lkml.org 
[lkml]   [2004]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: Linux v2.6.9 (Strange tty problem?)
From
Date
On Thu, 2004-10-21 at 04:07, Alan Cox wrote:
> introduced by the tty changes. I'll try and fix it ASAP if Paul doesn't
> beat me to it.

I reviewed, patched, and tested ppp_async.c to
implement ldisc->hangup(). This correctly terminates
the PPP connection on hangup.

Paul Mackerras already did an excellent job of
ensuring safe shutdown and I/O completion
in ldisc->close so the change is trivial:
just add the ldisc->hangup and call the
existing close routine.

One question to Alan: what is the return code
in ldisc->hangup for? The docs don't say.

--
Paul Fulghum
paulkf@microgate.com

--- linux-2.6.9-bk4/drivers/net/ppp_async.c 2004-10-18 16:54:40.000000000 -0500
+++ b/drivers/net/ppp_async.c 2004-10-21 12:50:50.000000000 -0500
@@ -238,6 +238,18 @@ ppp_asynctty_close(struct tty_struct *tt
}

/*
+ * Called on tty hangup in process context.
+ *
+ * Wait for I/O to driver to complete and unregister PPP channel.
+ * This is already done by the close routine, so just call that.
+ */
+static int ppp_asynctty_hangup(struct tty_struct *tty)
+{
+ ppp_asynctty_close(tty);
+ return 0;
+}
+
+/*
* Read does nothing - no data is ever available this way.
* Pppd reads and writes packets via /dev/ppp instead.
*/
@@ -380,6 +392,7 @@ static struct tty_ldisc ppp_ldisc = {
.name = "ppp",
.open = ppp_asynctty_open,
.close = ppp_asynctty_close,
+ .hangup = ppp_asynctty_hangup,
.read = ppp_asynctty_read,
.write = ppp_asynctty_write,
.ioctl = ppp_asynctty_ioctl,

-
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.141 / U:0.612 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site