[LinuxPPS] Question about PPS line discipline.

Cirilo Bernardo cirilo.bernardo at gmail.com
Fri Jun 13 02:58:30 CEST 2008


On Fri, Jun 13, 2008 at 12:32 AM,  <clemens at dwf.com> wrote:
> I asked several questions in my previous note, and this one seems to
> have got lost in the shuffel.
>
> The question is, NORMALLY when you are setting a line discipline, you are doing
> it for the device mentioned in the ioctl, viz
>
>        ttyctrl <options> <device>
>
> With linuxPPS, you specify the serial device, but set the PPS device.
>
>>> Does anything happen to the serial device?
> Does it get set away from N_TTY?
>
>

N_TTY is a line discipline so yes, N_TTY is replaced.  That is why I
suggested checking the pps line discipline code and to ensure that the
appropriate IOCTL functions are correctly passed onto the
n_tty_ioctl() functions for processing.

What happens with the current incarnation of the driver is that the
timestamp of the PPS IRQ is recorded.  As data comes in on the serial
line, it is buffered and passed onto the line discipline (for
filtering etc). If I am not mistaken, the ldisc is scheduled to do the
processing via a tasklet (presumably to reduce time spent in the
interrupt service routine). In this case the line discipline will also
check the timestamp associated with the PPS IRQ. As read() is called
on the device, the requests are actually passed onto the line
discipline's read routines. The same is true for write() if the line
discipline supports write operations, which I believe it should - but
I can't speak for pps ldisc because I haven't reviewed the code yet; I
can only comment on how things are supposed to run based on the design
of the kernel's serial code and line disciplines.

- Cirilo



More information about the LinuxPPS mailing list