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