diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-10-20 19:04:16 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-12-12 11:48:25 +0200 |
commit | c2da2ff00606ae008f0e233bd29c3307d0c3ce85 (patch) | |
tree | dae0f51cbc09d667eb7e477e52897cfeb401a62a /drivers/usb | |
parent | 1e7618d8a1ad7aac6904c3a3915bf63f411344c2 (diff) |
usb: dwc3: ep0: don't use ep0in for transfers
In "usb: dwc3: remove special status request handling in ep0" I simplied
a few things and used the generic API for the status transfers. The bug
I introcuded here is that we queue now requests to dep[1] but we don't
clear that list in the stall+start case.
Actually we don't need to use dep[1] at all. We only did in the past to
talk to the correct endpoint (i.e. in or out). This is now take care of
in a diffent place within the ep0 code. So we could queue the in
transfers to dep[0] and don't use dep[1] at all.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 7760d00cb902..7da25e181889 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c @@ -190,8 +190,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request, } /* we share one TRB for ep0/1 */ - if (!list_empty(&dwc->eps[0]->request_list) || - !list_empty(&dwc->eps[1]->request_list)) { + if (!list_empty(&dep->request_list)) { ret = -EBUSY; goto out; } @@ -213,8 +212,8 @@ static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc) struct dwc3_ep *dep = dwc->eps[0]; /* stall is always issued on EP0 */ - __dwc3_gadget_ep_set_halt(dwc->eps[0], 1); - dwc->eps[0]->flags = DWC3_EP_ENABLED; + __dwc3_gadget_ep_set_halt(dep, 1); + dep->flags = DWC3_EP_ENABLED; if (!list_empty(&dep->request_list)) { struct dwc3_request *req; @@ -300,7 +299,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl dwc->ep0_usb_req.length = sizeof(*response_pkt); dwc->ep0_usb_req.dma = dwc->setup_buf_addr; dwc->ep0_usb_req.complete = dwc3_ep0_status_cmpl; - return usb_ep_queue(&dwc->eps[1]->endpoint, &dwc->ep0_usb_req, + return usb_ep_queue(&dwc->eps[0]->endpoint, &dwc->ep0_usb_req, GFP_ATOMIC); } @@ -552,22 +551,21 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, struct dwc3_request *r = NULL; struct usb_request *ur; struct dwc3_trb trb; - struct dwc3_ep *dep; + struct dwc3_ep *ep0; u32 transferred; u8 epnum; epnum = event->endpoint_number; - dep = dwc->eps[epnum]; + ep0 = dwc->eps[0]; dwc->ep0_next_event = DWC3_EP0_NRDY_STATUS; - r = next_request(&dwc->eps[0]->request_list); + r = next_request(&ep0->request_list); ur = &r->request; dwc3_trb_to_nat(dwc->ep0_trb, &trb); if (dwc->ep0_bounced) { - struct dwc3_ep *ep0 = dwc->eps[0]; transferred = min_t(u32, ur->length, ep0->endpoint.maxpacket - trb.length); @@ -588,7 +586,7 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, * seems to be case when req.length > maxpacket. Could it be? */ if (r) - dwc3_gadget_giveback(dep, r, 0); + dwc3_gadget_giveback(ep0, r, 0); } } |