Re: [PATCH 05/10] ldisc: new dcd_change() method for line disciplines.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rodolfo Giometti
Date: Wednesday, August 20, 2008 - 1:53 am

On Wed, Aug 20, 2008 at 01:05:23AM +0200, Rodolfo Giometti wrote:


After sleeping this night :) I think is better defing the
uart_handle_dcd_change() into serial_core.h as follow:

uart_handle_dcd_change(struct uart_port *port, unsigned int status)
{
        struct uart_info *info = port->info;
        struct tty_ldisc *ld = tty_ldisc_ref(info->port.tty);
        struct timespec ts;

        if (ld->ops->dcd_change)
#ifdef CONFIG_PPS_IRQ_EVENTS
                ts = pps_irq_ts[port->irq];
#else
                getnstimeofday(&ts);
#endif

        port->icount.dcd++;
#ifdef CONFIG_HARD_PPS
        if ((port->flags & UPF_HARDPPS_CD) && status)
                hardpps();
#endif

        if (info->flags & UIF_CHECK_CD) {
                if (status)
                        wake_up_interruptible(&info->port.open_wait);
                else if (info->port.tty)
                        tty_hangup(info->port.tty);
        }

        if (ld->ops->dcd_change)
                ld->ops->dcd_change(info->port.tty, status, &ts);
        tty_ldisc_deref(ld);
}

This completely hides the (dirty) trick to the PPS clients and allow
using struct tty_struct as first parameter.

Is that acceptable?

Rodolfo

-- 

GNU/Linux Solutions                  e-mail: giometti@enneenne.com
Linux Device Driver                          giometti@linux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
LinuxPPS (RESUBMIT 6): the PPS Linux implementation., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 01/10] LinuxPPS core support., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 02/10] PPS: userland header file for PPS API., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 03/10] PPS: documentation programs and examples., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 04/10] PPS: LinuxPPS clients support., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 06/10] ldisc n_tty: export all N_TTY ldisc methods., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 07/10] tty: new PPS line discipline., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
[PATCH 08/10] PPS: serial clients support., Rodolfo Giometti, (Tue Aug 19, 2:50 pm)
Re: [PATCH 07/10] tty: new PPS line discipline., Alan Cox, (Tue Aug 19, 2:54 pm)
Re: [PATCH 08/10] PPS: serial clients support., Alan Cox, (Tue Aug 19, 2:56 pm)
Re: [PATCH 05/10] ldisc: new dcd_change() method for line ..., Rodolfo Giometti, (Tue Aug 19, 3:49 pm)
Re: [PATCH 05/10] ldisc: new dcd_change() method for line ..., Rodolfo Giometti, (Tue Aug 19, 4:05 pm)
Re: [PATCH 01/10] LinuxPPS core support., H. Peter Anvin, (Tue Aug 19, 4:22 pm)
Re: [PATCH 05/10] ldisc: new dcd_change() method for line ..., Rodolfo Giometti, (Wed Aug 20, 1:53 am)
Re: [PATCH 01/10] LinuxPPS core support., Rodolfo Giometti, (Wed Aug 20, 2:13 am)
Re: [PATCH 05/10] ldisc: new dcd_change() method for line ..., Rodolfo Giometti, (Wed Aug 20, 6:01 am)
Re: [PATCH 05/10] ldisc: new dcd_change() method for line ..., Rodolfo Giometti, (Wed Aug 20, 7:05 am)