Module Name: src
Committed By: jakllsch
Date: Fri Dec 25 03:13:43 UTC 2009
Modified Files:
src/sys/dev/usb: uplcom.c
Log Message:
Implement monitoring of CTS and RI lines. Use UCDC_N_SERIAL_* instead
of RSAQ_STATUS_*, the Linux driver shows that with the exception of CTS,
the PL2303 uses USB CDC bits at byte offset 8 of the interrupt transfer.
To-Do: Handle the other bits, such as BREAK.
To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/uplcom.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/uplcom.c
diff -u src/sys/dev/usb/uplcom.c:1.69 src/sys/dev/usb/uplcom.c:1.70
--- src/sys/dev/usb/uplcom.c:1.69 Thu Nov 12 19:58:27 2009
+++ src/sys/dev/usb/uplcom.c Fri Dec 25 03:13:43 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: uplcom.c,v 1.69 2009/11/12 19:58:27 dyoung Exp $ */
+/* $NetBSD: uplcom.c,v 1.70 2009/12/25 03:13:43 jakllsch Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uplcom.c,v 1.69 2009/11/12 19:58:27 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uplcom.c,v 1.70 2009/12/25 03:13:43 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,8 +74,8 @@
#define UPLCOM_SET_REQUEST 0x01
#define UPLCOM_SET_CRTSCTS_0 0x41
#define UPLCOM_SET_CRTSCTS_HX 0x61
-#define RSAQ_STATUS_DSR 0x02
-#define RSAQ_STATUS_DCD 0x01
+
+#define UPLCOM_N_SERIAL_CTS 0x80
enum pl2303_type {
UPLCOM_TYPE_0, /* we use this for all non-HX variants */
@@ -842,9 +842,13 @@
sc->sc_lsr = sc->sc_msr = 0;
pstatus = buf[8];
- if (ISSET(pstatus, RSAQ_STATUS_DSR))
+ if (ISSET(pstatus, UPLCOM_N_SERIAL_CTS))
+ sc->sc_msr |= UMSR_CTS;
+ if (ISSET(pstatus, UCDC_N_SERIAL_RI))
+ sc->sc_msr |= UMSR_RI;
+ if (ISSET(pstatus, UCDC_N_SERIAL_DSR))
sc->sc_msr |= UMSR_DSR;
- if (ISSET(pstatus, RSAQ_STATUS_DCD))
+ if (ISSET(pstatus, UCDC_N_SERIAL_DCD))
sc->sc_msr |= UMSR_DCD;
ucom_status_change(device_private(sc->sc_subdev));
}