Browse Source

Different windows+usb combinations respond with varying levels of reliability wrt timeouts so use a nominal extra 40ms before cancelling transfers that fail to time out on their own.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
b1be5c6d12
  1. 8
      usbutils.c

8
usbutils.c

@ -66,6 +66,10 @@
#define KLONDIKE_TIMEOUT_MS 999 #define KLONDIKE_TIMEOUT_MS 999
#define ICARUS_TIMEOUT_MS 999 #define ICARUS_TIMEOUT_MS 999
#define HASHFAST_TIMEOUT_MS 999 #define HASHFAST_TIMEOUT_MS 999
/* The safety timeout we use, cancelling async transfers on windows that fail
* to timeout on their own. */
#define WIN_CALLBACK_EXTRA 40
#else #else
#define BFLSC_TIMEOUT_MS 300 #define BFLSC_TIMEOUT_MS 300
#define BITFORCE_TIMEOUT_MS 200 #define BITFORCE_TIMEOUT_MS 200
@ -77,8 +81,6 @@
#define HASHFAST_TIMEOUT_MS 200 #define HASHFAST_TIMEOUT_MS 200
#endif #endif
#define USB_READ_MINPOLL 40
#define USB_EPS(_intx, _epinfosx) { \ #define USB_EPS(_intx, _epinfosx) { \
.interface = _intx, \ .interface = _intx, \
.ctrl_transfer = _intx, \ .ctrl_transfer = _intx, \
@ -2424,7 +2426,7 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
#ifdef WIN32 #ifdef WIN32
/* On windows the callback_timeout is a safety mechanism only. */ /* On windows the callback_timeout is a safety mechanism only. */
bulk_timeout = timeout; bulk_timeout = timeout;
callback_timeout += timeout + cgpu->usbdev->found->timeout; callback_timeout += WIN_CALLBACK_EXTRA;
#else #else
/* We give the transfer no timeout since we manage timeouts ourself on /* We give the transfer no timeout since we manage timeouts ourself on
* non windows. */ * non windows. */

Loading…
Cancel
Save