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[stream_id]; 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 cdnsp_find_new_dequeue_state(pdev, pep, preq->request.stream_id, in cdnsp_remove_request()
733 pep->stream_info.td_count--; in cdnsp_remove_request()
741 ret = cdnsp_cmd_set_deq(pdev, pep, &deq_state); in cdnsp_remove_request()
745 cdnsp_gadget_giveback(pep, cur_td->preq, status); in cdnsp_remove_request()
910 preq->pep->stream_info.td_count--; in cdnsp_td_cleanup()
912 cdnsp_gadget_giveback(preq->pep, preq, *status); in cdnsp_td_cleanup()
964 struct cdnsp_ep *pep, in cdnsp_giveback_first_trb() argument
980 if ((pep->ep_state & EP_HAS_STREAMS) && in cdnsp_giveback_first_trb()
981 !pep->stream_info.first_prime_det) { in cdnsp_giveback_first_trb()
982 trace_cdnsp_wait_for_prime(pep, stream_id); in cdnsp_giveback_first_trb()
986 return cdnsp_ring_ep_doorbell(pdev, pep, stream_id); in cdnsp_giveback_first_trb()
996 struct cdnsp_ep *pep, in cdnsp_process_ctrl_td() argument
1004 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_process_ctrl_td()
1021 if (pdev->ep0_stage == CDNSP_DATA_STAGE && pep->number == 0 && in cdnsp_process_ctrl_td()
1027 cdnsp_giveback_first_trb(pdev, pep, 0, ep_ring->cycle_state, in cdnsp_process_ctrl_td()
1034 cdnsp_finish_td(pdev, td, event, pep, status); in cdnsp_process_ctrl_td()
1044 struct cdnsp_ep *pep, in cdnsp_process_isoc_td() argument
1054 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_process_isoc_td()
1101 cdnsp_finish_td(pdev, td, event, pep, &status); in cdnsp_process_isoc_td()
1107 struct cdnsp_ep *pep, in cdnsp_skip_isoc_td() argument
1112 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_skip_isoc_td()
1178 struct cdnsp_ep *pep; in cdnsp_handle_tx_nrdy() local
1189 pep = &pdev->eps[ep_index]; in cdnsp_handle_tx_nrdy()
1191 if (!(pep->ep_state & EP_HAS_STREAMS)) in cdnsp_handle_tx_nrdy()
1195 pep->stream_info.first_prime_det = 1; in cdnsp_handle_tx_nrdy()
1196 for (cur_stream = 1; cur_stream < pep->stream_info.num_streams; in cdnsp_handle_tx_nrdy()
1198 ep_ring = pep->stream_info.stream_rings[cur_stream]; in cdnsp_handle_tx_nrdy()
1207 pep->stream_info.drbls_count--; in cdnsp_handle_tx_nrdy()
1208 ep_ring = pep->stream_info.stream_rings[dev_sid]; in cdnsp_handle_tx_nrdy()
1218 cdnsp_ring_doorbell_for_active_rings(pdev, pep); in cdnsp_handle_tx_nrdy()
1235 struct cdnsp_ep *pep; in cdnsp_handle_tx_event() local
1246 pep = &pdev->eps[ep_index]; in cdnsp_handle_tx_event()
1247 ep_ring = cdnsp_dma_to_transfer_ring(pep, le64_to_cpu(event->buffer)); in cdnsp_handle_tx_event()
1257 if (GET_EP_CTX_STATE(pep->out_ctx) == EP_STATE_DISABLED) { in cdnsp_handle_tx_event()
1258 trace_cdnsp_ep_disabled(pep->out_ctx); in cdnsp_handle_tx_event()
1272 pep->name); in cdnsp_handle_tx_event()
1297 pep->skip = true; in cdnsp_handle_tx_event()
1320 if (pep->skip) { in cdnsp_handle_tx_event()
1321 pep->skip = false; in cdnsp_handle_tx_event()
1322 trace_cdnsp_ep_list_empty_with_skip(pep, 0); in cdnsp_handle_tx_event()
1336 desc = td->preq->pep->endpoint.desc; in cdnsp_handle_tx_event()
1345 if (pep->skip && usb_endpoint_xfer_isoc(desc) && in cdnsp_handle_tx_event()
1360 pep->skip = false; in cdnsp_handle_tx_event()
1365 if (!pep->skip || !usb_endpoint_xfer_isoc(desc)) { in cdnsp_handle_tx_event()
1375 cdnsp_skip_isoc_td(pdev, td, event, pep, status); in cdnsp_handle_tx_event()
1384 if (pep->skip) { in cdnsp_handle_tx_event()
1385 pep->skip = false; in cdnsp_handle_tx_event()
1386 cdnsp_skip_isoc_td(pdev, td, event, pep, status); in cdnsp_handle_tx_event()
1394 cdnsp_process_ctrl_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1397 cdnsp_process_isoc_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1400 cdnsp_process_bulk_intr_td(pdev, td, ep_trb, event, pep, in cdnsp_handle_tx_event()
1403 handling_skipped_tds = pep->skip; in cdnsp_handle_tx_event()
1675 ep_ring = cdnsp_get_transfer_ring(pdev, preq->pep, in cdnsp_prepare_transfer()
1681 GET_EP_CTX_STATE(preq->pep->out_ctx), in cdnsp_prepare_transfer()
1692 preq->pep->stream_info.td_count++; in cdnsp_prepare_transfer()
1739 dev_err(preq->pep->pdev->dev, in cdnsp_check_trb_math()
1742 preq->pep->name, running_total, in cdnsp_check_trb_math()
1782 maxp = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_td_remainder()
1798 max_pkt = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_align_td()
1869 struct cdnsp_ep *pep; in cdnsp_queue_bulk_tx() local
1891 pep = preq->pep; in cdnsp_queue_bulk_tx()
1895 IS_ALIGNED(full_len, usb_endpoint_maxp(pep->endpoint.desc))) { in cdnsp_queue_bulk_tx()
2000 ret = cdnsp_giveback_first_trb(pdev, pep, preq->request.stream_id, in cdnsp_queue_bulk_tx()
2012 struct cdnsp_ep *pep = preq->pep; in cdnsp_queue_ctrl_tx() local
2025 maxp = usb_endpoint_maxp(pep->endpoint.desc); in cdnsp_queue_ctrl_tx()
2088 if (pep->ep_state & EP0_HALTED_STATUS) { in cdnsp_queue_ctrl_tx()
2089 pep->ep_state &= ~EP0_HALTED_STATUS; in cdnsp_queue_ctrl_tx()
2099 cdnsp_ring_ep_doorbell(pdev, pep, preq->request.stream_id); in cdnsp_queue_ctrl_tx()
2104 int cdnsp_cmd_stop_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_cmd_stop_ep() argument
2106 u32 ep_state = GET_EP_CTX_STATE(pep->out_ctx); in cdnsp_cmd_stop_ep()
2111 trace_cdnsp_ep_stopped_or_disabled(pep->out_ctx); in cdnsp_cmd_stop_ep()
2115 cdnsp_queue_stop_endpoint(pdev, pep->idx); in cdnsp_cmd_stop_ep()
2119 trace_cdnsp_handle_cmd_stop_ep(pep->out_ctx); in cdnsp_cmd_stop_ep()
2122 pep->ep_state |= EP_STOPPED; in cdnsp_cmd_stop_ep()
2126 int cdnsp_cmd_flush_ep(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_cmd_flush_ep() argument
2130 cdnsp_queue_flush_endpoint(pdev, pep->idx); in cdnsp_cmd_flush_ep()
2134 trace_cdnsp_handle_cmd_flush_ep(pep->out_ctx); in cdnsp_cmd_flush_ep()
2156 max_burst = preq->pep->endpoint.comp_desc->bMaxBurst; in cdnsp_get_burst_count()
2178 max_burst = preq->pep->endpoint.comp_desc->bMaxBurst; in cdnsp_get_last_burst_packet_count()
2215 ep_ring = preq->pep->ring; in cdnsp_queue_isoc_tx()
2240 max_pkt = usb_endpoint_maxp(preq->pep->endpoint.desc); in cdnsp_queue_isoc_tx()
2289 if (usb_endpoint_dir_out(preq->pep->endpoint.desc)) in cdnsp_queue_isoc_tx()
2333 cdnsp_giveback_first_trb(pdev, preq->pep, preq->request.stream_id, in cdnsp_queue_isoc_tx()
2429 struct cdnsp_ep *pep, in cdnsp_queue_new_dequeue_state() argument
2447 EP_ID_FOR_TRB(pep->idx) | type); in cdnsp_queue_new_dequeue_state()