summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBastian Krause <bst@pengutronix.de>2021-04-30 13:56:40 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-03 12:37:12 +0200
commitd873403324e570a7cee54db3bf233f2437a3a80b (patch)
tree7ba4f67bf59810b1f366e3166a652dec8162cb55 /scripts
parentbed436698993a6dad03002b76566282fc7b9aa28 (diff)
downloadbarebox-d873403324e570a7cee54db3bf233f2437a3a80b.tar.gz
barebox-d873403324e570a7cee54db3bf233f2437a3a80b.tar.xz
scripts: imx-usb-loader: print USB VID/PID of excluded devices
On hosts with multiple USB devices connected, multiple "excluded by device path option" messages can be observed. Add the USB VID/PID to these messages to give them some additional value. Signed-off-by: Bastian Krause <bst@pengutronix.de> Link: https://lore.barebox.org/20210430115640.21011-2-bst@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/imx/imx-usb-loader.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 6f9104e816..cff77f27f2 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -267,7 +267,8 @@ static void list_imx_device_types(void)
}
}
-static int device_location_equal(libusb_device *device, const char *location)
+static int device_location_equal(libusb_device *device, const char *location,
+ struct libusb_device_descriptor desc)
{
uint8_t port_path[MAX_USB_PORTS];
uint8_t dev_bus;
@@ -315,7 +316,8 @@ static int device_location_equal(libusb_device *device, const char *location)
if (path_step == path_len)
result = 1;
else if (verbose)
- fprintf(stderr, " excluded by device path option\n");
+ fprintf(stderr, "USB device [%04x:%04x] excluded by device path option\n",
+ desc.idVendor, desc.idProduct);
done:
free(loc);
@@ -343,7 +345,7 @@ static libusb_device *find_imx_dev(libusb_device **devs, const struct mach_id **
return NULL;
}
- if (location && !device_location_equal(dev, location)) {
+ if (location && !device_location_equal(dev, location, desc)) {
libusb_close(usb_dev_handle);
usb_dev_handle = NULL;
continue;