X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/blobdiff_plain/cf55ed64bbf7e7fea836434378d1590f667ff21f..74ed4fbde86ab4aaa5e3480d66b510b771c7bd1e:/usb-driver.c diff --git a/usb-driver.c b/usb-driver.c index a0524bf..1162d51 100644 --- a/usb-driver.c +++ b/usb-driver.c @@ -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; @@ -851,8 +858,10 @@ int close(int fd) { 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;