lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 Aug 2008 10:53:03 +0200
From:	Rodolfo Giometti <giometti@...eenne.com>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Woodhouse <dwmw2@...radead.org>,
	Dave Jones <davej@...hat.com>, Sam Ravnborg <sam@...nborg.org>,
	Greg KH <greg@...ah.com>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Kay Sievers <kay.sievers@...y.org>
Subject: Re: [PATCH 05/10] ldisc: new dcd_change() method for line
	disciplines.

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

> Maybe I can solve the problem defining dcd_change() as follow:
> 
>    void (*dcd_change)(struct tty_struct *tty, unsigned int status,
>                         void *data)
> 
> and then passing the timestamp or struct uart_port pointer?

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@...eenne.com
Linux Device Driver                          giometti@...ux.it
Embedded Systems                     phone:  +39 349 2432127
UNIX programming                     skype:  rodolfo.giometti
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ