drivers/pci/pci.h
Source file repositories/reference/linux-study-clean/drivers/pci/pci.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/pci.h- Extension
.h- Size
- 47246 bytes
- Lines
- 1452
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/align.hlinux/bitfield.hlinux/pci.htrace/events/pci.hlinux/aer.h
Detected Declarations
struct pcie_tlp_logstruct pci_cap_saved_datastruct pci_cap_saved_statestruct pci_slot_attributestruct pci_sriovstruct aer_err_infostruct rcec_eastruct pci_dev_reset_methodsstruct pci_reset_fn_methodstruct device_nodestruct pci_eq_presetsstruct of_changesetenum pci_mmap_apienum pci_bar_typeenum pcie_link_change_reasonenum equalization_preset_typefunction pci_bus_rrs_vendor_idfunction pci_wakeup_eventfunction pci_bar_index_is_validfunction pci_has_subordinatefunction pci_power_manageablefunction pcie_downstream_portfunction pci_proc_attach_devicefunction pci_proc_detach_devicefunction pci_proc_detach_busfunction pci_create_legacy_filesfunction pci_no_msifunction pci_no_d1d2function pci_create_sysfs_dev_filesfunction pci_remove_sysfs_dev_filesfunction pci_is_cardbus_bridgefunction pci_cardbus_resource_alignmentfunction pci_bus_size_cardbus_bridgefunction pci_cardbus_scan_bridge_extendfunction pci_setup_cardbusfunction pci_match_one_devicefunction pci_resource_is_bridge_winfunction pci_resource_numfunction pcie_dev_speed_mbpsfunction __pcie_update_link_speedfunction pci_doe_initfunction pci_npem_createfunction pci_doe_sysfs_initfunction pci_ide_initfunction pci_tsm_initfunction pci_dev_set_disconnectedfunction pci_dev_assign_addedfunction pci_dev_test_and_clear_added
Annotated Snippet
struct pci_cap_saved_data {
u16 cap_nr;
bool cap_extended;
unsigned int size;
u32 data[];
};
struct pci_cap_saved_state {
struct hlist_node next;
struct pci_cap_saved_data cap;
};
void pci_allocate_cap_save_buffers(struct pci_dev *dev);
void pci_free_cap_save_buffers(struct pci_dev *dev);
int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
u16 cap, unsigned int size);
struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev,
u16 cap);
#define PCI_PM_D2_DELAY 200 /* usec; see PCIe r4.0, sec 5.9.1 */
#define PCI_PM_D3HOT_WAIT 10 /* msec */
#define PCI_PM_D3COLD_WAIT 100 /* msec */
void pci_update_current_state(struct pci_dev *dev, pci_power_t state);
void pci_refresh_power_state(struct pci_dev *dev);
int pci_power_up(struct pci_dev *dev);
void pci_disable_enabled_device(struct pci_dev *dev);
int pci_finish_runtime_suspend(struct pci_dev *dev);
void pcie_clear_device_status(struct pci_dev *dev);
void pcie_clear_root_pme_status(struct pci_dev *dev);
bool pci_check_pme_status(struct pci_dev *dev);
void pci_pme_wakeup_bus(struct pci_bus *bus);
void pci_pme_restore(struct pci_dev *dev);
bool pci_dev_need_resume(struct pci_dev *dev);
void pci_dev_adjust_pme(struct pci_dev *dev);
void pci_dev_complete_resume(struct pci_dev *pci_dev);
void pci_config_pm_runtime_get(struct pci_dev *dev);
void pci_config_pm_runtime_put(struct pci_dev *dev);
void pci_pm_power_up_and_verify_state(struct pci_dev *pci_dev);
void pci_pm_init(struct pci_dev *dev);
void pci_ea_init(struct pci_dev *dev);
bool pci_ea_fixed_busnrs(struct pci_dev *dev, u8 *sec, u8 *sub);
void pci_msi_init(struct pci_dev *dev);
void pci_msix_init(struct pci_dev *dev);
bool pci_bridge_d3_possible(struct pci_dev *dev);
void pci_bridge_d3_update(struct pci_dev *dev);
int pci_bridge_wait_for_secondary_bus(struct pci_dev *dev, char *reset_type);
static inline bool pci_bus_rrs_vendor_id(u32 l)
{
return (l & 0xffff) == PCI_VENDOR_ID_PCI_SIG;
}
static inline void pci_wakeup_event(struct pci_dev *dev)
{
/* Wait 100 ms before the system can be put into a sleep state. */
pm_wakeup_event(&dev->dev, 100);
}
/**
* pci_bar_index_is_valid - Check whether a BAR index is within valid range
* @bar: BAR index
*
* Protects against overflowing &struct pci_dev.resource array.
*
* Return: true for valid index, false otherwise.
*/
static inline bool pci_bar_index_is_valid(int bar)
{
if (bar >= 0 && bar < PCI_NUM_RESOURCES)
return true;
return false;
}
static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
static inline bool pci_power_manageable(struct pci_dev *pci_dev)
{
/*
* Currently we allow normal PCI devices and PCI bridges transition
* into D3 if their bridge_d3 is set.
*/
return !pci_has_subordinate(pci_dev) || pci_dev->bridge_d3;
}
Annotation
- Immediate include surface: `linux/align.h`, `linux/bitfield.h`, `linux/pci.h`, `trace/events/pci.h`, `linux/aer.h`.
- Detected declarations: `struct pcie_tlp_log`, `struct pci_cap_saved_data`, `struct pci_cap_saved_state`, `struct pci_slot_attribute`, `struct pci_sriov`, `struct aer_err_info`, `struct rcec_ea`, `struct pci_dev_reset_methods`, `struct pci_reset_fn_method`, `struct device_node`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- 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.