Commit de32e901 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: gadget zero, loopback config fix

If the host writes OUT packets using URB_ZERO_PACKET
(or its analogue on other USB host systems), then the
loopback configuration should set req->zero, to use that
same transfer termination policy when it writes the
response back IN to the host.
parent 4166c817
...@@ -770,6 +770,7 @@ static void loopback_complete (struct usb_ep *ep, struct usb_request *req) ...@@ -770,6 +770,7 @@ static void loopback_complete (struct usb_ep *ep, struct usb_request *req)
case 0: /* normal completion? */ case 0: /* normal completion? */
if (ep == dev->out_ep) { if (ep == dev->out_ep) {
/* loop this OUT packet back IN to the host */ /* loop this OUT packet back IN to the host */
req->zero = (req->actual < req->length);
req->length = req->actual; req->length = req->actual;
status = usb_ep_queue (dev->in_ep, req, GFP_ATOMIC); status = usb_ep_queue (dev->in_ep, req, GFP_ATOMIC);
if (status == 0) if (status == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment