usb: chipidea: udc: zero-length packet is only needed for TX

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>
This commit is contained in:
Peter Chen 2015-07-28 10:08:32 +08:00
parent 11a27098e8
commit a4da4f12b4

View 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);