Lines Matching refs:ep

92 static int dwc2_ep_enable(struct usb_ep *ep,
94 static int dwc2_ep_disable(struct usb_ep *ep);
95 static struct usb_request *dwc2_alloc_request(struct usb_ep *ep,
97 static void dwc2_free_request(struct usb_ep *ep, struct usb_request *);
99 static int dwc2_queue(struct usb_ep *ep, struct usb_request *, gfp_t gfp_flags);
100 static int dwc2_dequeue(struct usb_ep *ep, struct usb_request *);
101 static int dwc2_fifo_status(struct usb_ep *ep);
102 static void dwc2_fifo_flush(struct usb_ep *ep);
104 static void dwc2_ep0_kick(struct dwc2_udc *dev, struct dwc2_ep *ep);
107 static int write_fifo_ep0(struct dwc2_ep *ep, struct dwc2_request *req);
108 static void done(struct dwc2_ep *ep, struct dwc2_request *req, int status);
115 static void nuke(struct dwc2_ep *ep, int status);
117 static void dwc2_udc_set_nak(struct dwc2_ep *ep);
199 struct dwc2_ep *ep = &dev->ep[i]; in udc_reinit() local
202 list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); in udc_reinit()
204 ep->desc = 0; in udc_reinit()
205 ep->stopped = 0; in udc_reinit()
206 INIT_LIST_HEAD(&ep->queue); in udc_reinit()
207 ep->pio_irqs = 0; in udc_reinit()
362 static void done(struct dwc2_ep *ep, struct dwc2_request *req, int status) in done() argument
364 unsigned int stopped = ep->stopped; in done()
367 __func__, ep->ep.name, ep, &req->req, stopped); in done()
378 ep->ep.name, &req->req, status, in done()
383 ep->stopped = 1; in done()
401 spin_unlock(&ep->dev->lock); in done()
402 req->req.complete(&ep->ep, &req->req); in done()
403 spin_lock(&ep->dev->lock); in done()
407 ep->stopped = stopped; in done()
413 static void nuke(struct dwc2_ep *ep, int status) in nuke() argument
417 debug("%s: %s %p\n", __func__, ep->ep.name, ep); in nuke()
420 while (!list_empty(&ep->queue)) { in nuke()
421 req = list_entry(ep->queue.next, struct dwc2_request, queue); in nuke()
422 done(ep, req, status); in nuke()
438 struct dwc2_ep *ep = &dev->ep[i]; in stop_activity() local
439 ep->stopped = 1; in stop_activity()
440 nuke(ep, -ESHUTDOWN); in stop_activity()
603 dev->ep[0].ep.maxpacket = ep0_fifo_size; in set_max_pktsize()
605 dev->ep[i].ep.maxpacket = ep_fifo_size; in set_max_pktsize()
619 struct dwc2_ep *ep; in dwc2_ep_enable() local
625 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_ep_enable()
626 if (!_ep || !desc || ep->desc || _ep->name == ep0name in dwc2_ep_enable()
628 || ep->bEndpointAddress != desc->bEndpointAddress in dwc2_ep_enable()
629 || ep_maxpacket(ep) < in dwc2_ep_enable()
637 if (ep->bmAttributes != desc->bmAttributes in dwc2_ep_enable()
638 && ep->bmAttributes != USB_ENDPOINT_XFER_BULK in dwc2_ep_enable()
648 ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) { in dwc2_ep_enable()
654 dev = ep->dev; in dwc2_ep_enable()
661 ep->stopped = 0; in dwc2_ep_enable()
662 ep->desc = desc; in dwc2_ep_enable()
663 ep->pio_irqs = 0; in dwc2_ep_enable()
664 ep->ep.maxpacket = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)); in dwc2_ep_enable()
667 dwc2_udc_set_nak(ep); in dwc2_ep_enable()
670 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_ep_enable()
671 dwc2_udc_ep_activate(ep); in dwc2_ep_enable()
672 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_ep_enable()
675 __func__, _ep->name, ep->stopped, ep->ep.maxpacket); in dwc2_ep_enable()
684 struct dwc2_ep *ep; in dwc2_ep_disable() local
689 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_ep_disable()
690 if (!_ep || !ep->desc) { in dwc2_ep_disable()
692 _ep ? ep->ep.name : NULL); in dwc2_ep_disable()
696 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_ep_disable()
699 nuke(ep, -ESHUTDOWN); in dwc2_ep_disable()
701 ep->desc = 0; in dwc2_ep_disable()
702 ep->stopped = 1; in dwc2_ep_disable()
704 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_ep_disable()
710 static struct usb_request *dwc2_alloc_request(struct usb_ep *ep, in dwc2_alloc_request() argument
715 debug("%s: %s %p\n", __func__, ep->name, ep); in dwc2_alloc_request()
727 static void dwc2_free_request(struct usb_ep *ep, struct usb_request *_req) in dwc2_free_request() argument
731 debug("%s: %p\n", __func__, ep); in dwc2_free_request()
741 struct dwc2_ep *ep; in dwc2_dequeue() local
747 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_dequeue()
748 if (!_ep || ep->ep.name == ep0name) in dwc2_dequeue()
751 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_dequeue()
754 list_for_each_entry(req, &ep->queue, queue) { in dwc2_dequeue()
759 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_dequeue()
763 done(ep, req, -ECONNRESET); in dwc2_dequeue()
765 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_dequeue()
775 struct dwc2_ep *ep; in dwc2_fifo_status() local
777 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_fifo_status()
783 debug("%s: %d\n", __func__, ep_index(ep)); in dwc2_fifo_status()
786 if (ep_is_in(ep)) in dwc2_fifo_status()
797 struct dwc2_ep *ep; in dwc2_fifo_flush() local
799 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_fifo_flush()
800 if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) { in dwc2_fifo_flush()
805 debug("%s: %d\n", __func__, ep_index(ep)); in dwc2_fifo_flush()
820 .ep0 = &memory.ep[0].ep,
825 .ep[0] = {
826 .ep = {
840 .ep[1] = {
841 .ep = {
855 .ep[2] = {
856 .ep = {
870 .ep[3] = {
871 .ep = {