diff options
author | Stephen Warren <swarren@nvidia.com> | 2014-07-01 11:41:14 -0600 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2014-07-02 15:45:38 +0200 |
commit | 8d7c39d3e8ad43dab3158220f3347186e6f1aa66 (patch) | |
tree | 08019616da2596f92fbcefb1c6f7039cfde12d90 /drivers/usb | |
parent | d7beeb9358a93e2dfd01e0ab5ff4317ce106c4d7 (diff) |
usb: ci_udc: don't assume QTDs are adjacent when transmitting ZLPs
Fix ci_ep_submit_next_request()'s ZLP transmission code to explicitly
call ci_get_qtd() to find the address of the other QTD to use. This
will allow us to correctly align each QTD individually in the future,
which may involve leaving a gap between the QTDs.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/ci_udc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 8ba604841c..4115cd5dab 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -404,10 +404,11 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep) * only 1 is used at a time since either an IN or an OUT but * not both is queued. For an IN transaction, item currently * points at the second of these items, so we know that we - * can use (item - 1) to transmit the extra zero-length packet + * can use the other to transmit the extra zero-length packet. */ - item->next = (unsigned)(item - 1); - item--; + struct ept_queue_item *other_item = ci_get_qtd(num, 0); + item->next = (unsigned)other_item; + item = other_item; item->info = INFO_ACTIVE; } |