From bde5394f5a4cc40478f28911cdcde6cec85f1b6d Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Tue, 26 Nov 2013 22:03:20 +0100 Subject: 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 Tested: Frank Gevaerts --- firmware/usbstack/usb_core.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'firmware/usbstack') 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); -- cgit v1.2.3