X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fjtag%2Fdrivers%2Flibusb1_common.h;h=4ef6bf730d0faf14c4a62cd259f49f1ea6ebf85a;hp=a4447ca9baec3bb3103af8e421ed9ec9879d2cff;hb=487c57d9a27244b6a916cce253d8aaaec5e22604;hpb=7568a91c8e2398a113f0b40a2a24a1b91ed12c95 diff --git a/src/jtag/drivers/libusb1_common.h b/src/jtag/drivers/libusb1_common.h index a4447ca9ba..4ef6bf730d 100644 --- a/src/jtag/drivers/libusb1_common.h +++ b/src/jtag/drivers/libusb1_common.h @@ -60,9 +60,23 @@ int jtag_libusb_bulk_read(struct jtag_libusb_device_handle *dev, int ep, char *bytes, int size, int timeout); int jtag_libusb_set_configuration(jtag_libusb_device_handle *devh, int configuration); -int jtag_libusb_get_endpoints(struct jtag_libusb_device *udev, +/** + * Find the first interface optionally matching class, subclass and + * protocol and claim it. + * @param devh _libusb_ device handle. + * @param usb_read_ep A pointer to a variable where the _IN_ endpoint + * number will be stored. + * @param usb_write_ep A pointer to a variable where the _OUT_ endpoint + * number will be stored. + * @param bclass `bInterfaceClass` to match, or -1 to ignore this field. + * @param subclass `bInterfaceSubClass` to match, or -1 to ignore this field. + * @param protocol `bInterfaceProtocol` to match, or -1 to ignore this field. + * @returns Returns ERROR_OK on success, ERROR_FAIL otherwise. + */ +int jtag_libusb_choose_interface(struct jtag_libusb_device_handle *devh, unsigned int *usb_read_ep, - unsigned int *usb_write_ep); + unsigned int *usb_write_ep, + int bclass, int subclass, int protocol); int jtag_libusb_get_pid(struct jtag_libusb_device *dev, uint16_t *pid); #endif /* JTAG_USB_COMMON_H */