Lines Matching refs:trb
70 union xhci_trb *trb) in xhci_trb_virt_to_dma() argument
74 if (!seg || !trb || trb < seg->trbs) in xhci_trb_virt_to_dma()
77 segment_offset = trb - seg->trbs; in xhci_trb_virt_to_dma()
80 return seg->dma + (segment_offset * sizeof(*trb)); in xhci_trb_virt_to_dma()
83 static bool trb_is_noop(union xhci_trb *trb) in trb_is_noop() argument
85 return TRB_TYPE_NOOP_LE32(trb->generic.field[3]); in trb_is_noop()
88 static bool trb_is_link(union xhci_trb *trb) in trb_is_link() argument
90 return TRB_TYPE_LINK_LE32(trb->link.control); in trb_is_link()
93 static bool last_trb_on_seg(struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_seg() argument
95 return trb == &seg->trbs[TRBS_PER_SEGMENT - 1]; in last_trb_on_seg()
99 struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_ring() argument
101 return last_trb_on_seg(seg, trb) && (seg->next == ring->first_seg); in last_trb_on_ring()
104 static bool link_trb_toggles_cycle(union xhci_trb *trb) in link_trb_toggles_cycle() argument
106 return le32_to_cpu(trb->link.control) & LINK_TOGGLE; in link_trb_toggles_cycle()
129 static void trb_to_noop(union xhci_trb *trb, u32 noop_type) in trb_to_noop() argument
131 if (trb_is_link(trb)) { in trb_to_noop()
133 trb->link.control &= cpu_to_le32(~TRB_CHAIN); in trb_to_noop()
135 trb->generic.field[0] = 0; in trb_to_noop()
136 trb->generic.field[1] = 0; in trb_to_noop()
137 trb->generic.field[2] = 0; in trb_to_noop()
139 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); in trb_to_noop()
140 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type)); in trb_to_noop()
151 union xhci_trb **trb) in next_trb() argument
153 if (trb_is_link(*trb) || last_trb_on_seg(*seg, *trb)) { in next_trb()
155 *trb = ((*seg)->trbs); in next_trb()
157 (*trb)++; in next_trb()
747 union xhci_trb *trb = td->first_trb; in td_to_noop() local
750 trb_to_noop(trb, TRB_TR_NOOP); in td_to_noop()
753 if (flip_cycle && trb != td->first_trb && trb != td->last_trb) in td_to_noop()
754 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE); in td_to_noop()
756 if (trb == td->last_trb) in td_to_noop()
759 next_trb(xhci, ep_ring, &seg, &trb); in td_to_noop()
1094 union xhci_trb *trb, u32 comp_code) in xhci_handle_cmd_stop_ep() argument
1104 if (unlikely(TRB_TO_SUSPEND_PORT(le32_to_cpu(trb->generic.field[3])))) { in xhci_handle_cmd_stop_ep()
1111 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_stop_ep()
1333 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_set_deq() argument
1344 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_set_deq()
1345 stream_id = TRB_TO_STREAM_ID(le32_to_cpu(trb->generic.field[2])); in xhci_handle_cmd_set_deq()
1468 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_reset_ep() argument
1474 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_reset_ep()
1497 if ((le32_to_cpu(trb->generic.field[3])) & TRB_TSP) in xhci_handle_cmd_reset_ep()
2273 union xhci_trb *trb = ring->dequeue; in sum_trb_lengths() local
2276 for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) { in sum_trb_lengths()
2277 if (!trb_is_noop(trb) && !trb_is_link(trb)) in sum_trb_lengths()
2278 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2])); in sum_trb_lengths()
3155 struct xhci_generic_trb *trb; in queue_trb() local
3157 trb = &ring->enqueue->generic; in queue_trb()
3158 trb->field[0] = cpu_to_le32(field1); in queue_trb()
3159 trb->field[1] = cpu_to_le32(field2); in queue_trb()
3160 trb->field[2] = cpu_to_le32(field3); in queue_trb()
3163 trb->field[3] = cpu_to_le32(field4); in queue_trb()
3165 trace_xhci_queue_trb(ring, trb); in queue_trb()