Return a valid USB string descriptor for index 0xEE.

Windows will try to retrieve such a descriptor on first connect.
If the device returns STALL or a regular string descriptor (i.e.
not one that follows the Microsoft OS Descriptor spec), things
will continue normally.

Unfortunately some of our low-level USB drivers have issues with
STALL so any other valid descriptor is the next best solution.

Change-Id: I59eb09eea157e4e14bec0197a898be378a5559f2
Reviewed-on: http://gerrit.rockbox.org/680
Reviewed-by: Frank Gevaerts <frank@gevaerts.be>
Tested: Frank Gevaerts <frank@gevaerts.be>
This commit is contained in:
Frank Gevaerts 2013-11-26 22:03:20 +01:00
parent f723ca5805
commit bde5394f5a

View file

@ -643,6 +643,13 @@ static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
size = usb_strings[index]->bLength; size = usb_strings[index]->bLength;
ptr = usb_strings[index]; ptr = usb_strings[index];
} }
else if(index == 0xee) {
// We don't have a real OS descriptor, and we don't handle
// STALL correctly on some devices, so we return any valid
// string (we arbitrarily pick the manufacturer name)
size = usb_string_iManufacturer.bLength;
ptr = &usb_string_iManufacturer;
}
else { else {
logf("bad string id %d", index); logf("bad string id %d", index);
usb_drv_stall(EP_CONTROL, true, true); usb_drv_stall(EP_CONTROL, true, true);