[LinuxPPS] Question about PPS line discipline.

Rodolfo Giometti giometti at enneenne.com
Fri Jun 13 09:40:54 CEST 2008


On Thu, Jun 12, 2008 at 06:32:08PM -0600, 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.

No, PPS line discipline creates /dev/pps{n} char devices just as PPP
line discipline creates ppp{n} net devices.

A line discipline is related to serial devices but once enabled it may
create other devices.

> >> Does anything happen to the serial device?
> Does it get set away from N_TTY?

Yes.

On Fri, Jun 13, 2008 at 12:58:30AM +0000, Cirilo Bernardo wrote:
> 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.

This function should not be useful to set device settings...

> 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.

Mmm... I suppose I need to add more methods to PPS ldisc... I supposed
that undefined functions were not used but reviewing the code I don't
think so. Need to study better...

Advices are welcomed! ;)

Thanks,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti at enneenne.com
Linux Device Driver                             giometti at linux.it
Embedded Systems                     phone:	+39 349 2432127
UNIX programming                     skype:     rodolfo.giometti



More information about the LinuxPPS mailing list