Hello, this patch is a small fix to acm.c CLOCAL handling.

It sets the clocal member to unsigned int instead of unsigned
char becase CLOCAL in <bits/termios.h> exceeds the size of 8-bits.
This patch renables the "hangup if not CLOCAL" code and
minicom now works again. With this patch if CLOCAL is not set read() returns
0 on lost of carrier and if CLOCAL is set read() continues to block or returns
the number of chars read.
I believe this behaviour more closely mimics the serial driver.

This patch is against v0.18 in the 2.4.2 code tree.


--- acm.c.orig  Thu Mar 29 15:49:50 2001
+++ acm.c       Thu Mar 29 15:50:13 2001
@@ -141,7 +141,7 @@
        unsigned int used;                              /* someone has this acm's 
device open */
        unsigned int minor;                             /* acm minor number */
        unsigned char throttle;                         /* throttled by tty layer */
-       unsigned char clocal;                           /* termios CLOCAL */
+       unsigned int clocal;                            /* termios CLOCAL */
 };
 
 static struct usb_driver acm_driver;
@@ -195,7 +195,7 @@
 
                        newctrl = le16_to_cpup((__u16 *) data);
 
-#if 0
+#if 1
                        /* Please someone tell me how to do this properly to kill pppd 
and not kill minicom */
                        if (acm->tty && !acm->clocal && (acm->ctrlin & ~newctrl & 
ACM_CTRL_DCD)) {
                                dbg("calling hangup");


-- 

Chan Shih-Ping (Richard) <[EMAIL PROTECTED]>
DSO National Laboratories
20 Science Park Drive
Singapore 118230

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
http://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to