drivers/scsi/aacraid/linit.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aacraid/linit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aacraid/linit.c- Extension
.c- Size
- 61885 bytes
- Lines
- 2075
- 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/compat.hlinux/blkdev.hlinux/completion.hlinux/init.hlinux/interrupt.hlinux/kernel.hlinux/module.hlinux/moduleparam.hlinux/pci.hlinux/slab.hlinux/mutex.hlinux/spinlock.hlinux/syscalls.hlinux/delay.hlinux/kthread.hlinux/msdos_partition.hscsi/scsi.hscsi/scsi_cmnd.hscsi/scsi_device.hscsi/scsi_host.hscsi/scsi_tcq.hscsi/scsicam.hscsi/scsi_eh.haacraid.h
Detected Declarations
struct fib_count_datafunction aac_queuecommandfunction aac_get_driver_identfunction aac_biosparmfunction aac_sdev_configurefunction __shost_for_each_devicefunction aac_change_queue_depthfunction __shost_for_each_devicefunction aac_show_raid_levelfunction aac_show_unique_idfunction aac_ioctlfunction fib_count_iterfunction get_num_of_incomplete_fibsfunction aac_eh_abortfunction aac_eh_tmf_lun_reset_fibfunction aac_eh_tmf_hard_reset_fibfunction aac_tmf_callbackfunction aac_eh_dev_resetfunction aac_eh_target_resetfunction aac_eh_bus_resetfunction aac_eh_host_resetfunction aac_cfg_openfunction aac_cfg_ioctlfunction aac_show_modelfunction aac_show_vendorfunction aac_show_flagsfunction aac_show_kernel_versionfunction aac_show_monitor_versionfunction aac_show_bios_versionfunction aac_show_driver_versionfunction aac_show_serial_numberfunction aac_show_max_channelfunction aac_show_max_idfunction aac_store_reset_adapterfunction aac_show_reset_adapterfunction aac_get_serial_numberfunction __aac_shutdownfunction aac_init_charfunction aac_reinit_aiffunction aac_probe_onefunction list_for_each_entryfunction aac_release_resourcesfunction aac_acquire_resourcesfunction aac_suspendfunction aac_resumefunction aac_shutdownfunction aac_remove_onefunction aac_pci_error_detected
Annotated Snippet
static const struct file_operations aac_cfg_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = aac_cfg_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = aac_cfg_ioctl,
#endif
.open = aac_cfg_open,
.llseek = noop_llseek,
};
static const struct scsi_host_template aac_driver_template = {
.module = THIS_MODULE,
.name = "AAC",
.proc_name = AAC_DRIVERNAME,
.info = aac_info,
.ioctl = aac_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = aac_ioctl,
#endif
.queuecommand = aac_queuecommand,
.bios_param = aac_biosparm,
.shost_groups = aac_host_groups,
.sdev_configure = aac_sdev_configure,
.change_queue_depth = aac_change_queue_depth,
.sdev_groups = aac_dev_groups,
.eh_abort_handler = aac_eh_abort,
.eh_device_reset_handler = aac_eh_dev_reset,
.eh_target_reset_handler = aac_eh_target_reset,
.eh_bus_reset_handler = aac_eh_bus_reset,
.eh_host_reset_handler = aac_eh_host_reset,
.can_queue = AAC_NUM_IO_FIB,
.this_id = MAXIMUM_NUM_CONTAINERS,
.sg_tablesize = 16,
.max_sectors = 128,
#if (AAC_NUM_IO_FIB > 256)
.cmd_per_lun = 256,
#else
.cmd_per_lun = AAC_NUM_IO_FIB,
#endif
.emulated = 1,
.no_write_same = 1,
.cmd_size = sizeof(struct aac_cmd_priv),
};
static void __aac_shutdown(struct aac_dev * aac)
{
int i;
mutex_lock(&aac->ioctl_mutex);
aac->adapter_shutdown = 1;
mutex_unlock(&aac->ioctl_mutex);
if (aac->aif_thread) {
int i;
/* Clear out events first */
for (i = 0; i < (aac->scsi_host_ptr->can_queue + AAC_NUM_MGT_FIB); i++) {
struct fib *fib = &aac->fibs[i];
if (!(fib->hw_fib_va->header.XferState & cpu_to_le32(NoResponseExpected | Async)) &&
(fib->hw_fib_va->header.XferState & cpu_to_le32(ResponseExpected)))
complete(&fib->event_wait);
}
kthread_stop(aac->thread);
aac->thread = NULL;
}
aac_send_shutdown(aac);
aac_adapter_disable_int(aac);
if (aac_is_src(aac)) {
if (aac->max_msix > 1) {
for (i = 0; i < aac->max_msix; i++) {
free_irq(pci_irq_vector(aac->pdev, i),
&(aac->aac_msix[i]));
}
} else {
free_irq(aac->pdev->irq,
&(aac->aac_msix[0]));
}
} else {
free_irq(aac->pdev->irq, aac);
}
if (aac->msi)
pci_disable_msi(aac->pdev);
else if (aac->max_msix > 1)
pci_disable_msix(aac->pdev);
}
static void aac_init_char(void)
{
aac_cfg_major = register_chrdev(0, "aac", &aac_cfg_fops);
Annotation
- Immediate include surface: `linux/compat.h`, `linux/blkdev.h`, `linux/completion.h`, `linux/init.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/module.h`, `linux/moduleparam.h`.
- Detected declarations: `struct fib_count_data`, `function aac_queuecommand`, `function aac_get_driver_ident`, `function aac_biosparm`, `function aac_sdev_configure`, `function __shost_for_each_device`, `function aac_change_queue_depth`, `function __shost_for_each_device`, `function aac_show_raid_level`, `function aac_show_unique_id`.
- 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.