Lines Matching refs:req

33 static void done(struct fusb300_ep *ep, struct fusb300_request *req,
251 struct fusb300_request *req;
259 req = list_entry(ep->queue.next, struct fusb300_request, queue);
261 done(ep, req, -ECONNRESET);
271 struct fusb300_request *req;
273 req = kzalloc(sizeof(struct fusb300_request), gfp_flags);
274 if (!req)
276 INIT_LIST_HEAD(&req->queue);
278 return &req->req;
283 struct fusb300_request *req;
285 req = container_of(_req, struct fusb300_request, req);
286 kfree(req);
331 struct fusb300_request *req)
337 u32 length = req->req.length - req->req.actual;
339 tmp = req->req.buf + req->req.actual;
349 req->req.actual += SS_CTL_MAX_PACKET_SIZE;
378 req->req.actual += length;
399 static void ep0_queue(struct fusb300_ep *ep, struct fusb300_request *req)
402 if (req->req.length) {
403 fusb300_wrcxf(ep, req);
405 printk(KERN_DEBUG "%s : req->req.length = 0x%x\n",
406 __func__, req->req.length);
407 if ((req->req.length == req->req.actual) ||
408 (req->req.actual < ep->ep.maxpacket))
409 done(ep, req, 0);
411 if (!req->req.length)
412 done(ep, req, 0);
423 struct fusb300_request *req;
428 req = container_of(_req, struct fusb300_request, req);
438 list_add_tail(&req->queue, &ep->queue);
440 req->req.actual = 0;
441 req->req.status = -EINPROGRESS;
444 ep0_queue(ep, req);
456 struct fusb300_request *req;
460 req = container_of(_req, struct fusb300_request, req);
464 done(ep, req, -ECONNRESET);
601 struct fusb300_request *req,
609 tmp = req->req.buf + req->req.actual;
610 req->req.actual += length;
612 if (req->req.actual > req->req.length)
613 printk(KERN_DEBUG "req->req.actual > req->req.length\n");
864 static void done(struct fusb300_ep *ep, struct fusb300_request *req,
867 list_del_init(&req->queue);
871 req->req.status = -ESHUTDOWN;
873 req->req.status = status;
876 usb_gadget_giveback_request(&ep->ep, &req->req);
939 struct fusb300_request *req)
944 &req->req, DMA_TO_DEVICE);
951 fusb300_fill_idma_prdtbl(ep, req->req.dma, req->req.length);
956 &req->req, DMA_TO_DEVICE);
961 struct fusb300_request *req = list_entry(ep->queue.next,
964 if (req->req.length)
965 fusb300_set_idma(ep, req);
966 done(ep, req, 0);
972 struct fusb300_request *req = list_entry(ep->queue.next,
977 fusb300_rdfifo(ep, req, length);
980 if ((req->req.length == req->req.actual) || (length < ep->ep.maxpacket))
981 done(ep, req, 0);
1012 struct fusb300_request *req;
1014 req = list_first_entry(&ep->queue,
1016 if (req->req.length)
1017 fusb300_rdcxf(ep->fusb300, req->req.buf,
1018 req->req.length);
1019 done(ep, req, 0);
1029 struct fusb300_request *req;
1033 req = list_entry(ep->queue.next,
1035 if (req->req.length)
1036 fusb300_wrcxf(ep, req);
1037 if ((req->req.length - req->req.actual) < ep->ep.maxpacket)
1038 done(ep, req, 0);