drivers/scsi/qla2xxx/qla_dbg.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla2xxx/qla_dbg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla2xxx/qla_dbg.c- Extension
.c- Size
- 90463 bytes
- Lines
- 2749
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
qla_def.hlinux/delay.htrace/events/qla.h
Detected Declarations
function qla2xxx_prep_dumpfunction qla2xxx_copy_queuesfunction qla27xx_dump_mpi_ramfunction qla24xx_dump_ramfunction qla24xx_dump_memoryfunction qla24xx_read_windowfunction qla24xx_pause_riscfunction qla24xx_soft_resetfunction qla2xxx_dump_ramfunction qla2xxx_read_windowfunction qla24xx_copy_eftfunction qla25xx_copy_fcefunction qla25xx_copy_exloginfunction qla81xx_copy_exchoffldfunction qla2xxx_copy_atioqueuesfunction qla25xx_copy_mqueuesfunction qla25xx_copy_mqfunction qla2xxx_dump_post_processfunction qla2xxx_dump_fwfunction qla2300_fw_dumpfunction qla2100_fw_dumpfunction qla24xx_fw_dumpfunction qla25xx_fw_dumpfunction qla81xx_fw_dumpfunction qla83xx_fw_dumpfunction ql_dbg_prefixfunction ql_dbgfunction ql_dbg_pcifunction ql_logfunction ql_log_pcifunction ql_dump_regsfunction ql_dump_bufferfunction ql_dbg_qp
Annotated Snippet
while (timer--) {
udelay(5);
if (qla_pci_disconnected(vha, reg))
return rval;
stat = rd_reg_dword(®->host_status);
/* Check for pending interrupts. */
if (!(stat & HSRX_RISC_INT))
continue;
stat &= 0xff;
if (stat != 0x1 && stat != 0x2 &&
stat != 0x10 && stat != 0x11) {
/* Clear this intr; it wasn't a mailbox intr */
wrt_reg_dword(®->hccr, HCCRX_CLR_RISC_INT);
rd_reg_dword(®->hccr);
continue;
}
set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
rval = rd_reg_word(®->mailbox0) & MBS_MASK;
wrt_reg_dword(®->hccr, HCCRX_CLR_RISC_INT);
rd_reg_dword(®->hccr);
break;
}
ha->flags.mbox_int = 1;
*nxt = ram + i;
if (!test_and_clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags)) {
/* no interrupt, timed out*/
return rval;
}
if (rval) {
/* error completion status */
return rval;
}
for (j = 0; j < dwords; j++) {
ram[i + j] =
(IS_QLA27XX(ha) || IS_QLA28XX(ha)) ?
chunk[j] : swab32(chunk[j]);
}
}
*nxt = ram + i;
return QLA_SUCCESS;
}
int
qla24xx_dump_ram(struct qla_hw_data *ha, uint32_t addr, __be32 *ram,
uint32_t ram_dwords, void **nxt)
{
int rval = QLA_FUNCTION_FAILED;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
dma_addr_t dump_dma = ha->gid_list_dma;
uint32_t *chunk = (uint32_t *)ha->gid_list;
uint32_t dwords = qla2x00_gid_list_size(ha) / 4;
uint32_t stat;
ulong i, j, timer = 6000000;
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
if (qla_pci_disconnected(vha, reg))
return rval;
for (i = 0; i < ram_dwords; i += dwords, addr += dwords) {
if (i + dwords > ram_dwords)
dwords = ram_dwords - i;
wrt_reg_word(®->mailbox0, MBC_DUMP_RISC_RAM_EXTENDED);
wrt_reg_word(®->mailbox1, LSW(addr));
wrt_reg_word(®->mailbox8, MSW(addr));
wrt_reg_word(®->mailbox10, 0);
wrt_reg_word(®->mailbox2, MSW(LSD(dump_dma)));
wrt_reg_word(®->mailbox3, LSW(LSD(dump_dma)));
wrt_reg_word(®->mailbox6, MSW(MSD(dump_dma)));
wrt_reg_word(®->mailbox7, LSW(MSD(dump_dma)));
wrt_reg_word(®->mailbox4, MSW(dwords));
wrt_reg_word(®->mailbox5, LSW(dwords));
wrt_reg_dword(®->hccr, HCCRX_SET_HOST_INT);
ha->flags.mbox_int = 0;
while (timer--) {
udelay(5);
if (qla_pci_disconnected(vha, reg))
return rval;
Annotation
- Immediate include surface: `qla_def.h`, `linux/delay.h`, `trace/events/qla.h`.
- Detected declarations: `function qla2xxx_prep_dump`, `function qla2xxx_copy_queues`, `function qla27xx_dump_mpi_ram`, `function qla24xx_dump_ram`, `function qla24xx_dump_memory`, `function qla24xx_read_window`, `function qla24xx_pause_risc`, `function qla24xx_soft_reset`, `function qla2xxx_dump_ram`, `function qla2xxx_read_window`.
- 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.
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.