Lines Matching refs:req

253 		struct s3c2410_request *req, int status)  in s3c2410_udc_done()  argument
257 list_del_init(&req->queue); in s3c2410_udc_done()
259 if (likely(req->req.status == -EINPROGRESS)) in s3c2410_udc_done()
260 req->req.status = status; in s3c2410_udc_done()
262 status = req->req.status; in s3c2410_udc_done()
265 usb_gadget_giveback_request(&ep->ep, &req->req); in s3c2410_udc_done()
277 struct s3c2410_request *req; in s3c2410_udc_nuke() local
278 req = list_entry(ep->queue.next, struct s3c2410_request, in s3c2410_udc_nuke()
280 s3c2410_udc_done(ep, req, status); in s3c2410_udc_nuke()
297 struct s3c2410_request *req, in s3c2410_udc_write_packet() argument
300 unsigned len = min(req->req.length - req->req.actual, max); in s3c2410_udc_write_packet()
301 u8 *buf = req->req.buf + req->req.actual; in s3c2410_udc_write_packet()
306 req->req.actual, req->req.length, len, req->req.actual + len); in s3c2410_udc_write_packet()
308 req->req.actual += len; in s3c2410_udc_write_packet()
321 struct s3c2410_request *req) in s3c2410_udc_write_fifo() argument
350 count = s3c2410_udc_write_packet(fifo_reg, req, ep->ep.maxpacket); in s3c2410_udc_write_fifo()
355 else if (req->req.length != req->req.actual || req->req.zero) in s3c2410_udc_write_fifo()
364 idx, count, req->req.actual, req->req.length, in s3c2410_udc_write_fifo()
365 is_last, req->req.zero); in s3c2410_udc_write_fifo()
385 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_write_fifo()
406 struct s3c2410_request *req, unsigned avail) in s3c2410_udc_read_packet() argument
410 len = min(req->req.length - req->req.actual, avail); in s3c2410_udc_read_packet()
411 req->req.actual += len; in s3c2410_udc_read_packet()
421 struct s3c2410_request *req) in s3c2410_udc_read_fifo() argument
454 if (!req->req.length) in s3c2410_udc_read_fifo()
457 buf = req->req.buf + req->req.actual; in s3c2410_udc_read_fifo()
458 bufferspace = req->req.length - req->req.actual; in s3c2410_udc_read_fifo()
474 fifo_count = s3c2410_udc_read_packet(fifo_reg, buf, req, avail); in s3c2410_udc_read_fifo()
483 req->req.status = -EOVERFLOW; in s3c2410_udc_read_fifo()
485 is_last = (req->req.length <= req->req.actual) ? 1 : 0; in s3c2410_udc_read_fifo()
508 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_read_fifo()
743 struct s3c2410_request *req; in s3c2410_udc_handle_ep0() local
747 req = NULL; in s3c2410_udc_handle_ep0()
749 req = list_entry(ep->queue.next, struct s3c2410_request, queue); in s3c2410_udc_handle_ep0()
784 if (!(ep0csr & S3C2410_UDC_EP0_CSR_IPKRDY) && req) in s3c2410_udc_handle_ep0()
785 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep0()
790 if ((ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY) && req) in s3c2410_udc_handle_ep0()
791 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep0()
812 struct s3c2410_request *req; in s3c2410_udc_handle_ep() local
818 req = list_entry(ep->queue.next, in s3c2410_udc_handle_ep()
821 req = NULL; in s3c2410_udc_handle_ep()
829 idx, ep_csr1, req ? 1 : 0); in s3c2410_udc_handle_ep()
839 if (!(ep_csr1 & S3C2410_UDC_ICSR1_PKTRDY) && req) in s3c2410_udc_handle_ep()
840 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep()
853 if ((ep_csr1 & S3C2410_UDC_OCSR1_PKTRDY) && req) in s3c2410_udc_handle_ep()
854 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep()
1021 static inline struct s3c2410_request *to_s3c2410_req(struct usb_request *req) in to_s3c2410_req() argument
1023 return container_of(req, struct s3c2410_request, req); in to_s3c2410_req()
1147 struct s3c2410_request *req; in s3c2410_udc_alloc_request() local
1154 req = kzalloc(sizeof(struct s3c2410_request), mem_flags); in s3c2410_udc_alloc_request()
1155 if (!req) in s3c2410_udc_alloc_request()
1158 INIT_LIST_HEAD(&req->queue); in s3c2410_udc_alloc_request()
1159 return &req->req; in s3c2410_udc_alloc_request()
1169 struct s3c2410_request *req = to_s3c2410_req(_req); in s3c2410_udc_free_request() local
1176 WARN_ON(!list_empty(&req->queue)); in s3c2410_udc_free_request()
1177 kfree(req); in s3c2410_udc_free_request()
1186 struct s3c2410_request *req = to_s3c2410_req(_req); in s3c2410_udc_queue() local
1207 || !_req->buf || !list_empty(&req->queue))) { in s3c2410_udc_queue()
1213 !list_empty(&req->queue)); in s3c2410_udc_queue()
1246 req)) { in s3c2410_udc_queue()
1248 req = NULL; in s3c2410_udc_queue()
1256 req))) { in s3c2410_udc_queue()
1258 req = NULL; in s3c2410_udc_queue()
1268 && s3c2410_udc_write_fifo(ep, req)) { in s3c2410_udc_queue()
1269 req = NULL; in s3c2410_udc_queue()
1272 && s3c2410_udc_read_fifo(ep, req)) { in s3c2410_udc_queue()
1273 req = NULL; in s3c2410_udc_queue()
1278 if (likely(req)) in s3c2410_udc_queue()
1279 list_add_tail(&req->queue, &ep->queue); in s3c2410_udc_queue()
1296 struct s3c2410_request *req = NULL; in s3c2410_udc_dequeue() local
1310 list_for_each_entry(req, &ep->queue, queue) { in s3c2410_udc_dequeue()
1311 if (&req->req == _req) { in s3c2410_udc_dequeue()
1312 list_del_init(&req->queue); in s3c2410_udc_dequeue()
1322 req, _ep->name, _req->length, _req->buf); in s3c2410_udc_dequeue()
1324 s3c2410_udc_done(ep, req, -ECONNRESET); in s3c2410_udc_dequeue()