From: Aurelien Jacobs Date: Sat, 5 Apr 2014 23:31:12 +0000 (+0200) Subject: scpi_usbtmc_libusb: disable bulk_out clear_halt for Rigol DS1000 X-Git-Tag: libsigrok-0.3.0~90 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=50e6311a1b76ead9e082d99bdea91c1cba08fd4e;p=libsigrok.git scpi_usbtmc_libusb: disable bulk_out clear_halt for Rigol DS1000 fix hangup issue with Rigol firmware version 00.02.02.02.00 --- diff --git a/hardware/common/scpi_usbtmc_libusb.c b/hardware/common/scpi_usbtmc_libusb.c index 933ce83c..f6c18d93 100644 --- a/hardware/common/scpi_usbtmc_libusb.c +++ b/hardware/common/scpi_usbtmc_libusb.c @@ -43,6 +43,7 @@ struct scpi_usbtmc_libusb { int response_length; int response_bytes_read; int remaining_length; + int rigol_ds1000; }; /* Some USBTMC-specific enums, as defined in the USBTMC standard. */ @@ -234,6 +235,8 @@ static int scpi_usbtmc_libusb_open(void *priv) } } found = 1; + uscpi->rigol_ds1000 = des.idVendor == 0x1ab1 && + des.idProduct == 0x0588; } libusb_free_config_descriptor(confdes); if (found) @@ -272,6 +275,7 @@ static int scpi_usbtmc_libusb_open(void *priv) uscpi->bulk_in_ep, libusb_error_name(ret)); return SR_ERR; } + if (!uscpi->rigol_ds1000) if ((ret = libusb_clear_halt(usb->devhdl, uscpi->bulk_out_ep)) < 0) { sr_err("Failed to clear halt/stall condition for EP %d: %s.", uscpi->bulk_out_ep, libusb_error_name(ret)); @@ -527,6 +531,7 @@ static int scpi_usbtmc_libusb_close(void *priv) if ((ret = libusb_clear_halt(usb->devhdl, uscpi->bulk_in_ep)) < 0) sr_err("Failed to clear halt/stall condition for EP %d: %s.", uscpi->bulk_in_ep, libusb_error_name(ret)); + if (!uscpi->rigol_ds1000) if ((ret = libusb_clear_halt(usb->devhdl, uscpi->bulk_out_ep)) < 0) sr_err("Failed to clear halt/stall condition for EP %d: %s.", uscpi->bulk_out_ep, libusb_error_name(ret));