drivers/pci/hotplug/cpci_hotplug_pci.c
Source file repositories/reference/linux-study-clean/drivers/pci/hotplug/cpci_hotplug_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/hotplug/cpci_hotplug_pci.c- Extension
.c- Size
- 6405 bytes
- Lines
- 313
- 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/pci.hlinux/pci_hotplug.hlinux/proc_fs.h../pci.hcpci_hotplug.h
Detected Declarations
function cpci_get_attention_statusfunction cpci_set_attention_statusfunction cpci_get_hs_csrfunction cpci_check_and_clear_insfunction cpci_check_extfunction cpci_clear_extfunction cpci_led_onfunction cpci_led_offfunction cpci_configure_slotfunction for_each_pci_bridgefunction cpci_unconfigure_slotfunction list_for_each_entry_safe
Annotated Snippet
if (slot->dev == NULL) {
err("Could not find PCI device for slot %02x", slot->number);
ret = -ENODEV;
goto out;
}
}
parent = slot->dev->bus;
for_each_pci_bridge(dev, parent) {
if (PCI_SLOT(dev->devfn) == PCI_SLOT(slot->devfn))
pci_hp_add_bridge(dev);
}
pci_assign_unassigned_bridge_resources(parent->self);
pci_bus_add_devices(parent);
out:
pci_unlock_rescan_remove();
dbg("%s - exit", __func__);
return ret;
}
int cpci_unconfigure_slot(struct slot *slot)
{
struct pci_dev *dev, *temp;
dbg("%s - enter", __func__);
if (!slot->dev) {
err("No device for slot %02x\n", slot->number);
return -ENODEV;
}
pci_lock_rescan_remove();
list_for_each_entry_safe(dev, temp, &slot->bus->devices, bus_list) {
if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
continue;
pci_dev_get(dev);
pci_stop_and_remove_bus_device(dev);
pci_dev_put(dev);
}
pci_dev_put(slot->dev);
slot->dev = NULL;
pci_unlock_rescan_remove();
dbg("%s - exit", __func__);
return 0;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/pci.h`, `linux/pci_hotplug.h`, `linux/proc_fs.h`, `../pci.h`, `cpci_hotplug.h`.
- Detected declarations: `function cpci_get_attention_status`, `function cpci_set_attention_status`, `function cpci_get_hs_csr`, `function cpci_check_and_clear_ins`, `function cpci_check_ext`, `function cpci_clear_ext`, `function cpci_led_on`, `function cpci_led_off`, `function cpci_configure_slot`, `function for_each_pci_bridge`.
- 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.