9506 Want support for QLogic QL41000/45000 series devices
[unleashed.git] / usr / src / uts / common / io / qede / 579xx / hsi / mcp / nvm_iscsi_cfg.h
blobf9efbc3a7cb8a059686673ddf19d241e34ba4e84
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1, (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1, (the "License").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 /****************************************************************************
38 * Name: nvm_iscsi_cfg.h
40 * Description: NVM config file for iSCSI configurations
42 * Created: 04/11/2016
44 * Version: 0.2
46 ****************************************************************************/
48 #ifndef NVM_ISCSI_CFG_H
49 #define NVM_ISCSI_CFG_H
51 #define NUM_OF_ISCSI_TARGET_PER_PF 4 // Defined as per the ISCSI IBFT constraint
52 #define NUM_OF_ISCSI_PF_SUPPORTED 4 // One PF per Port - assuming 4 port card
54 #define NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN 256
56 union nvm_iscsi_dhcp_vendor_id
58 u32 value[NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN/4];
59 u8 byte[NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN];
62 #define NVM_ISCSI_IPV4_ADDR_BYTE_LEN 4
63 union nvm_iscsi_ipv4_addr
65 u32 addr;
66 u8 byte[NVM_ISCSI_IPV4_ADDR_BYTE_LEN];
69 #define NVM_ISCSI_IPV6_ADDR_BYTE_LEN 16
70 union nvm_iscsi_ipv6_addr
72 u32 addr[4];
73 u8 byte[NVM_ISCSI_IPV6_ADDR_BYTE_LEN];
76 struct nvm_iscsi_initiator_ipv4
78 union nvm_iscsi_ipv4_addr addr; /* 0x0 */
79 union nvm_iscsi_ipv4_addr subnet_mask; /* 0x4 */
80 union nvm_iscsi_ipv4_addr gateway; /* 0x8 */
81 union nvm_iscsi_ipv4_addr primary_dns; /* 0xC */
82 union nvm_iscsi_ipv4_addr secondary_dns; /* 0x10 */
83 union nvm_iscsi_ipv4_addr dhcp_addr; /* 0x14 */
85 union nvm_iscsi_ipv4_addr isns_server; /* 0x18 */
86 union nvm_iscsi_ipv4_addr slp_server; /* 0x1C */
87 union nvm_iscsi_ipv4_addr primay_radius_server; /* 0x20 */
88 union nvm_iscsi_ipv4_addr secondary_radius_server; /* 0x24 */
90 union nvm_iscsi_ipv4_addr rsvd[4]; /* 0x28 */
93 struct nvm_iscsi_initiator_ipv6
95 union nvm_iscsi_ipv6_addr addr; /* 0x0 */
96 union nvm_iscsi_ipv6_addr subnet_mask; /* 0x10 */
97 union nvm_iscsi_ipv6_addr gateway; /* 0x20 */
98 union nvm_iscsi_ipv6_addr primary_dns; /* 0x30 */
99 union nvm_iscsi_ipv6_addr secondary_dns; /* 0x40 */
100 union nvm_iscsi_ipv6_addr dhcp_addr; /* 0x50 */
102 union nvm_iscsi_ipv6_addr isns_server; /* 0x60 */
103 union nvm_iscsi_ipv6_addr slp_server; /* 0x70 */
104 union nvm_iscsi_ipv6_addr primay_radius_server; /* 0x80 */
105 union nvm_iscsi_ipv6_addr secondary_radius_server; /* 0x90 */
107 union nvm_iscsi_ipv6_addr rsvd[3]; /* 0xA0 */
109 u32 config; /* 0xD0 */
110 #define NVM_ISCSI_CFG_INITIATOR_IPV6_SUBNET_MASK_PREFIX_MASK 0x000000FF
111 #define NVM_ISCSI_CFG_INITIATOR_IPV6_SUBNET_MASK_PREFIX_OFFSET 0
113 u32 rsvd_1[3]; /* 0xD4 */
117 #define NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN 223
118 #define NVM_ISCSI_CFG_ISCSI_NAME_MAX_PLUS_RESERVED 256 // NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN + RESERVED for backward compatibility
120 union nvm_iscsi_name
122 u32 value[NVM_ISCSI_CFG_ISCSI_NAME_MAX_PLUS_RESERVED/4];
123 u8 byte[NVM_ISCSI_CFG_ISCSI_NAME_MAX_PLUS_RESERVED];
126 #define NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN 256
128 union nvm_iscsi_chap_name
130 u32 value[NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN/4];
131 u8 byte[NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN];
134 #define NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN 16
135 // md5 need per RFC1996 is 16 octets
136 union nvm_iscsi_chap_password
138 u32 value[NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN/4];
139 u8 byte[NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN];
142 union nvm_iscsi_lun
144 u8 byte[8];
145 u32 value[2];
149 struct nvm_iscsi_generic
151 u32 ctrl_flags; /* 0x0 */
152 #define NVM_ISCSI_CFG_GEN_CHAP_ENABLED (1 << 0)
153 #define NVM_ISCSI_CFG_GEN_DHCP_TCPIP_CONFIG_ENABLED (1 << 1)
154 #define NVM_ISCSI_CFG_GEN_DHCP_ISCSI_CONFIG_ENABLED (1 << 2)
155 #define NVM_ISCSI_CFG_GEN_IPV6_ENABLED (1 << 3)
156 #define NVM_ISCSI_CFG_GEN_IPV4_FALLBACK_ENABLED (1 << 4) // currently not supported
157 #define NVM_ISCSI_CFG_GEN_ISNS_WORLD_LOGIN (1 << 5)
158 #define NVM_ISCSI_CFG_GEN_ISNS_SELECTIVE_LOGIN (1 << 6)
159 #define NVM_ISCSI_CFG_GEN_ADDR_REDIRECT_ENABLED (1 << 7)
160 #define NVM_ISCSI_CFG_GEN_CHAP_MUTUAL_ENABLED (1 << 8)
162 u32 timeout; /* 0x4 */
163 #define NVM_ISCSI_CFG_GEN_DHCP_REQUEST_TIMEOUT_MASK 0x0000FFFF
164 #define NVM_ISCSI_CFG_GEN_DHCP_REQUEST_TIMEOUT_OFFSET 0
165 #define NVM_ISCSI_CFG_GEN_PORT_LOGIN_TIMEOUT_MASK 0xFFFF0000
166 #define NVM_ISCSI_CFG_GEN_PORT_LOGIN_TIMEOUT_OFFSET 16
168 union nvm_iscsi_dhcp_vendor_id dhcp_vendor_id; /* 0x8 */
169 u32 rsvd[62]; /* 0x108 */
172 struct nvm_iscsi_initiator
174 struct nvm_iscsi_initiator_ipv4 ipv4; /* 0x0 */
175 struct nvm_iscsi_initiator_ipv6 ipv6; /* 0x38 */
177 union nvm_iscsi_name initiator_name; /* 0x118 */
178 union nvm_iscsi_chap_name chap_name; /* 0x218 */
179 union nvm_iscsi_chap_password chap_password; /* 0x318 */
181 u32 generic_cont0; /* 0x328 */
182 #define NVM_ISCSI_CFG_INITIATOR_VLAN_MASK 0x0000FFFF
183 #define NVM_ISCSI_CFG_INITIATOR_VLAN_OFFSET 0
184 #define NVM_ISCSI_CFG_INITIATOR_RESERVED 0x00030000
186 u32 ctrl_flags;
187 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_PRIORITY_V6 (1 << 0)
188 #define NVM_ISCSI_CFG_INITIATOR_VLAN_ENABLED (1 << 1)
190 u32 ip_ver;
191 #define NVM_ISCSI_CFG_INITIATOR_IP_MASK 0x00000007
192 #define NVM_ISCSI_CFG_INITIATOR_IP_OFFSET 0
193 #define NVM_ISCSI_CFG_INITIATOR_IPV4 1
194 #define NVM_ISCSI_CFG_INITIATOR_IPV6 2
195 #define NVM_ISCSI_CFG_INITIATOR_IPV4_IPV6 4
197 u32 rsvd[115]; /* 0x32C */
201 struct nvm_iscsi_target
203 u32 ctrl_flags; /* 0x0 */
204 #define NVM_ISCSI_CFG_TARGET_ENABLED (1 << 0)
205 #define NVM_ISCSI_CFG_BOOT_TIME_LOGIN_STATUS (1 << 1)
207 u32 generic_cont0; /* 0x4 */
208 #define NVM_ISCSI_CFG_TARGET_TCP_PORT_MASK 0x0000FFFF
209 #define NVM_ISCSI_CFG_TARGET_TCP_PORT_OFFSET 0
211 u32 ip_ver;
212 #define NVM_ISCSI_CFG_TARGET_IP_MASK 0x00000007
213 #define NVM_ISCSI_CFG_TARGET_IP_OFFSET 0
214 #define NVM_ISCSI_CFG_TARGET_IPV4 NVM_ISCSI_CFG_INITIATOR_IPV4
215 #define NVM_ISCSI_CFG_TARGET_IPV6 NVM_ISCSI_CFG_INITIATOR_IPV6
216 #define NVM_ISCSI_CFG_TARGET_IPV4_IPV6 NVM_ISCSI_CFG_INITIATOR_IPV4_IPV6 // currently not supported
218 u32 rsvd_1[7]; /* 0x24 */
219 union nvm_iscsi_ipv4_addr ipv4_addr; /* 0x28 */
220 union nvm_iscsi_ipv6_addr ipv6_addr; /* 0x2C */
221 union nvm_iscsi_lun lun; /* 0x3C */
223 union nvm_iscsi_name target_name; /* 0x44 */
224 union nvm_iscsi_chap_name chap_name; /* 0x144 */
225 union nvm_iscsi_chap_password chap_password; /* 0x244 */
227 u32 rsvd_2[107]; /* 0x254 */
230 struct nvm_iscsi_block
232 u32 id; /* 0x0 */
233 #define NVM_ISCSI_CFG_BLK_MAPPED_PF_ID_MASK 0x0000000F
234 #define NVM_ISCSI_CFG_BLK_MAPPED_PF_ID_OFFSET 0
235 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_MASK 0x00000FF0
236 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_OFFSET 4
237 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_IS_NOT_EMPTY (1 << 0)
238 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_PF_MAPPED (1 << 1)
240 u32 rsvd_1[5]; /* 0x4 */
242 struct nvm_iscsi_generic generic; /* 0x18 */
243 struct nvm_iscsi_initiator initiator; /* 0x218 */
244 struct nvm_iscsi_target target[NUM_OF_ISCSI_TARGET_PER_PF]; /* 0x718 */
246 u32 rsvd_2[58]; /* 0x1718 */
247 /* total size - 0x1800 - 6K block */
250 struct nvm_iscsi_cfg
252 u32 id; /* 0x0 */
253 #define NVM_ISCSI_CFG_BLK_VERSION_MINOR_MASK 0x000000FF
254 #define NVM_ISCSI_CFG_BLK_VERSION_MAJOR_MASK 0x0000FF00
255 #define NVM_ISCSI_CFG_BLK_SIGNATURE_MASK 0xFFFF0000
256 #define NVM_ISCSI_CFG_BLK_SIGNATURE 0x49430000 // IC - Iscsi Config
258 #define NVM_ISCSI_CFG_BLK_VERSION_MAJOR 0
259 #define NVM_ISCSI_CFG_BLK_VERSION_MINOR 11
260 #define NVM_ISCSI_CFG_BLK_VERSION (NVM_ISCSI_CFG_BLK_VERSION_MAJOR << 8) | NVM_ISCSI_CFG_BLK_VERSION_MINOR;
262 struct nvm_iscsi_block block[NUM_OF_ISCSI_PF_SUPPORTED]; /* 0x4 */
265 #endif