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:
Tomas Vanek 2023-03-06 15:31:08 +01:00
parent c8f56b4f00
commit c7e0040689
2 changed files with 3 additions and 1 deletions

View File

@ -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[])
{
for (unsigned i = 0; vids[i]; i++) {

View File

@ -30,6 +30,8 @@
typedef char * (*adapter_get_alternate_serial_fn)(struct libusb_device_handle *device,
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[],
struct libusb_device_handle **out,
adapter_get_alternate_serial_fn adapter_get_alternate_serial);