Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364509
b: refs/heads/master
c: 9e50643
h: refs/heads/master
i:
  364507: 447e007
v: v3
  • Loading branch information
Michael Grzeschik authored and Greg Kroah-Hartman committed Mar 30, 2013
1 parent e3414cd commit 86d3de7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 776ffc16b74a5c19285135cfbc6dd02e1c733f25
refs/heads/master: 9e5064384a69e6dac15e3ba8590355ec844e47b5
8 changes: 5 additions & 3 deletions trunk/drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,12 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
*/
static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
{
u32 tmptoken = le32_to_cpu(mReq->ptr->token);

if (mReq->req.status != -EALREADY)
return -EINVAL;

if ((cpu_to_le32(TD_STATUS_ACTIVE) & mReq->ptr->token) != 0)
if ((TD_STATUS_ACTIVE & tmptoken) != 0)
return -EBUSY;

if (mReq->zptr) {
Expand All @@ -498,15 +500,15 @@ static int _hardware_dequeue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)

usb_gadget_unmap_request(&mEp->ci->gadget, &mReq->req, mEp->dir);

mReq->req.status = le32_to_cpu(mReq->ptr->token) & TD_STATUS;
mReq->req.status = tmptoken & TD_STATUS;
if ((TD_STATUS_HALTED & mReq->req.status) != 0)
mReq->req.status = -1;
else if ((TD_STATUS_DT_ERR & mReq->req.status) != 0)
mReq->req.status = -1;
else if ((TD_STATUS_TR_ERR & mReq->req.status) != 0)
mReq->req.status = -1;

mReq->req.actual = le32_to_cpu(mReq->ptr->token) & TD_TOTAL_BYTES;
mReq->req.actual = tmptoken & TD_TOTAL_BYTES;
mReq->req.actual >>= __ffs(TD_TOTAL_BYTES);
mReq->req.actual = mReq->req.length - mReq->req.actual;
mReq->req.actual = mReq->req.status ? 0 : mReq->req.actual;
Expand Down

0 comments on commit 86d3de7

Please sign in to comment.