Lines Matching refs:ep

53 /*ep name is important in gadget, it should obey the convention of ep_match()*/
77 static void done(struct qe_ep *ep, struct qe_req *req, int status)
79 struct qe_udc *udc = ep->udc;
80 unsigned char stopped = ep->stopped;
84 * so here the req will be dropped from the ep->queue
97 ep_is_in(ep)
105 ep_is_in(ep)
111 ep->ep.name, &req->req, status,
115 ep->stopped = 1;
118 usb_gadget_giveback_request(&ep->ep, &req->req);
122 ep->stopped = stopped;
126 * nuke(): delete all requests related to this ep
128 static void nuke(struct qe_ep *ep, int status)
131 while (!list_empty(&ep->queue)) {
133 req = list_entry(ep->queue.next, struct qe_req, queue);
135 done(ep, req, status);
143 static int qe_eprx_stall_change(struct qe_ep *ep, int value)
146 u8 epnum = ep->epnum;
147 struct qe_udc *udc = ep->udc;
153 else if (ep->dir == USB_DIR_IN)
160 static int qe_eptx_stall_change(struct qe_ep *ep, int value)
163 u8 epnum = ep->epnum;
164 struct qe_udc *udc = ep->udc;
170 else if (ep->dir == USB_DIR_OUT)
187 static int qe_eprx_nack(struct qe_ep *ep)
189 u8 epnum = ep->epnum;
190 struct qe_udc *udc = ep->udc;
192 if (ep->state == EP_STATE_IDLE) {
193 /* Set the ep's nack */
201 ep->state = EP_STATE_NACK;
206 static int qe_eprx_normal(struct qe_ep *ep)
208 struct qe_udc *udc = ep->udc;
210 if (ep->state == EP_STATE_NACK) {
211 clrsetbits_be16(&udc->usb_regs->usb_usep[ep->epnum],
220 ep->state = EP_STATE_IDLE;
221 ep->has_data = 0;
227 static int qe_ep_cmd_stoptx(struct qe_ep *ep)
229 if (ep->udc->soc_type == PORT_CPM)
230 cpm_command(CPM_USB_STOP_TX | (ep->epnum << CPM_USB_EP_SHIFT),
234 ep->epnum, 0);
239 static int qe_ep_cmd_restarttx(struct qe_ep *ep)
241 if (ep->udc->soc_type == PORT_CPM)
242 cpm_command(CPM_USB_RESTART_TX | (ep->epnum <<
246 ep->epnum, 0);
251 static int qe_ep_flushtxfifo(struct qe_ep *ep)
253 struct qe_udc *udc = ep->udc;
256 i = (int)ep->epnum;
258 qe_ep_cmd_stoptx(ep);
260 USB_CMD_FLUSH_FIFO | (USB_CMD_EP_MASK & (ep->epnum)));
265 ep->c_txbd = ep->txbase;
266 ep->n_txbd = ep->txbase;
267 qe_ep_cmd_restarttx(ep);
271 static int qe_ep_filltxfifo(struct qe_ep *ep)
273 struct qe_udc *udc = ep->udc;
276 USB_CMD_STR_FIFO | (USB_CMD_EP_MASK & (ep->epnum)));
282 struct qe_ep *ep;
287 ep = &udc->eps[pipe_num];
289 if (ep->dir == USB_DIR_OUT)
294 bd = ep->rxbase;
301 bd = ep->txbase;
314 struct qe_ep *ep;
317 ep = &udc->eps[pipe_num];
321 switch (ep->dir) {
323 qe_ep_flushtxfifo(ep);
329 qe_ep_flushtxfifo(ep);
342 static int qe_ep_toggledata01(struct qe_ep *ep)
344 ep->data01 ^= 0x1;
350 struct qe_ep *ep = &udc->eps[pipe_num];
357 if (ep->dir == USB_DIR_OUT)
363 /* alloc multi-ram for BD rings and set the ep parameters */
376 ep->rxbase = cpm_muram_addr(tmp_addr);
377 ep->txbase = cpm_muram_addr(tmp_addr + (sizeof(struct qe_bd)
379 ep->n_rxbd = ep->rxbase;
380 ep->e_rxbd = ep->rxbase;
381 ep->n_txbd = ep->txbase;
382 ep->c_txbd = ep->txbase;
383 ep->data01 = 0; /* data0 */
386 bd = ep->rxbase;
395 bd = ep->txbase;
407 static int qe_ep_rxbd_update(struct qe_ep *ep)
415 if (ep->rxbase == NULL)
418 bd = ep->rxbase;
420 ep->rxframe = kmalloc(sizeof(*ep->rxframe), GFP_ATOMIC);
421 if (!ep->rxframe)
424 qe_frame_init(ep->rxframe);
426 if (ep->dir == USB_DIR_OUT)
431 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (bdring_len + 1);
432 ep->rxbuffer = kzalloc(size, GFP_ATOMIC);
433 if (!ep->rxbuffer) {
434 kfree(ep->rxframe);
438 ep->rxbuf_d = virt_to_phys((void *)ep->rxbuffer);
439 if (ep->rxbuf_d == DMA_ADDR_INVALID) {
440 ep->rxbuf_d = dma_map_single(ep->udc->gadget.dev.parent,
441 ep->rxbuffer,
444 ep->rxbufmap = 1;
446 dma_sync_single_for_device(ep->udc->gadget.dev.parent,
447 ep->rxbuf_d, size,
449 ep->rxbufmap = 0;
452 size = ep->ep.maxpacket + USB_CRC_SIZE + 2;
453 tmp = ep->rxbuf_d;
470 struct qe_ep *ep = &udc->eps[pipe_num];
479 logepnum = (ep->ep.desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK);
482 switch (ep->ep.desc->bmAttributes & 0x03) {
497 switch (ep->dir) {
513 tmp = (u16)(ep->ep.maxpacket + USB_CRC_SIZE);
525 struct qe_ep *ep = &udc->eps[pipe_num];
538 if (strstr(ep->ep.name, "-iso")
539 || strstr(ep->ep.name, "-int"))
561 if (strstr(ep->ep.name, "-iso")) /* bulk is ok */
579 if (strstr(ep->ep.name, "-bulk")
580 || strstr(ep->ep.name, "-int"))
596 if (strstr(ep->ep.name, "-iso")
597 || strstr(ep->ep.name, "-int"))
637 /* initialize ep structure */
638 ep->ep.maxpacket = max;
639 ep->tm = (u8)(desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK);
640 ep->ep.desc = desc;
641 ep->stopped = 0;
642 ep->init = 1;
645 ep->dir = USB_DIR_BOTH;
651 ep->dir = USB_DIR_OUT;
654 ep->dir = USB_DIR_IN;
662 if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_OUT)) {
663 reval = qe_ep_rxbd_update(ep);
668 if ((ep->tm == USBP_TM_CTL) || (ep->dir == USB_DIR_IN)) {
669 ep->txframe = kmalloc(sizeof(*ep->txframe), GFP_ATOMIC);
670 if (!ep->txframe)
672 qe_frame_init(ep->txframe);
683 kfree(ep->rxbuffer);
684 kfree(ep->rxframe);
688 dev_err(udc->dev, "failed to initialize %s\n", ep->ep.name);
710 static void recycle_one_rxbd(struct qe_ep *ep)
714 bdstatus = in_be32((u32 __iomem *)ep->e_rxbd);
716 out_be32((u32 __iomem *)ep->e_rxbd, bdstatus);
719 ep->e_rxbd = ep->rxbase;
721 ep->e_rxbd++;
724 static void recycle_rxbds(struct qe_ep *ep, unsigned char stopatnext)
730 nextbd = ep->n_rxbd;
731 bd = ep->e_rxbd;
739 bd = ep->rxbase;
748 ep->e_rxbd = bd;
751 static void ep_recycle_rxbds(struct qe_ep *ep)
753 struct qe_bd __iomem *bd = ep->n_rxbd;
755 u8 epnum = ep->epnum;
756 struct qe_udc *udc = ep->udc;
760 bd = ep->rxbase +
767 bd = ep->rxbase;
771 ep->e_rxbd = bd;
772 recycle_rxbds(ep, 0);
773 ep->e_rxbd = ep->n_rxbd;
775 recycle_rxbds(ep, 1);
780 if (ep->has_data <= 0 && (!list_empty(&ep->queue)))
781 qe_eprx_normal(ep);
783 ep->localnack = 0;
788 static int qe_ep_rxframe_handle(struct qe_ep *ep);
793 struct qe_ep *ep = &udc->eps[0];
798 pframe = ep->rxframe;
806 ep->data01 = 1;
817 struct qe_ep *ep = &udc->eps[0];
823 pframe = ep->rxframe;
825 if (ep->dir == USB_DIR_IN) {
830 bd = ep->n_rxbd;
863 qe_ep_rxframe_handle(ep);
870 recycle_one_rxbd(ep);
874 bd = ep->rxbase;
883 ep->n_rxbd = bd;
888 static int qe_ep_rxframe_handle(struct qe_ep *ep)
896 pframe = ep->rxframe;
901 if (framepid != ep->data01) {
902 dev_err(ep->udc->dev, "the data01 error!\n");
907 if (list_empty(&ep->queue)) {
908 dev_err(ep->udc->dev, "the %s have no requeue!\n", ep->name);
910 req = list_entry(ep->queue.next, struct qe_req, queue);
916 if ((fsize < ep->ep.maxpacket) ||
918 if (ep->epnum == 0)
919 ep0_req_complete(ep->udc, req);
921 done(ep, req, 0);
922 if (list_empty(&ep->queue) && ep->epnum != 0)
923 qe_eprx_nack(ep);
928 qe_ep_toggledata01(ep);
936 struct qe_ep *ep;
946 ep = &udc->eps[i];
948 if (ep->dir == USB_DIR_IN || ep->enable_tasklet == 0) {
950 "This is a transmit ep or disable tasklet!\n");
954 pframe = ep->rxframe;
955 bd = ep->n_rxbd;
960 if (list_empty(&ep->queue)) {
961 qe_eprx_nack(ep);
964 ep->has_data);
988 qe_ep_rxframe_handle(ep);
996 ep->has_data--;
997 if (!(ep->localnack))
998 recycle_one_rxbd(ep);
1002 bd = ep->rxbase;
1010 ep->n_rxbd = bd;
1012 if (ep->localnack)
1013 ep_recycle_rxbds(ep);
1015 ep->enable_tasklet = 0;
1021 static int qe_ep_rx(struct qe_ep *ep)
1028 udc = ep->udc;
1029 pframe = ep->rxframe;
1031 if (ep->dir == USB_DIR_IN) {
1032 dev_err(udc->dev, "transmit ep in rx function\n");
1036 bd = ep->n_rxbd;
1038 swoffs = (u16)(bd - ep->rxbase);
1039 ucoffs = (u16)((in_be16(&udc->ep_param[ep->epnum]->rbptr) -
1040 in_be16(&udc->ep_param[ep->epnum]->rbase)) >> 3);
1047 qe_eprx_nack(ep);
1048 ep->localnack = 1;
1051 ep->has_data = USB_BDRING_LEN_RX - emptybds;
1053 if (list_empty(&ep->queue)) {
1054 qe_eprx_nack(ep);
1056 ep->has_data);
1061 ep->enable_tasklet = 1;
1067 static int qe_ep_tx(struct qe_ep *ep, struct qe_frame *frame)
1069 struct qe_udc *udc = ep->udc;
1075 if (ep->dir == USB_DIR_OUT) {
1076 dev_err(udc->dev, "receive ep passed to tx function\n");
1085 bd = ep->n_txbd;
1105 if ((ep->epnum == 0) && (udc->ep0_state == DATA_STATE_NEED_ZLP))
1106 ep->data01 = 0x1;
1108 if (ep->data01) {
1118 qe_ep_filltxfifo(ep);
1123 qe_ep_toggledata01(ep);
1125 ep->n_txbd = ep->txbase;
1127 ep->n_txbd++;
1139 static int txcomplete(struct qe_ep *ep, unsigned char restart)
1141 if (ep->tx_req != NULL) {
1142 struct qe_req *req = ep->tx_req;
1145 last_len = min_t(unsigned, req->req.length - ep->sent,
1146 ep->ep.maxpacket);
1149 int asent = ep->last;
1150 ep->sent += asent;
1151 ep->last -= asent;
1153 ep->last = 0;
1159 (req->req.length % ep->ep.maxpacket) != 0)
1167 if (((ep->tx_req->req.length - ep->sent) <= 0) && !zlp) {
1168 done(ep, ep->tx_req, 0);
1169 ep->tx_req = NULL;
1170 ep->last = 0;
1171 ep->sent = 0;
1176 if (ep->tx_req == NULL) {
1177 if (!list_empty(&ep->queue)) {
1178 ep->tx_req = list_entry(ep->queue.next, struct qe_req,
1180 ep->last = 0;
1181 ep->sent = 0;
1189 static int qe_usb_senddata(struct qe_ep *ep, struct qe_frame *frame)
1195 size = min_t(u32, (ep->tx_req->req.length - ep->sent),
1196 ep->ep.maxpacket);
1197 buf = (u8 *)ep->tx_req->req.buf + ep->sent;
1199 ep->last = size;
1200 ep->tx_req->req.actual += size;
1205 return qe_ep_tx(ep, frame);
1211 static int sendnulldata(struct qe_ep *ep, struct qe_frame *frame, uint infor)
1213 struct qe_udc *udc = ep->udc;
1224 return qe_ep_tx(ep, frame);
1227 static int frame_create_tx(struct qe_ep *ep, struct qe_frame *frame)
1229 struct qe_req *req = ep->tx_req;
1235 if ((req->req.length - ep->sent) > 0)
1236 reval = qe_usb_senddata(ep, frame);
1238 reval = sendnulldata(ep, frame, 0);
1249 struct qe_ep *ep = &udc->eps[0];
1254 sendnulldata(ep, ep->txframe, SETUP_STATUS | NO_REQ);
1266 struct qe_ep *ep = &udc->eps[0];
1267 /* because usb and ep's status already been set in ch9setaddress() */
1271 done(ep, req, 0);
1278 done(ep, req, 0);
1283 done(ep, req, 0);
1290 done(ep, req, 0);
1304 static int ep0_txcomplete(struct qe_ep *ep, unsigned char restart)
1307 struct qe_frame *frame = ep->txframe;
1311 ep->udc->ep0_state = WAIT_FOR_SETUP;
1313 sendnulldata(ep, ep->txframe, SETUP_STATUS | NO_REQ);
1317 tx_req = ep->tx_req;
1320 int asent = ep->last;
1321 ep->sent += asent;
1322 ep->last -= asent;
1324 ep->last = 0;
1328 if ((ep->tx_req->req.length - ep->sent) <= 0) {
1329 ep->tx_req->req.actual = (unsigned int)ep->sent;
1330 ep0_req_complete(ep->udc, ep->tx_req);
1331 ep->tx_req = NULL;
1332 ep->last = 0;
1333 ep->sent = 0;
1336 dev_vdbg(ep->udc->dev, "the ep0_controller have no req\n");
1342 static int ep0_txframe_handle(struct qe_ep *ep)
1345 if (frame_get_status(ep->txframe) & FRAME_ERROR) {
1346 qe_ep_flushtxfifo(ep);
1347 dev_vdbg(ep->udc->dev, "The EP0 transmit data have error!\n");
1348 if (frame_get_info(ep->txframe) & PID_DATA0)
1349 ep->data01 = 0;
1351 ep->data01 = 1;
1353 ep0_txcomplete(ep, 1);
1355 ep0_txcomplete(ep, 0);
1357 frame_create_tx(ep, ep->txframe);
1361 static int qe_ep0_txconf(struct qe_ep *ep)
1367 bd = ep->c_txbd;
1370 pframe = ep->txframe;
1376 ep->c_txbd = ep->txbase;
1378 ep->c_txbd++;
1380 if (ep->c_txbd == ep->n_txbd) {
1388 ep0_txframe_handle(ep);
1391 bd = ep->c_txbd;
1398 static int ep_txframe_handle(struct qe_ep *ep)
1400 if (frame_get_status(ep->txframe) & FRAME_ERROR) {
1401 qe_ep_flushtxfifo(ep);
1402 dev_vdbg(ep->udc->dev, "The EP0 transmit data have error!\n");
1403 if (frame_get_info(ep->txframe) & PID_DATA0)
1404 ep->data01 = 0;
1406 ep->data01 = 1;
1408 txcomplete(ep, 1);
1410 txcomplete(ep, 0);
1412 frame_create_tx(ep, ep->txframe); /* send the data */
1417 static int qe_ep_txconf(struct qe_ep *ep)
1424 bd = ep->c_txbd;
1427 pframe = ep->txframe;
1440 ep->c_txbd = ep->txbase;
1442 ep->c_txbd++;
1445 ep_txframe_handle(ep);
1446 bd = ep->c_txbd;
1456 static int ep_req_send(struct qe_ep *ep, struct qe_req *req)
1460 if (ep->tx_req == NULL) {
1461 ep->sent = 0;
1462 ep->last = 0;
1463 txcomplete(ep, 0); /* can gain a new tx_req */
1464 reval = frame_create_tx(ep, ep->txframe);
1470 static int ep_req_rx(struct qe_ep *ep, struct qe_req *req)
1472 struct qe_udc *udc = ep->udc;
1481 if (list_empty(&ep->queue)) {
1485 pframe = ep->rxframe;
1487 bd = ep->n_rxbd;
1514 if (framepid != ep->data01) {
1523 if ((fsize < ep->ep.maxpacket)
1527 done(ep, req, 0);
1528 if (list_empty(&ep->queue))
1529 qe_eprx_nack(ep);
1532 qe_ep_toggledata01(ep);
1541 ep->has_data--;
1545 bd = ep->rxbase;
1553 ep->n_rxbd = bd;
1554 ep_recycle_rxbds(ep);
1560 static int ep_req_receive(struct qe_ep *ep, struct qe_req *req)
1562 if (ep->state == EP_STATE_NACK) {
1563 if (ep->has_data <= 0) {
1565 qe_eprx_normal(ep);
1568 ep_req_rx(ep, req);
1586 struct qe_ep *ep;
1590 ep = container_of(_ep, struct qe_ep, ep);
1597 udc = ep->udc;
1605 cpm_muram_free(cpm_muram_offset(ep->rxbase));
1606 dev_dbg(udc->dev, "enable ep%d failed\n", ep->epnum);
1609 dev_dbg(udc->dev, "enable ep%d successful\n", ep->epnum);
1616 struct qe_ep *ep;
1620 ep = container_of(_ep, struct qe_ep, ep);
1621 udc = ep->udc;
1623 if (!_ep || !ep->ep.desc) {
1624 dev_dbg(udc->dev, "%s not enabled\n", _ep ? ep->ep.name : NULL);
1630 nuke(ep, -ESHUTDOWN);
1631 ep->ep.desc = NULL;
1632 ep->stopped = 1;
1633 ep->tx_req = NULL;
1634 qe_ep_reset(udc, ep->epnum);
1637 cpm_muram_free(cpm_muram_offset(ep->rxbase));
1639 if (ep->dir == USB_DIR_OUT)
1640 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) *
1643 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) *
1646 if (ep->dir != USB_DIR_IN) {
1647 kfree(ep->rxframe);
1648 if (ep->rxbufmap) {
1650 ep->rxbuf_d, size,
1652 ep->rxbuf_d = DMA_ADDR_INVALID;
1656 ep->rxbuf_d, size,
1659 kfree(ep->rxbuffer);
1662 if (ep->dir != USB_DIR_OUT)
1663 kfree(ep->txframe);
1696 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
1701 udc = ep->udc;
1708 if (!_ep || (!ep->ep.desc && ep_index(ep))) {
1709 dev_dbg(udc->dev, "bad ep\n");
1716 req->ep = ep;
1720 req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
1723 ep_is_in(ep)
1728 dma_sync_single_for_device(ep->udc->gadget.dev.parent,
1730 ep_is_in(ep)
1739 list_add_tail(&req->queue, &ep->queue);
1741 ep->name, req->req.length);
1744 if (ep_is_in(ep))
1745 reval = ep_req_send(ep, req);
1748 if (ep_index(ep) == 0 && req->req.length > 0) {
1749 if (ep_is_in(ep))
1755 if (ep->dir == USB_DIR_OUT)
1756 reval = ep_req_receive(ep, req);
1765 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
1766 struct qe_udc *udc = ep->udc;
1779 struct qe_ep *ep = container_of(_ep, struct qe_ep, ep);
1787 spin_lock_irqsave(&ep->udc->lock, flags);
1790 list_for_each_entry(iter, &ep->queue, queue) {
1798 spin_unlock_irqrestore(&ep->udc->lock, flags);
1802 done(ep, req, -ECONNRESET);
1804 spin_unlock_irqrestore(&ep->udc->lock, flags);
1810 * @ep: the non-isochronous endpoint being stalled
1816 struct qe_ep *ep;
1821 ep = container_of(_ep, struct qe_ep, ep);
1822 if (!_ep || !ep->ep.desc) {
1827 udc = ep->udc;
1828 /* Attempt to halt IN ep will fail if any transfer requests
1830 if (value && ep_is_in(ep) && !list_empty(&ep->queue)) {
1836 spin_lock_irqsave(&ep->udc->lock, flags);
1837 qe_eptx_stall_change(ep, value);
1838 qe_eprx_stall_change(ep, value);
1839 spin_unlock_irqrestore(&ep->udc->lock, flags);
1841 if (ep->epnum == 0) {
1848 ep->data01 = 0;
1850 dev_vdbg(udc->dev, "%s %s halt stat %d\n", ep->ep.name,
1901 struct qe_ep *ep = &udc->eps[pipe];
1903 nuke(ep, -ECONNRESET);
1904 ep->tx_req = NULL;
1949 struct qe_ep *ep;
1952 ep = &udc->eps[0];
1969 if (!target_ep->ep.desc)
1986 req = container_of(qe_alloc_request(&ep->ep, GFP_KERNEL),
1998 status = __qe_ep_queue(&ep->ep, &req->req);
2052 struct qe_ep *ep;
2057 ep = &udc->eps[pipe];
2060 qe_ep_set_halt(&ep->ep,
2173 struct qe_ep *ep;
2182 ep = &udc->eps[i];
2183 if (ep && ep->init && (ep->dir != USB_DIR_OUT)) {
2184 bd = ep->c_txbd;
2188 if (ep->epnum == 0)
2189 res = qe_ep0_txconf(ep);
2191 res = qe_ep_txconf(ep);
2202 struct qe_ep *ep;
2207 ep = &udc->eps[i];
2208 if (ep && ep->init && (ep->dir != USB_DIR_IN)) {
2209 bd = ep->n_rxbd;
2212 if (ep->epnum == 0) {
2216 qe_ep_rx(ep);
2327 list_for_each_entry(loop_ep, &udc->gadget.ep_list, ep.ep_list)
2336 /* udc structure's alloc and setup, include ep-param alloc */
2410 struct qe_ep *ep = &udc->eps[pipe_num];
2412 ep->udc = udc;
2413 strcpy(ep->name, ep_name[pipe_num]);
2414 ep->ep.name = ep_name[pipe_num];
2417 ep->ep.caps.type_control = true;
2419 ep->ep.caps.type_iso = true;
2420 ep->ep.caps.type_bulk = true;
2421 ep->ep.caps.type_int = true;
2424 ep->ep.caps.dir_in = true;
2425 ep->ep.caps.dir_out = true;
2427 ep->ep.ops = &qe_ep_ops;
2428 ep->stopped = 1;
2429 usb_ep_set_maxpacket_limit(&ep->ep, (unsigned short) ~0);
2430 ep->ep.desc = NULL;
2431 ep->dir = 0xff;
2432 ep->epnum = (u8)pipe_num;
2433 ep->sent = 0;
2434 ep->last = 0;
2435 ep->init = 0;
2436 ep->rxframe = NULL;
2437 ep->txframe = NULL;
2438 ep->tx_req = NULL;
2439 ep->state = EP_STATE_IDLE;
2440 ep->has_data = 0;
2442 /* the queue lists any req for this ep */
2443 INIT_LIST_HEAD(&ep->queue);
2447 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
2449 ep->gadget = &udc->gadget;
2476 struct qe_ep *ep;
2508 udc->gadget.ep0 = &udc->eps[0].ep;
2521 /* because the ep type isn't decide here so
2524 /* setup the qe_ep struct and link ep.ep.list
2605 ep = &udc->eps[0];
2606 cpm_muram_free(cpm_muram_offset(ep->rxbase));
2607 kfree(ep->rxframe);
2608 kfree(ep->rxbuffer);
2609 kfree(ep->txframe);
2632 struct qe_ep *ep;
2652 ep = &udc->eps[0];
2653 cpm_muram_free(cpm_muram_offset(ep->rxbase));
2654 size = (ep->ep.maxpacket + USB_CRC_SIZE + 2) * (USB_BDRING_LEN + 1);
2656 kfree(ep->rxframe);
2657 if (ep->rxbufmap) {
2659 ep->rxbuf_d, size,
2661 ep->rxbuf_d = DMA_ADDR_INVALID;
2664 ep->rxbuf_d, size,
2668 kfree(ep->rxbuffer);
2669 kfree(ep->txframe);