drivers/scsi/elx/libefc_sli/sli4.c
Source file repositories/reference/linux-study-clean/drivers/scsi/elx/libefc_sli/sli4.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/elx/libefc_sli/sli4.c- Extension
.c- Size
- 133605 bytes
- Lines
- 5156
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sli4.h
Detected Declarations
function sli_config_cmd_initfunction sli_cmd_common_create_cqfunction sli_cmd_common_create_eqfunction sli_cmd_common_create_mq_extfunction sli_cmd_wq_createfunction sli_cmd_rq_create_v1function sli_cmd_rq_create_v2function __sli_queue_destroyfunction __sli_queue_initfunction sli_fc_rq_allocfunction sli_fc_rq_set_allocfunction sli_res_sli_configfunction __sli_create_queuefunction sli_get_queue_entry_sizefunction sli_queue_allocfunction sli_cmd_cq_set_createfunction sli_cq_alloc_setfunction sli_cmd_common_destroy_qfunction sli_queue_freefunction sli_queue_eq_armfunction sli_queue_armfunction sli_wq_writefunction sli_mq_writefunction sli_rq_writefunction sli_eq_readfunction sli_cq_readfunction sli_mq_readfunction sli_eq_parsefunction sli_cq_parsefunction sli_abort_wqefunction sli_els_request64_wqefunction sli_fcp_icmnd64_wqefunction sli_fcp_iread64_wqefunction sli_fcp_iwrite64_wqefunction sli_fcp_treceive64_wqefunction sli_fcp_cont_treceive64_wqefunction sli_fcp_trsp64_wqefunction sli_fcp_tsend64_wqefunction sli_gen_request64_wqefunction sli_send_frame_wqefunction sli_xmit_bls_rsp64_wqefunction sli_xmit_els_rsp64_wqefunction sli_xmit_sequence64_wqefunction sli_requeue_xri_wqefunction sli_fc_process_link_attentionfunction sli_fc_cqe_parsefunction sli_fc_response_lengthfunction sli_fc_io_length
Annotated Snippet
if (le32_to_cpu(mcqe->dw3_flags) & SLI4_MCQE_AE) {
*etype = SLI4_QENTRY_ASYNC;
} else {
*etype = SLI4_QENTRY_MQ;
rc = sli_cqe_mq(sli4, mcqe);
}
*q_id = -1;
} else {
rc = sli_fc_cqe_parse(sli4, cq, cqe, etype, q_id);
}
return rc;
}
int
sli_abort_wqe(struct sli4 *sli, void *buf, enum sli4_abort_type type,
bool send_abts, u32 ids, u32 mask, u16 tag, u16 cq_id)
{
struct sli4_abort_wqe *abort = buf;
memset(buf, 0, sli->wqe_size);
switch (type) {
case SLI4_ABORT_XRI:
abort->criteria = SLI4_ABORT_CRITERIA_XRI_TAG;
if (mask) {
efc_log_warn(sli, "%#x aborting XRI %#x warning non-zero mask",
mask, ids);
mask = 0;
}
break;
case SLI4_ABORT_ABORT_ID:
abort->criteria = SLI4_ABORT_CRITERIA_ABORT_TAG;
break;
case SLI4_ABORT_REQUEST_ID:
abort->criteria = SLI4_ABORT_CRITERIA_REQUEST_TAG;
break;
default:
efc_log_info(sli, "unsupported type %#x\n", type);
return -EIO;
}
abort->ia_ir_byte |= send_abts ? 0 : 1;
/* Suppress ABTS retries */
abort->ia_ir_byte |= SLI4_ABRT_WQE_IR;
abort->t_mask = cpu_to_le32(mask);
abort->t_tag = cpu_to_le32(ids);
abort->command = SLI4_WQE_ABORT;
abort->request_tag = cpu_to_le16(tag);
abort->dw10w0_flags = cpu_to_le16(SLI4_ABRT_WQE_QOSD);
abort->cq_id = cpu_to_le16(cq_id);
abort->cmdtype_wqec_byte |= SLI4_CMD_ABORT_WQE;
return 0;
}
int
sli_els_request64_wqe(struct sli4 *sli, void *buf, struct efc_dma *sgl,
struct sli_els_params *params)
{
struct sli4_els_request64_wqe *els = buf;
struct sli4_sge *sge = sgl->virt;
bool is_fabric = false;
struct sli4_bde *bptr;
memset(buf, 0, sli->wqe_size);
bptr = &els->els_request_payload;
if (sli->params.sgl_pre_registered) {
els->qosd_xbl_hlm_iod_dbde_wqes &= ~SLI4_REQ_WQE_XBL;
els->qosd_xbl_hlm_iod_dbde_wqes |= SLI4_REQ_WQE_DBDE;
bptr->bde_type_buflen =
cpu_to_le32((SLI4_BDE_TYPE_VAL(64)) |
(params->xmit_len & SLI4_BDE_LEN_MASK));
bptr->u.data.low = sge[0].buffer_address_low;
bptr->u.data.high = sge[0].buffer_address_high;
} else {
els->qosd_xbl_hlm_iod_dbde_wqes |= SLI4_REQ_WQE_XBL;
bptr->bde_type_buflen =
cpu_to_le32((SLI4_BDE_TYPE_VAL(BLP)) |
((2 * sizeof(struct sli4_sge)) &
SLI4_BDE_LEN_MASK));
bptr->u.blp.low = cpu_to_le32(lower_32_bits(sgl->phys));
Annotation
- Immediate include surface: `sli4.h`.
- Detected declarations: `function sli_config_cmd_init`, `function sli_cmd_common_create_cq`, `function sli_cmd_common_create_eq`, `function sli_cmd_common_create_mq_ext`, `function sli_cmd_wq_create`, `function sli_cmd_rq_create_v1`, `function sli_cmd_rq_create_v2`, `function __sli_queue_destroy`, `function __sli_queue_init`, `function sli_fc_rq_alloc`.
- 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.