include/linux/usb/hcd.h
Source file repositories/reference/linux-study-clean/include/linux/usb/hcd.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/hcd.h- Extension
.h- Size
- 27891 bytes
- Lines
- 766
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/rwsem.hlinux/interrupt.hlinux/idr.hlinux/usb/ch11.h
Detected Declarations
struct giveback_urb_bhstruct usb_hcdstruct hc_driverstruct platform_devicestruct pci_devstruct pci_device_idstruct usb_devicestruct usb_ttstruct usb_tt_clearstruct usb_mon_operationsenum usb_dev_authorize_policyfunction hcd_giveback_urb_in_bhfunction hcd_periodic_completion_in_progressfunction hcd_uses_dmafunction ehset_single_step_set_featurefunction usb_hcd_amd_resume_bugfunction usb_hcd_amd_resume_bugfunction usb_wakeup_enabled_descendantsfunction usb_hcd_resume_root_hubfunction usbmon_urb_submitfunction usbmon_urb_submit_errorfunction usbmon_urb_completefunction usbmon_urb_submit
Annotated Snippet
struct giveback_urb_bh {
bool running;
bool high_prio;
spinlock_t lock;
struct list_head head;
struct work_struct bh;
struct usb_host_endpoint *completing_ep;
};
enum usb_dev_authorize_policy {
USB_DEVICE_AUTHORIZE_NONE = 0,
USB_DEVICE_AUTHORIZE_ALL = 1,
USB_DEVICE_AUTHORIZE_INTERNAL = 2,
};
struct usb_hcd {
/*
* housekeeping
*/
struct usb_bus self; /* hcd is-a bus */
struct kref kref; /* reference counter */
const char *product_desc; /* product/vendor string */
int speed; /* Speed for this roothub.
* May be different from
* hcd->driver->flags & HCD_MASK
*/
char irq_descr[24]; /* driver + bus # */
struct timer_list rh_timer; /* drives root-hub polling */
struct urb *status_urb; /* the current status urb */
#ifdef CONFIG_PM
struct work_struct wakeup_work; /* for remote wakeup */
#endif
struct work_struct died_work; /* for when the device dies */
/*
* hardware info/state
*/
const struct hc_driver *driver; /* hw-specific hooks */
/*
* OTG and some Host controllers need software interaction with phys;
* other external phys should be software-transparent
*/
struct usb_phy *usb_phy;
struct usb_phy_roothub *phy_roothub;
/* Flags that need to be manipulated atomically because they can
* change while the host controller is running. Always use
* set_bit() or clear_bit() to change their values.
*/
unsigned long flags;
#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */
#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
#define HCD_FLAG_DEAD 6 /* controller has died? */
#define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */
#define HCD_FLAG_DEFER_RH_REGISTER 8 /* Defer roothub registration */
/* The flags can be tested using these macros; they are likely to
* be slightly faster than test_bit().
*/
#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
#define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER))
/*
* Specifies if interfaces are authorized by default
* or they require explicit user space authorization; this bit is
* settable through /sys/class/usb_host/X/interface_authorized_default
*/
#define HCD_INTF_AUTHORIZED(hcd) \
((hcd)->flags & (1U << HCD_FLAG_INTF_AUTHORIZED))
/*
* Specifies if devices are authorized by default
* or they require explicit user space authorization; this bit is
* settable through /sys/class/usb_host/X/authorized_default
*/
enum usb_dev_authorize_policy dev_policy;
/* Flags that get set only during HCD registration or removal. */
Annotation
- Immediate include surface: `linux/rwsem.h`, `linux/interrupt.h`, `linux/idr.h`, `linux/usb/ch11.h`.
- Detected declarations: `struct giveback_urb_bh`, `struct usb_hcd`, `struct hc_driver`, `struct platform_device`, `struct pci_dev`, `struct pci_device_id`, `struct usb_device`, `struct usb_tt`, `struct usb_tt_clear`, `struct usb_mon_operations`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.