Lines Matching refs:req
519 struct usb_request *req; in alloc_ep_req() local
521 req = usb_ep_alloc_request(ep, 0); in alloc_ep_req()
522 if (!req) in alloc_ep_req()
523 return req; in alloc_ep_req()
525 req->length = length; in alloc_ep_req()
526 req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, length); in alloc_ep_req()
527 if (!req->buf) { in alloc_ep_req()
528 usb_ep_free_request(ep, req); in alloc_ep_req()
529 req = NULL; in alloc_ep_req()
532 return req; in alloc_ep_req()
595 static void thor_rx_tx_complete(struct usb_ep *ep, struct usb_request *req) in thor_rx_tx_complete() argument
598 int status = req->status; in thor_rx_tx_complete()
600 debug("%s: ep_ptr:%p, req_ptr:%p\n", __func__, ep, req); in thor_rx_tx_complete()
621 status, req->actual, req->length); in thor_rx_tx_complete()
624 static void thor_setup_complete(struct usb_ep *ep, struct usb_request *req) in thor_setup_complete() argument
626 if (req->status || req->actual != req->length) in thor_setup_complete()
628 req->status, req->actual, req->length); in thor_setup_complete()
635 struct usb_request *req = dev->req; in thor_func_setup() local
660 req->length = value; in thor_func_setup()
661 req->zero = value < len; in thor_func_setup()
662 value = usb_ep_queue(gadget->ep0, req, 0); in thor_func_setup()
665 req->status = 0; in thor_func_setup()
740 static void free_ep_req(struct usb_ep *ep, struct usb_request *req) in free_ep_req() argument
742 if (req->buf) in free_ep_req()
743 free(req->buf); in free_ep_req()
744 usb_ep_free_request(ep, req); in free_ep_req()
770 dev->req = usb_ep_alloc_request(gadget->ep0, 0); in thor_func_bind()
771 if (!dev->req) { in thor_func_bind()
775 dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE, in thor_func_bind()
777 if (!dev->req->buf) { in thor_func_bind()
782 dev->req->complete = thor_setup_complete; in thor_func_bind()
855 if (dev->req) in thor_func_bind()
856 free_ep_req(gadget->ep0, dev->req); in thor_func_bind()
866 free_ep_req(dev->gadget->ep0, dev->req); in thor_unbind()
904 struct usb_request *req; in thor_eps_setup() local
917 req = alloc_ep_req(ep, THOR_PACKET_SIZE); in thor_eps_setup()
918 if (!req) { in thor_eps_setup()
923 memset(req->buf, 0, req->length); in thor_eps_setup()
924 req->complete = thor_rx_tx_complete; in thor_eps_setup()
925 dev->in_req = req; in thor_eps_setup()
935 req = usb_ep_alloc_request(ep, 0); in thor_eps_setup()
936 if (!req) { in thor_eps_setup()
941 req->complete = thor_rx_tx_complete; in thor_eps_setup()
942 dev->out_req = req; in thor_eps_setup()