libusb0: add compatibility define for transfer type bulk 00/4700/3
authorAntonio Borneo <borneo.antonio@gmail.com>
Mon, 8 Oct 2018 15:41:06 +0000 (17:41 +0200)
committerSpencer Oliver <spen@spen-soft.co.uk>
Tue, 11 Dec 2018 13:29:21 +0000 (13:29 +0000)
For compatibility with libusb1, define LIBUSB_TRANSFER_TYPE_BULK
in libusb0.
Remove the #ifdef HAVE_LIBUSB1 in jtag/driver/aice

This also fixes a compile error in jtag/drivers/openjtag with
libusb0.

Change-Id: I827b77eac10216759eb31aab461b2b63cabaf195
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4700
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/jtag/aice/aice_usb.c
src/jtag/drivers/libusb0_common.h

index d77b26b..f67ea7c 100644 (file)
@@ -2139,11 +2139,8 @@ static int aice_usb_open(struct aice_port_param_s *param)
 
        unsigned int aice_read_ep;
        unsigned int aice_write_ep;
-#ifdef HAVE_LIBUSB1
+
        jtag_libusb_choose_interface(devh, &aice_read_ep, &aice_write_ep, -1, -1, -1, LIBUSB_TRANSFER_TYPE_BULK);
-#else
-       jtag_libusb_choose_interface(devh, &aice_read_ep, &aice_write_ep, -1, -1, -1, USB_ENDPOINT_TYPE_BULK);
-#endif
        LOG_DEBUG("aice_read_ep=0x%x, aice_write_ep=0x%x", aice_read_ep, aice_write_ep);
 
        aice_handler.usb_read_ep = aice_read_ep;
index baa9e3c..676f43a 100644 (file)
@@ -38,6 +38,7 @@
 #define LIBUSB_RECIPIENT_DEVICE                        USB_RECIP_DEVICE
 #define LIBUSB_ENDPOINT_OUT                            USB_ENDPOINT_OUT
 #define LIBUSB_ENDPOINT_IN                             USB_ENDPOINT_IN
+#define LIBUSB_TRANSFER_TYPE_BULK              USB_ENDPOINT_TYPE_BULK
 
 static inline int jtag_libusb_claim_interface(jtag_libusb_device_handle *devh,
                                       int iface)