drivers/libusb_helper: allow external use of jtag_libusb_match_ids()
Can be employed by a driver with custom libusb open. Change-Id: I00c8a01df8780891a8b7c30e2e34ab191acdf9a8 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/7528 Tested-by: jenkins Reviewed-by: Wolfram Sang <wsa@kernel.org> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
c8f56b4f00
commit
c7e0040689
|
@ -50,7 +50,7 @@ static int jtag_libusb_error(int err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool jtag_libusb_match_ids(struct libusb_device_descriptor *dev_desc,
|
bool jtag_libusb_match_ids(struct libusb_device_descriptor *dev_desc,
|
||||||
const uint16_t vids[], const uint16_t pids[])
|
const uint16_t vids[], const uint16_t pids[])
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; vids[i]; i++) {
|
for (unsigned i = 0; vids[i]; i++) {
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
typedef char * (*adapter_get_alternate_serial_fn)(struct libusb_device_handle *device,
|
typedef char * (*adapter_get_alternate_serial_fn)(struct libusb_device_handle *device,
|
||||||
struct libusb_device_descriptor *dev_desc);
|
struct libusb_device_descriptor *dev_desc);
|
||||||
|
|
||||||
|
bool jtag_libusb_match_ids(struct libusb_device_descriptor *dev_desc,
|
||||||
|
const uint16_t vids[], const uint16_t pids[]);
|
||||||
int jtag_libusb_open(const uint16_t vids[], const uint16_t pids[],
|
int jtag_libusb_open(const uint16_t vids[], const uint16_t pids[],
|
||||||
struct libusb_device_handle **out,
|
struct libusb_device_handle **out,
|
||||||
adapter_get_alternate_serial_fn adapter_get_alternate_serial);
|
adapter_get_alternate_serial_fn adapter_get_alternate_serial);
|
||||||
|
|
Loading…
Reference in New Issue