Lines Matching refs:trb

72 				 union cdnsp_trb *trb)
74 unsigned long segment_offset = trb - seg->trbs;
76 if (trb < seg->trbs || segment_offset >= TRBS_PER_SEGMENT)
79 return seg->dma + (segment_offset * sizeof(*trb));
82 static bool cdnsp_trb_is_noop(union cdnsp_trb *trb)
84 return TRB_TYPE_NOOP_LE32(trb->generic.field[3]);
87 static bool cdnsp_trb_is_link(union cdnsp_trb *trb)
89 return TRB_TYPE_LINK_LE32(trb->link.control);
92 bool cdnsp_last_trb_on_seg(struct cdnsp_segment *seg, union cdnsp_trb *trb)
94 return trb == &seg->trbs[TRBS_PER_SEGMENT - 1];
99 union cdnsp_trb *trb)
101 return cdnsp_last_trb_on_seg(seg, trb) && (seg->next == ring->first_seg);
104 static bool cdnsp_link_trb_toggles_cycle(union cdnsp_trb *trb)
106 return le32_to_cpu(trb->link.control) & LINK_TOGGLE;
109 static void cdnsp_trb_to_noop(union cdnsp_trb *trb, u32 noop_type)
111 if (cdnsp_trb_is_link(trb)) {
113 trb->link.control &= cpu_to_le32(~TRB_CHAIN);
115 trb->generic.field[0] = 0;
116 trb->generic.field[1] = 0;
117 trb->generic.field[2] = 0;
119 trb->generic.field[3] &= cpu_to_le32(TRB_CYCLE);
120 trb->generic.field[3] |= cpu_to_le32(TRB_TYPE(noop_type));
125 * Updates trb to point to the next TRB in the ring, and updates seg if the next
132 union cdnsp_trb **trb)
134 if (cdnsp_trb_is_link(*trb)) {
136 *trb = ((*seg)->trbs);
138 (*trb)++;
148 /* event ring doesn't have link trbs, check for last trb. */
458 * We want to find the pointer, segment and cycle state of the new trb
509 union cdnsp_trb *trb = td->first_trb;
512 cdnsp_trb_to_noop(trb, TRB_TR_NOOP);
515 if (flip_cycle && trb != td->first_trb && trb != td->last_trb)
516 trb->generic.field[3] ^= cpu_to_le32(TRB_CYCLE);
518 if (trb == td->last_trb)
521 cdnsp_next_trb(pdev, ep_ring, &seg, &trb);
947 /* sum trb lengths from ring dequeue up to stop_trb, _excluding_ stop_trb */
953 union cdnsp_trb *trb = ring->dequeue;
956 for (sum = 0; trb != stop_trb; cdnsp_next_trb(pdev, ring, &seg, &trb)) {
957 if (!cdnsp_trb_is_noop(trb) && !cdnsp_trb_is_link(trb))
958 sum += TRB_LEN(le32_to_cpu(trb->generic.field[2]));
1154 /* Stopped on ep trb with invalid length, exclude it. */
1262 /* Some transfer events don't always point to a trb*/
1606 struct cdnsp_generic_trb *trb;
1608 trb = &ring->enqueue->generic;
1610 trb->field[0] = cpu_to_le32(field1);
1611 trb->field[1] = cpu_to_le32(field2);
1612 trb->field[2] = cpu_to_le32(field3);
1613 trb->field[3] = cpu_to_le32(field4);
1615 trace_cdnsp_queue_trb(ring, trb);
1826 /* Create a max max_pkt sized bounce buffer pointed to by last trb. */
1896 /* Deal with request.zero - need one more td/trb. */