Merge "ADB on linux: Handle USB SuperSpeed extra Descriptors"
This commit is contained in:
commit
dbb7c46d68
1 changed files with 12 additions and 0 deletions
|
|
@ -237,8 +237,20 @@ static void find_usb_device(const char *base,
|
||||||
// looks like ADB...
|
// looks like ADB...
|
||||||
ep1 = (struct usb_endpoint_descriptor *)bufptr;
|
ep1 = (struct usb_endpoint_descriptor *)bufptr;
|
||||||
bufptr += USB_DT_ENDPOINT_SIZE;
|
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;
|
ep2 = (struct usb_endpoint_descriptor *)bufptr;
|
||||||
bufptr += USB_DT_ENDPOINT_SIZE;
|
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 ||
|
if (bufptr > devdesc + desclength ||
|
||||||
ep1->bLength != USB_DT_ENDPOINT_SIZE ||
|
ep1->bLength != USB_DT_ENDPOINT_SIZE ||
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue