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;
if (fd == windrvrfd && windrvrfd >= 0) {
DPRINTF("close windrvrfd\n");
- if (usb_devhandle)
+ if (usb_devhandle) {
+ usb_claim(0);
usb_close(usb_devhandle);
+ }
usb_devhandle = NULL;
usbinterface = -1;