lkml.org 
[lkml]   [2008]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: LinuxPPS low-level IRQs timestamps & ldisc
> First I added a new dcd_change() ldisc method which can be used as
> follow:

This looks good.
>
> static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status)
> {
> int id = (int) tty->disc_data;
> struct timespec __ts;
> struct pps_ktime ts;
>
> /* First of all we get the time stamp... */
> getnstimeofday(&__ts);
>
> /* ... and translate it to PPS time data struct */
> ts.sec = __ts.tv_sec;
> ts.nsec = __ts.tv_nsec;
>
> /* Now do the PPS event report */
> pps_event(id, &ts,
> status ? PPS_CAPTUREASSERT : PPS_CAPTURECLEAR, tty);
>
> pr_debug("[STDev] PPS %s at %lu on source #%d\n",
> status ? "assert" : "clear", jiffies, id);
> }
>
> However this solution gives very low precision timestamps so that's

Where are you calling it from, and how ?

> 2) The new dcd_change() method is well implemented? Can I add the
> "irq" parameter or I can find it somewhere?

Not all tty devices have an IRQ (I suspect those which do not are useless
for PPS reporting however).

Do you get decent reports if you change the tty driver to do

getnstimeofday(&ts);
[blah blah lots of serial port I/O code]
if (dcd ^ old_dcd)
ld->dcd_change(tty, dcd, &ts);

??

Alan


\
 
 \ /
  Last update: 2008-06-02 09:09    [W:0.063 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site