diff options
author | Jack Pham <jackp@codeaurora.org> | 2014-12-05 12:11:20 -0800 |
---|---|---|
committer | Jack Pham <jackp@codeaurora.org> | 2014-12-05 12:11:20 -0800 |
commit | 1c02213e89f99c6f532b27048feb8f3170cac296 (patch) | |
tree | ff6ccdd1a4ade45871dcc76af18ba46c5fbcf8e0 | |
parent | a48decd47b6ef8559418c7d1a68739c5ef50aaf8 (diff) | |
download | system_core-1c02213e89f99c6f532b27048feb8f3170cac296.zip system_core-1c02213e89f99c6f532b27048feb8f3170cac296.tar.gz system_core-1c02213e89f99c6f532b27048feb8f3170cac296.tar.bz2 |
fastboot: Support USB 3.x SuperSpeed devices on Linux
When enumerating USB 3.x devices, an extra 6-byte SuperSpeed
companion descriptor follows each standard endpoint descriptor.
The loop parsing the descriptors will stumble if they're not
handled. Since they're not needed once the bulk endpoints are
identified, we can simply skip over them.
Change-Id: I7e73bcf9135f23c3059cd7c55b432557b28cb6ef
-rw-r--r-- | fastboot/usb_linux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c index fabbd51..022f364 100644 --- a/fastboot/usb_linux.c +++ b/fastboot/usb_linux.c @@ -223,6 +223,13 @@ static int filter_usb_device(char* sysfs_name, } else { out = ept->bEndpointAddress; } + + // For USB 3.0 devices skip the SS Endpoint Companion descriptor + if (check((struct usb_descriptor_hdr *)ptr, len, + USB_DT_SS_ENDPOINT_COMP, USB_DT_SS_EP_COMP_SIZE) == 0) { + len -= USB_DT_SS_EP_COMP_SIZE; + ptr += USB_DT_SS_EP_COMP_SIZE; + } } info.has_bulk_in = (in != -1); |