Lines Matching refs:pep

22 				   struct cdnsp_ep *pep);
410 void cdnsp_free_endpoint_rings(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_free_endpoint_rings() argument
412 cdnsp_ring_free(pdev, pep->ring); in cdnsp_free_endpoint_rings()
413 pep->ring = NULL; in cdnsp_free_endpoint_rings()
414 cdnsp_free_stream_info(pdev, pep); in cdnsp_free_endpoint_rings()
518 struct cdnsp_ep *pep) in cdnsp_free_stream_ctx() argument
520 dma_pool_free(pdev->device_pool, pep->stream_info.stream_ctx_array, in cdnsp_free_stream_ctx()
521 pep->stream_info.ctx_array_dma); in cdnsp_free_stream_ctx()
526 *cdnsp_alloc_stream_ctx(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_alloc_stream_ctx() argument
529 pep->stream_info.num_stream_ctxs; in cdnsp_alloc_stream_ctx()
540 &pep->stream_info.ctx_array_dma); in cdnsp_alloc_stream_ctx()
543 struct cdnsp_ring *cdnsp_dma_to_transfer_ring(struct cdnsp_ep *pep, u64 address) in cdnsp_dma_to_transfer_ring() argument
545 if (pep->ep_state & EP_HAS_STREAMS) in cdnsp_dma_to_transfer_ring()
546 return radix_tree_lookup(&pep->stream_info.trb_address_map, in cdnsp_dma_to_transfer_ring()
549 return pep->ring; in cdnsp_dma_to_transfer_ring()
562 struct cdnsp_ep *pep, in cdnsp_alloc_stream_info() argument
573 stream_info = &pep->stream_info; in cdnsp_alloc_stream_info()
585 stream_info->stream_ctx_array = cdnsp_alloc_stream_ctx(pdev, pep); in cdnsp_alloc_stream_info()
592 mps = usb_endpoint_maxp(pep->endpoint.desc); in cdnsp_alloc_stream_info()
636 kfree(pep->stream_info.stream_rings); in cdnsp_alloc_stream_info()
643 struct cdnsp_ep *pep) in cdnsp_free_stream_info() argument
645 struct cdnsp_stream_info *stream_info = &pep->stream_info; in cdnsp_free_stream_info()
649 if (!(pep->ep_state & EP_HAS_STREAMS)) in cdnsp_free_stream_info()
662 cdnsp_free_stream_ctx(pdev, pep); in cdnsp_free_stream_info()
665 pep->ep_state &= ~EP_HAS_STREAMS; in cdnsp_free_stream_info()
782 struct cdnsp_ep *pep) in cdnsp_parse_exponent_interval() argument
786 interval = clamp_val(pep->endpoint.desc->bInterval, 1, 16) - 1; in cdnsp_parse_exponent_interval()
787 if (interval != pep->endpoint.desc->bInterval - 1) in cdnsp_parse_exponent_interval()
789 pep->name, 1 << interval, in cdnsp_parse_exponent_interval()
812 struct cdnsp_ep *pep, in cdnsp_microframes_to_exponent() argument
830 struct cdnsp_ep *pep) in cdnsp_get_endpoint_interval() argument
838 if (usb_endpoint_xfer_int(pep->endpoint.desc) || in cdnsp_get_endpoint_interval()
839 usb_endpoint_xfer_isoc(pep->endpoint.desc)) in cdnsp_get_endpoint_interval()
840 interval = cdnsp_parse_exponent_interval(g, pep); in cdnsp_get_endpoint_interval()
843 if (usb_endpoint_xfer_isoc(pep->endpoint.desc)) { in cdnsp_get_endpoint_interval()
844 interval = cdnsp_parse_exponent_interval(g, pep); in cdnsp_get_endpoint_interval()
845 } else if (usb_endpoint_xfer_int(pep->endpoint.desc)) { in cdnsp_get_endpoint_interval()
846 interval = pep->endpoint.desc->bInterval << 3; in cdnsp_get_endpoint_interval()
847 interval = cdnsp_microframes_to_exponent(g, pep, in cdnsp_get_endpoint_interval()
866 static u32 cdnsp_get_endpoint_mult(struct usb_gadget *g, struct cdnsp_ep *pep) in cdnsp_get_endpoint_mult() argument
869 !usb_endpoint_xfer_isoc(pep->endpoint.desc)) in cdnsp_get_endpoint_mult()
872 return pep->endpoint.comp_desc->bmAttributes; in cdnsp_get_endpoint_mult()
876 struct cdnsp_ep *pep) in cdnsp_get_endpoint_max_burst() argument
880 return pep->endpoint.comp_desc->bMaxBurst; in cdnsp_get_endpoint_max_burst()
883 (usb_endpoint_xfer_isoc(pep->endpoint.desc) || in cdnsp_get_endpoint_max_burst()
884 usb_endpoint_xfer_int(pep->endpoint.desc))) in cdnsp_get_endpoint_max_burst()
885 return usb_endpoint_maxp_mult(pep->endpoint.desc) - 1; in cdnsp_get_endpoint_max_burst()
916 struct cdnsp_ep *pep) in cdnsp_get_max_esit_payload() argument
922 if (usb_endpoint_xfer_control(pep->endpoint.desc) || in cdnsp_get_max_esit_payload()
923 usb_endpoint_xfer_bulk(pep->endpoint.desc)) in cdnsp_get_max_esit_payload()
928 USB_SS_SSP_ISOC_COMP(pep->endpoint.desc->bmAttributes)) in cdnsp_get_max_esit_payload()
929 return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); in cdnsp_get_max_esit_payload()
932 return le16_to_cpu(pep->endpoint.comp_desc->wBytesPerInterval); in cdnsp_get_max_esit_payload()
934 max_packet = usb_endpoint_maxp(pep->endpoint.desc); in cdnsp_get_max_esit_payload()
935 max_burst = usb_endpoint_maxp_mult(pep->endpoint.desc); in cdnsp_get_max_esit_payload()
942 struct cdnsp_ep *pep, in cdnsp_endpoint_init() argument
957 ep_ctx = pep->in_ctx; in cdnsp_endpoint_init()
959 endpoint_type = cdnsp_get_endpoint_type(pep->endpoint.desc); in cdnsp_endpoint_init()
963 ring_type = usb_endpoint_type(pep->endpoint.desc); in cdnsp_endpoint_init()
971 max_esit_payload = cdnsp_get_max_esit_payload(&pdev->gadget, pep); in cdnsp_endpoint_init()
972 interval = cdnsp_get_endpoint_interval(&pdev->gadget, pep); in cdnsp_endpoint_init()
973 mult = cdnsp_get_endpoint_mult(&pdev->gadget, pep); in cdnsp_endpoint_init()
974 max_packet = usb_endpoint_maxp(pep->endpoint.desc); in cdnsp_endpoint_init()
975 max_burst = cdnsp_get_endpoint_max_burst(&pdev->gadget, pep); in cdnsp_endpoint_init()
979 if (!usb_endpoint_xfer_isoc(pep->endpoint.desc)) in cdnsp_endpoint_init()
981 if (usb_endpoint_xfer_bulk(pep->endpoint.desc) && in cdnsp_endpoint_init()
985 if (usb_endpoint_xfer_control(pep->endpoint.desc)) in cdnsp_endpoint_init()
989 pep->ring = cdnsp_ring_alloc(pdev, 2, ring_type, max_packet, mem_flags); in cdnsp_endpoint_init()
990 if (!pep->ring) in cdnsp_endpoint_init()
993 pep->skip = false; in cdnsp_endpoint_init()
1001 ep_ctx->deq = cpu_to_le64(pep->ring->first_seg->dma | in cdnsp_endpoint_init()
1002 pep->ring->cycle_state); in cdnsp_endpoint_init()
1007 if (usb_endpoint_xfer_bulk(pep->endpoint.desc) && in cdnsp_endpoint_init()
1009 ret = cdnsp_alloc_streams(pdev, pep); in cdnsp_endpoint_init()
1017 void cdnsp_endpoint_zero(struct cdnsp_device *pdev, struct cdnsp_ep *pep) in cdnsp_endpoint_zero() argument
1019 pep->in_ctx->ep_info = 0; in cdnsp_endpoint_zero()
1020 pep->in_ctx->ep_info2 = 0; in cdnsp_endpoint_zero()
1021 pep->in_ctx->deq = 0; in cdnsp_endpoint_zero()
1022 pep->in_ctx->tx_info = 0; in cdnsp_endpoint_zero()