lkml.org 
[lkml]   [2008]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 72/80] tty: fix up gigaset a bit
> >  	/* prevent other callers from entering ldisc methods */
> > + /* FIXME: should use the tty state flags */
> > tty->disc_data = NULL;
> >
> > if (!cs->hw.ser)
>
> Do you know of an example line discipline that has got this right?
> My model for this code was drivers/net/ppp_async.c but now it seems
> that this was not as exemplary as I had hoped.

If you want to know if the tty has been closed for further I/O then you
can use test_bit(TTY_IO_ERROR, &tty->flags). This gets set at the right
points on close/hangup/etc.

> > @@ -680,6 +675,8 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
> > /*
> > * Poll on the tty.
> > * Unused, always return zero.
> > + *
> > + * FIXME: should probably return an exception - especially on hangup
> > */
> > static unsigned int
> > gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
>
> Looking around, I see that many LDs don't even provide a poll method.
> So I'm thinking of just dropping this one. Would that be ok?

PPP doesn't route characters via the tty interface while you seem to do
so for the AT emulation so you do need it. In the hangup case you want to
return an exception event too: probably you want

POLLIN|POLLOUT|POLLERR|POLLHUP|POLLRDNORM|POLLWRNORM

for that case.

Alan


\
 
 \ /
  Last update: 2008-10-17 13:43    [W:0.077 / U:37.468 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site