summaryrefslogtreecommitdiffstats
path: root/firmware/usbstack
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2013-11-26 22:03:20 +0100
committerFrank Gevaerts <frank@gevaerts.be>2014-02-09 20:39:18 +0100
commitbde5394f5a4cc40478f28911cdcde6cec85f1b6d (patch)
tree751499deb477b44e0ceaa389e6ab57bbeb40cd34 /firmware/usbstack
parentf723ca58055a6acc7c4c2e8eff8709bd8fdc32b1 (diff)
downloadrockbox-bde5394f5a4cc40478f28911cdcde6cec85f1b6d.tar.gz
rockbox-bde5394f5a4cc40478f28911cdcde6cec85f1b6d.tar.bz2
rockbox-bde5394f5a4cc40478f28911cdcde6cec85f1b6d.zip
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>
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index e4ecc90e63..dc69628c13 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -643,6 +643,13 @@ static void request_handler_device_get_descriptor(struct usb_ctrlrequest* req)
size = usb_strings[index]->bLength;
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 {
logf("bad string id %d", index);
usb_drv_stall(EP_CONTROL, true, true);