USBD_OPEN_PIPE(9)
okay bestie, this is USBD_OPEN_PIPE(9) from the Kernel Developer's Manual, and it's literally the glow-up guide for creating USB pipes. π
β¨
π NAME π
usbd_open_pipe, usbd_open_pipe_intr β create USB pipe
π§ SYNOPSIS π§
#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);
β¨ DESCRIPTION β¨
so usbd_open_pipe() and usbd_open_pipe_intr() create pipes. no cap. 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. it's giving main character connection energy π₯
π usbd_open_pipe() argument squad π
The usbd_open_pipe() function takes the following arguments:
ifaceβ the USB interface for which the pipe is to be created. π«Άaddressβ the address of the endpoint in that interface to which the pipe should be connected.flagsβ a bitmask of flags. Currently there is only one flag bit defined:USBD_EXCLUSIVE_USEβ do not allow other pipes to use this endpoint while this pipe exists. exclusive vibes only, bestie π
pipeβ a pointer to where the resultingstruct usbd_pipe *should be stored if the call is successful.
π«Ά usbd_open_pipe_intr() argument squad π«Ά
The usbd_open_pipe_intr() function takes the following arguments:
ifaceβ the USB interface for which the pipe is to be created.addressβ the endpoint in that interface to which the pipe should be connected.flagsβ a bitmask of flags. These flags are not interpreted in the same way as theflagspassed tousbd_open_pipe(). Instead,usbd_open_pipe_intr()implicitly turns on theUSBD_EXCLUSIVE_USEbit for the pipe, disallowing multiple interrupt pipes for the same endpoint. Theflagsargument in this case is instead passed directly tousbd_setup_xfer(9)as itsflagsargument, whose interpretation is documented in its man page.pipeβ a pointer to where the resultingstruct usbd_pipe *should be stored if the call is successful.privβ a pointer to a private cookie untouched by the USB stack for reuse in the callback specified by thecbargument. πͺbufferβ a pointer to the data buffer for use by the implicit transfer (see below).lenβ the length in bytes ofbuffer.cbβ a callback invoked every time the interrupt transfer completes.ivalβ the interval in milliseconds with which the interrupt pipe should be polled by the USB stack.
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. it's giving forever repeating transfer era ππ
π CONTEXT π
usbd_open_pipe() and usbd_open_pipe_intr() can be called during autoconf or from process context. so yes, both of those contexts are valid, bestie. π
π SEE ALSO π
xoxo, signed by Debian on March 29, 2022, page USBD_OPEN_PIPE(9) ππ
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2015 Sean Levy <attila@stalphonsos.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms