xref: /aosp_15_r20/bionic/libc/kernel/uapi/scsi/fc/fc_fs.h (revision 8d67ca893c1523eb926b9080dbe4e2ffd2a27ba1)
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _FC_FS_H_
8 #define _FC_FS_H_
9 #include <linux/types.h>
10 struct fc_frame_header {
11   __u8 fh_r_ctl;
12   __u8 fh_d_id[3];
13   __u8 fh_cs_ctl;
14   __u8 fh_s_id[3];
15   __u8 fh_type;
16   __u8 fh_f_ctl[3];
17   __u8 fh_seq_id;
18   __u8 fh_df_ctl;
19   __be16 fh_seq_cnt;
20   __be16 fh_ox_id;
21   __be16 fh_rx_id;
22   __be32 fh_parm_offset;
23 };
24 #define FC_FRAME_HEADER_LEN 24
25 #define FC_MAX_PAYLOAD 2112U
26 #define FC_MIN_MAX_PAYLOAD 256U
27 #define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
28 #define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
29 enum fc_rctl {
30   FC_RCTL_DD_UNCAT = 0x00,
31   FC_RCTL_DD_SOL_DATA = 0x01,
32   FC_RCTL_DD_UNSOL_CTL = 0x02,
33   FC_RCTL_DD_SOL_CTL = 0x03,
34   FC_RCTL_DD_UNSOL_DATA = 0x04,
35   FC_RCTL_DD_DATA_DESC = 0x05,
36   FC_RCTL_DD_UNSOL_CMD = 0x06,
37   FC_RCTL_DD_CMD_STATUS = 0x07,
38 #define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL
39 #define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL
40   FC_RCTL_ELS_REQ = 0x22,
41   FC_RCTL_ELS_REP = 0x23,
42   FC_RCTL_ELS4_REQ = 0x32,
43   FC_RCTL_ELS4_REP = 0x33,
44   FC_RCTL_VFTH = 0x50,
45   FC_RCTL_IFRH = 0x51,
46   FC_RCTL_ENCH = 0x52,
47   FC_RCTL_BA_NOP = 0x80,
48   FC_RCTL_BA_ABTS = 0x81,
49   FC_RCTL_BA_RMC = 0x82,
50   FC_RCTL_BA_ACC = 0x84,
51   FC_RCTL_BA_RJT = 0x85,
52   FC_RCTL_BA_PRMT = 0x86,
53   FC_RCTL_ACK_1 = 0xc0,
54   FC_RCTL_ACK_0 = 0xc1,
55   FC_RCTL_P_RJT = 0xc2,
56   FC_RCTL_F_RJT = 0xc3,
57   FC_RCTL_P_BSY = 0xc4,
58   FC_RCTL_F_BSY = 0xc5,
59   FC_RCTL_F_BSYL = 0xc6,
60   FC_RCTL_LCR = 0xc7,
61   FC_RCTL_END = 0xc9,
62 };
63 #define FC_RCTL_NAMES_INIT {[FC_RCTL_DD_UNCAT] = "uncat",[FC_RCTL_DD_SOL_DATA] = "sol data",[FC_RCTL_DD_UNSOL_CTL] = "unsol ctl",[FC_RCTL_DD_SOL_CTL] = "sol ctl/reply",[FC_RCTL_DD_UNSOL_DATA] = "unsol data",[FC_RCTL_DD_DATA_DESC] = "data desc",[FC_RCTL_DD_UNSOL_CMD] = "unsol cmd",[FC_RCTL_DD_CMD_STATUS] = "cmd status",[FC_RCTL_ELS_REQ] = "ELS req",[FC_RCTL_ELS_REP] = "ELS rep",[FC_RCTL_ELS4_REQ] = "FC-4 ELS req",[FC_RCTL_ELS4_REP] = "FC-4 ELS rep",[FC_RCTL_BA_NOP] = "BLS NOP",[FC_RCTL_BA_ABTS] = "BLS abort",[FC_RCTL_BA_RMC] = "BLS remove connection",[FC_RCTL_BA_ACC] = "BLS accept",[FC_RCTL_BA_RJT] = "BLS reject",[FC_RCTL_BA_PRMT] = "BLS dedicated connection preempted",[FC_RCTL_ACK_1] = "LC ACK_1",[FC_RCTL_ACK_0] = "LC ACK_0",[FC_RCTL_P_RJT] = "LC port reject",[FC_RCTL_F_RJT] = "LC fabric reject",[FC_RCTL_P_BSY] = "LC port busy",[FC_RCTL_F_BSY] = "LC fabric busy to data frame",[FC_RCTL_F_BSYL] = "LC fabric busy to link control frame",[FC_RCTL_LCR] = "LC link credit reset",[FC_RCTL_END] = "LC end", \
64 }
65 enum fc_well_known_fid {
66   FC_FID_NONE = 0x000000,
67   FC_FID_BCAST = 0xffffff,
68   FC_FID_FLOGI = 0xfffffe,
69   FC_FID_FCTRL = 0xfffffd,
70   FC_FID_DIR_SERV = 0xfffffc,
71   FC_FID_TIME_SERV = 0xfffffb,
72   FC_FID_MGMT_SERV = 0xfffffa,
73   FC_FID_QOS = 0xfffff9,
74   FC_FID_ALIASES = 0xfffff8,
75   FC_FID_SEC_KEY = 0xfffff7,
76   FC_FID_CLOCK = 0xfffff6,
77   FC_FID_MCAST_SERV = 0xfffff5,
78 };
79 #define FC_FID_WELL_KNOWN_MAX 0xffffff
80 #define FC_FID_WELL_KNOWN_BASE 0xfffff5
81 #define FC_FID_DOM_MGR 0xfffc00
82 #define FC_FID_DOMAIN 0
83 #define FC_FID_PORT 1
84 #define FC_FID_LINK 2
85 enum fc_fh_type {
86   FC_TYPE_BLS = 0x00,
87   FC_TYPE_ELS = 0x01,
88   FC_TYPE_IP = 0x05,
89   FC_TYPE_FCP = 0x08,
90   FC_TYPE_CT = 0x20,
91   FC_TYPE_ILS = 0x22,
92   FC_TYPE_NVME = 0x28,
93 };
94 #define FC_TYPE_NAMES_INIT {[FC_TYPE_BLS] = "BLS",[FC_TYPE_ELS] = "ELS",[FC_TYPE_IP] = "IP",[FC_TYPE_FCP] = "FCP",[FC_TYPE_CT] = "CT",[FC_TYPE_ILS] = "ILS",[FC_TYPE_NVME] = "NVME", \
95 }
96 #define FC_XID_UNKNOWN 0xffff
97 #define FC_XID_MIN 0x0
98 #define FC_XID_MAX 0xfffe
99 #define FC_FC_EX_CTX (1 << 23)
100 #define FC_FC_SEQ_CTX (1 << 22)
101 #define FC_FC_FIRST_SEQ (1 << 21)
102 #define FC_FC_LAST_SEQ (1 << 20)
103 #define FC_FC_END_SEQ (1 << 19)
104 #define FC_FC_END_CONN (1 << 18)
105 #define FC_FC_RES_B17 (1 << 17)
106 #define FC_FC_SEQ_INIT (1 << 16)
107 #define FC_FC_X_ID_REASS (1 << 15)
108 #define FC_FC_X_ID_INVAL (1 << 14)
109 #define FC_FC_ACK_1 (1 << 12)
110 #define FC_FC_ACK_N (2 << 12)
111 #define FC_FC_ACK_0 (3 << 12)
112 #define FC_FC_RES_B11 (1 << 11)
113 #define FC_FC_RES_B10 (1 << 10)
114 #define FC_FC_RETX_SEQ (1 << 9)
115 #define FC_FC_UNI_TX (1 << 8)
116 #define FC_FC_CONT_SEQ(i) ((i) << 6)
117 #define FC_FC_ABT_SEQ(i) ((i) << 4)
118 #define FC_FC_REL_OFF (1 << 3)
119 #define FC_FC_RES2 (1 << 2)
120 #define FC_FC_FILL(i) ((i) & 3)
121 struct fc_ba_acc {
122   __u8 ba_seq_id_val;
123 #define FC_BA_SEQ_ID_VAL 0x80
124   __u8 ba_seq_id;
125   __u8 ba_resvd[2];
126   __be16 ba_ox_id;
127   __be16 ba_rx_id;
128   __be16 ba_low_seq_cnt;
129   __be16 ba_high_seq_cnt;
130 };
131 struct fc_ba_rjt {
132   __u8 br_resvd;
133   __u8 br_reason;
134   __u8 br_explan;
135   __u8 br_vendor;
136 };
137 enum fc_ba_rjt_reason {
138   FC_BA_RJT_NONE = 0,
139   FC_BA_RJT_INVL_CMD = 0x01,
140   FC_BA_RJT_LOG_ERR = 0x03,
141   FC_BA_RJT_LOG_BUSY = 0x05,
142   FC_BA_RJT_PROTO_ERR = 0x07,
143   FC_BA_RJT_UNABLE = 0x09,
144   FC_BA_RJT_VENDOR = 0xff,
145 };
146 enum fc_ba_rjt_explan {
147   FC_BA_RJT_EXP_NONE = 0x00,
148   FC_BA_RJT_INV_XID = 0x03,
149   FC_BA_RJT_ABT = 0x05,
150 };
151 struct fc_pf_rjt {
152   __u8 rj_action;
153   __u8 rj_reason;
154   __u8 rj_resvd;
155   __u8 rj_vendor;
156 };
157 enum fc_pf_rjt_reason {
158   FC_RJT_NONE = 0,
159   FC_RJT_INVL_DID = 0x01,
160   FC_RJT_INVL_SID = 0x02,
161   FC_RJT_P_UNAV_T = 0x03,
162   FC_RJT_P_UNAV = 0x04,
163   FC_RJT_CLS_UNSUP = 0x05,
164   FC_RJT_DEL_USAGE = 0x06,
165   FC_RJT_TYPE_UNSUP = 0x07,
166   FC_RJT_LINK_CTL = 0x08,
167   FC_RJT_R_CTL = 0x09,
168   FC_RJT_F_CTL = 0x0a,
169   FC_RJT_OX_ID = 0x0b,
170   FC_RJT_RX_ID = 0x0c,
171   FC_RJT_SEQ_ID = 0x0d,
172   FC_RJT_DF_CTL = 0x0e,
173   FC_RJT_SEQ_CNT = 0x0f,
174   FC_RJT_PARAM = 0x10,
175   FC_RJT_EXCH_ERR = 0x11,
176   FC_RJT_PROTO = 0x12,
177   FC_RJT_LEN = 0x13,
178   FC_RJT_UNEXP_ACK = 0x14,
179   FC_RJT_FAB_CLASS = 0x15,
180   FC_RJT_LOGI_REQ = 0x16,
181   FC_RJT_SEQ_XS = 0x17,
182   FC_RJT_EXCH_EST = 0x18,
183   FC_RJT_FAB_UNAV = 0x1a,
184   FC_RJT_VC_ID = 0x1b,
185   FC_RJT_CS_CTL = 0x1c,
186   FC_RJT_INSUF_RES = 0x1d,
187   FC_RJT_INVL_CLS = 0x1f,
188   FC_RJT_PREEMT_RJT = 0x20,
189   FC_RJT_PREEMT_DIS = 0x21,
190   FC_RJT_MCAST_ERR = 0x22,
191   FC_RJT_MCAST_ET = 0x23,
192   FC_RJT_PRLI_REQ = 0x24,
193   FC_RJT_INVL_ATT = 0x25,
194   FC_RJT_VENDOR = 0xff,
195 };
196 #define FC_DEF_E_D_TOV 2000UL
197 #define FC_DEF_R_A_TOV 10000UL
198 #endif
199