include/uapi/linux/usb/raw_gadget.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/usb/raw_gadget.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/usb/raw_gadget.h- Extension
.h- Size
- 8584 bytes
- Lines
- 260
- 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
asm/ioctl.hlinux/types.hlinux/usb/ch9.h
Detected Declarations
struct usb_raw_initstruct usb_raw_eventstruct usb_raw_ep_iostruct usb_raw_ep_capsstruct usb_raw_ep_limitsstruct usb_raw_ep_infostruct usb_raw_eps_infoenum usb_raw_event_typefunction usb_raw_io_flags_validfunction usb_raw_io_flags_zero
Annotated Snippet
struct usb_raw_init {
__u8 driver_name[UDC_NAME_LENGTH_MAX];
__u8 device_name[UDC_NAME_LENGTH_MAX];
__u8 speed;
};
/* The type of event fetched with the USB_RAW_IOCTL_EVENT_FETCH ioctl. */
enum usb_raw_event_type {
USB_RAW_EVENT_INVALID = 0,
/* This event is queued when the driver has bound to a UDC. */
USB_RAW_EVENT_CONNECT = 1,
/* This event is queued when a new control request arrived to ep0. */
USB_RAW_EVENT_CONTROL = 2,
/*
* These events are queued when the gadget driver is suspended,
* resumed, reset, or disconnected. Note that some UDCs (e.g. dwc2)
* report a disconnect event instead of a reset.
*/
USB_RAW_EVENT_SUSPEND = 3,
USB_RAW_EVENT_RESUME = 4,
USB_RAW_EVENT_RESET = 5,
USB_RAW_EVENT_DISCONNECT = 6,
/* The list might grow in the future. */
};
/*
* struct usb_raw_event - argument for USB_RAW_IOCTL_EVENT_FETCH ioctl.
* @type: The type of the fetched event.
* @length: Length of the data buffer. Updated by the driver and set to the
* actual length of the fetched event data.
* @data: A buffer to store the fetched event data.
*
* The fetched event data buffer contains struct usb_ctrlrequest for
* USB_RAW_EVENT_CONTROL and is empty for other events.
*/
struct usb_raw_event {
__u32 type;
__u32 length;
__u8 data[];
};
#define USB_RAW_IO_FLAGS_ZERO 0x0001
#define USB_RAW_IO_FLAGS_MASK 0x0001
static inline int usb_raw_io_flags_valid(__u16 flags)
{
return (flags & ~USB_RAW_IO_FLAGS_MASK) == 0;
}
static inline int usb_raw_io_flags_zero(__u16 flags)
{
return (flags & USB_RAW_IO_FLAGS_ZERO);
}
/*
* struct usb_raw_ep_io - argument for USB_RAW_IOCTL_EP0/EP_WRITE/READ ioctls.
* @ep: Endpoint handle as returned by USB_RAW_IOCTL_EP_ENABLE for
* USB_RAW_IOCTL_EP_WRITE/READ. Ignored for USB_RAW_IOCTL_EP0_WRITE/READ.
* @flags: When USB_RAW_IO_FLAGS_ZERO is specified, the zero flag is set on
* the submitted USB request, see include/linux/usb/gadget.h for details.
* @length: Length of data.
* @data: Data to send for USB_RAW_IOCTL_EP0/EP_WRITE. Buffer to store received
* data for USB_RAW_IOCTL_EP0/EP_READ.
*/
struct usb_raw_ep_io {
__u16 ep;
__u16 flags;
__u32 length;
__u8 data[];
};
/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */
#define USB_RAW_EPS_NUM_MAX 30
/* Maximum length of UDC endpoint name in struct usb_raw_ep_info. */
#define USB_RAW_EP_NAME_MAX 16
/* Used as addr in struct usb_raw_ep_info if endpoint accepts any address. */
#define USB_RAW_EP_ADDR_ANY 0xff
/*
* struct usb_raw_ep_caps - exposes endpoint capabilities from struct usb_ep
* (technically from its member struct usb_ep_caps).
*/
struct usb_raw_ep_caps {
__u32 type_control : 1;
Annotation
- Immediate include surface: `asm/ioctl.h`, `linux/types.h`, `linux/usb/ch9.h`.
- Detected declarations: `struct usb_raw_init`, `struct usb_raw_event`, `struct usb_raw_ep_io`, `struct usb_raw_ep_caps`, `struct usb_raw_ep_limits`, `struct usb_raw_ep_info`, `struct usb_raw_eps_info`, `enum usb_raw_event_type`, `function usb_raw_io_flags_valid`, `function usb_raw_io_flags_zero`.
- 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.