host: Allow matching of device to USB path, not just address

USB addresses change every time the device re-enumerates, while the path
reflects the physical topology of USB connections and stays persistent
unless the usb cabling is changed.  Let's allow the user to specify the
path instead of the address to uniquely identify a given slot.
This commit is contained in:
Harald Welte
2017-05-11 01:31:45 +02:00
parent 37ad41e092
commit a601635885
4 changed files with 44 additions and 4 deletions

View File

@@ -41,8 +41,8 @@ static int find_devices(void)
libusb_device_handle *dev_handle;
char strbuf[256];
printf("\t%04x:%04x Addr=%u, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ",
m->vendor, m->product, m->addr,
printf("\t%04x:%04x Addr=%u, Path=%s, Cfg=%u, Intf=%u, Alt=%u: %d/%d/%d ",
m->vendor, m->product, m->addr, m->path,
m->configuration, m->interface, m->altsetting,
m->class, m->sub_class, m->protocol);