Lines Matching refs:uep
43 struct usbhsg_uep *uep; member
60 int (*device)(struct usbhs_priv *priv, struct usbhsg_uep *uep,
62 int (*interface)(struct usbhs_priv *priv, struct usbhsg_uep *uep,
64 int (*endpoint)(struct usbhs_priv *priv, struct usbhsg_uep *uep,
78 ((i) < (g)->uep_size) && ((pos) = (g)->uep + (i)); \
96 #define usbhsg_gpriv_to_dcp(gp) ((gp)->uep)
97 #define usbhsg_gpriv_to_nth_uep(gp, i) ((gp)->uep + i)
118 static void __usbhsg_queue_pop(struct usbhsg_uep *uep, in __usbhsg_queue_pop() argument
122 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in __usbhsg_queue_pop()
123 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in __usbhsg_queue_pop()
132 usb_gadget_giveback_request(&uep->ep, &ureq->req); in __usbhsg_queue_pop()
136 static void usbhsg_queue_pop(struct usbhsg_uep *uep, in usbhsg_queue_pop() argument
140 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_queue_pop()
145 __usbhsg_queue_pop(uep, ureq, status); in usbhsg_queue_pop()
152 struct usbhsg_uep *uep = usbhsg_pipe_to_uep(pipe); in usbhsg_queue_done() local
159 if (uep) in usbhsg_queue_done()
160 __usbhsg_queue_pop(uep, ureq, 0); in usbhsg_queue_done()
164 static void usbhsg_queue_push(struct usbhsg_uep *uep, in usbhsg_queue_push() argument
167 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_queue_push()
169 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_queue_push()
218 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_control_done() argument
231 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_clear_endpoint() argument
234 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_clear_endpoint()
235 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_recip_handler_std_clear_endpoint()
243 usbhsg_recip_handler_std_control_done(priv, uep, ctrl); in usbhsg_recip_handler_std_clear_endpoint()
261 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_set_device() argument
266 usbhsg_recip_handler_std_control_done(priv, uep, ctrl); in usbhsg_recip_handler_std_set_device()
271 usbhsg_recip_handler_std_control_done(priv, uep, ctrl); in usbhsg_recip_handler_std_set_device()
279 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_set_endpoint() argument
282 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_recip_handler_std_set_endpoint()
286 usbhsg_recip_handler_std_control_done(priv, uep, ctrl); in usbhsg_recip_handler_std_set_endpoint()
349 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_get_device() argument
352 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_device()
364 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_get_interface() argument
367 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_interface()
376 struct usbhsg_uep *uep, in usbhsg_recip_handler_std_get_endpoint() argument
379 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_recip_handler_std_get_endpoint()
380 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_recip_handler_std_get_endpoint()
407 struct usbhsg_uep *uep; in usbhsg_recip_run_handle() local
412 int (*func)(struct usbhs_priv *priv, struct usbhsg_uep *uep, in usbhsg_recip_run_handle()
416 uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); in usbhsg_recip_run_handle()
417 pipe = usbhsg_uep_to_pipe(uep); in usbhsg_recip_run_handle()
444 ret = func(priv, uep, ctrl); in usbhsg_recip_run_handle()
556 static int usbhsg_pipe_disable(struct usbhsg_uep *uep) in usbhsg_pipe_disable() argument
558 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_pipe_disable()
566 usbhsg_queue_pop(uep, usbhsg_pkt_to_ureq(pkt), -ESHUTDOWN); in usbhsg_pipe_disable()
582 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); in usbhsg_ep_enable() local
583 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_ep_enable()
595 if (uep->pipe) { in usbhsg_ep_enable()
596 usbhs_pipe_clear(uep->pipe); in usbhsg_ep_enable()
597 usbhs_pipe_sequence_data0(uep->pipe); in usbhsg_ep_enable()
606 uep->pipe = pipe; in usbhsg_ep_enable()
607 pipe->mod_private = uep; in usbhsg_ep_enable()
638 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); in usbhsg_ep_disable() local
642 spin_lock_irqsave(&uep->lock, flags); in usbhsg_ep_disable()
643 pipe = usbhsg_uep_to_pipe(uep); in usbhsg_ep_disable()
647 usbhsg_pipe_disable(uep); in usbhsg_ep_disable()
650 uep->pipe->mod_private = NULL; in usbhsg_ep_disable()
651 uep->pipe = NULL; in usbhsg_ep_disable()
654 spin_unlock_irqrestore(&uep->lock, flags); in usbhsg_ep_disable()
685 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); in usbhsg_ep_queue() local
686 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in usbhsg_ep_queue()
688 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in usbhsg_ep_queue()
696 usbhsg_queue_push(uep, ureq); in usbhsg_ep_queue()
703 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); in usbhsg_ep_dequeue() local
708 spin_lock_irqsave(&uep->lock, flags); in usbhsg_ep_dequeue()
709 pipe = usbhsg_uep_to_pipe(uep); in usbhsg_ep_dequeue()
717 usbhsg_queue_pop(uep, ureq, -ECONNRESET); in usbhsg_ep_dequeue()
718 spin_unlock_irqrestore(&uep->lock, flags); in usbhsg_ep_dequeue()
725 struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep); in __usbhsg_ep_set_halt_wedge() local
726 struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); in __usbhsg_ep_set_halt_wedge()
727 struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep); in __usbhsg_ep_set_halt_wedge()
877 struct usbhsg_uep *uep; in usbhsg_try_stop() local
913 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) in usbhsg_try_stop()
914 usbhsg_ep_disable(&uep->ep); in usbhsg_try_stop()
1079 struct usbhsg_uep *uep; in usbhs_mod_gadget_probe() local
1091 uep = kcalloc(pipe_size, sizeof(struct usbhsg_uep), GFP_KERNEL); in usbhs_mod_gadget_probe()
1092 if (!uep) { in usbhs_mod_gadget_probe()
1118 gpriv->uep = uep; in usbhs_mod_gadget_probe()
1137 usbhsg_for_each_uep_with_dcp(uep, gpriv, i) { in usbhs_mod_gadget_probe()
1138 uep->gpriv = gpriv; in usbhs_mod_gadget_probe()
1139 uep->pipe = NULL; in usbhs_mod_gadget_probe()
1140 snprintf(uep->ep_name, EP_NAME_SIZE, "ep%d", i); in usbhs_mod_gadget_probe()
1142 uep->ep.name = uep->ep_name; in usbhs_mod_gadget_probe()
1143 uep->ep.ops = &usbhsg_ep_ops; in usbhs_mod_gadget_probe()
1144 INIT_LIST_HEAD(&uep->ep.ep_list); in usbhs_mod_gadget_probe()
1145 spin_lock_init(&uep->lock); in usbhs_mod_gadget_probe()
1148 if (usbhsg_is_dcp(uep)) { in usbhs_mod_gadget_probe()
1149 gpriv->gadget.ep0 = &uep->ep; in usbhs_mod_gadget_probe()
1150 usb_ep_set_maxpacket_limit(&uep->ep, 64); in usbhs_mod_gadget_probe()
1151 uep->ep.caps.type_control = true; in usbhs_mod_gadget_probe()
1155 uep->ep.caps.type_iso = true; in usbhs_mod_gadget_probe()
1157 uep->ep.caps.type_bulk = true; in usbhs_mod_gadget_probe()
1159 uep->ep.caps.type_int = true; in usbhs_mod_gadget_probe()
1160 usb_ep_set_maxpacket_limit(&uep->ep, in usbhs_mod_gadget_probe()
1162 list_add_tail(&uep->ep.ep_list, &gpriv->gadget.ep_list); in usbhs_mod_gadget_probe()
1164 uep->ep.caps.dir_in = true; in usbhs_mod_gadget_probe()
1165 uep->ep.caps.dir_out = true; in usbhs_mod_gadget_probe()
1178 kfree(gpriv->uep); in usbhs_mod_gadget_probe()
1192 kfree(gpriv->uep); in usbhs_mod_gadget_remove()