From af8058cc56dbd362e1a74dc70aa93d1902ff1760 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Sun, 21 Jul 2024 17:22:47 +0200 Subject: usb: Check for High-Speed configuration Signed-off-by: Paul Kocialkowski --- src/usb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/usb.c b/src/usb.c index 7b2397a..0871868 100644 --- a/src/usb.c +++ b/src/usb.c @@ -31,6 +31,7 @@ int usb_open(struct context *context, struct omap_description **descriptions, si struct libusb_device_handle *handle = NULL; struct libusb_device_descriptor descriptor; int configuration; + int speed; char device_name[32]; size_t count; size_t i; @@ -66,6 +67,12 @@ int usb_open(struct context *context, struct omap_description **descriptions, si for (j = 0; j < descriptions_count; j++) { for (k = 0; k < descriptions[j]->usb_device_ids_count; k++) { if (descriptions[j]->usb_device_ids[k].vendor_id == descriptor.idVendor && descriptions[j]->usb_device_ids[k].product_id == descriptor.idProduct) { + speed = libusb_get_device_speed(list[i]); + if (speed != LIBUSB_SPEED_HIGH) { + fprintf(stderr, "Configuring High-Speed failed\n"); + goto error; + } + rc = libusb_open(list[i], &handle); if (rc < 0) { fprintf(stderr, "Opening USB device failed\n"); -- cgit v1.2.3