Skip to content

Commit

Permalink
fastboot: Support USB 3.x SuperSpeed devices on Linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jack Pham committed Dec 5, 2014
1 parent a48decd commit 1c02213
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fastboot/usb_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1c02213

Please sign in to comment.