drivers/usb/core/usb.h
Source file repositories/reference/linux-study-clean/drivers/usb/core/usb.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/core/usb.h- Extension
.h- Size
- 7561 bytes
- Lines
- 218
- Domain
- Driver Families
- Bucket
- drivers/usb
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pm.hlinux/acpi.h
Detected Declarations
struct usb_hub_descriptorstruct usb_dev_statefunction usb_get_max_powerfunction usb_port_suspendfunction usb_port_resumefunction usb_autoresume_devicefunction usb_enable_usb2_hardware_lpmfunction usb_disable_usb2_hardware_lpmfunction is_usb_devicefunction is_usb_interfacefunction is_usb_endpointfunction is_usb_portfunction is_root_hubfunction usb_acpi_registerfunction usb_acpi_unregister
Annotated Snippet
extern const struct bus_type usb_bus_type;
extern struct mutex usb_port_peer_mutex;
extern const struct device_type usb_device_type;
extern const struct device_type usb_if_device_type;
extern const struct device_type usb_ep_device_type;
extern const struct device_type usb_port_device_type;
extern struct usb_device_driver usb_generic_driver;
static inline int is_usb_device(const struct device *dev)
{
return dev->type == &usb_device_type;
}
static inline int is_usb_interface(const struct device *dev)
{
return dev->type == &usb_if_device_type;
}
static inline int is_usb_endpoint(const struct device *dev)
{
return dev->type == &usb_ep_device_type;
}
static inline int is_usb_port(const struct device *dev)
{
return dev->type == &usb_port_device_type;
}
static inline int is_root_hub(struct usb_device *udev)
{
return (udev->parent == NULL);
}
extern bool is_usb_device_driver(const struct device_driver *drv);
/* for labeling diagnostics */
extern const char *usbcore_name;
/* sysfs stuff */
extern const struct attribute_group *usb_device_groups[];
extern const struct attribute_group *usb_interface_groups[];
/* usbfs stuff */
extern struct usb_driver usbfs_driver;
extern const struct file_operations usbfs_devices_fops;
extern const struct file_operations usbdev_file_operations;
extern int usb_devio_init(void);
extern void usb_devio_cleanup(void);
/*
* Firmware specific cookie identifying a port's location. '0' == no location
* data available
*/
typedef u32 usb_port_location_t;
/* internal notify stuff */
extern void usb_notify_add_device(struct usb_device *udev);
extern void usb_notify_remove_device(struct usb_device *udev);
extern void usb_notify_add_bus(struct usb_bus *ubus);
extern void usb_notify_remove_bus(struct usb_bus *ubus);
extern void usb_hub_adjust_deviceremovable(struct usb_device *hdev,
struct usb_hub_descriptor *desc);
#ifdef CONFIG_ACPI
extern int usb_acpi_register(void);
extern void usb_acpi_unregister(void);
extern acpi_handle usb_get_hub_port_acpi_handle(struct usb_device *hdev,
int port1);
#else
static inline int usb_acpi_register(void) { return 0; };
static inline void usb_acpi_unregister(void) { };
#endif
Annotation
- Immediate include surface: `linux/pm.h`, `linux/acpi.h`.
- Detected declarations: `struct usb_hub_descriptor`, `struct usb_dev_state`, `function usb_get_max_power`, `function usb_port_suspend`, `function usb_port_resume`, `function usb_autoresume_device`, `function usb_enable_usb2_hardware_lpm`, `function usb_disable_usb2_hardware_lpm`, `function is_usb_device`, `function is_usb_interface`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: pattern 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.