Lines Matching refs:ring

93 static bool last_trb_on_last_seg(struct xhci_hcd *xhci, struct xhci_ring *ring,  in last_trb_on_last_seg()  argument
96 if (ring == xhci->event_ring) in last_trb_on_last_seg()
107 static int last_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, in last_trb() argument
110 if (ring == xhci->event_ring) in last_trb()
116 static int enqueue_is_link_trb(struct xhci_ring *ring) in enqueue_is_link_trb() argument
118 struct xhci_link_trb *link = &ring->enqueue->link; in enqueue_is_link_trb()
127 struct xhci_ring *ring, in next_trb() argument
131 if (last_trb(xhci, ring, *seg, *trb)) { in next_trb()
143 static void inc_deq(struct xhci_hcd *xhci, struct xhci_ring *ring) in inc_deq() argument
145 ring->deq_updates++; in inc_deq()
151 if (ring->type != TYPE_EVENT && in inc_deq()
152 !last_trb(xhci, ring, ring->deq_seg, ring->dequeue)) in inc_deq()
153 ring->num_trbs_free++; in inc_deq()
161 if (last_trb(xhci, ring, ring->deq_seg, ring->dequeue)) { in inc_deq()
162 if (ring->type == TYPE_EVENT && in inc_deq()
163 last_trb_on_last_seg(xhci, ring, in inc_deq()
164 ring->deq_seg, ring->dequeue)) { in inc_deq()
165 ring->cycle_state ^= 1; in inc_deq()
167 ring->deq_seg = ring->deq_seg->next; in inc_deq()
168 ring->dequeue = ring->deq_seg->trbs; in inc_deq()
170 ring->dequeue++; in inc_deq()
172 } while (last_trb(xhci, ring, ring->deq_seg, ring->dequeue)); in inc_deq()
192 static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, in inc_enq() argument
198 chain = le32_to_cpu(ring->enqueue->generic.field[3]) & TRB_CHAIN; in inc_enq()
200 if (ring->type != TYPE_EVENT && in inc_enq()
201 !last_trb(xhci, ring, ring->enq_seg, ring->enqueue)) in inc_enq()
202 ring->num_trbs_free--; in inc_enq()
203 next = ++(ring->enqueue); in inc_enq()
205 ring->enq_updates++; in inc_enq()
209 while (last_trb(xhci, ring, ring->enq_seg, next)) { in inc_enq()
210 if (ring->type != TYPE_EVENT) { in inc_enq()
227 if (!(ring->type == TYPE_ISOC && in inc_enq()
240 if (last_trb_on_last_seg(xhci, ring, ring->enq_seg, next)) { in inc_enq()
241 ring->cycle_state ^= 1; in inc_enq()
244 ring->enq_seg = ring->enq_seg->next; in inc_enq()
245 ring->enqueue = ring->enq_seg->trbs; in inc_enq()
246 next = ring->enqueue; in inc_enq()
254 static inline int room_on_ring(struct xhci_hcd *xhci, struct xhci_ring *ring, in room_on_ring() argument
259 if (ring->num_trbs_free < num_trbs) in room_on_ring()
262 if (ring->type != TYPE_COMMAND && ring->type != TYPE_EVENT) { in room_on_ring()
263 num_trbs_in_deq_seg = ring->dequeue - ring->deq_seg->trbs; in room_on_ring()
264 if (ring->num_trbs_free < num_trbs + num_trbs_in_deq_seg) in room_on_ring()
361 if (ep->ring && !(list_empty(&ep->ring->td_list))) in ring_doorbell_for_active_rings()
384 return ep->ring; in xhci_triad_to_transfer_ring()
502 if (new_deq == ep->ring->dequeue) { in xhci_find_new_dequeue_state()
757 static void xhci_kill_ring_urbs(struct xhci_hcd *xhci, struct xhci_ring *ring) in xhci_kill_ring_urbs() argument
761 while (!list_empty(&ring->td_list)) { in xhci_kill_ring_urbs()
762 cur_td = list_first_entry(&ring->td_list, in xhci_kill_ring_urbs()
776 struct xhci_ring *ring; in xhci_kill_endpoint_urbs() local
792 ring = ep->ring; in xhci_kill_endpoint_urbs()
793 if (!ring) in xhci_kill_endpoint_urbs()
798 xhci_kill_ring_urbs(xhci, ring); in xhci_kill_endpoint_urbs()
2786 static void queue_trb(struct xhci_hcd *xhci, struct xhci_ring *ring, in queue_trb() argument
2792 trb = &ring->enqueue->generic; in queue_trb()
2797 inc_enq(xhci, ring, more_trbs_coming); in queue_trb()
2857 struct xhci_ring *ring = ep_ring; in prepare_ring() local
2860 next = ring->enqueue; in prepare_ring()
2862 while (last_trb(xhci, ring, ring->enq_seg, next)) { in prepare_ring()
2867 !(ring->type == TYPE_ISOC && in prepare_ring()
2877 if (last_trb_on_last_seg(xhci, ring, ring->enq_seg, next)) { in prepare_ring()
2878 ring->cycle_state ^= 1; in prepare_ring()
2880 ring->enq_seg = ring->enq_seg->next; in prepare_ring()
2881 ring->enqueue = ring->enq_seg->trbs; in prepare_ring()
2882 next = ring->enqueue; in prepare_ring()
3713 ep_ring = xhci->devs[slot_id]->eps[ep_index].ring; in xhci_queue_isoc_tx()
3913 ep_ring = xdev->eps[ep_index].ring; in xhci_queue_isoc_tx_prepare()