[LinuxPPS] 17Jun Patch

Rodolfo Giometti giometti at enneenne.com
Wed Jun 18 12:51:52 CEST 2008


On Wed, Jun 18, 2008 at 05:17:50AM +0000, Cirilo Bernardo wrote:

> (3) The "somehow sees" is the PPS ldisc.   You can think of the line
> discipline as a filter applied to the incoming and outgoing data
> stream.  For example, with N_TTY you can switch off all filters (raw
> mode), you can turn on software handshaking, and you can activate
> character translations.  Ideally, the PPS ldisc will behave exactly
> like N_TTY except that when it sees a change in DCD it gets a
> timestamp and sends a notification to the pps core.  An additional
> constraint is that the device using the serial port may not use DCD.

Cirilo was right. In fact latest N_PPS ldisc definition is:

struct tty_ldisc pps_ldisc = {
       .magic          = PPS_TTY_MAGIC,
       .name           = "pps_tty",
       .dcd_change     = pps_tty_dcd_change,
       .open           = pps_tty_open,
       .close          = pps_tty_close,

       /* Now we should use N_TTY ldisc methods in order to have
        * normal tty behaviour
        */
       .flush_buffer   = n_tty_flush_buffer,
       .chars_in_buffer = n_tty_chars_in_buffer,
       .read           = n_tty_read,
       .write          = n_tty_write,
       .ioctl          = n_tty_ioctl,
       .set_termios    = n_tty_set_termios,
       .poll           = n_tty_poll,
       .receive_buf    = n_tty_receive_buf,
       .write_wakeup   = n_tty_write_wakeup
};

This should define a new ldisc (N_PPS) which should be the same as
N_TTY but with timestamp recording thanks to dcd_change() method.

Ciao,

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