STRUCT USBIO_DEVICE(9)
π struct usbio_device(9) β a Kernel API Manual moment
okay so bestie, we're in the Kernel API Manual today and the star of the show is struct usbio_device π¦ β the usb device exposing IOs. she's the main character of /drivers/usb/misc/usbio.c and honestly? iconic.
β¨ NAME β¨
struct usbio_device β the usb device exposing IOs. that's her. that's the whole vibe. π
πΈ SYNOPSIS πΈ
no cap, here's the whole struct, every single field, copy-pasted exactly because we do not gatekeep:
struct usbio_device {
struct device *dev;
struct usb_device *udev;
struct usb_interface *intf;
unsigned long quirks;
struct mutex ctrl_mutex;
unsigned int ctrl_pipe;
u16 ctrlbuf_len;
void *ctrlbuf;
struct mutex bulk_mutex;
unsigned int tx_pipe;
u16 txbuf_len;
void *txbuf;
unsigned int rx_pipe;
u16 rxbuf_len;
u16 rxdat_len;
void *rxbuf;
struct urb *urb;
struct completion done;
struct list_head cli_list;
unsigned int nr_gpio_banks;
struct usbio_gpio_bank_desc gpios[USBIO_MAX_GPIOBANKS];
unsigned int nr_i2c_buses;
struct usbio_i2c_bus_desc i2cs[USBIO_MAX_I2CBUSES];
};
like, look at her. so many buffers. so many mutexes. it's giving organized chaos π
π Members π
breaking it down field by field, because you deserve to know every one of them π«Ά
devβ the device in the usb interfaceudevβ the detected usb deviceintfβ the usb interfacequirksβ quirks. yes that's the whole description. quirks. πctrl_mutexβ protectsctrl_bufctrl_pipeβ the control transfer pipectrlbuf_lenβ the size of the control transfer pipectrlbufβ the buffer used for control transfersbulk_mutexβ protectstx_buf,rx_bufand split bulk-transfers getting interruptedtx_pipeβ the bulk out pipetxbuf_lenβ the size of the bulk out pipetxbufβ the buffer used for bulk out transfersrx_pipeβ the bulk in piperxbuf_lenβ the size of the bulk in piperxdat_lenβ the data length at rx bufferrxbufβ the buffer used for bulk in transfersurbβ the urb to read bulk pipedoneβ completion object as request is donecli_listβ device's client listnr_gpio_banksβ Number of I2C bussesgpiosβ I2C bank descriptors
π so yeah β the source doc saysnr_gpio_banksis the "Number of I2C busses" andgpiosare "I2C bank descriptors". we're reporting it exactly as written, don't come for me, i'm just the messenger π
also ngl, the member list in the original justβ¦ stops aftergpiosπ sonr_i2c_busesandi2csare in the struct (see the synopsis up there β¬οΈ) with no writeup at all. they're mysterious. they're lowkey lurking. respect it. π
π₯ SEE ALSO π₯
- Kernel file
./drivers/usb/misc/usbio.cstruct usbio_client(9)
and that's the tea π go read usbio.c, go say hi to struct usbio_client(9), you've got this bestie π
this lil masterpiece lives in ./drivers/usb/misc, dated October 2026, and yes β we really did just do a whole struct usbio_device(9) deep dive together. slay. periodt. π§β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms