diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-03-27 11:26:53 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-05-21 10:00:51 +0300 |
commit | ee3638b897b9b6926d567b0ee0d9e65636138442 (patch) | |
tree | d85a5ba09f6ab72e98c3d0eda671ede86f259e7b /drivers/usb/dwc3 | |
parent | 5828cada99086c41cf23c4d4b63090b23c473008 (diff) |
usb: dwc3: gadget: update dep->frame_number from XferInprogress too
We will need an up-to-date frame_number from XferInProgress too when
future patches improve our handling of Isoc endpoints.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f078054f7178..6a2d41250602 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2417,6 +2417,16 @@ static int dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep, return 1; } +static void dwc3_gadget_endpoint_frame_from_event(struct dwc3_ep *dep, + const struct dwc3_event_depevt *event) +{ + u32 cur_uf, mask; + + mask = ~(dep->interval - 1); + cur_uf = event->parameters & mask; + dep->frame_number = cur_uf; +} + static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, const struct dwc3_event_depevt *event) { @@ -2424,6 +2434,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, unsigned status = 0; int clean_busy; + dwc3_gadget_endpoint_frame_from_event(dep, event); + if (event->status & DEPEVT_STATUS_BUSERR) status = -ECONNRESET; @@ -2462,12 +2474,7 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, static void dwc3_gadget_endpoint_transfer_not_ready(struct dwc3_ep *dep, const struct dwc3_event_depevt *event) { - u32 cur_uf, mask; - - mask = ~(dep->interval - 1); - cur_uf = event->parameters & mask; - dep->frame_number = cur_uf; - + dwc3_gadget_endpoint_frame_from_event(dep, event); __dwc3_gadget_start_isoc(dep); } |