Lines Matching refs:req
255 struct s3c2410_request *req, int status) in s3c2410_udc_done() argument
259 list_del_init(&req->queue); in s3c2410_udc_done()
261 if (likely(req->req.status == -EINPROGRESS)) in s3c2410_udc_done()
262 req->req.status = status; in s3c2410_udc_done()
264 status = req->req.status; in s3c2410_udc_done()
267 usb_gadget_giveback_request(&ep->ep, &req->req); in s3c2410_udc_done()
279 struct s3c2410_request *req; in s3c2410_udc_nuke() local
280 req = list_entry(ep->queue.next, struct s3c2410_request, in s3c2410_udc_nuke()
282 s3c2410_udc_done(ep, req, status); in s3c2410_udc_nuke()
299 struct s3c2410_request *req, in s3c2410_udc_write_packet() argument
302 unsigned len = min(req->req.length - req->req.actual, max); in s3c2410_udc_write_packet()
303 u8 *buf = req->req.buf + req->req.actual; in s3c2410_udc_write_packet()
308 req->req.actual, req->req.length, len, req->req.actual + len); in s3c2410_udc_write_packet()
310 req->req.actual += len; in s3c2410_udc_write_packet()
323 struct s3c2410_request *req) in s3c2410_udc_write_fifo() argument
352 count = s3c2410_udc_write_packet(fifo_reg, req, ep->ep.maxpacket); in s3c2410_udc_write_fifo()
357 else if (req->req.length != req->req.actual || req->req.zero) in s3c2410_udc_write_fifo()
366 idx, count, req->req.actual, req->req.length, in s3c2410_udc_write_fifo()
367 is_last, req->req.zero); in s3c2410_udc_write_fifo()
387 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_write_fifo()
408 struct s3c2410_request *req, unsigned avail) in s3c2410_udc_read_packet() argument
412 len = min(req->req.length - req->req.actual, avail); in s3c2410_udc_read_packet()
413 req->req.actual += len; in s3c2410_udc_read_packet()
423 struct s3c2410_request *req) in s3c2410_udc_read_fifo() argument
456 if (!req->req.length) in s3c2410_udc_read_fifo()
459 buf = req->req.buf + req->req.actual; in s3c2410_udc_read_fifo()
460 bufferspace = req->req.length - req->req.actual; in s3c2410_udc_read_fifo()
476 fifo_count = s3c2410_udc_read_packet(fifo_reg, buf, req, avail); in s3c2410_udc_read_fifo()
485 req->req.status = -EOVERFLOW; in s3c2410_udc_read_fifo()
487 is_last = (req->req.length <= req->req.actual) ? 1 : 0; in s3c2410_udc_read_fifo()
510 s3c2410_udc_done(ep, req, 0); in s3c2410_udc_read_fifo()
745 struct s3c2410_request *req; in s3c2410_udc_handle_ep0() local
749 req = NULL; in s3c2410_udc_handle_ep0()
751 req = list_entry(ep->queue.next, struct s3c2410_request, queue); in s3c2410_udc_handle_ep0()
786 if (!(ep0csr & S3C2410_UDC_EP0_CSR_IPKRDY) && req) in s3c2410_udc_handle_ep0()
787 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep0()
792 if ((ep0csr & S3C2410_UDC_EP0_CSR_OPKRDY) && req) in s3c2410_udc_handle_ep0()
793 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep0()
814 struct s3c2410_request *req; in s3c2410_udc_handle_ep() local
820 req = list_entry(ep->queue.next, in s3c2410_udc_handle_ep()
823 req = NULL; in s3c2410_udc_handle_ep()
831 idx, ep_csr1, req ? 1 : 0); in s3c2410_udc_handle_ep()
841 if (!(ep_csr1 & S3C2410_UDC_ICSR1_PKTRDY) && req) in s3c2410_udc_handle_ep()
842 s3c2410_udc_write_fifo(ep, req); in s3c2410_udc_handle_ep()
855 if ((ep_csr1 & S3C2410_UDC_OCSR1_PKTRDY) && req) in s3c2410_udc_handle_ep()
856 s3c2410_udc_read_fifo(ep, req); in s3c2410_udc_handle_ep()
1023 static inline struct s3c2410_request *to_s3c2410_req(struct usb_request *req) in to_s3c2410_req() argument
1025 return container_of(req, struct s3c2410_request, req); in to_s3c2410_req()
1149 struct s3c2410_request *req; in s3c2410_udc_alloc_request() local
1156 req = kzalloc(sizeof(struct s3c2410_request), mem_flags); in s3c2410_udc_alloc_request()
1157 if (!req) in s3c2410_udc_alloc_request()
1160 INIT_LIST_HEAD(&req->queue); in s3c2410_udc_alloc_request()
1161 return &req->req; in s3c2410_udc_alloc_request()
1171 struct s3c2410_request *req = to_s3c2410_req(_req); in s3c2410_udc_free_request() local
1178 WARN_ON(!list_empty(&req->queue)); in s3c2410_udc_free_request()
1179 kfree(req); in s3c2410_udc_free_request()
1188 struct s3c2410_request *req = to_s3c2410_req(_req); in s3c2410_udc_queue() local
1209 || !_req->buf || !list_empty(&req->queue))) { in s3c2410_udc_queue()
1215 !list_empty(&req->queue)); in s3c2410_udc_queue()
1248 req)) { in s3c2410_udc_queue()
1250 req = NULL; in s3c2410_udc_queue()
1258 req))) { in s3c2410_udc_queue()
1260 req = NULL; in s3c2410_udc_queue()
1270 && s3c2410_udc_write_fifo(ep, req)) { in s3c2410_udc_queue()
1271 req = NULL; in s3c2410_udc_queue()
1274 && s3c2410_udc_read_fifo(ep, req)) { in s3c2410_udc_queue()
1275 req = NULL; in s3c2410_udc_queue()
1280 if (likely(req)) in s3c2410_udc_queue()
1281 list_add_tail(&req->queue, &ep->queue); in s3c2410_udc_queue()
1298 struct s3c2410_request *req = NULL; in s3c2410_udc_dequeue() local
1312 list_for_each_entry(req, &ep->queue, queue) { in s3c2410_udc_dequeue()
1313 if (&req->req == _req) { in s3c2410_udc_dequeue()
1314 list_del_init(&req->queue); in s3c2410_udc_dequeue()
1324 req, _ep->name, _req->length, _req->buf); in s3c2410_udc_dequeue()
1326 s3c2410_udc_done(ep, req, -ECONNRESET); in s3c2410_udc_dequeue()