drivers/net/wireless/ath/ath12k/pci.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/pci.c- Extension
.c- Size
- 48030 bytes
- Lines
- 1849
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/module.hlinux/msi.hlinux/pci.hlinux/time.hlinux/vmalloc.hpci.hcore.hhif.hmhi.hdebug.hhal.h
Detected Declarations
function ath12k_pci_select_windowfunction ath12k_pci_select_static_windowfunction ath12k_pci_get_window_startfunction ath12k_pci_is_offset_within_mhi_regionfunction ath12k_pci_restore_windowfunction ath12k_pci_soc_global_resetfunction ath12k_pci_clear_dbg_registersfunction ath12k_pci_enable_ltssmfunction ath12k_pci_clear_all_intrsfunction ath12k_pci_set_wlaon_pwr_ctrlfunction ath12k_pci_force_wakefunction ath12k_pci_sw_resetfunction ath12k_pci_free_ext_irqfunction ath12k_pci_free_irqfunction ath12k_pci_ce_irq_enablefunction ath12k_pci_ce_irq_disablefunction ath12k_pci_ce_irqs_disablefunction ath12k_pci_sync_ce_irqsfunction ath12k_pci_ce_workqueuefunction ath12k_pci_ce_interrupt_handlerfunction ath12k_pci_ext_grp_disablefunction __ath12k_pci_ext_irq_disablefunction ath12k_pci_ext_grp_enablefunction ath12k_pci_sync_ext_irqsfunction ath12k_pci_ext_grp_napi_pollfunction ath12k_pci_ext_interrupt_handlerfunction ath12k_pci_ext_irq_configfunction ath12k_pci_set_irq_affinity_hintfunction ath12k_pci_config_irqfunction ath12k_pci_init_qmi_ce_configfunction ath12k_pci_ce_irqs_enablefunction ath12k_pci_msi_configfunction ath12k_pci_msi_enablefunction ath12k_pci_msi_disablefunction ath12k_pci_msi_allocfunction ath12k_pci_msi_freefunction ath12k_pci_config_msi_datafunction ath12k_pci_claimfunction ath12k_pci_free_regionfunction ath12k_pci_aspm_disablefunction ath12k_pci_update_qrtr_node_idfunction ath12k_pci_aspm_restorefunction ath12k_pci_cancel_workqueuefunction ath12k_pci_ce_irq_disable_syncfunction ath12k_pci_map_service_to_pipefunction ath12k_pci_get_msi_irqfunction ath12k_pci_get_user_msi_assignmentfunction ath12k_pci_get_msi_address
Annotated Snippet
struct pci_driver *pci_driver;
if (device_id >= ATH12K_DEVICE_FAMILY_MAX)
return -EINVAL;
if (!driver || !driver->ops.probe ||
!driver->ops.arch_init || !driver->ops.arch_deinit)
return -EINVAL;
if (ath12k_pci_family_drivers[device_id]) {
pr_err("Driver already registered for %d\n", device_id);
return -EALREADY;
}
ath12k_pci_family_drivers[device_id] = driver;
pci_driver = &ath12k_pci_family_drivers[device_id]->driver;
pci_driver->name = driver->name;
pci_driver->id_table = driver->id_table;
pci_driver->probe = ath12k_pci_probe;
pci_driver->remove = ath12k_pci_remove;
pci_driver->shutdown = ath12k_pci_shutdown;
pci_driver->driver.pm = &ath12k_pci_pm_ops;
return pci_register_driver(pci_driver);
}
EXPORT_SYMBOL(ath12k_pci_register_driver);
void ath12k_pci_unregister_driver(const enum ath12k_device_family device_id)
{
if (device_id >= ATH12K_DEVICE_FAMILY_MAX ||
!ath12k_pci_family_drivers[device_id])
return;
pci_unregister_driver(&ath12k_pci_family_drivers[device_id]->driver);
ath12k_pci_family_drivers[device_id] = NULL;
}
EXPORT_SYMBOL(ath12k_pci_unregister_driver);
/* firmware files */
MODULE_FIRMWARE(ATH12K_FW_DIR "/QCN9274/hw2.0/*");
MODULE_FIRMWARE(ATH12K_FW_DIR "/WCN7850/hw2.0/*");
Annotation
- Immediate include surface: `linux/module.h`, `linux/msi.h`, `linux/pci.h`, `linux/time.h`, `linux/vmalloc.h`, `pci.h`, `core.h`, `hif.h`.
- Detected declarations: `function ath12k_pci_select_window`, `function ath12k_pci_select_static_window`, `function ath12k_pci_get_window_start`, `function ath12k_pci_is_offset_within_mhi_region`, `function ath12k_pci_restore_window`, `function ath12k_pci_soc_global_reset`, `function ath12k_pci_clear_dbg_registers`, `function ath12k_pci_enable_ltssm`, `function ath12k_pci_clear_all_intrs`, `function ath12k_pci_set_wlaon_pwr_ctrl`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.