From b5dfb8f03ef6b647bea244db8307a33f16ee5ea2 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 3 Nov 2013 20:15:41 +1100 Subject: [PATCH] Ignore preferred packet size. --- usbutils.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/usbutils.c b/usbutils.c index 583a7660..fa18523d 100644 --- a/usbutils.c +++ b/usbutils.c @@ -2418,7 +2418,6 @@ usb_bulk_transfer(struct libusb_device_handle *dev_handle, int intinfo, struct usb_epinfo *usb_epinfo; struct usb_transfer ut; unsigned char endpoint; - uint16_t MaxPacketSize; int err, errn; #if DO_USB_STATS 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)) return libusb_bulk_transfer(dev_handle, endpoint, data, length, transferred, timeout); - /* Limit length of transfer to the largest this descriptor supports - * and leave the higher level functions to transfer more if needed. */ - if (usb_epinfo->PrefPacketSize) - MaxPacketSize = usb_epinfo->PrefPacketSize; - else - MaxPacketSize = usb_epinfo->wMaxPacketSize; - if (length > MaxPacketSize) - length = MaxPacketSize; + if (length > usb_epinfo->wMaxPacketSize) + length = usb_epinfo->wMaxPacketSize; if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT) memcpy(buf, data, length);