Lines Matching refs:ep

364 		u32 mul = hwreq->req.length / hwep->ep.maxpacket;  in add_td_to_list()
367 || hwreq->req.length % hwep->ep.maxpacket) in add_td_to_list()
401 static inline u8 _usb_addr(struct ci_hw_ep *ep) in _usb_addr() argument
403 return ((ep->dir == TX) ? USB_ENDPOINT_DIR_MASK : 0) | ep->num; in _usb_addr()
449 && (hwreq->req.length % hwep->ep.maxpacket == 0)) in _hardware_enqueue()
494 u32 mul = hwreq->req.length / hwep->ep.maxpacket; in _hardware_enqueue()
497 || hwreq->req.length % hwep->ep.maxpacket) in _hardware_enqueue()
648 usb_gadget_giveback_request(&hwep->ep, &hwreq->req); in _ep_nuke()
659 static int _ep_set_halt(struct usb_ep *ep, int value, bool check_transfer) in _ep_set_halt() argument
661 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in _ep_set_halt()
665 if (ep == NULL || hwep->ep.desc == NULL) in _ep_set_halt()
668 if (usb_endpoint_xfer_isoc(hwep->ep.desc)) in _ep_set_halt()
675 !usb_endpoint_xfer_control(hwep->ep.desc)) { in _ep_set_halt()
705 struct usb_ep *ep; in _gadget_stop_activity() local
716 gadget_for_each_ep(ep, gadget) { in _gadget_stop_activity()
717 usb_ep_fifo_flush(ep); in _gadget_stop_activity()
719 usb_ep_fifo_flush(&ci->ep0out->ep); in _gadget_stop_activity()
720 usb_ep_fifo_flush(&ci->ep0in->ep); in _gadget_stop_activity()
723 gadget_for_each_ep(ep, gadget) { in _gadget_stop_activity()
724 usb_ep_disable(ep); in _gadget_stop_activity()
728 usb_ep_free_request(&ci->ep0in->ep, ci->status); in _gadget_stop_activity()
762 ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC); in isr_reset_handler()
780 static void isr_get_status_complete(struct usb_ep *ep, struct usb_request *req) in isr_get_status_complete() argument
782 if (ep == NULL || req == NULL) in isr_get_status_complete()
786 usb_ep_free_request(ep, req); in isr_get_status_complete()
794 static int _ep_queue(struct usb_ep *ep, struct usb_request *req, in _ep_queue() argument
797 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in _ep_queue()
802 if (ep == NULL || req == NULL || hwep->ep.desc == NULL) in _ep_queue()
817 if (usb_endpoint_xfer_isoc(hwep->ep.desc) && in _ep_queue()
818 hwreq->req.length > (1 + hwep->ep.mult) * hwep->ep.maxpacket) { in _ep_queue()
864 req = usb_ep_alloc_request(&hwep->ep, gfp_flags); in isr_get_status_response()
889 retval = _ep_queue(&hwep->ep, req, gfp_flags); in isr_get_status_response()
899 usb_ep_free_request(&hwep->ep, req); in isr_get_status_response()
913 isr_setup_status_complete(struct usb_ep *ep, struct usb_request *req) in isr_setup_status_complete() argument
946 retval = _ep_queue(&hwep->ep, ci->status, GFP_ATOMIC); in isr_setup_status_phase()
977 usb_gadget_giveback_request(&hweptemp->ep, &hwreq->req); in isr_tr_complete_low()
1042 &ci->ci_hw_ep[num].ep); in isr_setup_packet_handler()
1092 err = _ep_set_halt(&ci->ci_hw_ep[num].ep, 1, false); in isr_setup_packet_handler()
1158 if (_ep_set_halt(&hwep->ep, 1, false)) in isr_setup_packet_handler()
1180 if (hwep->ep.desc == NULL) in isr_tr_complete_handler()
1190 if (_ep_set_halt(&hwep->ep, 1, false)) in isr_tr_complete_handler()
1213 static int ep_enable(struct usb_ep *ep, in ep_enable() argument
1216 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_enable()
1221 if (ep == NULL || desc == NULL) in ep_enable()
1234 hwep->ep.desc = desc; in ep_enable()
1240 hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff; in ep_enable()
1241 hwep->ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc)); in ep_enable()
1247 cap |= (hwep->ep.maxpacket << __ffs(QH_MAX_PKT)) & QH_MAX_PKT; in ep_enable()
1281 static int ep_disable(struct usb_ep *ep) in ep_disable() argument
1283 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_disable()
1287 if (ep == NULL) in ep_disable()
1289 else if (hwep->ep.desc == NULL) in ep_disable()
1306 hwep->ep.desc = NULL; in ep_disable()
1317 static struct usb_request *ep_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) in ep_alloc_request() argument
1321 if (ep == NULL) in ep_alloc_request()
1338 static void ep_free_request(struct usb_ep *ep, struct usb_request *req) in ep_free_request() argument
1340 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_free_request()
1345 if (ep == NULL || req == NULL) { in ep_free_request()
1371 static int ep_queue(struct usb_ep *ep, struct usb_request *req, in ep_queue() argument
1374 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_queue()
1378 if (ep == NULL || req == NULL || hwep->ep.desc == NULL) in ep_queue()
1382 retval = _ep_queue(ep, req, gfp_flags); in ep_queue()
1392 static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) in ep_dequeue() argument
1394 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_dequeue()
1399 if (ep == NULL || req == NULL || hwreq->req.status != -EALREADY || in ep_dequeue()
1400 hwep->ep.desc == NULL || list_empty(&hwreq->queue) || in ep_dequeue()
1423 usb_gadget_giveback_request(&hwep->ep, &hwreq->req); in ep_dequeue()
1436 static int ep_set_halt(struct usb_ep *ep, int value) in ep_set_halt() argument
1438 return _ep_set_halt(ep, value, true); in ep_set_halt()
1446 static int ep_set_wedge(struct usb_ep *ep) in ep_set_wedge() argument
1448 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_set_wedge()
1451 if (ep == NULL || hwep->ep.desc == NULL) in ep_set_wedge()
1458 return usb_ep_set_halt(ep); in ep_set_wedge()
1466 static void ep_fifo_flush(struct usb_ep *ep) in ep_fifo_flush() argument
1468 struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep); in ep_fifo_flush()
1471 if (ep == NULL) { in ep_fifo_flush()
1636 hwep->ep.name = hwep->name; in init_eps()
1637 hwep->ep.ops = &usb_ep_ops; in init_eps()
1640 hwep->ep.caps.type_control = true; in init_eps()
1642 hwep->ep.caps.type_iso = true; in init_eps()
1643 hwep->ep.caps.type_bulk = true; in init_eps()
1644 hwep->ep.caps.type_int = true; in init_eps()
1648 hwep->ep.caps.dir_in = true; in init_eps()
1650 hwep->ep.caps.dir_out = true; in init_eps()
1657 usb_ep_set_maxpacket_limit(&hwep->ep, (unsigned short)~0); in init_eps()
1677 usb_ep_set_maxpacket_limit(&hwep->ep, CTRL_PAYLOAD_MAX); in init_eps()
1681 list_add_tail(&hwep->ep.ep_list, &ci->gadget.ep_list); in init_eps()
1718 ci->ep0out->ep.desc = &ctrl_endpt_out_desc; in ci_udc_start()
1719 retval = usb_ep_enable(&ci->ep0out->ep); in ci_udc_start()
1723 ci->ep0in->ep.desc = &ctrl_endpt_in_desc; in ci_udc_start()
1724 retval = usb_ep_enable(&ci->ep0in->ep); in ci_udc_start()
1908 ci->gadget.ep0 = &ci->ep0in->ep; in udc_start()