drivers/scsi/aic94xx/aic94xx_init.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic94xx/aic94xx_init.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic94xx/aic94xx_init.c- Extension
.c- Size
- 26574 bytes
- Lines
- 1048
- 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/module.hlinux/init.hlinux/kernel.hlinux/pci.hlinux/delay.hlinux/firmware.hlinux/slab.hscsi/sas_ata.hscsi/scsi_host.haic94xx.haic94xx_reg.haic94xx_hwi.haic94xx_seq.haic94xx_sds.h
Detected Declarations
struct flash_commandstruct error_biosfunction asd_map_memiofunction asd_unmap_memiofunction asd_map_ioportfunction asd_unmap_ioportfunction asd_map_hafunction asd_unmap_hafunction asd_common_setupfunction asd_aic9410_setupfunction asd_aic9405_setupfunction asd_show_dev_revfunction asd_show_dev_bios_buildfunction asd_show_dev_pcba_snfunction asd_store_update_biosfunction asd_show_update_biosfunction asd_create_dev_attrsfunction asd_remove_dev_attrsfunction asd_create_ha_cachesfunction asd_free_edbsfunction asd_free_escbsfunction asd_destroy_ha_cachesfunction asd_create_global_cachesfunction asd_destroy_global_cachesfunction asd_register_sas_hafunction asd_unregister_sas_hafunction asd_pci_probefunction asd_free_queuesfunction list_for_each_safefunction asd_turn_off_ledsfunction for_each_phyfunction asd_pci_removefunction asd_scan_startfunction asd_scan_finishedfunction version_showfunction asd_create_driver_attrsfunction asd_remove_driver_attrsfunction aic94xx_initfunction aic94xx_exitmodule init aic94xx_init
Annotated Snippet
static ssize_t version_show(struct device_driver *driver, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", ASD_DRIVER_VERSION);
}
static DRIVER_ATTR_RO(version);
static int asd_create_driver_attrs(struct device_driver *driver)
{
return driver_create_file(driver, &driver_attr_version);
}
static void asd_remove_driver_attrs(struct device_driver *driver)
{
driver_remove_file(driver, &driver_attr_version);
}
static const struct attribute_group *asd_sdev_groups[] = {
&sas_ata_sdev_attr_group,
NULL
};
static struct sas_domain_function_template aic94xx_transport_functions = {
.lldd_dev_found = asd_dev_found,
.lldd_dev_gone = asd_dev_gone,
.lldd_execute_task = asd_execute_task,
.lldd_abort_task = asd_abort_task,
.lldd_abort_task_set = asd_abort_task_set,
.lldd_clear_task_set = asd_clear_task_set,
.lldd_I_T_nexus_reset = asd_I_T_nexus_reset,
.lldd_lu_reset = asd_lu_reset,
.lldd_query_task = asd_query_task,
.lldd_clear_nexus_port = asd_clear_nexus_port,
.lldd_clear_nexus_ha = asd_clear_nexus_ha,
.lldd_control_phy = asd_control_phy,
.lldd_ata_set_dmamode = asd_set_dmamode,
};
static const struct pci_device_id aic94xx_pci_table[] = {
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x410),0, 0, 1},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x412),0, 0, 1},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x416),0, 0, 1},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x41E),0, 0, 1},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x41F),0, 0, 1},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x430),0, 0, 2},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x432),0, 0, 2},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x43E),0, 0, 2},
{PCI_DEVICE(PCI_VENDOR_ID_ADAPTEC2, 0x43F),0, 0, 2},
{}
};
MODULE_DEVICE_TABLE(pci, aic94xx_pci_table);
static struct pci_driver aic94xx_pci_driver = {
.name = ASD_DRIVER_NAME,
.id_table = aic94xx_pci_table,
.probe = asd_pci_probe,
.remove = asd_pci_remove,
};
static int __init aic94xx_init(void)
{
int err;
asd_printk("%s version %s loaded\n", ASD_DRIVER_DESCRIPTION,
ASD_DRIVER_VERSION);
err = asd_create_global_caches();
if (err)
return err;
aic94xx_transport_template =
sas_domain_attach_transport(&aic94xx_transport_functions);
if (!aic94xx_transport_template) {
err = -ENOMEM;
goto out_destroy_caches;
}
err = pci_register_driver(&aic94xx_pci_driver);
if (err)
goto out_release_transport;
err = asd_create_driver_attrs(&aic94xx_pci_driver.driver);
if (err)
goto out_unregister_pcidrv;
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/kernel.h`, `linux/pci.h`, `linux/delay.h`, `linux/firmware.h`, `linux/slab.h`, `scsi/sas_ata.h`.
- Detected declarations: `struct flash_command`, `struct error_bios`, `function asd_map_memio`, `function asd_unmap_memio`, `function asd_map_ioport`, `function asd_unmap_ioport`, `function asd_map_ha`, `function asd_unmap_ha`, `function asd_common_setup`, `function asd_aic9410_setup`.
- 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.