Lines Matching refs:ring
38 static int last_trb(struct xhci_ctrl *ctrl, struct xhci_ring *ring, in last_trb() argument
41 if (ring == ctrl->event_ring) in last_trb()
58 struct xhci_ring *ring, in last_trb_on_last_seg() argument
62 if (ring == ctrl->event_ring) in last_trb_on_last_seg()
64 (seg->next == ring->first_seg)); in last_trb_on_last_seg()
91 static void inc_enq(struct xhci_ctrl *ctrl, struct xhci_ring *ring, in inc_enq() argument
97 chain = le32_to_cpu(ring->enqueue->generic.field[3]) & TRB_CHAIN; in inc_enq()
98 next = ++(ring->enqueue); in inc_enq()
104 while (last_trb(ctrl, ring, ring->enq_seg, next)) { in inc_enq()
105 if (ring != ctrl->event_ring) { in inc_enq()
131 if (last_trb_on_last_seg(ctrl, ring, in inc_enq()
132 ring->enq_seg, next)) in inc_enq()
133 ring->cycle_state = (ring->cycle_state ? 0 : 1); in inc_enq()
135 ring->enq_seg = ring->enq_seg->next; in inc_enq()
136 ring->enqueue = ring->enq_seg->trbs; in inc_enq()
137 next = ring->enqueue; in inc_enq()
149 static void inc_deq(struct xhci_ctrl *ctrl, struct xhci_ring *ring) in inc_deq() argument
157 if (last_trb(ctrl, ring, ring->deq_seg, ring->dequeue)) { in inc_deq()
158 if (ring == ctrl->event_ring && in inc_deq()
159 last_trb_on_last_seg(ctrl, ring, in inc_deq()
160 ring->deq_seg, ring->dequeue)) { in inc_deq()
161 ring->cycle_state = (ring->cycle_state ? 0 : 1); in inc_deq()
163 ring->deq_seg = ring->deq_seg->next; in inc_deq()
164 ring->dequeue = ring->deq_seg->trbs; in inc_deq()
166 ring->dequeue++; in inc_deq()
168 } while (last_trb(ctrl, ring, ring->deq_seg, ring->dequeue)); in inc_deq()
184 struct xhci_ring *ring, in queue_trb() argument
191 trb = &ring->enqueue->generic; in queue_trb()
198 inc_enq(ctrl, ring, more_trbs_coming); in queue_trb()
495 struct xhci_ring *ring = ctrl->devs[udev->slot_id]->eps[ep_index].ring; in abort_td() local
515 xhci_queue_command(ctrl, (void *)((uintptr_t)ring->enqueue | in abort_td()
516 ring->cycle_state), udev->slot_id, ep_index, TRB_SET_DEQ); in abort_td()
576 struct xhci_ring *ring; /* EP transfer ring */ in xhci_bulk_tx() local
601 ring = virt_dev->eps[ep_index].ring; in xhci_bulk_tx()
631 ret = prepare_ring(ctrl, ring, in xhci_bulk_tx()
641 start_trb = &ring->enqueue->generic; in xhci_bulk_tx()
642 start_cycle = ring->cycle_state; in xhci_bulk_tx()
674 field |= ring->cycle_state; in xhci_bulk_tx()
706 last_transfer_trb_addr = queue_trb(ctrl, ring, (num_trbs > 1), trb_fields); in xhci_bulk_tx()
786 ep_ring = virt_dev->eps[ep_index].ring; in xhci_ctrl_tx()