Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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> |
| 22 | struct fc_frame_header { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 23 | __u8 fh_r_ctl; |
| 24 | __u8 fh_d_id[3]; |
| 25 | __u8 fh_cs_ctl; |
| 26 | __u8 fh_s_id[3]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 27 | __u8 fh_type; |
| 28 | __u8 fh_f_ctl[3]; |
| 29 | __u8 fh_seq_id; |
| 30 | __u8 fh_df_ctl; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 31 | __be16 fh_seq_cnt; |
| 32 | __be16 fh_ox_id; |
| 33 | __be16 fh_rx_id; |
| 34 | __be32 fh_parm_offset; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | }; |
| 36 | #define FC_FRAME_HEADER_LEN 24 |
| 37 | #define FC_MAX_PAYLOAD 2112U |
| 38 | #define FC_MIN_MAX_PAYLOAD 256U |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
| 41 | enum fc_rctl { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | FC_RCTL_DD_UNCAT = 0x00, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 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, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 47 | FC_RCTL_DD_DATA_DESC = 0x05, |
| 48 | FC_RCTL_DD_UNSOL_CMD = 0x06, |
| 49 | FC_RCTL_DD_CMD_STATUS = 0x07, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 50 | #define FC_RCTL_ILS_REQ FC_RCTL_DD_UNSOL_CTL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define FC_RCTL_ILS_REP FC_RCTL_DD_SOL_CTL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | FC_RCTL_ELS_REQ = 0x22, |
| 53 | FC_RCTL_ELS_REP = 0x23, |
| 54 | FC_RCTL_ELS4_REQ = 0x32, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 55 | FC_RCTL_ELS4_REP = 0x33, |
| 56 | FC_RCTL_VFTH = 0x50, |
| 57 | FC_RCTL_IFRH = 0x51, |
| 58 | FC_RCTL_ENCH = 0x52, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | FC_RCTL_BA_NOP = 0x80, |
| 60 | FC_RCTL_BA_ABTS = 0x81, |
| 61 | FC_RCTL_BA_RMC = 0x82, |
| 62 | FC_RCTL_BA_ACC = 0x84, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 63 | FC_RCTL_BA_RJT = 0x85, |
| 64 | FC_RCTL_BA_PRMT = 0x86, |
| 65 | FC_RCTL_ACK_1 = 0xc0, |
| 66 | FC_RCTL_ACK_0 = 0xc1, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | FC_RCTL_P_RJT = 0xc2, |
| 68 | FC_RCTL_F_RJT = 0xc3, |
| 69 | FC_RCTL_P_BSY = 0xc4, |
| 70 | FC_RCTL_F_BSY = 0xc5, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | FC_RCTL_F_BSYL = 0xc6, |
| 72 | FC_RCTL_LCR = 0xc7, |
| 73 | FC_RCTL_END = 0xc9, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 74 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 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 | } |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | enum fc_well_known_fid { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 78 | FC_FID_NONE = 0x000000, |
| 79 | FC_FID_BCAST = 0xffffff, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | FC_FID_FLOGI = 0xfffffe, |
| 81 | FC_FID_FCTRL = 0xfffffd, |
| 82 | FC_FID_DIR_SERV = 0xfffffc, |
| 83 | FC_FID_TIME_SERV = 0xfffffb, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | FC_FID_MGMT_SERV = 0xfffffa, |
| 85 | FC_FID_QOS = 0xfffff9, |
| 86 | FC_FID_ALIASES = 0xfffff8, |
| 87 | FC_FID_SEC_KEY = 0xfffff7, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | FC_FID_CLOCK = 0xfffff6, |
| 89 | FC_FID_MCAST_SERV = 0xfffff5, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 90 | }; |
| 91 | #define FC_FID_WELL_KNOWN_MAX 0xffffff |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | #define FC_FID_LINK 2 |
| 97 | enum fc_fh_type { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 98 | FC_TYPE_BLS = 0x00, |
| 99 | FC_TYPE_ELS = 0x01, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 100 | FC_TYPE_IP = 0x05, |
| 101 | FC_TYPE_FCP = 0x08, |
| 102 | FC_TYPE_CT = 0x20, |
| 103 | FC_TYPE_ILS = 0x22, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 104 | FC_TYPE_NVME = 0x28, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 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", \ |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | } |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 108 | #define FC_XID_UNKNOWN 0xffff |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 109 | #define FC_XID_MIN 0x0 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 110 | #define FC_XID_MAX 0xfffe |
| 111 | #define FC_FC_EX_CTX (1 << 23) |
| 112 | #define FC_FC_SEQ_CTX (1 << 22) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 113 | #define FC_FC_FIRST_SEQ (1 << 21) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 114 | #define FC_FC_LAST_SEQ (1 << 20) |
| 115 | #define FC_FC_END_SEQ (1 << 19) |
| 116 | #define FC_FC_END_CONN (1 << 18) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 117 | #define FC_FC_RES_B17 (1 << 17) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 121 | #define FC_FC_ACK_1 (1 << 12) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 122 | #define FC_FC_ACK_N (2 << 12) |
| 123 | #define FC_FC_ACK_0 (3 << 12) |
| 124 | #define FC_FC_RES_B11 (1 << 11) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 125 | #define FC_FC_RES_B10 (1 << 10) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 129 | #define FC_FC_ABT_SEQ(i) ((i) << 4) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 130 | #define FC_FC_REL_OFF (1 << 3) |
| 131 | #define FC_FC_RES2 (1 << 2) |
| 132 | #define FC_FC_FILL(i) ((i) & 3) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 133 | struct fc_ba_acc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 134 | __u8 ba_seq_id_val; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 135 | #define FC_BA_SEQ_ID_VAL 0x80 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 136 | __u8 ba_seq_id; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 137 | __u8 ba_resvd[2]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 138 | __be16 ba_ox_id; |
| 139 | __be16 ba_rx_id; |
| 140 | __be16 ba_low_seq_cnt; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 141 | __be16 ba_high_seq_cnt; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 142 | }; |
| 143 | struct fc_ba_rjt { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 144 | __u8 br_resvd; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 145 | __u8 br_reason; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 146 | __u8 br_explan; |
| 147 | __u8 br_vendor; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 148 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 149 | enum fc_ba_rjt_reason { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 150 | FC_BA_RJT_NONE = 0, |
| 151 | FC_BA_RJT_INVL_CMD = 0x01, |
| 152 | FC_BA_RJT_LOG_ERR = 0x03, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 153 | FC_BA_RJT_LOG_BUSY = 0x05, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 154 | FC_BA_RJT_PROTO_ERR = 0x07, |
| 155 | FC_BA_RJT_UNABLE = 0x09, |
| 156 | FC_BA_RJT_VENDOR = 0xff, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 157 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 158 | enum fc_ba_rjt_explan { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | FC_BA_RJT_EXP_NONE = 0x00, |
| 160 | FC_BA_RJT_INV_XID = 0x03, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 161 | FC_BA_RJT_ABT = 0x05, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 162 | }; |
| 163 | struct fc_pf_rjt { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 164 | __u8 rj_action; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 165 | __u8 rj_reason; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 166 | __u8 rj_resvd; |
| 167 | __u8 rj_vendor; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 168 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 169 | enum fc_pf_rjt_reason { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 170 | FC_RJT_NONE = 0, |
| 171 | FC_RJT_INVL_DID = 0x01, |
| 172 | FC_RJT_INVL_SID = 0x02, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 173 | FC_RJT_P_UNAV_T = 0x03, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 174 | FC_RJT_P_UNAV = 0x04, |
| 175 | FC_RJT_CLS_UNSUP = 0x05, |
| 176 | FC_RJT_DEL_USAGE = 0x06, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 177 | FC_RJT_TYPE_UNSUP = 0x07, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 178 | FC_RJT_LINK_CTL = 0x08, |
| 179 | FC_RJT_R_CTL = 0x09, |
| 180 | FC_RJT_F_CTL = 0x0a, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 181 | FC_RJT_OX_ID = 0x0b, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 182 | FC_RJT_RX_ID = 0x0c, |
| 183 | FC_RJT_SEQ_ID = 0x0d, |
| 184 | FC_RJT_DF_CTL = 0x0e, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 185 | FC_RJT_SEQ_CNT = 0x0f, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 186 | FC_RJT_PARAM = 0x10, |
| 187 | FC_RJT_EXCH_ERR = 0x11, |
| 188 | FC_RJT_PROTO = 0x12, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 189 | FC_RJT_LEN = 0x13, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 190 | FC_RJT_UNEXP_ACK = 0x14, |
| 191 | FC_RJT_FAB_CLASS = 0x15, |
| 192 | FC_RJT_LOGI_REQ = 0x16, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 193 | FC_RJT_SEQ_XS = 0x17, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 194 | FC_RJT_EXCH_EST = 0x18, |
| 195 | FC_RJT_FAB_UNAV = 0x1a, |
| 196 | FC_RJT_VC_ID = 0x1b, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 197 | FC_RJT_CS_CTL = 0x1c, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 198 | FC_RJT_INSUF_RES = 0x1d, |
| 199 | FC_RJT_INVL_CLS = 0x1f, |
| 200 | FC_RJT_PREEMT_RJT = 0x20, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 201 | FC_RJT_PREEMT_DIS = 0x21, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 202 | FC_RJT_MCAST_ERR = 0x22, |
| 203 | FC_RJT_MCAST_ET = 0x23, |
| 204 | FC_RJT_PRLI_REQ = 0x24, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 205 | FC_RJT_INVL_ATT = 0x25, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 206 | FC_RJT_VENDOR = 0xff, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 207 | }; |
| 208 | #define FC_DEF_E_D_TOV 2000UL |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 209 | #define FC_DEF_R_A_TOV 10000UL |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 210 | #endif |