drivers/scsi/pm8001/pm8001_init.c
Source file repositories/reference/linux-study-clean/drivers/scsi/pm8001/pm8001_init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/pm8001/pm8001_init.c- Extension
.c- Size
- 46195 bytes
- Lines
- 1579
- Domain
- Driver Families
- Bucket
- drivers/scsi
- 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.
- 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/slab.hpm8001_sas.hpm8001_chips.hpm80xx_hwi.h
Detected Declarations
struct pm8001_mpi3_phy_pg_trx_configfunction pm8001_map_queuesfunction pm8001_phy_initfunction pm8001_freefunction pm8001_taskletfunction pm8001_init_taskletfunction pm8001_kill_taskletfunction pm8001_handle_irqfunction pm8001_interrupt_handler_msixfunction pm8001_interrupt_handler_intxfunction pm8001_allocfunction pm8001_ioremapfunction pci_go_44function pm8001_prep_sas_ha_initfunction pm8001_post_sas_ha_initfunction pm8001_init_sas_addfunction pm8001_get_phy_settings_infofunction pm8001_get_internal_phy_settingsfunction pm8001_get_external_phy_settingsfunction pm8001_get_phy_maskfunction pm8001_set_phy_settings_ven_117c_12Gfunction pm8001_configure_phy_settingsfunction pm8001_setup_msixfunction pm8001_request_msixfunction pm8001_request_irqfunction pm8001_free_irqfunction pm8001_pci_probefunction pm8001_init_ccb_tagfunction pm8001_pci_removefunction pm8001_pci_suspendfunction pm8001_pci_resumefunction pm8001_initfunction pm8001_exitmodule init pm8001_init
Annotated Snippet
static struct pci_driver pm8001_pci_driver = {
.name = DRV_NAME,
.id_table = pm8001_pci_table,
.probe = pm8001_pci_probe,
.remove = pm8001_pci_remove,
.driver.pm = &pm8001_pci_pm_ops,
};
/**
* pm8001_init - initialize scsi transport template
*/
static int __init pm8001_init(void)
{
int rc = -ENOMEM;
if (pm8001_use_tasklet && !pm8001_use_msix)
pm8001_use_tasklet = false;
pm8001_wq = alloc_workqueue("pm80xx", WQ_PERCPU, 0);
if (!pm8001_wq)
goto err;
pm8001_id = 0;
pm8001_stt = sas_domain_attach_transport(&pm8001_transport_ops);
if (!pm8001_stt)
goto err_wq;
rc = pci_register_driver(&pm8001_pci_driver);
if (rc)
goto err_tp;
return 0;
err_tp:
sas_release_transport(pm8001_stt);
err_wq:
destroy_workqueue(pm8001_wq);
err:
return rc;
}
static void __exit pm8001_exit(void)
{
pci_unregister_driver(&pm8001_pci_driver);
sas_release_transport(pm8001_stt);
destroy_workqueue(pm8001_wq);
}
module_init(pm8001_init);
module_exit(pm8001_exit);
MODULE_AUTHOR("Jack Wang <jack_wang@usish.com>");
MODULE_AUTHOR("Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>");
MODULE_AUTHOR("Sangeetha Gnanasekaran <Sangeetha.Gnanasekaran@pmcs.com>");
MODULE_AUTHOR("Nikith Ganigarakoppal <Nikith.Ganigarakoppal@pmcs.com>");
MODULE_DESCRIPTION(
"PMC-Sierra PM8001/8006/8081/8088/8089/8074/8076/8077/8070/8072 "
"SAS/SATA controller driver");
MODULE_VERSION(DRV_VERSION);
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, pm8001_pci_table);
Annotation
- Immediate include surface: `linux/slab.h`, `pm8001_sas.h`, `pm8001_chips.h`, `pm80xx_hwi.h`.
- Detected declarations: `struct pm8001_mpi3_phy_pg_trx_config`, `function pm8001_map_queues`, `function pm8001_phy_init`, `function pm8001_free`, `function pm8001_tasklet`, `function pm8001_init_tasklet`, `function pm8001_kill_tasklet`, `function pm8001_handle_irq`, `function pm8001_interrupt_handler_msix`, `function pm8001_interrupt_handler_intx`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: pattern implementation candidate.
- 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.