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 <alexander.pohoyda@gmx.net>
MFC after:	7 days
This commit is contained in:
Josef Karthauser 2003-07-14 17:46:27 +00:00
parent 1fd53fb949
commit 753bb32e49
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117564

View file

@ -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"));