Make the USB reset for USB TMC devices conditional. Check a whitelist,
which in this implementation exclusively contains the Siglent VID.
The whitelist's comment may need adjustment. The VID probably not only
applies to SDS devices, but could be used for SDG and others as well.
And lsusb output suggests the VID is used by Atten, too.
+/* Devices that shall get reset during open(). */
+static struct usbtmc_blacklist whitelist_usb_reset[] = {
+ { 0xf4ec, 0xffff }, /* All Siglent SDS devices */
+ ALL_ZERO
+};
+
static GSList *scpi_usbtmc_libusb_scan(struct drv_context *drvc)
{
struct libusb_device **devlist;
static GSList *scpi_usbtmc_libusb_scan(struct drv_context *drvc)
{
struct libusb_device **devlist;
int confidx, intfidx, epidx, config = 0, current_config;
uint8_t capabilities[24];
int ret, found = 0;
int confidx, intfidx, epidx, config = 0, current_config;
uint8_t capabilities[24];
int ret, found = 0;
if (usb->devhdl)
return SR_OK;
if (usb->devhdl)
return SR_OK;
- libusb_reset_device(usb->devhdl);
+ /* Optionally reset the USB device. */
+ do_reset = check_usbtmc_blacklist(whitelist_usb_reset,
+ des.idVendor, des.idProduct);
+ if (do_reset)
+ libusb_reset_device(usb->devhdl);
/* Get capabilities. */
ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |
/* Get capabilities. */
ret = libusb_control_transfer(usb->devhdl, LIBUSB_ENDPOINT_IN |