Lines Matching refs:dep
38 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep);
40 struct dwc3_ep *dep, struct dwc3_request *req);
63 struct dwc3_ep *dep; in dwc3_ep0_start_trans() local
67 dep = dwc->eps[epnum]; in dwc3_ep0_start_trans()
68 if (dep->flags & DWC3_EP_BUSY) { in dwc3_ep0_start_trans()
69 dwc3_trace(trace_dwc3_ep0, "%s still busy", dep->name); in dwc3_ep0_start_trans()
89 trace_dwc3_prepare_trb(dep, trb); in dwc3_ep0_start_trans()
91 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, in dwc3_ep0_start_trans()
95 dep->name); in dwc3_ep0_start_trans()
99 dep->flags |= DWC3_EP_BUSY; in dwc3_ep0_start_trans()
100 dep->resource_index = dwc3_gadget_ep_get_transfer_index(dwc, in dwc3_ep0_start_trans()
101 dep->number); in dwc3_ep0_start_trans()
108 static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, in __dwc3_gadget_ep0_queue() argument
111 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep0_queue()
115 req->epnum = dep->number; in __dwc3_gadget_ep0_queue()
117 list_add_tail(&req->list, &dep->request_list); in __dwc3_gadget_ep0_queue()
128 if (dep->flags & DWC3_EP_PENDING_REQUEST) { in __dwc3_gadget_ep0_queue()
131 direction = !!(dep->flags & DWC3_EP0_DIR_IN); in __dwc3_gadget_ep0_queue()
140 dep->flags &= ~(DWC3_EP_PENDING_REQUEST | in __dwc3_gadget_ep0_queue()
206 dep->flags &= ~DWC3_EP0_DIR_IN; in __dwc3_gadget_ep0_queue()
216 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_gadget_ep0_queue() local
217 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep0_queue()
224 if (!dep->endpoint.desc) { in dwc3_gadget_ep0_queue()
227 request, dep->name); in dwc3_gadget_ep0_queue()
233 if (!list_empty(&dep->request_list)) { in dwc3_gadget_ep0_queue()
240 request, dep->name, request->length, in dwc3_gadget_ep0_queue()
243 ret = __dwc3_gadget_ep0_queue(dep, req); in dwc3_gadget_ep0_queue()
253 struct dwc3_ep *dep; in dwc3_ep0_stall_and_restart() local
256 dep = dwc->eps[1]; in dwc3_ep0_stall_and_restart()
257 dep->flags = DWC3_EP_ENABLED; in dwc3_ep0_stall_and_restart()
260 dep = dwc->eps[0]; in dwc3_ep0_stall_and_restart()
261 __dwc3_gadget_ep_set_halt(dep, 1, false); in dwc3_ep0_stall_and_restart()
262 dep->flags = DWC3_EP_ENABLED; in dwc3_ep0_stall_and_restart()
265 if (!list_empty(&dep->request_list)) { in dwc3_ep0_stall_and_restart()
268 req = next_request(&dep->request_list); in dwc3_ep0_stall_and_restart()
269 dwc3_gadget_giveback(dep, req, -ECONNRESET); in dwc3_ep0_stall_and_restart()
278 struct dwc3_ep *dep = to_dwc3_ep(ep); in __dwc3_gadget_ep0_set_halt() local
279 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep0_set_halt()
288 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_gadget_ep0_set_halt() local
289 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep0_set_halt()
311 struct dwc3_ep *dep; in dwc3_wIndex_to_dep() local
319 dep = dwc->eps[epnum]; in dwc3_wIndex_to_dep()
320 if (dep->flags & DWC3_EP_ENABLED) in dwc3_wIndex_to_dep()
321 return dep; in dwc3_wIndex_to_dep()
335 struct dwc3_ep *dep; in dwc3_ep0_handle_status() local
367 dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex); in dwc3_ep0_handle_status()
368 if (!dep) in dwc3_ep0_handle_status()
371 if (dep->flags & DWC3_EP_STALL) in dwc3_ep0_handle_status()
381 dep = dwc->eps[0]; in dwc3_ep0_handle_status()
382 dwc->ep0_usb_req.dep = dep; in dwc3_ep0_handle_status()
387 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); in dwc3_ep0_handle_status()
393 struct dwc3_ep *dep; in dwc3_ep0_handle_feature() local
479 dep = dwc3_wIndex_to_dep(dwc, wIndex); in dwc3_ep0_handle_feature()
480 if (!dep) in dwc3_ep0_handle_feature()
482 if (set == 0 && (dep->flags & DWC3_EP_WEDGE)) in dwc3_ep0_handle_feature()
484 ret = __dwc3_gadget_ep_set_halt(dep, set, true); in dwc3_ep0_handle_feature()
596 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_ep0_set_sel_cmpl() local
597 struct dwc3 *dwc = dep->dwc; in dwc3_ep0_set_sel_cmpl()
640 struct dwc3_ep *dep; in dwc3_ep0_set_sel() local
665 dep = dwc->eps[0]; in dwc3_ep0_set_sel()
666 dwc->ep0_usb_req.dep = dep; in dwc3_ep0_set_sel()
667 dwc->ep0_usb_req.request.length = dep->endpoint.maxpacket; in dwc3_ep0_set_sel()
671 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); in dwc3_ep0_set_sel()
857 struct dwc3_ep *dep; in dwc3_ep0_complete_status() local
861 dep = dwc->eps[0]; in dwc3_ep0_complete_status()
864 trace_dwc3_complete_trb(dep, trb); in dwc3_ep0_complete_status()
866 if (!list_empty(&dep->request_list)) { in dwc3_ep0_complete_status()
867 r = next_request(&dep->request_list); in dwc3_ep0_complete_status()
869 dwc3_gadget_giveback(dep, r, 0); in dwc3_ep0_complete_status()
895 struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; in dwc3_ep0_xfer_complete() local
897 dep->flags &= ~DWC3_EP_BUSY; in dwc3_ep0_xfer_complete()
898 dep->resource_index = 0; in dwc3_ep0_xfer_complete()
922 struct dwc3_ep *dep, struct dwc3_request *req) in __dwc3_ep0_do_control_data() argument
926 req->direction = !!dep->number; in __dwc3_ep0_do_control_data()
929 ret = dwc3_ep0_start_trans(dwc, dep->number, in __dwc3_ep0_do_control_data()
932 } else if (!IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) in __dwc3_ep0_do_control_data()
933 && (dep->number == 0)) { in __dwc3_ep0_do_control_data()
938 dep->number); in __dwc3_ep0_do_control_data()
944 maxpacket = dep->endpoint.maxpacket; in __dwc3_ep0_do_control_data()
959 ret = dwc3_ep0_start_trans(dwc, dep->number, in __dwc3_ep0_do_control_data()
964 dep->number); in __dwc3_ep0_do_control_data()
970 ret = dwc3_ep0_start_trans(dwc, dep->number, req->request.dma, in __dwc3_ep0_do_control_data()
977 static int dwc3_ep0_start_control_status(struct dwc3_ep *dep) in dwc3_ep0_start_control_status() argument
979 struct dwc3 *dwc = dep->dwc; in dwc3_ep0_start_control_status()
985 return dwc3_ep0_start_trans(dwc, dep->number, in dwc3_ep0_start_control_status()
989 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep) in __dwc3_ep0_do_control_status() argument
997 WARN_ON(dwc3_ep0_start_control_status(dep)); in __dwc3_ep0_do_control_status()
1003 struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; in dwc3_ep0_do_control_status() local
1005 __dwc3_ep0_do_control_status(dwc, dep); in dwc3_ep0_do_control_status()
1008 static void dwc3_ep0_end_control_data(struct dwc3 *dwc, struct dwc3_ep *dep) in dwc3_ep0_end_control_data() argument
1014 if (!dep->resource_index) in dwc3_ep0_end_control_data()
1019 cmd |= DWC3_DEPCMD_PARAM(dep->resource_index); in dwc3_ep0_end_control_data()
1021 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, ¶ms); in dwc3_ep0_end_control_data()
1023 dep->resource_index = 0; in dwc3_ep0_end_control_data()
1045 struct dwc3_ep *dep = dwc->eps[dwc->ep0_expect_in]; in dwc3_ep0_xfernotready() local
1049 dwc3_ep0_end_control_data(dwc, dep); in dwc3_ep0_xfernotready()