drivers/scsi/qla4xxx/ql4_isr.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qla4xxx/ql4_isr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qla4xxx/ql4_isr.c- Extension
.c- Size
- 45776 bytes
- Lines
- 1622
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ql4_def.hql4_glbl.hql4_dbg.hql4_inline.h
Detected Declarations
function Copyrightfunction qla4xxx_status_cont_entryfunction qla4xxx_status_entryfunction qla4xxx_passthru_status_entryfunction qla4xxx_mbox_status_entryfunction qla4xxx_process_response_queuefunction qla4_83xx_loopback_in_progressfunction qla4xxx_update_ipaddr_statefunction qla4xxx_default_router_changedfunction qla4xxx_isr_decode_mailboxfunction qla4_83xx_interrupt_service_routinefunction qla4_82xx_interrupt_service_routinefunction qla4xxx_interrupt_service_routinefunction qla4_82xx_spurious_interruptfunction qla4xxx_intr_handlerfunction qla4_82xx_intr_handlerfunction qla4_83xx_intr_handlerfunction qla4_8xxx_msi_handlerfunction qla4_83xx_mailbox_intr_handlerfunction qla4_8xxx_default_intr_handlerfunction qla4_8xxx_msix_rsp_qfunction qla4xxx_process_aenfunction qla4xxx_request_irqsfunction qla4xxx_free_irqs
Annotated Snippet
if (sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) {
cmd->result = DID_ERROR << 16;
break;
}
if (sts_entry->iscsiFlags &ISCSI_FLAG_RESIDUAL_UNDER) {
scsi_set_resid(cmd, residual);
if (!scsi_status && ((scsi_bufflen(cmd) - residual) <
cmd->underflow)) {
cmd->result = DID_ERROR << 16;
DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: "
"Mid-layer Data underrun0, "
"xferlen = 0x%x, "
"residual = 0x%x\n", ha->host_no,
cmd->device->channel,
cmd->device->id,
cmd->device->lun, __func__,
scsi_bufflen(cmd), residual));
break;
}
}
cmd->result = DID_OK << 16 | scsi_status;
if (scsi_status != SAM_STAT_CHECK_CONDITION)
break;
/* Copy Sense Data into sense buffer. */
qla4xxx_copy_sense(ha, sts_entry, srb);
break;
case SCS_INCOMPLETE:
/* Always set the status to DID_ERROR, since
* all conditions result in that status anyway */
cmd->result = DID_ERROR << 16;
break;
case SCS_RESET_OCCURRED:
DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: Device RESET occurred\n",
ha->host_no, cmd->device->channel,
cmd->device->id, cmd->device->lun, __func__));
cmd->result = DID_RESET << 16;
break;
case SCS_ABORTED:
DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: Abort occurred\n",
ha->host_no, cmd->device->channel,
cmd->device->id, cmd->device->lun, __func__));
cmd->result = DID_RESET << 16;
break;
case SCS_TIMEOUT:
DEBUG2(printk(KERN_INFO "scsi%ld:%d:%d:%llu: Timeout\n",
ha->host_no, cmd->device->channel,
cmd->device->id, cmd->device->lun));
cmd->result = DID_TRANSPORT_DISRUPTED << 16;
/*
* Mark device missing so that we won't continue to send
* I/O to this device. We should get a ddb state change
* AEN soon.
*/
if (iscsi_is_session_online(ddb_entry->sess))
qla4xxx_mark_device_missing(ddb_entry->sess);
break;
case SCS_DATA_UNDERRUN:
case SCS_DATA_OVERRUN:
if ((sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_OVER) ||
(sts_entry->completionStatus == SCS_DATA_OVERRUN)) {
DEBUG2(printk("scsi%ld:%d:%d:%llu: %s: " "Data overrun\n",
ha->host_no,
cmd->device->channel, cmd->device->id,
cmd->device->lun, __func__));
cmd->result = DID_ERROR << 16;
break;
}
scsi_set_resid(cmd, residual);
if (sts_entry->iscsiFlags & ISCSI_FLAG_RESIDUAL_UNDER) {
/* Both the firmware and target reported UNDERRUN:
*
Annotation
- Immediate include surface: `ql4_def.h`, `ql4_glbl.h`, `ql4_dbg.h`, `ql4_inline.h`.
- Detected declarations: `function Copyright`, `function qla4xxx_status_cont_entry`, `function qla4xxx_status_entry`, `function qla4xxx_passthru_status_entry`, `function qla4xxx_mbox_status_entry`, `function qla4xxx_process_response_queue`, `function qla4_83xx_loopback_in_progress`, `function qla4xxx_update_ipaddr_state`, `function qla4xxx_default_router_changed`, `function qla4xxx_isr_decode_mailbox`.
- 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.