struct dwc3_request *req, *n;
u32 trbs_left;
u32 max;
- unsigned int last_one = 0;
BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
list_for_each_entry_safe(req, n, &dep->request_list, list) {
unsigned length;
dma_addr_t dma;
- last_one = false;
dma = req->request.dma;
length = req->request.length;
- trbs_left--;
-
- if (!trbs_left)
- last_one = 1;
-
- /* Is this the last request? */
- if (list_is_last(&req->list, &dep->request_list))
- last_one = 1;
dwc3_prepare_one_trb(dep, req, dma, length,
- last_one, false, 0);
+ true, false, 0);
- if (last_one)
- break;
+ break;
}
}
} else {
int ret;
- usb_ep_set_maxpacket_limit(&dep->endpoint, 1024);
+ usb_ep_set_maxpacket_limit(&dep->endpoint, 512);
dep->endpoint.max_streams = 15;
dep->endpoint.ops = &dwc3_gadget_ep_ops;
list_add_tail(&dep->endpoint.ep_list,
struct dwc3_request *req;
struct dwc3_trb *trb;
unsigned int slot;
- int ret;
- do {
- req = next_request(&dep->req_queued);
- if (!req) {
- WARN_ON_ONCE(1);
- return 1;
- }
-
- slot = req->start_slot;
- if ((slot == DWC3_TRB_NUM - 1) &&
- usb_endpoint_xfer_isoc(dep->endpoint.desc))
- slot++;
- slot %= DWC3_TRB_NUM;
- trb = &dep->trb_pool[slot];
-
- dwc3_flush_cache((int)trb, sizeof(*trb));
- ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb,
- event, status);
- if (ret)
- break;
+ req = next_request(&dep->req_queued);
+ if (!req) {
+ WARN_ON_ONCE(1);
+ return 1;
+ }
- dwc3_gadget_giveback(dep, req, status);
+ slot = req->start_slot;
+ if ((slot == DWC3_TRB_NUM - 1) &&
+ usb_endpoint_xfer_isoc(dep->endpoint.desc))
+ slot++;
+ slot %= DWC3_TRB_NUM;
+ trb = &dep->trb_pool[slot];
- if (ret)
- break;
- } while (1);
+ dwc3_flush_cache((int)trb, sizeof(*trb));
+ __dwc3_cleanup_done_trbs(dwc, dep, req, trb, event, status);
+ dwc3_gadget_giveback(dep, req, status);
if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
list_empty(&dep->req_queued)) {