From: Aurelien Jacobs Date: Sun, 6 Apr 2014 20:47:44 +0000 (+0200) Subject: scpi_usbtmc_libusb: disable all clear_halt for Rigol DS1000 X-Git-Tag: libsigrok-0.3.0~89 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f589a6d49971194737910faa11236012eed22c5a;p=libsigrok.git scpi_usbtmc_libusb: disable all clear_halt for Rigol DS1000 --- diff --git a/hardware/common/scpi_usbtmc_libusb.c b/hardware/common/scpi_usbtmc_libusb.c index f6c18d93..c814ba16 100644 --- a/hardware/common/scpi_usbtmc_libusb.c +++ b/hardware/common/scpi_usbtmc_libusb.c @@ -270,12 +270,12 @@ static int scpi_usbtmc_libusb_open(void *priv) return SR_ERR; } + if (!uscpi->rigol_ds1000) { 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)); 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)); @@ -286,6 +286,7 @@ static int scpi_usbtmc_libusb_open(void *priv) uscpi->interrupt_ep, libusb_error_name(ret)); return SR_ERR; } + } /* Get capabilities. */ ret = libusb_control_transfer(usb->devhdl, @@ -528,16 +529,17 @@ static int scpi_usbtmc_libusb_close(void *priv) if (!usb->devhdl) return SR_ERR; + if (!uscpi->rigol_ds1000) { 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)); if ((ret = libusb_clear_halt(usb->devhdl, uscpi->interrupt_ep)) < 0) sr_err("Failed to clear halt/stall condition for EP %d: %s.", uscpi->interrupt_ep, libusb_error_name(ret)); + } if ((ret = libusb_release_interface(usb->devhdl, uscpi->interface)) < 0) sr_err("Failed to release interface: %s.",