summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2004-07-11 05:29:16 +0000
committerderaadt <deraadt@openbsd.org>2004-07-11 05:29:16 +0000
commitfb11a4d4a855705900cb57f49ec48de40081b29c (patch)
treea314a2cff866cf2364474054cd2012ab9b502053
parentprototypes; ok deraadt (diff)
downloadwireguard-openbsd-fb11a4d4a855705900cb57f49ec48de40081b29c.tar.xz
wireguard-openbsd-fb11a4d4a855705900cb57f49ec48de40081b29c.zip
from netbsd via loki@animata.net
uhub.c revision 1.65, ohci.c revision 1.146, uhci.c revision 1.177 Use the correct wValue to get hub desriptors. Also, make wValue checks of root hub codes less strict.
-rw-r--r--sys/dev/usb/ohci.c4
-rw-r--r--sys/dev/usb/uhci.c4
-rw-r--r--sys/dev/usb/uhub.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c
index f8468c54662..5c603779125 100644
--- a/sys/dev/usb/ohci.c
+++ b/sys/dev/usb/ohci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ohci.c,v 1.40 2004/07/10 12:59:57 ho Exp $ */
+/* $OpenBSD: ohci.c,v 1.41 2004/07/11 05:29:16 deraadt Exp $ */
/* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */
/* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */
@@ -2562,7 +2562,7 @@ ohci_root_ctrl_start(usbd_xfer_handle xfer)
}
break;
case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
+ if ((value & 0xff) != 0) {
err = USBD_IOERROR;
goto ret;
}
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 32b36c0f26e..5cca24f927a 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.31 2004/05/04 16:59:32 grange Exp $ */
+/* $OpenBSD: uhci.c,v 1.32 2004/07/11 05:29:16 deraadt Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -3304,7 +3304,7 @@ uhci_root_ctrl_start(usbd_xfer_handle xfer)
}
break;
case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE):
- if (value != 0) {
+ if ((value & 0xff) != 0) {
err = USBD_IOERROR;
goto ret;
}
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c
index 53dcaee6b50..21d2c47173a 100644
--- a/sys/dev/usb/uhub.c
+++ b/sys/dev/usb/uhub.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhub.c,v 1.24 2004/07/08 22:18:44 deraadt Exp $ */
+/* $OpenBSD: uhub.c,v 1.25 2004/07/11 05:29:16 deraadt Exp $ */
/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
@@ -181,7 +181,7 @@ USB_ATTACH(uhub)
/* Get hub descriptor. */
req.bmRequestType = UT_READ_CLASS_DEVICE;
req.bRequest = UR_GET_DESCRIPTOR;
- USETW(req.wValue, 0);
+ USETW2(req.wValue, UDESC_HUB, 0);
USETW(req.wIndex, 0);
USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE);
DPRINTFN(1,("usb_init_hub: getting hub descriptor\n"));