include/linux/usb/usbio.h
Source file repositories/reference/linux-study-clean/include/linux/usb/usbio.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/usbio.h- Extension
.h- Size
- 4208 bytes
- Lines
- 178
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/auxiliary_bus.hlinux/byteorder/generic.hlinux/list.hlinux/types.h
Detected Declarations
struct usbio_packet_headerstruct usbio_ctrl_packetstruct usbio_bulk_packetstruct usbio_gpio_bank_descstruct usbio_gpio_initstruct usbio_gpio_rwstruct usbio_i2c_bus_descstruct usbio_i2c_uninitstruct usbio_i2c_initstruct usbio_i2c_rwenum usbio_gpio_cmdenum usbio_gpio_pincfgenum usbio_gpio_pinmodeenum usbio_i2c_cmd
Annotated Snippet
struct usbio_packet_header {
u8 type;
u8 cmd;
u8 flags;
} __packed;
/* USBIO Control Transfer Packet */
struct usbio_ctrl_packet {
struct usbio_packet_header header;
u8 len;
u8 data[] __counted_by(len);
} __packed;
/* USBIO Bulk Transfer Packet */
struct usbio_bulk_packet {
struct usbio_packet_header header;
__le16 len;
u8 data[] __counted_by(len);
} __packed;
/* USBIO GPIO commands */
enum usbio_gpio_cmd {
USBIO_GPIOCMD_DEINIT,
USBIO_GPIOCMD_INIT,
USBIO_GPIOCMD_READ,
USBIO_GPIOCMD_WRITE,
USBIO_GPIOCMD_END
};
/* USBIO GPIO config */
enum usbio_gpio_pincfg {
USBIO_GPIO_PINCFG_DEFAULT,
USBIO_GPIO_PINCFG_PULLUP,
USBIO_GPIO_PINCFG_PULLDOWN,
USBIO_GPIO_PINCFG_PUSHPULL
};
#define USBIO_GPIO_PINCFG_SHIFT 2
#define USBIO_GPIO_PINCFG_MASK (0x3 << USBIO_GPIO_PINCFG_SHIFT)
#define USBIO_GPIO_SET_PINCFG(pincfg) \
(((pincfg) << USBIO_GPIO_PINCFG_SHIFT) & USBIO_GPIO_PINCFG_MASK)
enum usbio_gpio_pinmode {
USBIO_GPIO_PINMOD_INVAL,
USBIO_GPIO_PINMOD_INPUT,
USBIO_GPIO_PINMOD_OUTPUT,
USBIO_GPIO_PINMOD_MAXVAL
};
#define USBIO_GPIO_PINMOD_MASK 0x3
#define USBIO_GPIO_SET_PINMOD(pin) (pin & USBIO_GPIO_PINMOD_MASK)
/*************************
* USBIO GPIO Controller *
*************************/
#define USBIO_MAX_GPIOBANKS 5
#define USBIO_GPIOSPERBANK 32
struct usbio_gpio_bank_desc {
u8 id;
u8 pins;
__le32 bmap;
} __packed;
struct usbio_gpio_init {
u8 bankid;
u8 config;
u8 pincount;
u8 pin;
} __packed;
struct usbio_gpio_rw {
u8 bankid;
u8 pincount;
u8 pin;
__le32 value;
} __packed;
/* USBIO I2C commands */
enum usbio_i2c_cmd {
USBIO_I2CCMD_UNINIT,
USBIO_I2CCMD_INIT,
USBIO_I2CCMD_READ,
USBIO_I2CCMD_WRITE,
USBIO_I2CCMD_END
};
/************************
* USBIO I2C Controller *
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/byteorder/generic.h`, `linux/list.h`, `linux/types.h`.
- Detected declarations: `struct usbio_packet_header`, `struct usbio_ctrl_packet`, `struct usbio_bulk_packet`, `struct usbio_gpio_bank_desc`, `struct usbio_gpio_init`, `struct usbio_gpio_rw`, `struct usbio_i2c_bus_desc`, `struct usbio_i2c_uninit`, `struct usbio_i2c_init`, `struct usbio_i2c_rw`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.