aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorDaniel Glöckner <dg@emlix.com>2009-11-17 04:52:56 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-11-30 19:43:16 -0500
commit5542bc2ac7b52c021fc9c7a96329955491b7e763 (patch)
tree653fc1d0bdad8d910047c1c3fa37fcb6a9d50add /drivers/usb
parentdfeffa531ccf9c31f2f55df6d7ca86eec92142df (diff)
USB: musb: respect usb_request->zero in control requests
In gadget mode the answer to a control request should be followed by a zero-length packet if the amount transferred is an exact multiple of the endpoint's packet size and the requests has its "zero" flag set. This patch prevents the request from being immediately removed from the queue when a control IN transfer ends on a full packet and "zero" is set. The next time ep0_txstate is entered, a zero-length packet is queued and the request is removed as fifo_count is 0. Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb/musb_gadget_ep0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c
index 7a6778675ad3..522efb31b56b 100644
--- a/drivers/usb/musb/musb_gadget_ep0.c
+++ b/drivers/usb/musb/musb_gadget_ep0.c
@@ -511,7 +511,8 @@ static void ep0_txstate(struct musb *musb)
511 511
512 /* update the flags */ 512 /* update the flags */
513 if (fifo_count < MUSB_MAX_END0_PACKET 513 if (fifo_count < MUSB_MAX_END0_PACKET
514 || request->actual == request->length) { 514 || (request->actual == request->length
515 && !request->zero)) {
515 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT; 516 musb->ep0_state = MUSB_EP0_STAGE_STATUSOUT;
516 csr |= MUSB_CSR0_P_DATAEND; 517 csr |= MUSB_CSR0_P_DATAEND;
517 } else 518 } else