drivers/usb/host/xhci-ext-caps.c
Source file repositories/reference/linux-study-clean/drivers/usb/host/xhci-ext-caps.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/host/xhci-ext-caps.c- Extension
.c- Size
- 2601 bytes
- Lines
- 111
- Domain
- Driver Families
- Bucket
- drivers/usb
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/property.hlinux/pci.hxhci.h
Detected Declarations
function xhci_intel_unregister_pdevfunction xhci_create_intel_xhci_sw_pdevfunction xhci_ext_cap_initexport xhci_ext_cap_init
Annotated Snippet
if (ret) {
dev_err(dev, "failed to register device properties\n");
platform_device_put(pdev);
return ret;
}
}
pdev->dev.parent = dev;
ret = platform_device_add(pdev);
if (ret) {
dev_err(dev, "couldn't register intel_xhci_usb_sw pdev\n");
platform_device_put(pdev);
return ret;
}
ret = devm_add_action_or_reset(dev, xhci_intel_unregister_pdev, pdev);
if (ret) {
dev_err(dev, "couldn't add unregister action for intel_xhci_usb_sw pdev\n");
return ret;
}
return 0;
}
int xhci_ext_cap_init(struct xhci_hcd *xhci)
{
void __iomem *base = &xhci->cap_regs->hc_capbase;
u32 offset, val;
int ret;
offset = xhci_find_next_ext_cap(base, 0, 0);
while (offset) {
val = readl(base + offset);
switch (XHCI_EXT_CAPS_ID(val)) {
case XHCI_EXT_CAPS_VENDOR_INTEL:
if (xhci->quirks & XHCI_INTEL_USB_ROLE_SW) {
ret = xhci_create_intel_xhci_sw_pdev(xhci,
offset);
if (ret)
return ret;
}
break;
}
offset = xhci_find_next_ext_cap(base, offset, 0);
}
return 0;
}
EXPORT_SYMBOL_GPL(xhci_ext_cap_init);
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/property.h`, `linux/pci.h`, `xhci.h`.
- Detected declarations: `function xhci_intel_unregister_pdev`, `function xhci_create_intel_xhci_sw_pdev`, `function xhci_ext_cap_init`, `export xhci_ext_cap_init`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: integration 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.