Lines Matching refs:req

230 		struct s3c2410_request *req, int status)
234 list_del_init(&req->queue);
236 if (likely(req->req.status == -EINPROGRESS))
237 req->req.status = status;
239 status = req->req.status;
242 usb_gadget_giveback_request(&ep->ep, &req->req);
250 struct s3c2410_request *req;
251 req = list_entry(ep->queue.next, struct s3c2410_request,
253 s3c2410_udc_done(ep, req, status);
270 struct s3c2410_request *req,
273 unsigned len = min(req->req.length - req->req.actual, max);
274 u8 *buf = req->req.buf + req->req.actual;
279 req->req.actual, req->req.length, len, req->req.actual + len);
281 req->req.actual += len;
294 struct s3c2410_request *req)
324 count = s3c2410_udc_write_packet(fifo_reg, req, ep->ep.maxpacket);
329 else if (req->req.length != req->req.actual || req->req.zero)
338 idx, count, req->req.actual, req->req.length,
339 is_last, req->req.zero);
359 s3c2410_udc_done(ep, req, 0);
380 struct s3c2410_request *req, unsigned avail)
384 len = min(req->req.length - req->req.actual, avail);
385 req->req.actual += len;
395 struct s3c2410_request *req)
429 if (!req->req.length)
432 buf = req->req.buf + req->req.actual;
433 bufferspace = req->req.length - req->req.actual;
449 fifo_count = s3c2410_udc_read_packet(fifo_reg, buf, req, avail);
458 req->req.status = -EOVERFLOW;
460 is_last = (req->req.length <= req->req.actual) ? 1 : 0;
483 s3c2410_udc_done(ep, req, 0);
718 struct s3c2410_request *req;
722 req = NULL;
724 req = list_entry(ep->queue.next, struct s3c2410_request, queue);
759 if (!(ep0csr & S3C2410_UDC_EP0_CSR_IPKRDY) && req)
760 s3c2410_udc_write_fifo(ep, req);
765 if ((ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY) && req)
766 s3c2410_udc_read_fifo(ep, req);
787 struct s3c2410_request *req;
793 req = list_entry(ep->queue.next,
796 req = NULL;
804 idx, ep_csr1, req ? 1 : 0);
814 if (!(ep_csr1 & S3C2410_UDC_ICSR1_PKTRDY) && req)
815 s3c2410_udc_write_fifo(ep, req);
828 if ((ep_csr1 & S3C2410_UDC_OCSR1_PKTRDY) && req)
829 s3c2410_udc_read_fifo(ep, req);
994 static inline struct s3c2410_request *to_s3c2410_req(struct usb_request *req)
996 return container_of(req, struct s3c2410_request, req);
1120 struct s3c2410_request *req;
1127 req = kzalloc(sizeof(struct s3c2410_request), mem_flags);
1128 if (!req)
1131 INIT_LIST_HEAD(&req->queue);
1132 return &req->req;
1142 struct s3c2410_request *req = to_s3c2410_req(_req);
1149 WARN_ON(!list_empty(&req->queue));
1150 kfree(req);
1159 struct s3c2410_request *req = to_s3c2410_req(_req);
1180 || !_req->buf || !list_empty(&req->queue))) {
1186 !list_empty(&req->queue));
1219 req)) {
1221 req = NULL;
1229 req))) {
1231 req = NULL;
1241 && s3c2410_udc_write_fifo(ep, req)) {
1242 req = NULL;
1245 && s3c2410_udc_read_fifo(ep, req)) {
1246 req = NULL;
1251 if (likely(req))
1252 list_add_tail(&req->queue, &ep->queue);
1268 struct s3c2410_request *req = NULL;
1280 list_for_each_entry(req, &ep->queue, queue) {
1281 if (&req->req == _req) {
1282 list_del_init(&req->queue);
1291 "dequeued req %p from %s, len %d buf %p\n",
1292 req, _ep->name, _req->length, _req->buf);
1294 s3c2410_udc_done(ep, req, -ECONNRESET);