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()
73 trb = &dwc->ep0_trb[dep->free_slot]; in dwc3_ep0_start_trans()
76 dep->free_slot++; in dwc3_ep0_start_trans()
99 trace_dwc3_prepare_trb(dep, trb); in dwc3_ep0_start_trans()
101 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, in dwc3_ep0_start_trans()
105 dep->name); in dwc3_ep0_start_trans()
109 dep->flags |= DWC3_EP_BUSY; in dwc3_ep0_start_trans()
110 dep->resource_index = dwc3_gadget_ep_get_transfer_index(dwc, in dwc3_ep0_start_trans()
111 dep->number); in dwc3_ep0_start_trans()
118 static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep, in __dwc3_gadget_ep0_queue() argument
121 struct dwc3 *dwc = dep->dwc; in __dwc3_gadget_ep0_queue()
125 req->epnum = dep->number; in __dwc3_gadget_ep0_queue()
127 list_add_tail(&req->list, &dep->request_list); in __dwc3_gadget_ep0_queue()
138 if (dep->flags & DWC3_EP_PENDING_REQUEST) { in __dwc3_gadget_ep0_queue()
141 direction = !!(dep->flags & DWC3_EP0_DIR_IN); in __dwc3_gadget_ep0_queue()
150 dep->flags &= ~(DWC3_EP_PENDING_REQUEST | in __dwc3_gadget_ep0_queue()
216 dep->flags &= ~DWC3_EP0_DIR_IN; in __dwc3_gadget_ep0_queue()
226 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_gadget_ep0_queue() local
227 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep0_queue()
234 if (!dep->endpoint.desc) { in dwc3_gadget_ep0_queue()
237 request, dep->name); in dwc3_gadget_ep0_queue()
243 if (!list_empty(&dep->request_list)) { in dwc3_gadget_ep0_queue()
250 request, dep->name, request->length, in dwc3_gadget_ep0_queue()
253 ret = __dwc3_gadget_ep0_queue(dep, req); in dwc3_gadget_ep0_queue()
263 struct dwc3_ep *dep; in dwc3_ep0_stall_and_restart() local
266 dep = dwc->eps[1]; in dwc3_ep0_stall_and_restart()
267 dep->flags = DWC3_EP_ENABLED; in dwc3_ep0_stall_and_restart()
270 dep = dwc->eps[0]; in dwc3_ep0_stall_and_restart()
271 __dwc3_gadget_ep_set_halt(dep, 1, false); in dwc3_ep0_stall_and_restart()
272 dep->flags = DWC3_EP_ENABLED; in dwc3_ep0_stall_and_restart()
275 if (!list_empty(&dep->request_list)) { in dwc3_ep0_stall_and_restart()
278 req = next_request(&dep->request_list); in dwc3_ep0_stall_and_restart()
279 dwc3_gadget_giveback(dep, req, -ECONNRESET); in dwc3_ep0_stall_and_restart()
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()
298 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_gadget_ep0_set_halt() local
299 struct dwc3 *dwc = dep->dwc; in dwc3_gadget_ep0_set_halt()
321 struct dwc3_ep *dep; in dwc3_wIndex_to_dep() local
329 dep = dwc->eps[epnum]; in dwc3_wIndex_to_dep()
330 if (dep->flags & DWC3_EP_ENABLED) in dwc3_wIndex_to_dep()
331 return dep; in dwc3_wIndex_to_dep()
345 struct dwc3_ep *dep; in dwc3_ep0_handle_status() local
377 dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex); in dwc3_ep0_handle_status()
378 if (!dep) in dwc3_ep0_handle_status()
381 if (dep->flags & DWC3_EP_STALL) in dwc3_ep0_handle_status()
391 dep = dwc->eps[0]; in dwc3_ep0_handle_status()
392 dwc->ep0_usb_req.dep = dep; in dwc3_ep0_handle_status()
397 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); in dwc3_ep0_handle_status()
403 struct dwc3_ep *dep; in dwc3_ep0_handle_feature() local
489 dep = dwc3_wIndex_to_dep(dwc, wIndex); in dwc3_ep0_handle_feature()
490 if (!dep) in dwc3_ep0_handle_feature()
492 if (set == 0 && (dep->flags & DWC3_EP_WEDGE)) in dwc3_ep0_handle_feature()
494 ret = __dwc3_gadget_ep_set_halt(dep, set, true); in dwc3_ep0_handle_feature()
606 struct dwc3_ep *dep = to_dwc3_ep(ep); in dwc3_ep0_set_sel_cmpl() local
607 struct dwc3 *dwc = dep->dwc; in dwc3_ep0_set_sel_cmpl()
650 struct dwc3_ep *dep; in dwc3_ep0_set_sel() local
675 dep = dwc->eps[0]; in dwc3_ep0_set_sel()
676 dwc->ep0_usb_req.dep = dep; in dwc3_ep0_set_sel()
677 dwc->ep0_usb_req.request.length = dep->endpoint.maxpacket; in dwc3_ep0_set_sel()
681 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req); in dwc3_ep0_set_sel()
886 struct dwc3_ep *dep; in dwc3_ep0_complete_status() local
890 dep = dwc->eps[0]; in dwc3_ep0_complete_status()
893 trace_dwc3_complete_trb(dep, trb); in dwc3_ep0_complete_status()
895 if (!list_empty(&dep->request_list)) { in dwc3_ep0_complete_status()
896 r = next_request(&dep->request_list); in dwc3_ep0_complete_status()
898 dwc3_gadget_giveback(dep, r, 0); in dwc3_ep0_complete_status()
924 struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; in dwc3_ep0_xfer_complete() local
926 dep->flags &= ~DWC3_EP_BUSY; in dwc3_ep0_xfer_complete()
927 dep->resource_index = 0; in dwc3_ep0_xfer_complete()
951 struct dwc3_ep *dep, struct dwc3_request *req) in __dwc3_ep0_do_control_data() argument
955 req->direction = !!dep->number; in __dwc3_ep0_do_control_data()
958 ret = dwc3_ep0_start_trans(dwc, dep->number, in __dwc3_ep0_do_control_data()
961 } else if (!IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) in __dwc3_ep0_do_control_data()
962 && (dep->number == 0)) { in __dwc3_ep0_do_control_data()
967 dep->number); in __dwc3_ep0_do_control_data()
973 maxpacket = dep->endpoint.maxpacket; in __dwc3_ep0_do_control_data()
978 ret = dwc3_ep0_start_trans(dwc, dep->number, in __dwc3_ep0_do_control_data()
990 ret = dwc3_ep0_start_trans(dwc, dep->number, in __dwc3_ep0_do_control_data()
995 dep->number); in __dwc3_ep0_do_control_data()
1001 ret = dwc3_ep0_start_trans(dwc, dep->number, req->request.dma, in __dwc3_ep0_do_control_data()
1009 static int dwc3_ep0_start_control_status(struct dwc3_ep *dep) in dwc3_ep0_start_control_status() argument
1011 struct dwc3 *dwc = dep->dwc; in dwc3_ep0_start_control_status()
1017 return dwc3_ep0_start_trans(dwc, dep->number, in dwc3_ep0_start_control_status()
1021 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep) in __dwc3_ep0_do_control_status() argument
1029 WARN_ON(dwc3_ep0_start_control_status(dep)); in __dwc3_ep0_do_control_status()
1035 struct dwc3_ep *dep = dwc->eps[event->endpoint_number]; in dwc3_ep0_do_control_status() local
1037 __dwc3_ep0_do_control_status(dwc, dep); in dwc3_ep0_do_control_status()
1040 static void dwc3_ep0_end_control_data(struct dwc3 *dwc, struct dwc3_ep *dep) in dwc3_ep0_end_control_data() argument
1046 if (!dep->resource_index) in dwc3_ep0_end_control_data()
1051 cmd |= DWC3_DEPCMD_PARAM(dep->resource_index); in dwc3_ep0_end_control_data()
1053 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, ¶ms); in dwc3_ep0_end_control_data()
1055 dep->resource_index = 0; in dwc3_ep0_end_control_data()
1077 struct dwc3_ep *dep = dwc->eps[dwc->ep0_expect_in]; in dwc3_ep0_xfernotready() local
1081 dwc3_ep0_end_control_data(dwc, dep); in dwc3_ep0_xfernotready()