drivers/scsi/aacraid/commsup.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aacraid/commsup.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aacraid/commsup.c- Extension
.c- Size
- 65853 bytes
- Lines
- 2454
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/kernel.hlinux/init.hlinux/crash_dump.hlinux/types.hlinux/sched.hlinux/pci.hlinux/spinlock.hlinux/slab.hlinux/completion.hlinux/blkdev.hlinux/delay.hlinux/kthread.hlinux/interrupt.hlinux/bcd.hscsi/scsi.hscsi/scsi_host.hscsi/scsi_device.hscsi/scsi_cmnd.haacraid.h
Detected Declarations
function Copyrightfunction aac_fib_map_freefunction aac_fib_vector_assignfunction aac_fib_setupfunction aac_fib_freefunction aac_fib_initfunction fib_deallocfunction fullfunction aac_queue_getfunction aac_fib_sendfunction aac_hba_sendfunction aac_consumer_getfunction aac_consumer_freefunction aac_fib_adapter_completefunction aac_fib_completefunction aac_printffunction aac_aif_datafunction aac_handle_aif_bufunction aac_handle_aiffunction aac_schedule_bus_scanfunction _aac_reset_adapterfunction aac_reset_adapterfunction is_safw_raid_volumefunction aac_add_safw_devicefunction aac_put_safw_scsi_devicefunction aac_remove_safw_devicefunction aac_is_safw_scan_count_equalfunction aac_is_safw_target_validfunction aac_is_safw_device_exposedfunction aac_update_safw_host_devicesfunction aac_scan_safw_hostfunction aac_scan_hostfunction aac_src_reinit_aif_workerfunction aac_handle_sa_aiffunction get_fib_countfunction fillup_poolsfunction wakeup_fibctx_threadsfunction aac_process_eventsfunction aac_send_wellness_commandfunction aac_send_safw_hostttimefunction aac_send_hosttimefunction aac_command_threadfunction aac_acquire_irqfunction aac_free_irq
Annotated Snippet
if (--idx == 0) {
if (qid == AdapNormCmdQueue)
idx = ADAP_NORM_CMD_ENTRIES;
else
idx = ADAP_NORM_RESP_ENTRIES;
}
if (idx != le32_to_cpu(*(q->headers.consumer)))
*nonotify = 1;
}
if (qid == AdapNormCmdQueue) {
if (*index >= ADAP_NORM_CMD_ENTRIES)
*index = 0; /* Wrap to front of the Producer Queue. */
} else {
if (*index >= ADAP_NORM_RESP_ENTRIES)
*index = 0; /* Wrap to front of the Producer Queue. */
}
/* Queue is full */
if ((*index + 1) == le32_to_cpu(*(q->headers.consumer))) {
printk(KERN_WARNING "Queue %d full, %u outstanding.\n",
qid, atomic_read(&q->numpending));
return 0;
} else {
*entry = q->base + *index;
return 1;
}
}
/**
* aac_queue_get - get the next free QE
* @dev: Adapter
* @index: Returned index
* @qid: Queue number
* @hw_fib: Fib to associate with the queue entry
* @wait: Wait if queue full
* @fibptr: Driver fib object to go with fib
* @nonotify: Don't notify the adapter
*
* Gets the next free QE off the requested priorty adapter command
* queue and associates the Fib with the QE. The QE represented by
* index is ready to insert on the queue when this routine returns
* success.
*/
int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hw_fib, int wait, struct fib * fibptr, unsigned long *nonotify)
{
struct aac_entry * entry = NULL;
int map = 0;
if (qid == AdapNormCmdQueue) {
/* if no entries wait for some if caller wants to */
while (!aac_get_entry(dev, qid, &entry, index, nonotify)) {
printk(KERN_ERR "GetEntries failed\n");
}
/*
* Setup queue entry with a command, status and fib mapped
*/
entry->size = cpu_to_le32(le16_to_cpu(hw_fib->header.Size));
map = 1;
} else {
while (!aac_get_entry(dev, qid, &entry, index, nonotify)) {
/* if no entries wait for some if caller wants to */
}
/*
* Setup queue entry with command, status and fib mapped
*/
entry->size = cpu_to_le32(le16_to_cpu(hw_fib->header.Size));
entry->addr = hw_fib->header.SenderFibAddress;
/* Restore adapters pointer to the FIB */
hw_fib->header.u.ReceiverFibAddress = hw_fib->header.SenderFibAddress; /* Let the adapter now where to find its data */
map = 0;
}
/*
* If MapFib is true than we need to map the Fib and put pointers
* in the queue entry.
*/
if (map)
entry->addr = cpu_to_le32(fibptr->hw_fib_pa);
return 0;
}
/*
* Define the highest level of host to adapter communication routines.
* These routines will support host to adapter FS commuication. These
* routines have no knowledge of the commuication method used. This level
* sends and receives FIBs. This level has no knowledge of how these FIBs
* get passed back and forth.
*/
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/crash_dump.h`, `linux/types.h`, `linux/sched.h`, `linux/pci.h`, `linux/spinlock.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function aac_fib_map_free`, `function aac_fib_vector_assign`, `function aac_fib_setup`, `function aac_fib_free`, `function aac_fib_init`, `function fib_dealloc`, `function full`, `function aac_queue_get`, `function aac_fib_send`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source 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.