summaryrefslogtreecommitdiffstats
path: root/fastboot/usb_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'fastboot/usb_linux.c')
-rw-r--r--fastboot/usb_linux.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c
index 78b7b98..1ba87e6 100644
--- a/fastboot/usb_linux.c
+++ b/fastboot/usb_linux.c
@@ -61,6 +61,11 @@
#define DBG1(x...)
#endif
+/* The max bulk size for linux is 16384 which is defined
+ * in drivers/usb/core/devio.c.
+ */
+#define MAX_USBFS_BULK_SIZE (16 * 1024)
+
struct usb_handle
{
char fname[64];
@@ -289,7 +294,7 @@ int usb_write(usb_handle *h, const void *_data, int len)
while(len > 0) {
int xfer;
- xfer = (len > 4096) ? 4096 : len;
+ xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len;
bulk.ep = h->ep_out;
bulk.len = xfer;
@@ -323,7 +328,7 @@ int usb_read(usb_handle *h, void *_data, int len)
}
while(len > 0) {
- int xfer = (len > 4096) ? 4096 : len;
+ int xfer = (len > MAX_USBFS_BULK_SIZE) ? MAX_USBFS_BULK_SIZE : len;
bulk.ep = h->ep_in;
bulk.len = xfer;