[LinuxPPS] LinuxPPS evolution.

Rodolfo Giometti giometti at enneenne.com
Tue Nov 13 14:10:37 CET 2007


On Mon, Nov 12, 2007 at 04:34:58PM -0700, clemens at dwf.com wrote:
> The LinuxPPS has evolved over the last year from something very
> different to the code in its present form.
> 
> I guess I have to ask the question why we have the /dev/pps<n> file
> at all in its current implementation.
> 
> It would seem that all the discussion that we have been having about
> parent/child files and opening this before you can do that, would
> just go away IF the ioctl that we currently do on the pps<n> file 
> was done on the 'parent' file instead.  The internal code could remain the
> same (almost) but the ioctl would be done on the parent rather than
> the child.
> 
> For things to work these two (parent / child) clearly know about one
> another so moving the ioctl to the other device (or adding a 2nd ioctl)
> would seem possible.

To do that you should modify _each_ parent device you planned to
use. This solution was implemented by PPSkit (only for some serial and
parallel ports) which has _never_ been accepted into Linux tree for
the reason above.

> And we would be back to an API that everyone understands, just one
> file for our standard case.  Whether the /dev/pps<n> files (and an ioctl
> there) would be useful for some of Rodolfo's strange devices is a question
> I can't answer).
> 
> Is this crazy or possible?

The problem is not into the API itself but in the fact that a device
(PPS) must be connected to another device (ttyS0, for instance). If
your PPS device is connected to a GPIOs or another independed device
the problem simply vanish.

The solution of using main and alternate device was suggested by NTPD
folks while the solution of using char devices for PPS sources was
suggested by both NTPD and kernel folks. :)

Ciao,

Rodolfo

-- 

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



More information about the LinuxPPS mailing list