1
2
3
4
5
6
7 #ifndef NVM_ISCSI_CFG_H
8 #define NVM_ISCSI_CFG_H
9
10 #define NUM_OF_ISCSI_TARGET_PER_PF 4
11
12
13 #define NUM_OF_ISCSI_PF_SUPPORTED 4
14
15
16
17 #define NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN 256
18
19 union nvm_iscsi_dhcp_vendor_id {
20 u32 value[NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN / 4];
21 u8 byte[NVM_ISCSI_CFG_DHCP_NAME_MAX_LEN];
22 };
23
24 #define NVM_ISCSI_IPV4_ADDR_BYTE_LEN 4
25 union nvm_iscsi_ipv4_addr {
26 u32 addr;
27 u8 byte[NVM_ISCSI_IPV4_ADDR_BYTE_LEN];
28 };
29
30 #define NVM_ISCSI_IPV6_ADDR_BYTE_LEN 16
31 union nvm_iscsi_ipv6_addr {
32 u32 addr[4];
33 u8 byte[NVM_ISCSI_IPV6_ADDR_BYTE_LEN];
34 };
35
36 struct nvm_iscsi_initiator_ipv4 {
37 union nvm_iscsi_ipv4_addr addr;
38 union nvm_iscsi_ipv4_addr subnet_mask;
39 union nvm_iscsi_ipv4_addr gateway;
40 union nvm_iscsi_ipv4_addr primary_dns;
41 union nvm_iscsi_ipv4_addr secondary_dns;
42 union nvm_iscsi_ipv4_addr dhcp_addr;
43
44 union nvm_iscsi_ipv4_addr isns_server;
45 union nvm_iscsi_ipv4_addr slp_server;
46 union nvm_iscsi_ipv4_addr primay_radius_server;
47 union nvm_iscsi_ipv4_addr secondary_radius_server;
48
49 union nvm_iscsi_ipv4_addr rsvd[4];
50 };
51
52 struct nvm_iscsi_initiator_ipv6 {
53 union nvm_iscsi_ipv6_addr addr;
54 union nvm_iscsi_ipv6_addr subnet_mask;
55 union nvm_iscsi_ipv6_addr gateway;
56 union nvm_iscsi_ipv6_addr primary_dns;
57 union nvm_iscsi_ipv6_addr secondary_dns;
58 union nvm_iscsi_ipv6_addr dhcp_addr;
59
60 union nvm_iscsi_ipv6_addr isns_server;
61 union nvm_iscsi_ipv6_addr slp_server;
62 union nvm_iscsi_ipv6_addr primay_radius_server;
63 union nvm_iscsi_ipv6_addr secondary_radius_server;
64
65 union nvm_iscsi_ipv6_addr rsvd[3];
66
67 u32 config;
68 #define NVM_ISCSI_CFG_INITIATOR_IPV6_SUBNET_MASK_PREFIX_MASK 0x000000FF
69 #define NVM_ISCSI_CFG_INITIATOR_IPV6_SUBNET_MASK_PREFIX_OFFSET 0
70
71 u32 rsvd_1[3];
72 };
73
74 #define NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN 256
75 union nvm_iscsi_name {
76 u32 value[NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN / 4];
77 u8 byte[NVM_ISCSI_CFG_ISCSI_NAME_MAX_LEN];
78 };
79
80 #define NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN 256
81 union nvm_iscsi_chap_name {
82 u32 value[NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN / 4];
83 u8 byte[NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN];
84 };
85
86 #define NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN 16
87
88
89 union nvm_iscsi_chap_password {
90 u32 value[NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN / 4];
91 u8 byte[NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN];
92 };
93
94 union nvm_iscsi_lun {
95 u8 byte[8];
96 u32 value[2];
97 };
98
99 struct nvm_iscsi_generic {
100 u32 ctrl_flags;
101 #define NVM_ISCSI_CFG_GEN_CHAP_ENABLED BIT(0)
102 #define NVM_ISCSI_CFG_GEN_DHCP_TCPIP_CONFIG_ENABLED BIT(1)
103 #define NVM_ISCSI_CFG_GEN_DHCP_ISCSI_CONFIG_ENABLED BIT(2)
104 #define NVM_ISCSI_CFG_GEN_IPV6_ENABLED BIT(3)
105 #define NVM_ISCSI_CFG_GEN_IPV4_FALLBACK_ENABLED BIT(4)
106 #define NVM_ISCSI_CFG_GEN_ISNS_WORLD_LOGIN BIT(5)
107 #define NVM_ISCSI_CFG_GEN_ISNS_SELECTIVE_LOGIN BIT(6)
108 #define NVM_ISCSI_CFG_GEN_ADDR_REDIRECT_ENABLED BIT(7)
109 #define NVM_ISCSI_CFG_GEN_CHAP_MUTUAL_ENABLED BIT(8)
110
111 u32 timeout;
112 #define NVM_ISCSI_CFG_GEN_DHCP_REQUEST_TIMEOUT_MASK 0x0000FFFF
113 #define NVM_ISCSI_CFG_GEN_DHCP_REQUEST_TIMEOUT_OFFSET 0
114 #define NVM_ISCSI_CFG_GEN_PORT_LOGIN_TIMEOUT_MASK 0xFFFF0000
115 #define NVM_ISCSI_CFG_GEN_PORT_LOGIN_TIMEOUT_OFFSET 16
116
117 union nvm_iscsi_dhcp_vendor_id dhcp_vendor_id;
118 u32 rsvd[62];
119 };
120
121 struct nvm_iscsi_initiator {
122 struct nvm_iscsi_initiator_ipv4 ipv4;
123 struct nvm_iscsi_initiator_ipv6 ipv6;
124
125 union nvm_iscsi_name initiator_name;
126 union nvm_iscsi_chap_name chap_name;
127 union nvm_iscsi_chap_password chap_password;
128
129 u32 generic_cont0;
130 #define NVM_ISCSI_CFG_INITIATOR_VLAN_MASK 0x0000FFFF
131 #define NVM_ISCSI_CFG_INITIATOR_VLAN_OFFSET 0
132 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_MASK 0x00030000
133 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_OFFSET 16
134 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_4 1
135 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_6 2
136 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_4_AND_6 3
137
138 u32 ctrl_flags;
139 #define NVM_ISCSI_CFG_INITIATOR_IP_VERSION_PRIORITY_V6 BIT(0)
140 #define NVM_ISCSI_CFG_INITIATOR_VLAN_ENABLED BIT(1)
141
142 u32 rsvd[116];
143 };
144
145 struct nvm_iscsi_target {
146 u32 ctrl_flags;
147 #define NVM_ISCSI_CFG_TARGET_ENABLED BIT(0)
148 #define NVM_ISCSI_CFG_BOOT_TIME_LOGIN_STATUS BIT(1)
149
150 u32 generic_cont0;
151 #define NVM_ISCSI_CFG_TARGET_TCP_PORT_MASK 0x0000FFFF
152 #define NVM_ISCSI_CFG_TARGET_TCP_PORT_OFFSET 0
153
154 u32 ip_ver;
155 #define NVM_ISCSI_CFG_IPv4 4
156 #define NVM_ISCSI_CFG_IPv6 6
157
158 u32 rsvd_1[7];
159 union nvm_iscsi_ipv4_addr ipv4_addr;
160 union nvm_iscsi_ipv6_addr ipv6_addr;
161 union nvm_iscsi_lun lun;
162
163 union nvm_iscsi_name target_name;
164 union nvm_iscsi_chap_name chap_name;
165 union nvm_iscsi_chap_password chap_password;
166
167 u32 rsvd_2[107];
168 };
169
170 struct nvm_iscsi_block {
171 u32 id;
172 #define NVM_ISCSI_CFG_BLK_MAPPED_PF_ID_MASK 0x0000000F
173 #define NVM_ISCSI_CFG_BLK_MAPPED_PF_ID_OFFSET 0
174 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_MASK 0x00000FF0
175 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_OFFSET 4
176 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_IS_NOT_EMPTY BIT(0)
177 #define NVM_ISCSI_CFG_BLK_CTRL_FLAG_PF_MAPPED BIT(1)
178
179 u32 rsvd_1[5];
180
181 struct nvm_iscsi_generic generic;
182 struct nvm_iscsi_initiator initiator;
183 struct nvm_iscsi_target target[NUM_OF_ISCSI_TARGET_PER_PF];
184
185
186 u32 rsvd_2[58];
187
188 };
189
190 struct nvm_iscsi_cfg {
191 u32 id;
192 #define NVM_ISCSI_CFG_BLK_VERSION_MINOR_MASK 0x000000FF
193 #define NVM_ISCSI_CFG_BLK_VERSION_MAJOR_MASK 0x0000FF00
194 #define NVM_ISCSI_CFG_BLK_SIGNATURE_MASK 0xFFFF0000
195 #define NVM_ISCSI_CFG_BLK_SIGNATURE 0x49430000
196
197
198
199 #define NVM_ISCSI_CFG_BLK_VERSION_MAJOR 0
200 #define NVM_ISCSI_CFG_BLK_VERSION_MINOR 10
201 #define NVM_ISCSI_CFG_BLK_VERSION ((NVM_ISCSI_CFG_BLK_VERSION_MAJOR << 8) | \
202 NVM_ISCSI_CFG_BLK_VERSION_MINOR)
203
204 struct nvm_iscsi_block block[NUM_OF_ISCSI_PF_SUPPORTED];
205 };
206
207 #endif