Lines Matching refs:num_trbs
255 unsigned int num_trbs) in room_on_ring() argument
259 if (ring->num_trbs_free < num_trbs) in room_on_ring()
264 if (ring->num_trbs_free < num_trbs + num_trbs_in_deq_seg) in room_on_ring()
2805 u32 ep_state, unsigned int num_trbs, gfp_t mem_flags) in prepare_ring() argument
2838 if (room_on_ring(xhci, ep_ring, num_trbs)) in prepare_ring()
2848 num_trbs_needed = num_trbs - ep_ring->num_trbs_free; in prepare_ring()
2893 unsigned int num_trbs, in prepare_transfer() argument
2913 num_trbs, mem_flags); in prepare_transfer()
2942 int num_sgs, num_trbs, running_total, temp, i; in count_sg_trbs_needed() local
2949 num_trbs = 0; in count_sg_trbs_needed()
2958 num_trbs++; in count_sg_trbs_needed()
2962 num_trbs++; in count_sg_trbs_needed()
2970 return num_trbs; in count_sg_trbs_needed()
2973 static void check_trb_math(struct urb *urb, int num_trbs, int running_total) in check_trb_math() argument
2975 if (num_trbs != 0) in check_trb_math()
2978 urb->ep->desc.bEndpointAddress, num_trbs); in check_trb_math()
3088 unsigned int num_trbs; in queue_bulk_sg_tx() local
3108 num_trbs = count_sg_trbs_needed(xhci, urb); in queue_bulk_sg_tx()
3115 num_trbs, urb, 0, mem_flags); in queue_bulk_sg_tx()
3125 num_trbs++; in queue_bulk_sg_tx()
3181 if (num_trbs > last_trb_num) { in queue_bulk_sg_tx()
3183 } else if (num_trbs == last_trb_num) { in queue_bulk_sg_tx()
3186 } else if (zero_length_needed && num_trbs == 1) { in queue_bulk_sg_tx()
3207 urb, num_trbs - 1); in queue_bulk_sg_tx()
3213 if (num_trbs > 1) in queue_bulk_sg_tx()
3222 --num_trbs; in queue_bulk_sg_tx()
3246 } while (num_trbs > 0); in queue_bulk_sg_tx()
3248 check_trb_math(urb, num_trbs, running_total); in queue_bulk_sg_tx()
3261 int num_trbs; in xhci_queue_bulk_tx() local
3281 num_trbs = 0; in xhci_queue_bulk_tx()
3291 num_trbs++; in xhci_queue_bulk_tx()
3294 num_trbs++; in xhci_queue_bulk_tx()
3300 num_trbs, urb, 0, mem_flags); in xhci_queue_bulk_tx()
3310 num_trbs++; in xhci_queue_bulk_tx()
3357 if (num_trbs > last_trb_num) { in xhci_queue_bulk_tx()
3359 } else if (num_trbs == last_trb_num) { in xhci_queue_bulk_tx()
3362 } else if (zero_length_needed && num_trbs == 1) { in xhci_queue_bulk_tx()
3375 urb, num_trbs - 1); in xhci_queue_bulk_tx()
3381 if (num_trbs > 1) in xhci_queue_bulk_tx()
3390 --num_trbs; in xhci_queue_bulk_tx()
3398 } while (num_trbs > 0); in xhci_queue_bulk_tx()
3400 check_trb_math(urb, num_trbs, running_total); in xhci_queue_bulk_tx()
3411 int num_trbs; in xhci_queue_ctrl_tx() local
3432 num_trbs = 2; in xhci_queue_ctrl_tx()
3439 num_trbs++; in xhci_queue_ctrl_tx()
3442 num_trbs, urb, 0, mem_flags); in xhci_queue_ctrl_tx()
3532 int num_trbs = 0; in count_isoc_trbs_needed() local
3538 num_trbs = DIV_ROUND_UP(td_len + (addr & (TRB_MAX_BUFF_SIZE - 1)), in count_isoc_trbs_needed()
3540 if (num_trbs == 0) in count_isoc_trbs_needed()
3541 num_trbs++; in count_isoc_trbs_needed()
3543 return num_trbs; in count_isoc_trbs_needed()
3906 int num_tds, num_trbs, i; in xhci_queue_isoc_tx_prepare() local
3916 num_trbs = 0; in xhci_queue_isoc_tx_prepare()
3919 num_trbs += count_isoc_trbs_needed(xhci, urb, i); in xhci_queue_isoc_tx_prepare()
3925 num_trbs, mem_flags); in xhci_queue_isoc_tx_prepare()