[LinuxPPS] 17Jun Patch

Rodolfo Giometti giometti at enneenne.com
Wed Jun 25 11:08:54 CEST 2008


On Wed, Jun 25, 2008 at 10:06:52AM +0200, Udo van den Heuvel wrote:
> Rodolfo Giometti wrote:
> >> (with all due respect, I think we need a good explanation why things are
> >> designed as they are on Linux)
> > 
> > I think is better that we ask to the ntpd guys before Alan.
> > 
> > Udo, please, write to the NTPD guys explaining «the problem».
> 
> Please propose a text that I can use.
> Then I can look into this.

You simply should say that: during the Linux kernel inclusion process,
Alan Cox asked to us to modify the code in order to move PPS support
for serial devices into a line discipline. Then the activation code
should became something like this:

	ret = time_pps_create(pp->io.fd, &up->handle);
	if (ret < 0) {
#ifdef N_PPS
		/* Before trying the alternate device we
		 * should check for N_PPS ldisc on primary device.
		 */
		ldisc = N_PPS;
		ret = ioctl(pp->io.fd, TIOCSETD, &ldisc);
                if (ret < 0)
                        WARNING("unable to set line discipline\n");
#endif

		/* Now we can try the alternate PPS device */
		(void) sprintf(device, DEVICEPPS, unit);
		fd = open(device, O_RDWR);
		if (fd < 0)
			goto pps_error;
		ret = time_pps_create(fd, &up->handle);
		if (ret < 0)
			goto pps_error;
	}
	else (void) sprintf(device, DEVICE, unit); /* just rebuild device's name */

In a few words we need to add the code into #ifdef.

Thanks for your help,

Rodolfo

P.S. Please, let me know if you prefere I open this ML to non-members'
posts.

-- 

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