Lines Matching refs:dep
29 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep);
31 struct dwc3_ep *dep, struct dwc3_request *req);
54 struct dwc3_ep *dep;
58 dep = dwc->eps[epnum];
59 if (dep->flags & DWC3_EP_BUSY) {
60 dev_vdbg(dwc->dev, "%s still busy", dep->name);
64 trb = &dwc->ep0_trb[dep->free_slot];
67 dep->free_slot++;
93 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
96 dev_dbg(dwc->dev, "%s STARTTRANSFER failed", dep->name);
100 dep->flags |= DWC3_EP_BUSY;
101 dep->resource_index = dwc3_gadget_ep_get_transfer_index(dwc,
102 dep->number);
109 static int __dwc3_gadget_ep0_queue(struct dwc3_ep *dep,
112 struct dwc3 *dwc = dep->dwc;
116 req->epnum = dep->number;
118 list_add_tail(&req->list, &dep->request_list);
129 if (dep->flags & DWC3_EP_PENDING_REQUEST) {
132 direction = !!(dep->flags & DWC3_EP0_DIR_IN);
141 dep->flags &= ~(DWC3_EP_PENDING_REQUEST |
206 dep->flags &= ~DWC3_EP0_DIR_IN;
216 struct dwc3_ep *dep = to_dwc3_ep(ep);
217 struct dwc3 *dwc = dep->dwc;
224 if (!dep->endpoint.desc) {
226 request, dep->name);
232 if (!list_empty(&dep->request_list)) {
238 request, dep->name, request->length,
241 ret = __dwc3_gadget_ep0_queue(dep, req);
251 struct dwc3_ep *dep;
254 dep = dwc->eps[1];
255 dep->flags = DWC3_EP_ENABLED;
258 dep = dwc->eps[0];
259 __dwc3_gadget_ep_set_halt(dep, 1, false);
260 dep->flags = DWC3_EP_ENABLED;
263 if (!list_empty(&dep->request_list)) {
266 req = next_request(&dep->request_list);
267 dwc3_gadget_giveback(dep, req, -ECONNRESET);
276 struct dwc3_ep *dep = to_dwc3_ep(ep);
277 struct dwc3 *dwc = dep->dwc;
307 struct dwc3_ep *dep;
315 dep = dwc->eps[epnum];
316 if (dep->flags & DWC3_EP_ENABLED)
317 return dep;
331 struct dwc3_ep *dep;
363 dep = dwc3_wIndex_to_dep(dwc, ctrl->wIndex);
364 if (!dep)
367 if (dep->flags & DWC3_EP_STALL)
377 dep = dwc->eps[0];
378 dwc->ep0_usb_req.dep = dep;
383 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req);
389 struct dwc3_ep *dep;
475 dep = dwc3_wIndex_to_dep(dwc, wIndex);
476 if (!dep)
478 if (set == 0 && (dep->flags & DWC3_EP_WEDGE))
480 ret = __dwc3_gadget_ep_set_halt(dep, set, true);
592 struct dwc3_ep *dep = to_dwc3_ep(ep);
593 struct dwc3 *dwc = dep->dwc;
636 struct dwc3_ep *dep;
659 dep = dwc->eps[0];
660 dwc->ep0_usb_req.dep = dep;
661 dwc->ep0_usb_req.request.length = dep->endpoint.maxpacket;
665 return __dwc3_gadget_ep0_queue(dep, &dwc->ep0_usb_req);
866 struct dwc3_ep *dep;
870 dep = dwc->eps[0];
873 if (!list_empty(&dep->request_list)) {
874 r = next_request(&dep->request_list);
876 dwc3_gadget_giveback(dep, r, 0);
902 struct dwc3_ep *dep = dwc->eps[event->endpoint_number];
904 dep->flags &= ~DWC3_EP_BUSY;
905 dep->resource_index = 0;
929 struct dwc3_ep *dep, struct dwc3_request *req)
933 req->direction = !!dep->number;
936 ret = dwc3_ep0_start_trans(dwc, dep->number,
939 } else if (!IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) &&
940 (dep->number == 0)) {
945 dep->number);
951 maxpacket = dep->endpoint.maxpacket;
955 ret = dwc3_ep0_start_trans(dwc, dep->number,
971 ret = dwc3_ep0_start_trans(dwc, dep->number,
976 dep->number);
982 ret = dwc3_ep0_start_trans(dwc, dep->number, req->request.dma,
990 static int dwc3_ep0_start_control_status(struct dwc3_ep *dep)
992 struct dwc3 *dwc = dep->dwc;
998 return dwc3_ep0_start_trans(dwc, dep->number,
1002 static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep)
1010 WARN_ON(dwc3_ep0_start_control_status(dep));
1016 struct dwc3_ep *dep = dwc->eps[event->endpoint_number];
1018 __dwc3_ep0_do_control_status(dwc, dep);
1021 static void dwc3_ep0_end_control_data(struct dwc3 *dwc, struct dwc3_ep *dep)
1027 if (!dep->resource_index)
1032 cmd |= DWC3_DEPCMD_PARAM(dep->resource_index);
1034 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, ¶ms);
1036 dep->resource_index = 0;
1058 struct dwc3_ep *dep = dwc->eps[dwc->ep0_expect_in];
1061 dwc3_ep0_end_control_data(dwc, dep);