Lines Matching refs:trb
67 union xhci_trb *trb) in xhci_trb_virt_to_dma() argument
71 if (!seg || !trb || trb < seg->trbs) in xhci_trb_virt_to_dma()
74 segment_offset = trb - seg->trbs; in xhci_trb_virt_to_dma()
77 return seg->dma + (segment_offset * sizeof(*trb)); in xhci_trb_virt_to_dma()
80 static bool trb_is_noop(union xhci_trb *trb) in trb_is_noop() argument
82 return TRB_TYPE_NOOP_LE32(trb->generic.field[3]); in trb_is_noop()
85 static bool trb_is_link(union xhci_trb *trb) in trb_is_link() argument
87 return TRB_TYPE_LINK_LE32(trb->link.control); in trb_is_link()
90 static bool last_trb_on_seg(struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_seg() argument
92 return trb == &seg->trbs[TRBS_PER_SEGMENT - 1]; in last_trb_on_seg()
96 struct xhci_segment *seg, union xhci_trb *trb) in last_trb_on_ring() argument
98 return last_trb_on_seg(seg, trb) && (seg->next == ring->first_seg); in last_trb_on_ring()
101 static bool link_trb_toggles_cycle(union xhci_trb *trb) in link_trb_toggles_cycle() argument
103 return le32_to_cpu(trb->link.control) & LINK_TOGGLE; in link_trb_toggles_cycle()
120 static void trb_to_noop(union xhci_trb *trb, u32 noop_type) in trb_to_noop() argument
122 if (trb_is_link(trb)) { in trb_to_noop()
124 trb->link.control &= cpu_to_le32(~TRB_CHAIN); in trb_to_noop()
126 trb->generic.field[0] = 0; in trb_to_noop()
127 trb->generic.field[1] = 0; in trb_to_noop()
128 trb->generic.field[2] = 0; in trb_to_noop()
130 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); in trb_to_noop()
131 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type)); in trb_to_noop()
142 union xhci_trb **trb) in next_trb() argument
144 if (trb_is_link(*trb)) { in next_trb()
146 *trb = ((*seg)->trbs); in next_trb()
148 (*trb)++; in next_trb()
610 union xhci_trb *trb = td->first_trb; in td_to_noop() local
613 trb_to_noop(trb, TRB_TR_NOOP); in td_to_noop()
616 if (flip_cycle && trb != td->first_trb && trb != td->last_trb) in td_to_noop()
617 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE); in td_to_noop()
619 if (trb == td->last_trb) in td_to_noop()
622 next_trb(xhci, ep_ring, &seg, &trb); in td_to_noop()
700 union xhci_trb *trb, struct xhci_event_cmd *event) in xhci_handle_cmd_stop_ep() argument
712 if (unlikely(TRB_TO_SUSPEND_PORT(le32_to_cpu(trb->generic.field[3])))) { in xhci_handle_cmd_stop_ep()
721 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_stop_ep()
1036 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_set_deq() argument
1046 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_set_deq()
1047 stream_id = TRB_TO_STREAM_ID(le32_to_cpu(trb->generic.field[2])); in xhci_handle_cmd_set_deq()
1131 union xhci_trb *trb, u32 cmd_comp_code) in xhci_handle_cmd_reset_ep() argument
1137 ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); in xhci_handle_cmd_reset_ep()
1171 if ((le32_to_cpu(trb->generic.field[3])) & TRB_TSP) in xhci_handle_cmd_reset_ep()
1995 union xhci_trb *trb = ring->dequeue; in sum_trb_lengths() local
1998 for (sum = 0; trb != stop_trb; next_trb(xhci, ring, &seg, &trb)) { in sum_trb_lengths()
1999 if (!trb_is_noop(trb) && !trb_is_link(trb)) in sum_trb_lengths()
2000 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2])); in sum_trb_lengths()
2854 struct xhci_generic_trb *trb; in queue_trb() local
2856 trb = &ring->enqueue->generic; in queue_trb()
2857 trb->field[0] = cpu_to_le32(field1); in queue_trb()
2858 trb->field[1] = cpu_to_le32(field2); in queue_trb()
2859 trb->field[2] = cpu_to_le32(field3); in queue_trb()
2860 trb->field[3] = cpu_to_le32(field4); in queue_trb()
2862 trace_xhci_queue_trb(ring, trb); in queue_trb()