Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (c) 2016, Avago Technologies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #ifndef _NVME_FC_TRANSPORT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #define _NVME_FC_TRANSPORT_H 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * Common definitions between the nvme_fc (host) transport and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * nvmet_fc (target) transport implementation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * ******************  FC-NVME LS HANDLING ******************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) union nvmefc_ls_requests {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	struct fcnvme_ls_rqst_w0		w0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	struct fcnvme_ls_cr_assoc_rqst		rq_cr_assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	struct fcnvme_ls_cr_conn_rqst		rq_cr_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	struct fcnvme_ls_disconnect_assoc_rqst	rq_dis_assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	struct fcnvme_ls_disconnect_conn_rqst	rq_dis_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) } __aligned(128);	/* alignment for other things alloc'd with */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) union nvmefc_ls_responses {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	struct fcnvme_ls_rjt			rsp_rjt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	struct fcnvme_ls_cr_assoc_acc		rsp_cr_assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 	struct fcnvme_ls_cr_conn_acc		rsp_cr_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	struct fcnvme_ls_disconnect_assoc_acc	rsp_dis_assoc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	struct fcnvme_ls_disconnect_conn_acc	rsp_dis_conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) } __aligned(128);	/* alignment for other things alloc'd with */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) nvme_fc_format_rsp_hdr(void *buf, u8 ls_cmd, __be32 desc_len, u8 rqst_ls_cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	struct fcnvme_ls_acc_hdr *acc = buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	acc->w0.ls_cmd = ls_cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	acc->desc_list_len = desc_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	acc->rqst.desc_tag = cpu_to_be32(FCNVME_LSDESC_RQST);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 	acc->rqst.desc_len =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			fcnvme_lsdesc_len(sizeof(struct fcnvme_lsdesc_rqst));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	acc->rqst.w0.ls_cmd = rqst_ls_cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) nvme_fc_format_rjt(void *buf, u16 buflen, u8 ls_cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 			u8 reason, u8 explanation, u8 vendor)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	struct fcnvme_ls_rjt *rjt = buf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	nvme_fc_format_rsp_hdr(buf, FCNVME_LSDESC_RQST,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 			fcnvme_lsdesc_len(sizeof(struct fcnvme_ls_rjt)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 			ls_cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	rjt->rjt.desc_tag = cpu_to_be32(FCNVME_LSDESC_RJT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	rjt->rjt.desc_len = fcnvme_lsdesc_len(sizeof(struct fcnvme_lsdesc_rjt));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	rjt->rjt.reason_code = reason;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	rjt->rjt.reason_explanation = explanation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	rjt->rjt.vendor = vendor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	return sizeof(struct fcnvme_ls_rjt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) /* Validation Error indexes into the string table below */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) enum {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	VERR_NO_ERROR		= 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	VERR_CR_ASSOC_LEN	= 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	VERR_CR_ASSOC_RQST_LEN	= 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	VERR_CR_ASSOC_CMD	= 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	VERR_CR_ASSOC_CMD_LEN	= 4,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	VERR_ERSP_RATIO		= 5,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	VERR_ASSOC_ALLOC_FAIL	= 6,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	VERR_QUEUE_ALLOC_FAIL	= 7,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	VERR_CR_CONN_LEN	= 8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	VERR_CR_CONN_RQST_LEN	= 9,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	VERR_ASSOC_ID		= 10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	VERR_ASSOC_ID_LEN	= 11,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	VERR_NO_ASSOC		= 12,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	VERR_CONN_ID		= 13,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	VERR_CONN_ID_LEN	= 14,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	VERR_INVAL_CONN		= 15,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	VERR_CR_CONN_CMD	= 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	VERR_CR_CONN_CMD_LEN	= 17,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	VERR_DISCONN_LEN	= 18,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	VERR_DISCONN_RQST_LEN	= 19,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	VERR_DISCONN_CMD	= 20,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	VERR_DISCONN_CMD_LEN	= 21,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	VERR_DISCONN_SCOPE	= 22,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	VERR_RS_LEN		= 23,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	VERR_RS_RQST_LEN	= 24,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	VERR_RS_CMD		= 25,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	VERR_RS_CMD_LEN		= 26,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	VERR_RS_RCTL		= 27,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	VERR_RS_RO		= 28,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	VERR_LSACC		= 29,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	VERR_LSDESC_RQST	= 30,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	VERR_LSDESC_RQST_LEN	= 31,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	VERR_CR_ASSOC		= 32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	VERR_CR_ASSOC_ACC_LEN	= 33,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	VERR_CR_CONN		= 34,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	VERR_CR_CONN_ACC_LEN	= 35,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	VERR_DISCONN		= 36,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	VERR_DISCONN_ACC_LEN	= 37,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) static char *validation_errors[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	"OK",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	"Bad CR_ASSOC Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	"Bad CR_ASSOC Rqst Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	"Not CR_ASSOC Cmd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	"Bad CR_ASSOC Cmd Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	"Bad Ersp Ratio",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	"Association Allocation Failed",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	"Queue Allocation Failed",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	"Bad CR_CONN Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	"Bad CR_CONN Rqst Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	"Not Association ID",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	"Bad Association ID Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	"No Association",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	"Not Connection ID",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	"Bad Connection ID Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	"Invalid Connection ID",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	"Not CR_CONN Cmd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	"Bad CR_CONN Cmd Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	"Bad DISCONN Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	"Bad DISCONN Rqst Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	"Not DISCONN Cmd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	"Bad DISCONN Cmd Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	"Bad Disconnect Scope",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	"Bad RS Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	"Bad RS Rqst Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	"Not RS Cmd",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	"Bad RS Cmd Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	"Bad RS R_CTL",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	"Bad RS Relative Offset",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	"Not LS_ACC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	"Not LSDESC_RQST",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	"Bad LSDESC_RQST Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	"Not CR_ASSOC Rqst",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	"Bad CR_ASSOC ACC Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	"Not CR_CONN Rqst",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	"Bad CR_CONN ACC Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	"Not Disconnect Rqst",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	"Bad Disconnect ACC Length",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define NVME_FC_LAST_LS_CMD_VALUE	FCNVME_LS_DISCONNECT_CONN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) static char *nvmefc_ls_names[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	"Reserved (0)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	"RJT (1)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	"ACC (2)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	"Create Association",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	"Create Connection",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	"Disconnect Association",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	"Disconnect Connection",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) static inline void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) nvmefc_fmt_lsreq_discon_assoc(struct nvmefc_ls_req *lsreq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	struct fcnvme_ls_disconnect_assoc_rqst *discon_rqst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	struct fcnvme_ls_disconnect_assoc_acc *discon_acc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	u64 association_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	lsreq->rqstaddr = discon_rqst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	lsreq->rqstlen = sizeof(*discon_rqst);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	lsreq->rspaddr = discon_acc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	lsreq->rsplen = sizeof(*discon_acc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	lsreq->timeout = NVME_FC_LS_TIMEOUT_SEC;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	discon_rqst->w0.ls_cmd = FCNVME_LS_DISCONNECT_ASSOC;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	discon_rqst->desc_list_len = cpu_to_be32(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 				sizeof(struct fcnvme_lsdesc_assoc_id) +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 				sizeof(struct fcnvme_lsdesc_disconn_cmd));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	discon_rqst->associd.desc_tag = cpu_to_be32(FCNVME_LSDESC_ASSOC_ID);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	discon_rqst->associd.desc_len =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 			fcnvme_lsdesc_len(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 				sizeof(struct fcnvme_lsdesc_assoc_id));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	discon_rqst->associd.association_id = cpu_to_be64(association_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	discon_rqst->discon_cmd.desc_tag = cpu_to_be32(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 						FCNVME_LSDESC_DISCONN_CMD);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	discon_rqst->discon_cmd.desc_len =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 			fcnvme_lsdesc_len(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 				sizeof(struct fcnvme_lsdesc_disconn_cmd));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) static inline int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) nvmefc_vldt_lsreq_discon_assoc(u32 rqstlen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	struct fcnvme_ls_disconnect_assoc_rqst *rqst)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	int ret = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	if (rqstlen < sizeof(struct fcnvme_ls_disconnect_assoc_rqst))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		ret = VERR_DISCONN_LEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	else if (rqst->desc_list_len !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 			fcnvme_lsdesc_len(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 				sizeof(struct fcnvme_ls_disconnect_assoc_rqst)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		ret = VERR_DISCONN_RQST_LEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	else if (rqst->associd.desc_tag != cpu_to_be32(FCNVME_LSDESC_ASSOC_ID))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		ret = VERR_ASSOC_ID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	else if (rqst->associd.desc_len !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 			fcnvme_lsdesc_len(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 				sizeof(struct fcnvme_lsdesc_assoc_id)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		ret = VERR_ASSOC_ID_LEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	else if (rqst->discon_cmd.desc_tag !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 			cpu_to_be32(FCNVME_LSDESC_DISCONN_CMD))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		ret = VERR_DISCONN_CMD;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	else if (rqst->discon_cmd.desc_len !=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 			fcnvme_lsdesc_len(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 				sizeof(struct fcnvme_lsdesc_disconn_cmd)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		ret = VERR_DISCONN_CMD_LEN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	 * As the standard changed on the LS, check if old format and scope
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	 * something other than Association (e.g. 0).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	else if (rqst->discon_cmd.rsvd8[0])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		ret = VERR_DISCONN_SCOPE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #endif /* _NVME_FC_TRANSPORT_H */