summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 0e27158..bb29f4f 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -154,16 +154,16 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
if (req->started) {
i = 0;
do {
- dep->busy_slot++;
+ dep->trb_dequeue++;
/*
* Skip LINK TRB. We can't use req->trb and check for
* DWC3_TRBCTL_LINK_TRB because it points the TRB we
* just completed (not the LINK TRB).
*/
- if (((dep->busy_slot & DWC3_TRB_MASK) ==
+ if (((dep->trb_dequeue & DWC3_TRB_MASK) ==
DWC3_TRB_NUM- 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
- dep->busy_slot++;
+ dep->trb_dequeue++;
} while(++i < req->request.num_mapped_sgs);
req->started = false;
}
@@ -741,20 +741,20 @@ static void dwc3_prepare_one_trb(struct dwc3_ep *dep,
chain ? " chain" : "");
- trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
+ trb = &dep->trb_pool[dep->trb_enqueue & DWC3_TRB_MASK];
if (!req->trb) {
dwc3_gadget_move_started_request(req);
req->trb = trb;
req->trb_dma = dwc3_trb_dma_offset(dep, trb);
- req->start_slot = dep->free_slot & DWC3_TRB_MASK;
+ req->first_trb_index = dep->trb_enqueue & DWC3_TRB_MASK;
}
- dep->free_slot++;
+ dep->trb_enqueue++;
/* Skip the LINK-TRB on ISOC */
- if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
+ if (((dep->trb_enqueue & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
- dep->free_slot++;
+ dep->trb_enqueue++;
trb->size = DWC3_TRB_SIZE_LENGTH(length);
trb->bpl = lower_32_bits(dma);
@@ -826,11 +826,11 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
/* the first request must not be queued */
- trbs_left = (dep->busy_slot - dep->free_slot) & DWC3_TRB_MASK;
+ trbs_left = (dep->trb_dequeue - dep->trb_enqueue) & DWC3_TRB_MASK;
/* Can't wrap around on a non-isoc EP since there's no link TRB */
if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
- max = DWC3_TRB_NUM - (dep->free_slot & DWC3_TRB_MASK);
+ max = DWC3_TRB_NUM - (dep->trb_enqueue & DWC3_TRB_MASK);
if (trbs_left > max)
trbs_left = max;
}
@@ -856,11 +856,11 @@ static void dwc3_prepare_trbs(struct dwc3_ep *dep, bool starting)
* don't wrap around we have to start at the beginning.
*/
if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
- dep->busy_slot = 1;
- dep->free_slot = 1;
+ dep->trb_dequeue = 1;
+ dep->trb_enqueue = 1;
} else {
- dep->busy_slot = 0;
- dep->free_slot = 0;
+ dep->trb_dequeue = 0;
+ dep->trb_enqueue = 0;
}
}
@@ -1931,7 +1931,7 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
i = 0;
do {
- slot = req->start_slot + i;
+ slot = req->first_trb_index + i;
if ((slot == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc))
slot++;
OpenPOWER on IntegriCloud