[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uplcom(4) flow contrl bug



If you have any USB to serial adapters using a chipset supported
by uplcom(4) then please test out the following patch..


Back out the "it is not completely clear" part of revision 1.18 - it
effectively swapped RTS and DTR, apparently on all versions of the chip.

>From NetBSD


Index: uplcom.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uplcom.c,v
retrieving revision 1.26
diff -u -p -r1.26 uplcom.c
--- uplcom.c	7 Feb 2006 23:35:11 -0000	1.26
+++ uplcom.c	7 Feb 2006 23:38:58 -0000
@@ -88,15 +88,6 @@ int	uplcomdebug = 0;
 #define RSAQ_STATUS_DSR		0x02
 #define RSAQ_STATUS_DCD		0x01
 
-#define UPLCOM_FLOW_OUT_CTS	0x0001
-#define UPLCOM_FLOW_OUT_DSR	0x0002
-#define UPLCOM_FLOW_IN_DSR	0x0004
-#define UPLCOM_FLOW_IN_DTR	0x0008
-#define UPLCOM_FLOW_IN_RTS	0x0010
-#define UPLCOM_FLOW_OUT_RTS	0x0020
-#define UPLCOM_FLOW_OUT_XON	0x0080
-#define UPLCOM_FLOW_IN_XON	0x0100
-
 struct	uplcom_softc {
 	USBBASEDEVICE		sc_dev;		/* base device */
 	usbd_device_handle	sc_udev;	/* USB device */
@@ -489,8 +480,8 @@ uplcom_set_line_state(struct uplcom_soft
 	if (sc->sc_rts == -1)
 		sc->sc_rts = 0;
 
-	ls = (sc->sc_dtr ? UPLCOM_FLOW_OUT_DSR : 0) |
-	    (sc->sc_rts ? UPLCOM_FLOW_OUT_CTS : 0);
+	ls = (sc->sc_dtr ? UCDC_LINE_DTR : 0) |
+	    (sc->sc_rts ? UCDC_LINE_RTS : 0);
 
 	req.bmRequestType = UT_WRITE_CLASS_INTERFACE;
 	req.bRequest = UCDC_SET_CONTROL_LINE_STATE;



Visit your host, monkey.org