include/uapi/linux/usb/gadgetfs.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/usb/gadgetfs.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/usb/gadgetfs.h- Extension
.h- Size
- 2826 bytes
- Lines
- 90
- 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/types.hlinux/ioctl.hlinux/usb/ch9.h
Detected Declarations
struct usb_gadgetfs_eventenum usb_gadgetfs_event_type
Annotated Snippet
struct usb_gadgetfs_event {
union {
/* NOP, DISCONNECT, SUSPEND: nothing
* ... some hardware can't report disconnection
*/
/* CONNECT: just the speed */
enum usb_device_speed speed;
/* SETUP: packet; DATA phase i/o precedes next event
*(setup.bmRequestType & USB_DIR_IN) flags direction
* ... includes SET_CONFIGURATION, SET_INTERFACE
*/
struct usb_ctrlrequest setup;
} u;
enum usb_gadgetfs_event_type type;
};
/* The 'g' code is also used by printer and hid gadget ioctl requests.
* Don't add any colliding codes to either driver, and keep
* them in unique ranges (size 0x20 for now).
*/
/* endpoint ioctls */
/* IN transfers may be reported to the gadget driver as complete
* when the fifo is loaded, before the host reads the data;
* OUT transfers may be reported to the host's "client" driver as
* complete when they're sitting in the FIFO unread.
* THIS returns how many bytes are "unclaimed" in the endpoint fifo
* (needed for precise fault handling, when the hardware allows it)
*/
#define GADGETFS_FIFO_STATUS _IO('g', 1)
/* discards any unclaimed data in the fifo. */
#define GADGETFS_FIFO_FLUSH _IO('g', 2)
/* resets endpoint halt+toggle; used to implement set_interface.
* some hardware (like pxa2xx) can't support this.
*/
#define GADGETFS_CLEAR_HALT _IO('g', 3)
#endif /* __LINUX_USB_GADGETFS_H */
Annotation
- Immediate include surface: `linux/types.h`, `linux/ioctl.h`, `linux/usb/ch9.h`.
- Detected declarations: `struct usb_gadgetfs_event`, `enum usb_gadgetfs_event_type`.
- 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.