fix usb_reset. sharing the cable between applications is still possible.
[usb-driver] / usb-driver.c
index a0524bf67d521ed5cc84a0aa5cf0f10267768936..942cdc15a01c8ed59a3d86eb12b26813b1d1799e 100644 (file)
@@ -450,8 +450,15 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
                                ret = (*ioctl_func) (fd, request, wdioctl);
 #else
                                if (usbdevice) {
-                                       if (!usb_devhandle)
+                                       if (!usb_devhandle) {
                                                usb_devhandle = usb_open(usbdevice);
+#ifndef NO_USB_RESET
+                                               if (usb_devhandle) {
+                                                       usb_reset(usb_devhandle);
+                                                       usb_devhandle = usb_open(usbdevice);
+                                               }
+#endif
+                                       }
 
                                        usbinterface = usbdevice->config[0].interface[usi->dwInterfaceNum].altsetting[usi->dwAlternateSetting].bInterfaceNumber;
                                        usbalternate = usi->dwAlternateSetting;
Impressum, Datenschutz