Lines Matching refs:trb

72 				 union cdnsp_trb *trb)  in cdnsp_trb_virt_to_dma()  argument
74 unsigned long segment_offset = trb - seg->trbs; in cdnsp_trb_virt_to_dma()
76 if (trb < seg->trbs || segment_offset >= TRBS_PER_SEGMENT) in cdnsp_trb_virt_to_dma()
79 return seg->dma + (segment_offset * sizeof(*trb)); in cdnsp_trb_virt_to_dma()
82 static bool cdnsp_trb_is_noop(union cdnsp_trb *trb) in cdnsp_trb_is_noop() argument
84 return TRB_TYPE_NOOP_LE32(trb->generic.field[3]); in cdnsp_trb_is_noop()
87 static bool cdnsp_trb_is_link(union cdnsp_trb *trb) in cdnsp_trb_is_link() argument
89 return TRB_TYPE_LINK_LE32(trb->link.control); in cdnsp_trb_is_link()
92 bool cdnsp_last_trb_on_seg(struct cdnsp_segment *seg, union cdnsp_trb *trb) in cdnsp_last_trb_on_seg() argument
94 return trb == &seg->trbs[TRBS_PER_SEGMENT - 1]; in cdnsp_last_trb_on_seg()
99 union cdnsp_trb *trb) in cdnsp_last_trb_on_ring() argument
101 return cdnsp_last_trb_on_seg(seg, trb) && (seg->next == ring->first_seg); in cdnsp_last_trb_on_ring()
104 static bool cdnsp_link_trb_toggles_cycle(union cdnsp_trb *trb) in cdnsp_link_trb_toggles_cycle() argument
106 return le32_to_cpu(trb->link.control) & LINK_TOGGLE; in cdnsp_link_trb_toggles_cycle()
109 static void cdnsp_trb_to_noop(union cdnsp_trb *trb, u32 noop_type) in cdnsp_trb_to_noop() argument
111 if (cdnsp_trb_is_link(trb)) { in cdnsp_trb_to_noop()
113 trb->link.control &= cpu_to_le32(~TRB_CHAIN); in cdnsp_trb_to_noop()
115 trb->generic.field[0] = 0; in cdnsp_trb_to_noop()
116 trb->generic.field[1] = 0; in cdnsp_trb_to_noop()
117 trb->generic.field[2] = 0; in cdnsp_trb_to_noop()
119 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE); in cdnsp_trb_to_noop()
120 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type)); in cdnsp_trb_to_noop()
132 union cdnsp_trb **trb) in cdnsp_next_trb() argument
134 if (cdnsp_trb_is_link(*trb)) { in cdnsp_next_trb()
136 *trb = ((*seg)->trbs); in cdnsp_next_trb()
138 (*trb)++; in cdnsp_next_trb()
509 union cdnsp_trb *trb = td->first_trb; in cdnsp_td_to_noop() local
512 cdnsp_trb_to_noop(trb, TRB_TR_NOOP); in cdnsp_td_to_noop()
515 if (flip_cycle && trb != td->first_trb && trb != td->last_trb) in cdnsp_td_to_noop()
516 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE); in cdnsp_td_to_noop()
518 if (trb == td->last_trb) in cdnsp_td_to_noop()
521 cdnsp_next_trb(pdev, ep_ring, &seg, &trb); in cdnsp_td_to_noop()
953 union cdnsp_trb *trb = ring->dequeue; in cdnsp_sum_trb_lengths() local
956 for (sum = 0; trb != stop_trb; cdnsp_next_trb(pdev, ring, &seg, &trb)) { in cdnsp_sum_trb_lengths()
957 if (!cdnsp_trb_is_noop(trb) && !cdnsp_trb_is_link(trb)) in cdnsp_sum_trb_lengths()
958 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2])); in cdnsp_sum_trb_lengths()
1596 struct cdnsp_generic_trb *trb; in cdnsp_queue_trb() local
1598 trb = &ring->enqueue->generic; in cdnsp_queue_trb()
1600 trb->field[0] = cpu_to_le32(field1); in cdnsp_queue_trb()
1601 trb->field[1] = cpu_to_le32(field2); in cdnsp_queue_trb()
1602 trb->field[2] = cpu_to_le32(field3); in cdnsp_queue_trb()
1603 trb->field[3] = cpu_to_le32(field4); in cdnsp_queue_trb()
1605 trace_cdnsp_queue_trb(ring, trb); in cdnsp_queue_trb()