Lines Matching refs:req
93 static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req) in setdma_rx() argument
99 buf = req->req.buf + req->req.actual; in setdma_rx()
100 length = min_t(u32, req->req.length - req->req.actual, in setdma_rx()
135 static int setdma_tx(struct dwc2_ep *ep, struct dwc2_request *req) in setdma_tx() argument
141 buf = req->req.buf + req->req.actual; in setdma_tx()
142 length = req->req.length - req->req.actual; in setdma_tx()
196 struct dwc2_request *req = NULL; in complete_rx() local
207 req = list_entry(ep->queue.next, struct dwc2_request, queue); in complete_rx()
235 req->req.actual += min(xfer_size, req->req.length - req->req.actual); in complete_rx()
241 __func__, ep_num, req->req.actual, req->req.length, in complete_rx()
242 is_short, ep_tsr, req->req.length - req->req.actual); in complete_rx()
244 if (is_short || req->req.actual == req->req.length) { in complete_rx()
251 done(ep, req, 0); in complete_rx()
254 req = list_entry(ep->queue.next, in complete_rx()
259 setdma_rx(ep, req); in complete_rx()
263 setdma_rx(ep, req); in complete_rx()
269 struct dwc2_request *req; in complete_tx() local
287 req = list_entry(ep->queue.next, struct dwc2_request, queue); in complete_tx()
293 req->req.actual += min(xfer_size, req->req.length - req->req.actual); in complete_tx()
298 __func__, ep_num, req->req.actual, req->req.length, in complete_tx()
299 is_short, ep_tsr, req->req.length - req->req.actual); in complete_tx()
307 last = write_fifo_ep0(ep, req); in complete_tx()
314 done(ep, req, 0); in complete_tx()
320 done(ep, req, 0); in complete_tx()
331 if (req->req.actual == req->req.length) in complete_tx()
332 done(ep, req, 0); in complete_tx()
335 req = list_entry(ep->queue.next, struct dwc2_request, queue); in complete_tx()
338 setdma_tx(ep, req); in complete_tx()
345 struct dwc2_request *req; in dwc2_udc_check_tx_queue() local
351 req = list_entry(ep->queue.next, struct dwc2_request, queue); in dwc2_udc_check_tx_queue()
354 __func__, req); in dwc2_udc_check_tx_queue()
357 setdma_tx(ep, req); in dwc2_udc_check_tx_queue()
359 setdma_rx(ep, req); in dwc2_udc_check_tx_queue()
611 struct dwc2_request *req; in dwc2_queue() local
617 req = container_of(_req, struct dwc2_request, req); in dwc2_queue()
619 || !list_empty(&req->queue))) { in dwc2_queue()
674 list_add_tail(&req->queue, &ep->queue); in dwc2_queue()
676 req = 0; in dwc2_queue()
684 setdma_tx(ep, req); in dwc2_queue()
691 setdma_rx(ep, req); in dwc2_queue()
696 if (likely(req != 0)) in dwc2_queue()
697 list_add_tail(&req->queue, &ep->queue); in dwc2_queue()
709 static int write_fifo_ep0(struct dwc2_ep *ep, struct dwc2_request *req) in write_fifo_ep0() argument
719 count = setdma_tx(ep, req); in write_fifo_ep0()
725 if (likely(req->req.length != req->req.actual + count) in write_fifo_ep0()
726 || req->req.zero) in write_fifo_ep0()
736 req->req.length - req->req.actual - count, req); in write_fifo_ep0()
810 struct dwc2_request *req; in dwc2_ep0_read() local
814 req = list_entry(ep->queue.next, struct dwc2_request, queue); in dwc2_ep0_read()
824 __func__, req, req->req.length, req->req.actual); in dwc2_ep0_read()
826 if (req->req.length == 0) { in dwc2_ep0_read()
839 setdma_rx(ep, req); in dwc2_ep0_read()
847 struct dwc2_request *req; in dwc2_ep0_write() local
852 req = 0; in dwc2_ep0_write()
854 req = list_entry(ep->queue.next, struct dwc2_request, queue); in dwc2_ep0_write()
856 if (!req) { in dwc2_ep0_write()
863 __func__, req, req->req.length, req->req.actual); in dwc2_ep0_write()
865 if (req->req.length - req->req.actual == ep0_fifo_size) { in dwc2_ep0_write()
871 ret = write_fifo_ep0(ep, req); in dwc2_ep0_write()