Lines Matching refs:req

38 static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req);
39 static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req);
44 struct m66592_request *req, int status);
497 static void start_ep0_write(struct m66592_ep *ep, struct m66592_request *req) in start_ep0_write() argument
506 if (req->req.length == 0) { in start_ep0_write()
509 transfer_complete(ep, req, 0); in start_ep0_write()
512 irq_ep0_write(ep, req); in start_ep0_write()
516 static void start_packet_write(struct m66592_ep *ep, struct m66592_request *req) in start_packet_write() argument
529 irq_packet_write(ep, req); in start_packet_write()
532 static void start_packet_read(struct m66592_ep *ep, struct m66592_request *req) in start_packet_read() argument
550 (req->req.length + ep->ep.maxpacket - 1) in start_packet_read()
559 static void start_packet(struct m66592_ep *ep, struct m66592_request *req) in start_packet() argument
562 start_packet_write(ep, req); in start_packet()
564 start_packet_read(ep, req); in start_packet()
567 static void start_ep0(struct m66592_ep *ep, struct m66592_request *req) in start_ep0() argument
575 start_ep0_write(ep, req); in start_ep0()
578 start_packet_read(ep, req); in start_ep0()
709 struct m66592_request *req, int status) in transfer_complete() argument
722 list_del_init(&req->queue); in transfer_complete()
724 req->req.status = -ESHUTDOWN; in transfer_complete()
726 req->req.status = status; in transfer_complete()
732 usb_gadget_giveback_request(&ep->ep, &req->req); in transfer_complete()
736 req = list_entry(ep->queue.next, struct m66592_request, queue); in transfer_complete()
738 start_packet(ep, req); in transfer_complete()
742 static void irq_ep0_write(struct m66592_ep *ep, struct m66592_request *req) in irq_ep0_write() argument
768 buf = req->req.buf + req->req.actual; in irq_ep0_write()
769 size = min(bufsize, req->req.length - req->req.actual); in irq_ep0_write()
772 if (req->req.buf) { in irq_ep0_write()
780 req->req.actual += size; in irq_ep0_write()
783 if ((!req->req.zero && (req->req.actual == req->req.length)) in irq_ep0_write()
795 static void irq_packet_write(struct m66592_ep *ep, struct m66592_request *req) in irq_packet_write() argument
815 buf = req->req.buf + req->req.actual; in irq_packet_write()
816 size = min(bufsize, req->req.length - req->req.actual); in irq_packet_write()
819 if (req->req.buf) { in irq_packet_write()
829 req->req.actual += size; in irq_packet_write()
831 if ((!req->req.zero && (req->req.actual == req->req.length)) in irq_packet_write()
842 static void irq_packet_read(struct m66592_ep *ep, struct m66592_request *req) in irq_packet_read() argument
855 req->req.status = -EPIPE; in irq_packet_read()
866 buf = req->req.buf + req->req.actual; in irq_packet_read()
867 req_len = req->req.length - req->req.actual; in irq_packet_read()
874 req->req.actual += size; in irq_packet_read()
877 if ((!req->req.zero && (req->req.actual == req->req.length)) in irq_packet_read()
886 if (req->req.buf) { in irq_packet_read()
894 transfer_complete(ep, req, 0); in irq_packet_read()
902 struct m66592_request *req; in irq_pipe_ready() local
910 req = list_entry(ep->queue.next, struct m66592_request, queue); in irq_pipe_ready()
911 irq_packet_read(ep, req); in irq_pipe_ready()
918 req = list_entry(ep->queue.next, in irq_pipe_ready()
921 irq_packet_write(ep, req); in irq_pipe_ready()
923 irq_packet_read(ep, req); in irq_pipe_ready()
935 struct m66592_request *req; in irq_pipe_empty() local
941 req = list_entry(ep->queue.next, struct m66592_request, queue); in irq_pipe_empty()
942 irq_ep0_write(ep, req); in irq_pipe_empty()
954 req = list_entry(ep->queue.next, in irq_pipe_empty()
958 transfer_complete(ep, req, 0); in irq_pipe_empty()
1014 struct m66592_request *req; in clear_feature() local
1023 req = list_entry(ep->queue.next, in clear_feature()
1029 start_packet(ep, req); in clear_feature()
1170 struct m66592_request *req; in irq_control_stage() local
1172 req = list_entry(ep->queue.next, struct m66592_request, queue); in irq_control_stage()
1173 transfer_complete(ep, req, 0); in irq_control_stage()
1318 struct m66592_request *req; in m66592_disable() local
1325 req = list_entry(ep->queue.next, struct m66592_request, queue); in m66592_disable()
1327 transfer_complete(ep, req, -ECONNRESET); in m66592_disable()
1338 struct m66592_request *req; in m66592_alloc_request() local
1340 req = kzalloc(sizeof(struct m66592_request), gfp_flags); in m66592_alloc_request()
1341 if (!req) in m66592_alloc_request()
1344 INIT_LIST_HEAD(&req->queue); in m66592_alloc_request()
1346 return &req->req; in m66592_alloc_request()
1351 struct m66592_request *req; in m66592_free_request() local
1353 req = container_of(_req, struct m66592_request, req); in m66592_free_request()
1354 kfree(req); in m66592_free_request()
1361 struct m66592_request *req; in m66592_queue() local
1366 req = container_of(_req, struct m66592_request, req); in m66592_queue()
1376 list_add_tail(&req->queue, &ep->queue); in m66592_queue()
1377 req->req.actual = 0; in m66592_queue()
1378 req->req.status = -EINPROGRESS; in m66592_queue()
1381 start_ep0(ep, req); in m66592_queue()
1384 start_packet(ep, req); in m66592_queue()
1395 struct m66592_request *req; in m66592_dequeue() local
1399 req = container_of(_req, struct m66592_request, req); in m66592_dequeue()
1403 transfer_complete(ep, req, -ECONNRESET); in m66592_dequeue()
1412 struct m66592_request *req; in m66592_set_halt() local
1417 req = list_entry(ep->queue.next, struct m66592_request, queue); in m66592_set_halt()