/** * @brief submit bulk urb * @param host struct uhci_host * @param device struct usb_device * @param endpoint u8 * @param data void * * @param size u16 * @param callback int * * @param arg void * * @param ioc int */ struct usb_request_block * uhci_submit_bulk(struct usb_host *usbhc, struct usb_device *device, struct usb_endpoint_descriptor *epdesc, void *data, u16 size, int (*callback)(struct usb_host *, struct usb_request_block *, void *), void *arg, int ioc) { struct uhci_host *host = (struct uhci_host *)usbhc->private; if (USB_EP_TRANSTYPE(epdesc) != USB_ENDPOINT_TYPE_BULK) { dprintft(2, "%04x: %s: wrong endpoint(%02x).\n", host->iobase, __FUNCTION__, USB_EP_TRANSTYPE(epdesc)); return (struct usb_request_block *)NULL; } return uhci_submit_async(host, device, epdesc, data, size, callback, arg, ioc); }
/** * @brief submit bulk urb * @param host struct uhci_host * @param device struct usb_device * @param endpoint u8 * @param data void * * @param size u16 * @param callback int * * @param arg void * * @param ioc int */ struct usb_request_block * uhci_submit_bulk(struct uhci_host *host, struct usb_device *device, u8 endpoint, void *data, u16 size, int (*callback)(struct usb_host *, struct usb_request_block *, void *), void *arg, int ioc) { struct usb_endpoint_descriptor *epdesc; epdesc = usb_epdesc(device, endpoint); if (!epdesc || (USB_EP_TRANSTYPE(epdesc) != USB_ENDPOINT_TYPE_BULK)) { if (!epdesc) dprintft(2, "%04x: %s: no endpoint(%02x) found.\n", host->iobase, __FUNCTION__, endpoint); else dprintft(2, "%04x: %s: wrong endpoint(%02x).\n", host->iobase, __FUNCTION__, USB_EP_TRANSTYPE(epdesc)); return (struct usb_request_block *)NULL; } return uhci_submit_async(host, device, epdesc, data, size, callback, arg, ioc); }