mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-24 01:08:32 +03:00
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:
@@ -2,6 +2,8 @@
|
||||
|
||||
#include <libusb.h>
|
||||
|
||||
#define USB_MAX_PATH_LEN 20
|
||||
|
||||
struct dev_id {
|
||||
uint16_t vendor_id;
|
||||
uint16_t product_id;
|
||||
@@ -21,6 +23,8 @@ struct usb_interface_match {
|
||||
uint16_t product;
|
||||
/* USB Bus Address */
|
||||
uint8_t addr;
|
||||
/* physical path */
|
||||
char path[USB_MAX_PATH_LEN];
|
||||
/* configuration of matching interface */
|
||||
uint8_t configuration;
|
||||
/* interface number of matching interface */
|
||||
|
||||
Reference in New Issue
Block a user