mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 04:54:26 +00:00
Differentiate libusb control transfer pipe errors from transfer errors since they're not fatal.
This commit is contained in:
parent
c7360dbe78
commit
29f5fc4888
@ -22,6 +22,10 @@
|
|||||||
(err) == LIBUSB_ERROR_PIPE || \
|
(err) == LIBUSB_ERROR_PIPE || \
|
||||||
(err) == LIBUSB_ERROR_OTHER)
|
(err) == LIBUSB_ERROR_OTHER)
|
||||||
|
|
||||||
|
#define NOCONTROLDEV(err) ((err) == LIBUSB_ERROR_NO_DEVICE || \
|
||||||
|
(err) == LIBUSB_ERROR_OTHER)
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_BFLSC
|
#ifdef USE_BFLSC
|
||||||
#define DRV_BFLSC 1
|
#define DRV_BFLSC 1
|
||||||
#endif
|
#endif
|
||||||
@ -2568,7 +2572,7 @@ int _usb_transfer(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRequest
|
|||||||
if (buf)
|
if (buf)
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
||||||
if (NODEV(err))
|
if (NOCONTROLDEV(err))
|
||||||
release_cgpu(cgpu);
|
release_cgpu(cgpu);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
@ -2614,7 +2618,7 @@ int _usb_transfer_read(struct cgpu_info *cgpu, uint8_t request_type, uint8_t bRe
|
|||||||
if (err > 0) {
|
if (err > 0) {
|
||||||
*amount = err;
|
*amount = err;
|
||||||
err = 0;
|
err = 0;
|
||||||
} else if (NODEV(err))
|
} else if (NOCONTROLDEV(err))
|
||||||
release_cgpu(cgpu);
|
release_cgpu(cgpu);
|
||||||
|
|
||||||
out_unlock:
|
out_unlock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user