From: Rodolfo Giometti <giometti@enneenne.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
David Woodhouse <dwmw2@infradead.org>,
Dave Jones <davej@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
Greg KH <greg@kroah.com>, Randy Dunlap <randy.dunlap@oracle.com>,
Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH 05/10] ldisc: new dcd_change() method for line disciplines.
Date: Wed, 20 Aug 2008 10:53:03 +0200 [thread overview]
Message-ID: <20080820085303.GA17591@tekkaman> (raw)
In-Reply-To: <20080819230523.GJ21330@tekkaman>
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@enneenne.com
Linux Device Driver giometti@linux.it
Embedded Systems phone: +39 349 2432127
UNIX programming skype: rodolfo.giometti
next prev parent reply other threads:[~2008-08-20 8:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-19 21:50 LinuxPPS (RESUBMIT 6): the PPS Linux implementation Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 01/10] LinuxPPS core support Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 02/10] PPS: userland header file for PPS API Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 03/10] PPS: documentation programs and examples Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 04/10] PPS: LinuxPPS clients support Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 05/10] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 06/10] ldisc n_tty: export all N_TTY ldisc methods Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 07/10] tty: new PPS line discipline Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 08/10] PPS: serial clients support Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 09/10] PPS: low level IRQ timestamps recording Rodolfo Giometti
2008-08-19 21:50 ` [PATCH 10/10] PPS: parallel port clients support Rodolfo Giometti
2008-08-20 10:31 ` [PATCH 09/10] PPS: low level IRQ timestamps recording Ingo Molnar
2008-08-19 21:56 ` [PATCH 08/10] PPS: serial clients support Alan Cox
2008-08-19 21:54 ` [PATCH 07/10] tty: new PPS line discipline Alan Cox
2008-08-19 21:58 ` [PATCH 06/10] ldisc n_tty: export all N_TTY ldisc methods Alan Cox
2008-08-19 21:53 ` [PATCH 05/10] ldisc: new dcd_change() method for line disciplines Alan Cox
2008-08-19 22:49 ` Rodolfo Giometti
2008-08-19 22:38 ` Alan Cox
2008-08-19 23:05 ` Rodolfo Giometti
2008-08-20 8:53 ` Rodolfo Giometti [this message]
2008-08-20 10:11 ` Alan Cox
2008-08-20 13:01 ` Rodolfo Giometti
2008-08-20 13:48 ` Ingo Molnar
2008-08-20 14:05 ` Rodolfo Giometti
2008-08-19 23:22 ` [PATCH 01/10] LinuxPPS core support H. Peter Anvin
2008-08-20 9:13 ` Rodolfo Giometti
-- strict thread matches above, loose matches on Subject: below --
2008-08-20 13:16 LinuxPPS (RESUBMIT 7): the PPS Linux implementation Rodolfo Giometti
2008-08-20 13:16 ` [PATCH 01/10] LinuxPPS core support Rodolfo Giometti
2008-08-20 13:16 ` [PATCH 02/10] PPS: userland header file for PPS API Rodolfo Giometti
2008-08-20 13:16 ` [PATCH 03/10] PPS: documentation programs and examples Rodolfo Giometti
2008-08-20 13:16 ` [PATCH 04/10] PPS: LinuxPPS clients support Rodolfo Giometti
2008-08-20 13:16 ` [PATCH 05/10] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2008-09-10 7:52 LinuxPPS (RESUBMIT 7): the PPS Linux implementation Rodolfo Giometti
2008-09-10 7:52 ` [PATCH 01/10] LinuxPPS core support Rodolfo Giometti
2008-09-10 7:52 ` [PATCH 02/10] PPS: userland header file for PPS API Rodolfo Giometti
2008-09-10 7:52 ` [PATCH 03/10] PPS: documentation programs and examples Rodolfo Giometti
2008-09-10 7:52 ` [PATCH 04/10] PPS: LinuxPPS clients support Rodolfo Giometti
2008-09-10 7:52 ` [PATCH 05/10] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2008-10-02 7:41 LinuxPPS (RESUBMIT 7): the PPS Linux implementation Rodolfo Giometti
2008-10-02 7:41 ` [PATCH 01/10] LinuxPPS core support Rodolfo Giometti
2008-10-02 7:41 ` [PATCH 02/10] PPS: userland header file for PPS API Rodolfo Giometti
2008-10-02 7:41 ` [PATCH 03/10] PPS: documentation programs and examples Rodolfo Giometti
2008-10-02 7:41 ` [PATCH 04/10] PPS: LinuxPPS clients support Rodolfo Giometti
2008-10-02 7:41 ` [PATCH 05/10] ldisc: new dcd_change() method for line disciplines Rodolfo Giometti
2008-10-02 15:25 ` H. Peter Anvin
2008-10-02 15:58 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080820085303.GA17591@tekkaman \
--to=giometti@enneenne.com \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davej@redhat.com \
--cc=dwmw2@infradead.org \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox