include/scsi/srp.h

Source file repositories/reference/linux-study-clean/include/scsi/srp.h

File Facts

System
Linux kernel
Corpus path
include/scsi/srp.h
Extension
.h
Size
7020 bytes
Lines
311
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct srp_direct_buf {
	__be64	va;
	__be32	key;
	__be32  len;
};

/*
 * We need the packed attribute because the SRP spec puts the list of
 * descriptors at an offset of 20, which is not aligned to the size of
 * struct srp_direct_buf.  The whole structure must be packed to avoid
 * having the 20-byte structure padded to 24 bytes on 64-bit architectures.
 */
struct srp_indirect_buf {
	struct srp_direct_buf	table_desc __packed __aligned(4);
	__be32			len;
	struct srp_direct_buf	desc_list[] __packed __aligned(4);
};

/* Immediate data buffer descriptor as defined in SRP2. */
struct srp_imm_buf {
	__be32	len;
};

/* srp_login_req.flags */
enum {
	SRP_MULTICHAN_SINGLE = 0,
	SRP_MULTICHAN_MULTI  = 1,
	SRP_IMMED_REQUESTED  = 0x80,	/* new in SRP2 */
};

struct srp_login_req {
	u8	opcode;
	u8	reserved1[7];
	u64	tag;
	__be32	req_it_iu_len;
	u8	reserved2[4];
	__be16	req_buf_fmt;
	u8	req_flags;
	u8	reserved3[1];
	__be16	imm_data_offset;	/* new in SRP2 */
	u8	reserved4[2];
	u8	initiator_port_id[16];
	u8	target_port_id[16];
};

/**
 * struct srp_login_req_rdma - RDMA/CM login parameters.
 *
 * RDMA/CM over InfiniBand can only carry 92 - 36 = 56 bytes of private
 * data. The %srp_login_req_rdma structure contains the same information as
 * %srp_login_req but with the reserved data removed.
 */
struct srp_login_req_rdma {
	u64	tag;
	__be16	req_buf_fmt;
	u8	req_flags;
	u8	opcode;
	__be32	req_it_iu_len;
	u8	initiator_port_id[16];
	u8	target_port_id[16];
	__be16	imm_data_offset;
	u8	reserved[6];
};

/* srp_login_rsp.rsp_flags */
enum {
	SRP_LOGIN_RSP_MULTICHAN_NO_CHAN	   = 0x0,
	SRP_LOGIN_RSP_MULTICHAN_TERMINATED = 0x1,
	SRP_LOGIN_RSP_MULTICHAN_MAINTAINED = 0x2,
	SRP_LOGIN_RSP_IMMED_SUPP	   = 0x80, /* new in SRP2 */
};

/*
 * The SRP spec defines the size of the LOGIN_RSP structure to be 52
 * bytes, so it needs to be packed to avoid having it padded to 56
 * bytes on 64-bit architectures.
 */
struct srp_login_rsp {
	u8	opcode;
	u8	reserved1[3];
	__be32	req_lim_delta;
	u64	tag __packed __aligned(4);
	__be32	max_it_iu_len;
	__be32	max_ti_iu_len;
	__be16	buf_fmt;
	u8	rsp_flags;
	u8	reserved2[25];
};

struct srp_login_rej {

Annotation

Implementation Notes