| USBD_TRANSFER(9) | Kernel Developer's Manual | USBD_TRANSFER(9) |
usbd_setup_xfer,
usbd_transfer — submit USB
data transfers
#include
<dev/usb/usb.h>
#include <dev/usb/usbdi.h>
void
usbd_setup_xfer(struct
usbd_xfer *xfer, struct
usbd_pipe *pipe, void
*priv, void
*buffer, uint32_t
length, uint16_t
flags, uint32_t
timeout, usbd_callback
callback);
usbd_status
usbd_transfer(struct
usbd_xfer *xfer);
These functions provide a controller independent mechanism to perform USB data transfers. They make use of a pipe created by usbd_open_pipe(9) or usbd_open_pipe_intr(9).
The function
usbd_setup_xfer()
is used to initialize the structure pointed to by
xfer, describing an individual transfer to submit. It
takes the following arguments:
USBD_NO_COPYUSBD_SYNCHRONOUSusbd_transfer() to sleep until the I/O
transfer is complete or the timeout
expires.USBD_SHORT_XFER_OKUSBD_FORCE_SHORT_XFERUSBD_CATCHUSBD_SYNCHRONOUS
flag to pass the PCATCH flag to
tsleep(9) in order to check for signals before and
after sleeping.The function
usbd_transfer()
is used to submit the USB transfer described by xfer
to the corresponding usb(4) host controller to perform I/O
with devices.
usbd_setup_xfer() can be called during
autoconf, from process context, or from interrupt context.
usbd_transfer() can be called during
autoconf, from process context, or from interrupt context if
USBD_SYNCHRONOUS has not been passed via
flags.
ehci(4), ohci(4), uhci(4), usb(4), tsleep(9), usbd_open_pipe(9), usbd_open_pipe_intr(9)
| May 4, 2015 | Debian |