drivers/scsi/qla2xxx/qla_tmpl.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla2xxx/qla_tmpl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla2xxx/qla_tmpl.c- Extension
.c- Size
- 30091 bytes
- Lines
- 1101
- 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.hqla_tmpl.h
Detected Declarations
function Copyrightfunction qla27xx_insert32function qla27xx_insertbuffunction qla27xx_read8function qla27xx_read16function qla27xx_read32function voidfunction qla27xx_read_regfunction qla27xx_write_regfunction qla27xx_read_windowfunction qla27xx_skip_entryfunction qla27xx_next_entryfunction qla27xx_fwdt_entry_t0function qla27xx_fwdt_entry_t255function qla27xx_fwdt_entry_t256function qla27xx_fwdt_entry_t257function qla27xx_fwdt_entry_t258function qla27xx_fwdt_entry_t259function qla27xx_fwdt_entry_t260function qla27xx_fwdt_entry_t261function qla27xx_fwdt_entry_t262function qla27xx_fwdt_entry_t263function qla27xx_fwdt_entry_t264function qla27xx_fwdt_entry_t265function qla27xx_fwdt_entry_t266function qla27xx_fwdt_entry_t267function qla27xx_fwdt_entry_t268function qla27xx_fwdt_entry_t269function qla27xx_fwdt_entry_t270function qla27xx_fwdt_entry_t271function qla27xx_fwdt_entry_t272function qla27xx_fwdt_entry_t273function qla27xx_fwdt_entry_t274function qla27xx_fwdt_entry_t275function qla27xx_fwdt_entry_t276function qla27xx_fwdt_entry_t277function qla27xx_fwdt_entry_t278function qla27xx_fwdt_entry_otherfunction qla27xx_walk_templatefunction qla27xx_time_stampfunction qla27xx_driver_infofunction qla27xx_firmware_infofunction ql27xx_edit_templatefunction qla27xx_template_checksumfunction qla27xx_verify_template_checksumfunction qla27xx_verify_template_headerfunction qla27xx_execute_fwdt_templatefunction qla27xx_fwdt_calculate_dump_size
Annotated Snippet
if (buf) {
ent->t262.start_addr = cpu_to_le32(start);
ent->t262.end_addr = cpu_to_le32(end);
}
} else if (area == T262_RAM_AREA_DDR_RAM) {
start = vha->hw->fw_ddr_ram_start;
end = vha->hw->fw_ddr_ram_end;
if (buf) {
ent->t262.start_addr = cpu_to_le32(start);
ent->t262.end_addr = cpu_to_le32(end);
}
} else if (area == T262_RAM_AREA_MISC) {
if (buf) {
ent->t262.start_addr = cpu_to_le32(start);
ent->t262.end_addr = cpu_to_le32(end);
}
} else {
ql_dbg(ql_dbg_misc, vha, 0xd022,
"%s: unknown area %x\n", __func__, area);
qla27xx_skip_entry(ent, buf);
goto done;
}
if (end < start || start == 0 || end == 0) {
ql_dbg(ql_dbg_misc, vha, 0xd023,
"%s: unusable range (start=%lx end=%lx)\n",
__func__, start, end);
qla27xx_skip_entry(ent, buf);
goto done;
}
dwords = end - start + 1;
if (buf) {
buf += *len;
rc = qla24xx_dump_ram(vha->hw, start, buf, dwords, &buf);
if (rc != QLA_SUCCESS) {
ql_dbg(ql_dbg_async, vha, 0xffff,
"%s: dump ram MB failed. Area %xh start %lxh end %lxh\n",
__func__, area, start, end);
return INVALID_ENTRY;
}
}
*len += dwords * sizeof(uint32_t);
done:
return qla27xx_next_entry(ent);
}
static struct qla27xx_fwdt_entry *
qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
struct qla27xx_fwdt_entry *ent, void *buf, ulong *len)
{
uint type = ent->t263.queue_type;
uint count = 0;
uint i;
uint length;
ql_dbg(ql_dbg_misc + ql_dbg_verbose, vha, 0xd207,
"%s: getq(%x) [%lx]\n", __func__, type, *len);
if (type == T263_QUEUE_TYPE_REQ) {
for (i = 0; i < vha->hw->max_req_queues; i++) {
struct req_que *req = vha->hw->req_q_map[i];
if (req || !buf) {
length = req ?
req->length : REQUEST_ENTRY_CNT_24XX;
qla27xx_insert16(i, buf, len);
qla27xx_insert16(length, buf, len);
qla27xx_insertbuf(req ? req->ring : NULL,
length * sizeof(*req->ring), buf, len);
count++;
}
}
} else if (type == T263_QUEUE_TYPE_RSP) {
for (i = 0; i < vha->hw->max_rsp_queues; i++) {
struct rsp_que *rsp = vha->hw->rsp_q_map[i];
if (rsp || !buf) {
length = rsp ?
rsp->length : RESPONSE_ENTRY_CNT_MQ;
qla27xx_insert16(i, buf, len);
qla27xx_insert16(length, buf, len);
qla27xx_insertbuf(rsp ? rsp->ring : NULL,
length * sizeof(*rsp->ring), buf, len);
count++;
}
}
} else if (QLA_TGT_MODE_ENABLED() &&
ent->t263.queue_type == T263_QUEUE_TYPE_ATIO) {
struct qla_hw_data *ha = vha->hw;
struct atio *atr = ha->tgt.atio_ring;
Annotation
- Immediate include surface: `qla_def.h`, `qla_tmpl.h`.
- Detected declarations: `function Copyright`, `function qla27xx_insert32`, `function qla27xx_insertbuf`, `function qla27xx_read8`, `function qla27xx_read16`, `function qla27xx_read32`, `function void`, `function qla27xx_read_reg`, `function qla27xx_write_reg`, `function qla27xx_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.