From 917f89df7f2cb23b9fb4793891c049c44271a7e9 Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 14 Jul 2003 17:46:27 +0000 Subject: [PATCH] As defined by USB Specification Rev 2.0 (in section 11.24.2.5), to get a Hub descriptor, we have to set req.wValue to "Descriptor Type and Descriptor Index". In this case, Descriptor Type is 0x29 (UDESC_HUB), Descriptor Index should be 0. If I don't do a check (dev->address > 1 ... ), root hub fails. A new Cytronix 4-port USB 2.0 Hub (Cypress CY7C65640 chip) now works after this patch. Submitted by: Alexander Pohoyda MFC after: 7 days --- sys/dev/usb/uhub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 0d97de8ab80d..f1eb05a5340f 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -194,7 +194,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, (dev->address > 1 ? UDESC_HUB : 0), 0); USETW(req.wIndex, 0); USETW(req.wLength, USB_HUB_DESCRIPTOR_SIZE); DPRINTFN(1,("usb_init_hub: getting hub descriptor\n"));