1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _FC_FS_H_
20#define _FC_FS_H_
21#include <linux/types.h>
22struct fc_frame_header {
23  __u8 fh_r_ctl;
24  __u8 fh_d_id[3];
25  __u8 fh_cs_ctl;
26  __u8 fh_s_id[3];
27  __u8 fh_type;
28  __u8 fh_f_ctl[3];
29  __u8 fh_seq_id;
30  __u8 fh_df_ctl;
31  __be16 fh_seq_cnt;
32  __be16 fh_ox_id;
33  __be16 fh_rx_id;
34  __be32 fh_parm_offset;
35};
36#define FC_FRAME_HEADER_LEN 24
37#define FC_MAX_PAYLOAD 2112U
38#define FC_MIN_MAX_PAYLOAD 256U
39#define FC_MAX_FRAME (FC_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
40#define FC_MIN_MAX_FRAME (FC_MIN_MAX_PAYLOAD + FC_FRAME_HEADER_LEN)
41enum fc_rctl {
42  FC_RCTL_DD_UNCAT = 0x00,
43  FC_RCTL_DD_SOL_DATA = 0x01,
44  FC_RCTL_DD_UNSOL_CTL = 0x02,
45  FC_RCTL_DD_SOL_CTL = 0x03,
46  FC_RCTL_DD_UNSOL_DATA = 0x04,
47  FC_RCTL_DD_DATA_DESC = 0x05,
48  FC_RCTL_DD_UNSOL_CMD = 0x06,
49  FC_RCTL_DD_CMD_STATUS = 0x07,
50#define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL
51#define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL
52  FC_RCTL_ELS_REQ = 0x22,
53  FC_RCTL_ELS_REP = 0x23,
54  FC_RCTL_ELS4_REQ = 0x32,
55  FC_RCTL_ELS4_REP = 0x33,
56  FC_RCTL_VFTH = 0x50,
57  FC_RCTL_IFRH = 0x51,
58  FC_RCTL_ENCH = 0x52,
59  FC_RCTL_BA_NOP = 0x80,
60  FC_RCTL_BA_ABTS = 0x81,
61  FC_RCTL_BA_RMC = 0x82,
62  FC_RCTL_BA_ACC = 0x84,
63  FC_RCTL_BA_RJT = 0x85,
64  FC_RCTL_BA_PRMT = 0x86,
65  FC_RCTL_ACK_1 = 0xc0,
66  FC_RCTL_ACK_0 = 0xc1,
67  FC_RCTL_P_RJT = 0xc2,
68  FC_RCTL_F_RJT = 0xc3,
69  FC_RCTL_P_BSY = 0xc4,
70  FC_RCTL_F_BSY = 0xc5,
71  FC_RCTL_F_BSYL = 0xc6,
72  FC_RCTL_LCR = 0xc7,
73  FC_RCTL_END = 0xc9,
74};
75#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", \
76}
77enum fc_well_known_fid {
78  FC_FID_NONE = 0x000000,
79  FC_FID_BCAST = 0xffffff,
80  FC_FID_FLOGI = 0xfffffe,
81  FC_FID_FCTRL = 0xfffffd,
82  FC_FID_DIR_SERV = 0xfffffc,
83  FC_FID_TIME_SERV = 0xfffffb,
84  FC_FID_MGMT_SERV = 0xfffffa,
85  FC_FID_QOS = 0xfffff9,
86  FC_FID_ALIASES = 0xfffff8,
87  FC_FID_SEC_KEY = 0xfffff7,
88  FC_FID_CLOCK = 0xfffff6,
89  FC_FID_MCAST_SERV = 0xfffff5,
90};
91#define FC_FID_WELL_KNOWN_MAX 0xffffff
92#define FC_FID_WELL_KNOWN_BASE 0xfffff5
93#define FC_FID_DOM_MGR 0xfffc00
94#define FC_FID_DOMAIN 0
95#define FC_FID_PORT 1
96#define FC_FID_LINK 2
97enum fc_fh_type {
98  FC_TYPE_BLS = 0x00,
99  FC_TYPE_ELS = 0x01,
100  FC_TYPE_IP = 0x05,
101  FC_TYPE_FCP = 0x08,
102  FC_TYPE_CT = 0x20,
103  FC_TYPE_ILS = 0x22,
104  FC_TYPE_NVME = 0x28,
105};
106#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", \
107}
108#define FC_XID_UNKNOWN 0xffff
109#define FC_XID_MIN 0x0
110#define FC_XID_MAX 0xfffe
111#define FC_FC_EX_CTX (1 << 23)
112#define FC_FC_SEQ_CTX (1 << 22)
113#define FC_FC_FIRST_SEQ (1 << 21)
114#define FC_FC_LAST_SEQ (1 << 20)
115#define FC_FC_END_SEQ (1 << 19)
116#define FC_FC_END_CONN (1 << 18)
117#define FC_FC_RES_B17 (1 << 17)
118#define FC_FC_SEQ_INIT (1 << 16)
119#define FC_FC_X_ID_REASS (1 << 15)
120#define FC_FC_X_ID_INVAL (1 << 14)
121#define FC_FC_ACK_1 (1 << 12)
122#define FC_FC_ACK_N (2 << 12)
123#define FC_FC_ACK_0 (3 << 12)
124#define FC_FC_RES_B11 (1 << 11)
125#define FC_FC_RES_B10 (1 << 10)
126#define FC_FC_RETX_SEQ (1 << 9)
127#define FC_FC_UNI_TX (1 << 8)
128#define FC_FC_CONT_SEQ(i) ((i) << 6)
129#define FC_FC_ABT_SEQ(i) ((i) << 4)
130#define FC_FC_REL_OFF (1 << 3)
131#define FC_FC_RES2 (1 << 2)
132#define FC_FC_FILL(i) ((i) & 3)
133struct fc_ba_acc {
134  __u8 ba_seq_id_val;
135#define FC_BA_SEQ_ID_VAL 0x80
136  __u8 ba_seq_id;
137  __u8 ba_resvd[2];
138  __be16 ba_ox_id;
139  __be16 ba_rx_id;
140  __be16 ba_low_seq_cnt;
141  __be16 ba_high_seq_cnt;
142};
143struct fc_ba_rjt {
144  __u8 br_resvd;
145  __u8 br_reason;
146  __u8 br_explan;
147  __u8 br_vendor;
148};
149enum fc_ba_rjt_reason {
150  FC_BA_RJT_NONE = 0,
151  FC_BA_RJT_INVL_CMD = 0x01,
152  FC_BA_RJT_LOG_ERR = 0x03,
153  FC_BA_RJT_LOG_BUSY = 0x05,
154  FC_BA_RJT_PROTO_ERR = 0x07,
155  FC_BA_RJT_UNABLE = 0x09,
156  FC_BA_RJT_VENDOR = 0xff,
157};
158enum fc_ba_rjt_explan {
159  FC_BA_RJT_EXP_NONE = 0x00,
160  FC_BA_RJT_INV_XID = 0x03,
161  FC_BA_RJT_ABT = 0x05,
162};
163struct fc_pf_rjt {
164  __u8 rj_action;
165  __u8 rj_reason;
166  __u8 rj_resvd;
167  __u8 rj_vendor;
168};
169enum fc_pf_rjt_reason {
170  FC_RJT_NONE = 0,
171  FC_RJT_INVL_DID = 0x01,
172  FC_RJT_INVL_SID = 0x02,
173  FC_RJT_P_UNAV_T = 0x03,
174  FC_RJT_P_UNAV = 0x04,
175  FC_RJT_CLS_UNSUP = 0x05,
176  FC_RJT_DEL_USAGE = 0x06,
177  FC_RJT_TYPE_UNSUP = 0x07,
178  FC_RJT_LINK_CTL = 0x08,
179  FC_RJT_R_CTL = 0x09,
180  FC_RJT_F_CTL = 0x0a,
181  FC_RJT_OX_ID = 0x0b,
182  FC_RJT_RX_ID = 0x0c,
183  FC_RJT_SEQ_ID = 0x0d,
184  FC_RJT_DF_CTL = 0x0e,
185  FC_RJT_SEQ_CNT = 0x0f,
186  FC_RJT_PARAM = 0x10,
187  FC_RJT_EXCH_ERR = 0x11,
188  FC_RJT_PROTO = 0x12,
189  FC_RJT_LEN = 0x13,
190  FC_RJT_UNEXP_ACK = 0x14,
191  FC_RJT_FAB_CLASS = 0x15,
192  FC_RJT_LOGI_REQ = 0x16,
193  FC_RJT_SEQ_XS = 0x17,
194  FC_RJT_EXCH_EST = 0x18,
195  FC_RJT_FAB_UNAV = 0x1a,
196  FC_RJT_VC_ID = 0x1b,
197  FC_RJT_CS_CTL = 0x1c,
198  FC_RJT_INSUF_RES = 0x1d,
199  FC_RJT_INVL_CLS = 0x1f,
200  FC_RJT_PREEMT_RJT = 0x20,
201  FC_RJT_PREEMT_DIS = 0x21,
202  FC_RJT_MCAST_ERR = 0x22,
203  FC_RJT_MCAST_ET = 0x23,
204  FC_RJT_PRLI_REQ = 0x24,
205  FC_RJT_INVL_ATT = 0x25,
206  FC_RJT_VENDOR = 0xff,
207};
208#define FC_DEF_E_D_TOV 2000UL
209#define FC_DEF_R_A_TOV 10000UL
210#endif
211