Lines Matching refs:req
710 struct usb_request *req = calloc(1, sizeof(struct usb_request)); in usb_request_new() local
711 if (!req) { in usb_request_new()
716 req->dev = dev; in usb_request_new()
717 req->max_packet_size = __le16_to_cpu(ep_desc->wMaxPacketSize); in usb_request_new()
718 req->private_data = urb; in usb_request_new()
719 req->endpoint = urb->endpoint; in usb_request_new()
720 urb->usercontext = req; in usb_request_new()
722 return req; in usb_request_new()
725 void usb_request_free(struct usb_request *req) in usb_request_free() argument
727 free(req->private_data); in usb_request_free()
728 free(req); in usb_request_free()
731 int usb_request_queue(struct usb_request *req) in usb_request_queue() argument
733 struct usbdevfs_urb *urb = (struct usbdevfs_urb*)req->private_data; in usb_request_queue()
737 urb->buffer = req->buffer; in usb_request_queue()
738 urb->buffer_length = req->buffer_length; in usb_request_queue()
741 res = ioctl(req->dev->fd, USBDEVFS_SUBMITURB, urb); in usb_request_queue()
774 struct usb_request *req = (struct usb_request*)urb->usercontext; in usb_request_wait() local
775 req->actual_length = urb->actual_length; in usb_request_wait()
777 return req; in usb_request_wait()
781 int usb_request_cancel(struct usb_request *req) in usb_request_cancel() argument
783 struct usbdevfs_urb *urb = ((struct usbdevfs_urb*)req->private_data); in usb_request_cancel()
784 return ioctl(req->dev->fd, USBDEVFS_DISCARDURB, urb); in usb_request_cancel()