| USBD_OPEN_PIPE(9) | Kernel Developer's Manual | USBD_OPEN_PIPE(9) |
usbd_open_pipe,
usbd_open_pipe_intr — create
USB pipe
#include
<dev/usb/usb.h>
#include <dev/usb/usbdi.h>
usbd_status
usbd_open_pipe(struct
usbd_interface *iface,
uint8_t address,
uint8_t flags,
struct usbd_pipe
**pipe);
usbd_status
usbd_open_pipe_intr(struct
usbd_interface *iface,
uint8_t address,
uint8_t flags,
struct usbd_pipe **pipe,
void *priv,
void *buffer,
uint32_t len,
usbd_callback cb,
int ival);
The
usbd_open_pipe()
and usbd_open_pipe_intr() functions create pipes. A
pipe is a logical connection between the host and an endpoint on a USB
device. USB drivers use pipes to manage transfers to or from a USB
endpoint.
The
usbd_open_pipe()
function takes the following arguments:
USBD_EXCLUSIVE_USEThe
usbd_open_pipe_intr()
function takes the following arguments:
usbd_open_pipe(). Instead,
usbd_open_pipe_intr() implicitly turns on the
USBD_EXCLUSIVE_USE bit for the pipe, disallowing
multiple interrupt pipes for the same endpoint. The
flags argument in this case is instead passed
directly to usbd_setup_xfer(9) as its
flags argument, whose interpretation is documented
in its man page.Pipes created by
usbd_open_pipe_intr()
implicitly have a repeating transfer queued on them which is run every
ival milliseconds. This implicit transfer is not
automatically removed from the list of transfers maintained by the pipe,
unlike normal transfers, and will continue to be processed every
ival milliseconds.
usbd_open_pipe() and
usbd_open_pipe_intr() can be called during autoconf
or from process context.
| March 29, 2022 | Debian |