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-09-26 11:59:49 +0200
commite1901a72316288a8a2f699f56e3e612c3259977b (patch)
tree94b62cb50ac2506c5fa4e023bf9934912829a369
parente83a740c5068065dc87d9ec7b8e59cc4d6cee502 (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 1dfaee1..456b083 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 */
@@ -2012,7 +2012,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;