drivers/scsi/lpfc/lpfc_sli.h

Source file repositories/reference/linux-study-clean/drivers/scsi/lpfc/lpfc_sli.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/lpfc/lpfc_sli.h
Extension
.h
Size
18033 bytes
Lines
504
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct lpfc_cq_event {
	struct list_head list;
	uint16_t hdwq;
	union {
		struct lpfc_mcqe		mcqe_cmpl;
		struct lpfc_acqe_link		acqe_link;
		struct lpfc_acqe_fip		acqe_fip;
		struct lpfc_acqe_dcbx		acqe_dcbx;
		struct lpfc_acqe_grp5		acqe_grp5;
		struct lpfc_acqe_fc_la		acqe_fc;
		struct lpfc_acqe_sli		acqe_sli;
		struct lpfc_rcqe		rcqe_cmpl;
		struct sli4_wcqe_xri_aborted	wcqe_axri;
		struct lpfc_wcqe_complete	wcqe_cmpl;
	} cqe;
};

/* This structure is used to handle IOCB requests / responses */
struct lpfc_iocbq {
	/* lpfc_iocbqs are used in double linked lists */
	struct list_head list;
	struct list_head clist;
	struct list_head dlist;
	uint16_t iotag;         /* pre-assigned IO tag */
	uint16_t sli4_lxritag;  /* logical pre-assigned XRI. */
	uint16_t sli4_xritag;   /* pre-assigned XRI, (OXID) tag. */
	uint16_t hba_wqidx;     /* index to HBA work queue */
	struct lpfc_cq_event cq_event;
	uint64_t isr_timestamp;

	union lpfc_wqe128 wqe;	/* SLI-4 */
	IOCB_t iocb;		/* SLI-3 */
	struct lpfc_wcqe_complete wcqe_cmpl;	/* WQE cmpl */

	u32 unsol_rcv_len;	/* Receive len in usol path */

	/* Pack the u8's together and make them module-4. */
	u8 num_bdes;	/* Number of BDEs */
	u8 abort_bls;	/* ABTS by initiator or responder */
	u8 abort_rctl;	/* ACC or RJT flag */
	u8 priority;	/* OAS priority */
	u8 retry;	/* retry counter for IOCB cmd - if needed */
	u8 rsvd1;       /* Pad for u32 */
	u8 rsvd2;       /* Pad for u32 */
	u8 rsvd3;	/* Pad for u32 */

	u32 cmd_flag;
#define LPFC_IO_LIBDFC		1	/* libdfc iocb */
#define LPFC_IO_WAKE		2	/* Synchronous I/O completed */
#define LPFC_IO_WAKE_TMO	LPFC_IO_WAKE /* Synchronous I/O timed out */
#define LPFC_IO_FCP		4	/* FCP command -- iocbq in scsi_buf */
#define LPFC_DRIVER_ABORTED	8	/* driver aborted this request */
#define LPFC_IO_FABRIC		0x10	/* Iocb send using fabric scheduler */
#define LPFC_DELAY_MEM_FREE	0x20    /* Defer free'ing of FC data */
#define LPFC_EXCHANGE_BUSY	0x40    /* SLI4 hba reported XB in response */
#define LPFC_USE_FCPWQIDX	0x80    /* Submit to specified FCPWQ index */
#define DSS_SECURITY_OP		0x100	/* security IO */
#define LPFC_IO_ON_TXCMPLQ	0x200	/* The IO is still on the TXCMPLQ */
#define LPFC_IO_DIF_PASS	0x400	/* T10 DIF IO pass-thru prot */
#define LPFC_IO_DIF_STRIP	0x800	/* T10 DIF IO strip prot */
#define LPFC_IO_DIF_INSERT	0x1000	/* T10 DIF IO insert prot */
#define LPFC_IO_CMD_OUTSTANDING	0x2000 /* timeout handler abort window */

#define LPFC_FIP_ELS_ID_MASK	0xc000	/* ELS_ID range 0-3, non-shifted mask */
#define LPFC_FIP_ELS_ID_SHIFT	14

#define LPFC_IO_OAS		0x10000 /* OAS FCP IO */
#define LPFC_IO_FOF		0x20000 /* FOF FCP IO */
#define LPFC_IO_LOOPBACK	0x40000 /* Loopback IO */
#define LPFC_PRLI_NVME_REQ	0x80000 /* This is an NVME PRLI. */
#define LPFC_PRLI_FCP_REQ	0x100000 /* This is an NVME PRLI. */
#define LPFC_IO_NVME	        0x200000 /* NVME FCP command */
#define LPFC_IO_NVME_LS		0x400000 /* NVME LS command */
#define LPFC_IO_NVMET		0x800000 /* NVMET command */
#define LPFC_IO_VMID            0x1000000 /* VMID tagged IO */
#define LPFC_IO_CMF		0x4000000 /* CMF command */

	uint32_t drvrTimeout;	/* driver timeout in seconds */
	struct lpfc_vport *vport;/* virtual port pointer */
	struct lpfc_dmabuf *cmd_dmabuf;
	struct lpfc_dmabuf *rsp_dmabuf;
	struct lpfc_dmabuf *bpl_dmabuf;
	uint32_t event_tag;	/* LA Event tag */
	union {
		wait_queue_head_t    *wait_queue;
		struct lpfcMboxq     *mbox;
		struct lpfc_node_rrq *rrq;
		struct nvmefc_ls_req *nvme_lsreq;
		struct lpfc_async_xchg_ctx *axchg;
		struct bsg_job_data *dd_data;

Annotation

Implementation Notes