Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c02213e authored by Jack Pham's avatar Jack Pham
Browse files

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
parent a48decd4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);