summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorYojiro Uo <yuo@cvs.openbsd.org>2008-07-02 15:12:19 +0000
committerYojiro Uo <yuo@cvs.openbsd.org>2008-07-02 15:12:19 +0000
commit3c56feb2b4ddf8f30afb1bbd4050a0cf5dde192e (patch)
treecff3050986051b8bfb7c96a3337fd8225f615ba0 /sys/dev/usb
parent9e5918d26446b4782a2006427f155b5c05bb80ae (diff)
As some modem devices in ubsa(4) are possible to be incompatible with
the native ubsa device, the patch notifies when it finds such a kind of device. ok jsg@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/ubsa.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c
index 4eb47e67ac2..0853623f836 100644
--- a/sys/dev/usb/ubsa.c
+++ b/sys/dev/usb/ubsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ubsa.c,v 1.34 2008/06/26 05:42:18 ray Exp $ */
+/* $OpenBSD: ubsa.c,v 1.35 2008/07/02 15:12:18 yuo Exp $ */
/* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
@@ -698,8 +698,10 @@ ubsa_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
{
struct ubsa_softc *sc = priv;
u_char *buf;
+ usb_cdc_notification_t *cdcbuf;
buf = sc->sc_intr_buf;
+ cdcbuf = (usb_cdc_notification_t *)sc->sc_intr_buf;
if (sc->sc_dying)
return;
@@ -713,6 +715,24 @@ ubsa_intr(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
return;
}
+#if 1 /* test */
+ if (cdcbuf->bmRequestType == UCDC_NOTIFICATION) {
+ printf("%s: this device is using CDC notify message in"
+ " intr pipe.\n"
+ "Please send your dmesg to <bugs@openbsd.org>, thanks.\n",
+ sc->sc_dev.dv_xname);
+ printf("%s: intr buffer 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
+ sc->sc_dev.dv_xname,
+ buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
+
+ /* check the buffer data */
+ if (cdcbuf->bNotification == UCDC_N_SERIAL_STATE)
+ printf("%s:notify serial state, len=%d, data=0x%02x\n",
+ sc->sc_dev.dv_xname,
+ cdcbuf->wLength, cdcbuf->data[0]);
+ }
+#endif
+
/* incidentally, Belkin adapter status bits match UART 16550 bits */
sc->sc_lsr = buf[2];
sc->sc_msr = buf[3];