Lines Matching refs:ep_ring
570 struct xhci_ring *ep_ring;
581 ep_ring = xhci_triad_to_transfer_ring(xhci, slot_id,
583 if (!ep_ring) {
595 if (list_empty(&ep_ring->td_list)) {
596 state->new_deq_seg = ep_ring->enq_seg;
597 state->new_deq_ptr = ep_ring->enqueue;
598 state->new_cycle_state = ep_ring->cycle_state;
611 new_seg = ep_ring->deq_seg;
612 new_deq = ep_ring->dequeue;
657 next_trb(xhci, ep_ring, &new_seg, &new_deq);
690 static void td_to_noop(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
706 next_trb(xhci, ep_ring, &seg, &trb);
777 struct xhci_ring *ep_ring, int status)
785 xhci_unmap_td_bounce_buffer(xhci, ep_ring, td);
937 struct xhci_ring *ep_ring;
1002 ep_ring = xhci_urb_to_transfer_ring(xhci, cur_td->urb);
1003 xhci_unmap_td_bounce_buffer(xhci, ep_ring, cur_td);
1175 struct xhci_ring *ep_ring,
1182 num_trbs_free_temp = ep_ring->num_trbs_free;
1183 dequeue_temp = ep_ring->dequeue;
1191 if (trb_is_link(ep_ring->dequeue)) {
1192 ep_ring->deq_seg = ep_ring->deq_seg->next;
1193 ep_ring->dequeue = ep_ring->deq_seg->trbs;
1196 while (ep_ring->dequeue != dev->eps[ep_index].queued_deq_ptr) {
1198 ep_ring->num_trbs_free++;
1199 ep_ring->dequeue++;
1200 if (trb_is_link(ep_ring->dequeue)) {
1201 if (ep_ring->dequeue ==
1204 ep_ring->deq_seg = ep_ring->deq_seg->next;
1205 ep_ring->dequeue = ep_ring->deq_seg->trbs;
1207 if (ep_ring->dequeue == dequeue_temp) {
1215 ep_ring->num_trbs_free = num_trbs_free_temp;
1231 struct xhci_ring *ep_ring;
1244 ep_ring = xhci_stream_id_to_ring(dev, ep_index, stream_id);
1245 if (!ep_ring) {
1307 ep_ring, ep_index);
2063 struct xhci_ring *ep_ring, struct xhci_td *td,
2095 xhci_handle_halted_endpoint(xhci, ep, ep_ring->stream_id, td,
2099 ep_ring->dequeue = td->last_trb;
2100 ep_ring->deq_seg = td->last_trb_seg;
2101 ep_ring->num_trbs_free += td->num_trbs - 1;
2102 inc_deq(xhci, ep_ring);
2105 return xhci_td_cleanup(xhci, td, ep_ring, td->status);
2127 struct xhci_ring *ep_ring, struct xhci_td *td,
2216 return finish_td(xhci, ep, ep_ring, td, trb_comp_code);
2223 struct xhci_ring *ep_ring, struct xhci_td *td,
2320 return finish_td(xhci, ep, ep_ring, td, trb_comp_code);
2353 struct xhci_ring *ep_ring, struct xhci_td *td,
2400 xhci_handle_halted_endpoint(xhci, ep, ep_ring->stream_id, td,
2412 sum_trb_lengths(xhci, ep_ring, ep_trb) +
2421 return finish_td(xhci, ep, ep_ring, td, trb_comp_code);
2434 struct xhci_ring *ep_ring;
2460 ep_ring = xhci_dma_to_transfer_ring(ep, ep_trb_dma);
2471 if (!ep_ring) {
2500 list_for_each(tmp, &ep_ring->td_list)
2513 ep_ring->last_td_was_short)
2589 if (!list_empty(&ep_ring->td_list))
2597 if (!list_empty(&ep_ring->td_list))
2607 * Set skip flag of the ep_ring; Complete the missed tds as
2608 * short transfer when process the ep_ring next time.
2644 if (list_empty(&ep_ring->td_list)) {
2655 ep_ring->last_td_was_short)) {
2669 ep_ring->stream_id,
2679 xhci_dbg(xhci, "All tds on the ep_ring skipped. Clear skip flag for slot %u ep %u.\n",
2684 td = list_first_entry(&ep_ring->td_list, struct xhci_td,
2690 ep_seg = trb_in_td(xhci, ep_ring->deq_seg, ep_ring->dequeue,
2695 * is not in the current TD pointed by ep_ring->dequeue because
2718 ep_ring->last_td_was_short) {
2719 ep_ring->last_td_was_short = false;
2735 !list_is_last(&td->td_list, &ep_ring->td_list)) {
2743 ep_ring->dequeue = td->last_trb;
2744 ep_ring->deq_seg = td->last_trb_seg;
2745 inc_deq(xhci, ep_ring);
2746 xhci_td_cleanup(xhci, td, ep_ring, td->status);
2758 trb_in_td(xhci, ep_ring->deq_seg,
2759 ep_ring->dequeue, td->last_trb,
2765 ep_ring->last_td_was_short = true;
2767 ep_ring->last_td_was_short = false;
2779 trace_xhci_handle_transfer(ep_ring,
2795 ep_ring->stream_id,
2804 process_ctrl_td(xhci, ep, ep_ring, td, ep_trb, event);
2806 process_isoc_td(xhci, ep, ep_ring, td, ep_trb, event);
2808 process_bulk_intr_td(xhci, ep, ep_ring, td, ep_trb, event);
3077 static int prepare_ring(struct xhci_hcd *xhci, struct xhci_ring *ep_ring,
3111 if (room_on_ring(xhci, ep_ring, num_trbs))
3114 if (ep_ring == xhci->cmd_ring) {
3121 num_trbs_needed = num_trbs - ep_ring->num_trbs_free;
3122 if (xhci_ring_expansion(xhci, ep_ring, num_trbs_needed,
3129 while (trb_is_link(ep_ring->enqueue)) {
3134 !(ep_ring->type == TYPE_ISOC &&
3136 ep_ring->enqueue->link.control &=
3139 ep_ring->enqueue->link.control |=
3143 ep_ring->enqueue->link.control ^= cpu_to_le32(TRB_CYCLE);
3146 if (link_trb_toggles_cycle(ep_ring->enqueue))
3147 ep_ring->cycle_state ^= 1;
3149 ep_ring->enq_seg = ep_ring->enq_seg->next;
3150 ep_ring->enqueue = ep_ring->enq_seg->trbs;
3167 struct xhci_ring *ep_ring;
3170 ep_ring = xhci_stream_id_to_ring(xdev, ep_index, stream_id);
3171 if (!ep_ring) {
3177 ret = prepare_ring(xhci, ep_ring, GET_EP_CTX_STATE(ep_ctx),
3196 list_add_tail(&td->td_list, &ep_ring->td_list);
3197 td->start_seg = ep_ring->enq_seg;
3198 td->first_trb = ep_ring->enqueue;
3605 struct xhci_ring *ep_ring;
3615 ep_ring = xhci_urb_to_transfer_ring(xhci, urb);
3616 if (!ep_ring)
3650 start_trb = &ep_ring->enqueue->generic;
3651 start_cycle = ep_ring->cycle_state;
3671 queue_trb(xhci, ep_ring, true,
3707 queue_trb(xhci, ep_ring, true,
3711 field | ep_ring->cycle_state);
3715 td->last_trb = ep_ring->enqueue;
3716 td->last_trb_seg = ep_ring->enq_seg;
3724 queue_trb(xhci, ep_ring, false,
3729 field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state);
3902 struct xhci_ring *ep_ring;
3918 ep_ring = xhci->devs[slot_id]->eps[ep_index].ring;
3926 start_trb = &ep_ring->enqueue->generic;
3927 start_cycle = ep_ring->cycle_state;
3978 (i ? ep_ring->cycle_state : !start_cycle);
3991 ep_ring->cycle_state;
4003 td->last_trb = ep_ring->enqueue;
4004 td->last_trb_seg = ep_ring->enq_seg;
4029 queue_trb(xhci, ep_ring, more_trbs_coming,
4072 urb_priv->td[0].last_trb = ep_ring->enqueue;
4074 td_to_noop(xhci, ep_ring, &urb_priv->td[0], true);
4077 ep_ring->enqueue = urb_priv->td[0].first_trb;
4078 ep_ring->enq_seg = urb_priv->td[0].start_seg;
4079 ep_ring->cycle_state = start_cycle;
4080 ep_ring->num_trbs_free = ep_ring->num_trbs_free_temp;
4096 struct xhci_ring *ep_ring;
4106 ep_ring = xdev->eps[ep_index].ring;
4117 ret = prepare_ring(xhci, ep_ring, GET_EP_CTX_STATE(ep_ctx),
4129 if (HCC_CFC(xhci->hcc_params) && !list_empty(&ep_ring->td_list)) {
4162 ep_ring->num_trbs_free_temp = ep_ring->num_trbs_free;