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()
123 static void trb_to_noop(union xhci_trb *trb, u32 noop_type) in trb_to_noop() argument
125 if (trb_is_link(trb)) { in trb_to_noop()
127 trb->link.control &= cpu_to_le32(~TRB_CHAIN); in trb_to_noop()
129 trb->generic.field[0] = 0; in trb_to_noop()
130 trb->generic.field[1] = 0; in trb_to_noop()
131 trb->generic.field[2] = 0; in trb_to_noop()
133 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); in trb_to_noop()
134 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type)); in trb_to_noop()
145 union xhci_trb **trb) in next_trb() argument
147 if (trb_is_link(*trb)) { in next_trb()
149 *trb = ((*seg)->trbs); in next_trb()
151 (*trb)++; in next_trb()
758 union xhci_trb *trb = td->first_trb; in td_to_noop() local
761 trb_to_noop(trb, TRB_TR_NOOP); in td_to_noop()
764 if (flip_cycle && trb != td->first_trb && trb != td->last_trb) in td_to_noop()
765 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE); in td_to_noop()
767 if (trb == td->last_trb) in td_to_noop()
770 next_trb(xhci, ep_ring, &seg, &trb); in td_to_noop()
1091 union xhci_trb *trb, u32 comp_code) in xhci_handle_cmd_stop_ep() argument
1101 if (unlikely(TRB_TO_SUSPEND_PORT(le32_to_cpu(trb->generic.field[3])))) { in xhci_handle_cmd_stop_ep()
1108 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_stop_ep()
1321 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_set_deq() argument
1331 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_set_deq()
1332 stream_id = TRB_TO_STREAM_ID(le32_to_cpu(trb->generic.field[2])); in xhci_handle_cmd_set_deq()
1430 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_reset_ep() argument
1436 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_reset_ep()
1459 if ((le32_to_cpu(trb->generic.field[3])) & TRB_TSP) in xhci_handle_cmd_reset_ep()
2246 union xhci_trb *trb = ring->dequeue; in sum_trb_lengths() local
2249 for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) { in sum_trb_lengths()
2250 if (!trb_is_noop(trb) && !trb_is_link(trb)) in sum_trb_lengths()
2251 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2])); in sum_trb_lengths()
3146 struct xhci_generic_trb *trb; in queue_trb() local
3148 trb = &ring->enqueue->generic; in queue_trb()
3149 trb->field[0] = cpu_to_le32(field1); in queue_trb()
3150 trb->field[1] = cpu_to_le32(field2); in queue_trb()
3151 trb->field[2] = cpu_to_le32(field3); in queue_trb()
3154 trb->field[3] = cpu_to_le32(field4); in queue_trb()
3156 trace_xhci_queue_trb(ring, trb); in queue_trb()