include/linux/nvme-fc.h

Source file repositories/reference/linux-study-clean/include/linux/nvme-fc.h

File Facts

System
Linux kernel
Corpus path
include/linux/nvme-fc.h
Extension
.h
Size
9955 bytes
Lines
439
Domain
Representative Device Path
Bucket
PCIe NVMe Storage Path
Inferred role
Representative Device Path: implementation source
Status
source implementation candidate

Why This File Exists

Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.

Dependency Surface

Detected Declarations

Annotated Snippet

struct nvme_fc_cmd_iu {
	__u8			format_id;
	__u8			fc_id;
	__be16			iu_len;
	__u8			rsvd4[2];
	__u8			rsv_cat;
	__u8			flags;
	__be64			connection_id;
	__be32			csn;
	__be32			data_len;
	struct nvme_command	sqe;
	__u8			dps;
	__u8			lbads;
	__be16			ms;
	__be32			rsvd92;
};

#define NVME_FC_SIZEOF_ZEROS_RSP	12

enum {
	FCNVME_SC_SUCCESS		= 0,
	FCNVME_SC_INVALID_FIELD		= 1,
	/* reserved			  2 */
	FCNVME_SC_ILL_CONN_PARAMS	= 3,
};

struct nvme_fc_ersp_iu {
	__u8			ersp_result;
	__u8			rsvd1;
	__be16			iu_len;
	__be32			rsn;
	__be32			xfrd_len;
	__be32			rsvd12;
	struct nvme_completion	cqe;
	/* for now - no additional payload */
};


#define FCNVME_NVME_SR_OPCODE		0x01
#define FCNVME_NVME_SR_RSP_OPCODE	0x02

struct nvme_fc_nvme_sr_iu {
	__u8			fc_id;
	__u8			opcode;
	__u8			rsvd2;
	__u8			retry_rctl;
	__be32			rsvd4;
};


enum {
	FCNVME_SRSTAT_ACC		= 0x0,
	/* reserved			  0x1 */
	/* reserved			  0x2 */
	FCNVME_SRSTAT_LOGICAL_ERR	= 0x3,
	FCNVME_SRSTAT_INV_QUALIF	= 0x4,
	FCNVME_SRSTAT_UNABL2PERFORM	= 0x9,
};

struct nvme_fc_nvme_sr_rsp_iu {
	__u8			fc_id;
	__u8			opcode;
	__u8			rsvd2;
	__u8			status;
	__be32			rsvd4;
};


/* FC-NVME Link Services - LS cmd values (w0 bits 31:24) */
enum {
	FCNVME_LS_RSVD			= 0,
	FCNVME_LS_RJT			= 1,
	FCNVME_LS_ACC			= 2,
	FCNVME_LS_CREATE_ASSOCIATION	= 3,	/* Create Association */
	FCNVME_LS_CREATE_CONNECTION	= 4,	/* Create I/O Connection */
	FCNVME_LS_DISCONNECT_ASSOC	= 5,	/* Disconnect Association */
	FCNVME_LS_DISCONNECT_CONN	= 6,	/* Disconnect Connection */
};

/* FC-NVME Link Service Descriptors */
enum {
	FCNVME_LSDESC_RSVD		= 0x0,
	FCNVME_LSDESC_RQST		= 0x1,
	FCNVME_LSDESC_RJT		= 0x2,
	FCNVME_LSDESC_CREATE_ASSOC_CMD	= 0x3,
	FCNVME_LSDESC_CREATE_CONN_CMD	= 0x4,
	FCNVME_LSDESC_DISCONN_CMD	= 0x5,
	FCNVME_LSDESC_CONN_ID		= 0x6,
	FCNVME_LSDESC_ASSOC_ID		= 0x7,
};

Annotation

Implementation Notes