drivers/scsi/qedf/qedf.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/qedf/qedf.h
Extension
.h
Size
17741 bytes
Lines
606
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 qedf_mp_req {
	uint32_t req_len;
	void *req_buf;
	dma_addr_t req_buf_dma;
	struct scsi_sge *mp_req_bd;
	dma_addr_t mp_req_bd_dma;
	struct fc_frame_header req_fc_hdr;

	uint32_t resp_len;
	void *resp_buf;
	dma_addr_t resp_buf_dma;
	struct scsi_sge *mp_resp_bd;
	dma_addr_t mp_resp_bd_dma;
	struct fc_frame_header resp_fc_hdr;
};

struct qedf_els_cb_arg {
	struct qedf_ioreq *aborted_io_req;
	struct qedf_ioreq *io_req;
	u8 op; /* Used to keep track of ELS op */
	uint16_t l2_oxid;
	u32 offset; /* Used for sequence cleanup */
	u8 r_ctl; /* Used for sequence cleanup */
};

enum qedf_ioreq_event {
	QEDF_IOREQ_EV_NONE,
	QEDF_IOREQ_EV_ABORT_SUCCESS,
	QEDF_IOREQ_EV_ABORT_FAILED,
	QEDF_IOREQ_EV_SEND_RRQ,
	QEDF_IOREQ_EV_ELS_TMO,
	QEDF_IOREQ_EV_ELS_ERR_DETECT,
	QEDF_IOREQ_EV_ELS_FLUSH,
	QEDF_IOREQ_EV_CLEANUP_SUCCESS,
	QEDF_IOREQ_EV_CLEANUP_FAILED,
};

#define FC_GOOD		0
#define FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER	(0x1<<2)
#define FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER	(0x1<<3)
#define FCOE_FCP_RSP_FLAGS_FCP_RSP_LEN_VALID	(0x1<<0)
#define FCOE_FCP_RSP_FLAGS_FCP_SNS_LEN_VALID	(0x1<<1)
struct qedf_ioreq {
	struct list_head link;
	uint16_t xid;
	struct scsi_cmnd *sc_cmd;
#define QEDF_SCSI_CMD		1
#define QEDF_TASK_MGMT_CMD	2
#define QEDF_ABTS		3
#define QEDF_ELS		4
#define QEDF_CLEANUP		5
#define QEDF_SEQ_CLEANUP	6
	u8 cmd_type;
#define QEDF_CMD_OUTSTANDING		0x0
#define QEDF_CMD_IN_ABORT		0x1
#define QEDF_CMD_IN_CLEANUP		0x2
#define QEDF_CMD_SRR_SENT		0x3
#define QEDF_CMD_DIRTY			0x4
#define QEDF_CMD_ERR_SCSI_DONE		0x5
	u8 io_req_flags;
	uint8_t tm_flags;
	u64 tm_lun;
	struct qedf_rport *fcport;
#define	QEDF_CMD_ST_INACTIVE		0
#define	QEDFC_CMD_ST_IO_ACTIVE		1
#define	QEDFC_CMD_ST_ABORT_ACTIVE	2
#define	QEDFC_CMD_ST_ABORT_ACTIVE_EH	3
#define	QEDFC_CMD_ST_CLEANUP_ACTIVE	4
#define	QEDFC_CMD_ST_CLEANUP_ACTIVE_EH	5
#define	QEDFC_CMD_ST_RRQ_ACTIVE		6
#define	QEDFC_CMD_ST_RRQ_WAIT		7
#define	QEDFC_CMD_ST_OXID_RETIRE_WAIT	8
#define	QEDFC_CMD_ST_TMF_ACTIVE		9
#define	QEDFC_CMD_ST_DRAIN_ACTIVE	10
#define	QEDFC_CMD_ST_CLEANED		11
#define	QEDFC_CMD_ST_ELS_ACTIVE		12
	atomic_t state;
	unsigned long flags;
	enum qedf_ioreq_event event;
	size_t data_xfer_len;
	/* ID: 001: Alloc cmd (qedf_alloc_cmd) */
	/* ID: 002: Initiate ABTS (qedf_initiate_abts) */
	/* ID: 003: For RRQ (qedf_process_abts_compl) */
	struct kref refcount;
	struct qedf_cmd_mgr *cmd_mgr;
	struct io_bdt *bd_tbl;
	struct delayed_work timeout_work;
	struct completion tm_done;
	struct completion abts_done;
	struct completion cleanup_done;

Annotation

Implementation Notes