Lines Matching refs:pep
277 struct cdnsp_ep *pep, in cdnsp_ring_ep_doorbell() argument
281 unsigned int ep_state = pep->ep_state; in cdnsp_ring_ep_doorbell()
292 if (pep->ep_state & EP_HAS_STREAMS) { in cdnsp_ring_ep_doorbell()
293 if (pep->stream_info.drbls_count >= 2) in cdnsp_ring_ep_doorbell()
296 pep->stream_info.drbls_count++; in cdnsp_ring_ep_doorbell()
299 pep->ep_state &= ~EP_STOPPED; in cdnsp_ring_ep_doorbell()
301 if (pep->idx == 0 && pdev->ep0_stage == CDNSP_DATA_STAGE && in cdnsp_ring_ep_doorbell()
303 db_value = DB_VALUE_EP0_OUT(pep->idx, stream_id); in cdnsp_ring_ep_doorbell()
305 db_value = DB_VALUE(pep->idx, stream_id); in cdnsp_ring_ep_doorbell()
307 trace_cdnsp_tr_drbl(pep, stream_id); in cdnsp_ring_ep_doorbell()
323 struct cdnsp_ep *pep, in cdnsp_get_transfer_ring() argument
326 if (!(pep->ep_state & EP_HAS_STREAMS)) in cdnsp_get_transfer_ring()
327 return pep->ring; in cdnsp_get_transfer_ring()
329 if (stream_id == 0 || stream_id >= pep->stream_info.num_streams) { in cdnsp_get_transfer_ring()
331 pep->name, stream_id); in cdnsp_get_transfer_ring()
335 return pep->stream_info.stream_rings[stream_id]; in cdnsp_get_transfer_ring()
342 return cdnsp_get_transfer_ring(pdev, preq->pep, in cdnsp_request_to_transfer_ring()
348 struct cdnsp_ep *pep) in cdnsp_ring_doorbell_for_active_rings() argument
354 if (pep->ep_state & EP_DIS_IN_RROGRESS) in cdnsp_ring_doorbell_for_active_rings()
358 if (!(pep->ep_state & EP_HAS_STREAMS) && pep->number) { in cdnsp_ring_doorbell_for_active_rings()
359 if (pep->ring && !list_empty(&pep->ring->td_list)) in cdnsp_ring_doorbell_for_active_rings()
360 cdnsp_ring_ep_doorbell(pdev, pep, 0); in cdnsp_ring_doorbell_for_active_rings()
364 stream_info = &pep->stream_info; in cdnsp_ring_doorbell_for_active_rings()
373 ep_ring = cdnsp_get_transfer_ring(pdev, pep, stream_id); in cdnsp_ring_doorbell_for_active_rings()
385 ret = cdnsp_ring_ep_doorbell(pdev, pep, stream_id); in cdnsp_ring_doorbell_for_active_rings()
403 struct cdnsp_ep *pep; in cdnsp_get_hw_deq() local
405 pep = &pdev->eps[ep_index]; in cdnsp_get_hw_deq()
407 if (pep->ep_state & EP_HAS_STREAMS) { in cdnsp_get_hw_deq()
408 st_ctx = &pep->stream_info.stream_ctx_array[stream_id]; in cdnsp_get_hw_deq()
412 return le64_to_cpu(pep->out_ctx->deq); in cdnsp_get_hw_deq()
431 struct cdnsp_ep *pep, in cdnsp_find_new_dequeue_state() argument
443 ep_ring = cdnsp_get_transfer_ring(pdev, pep, stream_id); in cdnsp_find_new_dequeue_state()
451 hw_dequeue = cdnsp_get_hw_deq(pdev, pep->idx, stream_id); in cdnsp_find_new_dequeue_state()
482 if (new_deq == pep->ring->dequeue) { in cdnsp_find_new_dequeue_state()
635 struct cdnsp_ep *pep, in cdnsp_cmd_set_deq() argument
642 cdnsp_ring_doorbell_for_active_rings(pdev, pep); in cdnsp_cmd_set_deq()
646 cdnsp_queue_new_dequeue_state(pdev, pep, deq_state); in cdnsp_cmd_set_deq()
651 trace_cdnsp_handle_cmd_set_deq_ep(pep->out_ctx); in cdnsp_cmd_set_deq()
657 ep_ring = cdnsp_get_transfer_ring(pdev, pep, deq_state->stream_id); in cdnsp_cmd_set_deq()
685 cdnsp_ring_doorbell_for_active_rings(pdev, pep); in cdnsp_cmd_set_deq()
692 struct cdnsp_ep *pep) in cdnsp_remove_request() argument
704 trace_cdnsp_remove_request(pep->out_ctx); in cdnsp_remove_request()
715 hw_deq = cdnsp_get_hw_deq(pdev, pep->idx, preq->request.stream_id); in cdnsp_remove_request()
721 if (seg && (pep->ep_state & EP_ENABLED) && in cdnsp_remove_request()
722 !(pep->ep_state & EP_DIS_IN_RROGRESS)) in cdnsp_remove_request()
723 cdnsp_find_new_dequeue_state(pdev, pep, preq->request.stream_id, in cdnsp_remove_request()
734 pep->stream_info.td_count--; in cdnsp_remove_request()
741 pep->ep_state & EP_DIS_IN_RROGRESS) { in cdnsp_remove_request()
743 ret = cdnsp_cmd_set_deq(pdev, pep, &deq_state); in cdnsp_remove_request()
747 cdnsp_gadget_giveback(pep, cur_td->preq, status); in cdnsp_remove_request()
912 preq->pep->stream_info.td_count--; in cdnsp_td_cleanup()
914 cdnsp_gadget_giveback(preq->pep, preq, *status); in cdnsp_td_cleanup()
966 struct cdnsp_ep *pep, in cdnsp_giveback_first_trb() argument
982 if ((pep->ep_state & EP_HAS_STREAMS) && in cdnsp_giveback_first_trb()
983 !pep->stream_info.first_prime_det) { in cdnsp_giveback_first_trb()
984 trace_cdnsp_wait_for_prime(pep, stream_id); in cdnsp_giveback_first_trb()
988 return cdnsp_ring_ep_doorbell(pdev, pep, stream_id); in cdnsp_giveback_first_trb()
998 struct cdnsp_ep *pep, in cdnsp_process_ctrl_td() argument
1006 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_process_ctrl_td()
1023 if (pdev->ep0_stage == CDNSP_DATA_STAGE && pep->number == 0 && in cdnsp_process_ctrl_td()
1029 cdnsp_giveback_first_trb(pdev, pep, 0, ep_ring->cycle_state, in cdnsp_process_ctrl_td()
1036 cdnsp_finish_td(pdev, td, event, pep, status); in cdnsp_process_ctrl_td()
1046 struct cdnsp_ep *pep, in cdnsp_process_isoc_td() argument
1056 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_process_isoc_td()
1103 cdnsp_finish_td(pdev, td, event, pep, &status); in cdnsp_process_isoc_td()
1109 struct cdnsp_ep *pep, in cdnsp_skip_isoc_td() argument
1114 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_skip_isoc_td()
1180 struct cdnsp_ep *pep; in cdnsp_handle_tx_nrdy() local
1191 pep = &pdev->eps[ep_index]; in cdnsp_handle_tx_nrdy()
1193 if (!(pep->ep_state & EP_HAS_STREAMS)) in cdnsp_handle_tx_nrdy()
1197 pep->stream_info.first_prime_det = 1; in cdnsp_handle_tx_nrdy()
1198 for (cur_stream = 1; cur_stream < pep->stream_info.num_streams; in cdnsp_handle_tx_nrdy()
1200 ep_ring = pep->stream_info.stream_rings[cur_stream]; in cdnsp_handle_tx_nrdy()
1209 pep->stream_info.drbls_count--; in cdnsp_handle_tx_nrdy()
1210 ep_ring = pep->stream_info.stream_rings[dev_sid]; in cdnsp_handle_tx_nrdy()
1220 cdnsp_ring_doorbell_for_active_rings(pdev, pep); in cdnsp_handle_tx_nrdy()
1237 struct cdnsp_ep *pep; in cdnsp_handle_tx_event() local
1248 pep = &pdev->eps[ep_index]; in cdnsp_handle_tx_event()
1249 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_handle_tx_event()
1259 if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_DISABLED) { in cdnsp_handle_tx_event()
1260 trace_cdnsp_ep_disabled(pep->out_ctx); in cdnsp_handle_tx_event()
1274 pep->name); in cdnsp_handle_tx_event()
1299 pep->skip = true; in cdnsp_handle_tx_event()
1322 if (pep->skip) { in cdnsp_handle_tx_event()
1323 pep->skip = false; in cdnsp_handle_tx_event()
1324 trace_cdnsp_ep_list_empty_with_skip(pep, 0); in cdnsp_handle_tx_event()
1338 desc = td->preq->pep->endpoint.desc; in cdnsp_handle_tx_event()
1347 if (pep->skip && usb_endpoint_xfer_isoc(desc) && in cdnsp_handle_tx_event()
1362 pep->skip = false; in cdnsp_handle_tx_event()
1367 if (!pep->skip || !usb_endpoint_xfer_isoc(desc)) { in cdnsp_handle_tx_event()
1377 cdnsp_skip_isoc_td(pdev, td, event, pep, status); in cdnsp_handle_tx_event()
1386 if (pep->skip) { in cdnsp_handle_tx_event()
1387 pep->skip = false; in cdnsp_handle_tx_event()
1388 cdnsp_skip_isoc_td(pdev, td, event, pep, status); in cdnsp_handle_tx_event()
1396 cdnsp_process_ctrl_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1399 cdnsp_process_isoc_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1402 cdnsp_process_bulk_intr_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1405 handling_skipped_tds = pep->skip; in cdnsp_handle_tx_event()
1680 ep_ring = cdnsp_get_transfer_ring(pdev, preq->pep, in cdnsp_prepare_transfer()
1686 GET_EP_CTX_STATE(preq->pep->out_ctx), in cdnsp_prepare_transfer()
1697 preq->pep->stream_info.td_count++; in cdnsp_prepare_transfer()
1744 dev_err(preq->pep->pdev->dev, in cdnsp_check_trb_math()
1747 preq->pep->name, running_total, in cdnsp_check_trb_math()
1787 maxp = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_td_remainder()
1803 max_pkt = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_align_td()
1874 struct cdnsp_ep *pep; in cdnsp_queue_bulk_tx() local
1896 pep = preq->pep; in cdnsp_queue_bulk_tx()
1900 IS_ALIGNED(full_len, usb_endpoint_maxp(pep->endpoint.desc))) { in cdnsp_queue_bulk_tx()
1918 if (pep->wa1_nop_trb) { in cdnsp_queue_bulk_tx()
1919 field = le32_to_cpu(pep->wa1_nop_trb->trans_event.flags); in cdnsp_queue_bulk_tx()
1922 pep->wa1_nop_trb->trans_event.flags = cpu_to_le32(field); in cdnsp_queue_bulk_tx()
1923 pep->wa1_nop_trb = NULL; in cdnsp_queue_bulk_tx()
2026 pep->wa1_nop_trb = ring->enqueue; in cdnsp_queue_bulk_tx()
2033 ret = cdnsp_giveback_first_trb(pdev, pep, preq->request.stream_id, in cdnsp_queue_bulk_tx()
2045 struct cdnsp_ep *pep = preq->pep; in cdnsp_queue_ctrl_tx() local
2058 maxp = usb_endpoint_maxp(pep->endpoint.desc); in cdnsp_queue_ctrl_tx()
2121 if (pep->ep_state & EP0_HALTED_STATUS) { in cdnsp_queue_ctrl_tx()
2122 pep->ep_state &= ~EP0_HALTED_STATUS; in cdnsp_queue_ctrl_tx()
2132 cdnsp_ring_ep_doorbell(pdev, pep, preq->request.stream_id); in cdnsp_queue_ctrl_tx()
2137 int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_cmd_stop_ep() argument
2139 u32 ep_state = GET_EP_CTX_STATE(pep->out_ctx); in cdnsp_cmd_stop_ep()
2144 trace_cdnsp_ep_stopped_or_disabled(pep->out_ctx); in cdnsp_cmd_stop_ep()
2148 cdnsp_queue_stop_endpoint(pdev, pep->idx); in cdnsp_cmd_stop_ep()
2152 trace_cdnsp_handle_cmd_stop_ep(pep->out_ctx); in cdnsp_cmd_stop_ep()
2155 pep->ep_state |= EP_STOPPED; in cdnsp_cmd_stop_ep()
2159 int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_cmd_flush_ep() argument
2163 cdnsp_queue_flush_endpoint(pdev, pep->idx); in cdnsp_cmd_flush_ep()
2167 trace_cdnsp_handle_cmd_flush_ep(pep->out_ctx); in cdnsp_cmd_flush_ep()
2189 max_burst = preq->pep->endpoint.comp_desc->bMaxBurst; in cdnsp_get_burst_count()
2211 max_burst = preq->pep->endpoint.comp_desc->bMaxBurst; in cdnsp_get_last_burst_packet_count()
2248 ep_ring = preq->pep->ring; in cdnsp_queue_isoc_tx()
2273 max_pkt = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_queue_isoc_tx()
2322 if (usb_endpoint_dir_out(preq->pep->endpoint.desc)) in cdnsp_queue_isoc_tx()
2366 cdnsp_giveback_first_trb(pdev, preq->pep, preq->request.stream_id, in cdnsp_queue_isoc_tx()
2462 struct cdnsp_ep *pep, in cdnsp_queue_new_dequeue_state() argument
2480 EP_ID_FOR_TRB(pep->idx) | type); in cdnsp_queue_new_dequeue_state()