mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Ignore preferred packet size.
This commit is contained in:
parent
0cceaccf75
commit
b5dfb8f03e
11
usbutils.c
11
usbutils.c
@ -2418,7 +2418,6 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
|
|||||||
struct usb_epinfo *usb_epinfo;
|
struct usb_epinfo *usb_epinfo;
|
||||||
struct usb_transfer ut;
|
struct usb_transfer ut;
|
||||||
unsigned char endpoint;
|
unsigned char endpoint;
|
||||||
uint16_t MaxPacketSize;
|
|
||||||
int err, errn;
|
int err, errn;
|
||||||
#if DO_USB_STATS
|
#if DO_USB_STATS
|
||||||
struct timeval tv_start, tv_finish;
|
struct timeval tv_start, tv_finish;
|
||||||
@ -2442,14 +2441,8 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo,
|
|||||||
if (unlikely(cgpu->shutdown))
|
if (unlikely(cgpu->shutdown))
|
||||||
return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout);
|
return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout);
|
||||||
|
|
||||||
/* Limit length of transfer to the largest this descriptor supports
|
if (length > usb_epinfo->wMaxPacketSize)
|
||||||
* and leave the higher level functions to transfer more if needed. */
|
length = usb_epinfo->wMaxPacketSize;
|
||||||
if (usb_epinfo->PrefPacketSize)
|
|
||||||
MaxPacketSize = usb_epinfo->PrefPacketSize;
|
|
||||||
else
|
|
||||||
MaxPacketSize = usb_epinfo->wMaxPacketSize;
|
|
||||||
if (length > MaxPacketSize)
|
|
||||||
length = MaxPacketSize;
|
|
||||||
if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
|
if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
|
||||||
memcpy(buf, data, length);
|
memcpy(buf, data, length);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user