Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280937
b: refs/heads/master
c: 68e823e
h: refs/heads/master
i:
  280935: d89a1f4
v: v3
  • Loading branch information
Felipe Balbi committed Dec 21, 2011
1 parent 84aa547 commit d2c2946
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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: c71fc37c191747ea1f00424e84f96c1f88e52bfc
refs/heads/master: 68e823e24aea5227eaf20d6435485e733109d113
22 changes: 9 additions & 13 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ static void dwc3_gadget_ep_free_request(struct usb_ep *ep,
* @dep: endpoint for which this request is prepared
* @req: dwc3_request pointer
*/
static int dwc3_prepare_one_trb(struct dwc3_ep *dep,
static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
struct dwc3_request *req, unsigned last)
{
struct dwc3_trb_hw *trb_hw;
Expand All @@ -559,7 +559,7 @@ static int dwc3_prepare_one_trb(struct dwc3_ep *dep,
/* Skip the LINK-TRB on ISOC */
if (((cur_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->desc))
return 0;
return;

dwc3_gadget_move_request_queued(req);
memset(&trb, 0, sizeof(trb));
Expand Down Expand Up @@ -607,8 +607,6 @@ static int dwc3_prepare_one_trb(struct dwc3_ep *dep,

dwc3_trb_to_hw(&trb, trb_hw);
req->trb_dma = dwc3_trb_dma_offset(dep, trb_hw);

return 0;
}

/*
Expand All @@ -620,10 +618,9 @@ static int dwc3_prepare_one_trb(struct dwc3_ep *dep,
* transfers. The functions returns once there are not more TRBs available or
* it run out of requests.
*/
static struct dwc3_request *dwc3_prepare_trbs(struct dwc3_ep *dep,
bool starting)
static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
{
struct dwc3_request *req, *n, *ret = NULL;
struct dwc3_request *req, *n;
u32 trbs_left;
unsigned int last_one = 0;

Expand All @@ -639,7 +636,7 @@ static struct dwc3_request *dwc3_prepare_trbs(struct dwc3_ep *dep,
*/
if (!trbs_left) {
if (!starting)
return NULL;
return;
trbs_left = DWC3_TRB_NUM;
/*
* In case we start from scratch, we queue the ISOC requests
Expand All @@ -663,7 +660,7 @@ static struct dwc3_request *dwc3_prepare_trbs(struct dwc3_ep *dep,

/* The last TRB is a link TRB, not used for xfer */
if ((trbs_left <= 1) && usb_endpoint_xfer_isoc(dep->desc))
return NULL;
return;

list_for_each_entry_safe(req, n, &dep->request_list, list) {
trbs_left--;
Expand All @@ -684,11 +681,8 @@ static struct dwc3_request *dwc3_prepare_trbs(struct dwc3_ep *dep,
* multiple TRBs handling, use only one TRB at a time.
*/
dwc3_prepare_one_trb(dep, req, true);
ret = req;
break;
}

return ret;
}

static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param,
Expand Down Expand Up @@ -717,11 +711,13 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep, u16 cmd_param,
/* req points to the first request which will be sent */
req = next_request(&dep->req_queued);
} else {
dwc3_prepare_trbs(dep, start_new);

/*
* req points to the first request where HWO changed
* from 0 to 1
*/
req = dwc3_prepare_trbs(dep, start_new);
req = next_request(&dep->req_queued);
}
if (!req) {
dep->flags |= DWC3_EP_PENDING_REQUEST;
Expand Down

0 comments on commit d2c2946

Please sign in to comment.