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
This commit is contained in:
Jack Pham 2014-12-05 12:11:20 -08:00
parent a48decd47b
commit 1c02213e89

View file

@ -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);