drivers/scsi/esas2r/esas2r_int.c
Source file repositories/reference/linux-study-clean/drivers/scsi/esas2r/esas2r_int.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/esas2r/esas2r_int.c- Extension
.c- Size
- 24654 bytes
- Lines
- 945
- 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
esas2r.h
Detected Declarations
function esas2r_polled_interruptfunction esas2r_interruptfunction esas2r_adapter_interruptfunction esas2r_msi_interruptfunction esas2r_handle_outbound_rsp_errfunction esas2r_get_outbound_responsesfunction esas2r_do_deferred_processesfunction list_for_each_safefunction resetfunction esas2r_process_bus_resetfunction esas2r_chip_rst_needed_during_taskletfunction esas2r_handle_chip_rst_during_taskletfunction esas2r_do_tasklet_tasksfunction esas2r_doorbell_interruptfunction esas2r_force_interruptfunction esas2r_lun_eventfunction esas2r_ae_completefunction esas2r_send_reset_aefunction esas2r_dummy_completefunction esas2r_complete_request
Annotated Snippet
if (rq->req_stat == RS_ABORTED) {
if (rq->timeout > RQ_MAX_TIMEOUT)
rq->req_stat = RS_TIMEOUT;
} else if (rq->req_stat == RS_SCSI_ERROR) {
u8 scsistatus = rq->func_rsp.scsi_rsp.scsi_stat;
esas2r_trace("scsistatus: %x", scsistatus);
/* Any of these are a good result. */
if (scsistatus == SAM_STAT_GOOD || scsistatus ==
SAM_STAT_CONDITION_MET || scsistatus ==
SAM_STAT_INTERMEDIATE || scsistatus ==
SAM_STAT_INTERMEDIATE_CONDITION_MET) {
rq->req_stat = RS_SUCCESS;
rq->func_rsp.scsi_rsp.scsi_stat =
SAM_STAT_GOOD;
}
}
}
}
static void esas2r_get_outbound_responses(struct esas2r_adapter *a)
{
struct atto_vda_ob_rsp *rsp;
u32 rspput_ptr;
u32 rspget_ptr;
struct esas2r_request *rq;
u32 handle;
unsigned long flags;
LIST_HEAD(comp_list);
esas2r_trace_enter();
spin_lock_irqsave(&a->queue_lock, flags);
/* Get the outbound limit and pointers */
rspput_ptr = le32_to_cpu(*a->outbound_copy) & MU_OLC_WRT_PTR;
rspget_ptr = a->last_read;
esas2r_trace("rspput_ptr: %x, rspget_ptr: %x", rspput_ptr, rspget_ptr);
/* If we don't have anything to process, get out */
if (unlikely(rspget_ptr == rspput_ptr)) {
spin_unlock_irqrestore(&a->queue_lock, flags);
esas2r_trace_exit();
return;
}
/* Make sure the firmware is healthy */
if (unlikely(rspput_ptr >= a->list_size)) {
spin_unlock_irqrestore(&a->queue_lock, flags);
esas2r_bugon();
esas2r_local_reset_adapter(a);
esas2r_trace_exit();
return;
}
do {
rspget_ptr++;
if (rspget_ptr >= a->list_size)
rspget_ptr = 0;
rsp = (struct atto_vda_ob_rsp *)a->outbound_list_md.virt_addr
+ rspget_ptr;
handle = rsp->handle;
/* Verify the handle range */
if (unlikely(LOWORD(handle) == 0
|| LOWORD(handle) > num_requests +
num_ae_requests + 1)) {
esas2r_bugon();
continue;
}
/* Get the request for this handle */
rq = a->req_table[LOWORD(handle)];
if (unlikely(rq == NULL || rq->vrq->scsi.handle != handle)) {
esas2r_bugon();
continue;
}
list_del(&rq->req_list);
/* Get the completion status */
rq->req_stat = rsp->req_stat;
Annotation
- Immediate include surface: `esas2r.h`.
- Detected declarations: `function esas2r_polled_interrupt`, `function esas2r_interrupt`, `function esas2r_adapter_interrupt`, `function esas2r_msi_interrupt`, `function esas2r_handle_outbound_rsp_err`, `function esas2r_get_outbound_responses`, `function esas2r_do_deferred_processes`, `function list_for_each_safe`, `function reset`, `function esas2r_process_bus_reset`.
- 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.