summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-06-22 11:48:37 +0200
committerHans de Goede <hdegoede@redhat.com>2012-06-22 11:58:25 +0200
commit7783d3db61083bbf7f61b1ea8608c666b4c6a1dd (patch)
tree35e666703d01e0eb43018bed99e2c1844937bf8e
parent4ff1a981739e0711684dcf8b4f7221d55bbf23b7 (diff)
usbredirhost: Don't set a timeout on bulk transfers
Bulk packets can be (ab)used as interrupt transfers without timing guarantees, iow you can submit a bulk in transfer and let it be submitted until the device has data to reports a few eons later. This is used by (some?) USB cdc-acm devices (modems, smartcard readers, gps devices), specifically a smartcard reader I've been debugging, which currently does not work. Not setting a timeout at the usb-host side fixes these devices. For devices where timeouts do make sense, the timeouts should be handled by the usb-guest, which has device specific knowledge we lack. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--usbredirhost/usbredirhost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usbredirhost/usbredirhost.c b/usbredirhost/usbredirhost.c
index 8b0c1ba..be75f87 100644
--- a/usbredirhost/usbredirhost.c
+++ b/usbredirhost/usbredirhost.c
@@ -31,7 +31,7 @@
#define MAX_ENDPOINTS 32
#define MAX_INTERFACES 32 /* Max 32 endpoints and thus interfaces */
#define CTRL_TIMEOUT 5000 /* USB specifies a 5 second max timeout */
-#define BULK_TIMEOUT 5000
+#define BULK_TIMEOUT 0 /* No timeout for bulk transfers */
#define ISO_TIMEOUT 1000
#define INTERRUPT_TIMEOUT 0 /* No timeout for interrupt transfers */
@@ -2017,7 +2017,7 @@ static void usbredirhost_bulk_packet(void *priv, uint32_t id,
libusb_fill_bulk_transfer(transfer->transfer, host->handle, ep,
data, bulk_packet->length,
usbredirhost_bulk_packet_complete,
- transfer, CTRL_TIMEOUT);
+ transfer, BULK_TIMEOUT);
transfer->id = id;
transfer->bulk_packet = *bulk_packet;