[ntp:questions] Re: PPS API

Ulrich Windl Ulrich.Windl at RZ.Uni-Regensburg.DE
Mon May 9 12:33:47 UTC 2005


Rodolfo Giometti <giometti at linux.it> writes:

> Sorry for delay...
> 
> On Fri, Apr 08, 2005 at 02:39:55PM +0200, Ulrich Windl wrote:
> > What I undertstood is that this is simply still all in kernel space; right?
> > What should be the benefits from your point of view?
> 
> The benefits are:
> 
> * by using the netlink layer we can divide the PPSAPI from a
> particular driver (you don't need to modify the serial driver so
> heavy).

Did you inspect the Linux 2.6 version? There I put most of the code from the
serial driver to a new module "ppsapi" (to enable a second source, the
parallel port).

> 
> * the PPSAPI can be the same for all PPS source (currently in
> PPSkit-light-PPSAPI-alpha-1610m-2.6.5 there are duplicated functions
> whose do the same things: do_clock_gettime(), pps_update_event(),
> etc.)

pps_update_event is inlined and time-critical AFAIK. Low latency and low
jitter, please!

> 
> * by using the exported kernel symbols we can manage the PPS source
> with few and simple functions calls. For example, once you register a
> PPS source into the kernel with:
> 
>    static struct linuxpps_source_info_s linuxpps_ktimer_info = {
>       name		: "my PPS source",
>       mode		: PPS_CAPTUREASSERT|PPS_OFFSETASSERT|PPS_ECHOASSERT| \
> 		          PPS_CANWAIT|PPS_TSFMT_TSPEC,
>       echo 	        : linuxpps_ktimer_echo,
>    };
> 
>    ...
> 
>    source = linuxpps_register_source(&linuxpps_ktimer_info, ...);
> 
> you can signal an assert event (for example in the interrupt handler
> routine) just using:
> 
>    linuxpps_event(source, PPS_CAPTUREASSERT);
> 
> The same function may also runs the defined echo function
> (linuxpps_ktimer_echo()) if the user asked for that... etc.
> 
> I'm just working on it and I hope to be able to post some alpha
> version of my code as soon as possible, so you can see it and give me
> back some suggestions.

The last code I saw lacked the kc_bind functionality. Don't give us less, give
us more! ;-)

Regards,
Ulrich



More information about the questions mailing list