Lines Matching full:ep

51 /* Free the bdl during ep disable */
52 static void ep_bd_list_free(struct bdc_ep *ep, u32 num_tabs) in ep_bd_list_free() argument
54 struct bd_list *bd_list = &ep->bd_list; in ep_bd_list_free()
55 struct bdc *bdc = ep->bdc; in ep_bd_list_free()
59 dev_dbg(bdc->dev, "%s ep:%s num_tabs:%d\n", in ep_bd_list_free()
60 __func__, ep->name, num_tabs); in ep_bd_list_free()
63 dev_dbg(bdc->dev, "%s already freed\n", ep->name); in ep_bd_list_free()
95 kfree(ep->bd_list.bd_table_array); in ep_bd_list_free()
120 /* Allocate the bdl for ep, during config ep */
121 static int ep_bd_list_alloc(struct bdc_ep *ep) in ep_bd_list_alloc() argument
125 struct bdc *bdc = ep->bdc; in ep_bd_list_alloc()
129 if (usb_endpoint_xfer_isoc(ep->desc)) in ep_bd_list_alloc()
137 "%s ep:%p num_tabs:%d\n", in ep_bd_list_alloc()
138 __func__, ep, num_tabs); in ep_bd_list_alloc()
141 ep->bd_list.bd_table_array = kcalloc(num_tabs, in ep_bd_list_alloc()
144 if (!ep->bd_list.bd_table_array) in ep_bd_list_alloc()
169 ep->bd_list.bd_table_array[index] = bd_table; in ep_bd_list_alloc()
175 chain_table(prev_table, ep->bd_list.bd_table_array[0], bd_p_tab); in ep_bd_list_alloc()
177 ep->bd_list.num_tabs = num_tabs; in ep_bd_list_alloc()
178 ep->bd_list.max_bdi = (num_tabs * bd_p_tab) - 1; in ep_bd_list_alloc()
179 ep->bd_list.num_tabs = num_tabs; in ep_bd_list_alloc()
180 ep->bd_list.num_bds_table = bd_p_tab; in ep_bd_list_alloc()
181 ep->bd_list.eqp_bdi = 0; in ep_bd_list_alloc()
182 ep->bd_list.hwd_bdi = 0; in ep_bd_list_alloc()
187 ep_bd_list_free(ep, num_tabs); in ep_bd_list_alloc()
215 static int bd_add_to_bdi(struct bdc_ep *ep, dma_addr_t bd_dma_addr) in bd_add_to_bdi() argument
217 struct bd_list *bd_list = &ep->bd_list; in bd_add_to_bdi()
219 struct bdc *bdc = ep->bdc; in bd_add_to_bdi()
253 /* return the global bdi, to compare with ep eqp_bdi */ in bd_add_to_bdi()
258 static int bdi_to_tbi(struct bdc_ep *ep, int bdi) in bdi_to_tbi() argument
262 tbi = bdi / ep->bd_list.num_bds_table; in bdi_to_tbi()
263 dev_vdbg(ep->bdc->dev, in bdi_to_tbi()
265 bdi, ep->bd_list.num_bds_table, tbi); in bdi_to_tbi()
271 static inline int find_end_bdi(struct bdc_ep *ep, int next_hwd_bdi) in find_end_bdi() argument
277 end_bdi = ep->bd_list.max_bdi - 1; in find_end_bdi()
278 else if ((end_bdi % (ep->bd_list.num_bds_table-1)) == 0) in find_end_bdi()
285 * How many transfer bd's are available on this ep bdl, chain bds are not
288 static int bd_available_ep(struct bdc_ep *ep) in bd_available_ep() argument
290 struct bd_list *bd_list = &ep->bd_list; in bd_available_ep()
292 struct bdc *bdc = ep->bdc; in bd_available_ep()
321 if (!(bdi_to_tbi(ep, bd_list->hwd_bdi) in bd_available_ep()
322 == bdi_to_tbi(ep, bd_list->eqp_bdi))) { in bd_available_ep()
343 struct bdc_ep *ep = bdc->bdc_ep_array[epnum]; in bdc_notify_xfr() local
347 * We don't have anyway to check if ep state is running, in bdc_notify_xfr()
350 if (unlikely(ep->flags & BDC_EP_STOP)) in bdc_notify_xfr()
351 ep->flags &= ~BDC_EP_STOP; in bdc_notify_xfr()
357 static struct bdc_bd *bdi_to_bd(struct bdc_ep *ep, int bdi) in bdi_to_bd() argument
359 int tbi = bdi_to_tbi(ep, bdi); in bdi_to_bd()
362 local_bdi = bdi - (tbi * ep->bd_list.num_bds_table); in bdi_to_bd()
363 dev_vdbg(ep->bdc->dev, in bdi_to_bd()
367 return (ep->bd_list.bd_table_array[tbi]->start_bd + local_bdi); in bdi_to_bd()
371 static void ep_bdlist_eqp_adv(struct bdc_ep *ep) in ep_bdlist_eqp_adv() argument
373 ep->bd_list.eqp_bdi++; in ep_bdlist_eqp_adv()
375 if (((ep->bd_list.eqp_bdi + 1) % ep->bd_list.num_bds_table) == 0) in ep_bdlist_eqp_adv()
376 ep->bd_list.eqp_bdi++; in ep_bdlist_eqp_adv()
379 if (ep->bd_list.eqp_bdi == (ep->bd_list.max_bdi + 1)) in ep_bdlist_eqp_adv()
380 ep->bd_list.eqp_bdi = 0; in ep_bdlist_eqp_adv()
389 req->ep->dir = 0; in setup_first_bd_ep0()
431 struct bdc_ep *ep; in setup_bd_list_xfr() local
436 ep = req->ep; in setup_bd_list_xfr()
437 bd_list = &ep->bd_list; in setup_bd_list_xfr()
441 bd = bdi_to_bd(ep, bd_list->eqp_bdi); in setup_bd_list_xfr()
443 maxp = usb_endpoint_maxp(ep->desc); in setup_bd_list_xfr()
446 dev_vdbg(bdc->dev, "%s ep:%s num_bds:%d tfs:%d r_len:%d bd:%p\n", in setup_bd_list_xfr()
447 __func__, ep->name, num_bds, tfs, req_len, bd); in setup_bd_list_xfr()
456 if (ep->ep_num == 1) { in setup_bd_list_xfr()
462 if (!req->ep->dir) in setup_bd_list_xfr()
476 bd = bdi_to_bd(ep, ep->bd_list.eqp_bdi); in setup_bd_list_xfr()
487 ep_bdlist_eqp_adv(ep); in setup_bd_list_xfr()
492 ep->bd_list.eqp_bdi); in setup_bd_list_xfr()
493 bd = bdi_to_bd(ep, ep->bd_list.eqp_bdi); in setup_bd_list_xfr()
497 bd = bdi_to_bd(ep, bd_xfr->start_bdi); in setup_bd_list_xfr()
501 bd_xfr->next_hwd_bdi = ep->bd_list.eqp_bdi; in setup_bd_list_xfr()
512 struct bdc_ep *ep; in bdc_queue_xfr() local
515 ep = req->ep; in bdc_queue_xfr()
518 ep->bd_list.eqp_bdi, ep->bd_list.hwd_bdi); in bdc_queue_xfr()
521 bd_available = bd_available_ep(ep); in bdc_queue_xfr()
523 /* how many bd's are avaialble on ep */ in bdc_queue_xfr()
530 list_add_tail(&req->queue, &ep->queue); in bdc_queue_xfr()
531 bdc_dbg_bd_list(bdc, ep); in bdc_queue_xfr()
532 bdc_notify_xfr(bdc, ep->ep_num); in bdc_queue_xfr()
538 static void bdc_req_complete(struct bdc_ep *ep, struct bdc_req *req, in bdc_req_complete() argument
541 struct bdc *bdc = ep->bdc; in bdc_req_complete()
546 dev_dbg(bdc->dev, "%s ep:%s status:%d\n", __func__, ep->name, status); in bdc_req_complete()
549 usb_gadget_unmap_request(&bdc->gadget, &req->usb_req, ep->dir); in bdc_req_complete()
552 usb_gadget_giveback_request(&ep->usb_ep, &req->usb_req); in bdc_req_complete()
558 int bdc_ep_disable(struct bdc_ep *ep) in bdc_ep_disable() argument
565 bdc = ep->bdc; in bdc_ep_disable()
566 dev_dbg(bdc->dev, "%s() ep->ep_num=%d\n", __func__, ep->ep_num); in bdc_ep_disable()
568 ret = bdc_stop_ep(bdc, ep->ep_num); in bdc_ep_disable()
575 while (!list_empty(&ep->queue)) { in bdc_ep_disable()
576 req = list_entry(ep->queue.next, struct bdc_req, in bdc_ep_disable()
578 bdc_req_complete(ep, req, -ESHUTDOWN); in bdc_ep_disable()
581 ret = bdc_dconfig_ep(bdc, ep); in bdc_ep_disable()
586 ep->flags = 0; in bdc_ep_disable()
588 if (ep->ep_num == 1) in bdc_ep_disable()
592 ep_bd_list_free(ep, ep->bd_list.num_tabs); in bdc_ep_disable()
593 ep->desc = NULL; in bdc_ep_disable()
594 ep->comp_desc = NULL; in bdc_ep_disable()
595 ep->usb_ep.desc = NULL; in bdc_ep_disable()
596 ep->ep_type = 0; in bdc_ep_disable()
601 /* Enable the ep */
602 int bdc_ep_enable(struct bdc_ep *ep) in bdc_ep_enable() argument
607 bdc = ep->bdc; in bdc_ep_enable()
611 ret = ep_bd_list_alloc(ep); in bdc_ep_enable()
613 dev_err(bdc->dev, "ep bd list allocation failed:%d\n", ret); in bdc_ep_enable()
616 bdc_dbg_bd_list(bdc, ep); in bdc_ep_enable()
617 /* only for ep0: config ep is called for ep0 from connect event */ in bdc_ep_enable()
618 if (ep->ep_num == 1) in bdc_ep_enable()
622 ret = bdc_config_ep(bdc, ep); in bdc_ep_enable()
626 ep->usb_ep.maxpacket = usb_endpoint_maxp(ep->desc); in bdc_ep_enable()
627 ep->usb_ep.desc = ep->desc; in bdc_ep_enable()
628 ep->usb_ep.comp_desc = ep->comp_desc; in bdc_ep_enable()
629 ep->ep_type = usb_endpoint_type(ep->desc); in bdc_ep_enable()
630 ep->flags |= BDC_EP_ENABLED; in bdc_ep_enable()
641 struct bdc_ep *ep; in ep0_queue_status_stage() local
644 ep = bdc->bdc_ep_array[1]; in ep0_queue_status_stage()
645 status_req->ep = ep; in ep0_queue_status_stage()
656 static int ep0_queue(struct bdc_ep *ep, struct bdc_req *req) in ep0_queue() argument
661 bdc = ep->bdc; in ep0_queue()
665 req->epnum = ep->ep_num; in ep0_queue()
686 ret = usb_gadget_map_request(&bdc->gadget, &req->usb_req, ep->dir); in ep0_queue()
688 dev_err(bdc->dev, "dma mapping failed %s\n", ep->name); in ep0_queue()
698 struct bdc_ep *ep; in ep0_queue_data_stage() local
701 ep = bdc->bdc_ep_array[1]; in ep0_queue_data_stage()
702 bdc->ep0_req.ep = ep; in ep0_queue_data_stage()
705 return ep0_queue(ep, &bdc->ep0_req); in ep0_queue_data_stage()
708 /* Queue req on ep */
709 static int ep_queue(struct bdc_ep *ep, struct bdc_req *req) in ep_queue() argument
714 if (!req || !ep->usb_ep.desc) in ep_queue()
717 bdc = ep->bdc; in ep_queue()
721 req->epnum = ep->ep_num; in ep_queue()
723 ret = usb_gadget_map_request(&bdc->gadget, &req->usb_req, ep->dir); in ep_queue()
732 /* Dequeue a request from ep */
733 static int ep_dequeue(struct bdc_ep *ep, struct bdc_req *req) in ep_dequeue() argument
747 bdc = ep->bdc; in ep_dequeue()
749 eqp_bdi = ep->bd_list.eqp_bdi - 1; in ep_dequeue()
752 eqp_bdi = ep->bd_list.max_bdi; in ep_dequeue()
755 end_bdi = find_end_bdi(ep, req->bd_xfr.next_hwd_bdi); in ep_dequeue()
757 dev_dbg(bdc->dev, "%s ep:%s start:%d end:%d\n", in ep_dequeue()
758 __func__, ep->name, start_bdi, end_bdi); in ep_dequeue()
759 dev_dbg(bdc->dev, "%s ep=%p ep->desc=%p\n", __func__, in ep_dequeue()
760 ep, (void *)ep->usb_ep.desc); in ep_dequeue()
761 /* if still connected, stop the ep to see where the HW is ? */ in ep_dequeue()
763 ret = bdc_stop_ep(bdc, ep->ep_num); in ep_dequeue()
782 curr_hw_dqpi = bd_add_to_bdi(ep, deq_ptr_64); in ep_dequeue()
822 tbi = bdi_to_tbi(ep, req->bd_xfr.next_hwd_bdi); in ep_dequeue()
823 table = ep->bd_list.bd_table_array[tbi]; in ep_dequeue()
826 tbi * ep->bd_list.num_bds_table); in ep_dequeue()
828 first_req = list_first_entry(&ep->queue, struct bdc_req, in ep_dequeue()
844 bd_start = bdi_to_bd(ep, start_bdi); in ep_dequeue()
849 bdc_dbg_bd_list(bdc, ep); in ep_dequeue()
855 ret = bdc_ep_bla(bdc, ep, next_bd_dma); in ep_dequeue()
865 /* Halt/Clear the ep based on value */
866 static int ep_set_halt(struct bdc_ep *ep, u32 value) in ep_set_halt() argument
871 bdc = ep->bdc; in ep_set_halt()
872 dev_dbg(bdc->dev, "%s ep:%s value=%d\n", __func__, ep->name, value); in ep_set_halt()
876 if (ep->ep_num == 1) in ep_set_halt()
879 ret = bdc_ep_set_stall(bdc, ep->ep_num); in ep_set_halt()
882 ep->name); in ep_set_halt()
884 ep->flags |= BDC_EP_STALL; in ep_set_halt()
888 ret = bdc_ep_clear_stall(bdc, ep->ep_num); in ep_set_halt()
891 ep->name); in ep_set_halt()
893 ep->flags &= ~BDC_EP_STALL; in ep_set_halt()
900 /* Free all the ep */
903 struct bdc_ep *ep; in bdc_free_ep() local
908 ep = bdc->bdc_ep_array[epnum]; in bdc_free_ep()
909 if (!ep) in bdc_free_ep()
912 if (ep->flags & BDC_EP_ENABLED) in bdc_free_ep()
913 ep_bd_list_free(ep, ep->bd_list.num_tabs); in bdc_free_ep()
917 list_del(&ep->usb_ep.ep_list); in bdc_free_ep()
919 kfree(ep); in bdc_free_ep()
952 static void handle_xsr_succ_status(struct bdc *bdc, struct bdc_ep *ep, in handle_xsr_succ_status() argument
956 struct bd_list *bd_list = &ep->bd_list; in handle_xsr_succ_status()
966 dev_dbg(bdc->dev, "%s ep:%p\n", __func__, ep); in handle_xsr_succ_status()
969 if (ep->ignore_next_sr) { in handle_xsr_succ_status()
970 ep->ignore_next_sr = false; in handle_xsr_succ_status()
974 if (unlikely(list_empty(&ep->queue))) { in handle_xsr_succ_status()
978 req = list_entry(ep->queue.next, struct bdc_req, in handle_xsr_succ_status()
998 short_bdi = bd_add_to_bdi(ep, deq_ptr_64); in handle_xsr_succ_status()
1010 if (!(bdi_to_tbi(ep, start_bdi) == in handle_xsr_succ_status()
1011 bdi_to_tbi(ep, short_bdi))) in handle_xsr_succ_status()
1027 end_bdi = find_end_bdi(ep, bd_xfr->next_hwd_bdi); in handle_xsr_succ_status()
1029 ep->ignore_next_sr = true; in handle_xsr_succ_status()
1032 short_bd = bdi_to_bd(ep, short_bdi); in handle_xsr_succ_status()
1049 ep->bd_list.hwd_bdi = bd_xfr->next_hwd_bdi; in handle_xsr_succ_status()
1051 dev_dbg(bdc->dev, "short xfr on %d\n", ep->ep_num); in handle_xsr_succ_status()
1055 bdc_req_complete(ep, bd_xfr->req, status); in handle_xsr_succ_status()
1090 struct bdc_ep *ep = bdc->bdc_ep_array[1]; in ep0_stall() local
1095 ep_set_halt(ep, 1); in ep0_stall()
1098 while (!list_empty(&ep->queue)) { in ep0_stall()
1099 req = list_entry(ep->queue.next, struct bdc_req, in ep0_stall()
1101 bdc_req_complete(ep, req, -ESHUTDOWN); in ep0_stall()
1233 struct bdc_ep *ep; in ep0_handle_feature() local
1290 ep = bdc->bdc_ep_array[epnum]; in ep0_handle_feature()
1291 if (!ep) in ep0_handle_feature()
1294 return ep_set_halt(ep, set); in ep0_handle_feature()
1308 struct bdc_ep *ep; in ep0_handle_status() local
1356 ep = bdc->bdc_ep_array[epnum]; in ep0_handle_status()
1357 if (!ep) { in ep0_handle_status()
1358 dev_err(bdc->dev, "ISSUE, GET_STATUS for invalid EP ?"); in ep0_handle_status()
1361 if (ep->flags & BDC_EP_STALL) in ep0_handle_status()
1388 struct bdc_ep *ep; in ep0_set_sel() local
1397 ep = bdc->bdc_ep_array[1]; in ep0_set_sel()
1398 bdc->ep0_req.ep = ep; in ep0_set_sel()
1416 bdc->ep0_req.ep = bdc->bdc_ep_array[1]; in ep0_queue_zlp()
1512 struct bdc_ep *ep; in bdc_xsf_ep0_data_start() local
1516 ep = bdc->bdc_ep_array[1]; in bdc_xsf_ep0_data_start()
1518 if (ep->flags & BDC_EP_STALL) { in bdc_xsf_ep0_data_start()
1519 ret = ep_set_halt(ep, 0); in bdc_xsf_ep0_data_start()
1551 struct bdc_ep *ep; in bdc_xsf_ep0_status_start() local
1557 ep = bdc->bdc_ep_array[1]; in bdc_xsf_ep0_status_start()
1563 if (ep->flags & BDC_EP_STALL) { in bdc_xsf_ep0_status_start()
1564 ret = ep_set_halt(ep, 0); in bdc_xsf_ep0_status_start()
1646 struct bdc_ep *ep; in bdc_sr_xsf() local
1651 ep = bdc->bdc_ep_array[ep_num]; in bdc_sr_xsf()
1652 if (!ep || !(ep->flags & BDC_EP_ENABLED)) { in bdc_sr_xsf()
1653 dev_err(bdc->dev, "xsf for ep not enabled\n"); in bdc_sr_xsf()
1666 dev_dbg_ratelimited(bdc->dev, "%s sr_status=%d ep:%s\n", in bdc_sr_xsf()
1667 __func__, sr_status, ep->name); in bdc_sr_xsf()
1672 handle_xsr_succ_status(bdc, ep, sreport); in bdc_sr_xsf()
1702 dev_warn(bdc->dev, "Babble on ep not handled\n"); in bdc_sr_xsf()
1715 struct bdc_ep *ep; in bdc_gadget_ep_queue() local
1725 ep = to_bdc_ep(_ep); in bdc_gadget_ep_queue()
1727 bdc = ep->bdc; in bdc_gadget_ep_queue()
1728 dev_dbg(bdc->dev, "%s ep:%p req:%p\n", __func__, ep, req); in bdc_gadget_ep_queue()
1730 _req, ep->name, _req->length, _req->zero); in bdc_gadget_ep_queue()
1732 if (!ep->usb_ep.desc) { in bdc_gadget_ep_queue()
1735 _req, ep->name); in bdc_gadget_ep_queue()
1746 if (ep == bdc->bdc_ep_array[1]) in bdc_gadget_ep_queue()
1747 ret = ep0_queue(ep, req); in bdc_gadget_ep_queue()
1749 ret = ep_queue(ep, req); in bdc_gadget_ep_queue()
1762 struct bdc_ep *ep; in bdc_gadget_ep_dequeue() local
1769 ep = to_bdc_ep(_ep); in bdc_gadget_ep_dequeue()
1771 bdc = ep->bdc; in bdc_gadget_ep_dequeue()
1772 dev_dbg(bdc->dev, "%s ep:%s req:%p\n", __func__, ep->name, req); in bdc_gadget_ep_dequeue()
1773 bdc_dbg_bd_list(bdc, ep); in bdc_gadget_ep_dequeue()
1778 list_for_each_entry(iter, &ep->queue, queue) { in bdc_gadget_ep_dequeue()
1789 ret = ep_dequeue(ep, req); in bdc_gadget_ep_dequeue()
1794 bdc_req_complete(ep, req, -ECONNRESET); in bdc_gadget_ep_dequeue()
1797 bdc_dbg_bd_list(bdc, ep); in bdc_gadget_ep_dequeue()
1806 struct bdc_ep *ep; in bdc_gadget_ep_set_halt() local
1810 ep = to_bdc_ep(_ep); in bdc_gadget_ep_set_halt()
1811 bdc = ep->bdc; in bdc_gadget_ep_set_halt()
1812 dev_dbg(bdc->dev, "%s ep:%s value=%d\n", __func__, ep->name, value); in bdc_gadget_ep_set_halt()
1814 if (usb_endpoint_xfer_isoc(ep->usb_ep.desc)) in bdc_gadget_ep_set_halt()
1816 else if (!list_empty(&ep->queue)) in bdc_gadget_ep_set_halt()
1819 ret = ep_set_halt(ep, value); in bdc_gadget_ep_set_halt()
1830 struct bdc_ep *ep; in bdc_gadget_alloc_request() local
1836 ep = to_bdc_ep(_ep); in bdc_gadget_alloc_request()
1837 req->ep = ep; in bdc_gadget_alloc_request()
1838 req->epnum = ep->ep_num; in bdc_gadget_alloc_request()
1840 dev_dbg(ep->bdc->dev, "%s ep:%s req:%p\n", __func__, ep->name, req); in bdc_gadget_alloc_request()
1861 struct bdc_ep *ep; in bdc_gadget_ep_enable() local
1875 ep = to_bdc_ep(_ep); in bdc_gadget_ep_enable()
1876 bdc = ep->bdc; in bdc_gadget_ep_enable()
1879 if (ep == bdc->bdc_ep_array[1]) in bdc_gadget_ep_enable()
1887 dev_dbg(bdc->dev, "%s Enabling %s\n", __func__, ep->name); in bdc_gadget_ep_enable()
1889 ep->desc = desc; in bdc_gadget_ep_enable()
1890 ep->comp_desc = _ep->comp_desc; in bdc_gadget_ep_enable()
1891 ret = bdc_ep_enable(ep); in bdc_gadget_ep_enable()
1900 struct bdc_ep *ep; in bdc_gadget_ep_disable() local
1908 ep = to_bdc_ep(_ep); in bdc_gadget_ep_disable()
1909 bdc = ep->bdc; in bdc_gadget_ep_disable()
1912 if (ep == bdc->bdc_ep_array[1]) { in bdc_gadget_ep_disable()
1917 "%s() ep:%s ep->flags:%08x\n", in bdc_gadget_ep_disable()
1918 __func__, ep->name, ep->flags); in bdc_gadget_ep_disable()
1920 if (!(ep->flags & BDC_EP_ENABLED)) { in bdc_gadget_ep_disable()
1923 ep->name); in bdc_gadget_ep_disable()
1927 ret = bdc_ep_disable(ep); in bdc_gadget_ep_disable()
1946 struct bdc_ep *ep; in init_ep() local
1949 ep = kzalloc(sizeof(*ep), GFP_KERNEL); in init_ep()
1950 if (!ep) in init_ep()
1953 ep->bdc = bdc; in init_ep()
1954 ep->dir = dir; in init_ep()
1957 ep->usb_ep.caps.dir_in = true; in init_ep()
1959 ep->usb_ep.caps.dir_out = true; in init_ep()
1961 /* ep->ep_num is the index inside bdc_ep */ in init_ep()
1963 ep->ep_num = 1; in init_ep()
1964 bdc->bdc_ep_array[ep->ep_num] = ep; in init_ep()
1965 snprintf(ep->name, sizeof(ep->name), "ep%d", epnum - 1); in init_ep()
1966 usb_ep_set_maxpacket_limit(&ep->usb_ep, EP0_MAX_PKT_SIZE); in init_ep()
1967 ep->usb_ep.caps.type_control = true; in init_ep()
1968 ep->comp_desc = NULL; in init_ep()
1969 bdc->gadget.ep0 = &ep->usb_ep; in init_ep()
1972 ep->ep_num = epnum * 2 - 1; in init_ep()
1974 ep->ep_num = epnum * 2 - 2; in init_ep()
1976 bdc->bdc_ep_array[ep->ep_num] = ep; in init_ep()
1977 snprintf(ep->name, sizeof(ep->name), "ep%d%s", epnum - 1, in init_ep()
1980 usb_ep_set_maxpacket_limit(&ep->usb_ep, 1024); in init_ep()
1981 ep->usb_ep.caps.type_iso = true; in init_ep()
1982 ep->usb_ep.caps.type_bulk = true; in init_ep()
1983 ep->usb_ep.caps.type_int = true; in init_ep()
1984 ep->usb_ep.max_streams = 0; in init_ep()
1985 list_add_tail(&ep->usb_ep.ep_list, &bdc->gadget.ep_list); in init_ep()
1987 ep->usb_ep.ops = &bdc_gadget_ep_ops; in init_ep()
1988 ep->usb_ep.name = ep->name; in init_ep()
1989 ep->flags = 0; in init_ep()
1990 ep->ignore_next_sr = false; in init_ep()
1991 dev_dbg(bdc->dev, "ep=%p ep->usb_ep.name=%s epnum=%d ep->epnum=%d\n", in init_ep()
1992 ep, ep->usb_ep.name, epnum, ep->ep_num); in init_ep()
1994 INIT_LIST_HEAD(&ep->queue); in init_ep()
1999 /* Init all ep */
2010 dev_err(bdc->dev, "init ep ep0 fail %d\n", ret); in bdc_init_ep()
2019 "init ep failed for:%d error: %d\n", in bdc_init_ep()
2028 "init ep failed for:%d error: %d\n", in bdc_init_ep()