Lines Matching refs:req

162 	struct usb_request	req;
169 #define to_ast_req(__req) container_of(__req, struct ast_udc_request, req)
281 static void ast_udc_done(struct ast_udc_ep *ep, struct ast_udc_request *req,
286 EP_DBG(ep, "req @%p, len (%d/%d), buf:0x%x, dir:0x%x\n",
287 req, req->req.actual, req->req.length,
288 (u32)req->req.buf, ep->dir_in);
290 list_del(&req->queue);
292 if (req->req.status == -EINPROGRESS)
293 req->req.status = status;
295 status = req->req.status;
298 EP_DBG(ep, "done req:%p, status:%d\n", req, status);
301 usb_gadget_giveback_request(&ep->ep, &req->req);
310 struct ast_udc_request *req;
312 req = list_entry(ep->queue.next, struct ast_udc_request,
314 ast_udc_done(ep, req, status);
453 struct ast_udc_request *req;
455 req = kzalloc(sizeof(struct ast_udc_request), gfp_flags);
456 if (!req) {
461 INIT_LIST_HEAD(&req->queue);
463 return &req->req;
469 struct ast_udc_request *req = to_ast_req(_req);
471 kfree(req);
475 u16 tx_len, struct ast_udc_request *req)
492 EP_DBG(ep, "req @%p, %s:%d, %s:0x%x, %s:0x%x\n", req,
516 req->saved_dma_wptr = ep->descs_wptr;
530 static void ast_udc_epn_kick(struct ast_udc_ep *ep, struct ast_udc_request *req)
535 last = req->req.length - req->req.actual;
538 EP_DBG(ep, "kick req @%p, len:%d, dir:%d\n",
539 req, tx_len, ep->dir_in);
541 ast_ep_write(ep, req->req.dma + req->req.actual, AST_UDC_EP_DMA_BUFF);
550 struct ast_udc_request *req)
558 last = req->req.length - req->req.actual;
561 EP_DBG(ep, "kick req @%p, %s:%d, %s:0x%x, %s:0x%x (%d/%d), %s:0x%x\n",
562 req, "tx_len", tx_len, "dir_in", ep->dir_in,
563 "dma", req->req.dma + req->req.actual,
564 req->req.actual, req->req.length,
567 if (!ast_dma_descriptor_setup(ep, req->req.dma + req->req.actual,
568 tx_len, req))
569 req->actual_dma_length += tx_len;
583 struct ast_udc_request *req)
589 last = req->req.length - req->req.actual;
592 ast_udc_write(udc, req->req.dma + req->req.actual,
598 "buf", (u32)req->req.buf,
599 "dma", req->req.dma + req->req.actual,
601 req->req.actual, req->req.length,
604 req->req.actual += tx_len;
612 "buf", (u32)req->req.buf,
613 "dma", req->req.dma + req->req.actual,
614 "len", req->req.actual, req->req.length,
617 if (!req->req.length) {
629 struct ast_udc_request *req = to_ast_req(_req);
648 list_add_tail(&req->queue, &ep->queue);
650 req->req.actual = 0;
651 req->req.status = -EINPROGRESS;
652 req->actual_dma_length = 0;
654 rc = usb_gadget_map_request(&udc->gadget, &req->req, ep->dir_in);
661 EP_DBG(ep, "enqueue req @%p\n", req);
667 if ((req->req.dma % 4) != 0) {
668 dev_warn(dev, "EP0 req dma alignment error\n");
673 ast_udc_ep0_queue(ep, req);
680 ast_udc_epn_kick_desc(ep, req);
682 ast_udc_epn_kick(ep, req);
695 struct ast_udc_request *req;
702 list_for_each_entry(req, &ep->queue, queue) {
703 if (&req->req == _req) {
704 list_del_init(&req->queue);
705 ast_udc_done(ep, req, -ESHUTDOWN);
712 if (&req->req != _req)
790 struct ast_udc_request *req;
796 req = list_entry(ep->queue.next, struct ast_udc_request, queue);
799 req->req.actual += rx_len;
801 SETUP_DBG(udc, "req %p (%d/%d)\n", req,
802 req->req.actual, req->req.length);
805 (req->req.actual == req->req.length)) {
808 ast_udc_done(ep, req, 0);
811 if (rx_len > req->req.length) {
814 req->req.actual, req->req.length);
816 ast_udc_done(ep, req, 0);
823 ast_udc_ep0_queue(ep, req);
830 struct ast_udc_request *req;
841 req = list_entry(ep->queue.next, struct ast_udc_request, queue);
843 SETUP_DBG(udc, "req %p (%d/%d)\n", req,
844 req->req.actual, req->req.length);
846 if (req->req.length == req->req.actual) {
847 if (req->req.length)
851 ast_udc_done(ep, req, 0);
855 ast_udc_ep0_queue(ep, req);
862 struct ast_udc_request *req;
868 req = list_first_entry(&ep->queue, struct ast_udc_request, queue);
871 req->req.actual += len;
873 EP_DBG(ep, "req @%p, length:(%d/%d), %s:0x%x\n", req,
874 req->req.actual, req->req.length, "len", len);
877 if (req->req.length == req->req.actual) {
878 ast_udc_done(ep, req, 0);
879 req = list_first_entry_or_null(&ep->queue,
886 ast_udc_done(ep, req, 0);
887 req = list_first_entry_or_null(&ep->queue,
894 if (req)
895 ast_udc_epn_kick(ep, req);
902 struct ast_udc_request *req;
913 req = list_first_entry(&ep->queue, struct ast_udc_request, queue);
938 i = req->saved_dma_wptr;
950 req->req.actual += total_len;
952 EP_DBG(ep, "req @%p, length:(%d/%d), %s:0x%x\n", req,
953 req->req.actual, req->req.length, "len", total_len);
956 if (req->req.length == req->req.actual) {
957 ast_udc_done(ep, req, 0);
958 req = list_first_entry_or_null(&ep->queue,
965 ast_udc_done(ep, req, 0);
966 req = list_first_entry_or_null(&ep->queue,
973 if (req && (req->actual_dma_length == req->req.actual)) {
975 ast_udc_epn_kick_desc(ep, req);
1033 struct ast_udc_request *req;
1049 list_for_each_entry(req, &udc->ep[0].queue, queue) {
1051 EP_DBG(ep, "there is req %p in ep0 queue !\n", req);