diff options
author | Elliott Hughes <enh@google.com> | 2014-12-08 22:35:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-12-08 22:35:41 +0000 |
commit | dbb7c46d686e55aabd52a8e4c5494768c8955a2f (patch) | |
tree | 0dd21a6faeb3fca211286b7f1452ee5dec200485 /adb | |
parent | a5e9b065efcd2ee91a7a9bee4a44d85c5d30cf13 (diff) | |
parent | 58b01e01875e2f6ae593ded197430bc23713dd0a (diff) | |
download | system_core-dbb7c46d686e55aabd52a8e4c5494768c8955a2f.zip system_core-dbb7c46d686e55aabd52a8e4c5494768c8955a2f.tar.gz system_core-dbb7c46d686e55aabd52a8e4c5494768c8955a2f.tar.bz2 |
Merge "ADB on linux: Handle USB SuperSpeed extra Descriptors"
Diffstat (limited to 'adb')
-rw-r--r-- | adb/usb_linux.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/adb/usb_linux.c b/adb/usb_linux.c index f16bdd0..7d13a5d 100644 --- a/adb/usb_linux.c +++ b/adb/usb_linux.c @@ -237,8 +237,20 @@ static void find_usb_device(const char *base, // looks like ADB... ep1 = (struct usb_endpoint_descriptor *)bufptr; bufptr += USB_DT_ENDPOINT_SIZE; + // For USB 3.0 SuperSpeed devices, skip potential + // USB 3.0 SuperSpeed Endpoint Companion descriptor + if (bufptr+2 <= devdesc + desclength && + bufptr[0] == USB_DT_SS_EP_COMP_SIZE && + bufptr[1] == USB_DT_SS_ENDPOINT_COMP) { + bufptr += USB_DT_SS_EP_COMP_SIZE; + } ep2 = (struct usb_endpoint_descriptor *)bufptr; bufptr += USB_DT_ENDPOINT_SIZE; + if (bufptr+2 <= devdesc + desclength && + bufptr[0] == USB_DT_SS_EP_COMP_SIZE && + bufptr[1] == USB_DT_SS_ENDPOINT_COMP) { + bufptr += USB_DT_SS_EP_COMP_SIZE; + } if (bufptr > devdesc + desclength || ep1->bLength != USB_DT_ENDPOINT_SIZE || |