aboutsummaryrefslogtreecommitdiff
path: root/src/jtag/aice
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2014-10-01 10:36:02 +0400
committerSpencer Oliver <spen@spen-soft.co.uk>2014-10-06 18:40:39 +0000
commit487c57d9a27244b6a916cce253d8aaaec5e22604 (patch)
tree415a362429677abc7046a654da2bd08c1a902841 /src/jtag/aice
parentb631e78b25433712b4ffd03e1bc4b34a03da4f10 (diff)
downloadriscv-openocd-487c57d9a27244b6a916cce253d8aaaec5e22604.zip
riscv-openocd-487c57d9a27244b6a916cce253d8aaaec5e22604.tar.gz
riscv-openocd-487c57d9a27244b6a916cce253d8aaaec5e22604.tar.bz2
libusb: introduce jtag_libusb_choose_interface() and use it for JLink
This introduces a new common function that allows auto-discovery of a suitable USB interface based on class, subclass and protocol matching. It claims the interface and returns the corresponding endpoints number to the caller. The need for this arised due to nRF51822 USB dongle which comes with an "on-board Segger J-link debugger" having 3 interfaces, so the current code can't work at all with it (in this particular case the last interface needs to be choosen). This also removes special handling of JLink-OB endpoint numbers as it's now possible to autodetect them as well as the standard JLink endpoints. Change-Id: I4d990a7a3b373efdd2949a394b32d855a168e138 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2327 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/jtag/aice')
-rw-r--r--src/jtag/aice/aice_usb.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/jtag/aice/aice_usb.c b/src/jtag/aice/aice_usb.c
index d933845..50b3b9a 100644
--- a/src/jtag/aice/aice_usb.c
+++ b/src/jtag/aice/aice_usb.c
@@ -2136,13 +2136,11 @@ static int aice_usb_open(struct aice_port_param_s *param)
#endif
/* usb_set_configuration required under win32 */
- struct jtag_libusb_device *udev = jtag_libusb_get_device(devh);
jtag_libusb_set_configuration(devh, 0);
- jtag_libusb_claim_interface(devh, 0);
unsigned int aice_read_ep;
unsigned int aice_write_ep;
- jtag_libusb_get_endpoints(udev, &aice_read_ep, &aice_write_ep);
+ jtag_libusb_choose_interface(devh, &aice_read_ep, &aice_write_ep, -1, -1, -1);
aice_handler.usb_read_ep = aice_read_ep;
aice_handler.usb_write_ep = aice_write_ep;