lkml.org 
[lkml]   [2004]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Correctly flush 8250 buffers, notify ldisc of line status changes.
From
Date
On Maw, 2004-11-09 at 11:07, David Woodhouse wrote:
> + * tty_status_change - notify of line status changes
> + * @tty: terminal
> + *
> + * Helper for informing the line discipline that the modem
> + * status lines may have changed.
> + */
> +
> +void tty_status_changed(struct tty_struct *tty)
> +{
> + struct tty_ldisc *ld = tty_ldisc_ref(tty);
> + if(ld) {
> + if(ld->status_changed)
> + ld->status_changed(tty);
> + tty_ldisc_deref(ld);
> + }
> +}
> +

This is the wrong way to do it. I've been trying this and discarded it.
The problem is that data arrival is asynchronous to the event which
means you've not got a clue how to combine the status change and the
data stream. This in itself makes the whole feature useless.

Modem changes have to go inline with the data just like break and
parity.

> + *
> + * void (*status_changed)(struct tty_struct *)
> + *
> + * Called when the modem status lines (CTS, DSR, DCD etc.) are
> + * changed. May not sleep.
> */

You also forgot to update the Documentation directory.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.046 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site