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()
84 static bool trb_is_noop(union xhci_trb *trb) in trb_is_noop() argument
86 return TRB_TYPE_NOOP_LE32(trb->generic.field[3]); in trb_is_noop()
89 static bool trb_is_link(union xhci_trb *trb) in trb_is_link() argument
91 return TRB_TYPE_LINK_LE32(trb->link.control); in trb_is_link()
94 static bool last_trb_on_seg(struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_seg() argument
96 return trb == &seg->trbs[TRBS_PER_SEGMENT - 1]; in last_trb_on_seg()
100 struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_ring() argument
102 return last_trb_on_seg(seg, trb) && (seg->next == ring->first_seg); in last_trb_on_ring()
105 static bool link_trb_toggles_cycle(union xhci_trb *trb) in link_trb_toggles_cycle() argument
107 return le32_to_cpu(trb->link.control) & LINK_TOGGLE; in link_trb_toggles_cycle()
124 static void trb_to_noop(union xhci_trb *trb, u32 noop_type) in trb_to_noop() argument
126 if (trb_is_link(trb)) { in trb_to_noop()
128 trb->link.control &= cpu_to_le32(~TRB_CHAIN); in trb_to_noop()
130 trb->generic.field[0] = 0; in trb_to_noop()
131 trb->generic.field[1] = 0; in trb_to_noop()
132 trb->generic.field[2] = 0; in trb_to_noop()
134 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); in trb_to_noop()
135 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type)); in trb_to_noop()
146 union xhci_trb **trb) in next_trb() argument
148 if (trb_is_link(*trb)) { in next_trb()
150 *trb = ((*seg)->trbs); in next_trb()
152 (*trb)++; in next_trb()
729 union xhci_trb *trb = td->first_trb; in td_to_noop() local
732 trb_to_noop(trb, TRB_TR_NOOP); in td_to_noop()
735 if (flip_cycle && trb != td->first_trb && trb != td->last_trb) in td_to_noop()
736 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE); in td_to_noop()
738 if (trb == td->last_trb) in td_to_noop()
741 next_trb(xhci, ep_ring, &seg, &trb); in td_to_noop()
1072 union xhci_trb *trb, u32 comp_code) in xhci_handle_cmd_stop_ep() argument
1082 if (unlikely(TRB_TO_SUSPEND_PORT(le32_to_cpu(trb->generic.field[3])))) { in xhci_handle_cmd_stop_ep()
1089 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_stop_ep()
1354 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_set_deq() argument
1364 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_set_deq()
1365 stream_id = TRB_TO_STREAM_ID(le32_to_cpu(trb->generic.field[2])); in xhci_handle_cmd_set_deq()
1463 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_reset_ep() argument
1469 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_reset_ep()
1494 if ((le32_to_cpu(trb->generic.field[3])) & TRB_TSP) in xhci_handle_cmd_reset_ep()
2285 union xhci_trb *trb = ring->dequeue; in sum_trb_lengths() local
2288 for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) { in sum_trb_lengths()
2289 if (!trb_is_noop(trb) && !trb_is_link(trb)) in sum_trb_lengths()
2290 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2])); in sum_trb_lengths()
3185 struct xhci_generic_trb *trb; in queue_trb() local
3187 trb = &ring->enqueue->generic; in queue_trb()
3188 trb->field[0] = cpu_to_le32(field1); in queue_trb()
3189 trb->field[1] = cpu_to_le32(field2); in queue_trb()
3190 trb->field[2] = cpu_to_le32(field3); in queue_trb()
3193 trb->field[3] = cpu_to_le32(field4); in queue_trb()
3195 trace_xhci_queue_trb(ring, trb); in queue_trb()