drivers/scsi/qedi/qedi_fw_api.c
Source file repositories/reference/linux-study-clean/drivers/scsi/qedi/qedi_fw_api.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/qedi/qedi_fw_api.c- Extension
.c- Size
- 26422 bytes
- Lines
- 803
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hasm/byteorder.hqedi_hsi.hlinux/qed/qed_if.hqedi_fw_iscsi.hqedi_fw_scsi.h
Detected Declarations
function Copyrightfunction init_scsi_sgl_contextfunction calc_rw_task_sizefunction init_dif_context_flagsfunction init_sqefunction init_default_iscsi_taskfunction init_initiator_rw_cdb_ystorm_contextfunction init_ustorm_task_contextsfunction set_rw_exp_data_acked_and_cont_lenfunction init_rtdif_task_contextfunction set_local_completion_contextfunction init_rw_iscsi_taskfunction init_initiator_rw_iscsi_taskfunction init_initiator_login_request_taskfunction init_initiator_nop_out_taskfunction init_initiator_logout_request_taskfunction init_initiator_tmf_request_taskfunction init_initiator_text_request_taskfunction init_cleanup_task
Annotated Snippet
if (task_params->tx_io_size) {
buf_size = calc_rw_task_size(task_params, task_type,
sgl_task_params,
dif_task_params);
if (scsi_is_slow_sgl(sgl_task_params->num_sges,
sgl_task_params->small_mid_sge))
num_sges = ISCSI_WQE_NUM_SGES_SLOWIO;
else
num_sges = min(sgl_task_params->num_sges,
(u16)SCSI_NUM_SGES_SLOW_SGL_THR);
}
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_NUM_SGES,
num_sges);
SET_FIELD(task_params->sqe->contlen_cdbsize, ISCSI_WQE_CONT_LEN,
buf_size);
if (GET_FIELD(pdu_header->hdr_second_dword,
ISCSI_CMD_HDR_TOTAL_AHS_LEN))
SET_FIELD(task_params->sqe->contlen_cdbsize,
ISCSI_WQE_CDB_SIZE,
cmd_params->extended_cdb_sge.sge_len);
}
break;
case ISCSI_TASK_TYPE_INITIATOR_READ:
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_WQE_TYPE,
ISCSI_WQE_TYPE_NORMAL);
if (GET_FIELD(pdu_header->hdr_second_dword,
ISCSI_CMD_HDR_TOTAL_AHS_LEN))
SET_FIELD(task_params->sqe->contlen_cdbsize,
ISCSI_WQE_CDB_SIZE,
cmd_params->extended_cdb_sge.sge_len);
break;
case ISCSI_TASK_TYPE_LOGIN_RESPONSE:
case ISCSI_TASK_TYPE_MIDPATH:
{
bool advance_statsn = true;
if (task_type == ISCSI_TASK_TYPE_LOGIN_RESPONSE)
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_WQE_TYPE,
ISCSI_WQE_TYPE_LOGIN);
else
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_WQE_TYPE,
ISCSI_WQE_TYPE_MIDDLE_PATH);
if (task_type == ISCSI_TASK_TYPE_MIDPATH) {
u8 opcode = GET_FIELD(pdu_header->hdr_first_byte,
ISCSI_COMMON_HDR_OPCODE);
if (opcode != ISCSI_OPCODE_TEXT_RESPONSE &&
(opcode != ISCSI_OPCODE_NOP_IN ||
pdu_header->itt == ISCSI_TTT_ALL_ONES))
advance_statsn = false;
}
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_RESPONSE,
advance_statsn ? 1 : 0);
if (task_params->tx_io_size) {
SET_FIELD(task_params->sqe->contlen_cdbsize,
ISCSI_WQE_CONT_LEN, task_params->tx_io_size);
if (scsi_is_slow_sgl(sgl_task_params->num_sges,
sgl_task_params->small_mid_sge))
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_NUM_SGES,
ISCSI_WQE_NUM_SGES_SLOWIO);
else
SET_FIELD(task_params->sqe->flags, ISCSI_WQE_NUM_SGES,
min(sgl_task_params->num_sges,
(u16)SCSI_NUM_SGES_SLOW_SGL_THR));
}
}
break;
default:
break;
}
}
static void init_default_iscsi_task(struct iscsi_task_params *task_params,
struct data_hdr *pdu_header,
enum iscsi_task_type task_type)
{
struct iscsi_task_context *context;
u32 val;
u16 index;
u8 val_byte;
context = task_params->context;
Annotation
- Immediate include surface: `linux/types.h`, `asm/byteorder.h`, `qedi_hsi.h`, `linux/qed/qed_if.h`, `qedi_fw_iscsi.h`, `qedi_fw_scsi.h`.
- Detected declarations: `function Copyright`, `function init_scsi_sgl_context`, `function calc_rw_task_size`, `function init_dif_context_flags`, `function init_sqe`, `function init_default_iscsi_task`, `function init_initiator_rw_cdb_ystorm_context`, `function init_ustorm_task_contexts`, `function set_rw_exp_data_acked_and_cont_len`, `function init_rtdif_task_context`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
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.