drivers/pci/hotplug/shpchp_sysfs.c
Source file repositories/reference/linux-study-clean/drivers/pci/hotplug/shpchp_sysfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/hotplug/shpchp_sysfs.c- Extension
.c- Size
- 2499 bytes
- Lines
- 87
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: implementation source
- Status
- source implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/types.hlinux/pci.hshpchp.h
Detected Declarations
function Copyrightfunction shpchp_create_ctrl_filesfunction shpchp_remove_ctrl_files
Annotated Snippet
if (res && (res->flags & IORESOURCE_IO)) {
len += sysfs_emit_at(buf, len,
"start = %8.8llx, length = %8.8llx\n",
(unsigned long long)res->start,
(unsigned long long)resource_size(res));
}
}
len += sysfs_emit_at(buf, len, "Free resources: bus numbers\n");
for (busnr = bus->busn_res.start; busnr <= bus->busn_res.end; busnr++) {
if (!pci_find_bus(pci_domain_nr(bus), busnr))
break;
}
if (busnr < bus->busn_res.end)
len += sysfs_emit_at(buf, len,
"start = %8.8x, length = %8.8x\n",
busnr, (int)(bus->busn_res.end - busnr));
return len;
}
static DEVICE_ATTR(ctrl, S_IRUGO, show_ctrl, NULL);
int shpchp_create_ctrl_files(struct controller *ctrl)
{
return device_create_file(&ctrl->pci_dev->dev, &dev_attr_ctrl);
}
void shpchp_remove_ctrl_files(struct controller *ctrl)
{
device_remove_file(&ctrl->pci_dev->dev, &dev_attr_ctrl);
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/types.h`, `linux/pci.h`, `shpchp.h`.
- Detected declarations: `function Copyright`, `function shpchp_create_ctrl_files`, `function shpchp_remove_ctrl_files`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- 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.