From: devet@adv.win.tue.nl (Arjan de Vet) Subject: [SERIAL] DTR patch for better modem hangup Date: 21 Feb 1993 10:40:23 GMT
In article <1993Feb18.012523.2116@tribiet.maintech.com>
carvalho@tribiet.maintech.com (Joseph D. Carvalho) writes:
>SLS v1.0.
>Linux 0.99pl5
>
>Kermit works fine. Dial-in works fine. If in the process of dialing out
>the connection is never completed, uucico times out but never drops dtr.
>I can also not keep the line set for crtscts. It keeps reverting back to
>-crtscts.
I also had problems with uucico not dropping DTR to hang up the modem after
uucico closes the serial device. The problem is that immediately after
closing the device the DTR goes indeed low but because there is a dial-in
getty process waiting DTR goes high immediately again: for my modem the
DTR-low time was too short to be recognized.
Here's the solution: when closing a serial device in presence of another
process on the same serial line (e.g., a getty for dial-in) make sure that
DTR drops for 2 seconds. You can notice this delay when you exit kermit for
example.
Patch to linux/kernel/chr_drv/serial.c:
=============================================================================
--- serial.c.org Wed Feb 10 02:00:37 1993
+++ serial.c Sat Feb 20 02:47:09 1993
@@ -523,6 +523,12 @@
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
if (info->blocked_open) {
shutdown(info);
+
+ /* Drop DTR for 2 seconds to hangup modem (AdV 930220) */
+ current->state = TASK_INTERRUPTIBLE;
+ current->timeout = jiffies + 200; /* 2 secs */
+ schedule();
+
startup(info);
wake_up_interruptible(&info->open_wait);
return;
=============================================================================
I've already submitted this simple patch to Ted and Linus for inclusion in
serial.c but haven't got a reaction yet.
Arjan