[LinuxPPS] Found it, problem with current PPS code.

Cirilo Bernardo cirilo.bernardo at gmail.com
Sat Jun 14 01:50:36 CEST 2008


On Sat, Jun 14, 2008 at 9:25 AM,  <clemens at dwf.com> wrote:
[snip]
> But I dont have a clue as to what line discipline is there (there must be a
> system call to tell you/ better yet a user callable program) or how to tell
> it the line speed and options (raw?) necessary.  It would seem better that
> the device REMAIN a TTY so we all know whats going on.
> --

man tty_ioctl

Of course the number assigned to the PPS ldisc is somewhat arbitrary.
Note that the NTPD code does not deal with line disciplines at all;
this is because some operating systems are not engineered that way and
even if other systems had Linux-like line disciplines, you can bet
that the number assigned to each line discipline would be different.
Short story: ldisc is non-portable, the ntp code only cares about the
portable part, which is using the tcget/set to flush the buffer, set
speeds, etc.

As I said before, the PPP line discipline just passes ioctls to
set/get the termios on to the n_tty_ioctl() routines - this is all we
need for the PPS ldisc to support changing speed, flushing buffers,
etc because all that code is already in the 8250 driver (and similar
drivers) and the n_tty_ioctl() takes care of invoking the correct
routines.  Well, it could be a wee bit more complex than that.  If you
look at the serial code, a lot of work is called by invoking routines
pointed to within pointers to structs ... it's what makes the whole
serial thing so flexible, but at times it also makes it difficult to
understand how things are accomplished.

- Cirilo



More information about the LinuxPPS mailing list