From 05069ebd4d5ec6fb63faf1fd7ff8daa108366581 Mon Sep 17 00:00:00 2001 From: toshii Date: Mon, 29 Dec 2003 08:17:10 +0000 Subject: [PATCH] Use the correct wValue to get hub desriptors. Also, make wValue checks of root hub codes less strict. --- sys/dev/usb/ehci.c | 6 +++--- sys/dev/usb/ohci.c | 6 +++--- sys/dev/usb/uhci.c | 6 +++--- sys/dev/usb/uhub.c | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 753a4af298f7..58b72f136094 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.50 2003/10/18 04:50:35 simonb Exp $ */ +/* $NetBSD: ehci.c,v 1.51 2003/12/29 08:17:10 toshii Exp $ */ /* * TODO @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.50 2003/10/18 04:50:35 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.51 2003/12/29 08:17:10 toshii Exp $"); #include "ohci.h" #include "uhci.h" @@ -1712,7 +1712,7 @@ ehci_root_ctrl_start(usbd_xfer_handle xfer) #endif 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/ohci.c b/sys/dev/usb/ohci.c index e6568d746eb4..cf5de8dd76d2 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci.c,v 1.145 2003/11/23 19:20:25 augustss Exp $ */ +/* $NetBSD: ohci.c,v 1.146 2003/12/29 08:17:10 toshii Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ /* @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.145 2003/11/23 19:20:25 augustss Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.146 2003/12/29 08:17:10 toshii Exp $"); #include #include @@ -2551,7 +2551,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 1b2c57af8217..be58618ce571 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhci.c,v 1.176 2003/11/04 19:11:21 mycroft Exp $ */ +/* $NetBSD: uhci.c,v 1.177 2003/12/29 08:17:10 toshii Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ /* @@ -49,7 +49,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.176 2003/11/04 19:11:21 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.177 2003/12/29 08:17:10 toshii Exp $"); #include #include @@ -3312,7 +3312,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 579ea9c793b0..667687031bd9 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */ +/* $NetBSD: uhub.c,v 1.65 2003/12/29 08:17:11 toshii Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ /* @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.65 2003/12/29 08:17:11 toshii Exp $"); #include #include @@ -176,7 +176,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"));