usb: chipidea: udc: zero-length packet is only needed for TX
authorPeter Chen <peter.chen@freescale.com>
Tue, 28 Jul 2015 02:08:32 +0000 (10:08 +0800)
committerPeter Chen <peter.chen@freescale.com>
Fri, 14 Aug 2015 01:16:46 +0000 (09:16 +0800)
The zero-length packet is the sendor tells the receiver that there
is no more data, so it is only needed at the TX side.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/chipidea/udc.c

index 27cbd1c..aca7a97 100644 (file)
@@ -445,7 +445,7 @@ static int _hardware_enqueue(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq)
                rest -= count;
        }
 
-       if (hwreq->req.zero && hwreq->req.length
+       if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX
            && (hwreq->req.length % hwep->ep.maxpacket == 0))
                add_td_to_list(hwep, hwreq, 0);