18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright(c) 2007 Intel Corporation. All rights reserved.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Maintained at www.Open-FCoE.org
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef _FC_FS_H_
98c2ecf20Sopenharmony_ci#define _FC_FS_H_
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/types.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/*
148c2ecf20Sopenharmony_ci * Fibre Channel Framing and Signalling definitions.
158c2ecf20Sopenharmony_ci * From T11 FC-FS-2 Rev 0.90 - 9 August 2005.
168c2ecf20Sopenharmony_ci */
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci/*
198c2ecf20Sopenharmony_ci * Frame header
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_cistruct fc_frame_header {
228c2ecf20Sopenharmony_ci	__u8          fh_r_ctl;	/* routing control */
238c2ecf20Sopenharmony_ci	__u8          fh_d_id[3];	/* Destination ID */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci	__u8          fh_cs_ctl;	/* class of service control / pri */
268c2ecf20Sopenharmony_ci	__u8          fh_s_id[3];	/* Source ID */
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci	__u8          fh_type;		/* see enum fc_fh_type below */
298c2ecf20Sopenharmony_ci	__u8          fh_f_ctl[3];	/* frame control */
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	__u8          fh_seq_id;	/* sequence ID */
328c2ecf20Sopenharmony_ci	__u8          fh_df_ctl;	/* data field control */
338c2ecf20Sopenharmony_ci	__be16        fh_seq_cnt;	/* sequence count */
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	__be16        fh_ox_id;		/* originator exchange ID */
368c2ecf20Sopenharmony_ci	__be16        fh_rx_id;		/* responder exchange ID */
378c2ecf20Sopenharmony_ci	__be32        fh_parm_offset;	/* parameter or relative offset */
388c2ecf20Sopenharmony_ci};
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci#define FC_FRAME_HEADER_LEN 24	/* expected length of structure */
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define FC_MAX_PAYLOAD  2112U		/* max payload length in bytes */
438c2ecf20Sopenharmony_ci#define FC_MIN_MAX_PAYLOAD  256U 	/* lower limit on max payload */
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define FC_MAX_FRAME	(FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
468c2ecf20Sopenharmony_ci#define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/*
498c2ecf20Sopenharmony_ci * fh_r_ctl - Routing control definitions.
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_ci    /*
528c2ecf20Sopenharmony_ci     * FC-4 device_data.
538c2ecf20Sopenharmony_ci     */
548c2ecf20Sopenharmony_cienum fc_rctl {
558c2ecf20Sopenharmony_ci	FC_RCTL_DD_UNCAT = 0x00,	/* uncategorized information */
568c2ecf20Sopenharmony_ci	FC_RCTL_DD_SOL_DATA = 0x01,	/* solicited data */
578c2ecf20Sopenharmony_ci	FC_RCTL_DD_UNSOL_CTL = 0x02,	/* unsolicited control */
588c2ecf20Sopenharmony_ci	FC_RCTL_DD_SOL_CTL = 0x03,	/* solicited control or reply */
598c2ecf20Sopenharmony_ci	FC_RCTL_DD_UNSOL_DATA = 0x04,	/* unsolicited data */
608c2ecf20Sopenharmony_ci	FC_RCTL_DD_DATA_DESC = 0x05,	/* data descriptor */
618c2ecf20Sopenharmony_ci	FC_RCTL_DD_UNSOL_CMD = 0x06,	/* unsolicited command */
628c2ecf20Sopenharmony_ci	FC_RCTL_DD_CMD_STATUS = 0x07,	/* command status */
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL	/* ILS request */
658c2ecf20Sopenharmony_ci#define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL	/* ILS reply */
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci	/*
688c2ecf20Sopenharmony_ci	 * Extended Link_Data
698c2ecf20Sopenharmony_ci	 */
708c2ecf20Sopenharmony_ci	FC_RCTL_ELS_REQ = 0x22,	/* extended link services request */
718c2ecf20Sopenharmony_ci	FC_RCTL_ELS_REP = 0x23,	/* extended link services reply */
728c2ecf20Sopenharmony_ci	FC_RCTL_ELS4_REQ = 0x32, /* FC-4 ELS request */
738c2ecf20Sopenharmony_ci	FC_RCTL_ELS4_REP = 0x33, /* FC-4 ELS reply */
748c2ecf20Sopenharmony_ci	/*
758c2ecf20Sopenharmony_ci	 * Optional Extended Headers
768c2ecf20Sopenharmony_ci	 */
778c2ecf20Sopenharmony_ci	FC_RCTL_VFTH = 0x50,	/* virtual fabric tagging header */
788c2ecf20Sopenharmony_ci	FC_RCTL_IFRH = 0x51,	/* inter-fabric routing header */
798c2ecf20Sopenharmony_ci	FC_RCTL_ENCH = 0x52,	/* encapsulation header */
808c2ecf20Sopenharmony_ci	/*
818c2ecf20Sopenharmony_ci	 * Basic Link Services fh_r_ctl values.
828c2ecf20Sopenharmony_ci	 */
838c2ecf20Sopenharmony_ci	FC_RCTL_BA_NOP = 0x80,	/* basic link service NOP */
848c2ecf20Sopenharmony_ci	FC_RCTL_BA_ABTS = 0x81,	/* basic link service abort */
858c2ecf20Sopenharmony_ci	FC_RCTL_BA_RMC = 0x82,	/* remove connection */
868c2ecf20Sopenharmony_ci	FC_RCTL_BA_ACC = 0x84,	/* basic accept */
878c2ecf20Sopenharmony_ci	FC_RCTL_BA_RJT = 0x85,	/* basic reject */
888c2ecf20Sopenharmony_ci	FC_RCTL_BA_PRMT = 0x86,	/* dedicated connection preempted */
898c2ecf20Sopenharmony_ci	/*
908c2ecf20Sopenharmony_ci	 * Link Control Information.
918c2ecf20Sopenharmony_ci	 */
928c2ecf20Sopenharmony_ci	FC_RCTL_ACK_1 = 0xc0,	/* acknowledge_1 */
938c2ecf20Sopenharmony_ci	FC_RCTL_ACK_0 = 0xc1,	/* acknowledge_0 */
948c2ecf20Sopenharmony_ci	FC_RCTL_P_RJT = 0xc2,	/* port reject */
958c2ecf20Sopenharmony_ci	FC_RCTL_F_RJT = 0xc3,	/* fabric reject */
968c2ecf20Sopenharmony_ci	FC_RCTL_P_BSY = 0xc4,	/* port busy */
978c2ecf20Sopenharmony_ci	FC_RCTL_F_BSY = 0xc5,	/* fabric busy to data frame */
988c2ecf20Sopenharmony_ci	FC_RCTL_F_BSYL = 0xc6,	/* fabric busy to link control frame */
998c2ecf20Sopenharmony_ci	FC_RCTL_LCR = 0xc7,	/* link credit reset */
1008c2ecf20Sopenharmony_ci	FC_RCTL_END = 0xc9,	/* end */
1018c2ecf20Sopenharmony_ci};
1028c2ecf20Sopenharmony_ci				    /* incomplete list of definitions */
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/*
1058c2ecf20Sopenharmony_ci * R_CTL names initializer.
1068c2ecf20Sopenharmony_ci * Please keep this matching the above definitions.
1078c2ecf20Sopenharmony_ci */
1088c2ecf20Sopenharmony_ci#define FC_RCTL_NAMES_INIT { \
1098c2ecf20Sopenharmony_ci	[FC_RCTL_DD_UNCAT] =		"uncat",			\
1108c2ecf20Sopenharmony_ci	[FC_RCTL_DD_SOL_DATA] =		"sol data",			\
1118c2ecf20Sopenharmony_ci	[FC_RCTL_DD_UNSOL_CTL] =	"unsol ctl",			\
1128c2ecf20Sopenharmony_ci	[FC_RCTL_DD_SOL_CTL] =		"sol ctl/reply",		\
1138c2ecf20Sopenharmony_ci	[FC_RCTL_DD_UNSOL_DATA] =	"unsol data",			\
1148c2ecf20Sopenharmony_ci	[FC_RCTL_DD_DATA_DESC] =	"data desc",			\
1158c2ecf20Sopenharmony_ci	[FC_RCTL_DD_UNSOL_CMD] =	"unsol cmd",			\
1168c2ecf20Sopenharmony_ci	[FC_RCTL_DD_CMD_STATUS] =	"cmd status",			\
1178c2ecf20Sopenharmony_ci	[FC_RCTL_ELS_REQ] =		"ELS req",			\
1188c2ecf20Sopenharmony_ci	[FC_RCTL_ELS_REP] =		"ELS rep",			\
1198c2ecf20Sopenharmony_ci	[FC_RCTL_ELS4_REQ] =		"FC-4 ELS req",			\
1208c2ecf20Sopenharmony_ci	[FC_RCTL_ELS4_REP] =		"FC-4 ELS rep",			\
1218c2ecf20Sopenharmony_ci	[FC_RCTL_BA_NOP] =		"BLS NOP",			\
1228c2ecf20Sopenharmony_ci	[FC_RCTL_BA_ABTS] =		"BLS abort",			\
1238c2ecf20Sopenharmony_ci	[FC_RCTL_BA_RMC] =		"BLS remove connection",	\
1248c2ecf20Sopenharmony_ci	[FC_RCTL_BA_ACC] =		"BLS accept",			\
1258c2ecf20Sopenharmony_ci	[FC_RCTL_BA_RJT] =		"BLS reject",			\
1268c2ecf20Sopenharmony_ci	[FC_RCTL_BA_PRMT] =		"BLS dedicated connection preempted", \
1278c2ecf20Sopenharmony_ci	[FC_RCTL_ACK_1] =		"LC ACK_1",			\
1288c2ecf20Sopenharmony_ci	[FC_RCTL_ACK_0] =		"LC ACK_0",			\
1298c2ecf20Sopenharmony_ci	[FC_RCTL_P_RJT] =		"LC port reject",		\
1308c2ecf20Sopenharmony_ci	[FC_RCTL_F_RJT] =		"LC fabric reject",		\
1318c2ecf20Sopenharmony_ci	[FC_RCTL_P_BSY] =		"LC port busy",			\
1328c2ecf20Sopenharmony_ci	[FC_RCTL_F_BSY] =		"LC fabric busy to data frame",	\
1338c2ecf20Sopenharmony_ci	[FC_RCTL_F_BSYL] =		"LC fabric busy to link control frame",\
1348c2ecf20Sopenharmony_ci	[FC_RCTL_LCR] =			"LC link credit reset",		\
1358c2ecf20Sopenharmony_ci	[FC_RCTL_END] =			"LC end",			\
1368c2ecf20Sopenharmony_ci}
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_ci/*
1398c2ecf20Sopenharmony_ci * Well-known fabric addresses.
1408c2ecf20Sopenharmony_ci */
1418c2ecf20Sopenharmony_cienum fc_well_known_fid {
1428c2ecf20Sopenharmony_ci	FC_FID_NONE =           0x000000,       /* No destination */
1438c2ecf20Sopenharmony_ci	FC_FID_BCAST =		0xffffff,	/* broadcast */
1448c2ecf20Sopenharmony_ci	FC_FID_FLOGI =		0xfffffe,	/* fabric login */
1458c2ecf20Sopenharmony_ci	FC_FID_FCTRL =		0xfffffd,	/* fabric controller */
1468c2ecf20Sopenharmony_ci	FC_FID_DIR_SERV =	0xfffffc,	/* directory server */
1478c2ecf20Sopenharmony_ci	FC_FID_TIME_SERV =	0xfffffb,	/* time server */
1488c2ecf20Sopenharmony_ci	FC_FID_MGMT_SERV =	0xfffffa,	/* management server */
1498c2ecf20Sopenharmony_ci	FC_FID_QOS =		0xfffff9,	/* QoS Facilitator */
1508c2ecf20Sopenharmony_ci	FC_FID_ALIASES =	0xfffff8,	/* alias server (FC-PH2) */
1518c2ecf20Sopenharmony_ci	FC_FID_SEC_KEY =	0xfffff7,	/* Security key dist. server */
1528c2ecf20Sopenharmony_ci	FC_FID_CLOCK =		0xfffff6,	/* clock synch server */
1538c2ecf20Sopenharmony_ci	FC_FID_MCAST_SERV =	0xfffff5,	/* multicast server */
1548c2ecf20Sopenharmony_ci};
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci#define	FC_FID_WELL_KNOWN_MAX	0xffffff /* highest well-known fabric ID */
1578c2ecf20Sopenharmony_ci#define	FC_FID_WELL_KNOWN_BASE	0xfffff5 /* start of well-known fabric ID */
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci/*
1608c2ecf20Sopenharmony_ci * Other well-known addresses, outside the above contiguous range.
1618c2ecf20Sopenharmony_ci */
1628c2ecf20Sopenharmony_ci#define	FC_FID_DOM_MGR		0xfffc00	/* domain manager base */
1638c2ecf20Sopenharmony_ci
1648c2ecf20Sopenharmony_ci/*
1658c2ecf20Sopenharmony_ci * Fabric ID bytes.
1668c2ecf20Sopenharmony_ci */
1678c2ecf20Sopenharmony_ci#define	FC_FID_DOMAIN		0
1688c2ecf20Sopenharmony_ci#define	FC_FID_PORT		1
1698c2ecf20Sopenharmony_ci#define	FC_FID_LINK		2
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/*
1728c2ecf20Sopenharmony_ci * fh_type codes
1738c2ecf20Sopenharmony_ci */
1748c2ecf20Sopenharmony_cienum fc_fh_type {
1758c2ecf20Sopenharmony_ci	FC_TYPE_BLS =	0x00,	/* basic link service */
1768c2ecf20Sopenharmony_ci	FC_TYPE_ELS =	0x01,	/* extended link service */
1778c2ecf20Sopenharmony_ci	FC_TYPE_IP =	0x05,	/* IP over FC, RFC 4338 */
1788c2ecf20Sopenharmony_ci	FC_TYPE_FCP =	0x08,	/* SCSI FCP */
1798c2ecf20Sopenharmony_ci	FC_TYPE_CT =	0x20,	/* Fibre Channel Services (FC-CT) */
1808c2ecf20Sopenharmony_ci	FC_TYPE_ILS =	0x22,	/* internal link service */
1818c2ecf20Sopenharmony_ci	FC_TYPE_NVME =	0x28,	/* FC-NVME */
1828c2ecf20Sopenharmony_ci};
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci/*
1858c2ecf20Sopenharmony_ci * FC_TYPE names initializer.
1868c2ecf20Sopenharmony_ci * Please keep this matching the above definitions.
1878c2ecf20Sopenharmony_ci */
1888c2ecf20Sopenharmony_ci#define FC_TYPE_NAMES_INIT {				\
1898c2ecf20Sopenharmony_ci	[FC_TYPE_BLS] =		"BLS",			\
1908c2ecf20Sopenharmony_ci	[FC_TYPE_ELS] =		"ELS",			\
1918c2ecf20Sopenharmony_ci	[FC_TYPE_IP] =		"IP",			\
1928c2ecf20Sopenharmony_ci	[FC_TYPE_FCP] =		"FCP",			\
1938c2ecf20Sopenharmony_ci	[FC_TYPE_CT] =		"CT",			\
1948c2ecf20Sopenharmony_ci	[FC_TYPE_ILS] =		"ILS",			\
1958c2ecf20Sopenharmony_ci	[FC_TYPE_NVME] =	"NVME",			\
1968c2ecf20Sopenharmony_ci}
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_ci/*
1998c2ecf20Sopenharmony_ci * Exchange IDs.
2008c2ecf20Sopenharmony_ci */
2018c2ecf20Sopenharmony_ci#define FC_XID_UNKNOWN  0xffff	/* unknown exchange ID */
2028c2ecf20Sopenharmony_ci#define FC_XID_MIN	0x0	/* supported min exchange ID */
2038c2ecf20Sopenharmony_ci#define FC_XID_MAX	0xfffe	/* supported max exchange ID */
2048c2ecf20Sopenharmony_ci
2058c2ecf20Sopenharmony_ci/*
2068c2ecf20Sopenharmony_ci * fh_f_ctl - Frame control flags.
2078c2ecf20Sopenharmony_ci */
2088c2ecf20Sopenharmony_ci#define	FC_FC_EX_CTX	(1 << 23)	/* sent by responder to exchange */
2098c2ecf20Sopenharmony_ci#define	FC_FC_SEQ_CTX	(1 << 22)	/* sent by responder to sequence */
2108c2ecf20Sopenharmony_ci#define	FC_FC_FIRST_SEQ (1 << 21)	/* first sequence of this exchange */
2118c2ecf20Sopenharmony_ci#define	FC_FC_LAST_SEQ	(1 << 20)	/* last sequence of this exchange */
2128c2ecf20Sopenharmony_ci#define	FC_FC_END_SEQ	(1 << 19)	/* last frame of sequence */
2138c2ecf20Sopenharmony_ci#define	FC_FC_END_CONN	(1 << 18)	/* end of class 1 connection pending */
2148c2ecf20Sopenharmony_ci#define	FC_FC_RES_B17	(1 << 17)	/* reserved */
2158c2ecf20Sopenharmony_ci#define	FC_FC_SEQ_INIT	(1 << 16)	/* transfer of sequence initiative */
2168c2ecf20Sopenharmony_ci#define	FC_FC_X_ID_REASS (1 << 15)	/* exchange ID has been changed */
2178c2ecf20Sopenharmony_ci#define	FC_FC_X_ID_INVAL (1 << 14)	/* exchange ID invalidated */
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci#define	FC_FC_ACK_1	(1 << 12)	/* 13:12 = 1: ACK_1 expected */
2208c2ecf20Sopenharmony_ci#define	FC_FC_ACK_N	(2 << 12)	/* 13:12 = 2: ACK_N expected */
2218c2ecf20Sopenharmony_ci#define	FC_FC_ACK_0	(3 << 12)	/* 13:12 = 3: ACK_0 expected */
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci#define	FC_FC_RES_B11	(1 << 11)	/* reserved */
2248c2ecf20Sopenharmony_ci#define	FC_FC_RES_B10	(1 << 10)	/* reserved */
2258c2ecf20Sopenharmony_ci#define	FC_FC_RETX_SEQ	(1 << 9)	/* retransmitted sequence */
2268c2ecf20Sopenharmony_ci#define	FC_FC_UNI_TX	(1 << 8)	/* unidirectional transmit (class 1) */
2278c2ecf20Sopenharmony_ci#define	FC_FC_CONT_SEQ(i) ((i) << 6)
2288c2ecf20Sopenharmony_ci#define	FC_FC_ABT_SEQ(i) ((i) << 4)
2298c2ecf20Sopenharmony_ci#define	FC_FC_REL_OFF	(1 << 3)	/* parameter is relative offset */
2308c2ecf20Sopenharmony_ci#define	FC_FC_RES2	(1 << 2)	/* reserved */
2318c2ecf20Sopenharmony_ci#define	FC_FC_FILL(i)	((i) & 3)	/* 1:0: bytes of trailing fill */
2328c2ecf20Sopenharmony_ci
2338c2ecf20Sopenharmony_ci/*
2348c2ecf20Sopenharmony_ci * BA_ACC payload.
2358c2ecf20Sopenharmony_ci */
2368c2ecf20Sopenharmony_cistruct fc_ba_acc {
2378c2ecf20Sopenharmony_ci	__u8		ba_seq_id_val;	/* SEQ_ID validity */
2388c2ecf20Sopenharmony_ci#define FC_BA_SEQ_ID_VAL 0x80
2398c2ecf20Sopenharmony_ci	__u8		ba_seq_id;	/* SEQ_ID of seq last deliverable */
2408c2ecf20Sopenharmony_ci	__u8		ba_resvd[2];	/* reserved */
2418c2ecf20Sopenharmony_ci	__be16		ba_ox_id;	/* OX_ID for aborted seq or exch */
2428c2ecf20Sopenharmony_ci	__be16		ba_rx_id;	/* RX_ID for aborted seq or exch */
2438c2ecf20Sopenharmony_ci	__be16		ba_low_seq_cnt;	/* low SEQ_CNT of aborted seq */
2448c2ecf20Sopenharmony_ci	__be16		ba_high_seq_cnt; /* high SEQ_CNT of aborted seq */
2458c2ecf20Sopenharmony_ci};
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci/*
2488c2ecf20Sopenharmony_ci * BA_RJT: Basic Reject payload.
2498c2ecf20Sopenharmony_ci */
2508c2ecf20Sopenharmony_cistruct fc_ba_rjt {
2518c2ecf20Sopenharmony_ci	__u8		br_resvd;	/* reserved */
2528c2ecf20Sopenharmony_ci	__u8		br_reason;	/* reason code */
2538c2ecf20Sopenharmony_ci	__u8		br_explan;	/* reason explanation */
2548c2ecf20Sopenharmony_ci	__u8		br_vendor;	/* vendor unique code */
2558c2ecf20Sopenharmony_ci};
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci/*
2588c2ecf20Sopenharmony_ci * BA_RJT reason codes.
2598c2ecf20Sopenharmony_ci * From FS-2.
2608c2ecf20Sopenharmony_ci */
2618c2ecf20Sopenharmony_cienum fc_ba_rjt_reason {
2628c2ecf20Sopenharmony_ci	FC_BA_RJT_NONE =	0,	/* in software this means no reject */
2638c2ecf20Sopenharmony_ci	FC_BA_RJT_INVL_CMD =	0x01,	/* invalid command code */
2648c2ecf20Sopenharmony_ci	FC_BA_RJT_LOG_ERR =	0x03,	/* logical error */
2658c2ecf20Sopenharmony_ci	FC_BA_RJT_LOG_BUSY =	0x05,	/* logical busy */
2668c2ecf20Sopenharmony_ci	FC_BA_RJT_PROTO_ERR =	0x07,	/* protocol error */
2678c2ecf20Sopenharmony_ci	FC_BA_RJT_UNABLE =	0x09,	/* unable to perform request */
2688c2ecf20Sopenharmony_ci	FC_BA_RJT_VENDOR =	0xff,	/* vendor-specific (see br_vendor) */
2698c2ecf20Sopenharmony_ci};
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci/*
2728c2ecf20Sopenharmony_ci * BA_RJT reason code explanations.
2738c2ecf20Sopenharmony_ci */
2748c2ecf20Sopenharmony_cienum fc_ba_rjt_explan {
2758c2ecf20Sopenharmony_ci	FC_BA_RJT_EXP_NONE =	0x00,	/* no additional expanation */
2768c2ecf20Sopenharmony_ci	FC_BA_RJT_INV_XID =	0x03,	/* invalid OX_ID-RX_ID combination */
2778c2ecf20Sopenharmony_ci	FC_BA_RJT_ABT =		0x05,	/* sequence aborted, no seq info */
2788c2ecf20Sopenharmony_ci};
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci/*
2818c2ecf20Sopenharmony_ci * P_RJT or F_RJT: Port Reject or Fabric Reject parameter field.
2828c2ecf20Sopenharmony_ci */
2838c2ecf20Sopenharmony_cistruct fc_pf_rjt {
2848c2ecf20Sopenharmony_ci	__u8		rj_action;	/* reserved */
2858c2ecf20Sopenharmony_ci	__u8		rj_reason;	/* reason code */
2868c2ecf20Sopenharmony_ci	__u8		rj_resvd;	/* reserved */
2878c2ecf20Sopenharmony_ci	__u8		rj_vendor;	/* vendor unique code */
2888c2ecf20Sopenharmony_ci};
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci/*
2918c2ecf20Sopenharmony_ci * P_RJT and F_RJT reject reason codes.
2928c2ecf20Sopenharmony_ci */
2938c2ecf20Sopenharmony_cienum fc_pf_rjt_reason {
2948c2ecf20Sopenharmony_ci	FC_RJT_NONE =		0,	/* non-reject (reserved by standard) */
2958c2ecf20Sopenharmony_ci	FC_RJT_INVL_DID =	0x01,	/* invalid destination ID */
2968c2ecf20Sopenharmony_ci	FC_RJT_INVL_SID =	0x02,	/* invalid source ID */
2978c2ecf20Sopenharmony_ci	FC_RJT_P_UNAV_T =	0x03,	/* port unavailable, temporary */
2988c2ecf20Sopenharmony_ci	FC_RJT_P_UNAV =		0x04,	/* port unavailable, permanent */
2998c2ecf20Sopenharmony_ci	FC_RJT_CLS_UNSUP =	0x05,	/* class not supported */
3008c2ecf20Sopenharmony_ci	FC_RJT_DEL_USAGE =	0x06,	/* delimiter usage error */
3018c2ecf20Sopenharmony_ci	FC_RJT_TYPE_UNSUP =	0x07,	/* type not supported */
3028c2ecf20Sopenharmony_ci	FC_RJT_LINK_CTL =	0x08,	/* invalid link control */
3038c2ecf20Sopenharmony_ci	FC_RJT_R_CTL =		0x09,	/* invalid R_CTL field */
3048c2ecf20Sopenharmony_ci	FC_RJT_F_CTL =		0x0a,	/* invalid F_CTL field */
3058c2ecf20Sopenharmony_ci	FC_RJT_OX_ID =		0x0b,	/* invalid originator exchange ID */
3068c2ecf20Sopenharmony_ci	FC_RJT_RX_ID =		0x0c,	/* invalid responder exchange ID */
3078c2ecf20Sopenharmony_ci	FC_RJT_SEQ_ID =		0x0d,	/* invalid sequence ID */
3088c2ecf20Sopenharmony_ci	FC_RJT_DF_CTL =		0x0e,	/* invalid DF_CTL field */
3098c2ecf20Sopenharmony_ci	FC_RJT_SEQ_CNT =	0x0f,	/* invalid SEQ_CNT field */
3108c2ecf20Sopenharmony_ci	FC_RJT_PARAM =		0x10,	/* invalid parameter field */
3118c2ecf20Sopenharmony_ci	FC_RJT_EXCH_ERR =	0x11,	/* exchange error */
3128c2ecf20Sopenharmony_ci	FC_RJT_PROTO =		0x12,	/* protocol error */
3138c2ecf20Sopenharmony_ci	FC_RJT_LEN =		0x13,	/* incorrect length */
3148c2ecf20Sopenharmony_ci	FC_RJT_UNEXP_ACK =	0x14,	/* unexpected ACK */
3158c2ecf20Sopenharmony_ci	FC_RJT_FAB_CLASS =	0x15,	/* class unsupported by fabric entity */
3168c2ecf20Sopenharmony_ci	FC_RJT_LOGI_REQ =	0x16,	/* login required */
3178c2ecf20Sopenharmony_ci	FC_RJT_SEQ_XS =		0x17,	/* excessive sequences attempted */
3188c2ecf20Sopenharmony_ci	FC_RJT_EXCH_EST =	0x18,	/* unable to establish exchange */
3198c2ecf20Sopenharmony_ci	FC_RJT_FAB_UNAV =	0x1a,	/* fabric unavailable */
3208c2ecf20Sopenharmony_ci	FC_RJT_VC_ID =		0x1b,	/* invalid VC_ID (class 4) */
3218c2ecf20Sopenharmony_ci	FC_RJT_CS_CTL =		0x1c,	/* invalid CS_CTL field */
3228c2ecf20Sopenharmony_ci	FC_RJT_INSUF_RES =	0x1d,	/* insuff. resources for VC (Class 4) */
3238c2ecf20Sopenharmony_ci	FC_RJT_INVL_CLS =	0x1f,	/* invalid class of service */
3248c2ecf20Sopenharmony_ci	FC_RJT_PREEMT_RJT =	0x20,	/* preemption request rejected */
3258c2ecf20Sopenharmony_ci	FC_RJT_PREEMT_DIS =	0x21,	/* preemption not enabled */
3268c2ecf20Sopenharmony_ci	FC_RJT_MCAST_ERR =	0x22,	/* multicast error */
3278c2ecf20Sopenharmony_ci	FC_RJT_MCAST_ET =	0x23,	/* multicast error terminate */
3288c2ecf20Sopenharmony_ci	FC_RJT_PRLI_REQ =	0x24,	/* process login required */
3298c2ecf20Sopenharmony_ci	FC_RJT_INVL_ATT =	0x25,	/* invalid attachment */
3308c2ecf20Sopenharmony_ci	FC_RJT_VENDOR =		0xff,	/* vendor specific reject */
3318c2ecf20Sopenharmony_ci};
3328c2ecf20Sopenharmony_ci
3338c2ecf20Sopenharmony_ci/* default timeout values */
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci#define FC_DEF_E_D_TOV	2000UL
3368c2ecf20Sopenharmony_ci#define FC_DEF_R_A_TOV	10000UL
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#endif /* _FC_FS_H_ */
339