aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-08-23 04:44:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-23 12:47:39 -0400
commit7c79d094358326132693279bfb22e4f8454cc652 (patch)
tree60586c62e8a679d5c2c47425378345113862d886 /drivers/usb/misc
parent39eb4ed556c145f35059c59144192d8ee32ceaa5 (diff)
USB: usbtest: use URB_ZERO_PACKET for BULK-OUT transfers
Executing | testusb -a -c 1 -t 3 -v 421 -s 2048 does not complete on the gadget side. g_zero enqueues a 4096 bytes long buffer. The host sends 2048bytes which is a multiple of wMaxPacketSize (either 64 or 512 bytes). The host is done with sending data but the gadget waits for more. Since the protocol does not include transfer-length-field sending a terminating zero packet seems the only way out. Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/usbtest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
index bb10846affc3..bd715006b056 100644
--- a/drivers/usb/misc/usbtest.c
+++ b/drivers/usb/misc/usbtest.c
@@ -359,8 +359,10 @@ static int simple_io(
359 urb->context = &completion; 359 urb->context = &completion;
360 while (retval == 0 && iterations-- > 0) { 360 while (retval == 0 && iterations-- > 0) {
361 init_completion(&completion); 361 init_completion(&completion);
362 if (usb_pipeout(urb->pipe)) 362 if (usb_pipeout(urb->pipe)) {
363 simple_fill_buf(urb); 363 simple_fill_buf(urb);
364 urb->transfer_flags |= URB_ZERO_PACKET;
365 }
364 retval = usb_submit_urb(urb, GFP_KERNEL); 366 retval = usb_submit_urb(urb, GFP_KERNEL);
365 if (retval != 0) 367 if (retval != 0)
366 break; 368 break;