Lines Matching refs:ep
84 static int dwc2_ep_enable(struct usb_ep *ep,
86 static int dwc2_ep_disable(struct usb_ep *ep);
87 static struct usb_request *dwc2_alloc_request(struct usb_ep *ep,
89 static void dwc2_free_request(struct usb_ep *ep, struct usb_request *);
91 static int dwc2_queue(struct usb_ep *ep, struct usb_request *, gfp_t gfp_flags);
92 static int dwc2_dequeue(struct usb_ep *ep, struct usb_request *);
93 static int dwc2_fifo_status(struct usb_ep *ep);
94 static void dwc2_fifo_flush(struct usb_ep *ep);
96 static void dwc2_ep0_kick(struct dwc2_udc *dev, struct dwc2_ep *ep);
99 static int write_fifo_ep0(struct dwc2_ep *ep, struct dwc2_request *req);
100 static void done(struct dwc2_ep *ep, struct dwc2_request *req, int status);
107 static void nuke(struct dwc2_ep *ep, int status);
109 static void dwc2_udc_set_nak(struct dwc2_ep *ep);
191 struct dwc2_ep *ep = &dev->ep[i]; in udc_reinit() local
194 list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list); in udc_reinit()
196 ep->desc = 0; in udc_reinit()
197 ep->stopped = 0; in udc_reinit()
198 INIT_LIST_HEAD(&ep->queue); in udc_reinit()
199 ep->pio_irqs = 0; in udc_reinit()
305 static void done(struct dwc2_ep *ep, struct dwc2_request *req, int status) in done() argument
307 unsigned int stopped = ep->stopped; in done()
310 __func__, ep->ep.name, ep, &req->req, stopped); in done()
321 ep->ep.name, &req->req, status, in done()
326 ep->stopped = 1; in done()
344 spin_unlock(&ep->dev->lock); in done()
345 req->req.complete(&ep->ep, &req->req); in done()
346 spin_lock(&ep->dev->lock); in done()
350 ep->stopped = stopped; in done()
356 static void nuke(struct dwc2_ep *ep, int status) in nuke() argument
360 debug("%s: %s %p\n", __func__, ep->ep.name, ep); in nuke()
363 while (!list_empty(&ep->queue)) { in nuke()
364 req = list_entry(ep->queue.next, struct dwc2_request, queue); in nuke()
365 done(ep, req, status); in nuke()
381 struct dwc2_ep *ep = &dev->ep[i]; in stop_activity() local
382 ep->stopped = 1; in stop_activity()
383 nuke(ep, -ESHUTDOWN); in stop_activity()
528 dev->ep[0].ep.maxpacket = ep0_fifo_size; in set_max_pktsize()
530 dev->ep[i].ep.maxpacket = ep_fifo_size; in set_max_pktsize()
544 struct dwc2_ep *ep; in dwc2_ep_enable() local
550 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_ep_enable()
551 if (!_ep || !desc || ep->desc || _ep->name == ep0name in dwc2_ep_enable()
553 || ep->bEndpointAddress != desc->bEndpointAddress in dwc2_ep_enable()
554 || ep_maxpacket(ep) < in dwc2_ep_enable()
562 if (ep->bmAttributes != desc->bmAttributes in dwc2_ep_enable()
563 && ep->bmAttributes != USB_ENDPOINT_XFER_BULK in dwc2_ep_enable()
573 ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) { in dwc2_ep_enable()
579 dev = ep->dev; in dwc2_ep_enable()
586 ep->stopped = 0; in dwc2_ep_enable()
587 ep->desc = desc; in dwc2_ep_enable()
588 ep->pio_irqs = 0; in dwc2_ep_enable()
589 ep->ep.maxpacket = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)); in dwc2_ep_enable()
592 dwc2_udc_set_nak(ep); in dwc2_ep_enable()
595 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_ep_enable()
596 dwc2_udc_ep_activate(ep); in dwc2_ep_enable()
597 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_ep_enable()
600 __func__, _ep->name, ep->stopped, ep->ep.maxpacket); in dwc2_ep_enable()
609 struct dwc2_ep *ep; in dwc2_ep_disable() local
614 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_ep_disable()
615 if (!_ep || !ep->desc) { in dwc2_ep_disable()
617 _ep ? ep->ep.name : NULL); in dwc2_ep_disable()
621 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_ep_disable()
624 nuke(ep, -ESHUTDOWN); in dwc2_ep_disable()
626 ep->desc = 0; in dwc2_ep_disable()
627 ep->stopped = 1; in dwc2_ep_disable()
629 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_ep_disable()
635 static struct usb_request *dwc2_alloc_request(struct usb_ep *ep, in dwc2_alloc_request() argument
640 debug("%s: %s %p\n", __func__, ep->name, ep); in dwc2_alloc_request()
652 static void dwc2_free_request(struct usb_ep *ep, struct usb_request *_req) in dwc2_free_request() argument
656 debug("%s: %p\n", __func__, ep); in dwc2_free_request()
666 struct dwc2_ep *ep; in dwc2_dequeue() local
672 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_dequeue()
673 if (!_ep || ep->ep.name == ep0name) in dwc2_dequeue()
676 spin_lock_irqsave(&ep->dev->lock, flags); in dwc2_dequeue()
679 list_for_each_entry(req, &ep->queue, queue) { in dwc2_dequeue()
684 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_dequeue()
688 done(ep, req, -ECONNRESET); in dwc2_dequeue()
690 spin_unlock_irqrestore(&ep->dev->lock, flags); in dwc2_dequeue()
700 struct dwc2_ep *ep; in dwc2_fifo_status() local
702 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_fifo_status()
708 debug("%s: %d\n", __func__, ep_index(ep)); in dwc2_fifo_status()
711 if (ep_is_in(ep)) in dwc2_fifo_status()
722 struct dwc2_ep *ep; in dwc2_fifo_flush() local
724 ep = container_of(_ep, struct dwc2_ep, ep); in dwc2_fifo_flush()
725 if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) { in dwc2_fifo_flush()
730 debug("%s: %d\n", __func__, ep_index(ep)); in dwc2_fifo_flush()
741 .ep0 = &memory.ep[0].ep,
746 .ep[0] = {
747 .ep = {
761 .ep[1] = {
762 .ep = {
776 .ep[2] = {
777 .ep = {
791 .ep[3] = {
792 .ep = {