1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /* QLogic qed NIC Driver
3  * Copyright (c) 2015-2017  QLogic Corporation
4  * Copyright (c) 2019-2020 Marvell International Ltd.
5  */
6 
7 #ifndef _QED_HSI_H
8 #define _QED_HSI_H
9 
10 #include <linux/types.h>
11 #include <linux/io.h>
12 #include <linux/bitops.h>
13 #include <linux/delay.h>
14 #include <linux/kernel.h>
15 #include <linux/list.h>
16 #include <linux/slab.h>
17 #include <linux/qed/common_hsi.h>
18 #include <linux/qed/storage_common.h>
19 #include <linux/qed/tcp_common.h>
20 #include <linux/qed/fcoe_common.h>
21 #include <linux/qed/eth_common.h>
22 #include <linux/qed/iscsi_common.h>
23 #include <linux/qed/nvmetcp_common.h>
24 #include <linux/qed/iwarp_common.h>
25 #include <linux/qed/rdma_common.h>
26 #include <linux/qed/roce_common.h>
27 #include <linux/qed/qed_fcoe_if.h>
28 
29 struct qed_hwfn;
30 struct qed_ptt;
31 
32 /* Opcodes for the event ring */
33 enum common_event_opcode {
34 	COMMON_EVENT_PF_START,
35 	COMMON_EVENT_PF_STOP,
36 	COMMON_EVENT_VF_START,
37 	COMMON_EVENT_VF_STOP,
38 	COMMON_EVENT_VF_PF_CHANNEL,
39 	COMMON_EVENT_VF_FLR,
40 	COMMON_EVENT_PF_UPDATE,
41 	COMMON_EVENT_MALICIOUS_VF,
42 	COMMON_EVENT_RL_UPDATE,
43 	COMMON_EVENT_EMPTY,
44 	MAX_COMMON_EVENT_OPCODE
45 };
46 
47 /* Common Ramrod Command IDs */
48 enum common_ramrod_cmd_id {
49 	COMMON_RAMROD_UNUSED,
50 	COMMON_RAMROD_PF_START,
51 	COMMON_RAMROD_PF_STOP,
52 	COMMON_RAMROD_VF_START,
53 	COMMON_RAMROD_VF_STOP,
54 	COMMON_RAMROD_PF_UPDATE,
55 	COMMON_RAMROD_RL_UPDATE,
56 	COMMON_RAMROD_EMPTY,
57 	MAX_COMMON_RAMROD_CMD_ID
58 };
59 
60 /* How ll2 should deal with packet upon errors */
61 enum core_error_handle {
62 	LL2_DROP_PACKET,
63 	LL2_DO_NOTHING,
64 	LL2_ASSERT,
65 	MAX_CORE_ERROR_HANDLE
66 };
67 
68 /* Opcodes for the event ring */
69 enum core_event_opcode {
70 	CORE_EVENT_TX_QUEUE_START,
71 	CORE_EVENT_TX_QUEUE_STOP,
72 	CORE_EVENT_RX_QUEUE_START,
73 	CORE_EVENT_RX_QUEUE_STOP,
74 	CORE_EVENT_RX_QUEUE_FLUSH,
75 	CORE_EVENT_TX_QUEUE_UPDATE,
76 	CORE_EVENT_QUEUE_STATS_QUERY,
77 	MAX_CORE_EVENT_OPCODE
78 };
79 
80 /* The L4 pseudo checksum mode for Core */
81 enum core_l4_pseudo_checksum_mode {
82 	CORE_L4_PSEUDO_CSUM_CORRECT_LENGTH,
83 	CORE_L4_PSEUDO_CSUM_ZERO_LENGTH,
84 	MAX_CORE_L4_PSEUDO_CHECKSUM_MODE
85 };
86 
87 /* Light-L2 RX Producers in Tstorm RAM */
88 struct core_ll2_port_stats {
89 	struct regpair gsi_invalid_hdr;
90 	struct regpair gsi_invalid_pkt_length;
91 	struct regpair gsi_unsupported_pkt_typ;
92 	struct regpair gsi_crcchksm_error;
93 };
94 
95 /* LL2 TX Per Queue Stats */
96 struct core_ll2_pstorm_per_queue_stat {
97 	struct regpair sent_ucast_bytes;
98 	struct regpair sent_mcast_bytes;
99 	struct regpair sent_bcast_bytes;
100 	struct regpair sent_ucast_pkts;
101 	struct regpair sent_mcast_pkts;
102 	struct regpair sent_bcast_pkts;
103 	struct regpair error_drop_pkts;
104 };
105 
106 /* Light-L2 RX Producers in Tstorm RAM */
107 struct core_ll2_rx_prod {
108 	__le16 bd_prod;
109 	__le16 cqe_prod;
110 };
111 
112 struct core_ll2_tstorm_per_queue_stat {
113 	struct regpair packet_too_big_discard;
114 	struct regpair no_buff_discard;
115 };
116 
117 struct core_ll2_ustorm_per_queue_stat {
118 	struct regpair rcv_ucast_bytes;
119 	struct regpair rcv_mcast_bytes;
120 	struct regpair rcv_bcast_bytes;
121 	struct regpair rcv_ucast_pkts;
122 	struct regpair rcv_mcast_pkts;
123 	struct regpair rcv_bcast_pkts;
124 };
125 
126 /* Structure for doorbell data, in PWM mode, for RX producers update. */
127 struct core_pwm_prod_update_data {
128 	__le16 icid; /* internal CID */
129 	u8 reserved0;
130 	u8 params;
131 #define CORE_PWM_PROD_UPDATE_DATA_AGG_CMD_MASK	  0x3
132 #define CORE_PWM_PROD_UPDATE_DATA_AGG_CMD_SHIFT   0
133 #define CORE_PWM_PROD_UPDATE_DATA_RESERVED1_MASK  0x3F	/* Set 0 */
134 #define CORE_PWM_PROD_UPDATE_DATA_RESERVED1_SHIFT 2
135 	struct core_ll2_rx_prod prod; /* Producers */
136 };
137 
138 /* Core Ramrod Command IDs (light L2) */
139 enum core_ramrod_cmd_id {
140 	CORE_RAMROD_UNUSED,
141 	CORE_RAMROD_RX_QUEUE_START,
142 	CORE_RAMROD_TX_QUEUE_START,
143 	CORE_RAMROD_RX_QUEUE_STOP,
144 	CORE_RAMROD_TX_QUEUE_STOP,
145 	CORE_RAMROD_RX_QUEUE_FLUSH,
146 	CORE_RAMROD_TX_QUEUE_UPDATE,
147 	CORE_RAMROD_QUEUE_STATS_QUERY,
148 	MAX_CORE_RAMROD_CMD_ID
149 };
150 
151 /* Core RX CQE Type for Light L2 */
152 enum core_roce_flavor_type {
153 	CORE_ROCE,
154 	CORE_RROCE,
155 	MAX_CORE_ROCE_FLAVOR_TYPE
156 };
157 
158 /* Specifies how ll2 should deal with packets errors: packet_too_big and
159  * no_buff.
160  */
161 struct core_rx_action_on_error {
162 	u8 error_type;
163 #define CORE_RX_ACTION_ON_ERROR_PACKET_TOO_BIG_MASK	0x3
164 #define CORE_RX_ACTION_ON_ERROR_PACKET_TOO_BIG_SHIFT	0
165 #define CORE_RX_ACTION_ON_ERROR_NO_BUFF_MASK		0x3
166 #define CORE_RX_ACTION_ON_ERROR_NO_BUFF_SHIFT		2
167 #define CORE_RX_ACTION_ON_ERROR_RESERVED_MASK		0xF
168 #define CORE_RX_ACTION_ON_ERROR_RESERVED_SHIFT		4
169 };
170 
171 /* Core RX BD for Light L2 */
172 struct core_rx_bd {
173 	struct regpair addr;
174 	__le16 reserved[4];
175 };
176 
177 /* Core RX CM offload BD for Light L2 */
178 struct core_rx_bd_with_buff_len {
179 	struct regpair addr;
180 	__le16 buff_length;
181 	__le16 reserved[3];
182 };
183 
184 /* Core RX CM offload BD for Light L2 */
185 union core_rx_bd_union {
186 	struct core_rx_bd rx_bd;
187 	struct core_rx_bd_with_buff_len rx_bd_with_len;
188 };
189 
190 /* Opaque Data for Light L2 RX CQE */
191 struct core_rx_cqe_opaque_data {
192 	__le32 data[2];
193 };
194 
195 /* Core RX CQE Type for Light L2 */
196 enum core_rx_cqe_type {
197 	CORE_RX_CQE_ILLEGAL_TYPE,
198 	CORE_RX_CQE_TYPE_REGULAR,
199 	CORE_RX_CQE_TYPE_GSI_OFFLOAD,
200 	CORE_RX_CQE_TYPE_SLOW_PATH,
201 	MAX_CORE_RX_CQE_TYPE
202 };
203 
204 /* Core RX CQE for Light L2 */
205 struct core_rx_fast_path_cqe {
206 	u8 type;
207 	u8 placement_offset;
208 	struct parsing_and_err_flags parse_flags;
209 	__le16 packet_length;
210 	__le16 vlan;
211 	struct core_rx_cqe_opaque_data opaque_data;
212 	struct parsing_err_flags err_flags;
213 	__le16 reserved0;
214 	__le32 reserved1[3];
215 };
216 
217 /* Core Rx CM offload CQE */
218 struct core_rx_gsi_offload_cqe {
219 	u8 type;
220 	u8 data_length_error;
221 	struct parsing_and_err_flags parse_flags;
222 	__le16 data_length;
223 	__le16 vlan;
224 	__le32 src_mac_addrhi;
225 	__le16 src_mac_addrlo;
226 	__le16 qp_id;
227 	__le32 src_qp;
228 	struct core_rx_cqe_opaque_data opaque_data;
229 	__le32 reserved;
230 };
231 
232 /* Core RX CQE for Light L2 */
233 struct core_rx_slow_path_cqe {
234 	u8 type;
235 	u8 ramrod_cmd_id;
236 	__le16 echo;
237 	struct core_rx_cqe_opaque_data opaque_data;
238 	__le32 reserved1[5];
239 };
240 
241 /* Core RX CM offload BD for Light L2 */
242 union core_rx_cqe_union {
243 	struct core_rx_fast_path_cqe rx_cqe_fp;
244 	struct core_rx_gsi_offload_cqe rx_cqe_gsi;
245 	struct core_rx_slow_path_cqe rx_cqe_sp;
246 };
247 
248 /* Ramrod data for rx queue start ramrod */
249 struct core_rx_start_ramrod_data {
250 	struct regpair bd_base;
251 	struct regpair cqe_pbl_addr;
252 	__le16 mtu;
253 	__le16 sb_id;
254 	u8 sb_index;
255 	u8 complete_cqe_flg;
256 	u8 complete_event_flg;
257 	u8 drop_ttl0_flg;
258 	__le16 num_of_pbl_pages;
259 	u8 inner_vlan_stripping_en;
260 	u8 report_outer_vlan;
261 	u8 queue_id;
262 	u8 main_func_queue;
263 	u8 mf_si_bcast_accept_all;
264 	u8 mf_si_mcast_accept_all;
265 	struct core_rx_action_on_error action_on_error;
266 	u8 gsi_offload_flag;
267 	u8 vport_id_valid;
268 	u8 vport_id;
269 	u8 zero_prod_flg;
270 	u8 wipe_inner_vlan_pri_en;
271 	u8 reserved[2];
272 };
273 
274 /* Ramrod data for rx queue stop ramrod */
275 struct core_rx_stop_ramrod_data {
276 	u8 complete_cqe_flg;
277 	u8 complete_event_flg;
278 	u8 queue_id;
279 	u8 reserved1;
280 	__le16 reserved2[2];
281 };
282 
283 /* Flags for Core TX BD */
284 struct core_tx_bd_data {
285 	__le16 as_bitfield;
286 #define CORE_TX_BD_DATA_FORCE_VLAN_MODE_MASK		0x1
287 #define CORE_TX_BD_DATA_FORCE_VLAN_MODE_SHIFT		0
288 #define CORE_TX_BD_DATA_VLAN_INSERTION_MASK		0x1
289 #define CORE_TX_BD_DATA_VLAN_INSERTION_SHIFT		1
290 #define CORE_TX_BD_DATA_START_BD_MASK			0x1
291 #define CORE_TX_BD_DATA_START_BD_SHIFT			2
292 #define CORE_TX_BD_DATA_IP_CSUM_MASK			0x1
293 #define CORE_TX_BD_DATA_IP_CSUM_SHIFT			3
294 #define CORE_TX_BD_DATA_L4_CSUM_MASK			0x1
295 #define CORE_TX_BD_DATA_L4_CSUM_SHIFT			4
296 #define CORE_TX_BD_DATA_IPV6_EXT_MASK			0x1
297 #define CORE_TX_BD_DATA_IPV6_EXT_SHIFT			5
298 #define CORE_TX_BD_DATA_L4_PROTOCOL_MASK		0x1
299 #define CORE_TX_BD_DATA_L4_PROTOCOL_SHIFT		6
300 #define CORE_TX_BD_DATA_L4_PSEUDO_CSUM_MODE_MASK	0x1
301 #define CORE_TX_BD_DATA_L4_PSEUDO_CSUM_MODE_SHIFT	7
302 #define CORE_TX_BD_DATA_NBDS_MASK			0xF
303 #define CORE_TX_BD_DATA_NBDS_SHIFT			8
304 #define CORE_TX_BD_DATA_ROCE_FLAV_MASK			0x1
305 #define CORE_TX_BD_DATA_ROCE_FLAV_SHIFT			12
306 #define CORE_TX_BD_DATA_IP_LEN_MASK			0x1
307 #define CORE_TX_BD_DATA_IP_LEN_SHIFT			13
308 #define CORE_TX_BD_DATA_DISABLE_STAG_INSERTION_MASK	0x1
309 #define CORE_TX_BD_DATA_DISABLE_STAG_INSERTION_SHIFT	14
310 #define CORE_TX_BD_DATA_RESERVED0_MASK			0x1
311 #define CORE_TX_BD_DATA_RESERVED0_SHIFT			15
312 };
313 
314 /* Core TX BD for Light L2 */
315 struct core_tx_bd {
316 	struct regpair addr;
317 	__le16 nbytes;
318 	__le16 nw_vlan_or_lb_echo;
319 	struct core_tx_bd_data bd_data;
320 	__le16 bitfield1;
321 #define CORE_TX_BD_L4_HDR_OFFSET_W_MASK		0x3FFF
322 #define CORE_TX_BD_L4_HDR_OFFSET_W_SHIFT	0
323 #define CORE_TX_BD_TX_DST_MASK			0x3
324 #define CORE_TX_BD_TX_DST_SHIFT			14
325 };
326 
327 /* Light L2 TX Destination */
328 enum core_tx_dest {
329 	CORE_TX_DEST_NW,
330 	CORE_TX_DEST_LB,
331 	CORE_TX_DEST_RESERVED,
332 	CORE_TX_DEST_DROP,
333 	MAX_CORE_TX_DEST
334 };
335 
336 /* Ramrod data for tx queue start ramrod */
337 struct core_tx_start_ramrod_data {
338 	struct regpair pbl_base_addr;
339 	__le16 mtu;
340 	__le16 sb_id;
341 	u8 sb_index;
342 	u8 stats_en;
343 	u8 stats_id;
344 	u8 conn_type;
345 	__le16 pbl_size;
346 	__le16 qm_pq_id;
347 	u8 gsi_offload_flag;
348 	u8 ctx_stats_en;
349 	u8 vport_id_valid;
350 	u8 vport_id;
351 	u8 enforce_security_flag;
352 	u8 reserved[7];
353 };
354 
355 /* Ramrod data for tx queue stop ramrod */
356 struct core_tx_stop_ramrod_data {
357 	__le32 reserved0[2];
358 };
359 
360 /* Ramrod data for tx queue update ramrod */
361 struct core_tx_update_ramrod_data {
362 	u8 update_qm_pq_id_flg;
363 	u8 reserved0;
364 	__le16 qm_pq_id;
365 	__le32 reserved1;
366 };
367 
368 /* Enum flag for what type of dcb data to update */
369 enum dcb_dscp_update_mode {
370 	DONT_UPDATE_DCB_DSCP,
371 	UPDATE_DCB,
372 	UPDATE_DSCP,
373 	UPDATE_DCB_DSCP,
374 	MAX_DCB_DSCP_UPDATE_MODE
375 };
376 
377 /* The core storm context for the Ystorm */
378 struct ystorm_core_conn_st_ctx {
379 	__le32 reserved[4];
380 };
381 
382 /* The core storm context for the Pstorm */
383 struct pstorm_core_conn_st_ctx {
384 	__le32 reserved[20];
385 };
386 
387 /* Core Slowpath Connection storm context of Xstorm */
388 struct xstorm_core_conn_st_ctx {
389 	__le32 spq_base_lo;
390 	__le32 spq_base_hi;
391 	struct regpair consolid_base_addr;
392 	__le16 spq_cons;
393 	__le16 consolid_cons;
394 	__le32 reserved0[55];
395 };
396 
397 struct e4_xstorm_core_conn_ag_ctx {
398 	u8 reserved0;
399 	u8 state;
400 	u8 flags0;
401 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
402 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
403 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED1_MASK	0x1
404 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED1_SHIFT	1
405 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED2_MASK	0x1
406 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED2_SHIFT	2
407 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
408 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
409 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED3_MASK	0x1
410 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED3_SHIFT	4
411 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED4_MASK	0x1
412 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED4_SHIFT	5
413 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED5_MASK	0x1
414 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED5_SHIFT	6
415 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED6_MASK	0x1
416 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED6_SHIFT	7
417 	u8 flags1;
418 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED7_MASK	0x1
419 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED7_SHIFT	0
420 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED8_MASK	0x1
421 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED8_SHIFT	1
422 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED9_MASK	0x1
423 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED9_SHIFT	2
424 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT11_MASK		0x1
425 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT11_SHIFT		3
426 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT12_MASK		0x1
427 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT12_SHIFT		4
428 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT13_MASK		0x1
429 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT13_SHIFT		5
430 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_MASK	0x1
431 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT	6
432 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_MASK	0x1
433 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT	7
434 	u8 flags2;
435 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0_MASK	0x3
436 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0_SHIFT	0
437 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1_MASK	0x3
438 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1_SHIFT	2
439 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2_MASK	0x3
440 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2_SHIFT	4
441 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3_MASK	0x3
442 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3_SHIFT	6
443 	u8 flags3;
444 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4_MASK	0x3
445 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4_SHIFT	0
446 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5_MASK	0x3
447 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5_SHIFT	2
448 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6_MASK	0x3
449 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6_SHIFT	4
450 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7_MASK	0x3
451 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7_SHIFT	6
452 	u8 flags4;
453 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8_MASK	0x3
454 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8_SHIFT	0
455 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9_MASK	0x3
456 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9_SHIFT	2
457 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10_MASK	0x3
458 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10_SHIFT	4
459 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11_MASK	0x3
460 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11_SHIFT	6
461 	u8 flags5;
462 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12_MASK	0x3
463 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12_SHIFT	0
464 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13_MASK	0x3
465 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13_SHIFT	2
466 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14_MASK	0x3
467 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14_SHIFT	4
468 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15_MASK	0x3
469 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15_SHIFT	6
470 	u8 flags6;
471 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_MASK	0x3
472 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_SHIFT	0
473 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17_MASK			0x3
474 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17_SHIFT			2
475 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_MASK			0x3
476 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_SHIFT			4
477 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_MASK		0x3
478 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_SHIFT		6
479 	u8 flags7;
480 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_MASK	0x3
481 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_SHIFT	0
482 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED10_MASK	0x3
483 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED10_SHIFT	2
484 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_MASK	0x3
485 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_SHIFT	4
486 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0EN_MASK		0x1
487 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT		6
488 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1EN_MASK		0x1
489 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT		7
490 	u8 flags8;
491 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2EN_MASK	0x1
492 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT	0
493 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3EN_MASK	0x1
494 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT	1
495 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4EN_MASK	0x1
496 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT	2
497 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5EN_MASK	0x1
498 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT	3
499 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6EN_MASK	0x1
500 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT	4
501 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7EN_MASK	0x1
502 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT	5
503 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8EN_MASK	0x1
504 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT	6
505 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9EN_MASK	0x1
506 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT	7
507 	u8 flags9;
508 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10EN_MASK			0x1
509 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT			0
510 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11EN_MASK			0x1
511 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11EN_SHIFT			1
512 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12EN_MASK			0x1
513 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12EN_SHIFT			2
514 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13EN_MASK			0x1
515 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13EN_SHIFT			3
516 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14EN_MASK			0x1
517 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14EN_SHIFT			4
518 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15EN_MASK			0x1
519 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15EN_SHIFT			5
520 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_MASK	0x1
521 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_SHIFT	6
522 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17EN_MASK			0x1
523 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17EN_SHIFT			7
524 	u8 flags10;
525 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_MASK		0x1
526 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_SHIFT		0
527 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_MASK		0x1
528 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT	1
529 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_MASK		0x1
530 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT		2
531 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED11_MASK		0x1
532 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED11_SHIFT		3
533 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_MASK		0x1
534 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT		4
535 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23EN_MASK			0x1
536 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23EN_SHIFT			5
537 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED12_MASK		0x1
538 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED12_SHIFT		6
539 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED13_MASK		0x1
540 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED13_SHIFT		7
541 	u8 flags11;
542 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED14_MASK	0x1
543 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED14_SHIFT	0
544 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED15_MASK	0x1
545 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED15_SHIFT	1
546 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_MASK	0x1
547 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT	2
548 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK		0x1
549 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT	3
550 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK		0x1
551 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT	4
552 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK		0x1
553 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT	5
554 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
555 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
556 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE9EN_MASK		0x1
557 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE9EN_SHIFT	7
558 	u8 flags12;
559 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE10EN_MASK	0x1
560 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE10EN_SHIFT	0
561 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE11EN_MASK	0x1
562 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE11EN_SHIFT	1
563 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
564 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
565 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
566 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
567 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE14EN_MASK	0x1
568 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE14EN_SHIFT	4
569 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE15EN_MASK	0x1
570 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE15EN_SHIFT	5
571 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE16EN_MASK	0x1
572 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE16EN_SHIFT	6
573 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE17EN_MASK	0x1
574 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE17EN_SHIFT	7
575 	u8 flags13;
576 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE18EN_MASK	0x1
577 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE18EN_SHIFT	0
578 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE19EN_MASK	0x1
579 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE19EN_SHIFT	1
580 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_MASK	0x1
581 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_SHIFT	2
582 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_MASK	0x1
583 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_SHIFT	3
584 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_MASK	0x1
585 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_SHIFT	4
586 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_MASK	0x1
587 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_SHIFT	5
588 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_MASK	0x1
589 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_SHIFT	6
590 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_MASK	0x1
591 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_SHIFT	7
592 	u8 flags14;
593 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT16_MASK	0x1
594 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT16_SHIFT	0
595 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT17_MASK	0x1
596 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT17_SHIFT	1
597 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT18_MASK	0x1
598 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT18_SHIFT	2
599 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT19_MASK	0x1
600 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT19_SHIFT	3
601 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT20_MASK	0x1
602 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT20_SHIFT	4
603 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT21_MASK	0x1
604 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT21_SHIFT	5
605 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23_MASK	0x3
606 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23_SHIFT	6
607 	u8 byte2;
608 	__le16 physical_q0;
609 	__le16 consolid_prod;
610 	__le16 reserved16;
611 	__le16 tx_bd_cons;
612 	__le16 tx_bd_or_spq_prod;
613 	__le16 updated_qm_pq_id;
614 	__le16 conn_dpi;
615 	u8 byte3;
616 	u8 byte4;
617 	u8 byte5;
618 	u8 byte6;
619 	__le32 reg0;
620 	__le32 reg1;
621 	__le32 reg2;
622 	__le32 reg3;
623 	__le32 reg4;
624 	__le32 reg5;
625 	__le32 reg6;
626 	__le16 word7;
627 	__le16 word8;
628 	__le16 word9;
629 	__le16 word10;
630 	__le32 reg7;
631 	__le32 reg8;
632 	__le32 reg9;
633 	u8 byte7;
634 	u8 byte8;
635 	u8 byte9;
636 	u8 byte10;
637 	u8 byte11;
638 	u8 byte12;
639 	u8 byte13;
640 	u8 byte14;
641 	u8 byte15;
642 	u8 e5_reserved;
643 	__le16 word11;
644 	__le32 reg10;
645 	__le32 reg11;
646 	__le32 reg12;
647 	__le32 reg13;
648 	__le32 reg14;
649 	__le32 reg15;
650 	__le32 reg16;
651 	__le32 reg17;
652 	__le32 reg18;
653 	__le32 reg19;
654 	__le16 word12;
655 	__le16 word13;
656 	__le16 word14;
657 	__le16 word15;
658 };
659 
660 struct e4_tstorm_core_conn_ag_ctx {
661 	u8 byte0;
662 	u8 byte1;
663 	u8 flags0;
664 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT0_MASK	0x1
665 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT	0
666 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT1_MASK	0x1
667 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT	1
668 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT2_MASK	0x1
669 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT2_SHIFT	2
670 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT3_MASK	0x1
671 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT3_SHIFT	3
672 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT4_MASK	0x1
673 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT4_SHIFT	4
674 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT5_MASK	0x1
675 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT5_SHIFT	5
676 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0_MASK	0x3
677 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0_SHIFT	6
678 	u8 flags1;
679 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1_MASK	0x3
680 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1_SHIFT	0
681 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2_MASK	0x3
682 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2_SHIFT	2
683 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3_MASK	0x3
684 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3_SHIFT	4
685 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4_MASK	0x3
686 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4_SHIFT	6
687 	u8 flags2;
688 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5_MASK	0x3
689 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5_SHIFT	0
690 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6_MASK	0x3
691 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6_SHIFT	2
692 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7_MASK	0x3
693 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7_SHIFT	4
694 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8_MASK	0x3
695 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8_SHIFT	6
696 	u8 flags3;
697 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9_MASK	0x3
698 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9_SHIFT	0
699 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10_MASK	0x3
700 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10_SHIFT	2
701 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0EN_MASK	0x1
702 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT	4
703 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1EN_MASK	0x1
704 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT	5
705 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2EN_MASK	0x1
706 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT	6
707 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3EN_MASK	0x1
708 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT	7
709 	u8 flags4;
710 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4EN_MASK		0x1
711 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT		0
712 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5EN_MASK		0x1
713 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT		1
714 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6EN_MASK		0x1
715 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT		2
716 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7EN_MASK		0x1
717 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT		3
718 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8EN_MASK		0x1
719 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT		4
720 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9EN_MASK		0x1
721 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT		5
722 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10EN_MASK		0x1
723 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT		6
724 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK		0x1
725 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT	7
726 	u8 flags5;
727 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK		0x1
728 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT	0
729 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK		0x1
730 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT	1
731 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK		0x1
732 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT	2
733 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK		0x1
734 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT	3
735 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK		0x1
736 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT	4
737 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK		0x1
738 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT	5
739 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK		0x1
740 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT	6
741 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE8EN_MASK		0x1
742 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT	7
743 	__le32 reg0;
744 	__le32 reg1;
745 	__le32 reg2;
746 	__le32 reg3;
747 	__le32 reg4;
748 	__le32 reg5;
749 	__le32 reg6;
750 	__le32 reg7;
751 	__le32 reg8;
752 	u8 byte2;
753 	u8 byte3;
754 	__le16 word0;
755 	u8 byte4;
756 	u8 byte5;
757 	__le16 word1;
758 	__le16 word2;
759 	__le16 word3;
760 	__le32 ll2_rx_prod;
761 	__le32 reg10;
762 };
763 
764 struct e4_ustorm_core_conn_ag_ctx {
765 	u8 reserved;
766 	u8 byte1;
767 	u8 flags0;
768 #define E4_USTORM_CORE_CONN_AG_CTX_BIT0_MASK	0x1
769 #define E4_USTORM_CORE_CONN_AG_CTX_BIT0_SHIFT	0
770 #define E4_USTORM_CORE_CONN_AG_CTX_BIT1_MASK	0x1
771 #define E4_USTORM_CORE_CONN_AG_CTX_BIT1_SHIFT	1
772 #define E4_USTORM_CORE_CONN_AG_CTX_CF0_MASK	0x3
773 #define E4_USTORM_CORE_CONN_AG_CTX_CF0_SHIFT	2
774 #define E4_USTORM_CORE_CONN_AG_CTX_CF1_MASK	0x3
775 #define E4_USTORM_CORE_CONN_AG_CTX_CF1_SHIFT	4
776 #define E4_USTORM_CORE_CONN_AG_CTX_CF2_MASK	0x3
777 #define E4_USTORM_CORE_CONN_AG_CTX_CF2_SHIFT	6
778 	u8 flags1;
779 #define E4_USTORM_CORE_CONN_AG_CTX_CF3_MASK	0x3
780 #define E4_USTORM_CORE_CONN_AG_CTX_CF3_SHIFT	0
781 #define E4_USTORM_CORE_CONN_AG_CTX_CF4_MASK	0x3
782 #define E4_USTORM_CORE_CONN_AG_CTX_CF4_SHIFT	2
783 #define E4_USTORM_CORE_CONN_AG_CTX_CF5_MASK	0x3
784 #define E4_USTORM_CORE_CONN_AG_CTX_CF5_SHIFT	4
785 #define E4_USTORM_CORE_CONN_AG_CTX_CF6_MASK	0x3
786 #define E4_USTORM_CORE_CONN_AG_CTX_CF6_SHIFT	6
787 	u8 flags2;
788 #define E4_USTORM_CORE_CONN_AG_CTX_CF0EN_MASK		0x1
789 #define E4_USTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT		0
790 #define E4_USTORM_CORE_CONN_AG_CTX_CF1EN_MASK		0x1
791 #define E4_USTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT		1
792 #define E4_USTORM_CORE_CONN_AG_CTX_CF2EN_MASK		0x1
793 #define E4_USTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT		2
794 #define E4_USTORM_CORE_CONN_AG_CTX_CF3EN_MASK		0x1
795 #define E4_USTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT		3
796 #define E4_USTORM_CORE_CONN_AG_CTX_CF4EN_MASK		0x1
797 #define E4_USTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT		4
798 #define E4_USTORM_CORE_CONN_AG_CTX_CF5EN_MASK		0x1
799 #define E4_USTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT		5
800 #define E4_USTORM_CORE_CONN_AG_CTX_CF6EN_MASK		0x1
801 #define E4_USTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT		6
802 #define E4_USTORM_CORE_CONN_AG_CTX_RULE0EN_MASK		0x1
803 #define E4_USTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT	7
804 	u8 flags3;
805 #define E4_USTORM_CORE_CONN_AG_CTX_RULE1EN_MASK		0x1
806 #define E4_USTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT	0
807 #define E4_USTORM_CORE_CONN_AG_CTX_RULE2EN_MASK		0x1
808 #define E4_USTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT	1
809 #define E4_USTORM_CORE_CONN_AG_CTX_RULE3EN_MASK		0x1
810 #define E4_USTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT	2
811 #define E4_USTORM_CORE_CONN_AG_CTX_RULE4EN_MASK		0x1
812 #define E4_USTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT	3
813 #define E4_USTORM_CORE_CONN_AG_CTX_RULE5EN_MASK		0x1
814 #define E4_USTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT	4
815 #define E4_USTORM_CORE_CONN_AG_CTX_RULE6EN_MASK		0x1
816 #define E4_USTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT	5
817 #define E4_USTORM_CORE_CONN_AG_CTX_RULE7EN_MASK		0x1
818 #define E4_USTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT	6
819 #define E4_USTORM_CORE_CONN_AG_CTX_RULE8EN_MASK		0x1
820 #define E4_USTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT	7
821 	u8 byte2;
822 	u8 byte3;
823 	__le16 word0;
824 	__le16 word1;
825 	__le32 rx_producers;
826 	__le32 reg1;
827 	__le32 reg2;
828 	__le32 reg3;
829 	__le16 word2;
830 	__le16 word3;
831 };
832 
833 /* The core storm context for the Mstorm */
834 struct mstorm_core_conn_st_ctx {
835 	__le32 reserved[40];
836 };
837 
838 /* The core storm context for the Ustorm */
839 struct ustorm_core_conn_st_ctx {
840 	__le32 reserved[20];
841 };
842 
843 /* The core storm context for the Tstorm */
844 struct tstorm_core_conn_st_ctx {
845 	__le32 reserved[4];
846 };
847 
848 /* core connection context */
849 struct e4_core_conn_context {
850 	struct ystorm_core_conn_st_ctx ystorm_st_context;
851 	struct regpair ystorm_st_padding[2];
852 	struct pstorm_core_conn_st_ctx pstorm_st_context;
853 	struct regpair pstorm_st_padding[2];
854 	struct xstorm_core_conn_st_ctx xstorm_st_context;
855 	struct e4_xstorm_core_conn_ag_ctx xstorm_ag_context;
856 	struct e4_tstorm_core_conn_ag_ctx tstorm_ag_context;
857 	struct e4_ustorm_core_conn_ag_ctx ustorm_ag_context;
858 	struct mstorm_core_conn_st_ctx mstorm_st_context;
859 	struct ustorm_core_conn_st_ctx ustorm_st_context;
860 	struct regpair ustorm_st_padding[2];
861 	struct tstorm_core_conn_st_ctx tstorm_st_context;
862 	struct regpair tstorm_st_padding[2];
863 };
864 
865 struct eth_mstorm_per_pf_stat {
866 	struct regpair gre_discard_pkts;
867 	struct regpair vxlan_discard_pkts;
868 	struct regpair geneve_discard_pkts;
869 	struct regpair lb_discard_pkts;
870 };
871 
872 struct eth_mstorm_per_queue_stat {
873 	struct regpair ttl0_discard;
874 	struct regpair packet_too_big_discard;
875 	struct regpair no_buff_discard;
876 	struct regpair not_active_discard;
877 	struct regpair tpa_coalesced_pkts;
878 	struct regpair tpa_coalesced_events;
879 	struct regpair tpa_aborts_num;
880 	struct regpair tpa_coalesced_bytes;
881 };
882 
883 /* Ethernet TX Per PF */
884 struct eth_pstorm_per_pf_stat {
885 	struct regpair sent_lb_ucast_bytes;
886 	struct regpair sent_lb_mcast_bytes;
887 	struct regpair sent_lb_bcast_bytes;
888 	struct regpair sent_lb_ucast_pkts;
889 	struct regpair sent_lb_mcast_pkts;
890 	struct regpair sent_lb_bcast_pkts;
891 	struct regpair sent_gre_bytes;
892 	struct regpair sent_vxlan_bytes;
893 	struct regpair sent_geneve_bytes;
894 	struct regpair sent_mpls_bytes;
895 	struct regpair sent_gre_mpls_bytes;
896 	struct regpair sent_udp_mpls_bytes;
897 	struct regpair sent_gre_pkts;
898 	struct regpair sent_vxlan_pkts;
899 	struct regpair sent_geneve_pkts;
900 	struct regpair sent_mpls_pkts;
901 	struct regpair sent_gre_mpls_pkts;
902 	struct regpair sent_udp_mpls_pkts;
903 	struct regpair gre_drop_pkts;
904 	struct regpair vxlan_drop_pkts;
905 	struct regpair geneve_drop_pkts;
906 	struct regpair mpls_drop_pkts;
907 	struct regpair gre_mpls_drop_pkts;
908 	struct regpair udp_mpls_drop_pkts;
909 };
910 
911 /* Ethernet TX Per Queue Stats */
912 struct eth_pstorm_per_queue_stat {
913 	struct regpair sent_ucast_bytes;
914 	struct regpair sent_mcast_bytes;
915 	struct regpair sent_bcast_bytes;
916 	struct regpair sent_ucast_pkts;
917 	struct regpair sent_mcast_pkts;
918 	struct regpair sent_bcast_pkts;
919 	struct regpair error_drop_pkts;
920 };
921 
922 /* ETH Rx producers data */
923 struct eth_rx_rate_limit {
924 	__le16 mult;
925 	__le16 cnst;
926 	u8 add_sub_cnst;
927 	u8 reserved0;
928 	__le16 reserved1;
929 };
930 
931 /* Update RSS indirection table entry command */
932 struct eth_tstorm_rss_update_data {
933 	u8 valid;
934 	u8 vport_id;
935 	u8 ind_table_index;
936 	u8 reserved;
937 	__le16 ind_table_value;
938 	__le16 reserved1;
939 };
940 
941 struct eth_ustorm_per_pf_stat {
942 	struct regpair rcv_lb_ucast_bytes;
943 	struct regpair rcv_lb_mcast_bytes;
944 	struct regpair rcv_lb_bcast_bytes;
945 	struct regpair rcv_lb_ucast_pkts;
946 	struct regpair rcv_lb_mcast_pkts;
947 	struct regpair rcv_lb_bcast_pkts;
948 	struct regpair rcv_gre_bytes;
949 	struct regpair rcv_vxlan_bytes;
950 	struct regpair rcv_geneve_bytes;
951 	struct regpair rcv_gre_pkts;
952 	struct regpair rcv_vxlan_pkts;
953 	struct regpair rcv_geneve_pkts;
954 };
955 
956 struct eth_ustorm_per_queue_stat {
957 	struct regpair rcv_ucast_bytes;
958 	struct regpair rcv_mcast_bytes;
959 	struct regpair rcv_bcast_bytes;
960 	struct regpair rcv_ucast_pkts;
961 	struct regpair rcv_mcast_pkts;
962 	struct regpair rcv_bcast_pkts;
963 };
964 
965 /* Event Ring VF-PF Channel data */
966 struct vf_pf_channel_eqe_data {
967 	struct regpair msg_addr;
968 };
969 
970 /* Event Ring malicious VF data */
971 struct malicious_vf_eqe_data {
972 	u8 vf_id;
973 	u8 err_id;
974 	__le16 reserved[3];
975 };
976 
977 /* Event Ring initial cleanup data */
978 struct initial_cleanup_eqe_data {
979 	u8 vf_id;
980 	u8 reserved[7];
981 };
982 
983 /* Event Data Union */
984 union event_ring_data {
985 	u8 bytes[8];
986 	struct vf_pf_channel_eqe_data vf_pf_channel;
987 	struct iscsi_eqe_data iscsi_info;
988 	struct iscsi_connect_done_results iscsi_conn_done_info;
989 	union rdma_eqe_data rdma_data;
990 	struct malicious_vf_eqe_data malicious_vf;
991 	struct initial_cleanup_eqe_data vf_init_cleanup;
992 };
993 
994 /* Event Ring Entry */
995 struct event_ring_entry {
996 	u8 protocol_id;
997 	u8 opcode;
998 	u8 reserved0;
999 	u8 vf_id;
1000 	__le16 echo;
1001 	u8 fw_return_code;
1002 	u8 flags;
1003 #define EVENT_RING_ENTRY_ASYNC_MASK		0x1
1004 #define EVENT_RING_ENTRY_ASYNC_SHIFT		0
1005 #define EVENT_RING_ENTRY_RESERVED1_MASK		0x7F
1006 #define EVENT_RING_ENTRY_RESERVED1_SHIFT	1
1007 	union event_ring_data data;
1008 };
1009 
1010 /* Event Ring Next Page Address */
1011 struct event_ring_next_addr {
1012 	struct regpair addr;
1013 	__le32 reserved[2];
1014 };
1015 
1016 /* Event Ring Element */
1017 union event_ring_element {
1018 	struct event_ring_entry entry;
1019 	struct event_ring_next_addr next_addr;
1020 };
1021 
1022 /* Ports mode */
1023 enum fw_flow_ctrl_mode {
1024 	flow_ctrl_pause,
1025 	flow_ctrl_pfc,
1026 	MAX_FW_FLOW_CTRL_MODE
1027 };
1028 
1029 /* GFT profile type */
1030 enum gft_profile_type {
1031 	GFT_PROFILE_TYPE_4_TUPLE,
1032 	GFT_PROFILE_TYPE_L4_DST_PORT,
1033 	GFT_PROFILE_TYPE_IP_DST_ADDR,
1034 	GFT_PROFILE_TYPE_IP_SRC_ADDR,
1035 	GFT_PROFILE_TYPE_TUNNEL_TYPE,
1036 	MAX_GFT_PROFILE_TYPE
1037 };
1038 
1039 /* Major and Minor hsi Versions */
1040 struct hsi_fp_ver_struct {
1041 	u8 minor_ver_arr[2];
1042 	u8 major_ver_arr[2];
1043 };
1044 
1045 enum iwarp_ll2_tx_queues {
1046 	IWARP_LL2_IN_ORDER_TX_QUEUE = 1,
1047 	IWARP_LL2_ALIGNED_TX_QUEUE,
1048 	IWARP_LL2_ALIGNED_RIGHT_TRIMMED_TX_QUEUE,
1049 	IWARP_LL2_ERROR,
1050 	MAX_IWARP_LL2_TX_QUEUES
1051 };
1052 
1053 /* Malicious VF error ID */
1054 enum malicious_vf_error_id {
1055 	MALICIOUS_VF_NO_ERROR,
1056 	VF_PF_CHANNEL_NOT_READY,
1057 	VF_ZONE_MSG_NOT_VALID,
1058 	VF_ZONE_FUNC_NOT_ENABLED,
1059 	ETH_PACKET_TOO_SMALL,
1060 	ETH_ILLEGAL_VLAN_MODE,
1061 	ETH_MTU_VIOLATION,
1062 	ETH_ILLEGAL_INBAND_TAGS,
1063 	ETH_VLAN_INSERT_AND_INBAND_VLAN,
1064 	ETH_ILLEGAL_NBDS,
1065 	ETH_FIRST_BD_WO_SOP,
1066 	ETH_INSUFFICIENT_BDS,
1067 	ETH_ILLEGAL_LSO_HDR_NBDS,
1068 	ETH_ILLEGAL_LSO_MSS,
1069 	ETH_ZERO_SIZE_BD,
1070 	ETH_ILLEGAL_LSO_HDR_LEN,
1071 	ETH_INSUFFICIENT_PAYLOAD,
1072 	ETH_EDPM_OUT_OF_SYNC,
1073 	ETH_TUNN_IPV6_EXT_NBD_ERR,
1074 	ETH_CONTROL_PACKET_VIOLATION,
1075 	ETH_ANTI_SPOOFING_ERR,
1076 	ETH_PACKET_SIZE_TOO_LARGE,
1077 	CORE_ILLEGAL_VLAN_MODE,
1078 	CORE_ILLEGAL_NBDS,
1079 	CORE_FIRST_BD_WO_SOP,
1080 	CORE_INSUFFICIENT_BDS,
1081 	CORE_PACKET_TOO_SMALL,
1082 	CORE_ILLEGAL_INBAND_TAGS,
1083 	CORE_VLAN_INSERT_AND_INBAND_VLAN,
1084 	CORE_MTU_VIOLATION,
1085 	CORE_CONTROL_PACKET_VIOLATION,
1086 	CORE_ANTI_SPOOFING_ERR,
1087 	CORE_PACKET_SIZE_TOO_LARGE,
1088 	CORE_ILLEGAL_BD_FLAGS,
1089 	CORE_GSI_PACKET_VIOLATION,
1090 	MAX_MALICIOUS_VF_ERROR_ID,
1091 };
1092 
1093 /* Mstorm non-triggering VF zone */
1094 struct mstorm_non_trigger_vf_zone {
1095 	struct eth_mstorm_per_queue_stat eth_queue_stat;
1096 	struct eth_rx_prod_data eth_rx_queue_producers[ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD];
1097 };
1098 
1099 /* Mstorm VF zone */
1100 struct mstorm_vf_zone {
1101 	struct mstorm_non_trigger_vf_zone non_trigger;
1102 };
1103 
1104 /* vlan header including TPID and TCI fields */
1105 struct vlan_header {
1106 	__le16 tpid;
1107 	__le16 tci;
1108 };
1109 
1110 /* outer tag configurations */
1111 struct outer_tag_config_struct {
1112 	u8 enable_stag_pri_change;
1113 	u8 pri_map_valid;
1114 	u8 reserved[2];
1115 	struct vlan_header outer_tag;
1116 	u8 inner_to_outer_pri_map[8];
1117 };
1118 
1119 /* personality per PF */
1120 enum personality_type {
1121 	BAD_PERSONALITY_TYP,
1122 	PERSONALITY_TCP_ULP,
1123 	PERSONALITY_FCOE,
1124 	PERSONALITY_RDMA_AND_ETH,
1125 	PERSONALITY_RDMA,
1126 	PERSONALITY_CORE,
1127 	PERSONALITY_ETH,
1128 	PERSONALITY_RESERVED,
1129 	MAX_PERSONALITY_TYPE
1130 };
1131 
1132 /* tunnel configuration */
1133 struct pf_start_tunnel_config {
1134 	u8 set_vxlan_udp_port_flg;
1135 	u8 set_geneve_udp_port_flg;
1136 	u8 set_no_inner_l2_vxlan_udp_port_flg;
1137 	u8 tunnel_clss_vxlan;
1138 	u8 tunnel_clss_l2geneve;
1139 	u8 tunnel_clss_ipgeneve;
1140 	u8 tunnel_clss_l2gre;
1141 	u8 tunnel_clss_ipgre;
1142 	__le16 vxlan_udp_port;
1143 	__le16 geneve_udp_port;
1144 	__le16 no_inner_l2_vxlan_udp_port;
1145 	__le16 reserved[3];
1146 };
1147 
1148 /* Ramrod data for PF start ramrod */
1149 struct pf_start_ramrod_data {
1150 	struct regpair event_ring_pbl_addr;
1151 	struct regpair consolid_q_pbl_addr;
1152 	struct pf_start_tunnel_config tunnel_config;
1153 	__le16 event_ring_sb_id;
1154 	u8 base_vf_id;
1155 	u8 num_vfs;
1156 	u8 event_ring_num_pages;
1157 	u8 event_ring_sb_index;
1158 	u8 path_id;
1159 	u8 warning_as_error;
1160 	u8 dont_log_ramrods;
1161 	u8 personality;
1162 	__le16 log_type_mask;
1163 	u8 mf_mode;
1164 	u8 integ_phase;
1165 	u8 allow_npar_tx_switching;
1166 	u8 reserved0;
1167 	struct hsi_fp_ver_struct hsi_fp_ver;
1168 	struct outer_tag_config_struct outer_tag_config;
1169 };
1170 
1171 /* Data for port update ramrod */
1172 struct protocol_dcb_data {
1173 	u8 dcb_enable_flag;
1174 	u8 dscp_enable_flag;
1175 	u8 dcb_priority;
1176 	u8 dcb_tc;
1177 	u8 dscp_val;
1178 	u8 dcb_dont_add_vlan0;
1179 };
1180 
1181 /* Update tunnel configuration */
1182 struct pf_update_tunnel_config {
1183 	u8 update_rx_pf_clss;
1184 	u8 update_rx_def_ucast_clss;
1185 	u8 update_rx_def_non_ucast_clss;
1186 	u8 set_vxlan_udp_port_flg;
1187 	u8 set_geneve_udp_port_flg;
1188 	u8 set_no_inner_l2_vxlan_udp_port_flg;
1189 	u8 tunnel_clss_vxlan;
1190 	u8 tunnel_clss_l2geneve;
1191 	u8 tunnel_clss_ipgeneve;
1192 	u8 tunnel_clss_l2gre;
1193 	u8 tunnel_clss_ipgre;
1194 	u8 reserved;
1195 	__le16 vxlan_udp_port;
1196 	__le16 geneve_udp_port;
1197 	__le16 no_inner_l2_vxlan_udp_port;
1198 	__le16 reserved1[3];
1199 };
1200 
1201 /* Data for port update ramrod */
1202 struct pf_update_ramrod_data {
1203 	u8 update_eth_dcb_data_mode;
1204 	u8 update_fcoe_dcb_data_mode;
1205 	u8 update_iscsi_dcb_data_mode;
1206 	u8 update_roce_dcb_data_mode;
1207 	u8 update_rroce_dcb_data_mode;
1208 	u8 update_iwarp_dcb_data_mode;
1209 	u8 update_mf_vlan_flag;
1210 	u8 update_enable_stag_pri_change;
1211 	struct protocol_dcb_data eth_dcb_data;
1212 	struct protocol_dcb_data fcoe_dcb_data;
1213 	struct protocol_dcb_data iscsi_dcb_data;
1214 	struct protocol_dcb_data roce_dcb_data;
1215 	struct protocol_dcb_data rroce_dcb_data;
1216 	struct protocol_dcb_data iwarp_dcb_data;
1217 	__le16 mf_vlan;
1218 	u8 enable_stag_pri_change;
1219 	u8 reserved;
1220 	struct pf_update_tunnel_config tunnel_config;
1221 };
1222 
1223 /* Ports mode */
1224 enum ports_mode {
1225 	ENGX2_PORTX1,
1226 	ENGX2_PORTX2,
1227 	ENGX1_PORTX1,
1228 	ENGX1_PORTX2,
1229 	ENGX1_PORTX4,
1230 	MAX_PORTS_MODE
1231 };
1232 
1233 /* use to index in hsi_fp_[major|minor]_ver_arr per protocol */
1234 enum protocol_version_array_key {
1235 	ETH_VER_KEY = 0,
1236 	ROCE_VER_KEY,
1237 	MAX_PROTOCOL_VERSION_ARRAY_KEY
1238 };
1239 
1240 /* RDMA TX Stats */
1241 struct rdma_sent_stats {
1242 	struct regpair sent_bytes;
1243 	struct regpair sent_pkts;
1244 };
1245 
1246 /* Pstorm non-triggering VF zone */
1247 struct pstorm_non_trigger_vf_zone {
1248 	struct eth_pstorm_per_queue_stat eth_queue_stat;
1249 	struct rdma_sent_stats rdma_stats;
1250 };
1251 
1252 /* Pstorm VF zone */
1253 struct pstorm_vf_zone {
1254 	struct pstorm_non_trigger_vf_zone non_trigger;
1255 	struct regpair reserved[7];
1256 };
1257 
1258 /* Ramrod Header of SPQE */
1259 struct ramrod_header {
1260 	__le32 cid;
1261 	u8 cmd_id;
1262 	u8 protocol_id;
1263 	__le16 echo;
1264 };
1265 
1266 /* RDMA RX Stats */
1267 struct rdma_rcv_stats {
1268 	struct regpair rcv_bytes;
1269 	struct regpair rcv_pkts;
1270 };
1271 
1272 /* Data for update QCN/DCQCN RL ramrod */
1273 struct rl_update_ramrod_data {
1274 	u8 qcn_update_param_flg;
1275 	u8 dcqcn_update_param_flg;
1276 	u8 rl_init_flg;
1277 	u8 rl_start_flg;
1278 	u8 rl_stop_flg;
1279 	u8 rl_id_first;
1280 	u8 rl_id_last;
1281 	u8 rl_dc_qcn_flg;
1282 	u8 dcqcn_reset_alpha_on_idle;
1283 	u8 rl_bc_stage_th;
1284 	u8 rl_timer_stage_th;
1285 	u8 reserved1;
1286 	__le32 rl_bc_rate;
1287 	__le16 rl_max_rate;
1288 	__le16 rl_r_ai;
1289 	__le16 rl_r_hai;
1290 	__le16 dcqcn_g;
1291 	__le32 dcqcn_k_us;
1292 	__le32 dcqcn_timeuot_us;
1293 	__le32 qcn_timeuot_us;
1294 	__le32 reserved2;
1295 };
1296 
1297 /* Slowpath Element (SPQE) */
1298 struct slow_path_element {
1299 	struct ramrod_header hdr;
1300 	struct regpair data_ptr;
1301 };
1302 
1303 /* Tstorm non-triggering VF zone */
1304 struct tstorm_non_trigger_vf_zone {
1305 	struct rdma_rcv_stats rdma_stats;
1306 };
1307 
1308 struct tstorm_per_port_stat {
1309 	struct regpair trunc_error_discard;
1310 	struct regpair mac_error_discard;
1311 	struct regpair mftag_filter_discard;
1312 	struct regpair eth_mac_filter_discard;
1313 	struct regpair ll2_mac_filter_discard;
1314 	struct regpair ll2_conn_disabled_discard;
1315 	struct regpair iscsi_irregular_pkt;
1316 	struct regpair fcoe_irregular_pkt;
1317 	struct regpair roce_irregular_pkt;
1318 	struct regpair iwarp_irregular_pkt;
1319 	struct regpair eth_irregular_pkt;
1320 	struct regpair toe_irregular_pkt;
1321 	struct regpair preroce_irregular_pkt;
1322 	struct regpair eth_gre_tunn_filter_discard;
1323 	struct regpair eth_vxlan_tunn_filter_discard;
1324 	struct regpair eth_geneve_tunn_filter_discard;
1325 	struct regpair eth_gft_drop_pkt;
1326 };
1327 
1328 /* Tstorm VF zone */
1329 struct tstorm_vf_zone {
1330 	struct tstorm_non_trigger_vf_zone non_trigger;
1331 };
1332 
1333 /* Tunnel classification scheme */
1334 enum tunnel_clss {
1335 	TUNNEL_CLSS_MAC_VLAN = 0,
1336 	TUNNEL_CLSS_MAC_VNI,
1337 	TUNNEL_CLSS_INNER_MAC_VLAN,
1338 	TUNNEL_CLSS_INNER_MAC_VNI,
1339 	TUNNEL_CLSS_MAC_VLAN_DUAL_STAGE,
1340 	MAX_TUNNEL_CLSS
1341 };
1342 
1343 /* Ustorm non-triggering VF zone */
1344 struct ustorm_non_trigger_vf_zone {
1345 	struct eth_ustorm_per_queue_stat eth_queue_stat;
1346 	struct regpair vf_pf_msg_addr;
1347 };
1348 
1349 /* Ustorm triggering VF zone */
1350 struct ustorm_trigger_vf_zone {
1351 	u8 vf_pf_msg_valid;
1352 	u8 reserved[7];
1353 };
1354 
1355 /* Ustorm VF zone */
1356 struct ustorm_vf_zone {
1357 	struct ustorm_non_trigger_vf_zone non_trigger;
1358 	struct ustorm_trigger_vf_zone trigger;
1359 };
1360 
1361 /* VF-PF channel data */
1362 struct vf_pf_channel_data {
1363 	__le32 ready;
1364 	u8 valid;
1365 	u8 reserved0;
1366 	__le16 reserved1;
1367 };
1368 
1369 /* Ramrod data for VF start ramrod */
1370 struct vf_start_ramrod_data {
1371 	u8 vf_id;
1372 	u8 enable_flr_ack;
1373 	__le16 opaque_fid;
1374 	u8 personality;
1375 	u8 reserved[7];
1376 	struct hsi_fp_ver_struct hsi_fp_ver;
1377 
1378 };
1379 
1380 /* Ramrod data for VF start ramrod */
1381 struct vf_stop_ramrod_data {
1382 	u8 vf_id;
1383 	u8 reserved0;
1384 	__le16 reserved1;
1385 	__le32 reserved2;
1386 };
1387 
1388 /* VF zone size mode */
1389 enum vf_zone_size_mode {
1390 	VF_ZONE_SIZE_MODE_DEFAULT,
1391 	VF_ZONE_SIZE_MODE_DOUBLE,
1392 	VF_ZONE_SIZE_MODE_QUAD,
1393 	MAX_VF_ZONE_SIZE_MODE
1394 };
1395 
1396 /* Xstorm non-triggering VF zone */
1397 struct xstorm_non_trigger_vf_zone {
1398 	struct regpair non_edpm_ack_pkts;
1399 };
1400 
1401 /* Tstorm VF zone */
1402 struct xstorm_vf_zone {
1403 	struct xstorm_non_trigger_vf_zone non_trigger;
1404 };
1405 
1406 /* Attentions status block */
1407 struct atten_status_block {
1408 	__le32 atten_bits;
1409 	__le32 atten_ack;
1410 	__le16 reserved0;
1411 	__le16 sb_index;
1412 	__le32 reserved1;
1413 };
1414 
1415 /* DMAE command */
1416 struct dmae_cmd {
1417 	__le32 opcode;
1418 #define DMAE_CMD_SRC_MASK		0x1
1419 #define DMAE_CMD_SRC_SHIFT		0
1420 #define DMAE_CMD_DST_MASK		0x3
1421 #define DMAE_CMD_DST_SHIFT		1
1422 #define DMAE_CMD_C_DST_MASK		0x1
1423 #define DMAE_CMD_C_DST_SHIFT		3
1424 #define DMAE_CMD_CRC_RESET_MASK		0x1
1425 #define DMAE_CMD_CRC_RESET_SHIFT	4
1426 #define DMAE_CMD_SRC_ADDR_RESET_MASK	0x1
1427 #define DMAE_CMD_SRC_ADDR_RESET_SHIFT	5
1428 #define DMAE_CMD_DST_ADDR_RESET_MASK	0x1
1429 #define DMAE_CMD_DST_ADDR_RESET_SHIFT	6
1430 #define DMAE_CMD_COMP_FUNC_MASK		0x1
1431 #define DMAE_CMD_COMP_FUNC_SHIFT	7
1432 #define DMAE_CMD_COMP_WORD_EN_MASK	0x1
1433 #define DMAE_CMD_COMP_WORD_EN_SHIFT	8
1434 #define DMAE_CMD_COMP_CRC_EN_MASK	0x1
1435 #define DMAE_CMD_COMP_CRC_EN_SHIFT	9
1436 #define DMAE_CMD_COMP_CRC_OFFSET_MASK	0x7
1437 #define DMAE_CMD_COMP_CRC_OFFSET_SHIFT 10
1438 #define DMAE_CMD_RESERVED1_MASK		0x1
1439 #define DMAE_CMD_RESERVED1_SHIFT	13
1440 #define DMAE_CMD_ENDIANITY_MODE_MASK	0x3
1441 #define DMAE_CMD_ENDIANITY_MODE_SHIFT	14
1442 #define DMAE_CMD_ERR_HANDLING_MASK	0x3
1443 #define DMAE_CMD_ERR_HANDLING_SHIFT	16
1444 #define DMAE_CMD_PORT_ID_MASK		0x3
1445 #define DMAE_CMD_PORT_ID_SHIFT		18
1446 #define DMAE_CMD_SRC_PF_ID_MASK		0xF
1447 #define DMAE_CMD_SRC_PF_ID_SHIFT	20
1448 #define DMAE_CMD_DST_PF_ID_MASK		0xF
1449 #define DMAE_CMD_DST_PF_ID_SHIFT	24
1450 #define DMAE_CMD_SRC_VF_ID_VALID_MASK	0x1
1451 #define DMAE_CMD_SRC_VF_ID_VALID_SHIFT 28
1452 #define DMAE_CMD_DST_VF_ID_VALID_MASK	0x1
1453 #define DMAE_CMD_DST_VF_ID_VALID_SHIFT 29
1454 #define DMAE_CMD_RESERVED2_MASK		0x3
1455 #define DMAE_CMD_RESERVED2_SHIFT	30
1456 	__le32 src_addr_lo;
1457 	__le32 src_addr_hi;
1458 	__le32 dst_addr_lo;
1459 	__le32 dst_addr_hi;
1460 	__le16 length_dw;
1461 	__le16 opcode_b;
1462 #define DMAE_CMD_SRC_VF_ID_MASK		0xFF
1463 #define DMAE_CMD_SRC_VF_ID_SHIFT	0
1464 #define DMAE_CMD_DST_VF_ID_MASK		0xFF
1465 #define DMAE_CMD_DST_VF_ID_SHIFT	8
1466 	__le32 comp_addr_lo;
1467 	__le32 comp_addr_hi;
1468 	__le32 comp_val;
1469 	__le32 crc32;
1470 	__le32 crc_32_c;
1471 	__le16 crc16;
1472 	__le16 crc16_c;
1473 	__le16 crc10;
1474 	__le16 error_bit_reserved;
1475 #define DMAE_CMD_ERROR_BIT_MASK        0x1
1476 #define DMAE_CMD_ERROR_BIT_SHIFT       0
1477 #define DMAE_CMD_RESERVED_MASK	       0x7FFF
1478 #define DMAE_CMD_RESERVED_SHIFT        1
1479 	__le16 xsum16;
1480 	__le16 xsum8;
1481 };
1482 
1483 enum dmae_cmd_comp_crc_en_enum {
1484 	dmae_cmd_comp_crc_disabled,
1485 	dmae_cmd_comp_crc_enabled,
1486 	MAX_DMAE_CMD_COMP_CRC_EN_ENUM
1487 };
1488 
1489 enum dmae_cmd_comp_func_enum {
1490 	dmae_cmd_comp_func_to_src,
1491 	dmae_cmd_comp_func_to_dst,
1492 	MAX_DMAE_CMD_COMP_FUNC_ENUM
1493 };
1494 
1495 enum dmae_cmd_comp_word_en_enum {
1496 	dmae_cmd_comp_word_disabled,
1497 	dmae_cmd_comp_word_enabled,
1498 	MAX_DMAE_CMD_COMP_WORD_EN_ENUM
1499 };
1500 
1501 enum dmae_cmd_c_dst_enum {
1502 	dmae_cmd_c_dst_pcie,
1503 	dmae_cmd_c_dst_grc,
1504 	MAX_DMAE_CMD_C_DST_ENUM
1505 };
1506 
1507 enum dmae_cmd_dst_enum {
1508 	dmae_cmd_dst_none_0,
1509 	dmae_cmd_dst_pcie,
1510 	dmae_cmd_dst_grc,
1511 	dmae_cmd_dst_none_3,
1512 	MAX_DMAE_CMD_DST_ENUM
1513 };
1514 
1515 enum dmae_cmd_error_handling_enum {
1516 	dmae_cmd_error_handling_send_regular_comp,
1517 	dmae_cmd_error_handling_send_comp_with_err,
1518 	dmae_cmd_error_handling_dont_send_comp,
1519 	MAX_DMAE_CMD_ERROR_HANDLING_ENUM
1520 };
1521 
1522 enum dmae_cmd_src_enum {
1523 	dmae_cmd_src_pcie,
1524 	dmae_cmd_src_grc,
1525 	MAX_DMAE_CMD_SRC_ENUM
1526 };
1527 
1528 struct e4_mstorm_core_conn_ag_ctx {
1529 	u8 byte0;
1530 	u8 byte1;
1531 	u8 flags0;
1532 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT0_MASK	0x1
1533 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT	0
1534 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT1_MASK	0x1
1535 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT	1
1536 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0_MASK	0x3
1537 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0_SHIFT	2
1538 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1_MASK	0x3
1539 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1_SHIFT	4
1540 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2_MASK	0x3
1541 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2_SHIFT	6
1542 	u8 flags1;
1543 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0EN_MASK		0x1
1544 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT		0
1545 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1EN_MASK		0x1
1546 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT		1
1547 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2EN_MASK		0x1
1548 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT		2
1549 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK		0x1
1550 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT	3
1551 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK		0x1
1552 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT	4
1553 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK		0x1
1554 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT	5
1555 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK		0x1
1556 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT	6
1557 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK		0x1
1558 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT	7
1559 	__le16 word0;
1560 	__le16 word1;
1561 	__le32 reg0;
1562 	__le32 reg1;
1563 };
1564 
1565 struct e4_ystorm_core_conn_ag_ctx {
1566 	u8 byte0;
1567 	u8 byte1;
1568 	u8 flags0;
1569 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT0_MASK	0x1
1570 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT	0
1571 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT1_MASK	0x1
1572 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT	1
1573 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0_MASK	0x3
1574 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0_SHIFT	2
1575 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1_MASK	0x3
1576 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1_SHIFT	4
1577 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2_MASK	0x3
1578 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2_SHIFT	6
1579 	u8 flags1;
1580 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0EN_MASK		0x1
1581 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT		0
1582 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1EN_MASK		0x1
1583 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT		1
1584 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2EN_MASK		0x1
1585 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT		2
1586 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK		0x1
1587 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT	3
1588 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK		0x1
1589 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT	4
1590 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK		0x1
1591 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT	5
1592 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK		0x1
1593 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT	6
1594 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK		0x1
1595 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT	7
1596 	u8 byte2;
1597 	u8 byte3;
1598 	__le16 word0;
1599 	__le32 reg0;
1600 	__le32 reg1;
1601 	__le16 word1;
1602 	__le16 word2;
1603 	__le16 word3;
1604 	__le16 word4;
1605 	__le32 reg2;
1606 	__le32 reg3;
1607 };
1608 
1609 /* DMAE parameters */
1610 struct qed_dmae_params {
1611 	u32 flags;
1612 /* If QED_DMAE_PARAMS_RW_REPL_SRC flag is set and the
1613  * source is a block of length DMAE_MAX_RW_SIZE and the
1614  * destination is larger, the source block will be duplicated as
1615  * many times as required to fill the destination block. This is
1616  * used mostly to write a zeroed buffer to destination address
1617  * using DMA
1618  */
1619 #define QED_DMAE_PARAMS_RW_REPL_SRC_MASK	0x1
1620 #define QED_DMAE_PARAMS_RW_REPL_SRC_SHIFT	0
1621 #define QED_DMAE_PARAMS_SRC_VF_VALID_MASK	0x1
1622 #define QED_DMAE_PARAMS_SRC_VF_VALID_SHIFT	1
1623 #define QED_DMAE_PARAMS_DST_VF_VALID_MASK	0x1
1624 #define QED_DMAE_PARAMS_DST_VF_VALID_SHIFT	2
1625 #define QED_DMAE_PARAMS_COMPLETION_DST_MASK	0x1
1626 #define QED_DMAE_PARAMS_COMPLETION_DST_SHIFT	3
1627 #define QED_DMAE_PARAMS_PORT_VALID_MASK		0x1
1628 #define QED_DMAE_PARAMS_PORT_VALID_SHIFT	4
1629 #define QED_DMAE_PARAMS_SRC_PF_VALID_MASK	0x1
1630 #define QED_DMAE_PARAMS_SRC_PF_VALID_SHIFT	5
1631 #define QED_DMAE_PARAMS_DST_PF_VALID_MASK	0x1
1632 #define QED_DMAE_PARAMS_DST_PF_VALID_SHIFT	6
1633 #define QED_DMAE_PARAMS_RESERVED_MASK		0x1FFFFFF
1634 #define QED_DMAE_PARAMS_RESERVED_SHIFT		7
1635 	u8 src_vfid;
1636 	u8 dst_vfid;
1637 	u8 port_id;
1638 	u8 src_pfid;
1639 	u8 dst_pfid;
1640 	u8 reserved1;
1641 	__le16 reserved2;
1642 };
1643 
1644 /* IGU cleanup command */
1645 struct igu_cleanup {
1646 	__le32 sb_id_and_flags;
1647 #define IGU_CLEANUP_RESERVED0_MASK	0x7FFFFFF
1648 #define IGU_CLEANUP_RESERVED0_SHIFT	0
1649 #define IGU_CLEANUP_CLEANUP_SET_MASK	0x1
1650 #define IGU_CLEANUP_CLEANUP_SET_SHIFT	27
1651 #define IGU_CLEANUP_CLEANUP_TYPE_MASK	0x7
1652 #define IGU_CLEANUP_CLEANUP_TYPE_SHIFT	28
1653 #define IGU_CLEANUP_COMMAND_TYPE_MASK	0x1
1654 #define IGU_CLEANUP_COMMAND_TYPE_SHIFT	31
1655 	__le32 reserved1;
1656 };
1657 
1658 /* IGU firmware driver command */
1659 union igu_command {
1660 	struct igu_prod_cons_update prod_cons_update;
1661 	struct igu_cleanup cleanup;
1662 };
1663 
1664 /* IGU firmware driver command */
1665 struct igu_command_reg_ctrl {
1666 	__le16 opaque_fid;
1667 	__le16 igu_command_reg_ctrl_fields;
1668 #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_MASK	0xFFF
1669 #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_SHIFT	0
1670 #define IGU_COMMAND_REG_CTRL_RESERVED_MASK	0x7
1671 #define IGU_COMMAND_REG_CTRL_RESERVED_SHIFT	12
1672 #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_MASK	0x1
1673 #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_SHIFT	15
1674 };
1675 
1676 /* IGU mapping line structure */
1677 struct igu_mapping_line {
1678 	__le32 igu_mapping_line_fields;
1679 #define IGU_MAPPING_LINE_VALID_MASK		0x1
1680 #define IGU_MAPPING_LINE_VALID_SHIFT		0
1681 #define IGU_MAPPING_LINE_VECTOR_NUMBER_MASK	0xFF
1682 #define IGU_MAPPING_LINE_VECTOR_NUMBER_SHIFT	1
1683 #define IGU_MAPPING_LINE_FUNCTION_NUMBER_MASK	0xFF
1684 #define IGU_MAPPING_LINE_FUNCTION_NUMBER_SHIFT	9
1685 #define IGU_MAPPING_LINE_PF_VALID_MASK		0x1
1686 #define IGU_MAPPING_LINE_PF_VALID_SHIFT		17
1687 #define IGU_MAPPING_LINE_IPS_GROUP_MASK		0x3F
1688 #define IGU_MAPPING_LINE_IPS_GROUP_SHIFT	18
1689 #define IGU_MAPPING_LINE_RESERVED_MASK		0xFF
1690 #define IGU_MAPPING_LINE_RESERVED_SHIFT		24
1691 };
1692 
1693 /* IGU MSIX line structure */
1694 struct igu_msix_vector {
1695 	struct regpair address;
1696 	__le32 data;
1697 	__le32 msix_vector_fields;
1698 #define IGU_MSIX_VECTOR_MASK_BIT_MASK		0x1
1699 #define IGU_MSIX_VECTOR_MASK_BIT_SHIFT		0
1700 #define IGU_MSIX_VECTOR_RESERVED0_MASK		0x7FFF
1701 #define IGU_MSIX_VECTOR_RESERVED0_SHIFT		1
1702 #define IGU_MSIX_VECTOR_STEERING_TAG_MASK	0xFF
1703 #define IGU_MSIX_VECTOR_STEERING_TAG_SHIFT	16
1704 #define IGU_MSIX_VECTOR_RESERVED1_MASK		0xFF
1705 #define IGU_MSIX_VECTOR_RESERVED1_SHIFT		24
1706 };
1707 /* per encapsulation type enabling flags */
1708 struct prs_reg_encapsulation_type_en {
1709 	u8 flags;
1710 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_MASK		0x1
1711 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_SHIFT		0
1712 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_MASK		0x1
1713 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_SHIFT		1
1714 #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_MASK			0x1
1715 #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_SHIFT		2
1716 #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_MASK			0x1
1717 #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_SHIFT		3
1718 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_MASK	0x1
1719 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_SHIFT	4
1720 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_MASK	0x1
1721 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_SHIFT	5
1722 #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_MASK			0x3
1723 #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_SHIFT			6
1724 };
1725 
1726 enum pxp_tph_st_hint {
1727 	TPH_ST_HINT_BIDIR,
1728 	TPH_ST_HINT_REQUESTER,
1729 	TPH_ST_HINT_TARGET,
1730 	TPH_ST_HINT_TARGET_PRIO,
1731 	MAX_PXP_TPH_ST_HINT
1732 };
1733 
1734 /* QM hardware structure of enable bypass credit mask */
1735 struct qm_rf_bypass_mask {
1736 	u8 flags;
1737 #define QM_RF_BYPASS_MASK_LINEVOQ_MASK		0x1
1738 #define QM_RF_BYPASS_MASK_LINEVOQ_SHIFT		0
1739 #define QM_RF_BYPASS_MASK_RESERVED0_MASK	0x1
1740 #define QM_RF_BYPASS_MASK_RESERVED0_SHIFT	1
1741 #define QM_RF_BYPASS_MASK_PFWFQ_MASK		0x1
1742 #define QM_RF_BYPASS_MASK_PFWFQ_SHIFT		2
1743 #define QM_RF_BYPASS_MASK_VPWFQ_MASK		0x1
1744 #define QM_RF_BYPASS_MASK_VPWFQ_SHIFT		3
1745 #define QM_RF_BYPASS_MASK_PFRL_MASK		0x1
1746 #define QM_RF_BYPASS_MASK_PFRL_SHIFT		4
1747 #define QM_RF_BYPASS_MASK_VPQCNRL_MASK		0x1
1748 #define QM_RF_BYPASS_MASK_VPQCNRL_SHIFT		5
1749 #define QM_RF_BYPASS_MASK_FWPAUSE_MASK		0x1
1750 #define QM_RF_BYPASS_MASK_FWPAUSE_SHIFT		6
1751 #define QM_RF_BYPASS_MASK_RESERVED1_MASK	0x1
1752 #define QM_RF_BYPASS_MASK_RESERVED1_SHIFT	7
1753 };
1754 
1755 /* QM hardware structure of opportunistic credit mask */
1756 struct qm_rf_opportunistic_mask {
1757 	__le16 flags;
1758 #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_MASK		0x1
1759 #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_SHIFT		0
1760 #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_MASK		0x1
1761 #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_SHIFT		1
1762 #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_MASK		0x1
1763 #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_SHIFT		2
1764 #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_MASK		0x1
1765 #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_SHIFT		3
1766 #define QM_RF_OPPORTUNISTIC_MASK_PFRL_MASK		0x1
1767 #define QM_RF_OPPORTUNISTIC_MASK_PFRL_SHIFT		4
1768 #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_MASK		0x1
1769 #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_SHIFT		5
1770 #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_MASK		0x1
1771 #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_SHIFT		6
1772 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_MASK		0x1
1773 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_SHIFT	7
1774 #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_MASK	0x1
1775 #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_SHIFT	8
1776 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_MASK		0x7F
1777 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_SHIFT	9
1778 };
1779 
1780 /* QM hardware structure of QM map memory */
1781 struct qm_rf_pq_map_e4 {
1782 	__le32 reg;
1783 #define QM_RF_PQ_MAP_E4_PQ_VALID_MASK		0x1
1784 #define QM_RF_PQ_MAP_E4_PQ_VALID_SHIFT		0
1785 #define QM_RF_PQ_MAP_E4_RL_ID_MASK		0xFF
1786 #define QM_RF_PQ_MAP_E4_RL_ID_SHIFT		1
1787 #define QM_RF_PQ_MAP_E4_VP_PQ_ID_MASK		0x1FF
1788 #define QM_RF_PQ_MAP_E4_VP_PQ_ID_SHIFT		9
1789 #define QM_RF_PQ_MAP_E4_VOQ_MASK		0x1F
1790 #define QM_RF_PQ_MAP_E4_VOQ_SHIFT		18
1791 #define QM_RF_PQ_MAP_E4_WRR_WEIGHT_GROUP_MASK	0x3
1792 #define QM_RF_PQ_MAP_E4_WRR_WEIGHT_GROUP_SHIFT	23
1793 #define QM_RF_PQ_MAP_E4_RL_VALID_MASK		0x1
1794 #define QM_RF_PQ_MAP_E4_RL_VALID_SHIFT		25
1795 #define QM_RF_PQ_MAP_E4_RESERVED_MASK		0x3F
1796 #define QM_RF_PQ_MAP_E4_RESERVED_SHIFT		26
1797 };
1798 
1799 /* Completion params for aggregated interrupt completion */
1800 struct sdm_agg_int_comp_params {
1801 	__le16 params;
1802 #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_MASK	0x3F
1803 #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_SHIFT	0
1804 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_MASK	0x1
1805 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_SHIFT	6
1806 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_MASK	0x1FF
1807 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_SHIFT	7
1808 };
1809 
1810 /* SDM operation gen command (generate aggregative interrupt) */
1811 struct sdm_op_gen {
1812 	__le32 command;
1813 #define SDM_OP_GEN_COMP_PARAM_MASK	0xFFFF
1814 #define SDM_OP_GEN_COMP_PARAM_SHIFT	0
1815 #define SDM_OP_GEN_COMP_TYPE_MASK	0xF
1816 #define SDM_OP_GEN_COMP_TYPE_SHIFT	16
1817 #define SDM_OP_GEN_RESERVED_MASK	0xFFF
1818 #define SDM_OP_GEN_RESERVED_SHIFT	20
1819 };
1820 
1821 /* Physical memory descriptor */
1822 struct phys_mem_desc {
1823 	dma_addr_t phys_addr;
1824 	void *virt_addr;
1825 	u32 size;		/* In bytes */
1826 };
1827 
1828 /* Virtual memory descriptor */
1829 struct virt_mem_desc {
1830 	void *ptr;
1831 	u32 size;		/* In bytes */
1832 };
1833 
1834 /****************************************/
1835 /* Debug Tools HSI constants and macros */
1836 /****************************************/
1837 
1838 enum block_id {
1839 	BLOCK_GRC,
1840 	BLOCK_MISCS,
1841 	BLOCK_MISC,
1842 	BLOCK_DBU,
1843 	BLOCK_PGLUE_B,
1844 	BLOCK_CNIG,
1845 	BLOCK_CPMU,
1846 	BLOCK_NCSI,
1847 	BLOCK_OPTE,
1848 	BLOCK_BMB,
1849 	BLOCK_PCIE,
1850 	BLOCK_MCP,
1851 	BLOCK_MCP2,
1852 	BLOCK_PSWHST,
1853 	BLOCK_PSWHST2,
1854 	BLOCK_PSWRD,
1855 	BLOCK_PSWRD2,
1856 	BLOCK_PSWWR,
1857 	BLOCK_PSWWR2,
1858 	BLOCK_PSWRQ,
1859 	BLOCK_PSWRQ2,
1860 	BLOCK_PGLCS,
1861 	BLOCK_DMAE,
1862 	BLOCK_PTU,
1863 	BLOCK_TCM,
1864 	BLOCK_MCM,
1865 	BLOCK_UCM,
1866 	BLOCK_XCM,
1867 	BLOCK_YCM,
1868 	BLOCK_PCM,
1869 	BLOCK_QM,
1870 	BLOCK_TM,
1871 	BLOCK_DORQ,
1872 	BLOCK_BRB,
1873 	BLOCK_SRC,
1874 	BLOCK_PRS,
1875 	BLOCK_TSDM,
1876 	BLOCK_MSDM,
1877 	BLOCK_USDM,
1878 	BLOCK_XSDM,
1879 	BLOCK_YSDM,
1880 	BLOCK_PSDM,
1881 	BLOCK_TSEM,
1882 	BLOCK_MSEM,
1883 	BLOCK_USEM,
1884 	BLOCK_XSEM,
1885 	BLOCK_YSEM,
1886 	BLOCK_PSEM,
1887 	BLOCK_RSS,
1888 	BLOCK_TMLD,
1889 	BLOCK_MULD,
1890 	BLOCK_YULD,
1891 	BLOCK_XYLD,
1892 	BLOCK_PRM,
1893 	BLOCK_PBF_PB1,
1894 	BLOCK_PBF_PB2,
1895 	BLOCK_RPB,
1896 	BLOCK_BTB,
1897 	BLOCK_PBF,
1898 	BLOCK_RDIF,
1899 	BLOCK_TDIF,
1900 	BLOCK_CDU,
1901 	BLOCK_CCFC,
1902 	BLOCK_TCFC,
1903 	BLOCK_IGU,
1904 	BLOCK_CAU,
1905 	BLOCK_UMAC,
1906 	BLOCK_XMAC,
1907 	BLOCK_MSTAT,
1908 	BLOCK_DBG,
1909 	BLOCK_NIG,
1910 	BLOCK_WOL,
1911 	BLOCK_BMBN,
1912 	BLOCK_IPC,
1913 	BLOCK_NWM,
1914 	BLOCK_NWS,
1915 	BLOCK_MS,
1916 	BLOCK_PHY_PCIE,
1917 	BLOCK_LED,
1918 	BLOCK_AVS_WRAP,
1919 	BLOCK_PXPREQBUS,
1920 	BLOCK_BAR0_MAP,
1921 	BLOCK_MCP_FIO,
1922 	BLOCK_LAST_INIT,
1923 	BLOCK_PRS_FC,
1924 	BLOCK_PBF_FC,
1925 	BLOCK_NIG_LB_FC,
1926 	BLOCK_NIG_LB_FC_PLLH,
1927 	BLOCK_NIG_TX_FC_PLLH,
1928 	BLOCK_NIG_TX_FC,
1929 	BLOCK_NIG_RX_FC_PLLH,
1930 	BLOCK_NIG_RX_FC,
1931 	MAX_BLOCK_ID
1932 };
1933 
1934 /* binary debug buffer types */
1935 enum bin_dbg_buffer_type {
1936 	BIN_BUF_DBG_MODE_TREE,
1937 	BIN_BUF_DBG_DUMP_REG,
1938 	BIN_BUF_DBG_DUMP_MEM,
1939 	BIN_BUF_DBG_IDLE_CHK_REGS,
1940 	BIN_BUF_DBG_IDLE_CHK_IMMS,
1941 	BIN_BUF_DBG_IDLE_CHK_RULES,
1942 	BIN_BUF_DBG_IDLE_CHK_PARSING_DATA,
1943 	BIN_BUF_DBG_ATTN_BLOCKS,
1944 	BIN_BUF_DBG_ATTN_REGS,
1945 	BIN_BUF_DBG_ATTN_INDEXES,
1946 	BIN_BUF_DBG_ATTN_NAME_OFFSETS,
1947 	BIN_BUF_DBG_BLOCKS,
1948 	BIN_BUF_DBG_BLOCKS_CHIP_DATA,
1949 	BIN_BUF_DBG_BUS_LINES,
1950 	BIN_BUF_DBG_BLOCKS_USER_DATA,
1951 	BIN_BUF_DBG_BLOCKS_CHIP_USER_DATA,
1952 	BIN_BUF_DBG_BUS_LINE_NAME_OFFSETS,
1953 	BIN_BUF_DBG_RESET_REGS,
1954 	BIN_BUF_DBG_PARSING_STRINGS,
1955 	MAX_BIN_DBG_BUFFER_TYPE
1956 };
1957 
1958 
1959 /* Attention bit mapping */
1960 struct dbg_attn_bit_mapping {
1961 	u16 data;
1962 #define DBG_ATTN_BIT_MAPPING_VAL_MASK			0x7FFF
1963 #define DBG_ATTN_BIT_MAPPING_VAL_SHIFT			0
1964 #define DBG_ATTN_BIT_MAPPING_IS_UNUSED_BIT_CNT_MASK	0x1
1965 #define DBG_ATTN_BIT_MAPPING_IS_UNUSED_BIT_CNT_SHIFT	15
1966 };
1967 
1968 /* Attention block per-type data */
1969 struct dbg_attn_block_type_data {
1970 	u16 names_offset;
1971 	u16 reserved1;
1972 	u8 num_regs;
1973 	u8 reserved2;
1974 	u16 regs_offset;
1975 
1976 };
1977 
1978 /* Block attentions */
1979 struct dbg_attn_block {
1980 	struct dbg_attn_block_type_data per_type_data[2];
1981 };
1982 
1983 /* Attention register result */
1984 struct dbg_attn_reg_result {
1985 	u32 data;
1986 #define DBG_ATTN_REG_RESULT_STS_ADDRESS_MASK	0xFFFFFF
1987 #define DBG_ATTN_REG_RESULT_STS_ADDRESS_SHIFT	0
1988 #define DBG_ATTN_REG_RESULT_NUM_REG_ATTN_MASK	0xFF
1989 #define DBG_ATTN_REG_RESULT_NUM_REG_ATTN_SHIFT	24
1990 	u16 block_attn_offset;
1991 	u16 reserved;
1992 	u32 sts_val;
1993 	u32 mask_val;
1994 };
1995 
1996 /* Attention block result */
1997 struct dbg_attn_block_result {
1998 	u8 block_id;
1999 	u8 data;
2000 #define DBG_ATTN_BLOCK_RESULT_ATTN_TYPE_MASK	0x3
2001 #define DBG_ATTN_BLOCK_RESULT_ATTN_TYPE_SHIFT	0
2002 #define DBG_ATTN_BLOCK_RESULT_NUM_REGS_MASK	0x3F
2003 #define DBG_ATTN_BLOCK_RESULT_NUM_REGS_SHIFT	2
2004 	u16 names_offset;
2005 	struct dbg_attn_reg_result reg_results[15];
2006 };
2007 
2008 /* Mode header */
2009 struct dbg_mode_hdr {
2010 	u16 data;
2011 #define DBG_MODE_HDR_EVAL_MODE_MASK		0x1
2012 #define DBG_MODE_HDR_EVAL_MODE_SHIFT		0
2013 #define DBG_MODE_HDR_MODES_BUF_OFFSET_MASK	0x7FFF
2014 #define DBG_MODE_HDR_MODES_BUF_OFFSET_SHIFT	1
2015 };
2016 
2017 /* Attention register */
2018 struct dbg_attn_reg {
2019 	struct dbg_mode_hdr mode;
2020 	u16 block_attn_offset;
2021 	u32 data;
2022 #define DBG_ATTN_REG_STS_ADDRESS_MASK	0xFFFFFF
2023 #define DBG_ATTN_REG_STS_ADDRESS_SHIFT	0
2024 #define DBG_ATTN_REG_NUM_REG_ATTN_MASK	0xFF
2025 #define DBG_ATTN_REG_NUM_REG_ATTN_SHIFT 24
2026 	u32 sts_clr_address;
2027 	u32 mask_address;
2028 };
2029 
2030 /* Attention types */
2031 enum dbg_attn_type {
2032 	ATTN_TYPE_INTERRUPT,
2033 	ATTN_TYPE_PARITY,
2034 	MAX_DBG_ATTN_TYPE
2035 };
2036 
2037 /* Block debug data */
2038 struct dbg_block {
2039 	u8 name[15];
2040 	u8 associated_storm_letter;
2041 };
2042 
2043 /* Chip-specific block debug data */
2044 struct dbg_block_chip {
2045 	u8 flags;
2046 #define DBG_BLOCK_CHIP_IS_REMOVED_MASK		 0x1
2047 #define DBG_BLOCK_CHIP_IS_REMOVED_SHIFT		 0
2048 #define DBG_BLOCK_CHIP_HAS_RESET_REG_MASK	 0x1
2049 #define DBG_BLOCK_CHIP_HAS_RESET_REG_SHIFT	 1
2050 #define DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP_MASK  0x1
2051 #define DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP_SHIFT 2
2052 #define DBG_BLOCK_CHIP_HAS_DBG_BUS_MASK		 0x1
2053 #define DBG_BLOCK_CHIP_HAS_DBG_BUS_SHIFT	 3
2054 #define DBG_BLOCK_CHIP_HAS_LATENCY_EVENTS_MASK	 0x1
2055 #define DBG_BLOCK_CHIP_HAS_LATENCY_EVENTS_SHIFT  4
2056 #define DBG_BLOCK_CHIP_RESERVED0_MASK		 0x7
2057 #define DBG_BLOCK_CHIP_RESERVED0_SHIFT		 5
2058 	u8 dbg_client_id;
2059 	u8 reset_reg_id;
2060 	u8 reset_reg_bit_offset;
2061 	struct dbg_mode_hdr dbg_bus_mode;
2062 	u16 reserved1;
2063 	u8 reserved2;
2064 	u8 num_of_dbg_bus_lines;
2065 	u16 dbg_bus_lines_offset;
2066 	u32 dbg_select_reg_addr;
2067 	u32 dbg_dword_enable_reg_addr;
2068 	u32 dbg_shift_reg_addr;
2069 	u32 dbg_force_valid_reg_addr;
2070 	u32 dbg_force_frame_reg_addr;
2071 };
2072 
2073 /* Chip-specific block user debug data */
2074 struct dbg_block_chip_user {
2075 	u8 num_of_dbg_bus_lines;
2076 	u8 has_latency_events;
2077 	u16 names_offset;
2078 };
2079 
2080 /* Block user debug data */
2081 struct dbg_block_user {
2082 	u8 name[16];
2083 };
2084 
2085 /* Block Debug line data */
2086 struct dbg_bus_line {
2087 	u8 data;
2088 #define DBG_BUS_LINE_NUM_OF_GROUPS_MASK		0xF
2089 #define DBG_BUS_LINE_NUM_OF_GROUPS_SHIFT	0
2090 #define DBG_BUS_LINE_IS_256B_MASK		0x1
2091 #define DBG_BUS_LINE_IS_256B_SHIFT		4
2092 #define DBG_BUS_LINE_RESERVED_MASK		0x7
2093 #define DBG_BUS_LINE_RESERVED_SHIFT		5
2094 	u8 group_sizes;
2095 };
2096 
2097 /* Condition header for registers dump */
2098 struct dbg_dump_cond_hdr {
2099 	struct dbg_mode_hdr mode; /* Mode header */
2100 	u8 block_id; /* block ID */
2101 	u8 data_size; /* size in dwords of the data following this header */
2102 };
2103 
2104 /* Memory data for registers dump */
2105 struct dbg_dump_mem {
2106 	u32 dword0;
2107 #define DBG_DUMP_MEM_ADDRESS_MASK	0xFFFFFF
2108 #define DBG_DUMP_MEM_ADDRESS_SHIFT	0
2109 #define DBG_DUMP_MEM_MEM_GROUP_ID_MASK	0xFF
2110 #define DBG_DUMP_MEM_MEM_GROUP_ID_SHIFT	24
2111 	u32 dword1;
2112 #define DBG_DUMP_MEM_LENGTH_MASK	0xFFFFFF
2113 #define DBG_DUMP_MEM_LENGTH_SHIFT	0
2114 #define DBG_DUMP_MEM_WIDE_BUS_MASK	0x1
2115 #define DBG_DUMP_MEM_WIDE_BUS_SHIFT	24
2116 #define DBG_DUMP_MEM_RESERVED_MASK	0x7F
2117 #define DBG_DUMP_MEM_RESERVED_SHIFT	25
2118 };
2119 
2120 /* Register data for registers dump */
2121 struct dbg_dump_reg {
2122 	u32 data;
2123 #define DBG_DUMP_REG_ADDRESS_MASK	0x7FFFFF
2124 #define DBG_DUMP_REG_ADDRESS_SHIFT	0
2125 #define DBG_DUMP_REG_WIDE_BUS_MASK	0x1
2126 #define DBG_DUMP_REG_WIDE_BUS_SHIFT	23
2127 #define DBG_DUMP_REG_LENGTH_MASK	0xFF
2128 #define DBG_DUMP_REG_LENGTH_SHIFT	24
2129 };
2130 
2131 /* Split header for registers dump */
2132 struct dbg_dump_split_hdr {
2133 	u32 hdr;
2134 #define DBG_DUMP_SPLIT_HDR_DATA_SIZE_MASK	0xFFFFFF
2135 #define DBG_DUMP_SPLIT_HDR_DATA_SIZE_SHIFT	0
2136 #define DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID_MASK	0xFF
2137 #define DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID_SHIFT	24
2138 };
2139 
2140 /* Condition header for idle check */
2141 struct dbg_idle_chk_cond_hdr {
2142 	struct dbg_mode_hdr mode; /* Mode header */
2143 	u16 data_size; /* size in dwords of the data following this header */
2144 };
2145 
2146 /* Idle Check condition register */
2147 struct dbg_idle_chk_cond_reg {
2148 	u32 data;
2149 #define DBG_IDLE_CHK_COND_REG_ADDRESS_MASK	0x7FFFFF
2150 #define DBG_IDLE_CHK_COND_REG_ADDRESS_SHIFT	0
2151 #define DBG_IDLE_CHK_COND_REG_WIDE_BUS_MASK	0x1
2152 #define DBG_IDLE_CHK_COND_REG_WIDE_BUS_SHIFT	23
2153 #define DBG_IDLE_CHK_COND_REG_BLOCK_ID_MASK	0xFF
2154 #define DBG_IDLE_CHK_COND_REG_BLOCK_ID_SHIFT	24
2155 	u16 num_entries;
2156 	u8 entry_size;
2157 	u8 start_entry;
2158 };
2159 
2160 /* Idle Check info register */
2161 struct dbg_idle_chk_info_reg {
2162 	u32 data;
2163 #define DBG_IDLE_CHK_INFO_REG_ADDRESS_MASK	0x7FFFFF
2164 #define DBG_IDLE_CHK_INFO_REG_ADDRESS_SHIFT	0
2165 #define DBG_IDLE_CHK_INFO_REG_WIDE_BUS_MASK	0x1
2166 #define DBG_IDLE_CHK_INFO_REG_WIDE_BUS_SHIFT	23
2167 #define DBG_IDLE_CHK_INFO_REG_BLOCK_ID_MASK	0xFF
2168 #define DBG_IDLE_CHK_INFO_REG_BLOCK_ID_SHIFT	24
2169 	u16 size; /* register size in dwords */
2170 	struct dbg_mode_hdr mode; /* Mode header */
2171 };
2172 
2173 /* Idle Check register */
2174 union dbg_idle_chk_reg {
2175 	struct dbg_idle_chk_cond_reg cond_reg; /* condition register */
2176 	struct dbg_idle_chk_info_reg info_reg; /* info register */
2177 };
2178 
2179 /* Idle Check result header */
2180 struct dbg_idle_chk_result_hdr {
2181 	u16 rule_id; /* Failing rule index */
2182 	u16 mem_entry_id; /* Failing memory entry index */
2183 	u8 num_dumped_cond_regs; /* number of dumped condition registers */
2184 	u8 num_dumped_info_regs; /* number of dumped condition registers */
2185 	u8 severity; /* from dbg_idle_chk_severity_types enum */
2186 	u8 reserved;
2187 };
2188 
2189 /* Idle Check result register header */
2190 struct dbg_idle_chk_result_reg_hdr {
2191 	u8 data;
2192 #define DBG_IDLE_CHK_RESULT_REG_HDR_IS_MEM_MASK  0x1
2193 #define DBG_IDLE_CHK_RESULT_REG_HDR_IS_MEM_SHIFT 0
2194 #define DBG_IDLE_CHK_RESULT_REG_HDR_REG_ID_MASK  0x7F
2195 #define DBG_IDLE_CHK_RESULT_REG_HDR_REG_ID_SHIFT 1
2196 	u8 start_entry; /* index of the first checked entry */
2197 	u16 size; /* register size in dwords */
2198 };
2199 
2200 /* Idle Check rule */
2201 struct dbg_idle_chk_rule {
2202 	u16 rule_id; /* Idle Check rule ID */
2203 	u8 severity; /* value from dbg_idle_chk_severity_types enum */
2204 	u8 cond_id; /* Condition ID */
2205 	u8 num_cond_regs; /* number of condition registers */
2206 	u8 num_info_regs; /* number of info registers */
2207 	u8 num_imms; /* number of immediates in the condition */
2208 	u8 reserved1;
2209 	u16 reg_offset; /* offset of this rules registers in the idle check
2210 			 * register array (in dbg_idle_chk_reg units).
2211 			 */
2212 	u16 imm_offset; /* offset of this rules immediate values in the
2213 			 * immediate values array (in dwords).
2214 			 */
2215 };
2216 
2217 /* Idle Check rule parsing data */
2218 struct dbg_idle_chk_rule_parsing_data {
2219 	u32 data;
2220 #define DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG_MASK	0x1
2221 #define DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG_SHIFT	0
2222 #define DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET_MASK	0x7FFFFFFF
2223 #define DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET_SHIFT	1
2224 };
2225 
2226 /* Idle check severity types */
2227 enum dbg_idle_chk_severity_types {
2228 	/* idle check failure should cause an error */
2229 	IDLE_CHK_SEVERITY_ERROR,
2230 	/* idle check failure should cause an error only if theres no traffic */
2231 	IDLE_CHK_SEVERITY_ERROR_NO_TRAFFIC,
2232 	/* idle check failure should cause a warning */
2233 	IDLE_CHK_SEVERITY_WARNING,
2234 	MAX_DBG_IDLE_CHK_SEVERITY_TYPES
2235 };
2236 
2237 /* Reset register */
2238 struct dbg_reset_reg {
2239 	u32 data;
2240 #define DBG_RESET_REG_ADDR_MASK        0xFFFFFF
2241 #define DBG_RESET_REG_ADDR_SHIFT       0
2242 #define DBG_RESET_REG_IS_REMOVED_MASK  0x1
2243 #define DBG_RESET_REG_IS_REMOVED_SHIFT 24
2244 #define DBG_RESET_REG_RESERVED_MASK    0x7F
2245 #define DBG_RESET_REG_RESERVED_SHIFT   25
2246 };
2247 
2248 /* Debug Bus block data */
2249 struct dbg_bus_block_data {
2250 	u8 enable_mask;
2251 	u8 right_shift;
2252 	u8 force_valid_mask;
2253 	u8 force_frame_mask;
2254 	u8 dword_mask;
2255 	u8 line_num;
2256 	u8 hw_id;
2257 	u8 flags;
2258 #define DBG_BUS_BLOCK_DATA_IS_256B_LINE_MASK  0x1
2259 #define DBG_BUS_BLOCK_DATA_IS_256B_LINE_SHIFT 0
2260 #define DBG_BUS_BLOCK_DATA_RESERVED_MASK      0x7F
2261 #define DBG_BUS_BLOCK_DATA_RESERVED_SHIFT     1
2262 };
2263 
2264 enum dbg_bus_clients {
2265 	DBG_BUS_CLIENT_RBCN,
2266 	DBG_BUS_CLIENT_RBCP,
2267 	DBG_BUS_CLIENT_RBCR,
2268 	DBG_BUS_CLIENT_RBCT,
2269 	DBG_BUS_CLIENT_RBCU,
2270 	DBG_BUS_CLIENT_RBCF,
2271 	DBG_BUS_CLIENT_RBCX,
2272 	DBG_BUS_CLIENT_RBCS,
2273 	DBG_BUS_CLIENT_RBCH,
2274 	DBG_BUS_CLIENT_RBCZ,
2275 	DBG_BUS_CLIENT_OTHER_ENGINE,
2276 	DBG_BUS_CLIENT_TIMESTAMP,
2277 	DBG_BUS_CLIENT_CPU,
2278 	DBG_BUS_CLIENT_RBCY,
2279 	DBG_BUS_CLIENT_RBCQ,
2280 	DBG_BUS_CLIENT_RBCM,
2281 	DBG_BUS_CLIENT_RBCB,
2282 	DBG_BUS_CLIENT_RBCW,
2283 	DBG_BUS_CLIENT_RBCV,
2284 	MAX_DBG_BUS_CLIENTS
2285 };
2286 
2287 /* Debug Bus constraint operation types */
2288 enum dbg_bus_constraint_ops {
2289 	DBG_BUS_CONSTRAINT_OP_EQ,
2290 	DBG_BUS_CONSTRAINT_OP_NE,
2291 	DBG_BUS_CONSTRAINT_OP_LT,
2292 	DBG_BUS_CONSTRAINT_OP_LTC,
2293 	DBG_BUS_CONSTRAINT_OP_LE,
2294 	DBG_BUS_CONSTRAINT_OP_LEC,
2295 	DBG_BUS_CONSTRAINT_OP_GT,
2296 	DBG_BUS_CONSTRAINT_OP_GTC,
2297 	DBG_BUS_CONSTRAINT_OP_GE,
2298 	DBG_BUS_CONSTRAINT_OP_GEC,
2299 	MAX_DBG_BUS_CONSTRAINT_OPS
2300 };
2301 
2302 /* Debug Bus trigger state data */
2303 struct dbg_bus_trigger_state_data {
2304 	u8 msg_len;
2305 	u8 constraint_dword_mask;
2306 	u8 storm_id;
2307 	u8 reserved;
2308 };
2309 
2310 /* Debug Bus memory address */
2311 struct dbg_bus_mem_addr {
2312 	u32 lo;
2313 	u32 hi;
2314 };
2315 
2316 /* Debug Bus PCI buffer data */
2317 struct dbg_bus_pci_buf_data {
2318 	struct dbg_bus_mem_addr phys_addr; /* PCI buffer physical address */
2319 	struct dbg_bus_mem_addr virt_addr; /* PCI buffer virtual address */
2320 	u32 size; /* PCI buffer size in bytes */
2321 };
2322 
2323 /* Debug Bus Storm EID range filter params */
2324 struct dbg_bus_storm_eid_range_params {
2325 	u8 min; /* Minimal event ID to filter on */
2326 	u8 max; /* Maximal event ID to filter on */
2327 };
2328 
2329 /* Debug Bus Storm EID mask filter params */
2330 struct dbg_bus_storm_eid_mask_params {
2331 	u8 val; /* Event ID value */
2332 	u8 mask; /* Event ID mask. 1s in the mask = dont care bits. */
2333 };
2334 
2335 /* Debug Bus Storm EID filter params */
2336 union dbg_bus_storm_eid_params {
2337 	struct dbg_bus_storm_eid_range_params range;
2338 	struct dbg_bus_storm_eid_mask_params mask;
2339 };
2340 
2341 /* Debug Bus Storm data */
2342 struct dbg_bus_storm_data {
2343 	u8 enabled;
2344 	u8 mode;
2345 	u8 hw_id;
2346 	u8 eid_filter_en;
2347 	u8 eid_range_not_mask;
2348 	u8 cid_filter_en;
2349 	union dbg_bus_storm_eid_params eid_filter_params;
2350 	u32 cid;
2351 };
2352 
2353 /* Debug Bus data */
2354 struct dbg_bus_data {
2355 	u32 app_version;
2356 	u8 state;
2357 	u8 mode_256b_en;
2358 	u8 num_enabled_blocks;
2359 	u8 num_enabled_storms;
2360 	u8 target;
2361 	u8 one_shot_en;
2362 	u8 grc_input_en;
2363 	u8 timestamp_input_en;
2364 	u8 filter_en;
2365 	u8 adding_filter;
2366 	u8 filter_pre_trigger;
2367 	u8 filter_post_trigger;
2368 	u8 trigger_en;
2369 	u8 filter_constraint_dword_mask;
2370 	u8 next_trigger_state;
2371 	u8 next_constraint_id;
2372 	struct dbg_bus_trigger_state_data trigger_states[3];
2373 	u8 filter_msg_len;
2374 	u8 rcv_from_other_engine;
2375 	u8 blocks_dword_mask;
2376 	u8 blocks_dword_overlap;
2377 	u32 hw_id_mask;
2378 	struct dbg_bus_pci_buf_data pci_buf;
2379 	struct dbg_bus_block_data blocks[132];
2380 	struct dbg_bus_storm_data storms[6];
2381 };
2382 
2383 /* Debug bus states */
2384 enum dbg_bus_states {
2385 	DBG_BUS_STATE_IDLE,
2386 	DBG_BUS_STATE_READY,
2387 	DBG_BUS_STATE_RECORDING,
2388 	DBG_BUS_STATE_STOPPED,
2389 	MAX_DBG_BUS_STATES
2390 };
2391 
2392 /* Debug Bus Storm modes */
2393 enum dbg_bus_storm_modes {
2394 	DBG_BUS_STORM_MODE_PRINTF,
2395 	DBG_BUS_STORM_MODE_PRAM_ADDR,
2396 	DBG_BUS_STORM_MODE_DRA_RW,
2397 	DBG_BUS_STORM_MODE_DRA_W,
2398 	DBG_BUS_STORM_MODE_LD_ST_ADDR,
2399 	DBG_BUS_STORM_MODE_DRA_FSM,
2400 	DBG_BUS_STORM_MODE_FAST_DBGMUX,
2401 	DBG_BUS_STORM_MODE_RH,
2402 	DBG_BUS_STORM_MODE_RH_WITH_STORE,
2403 	DBG_BUS_STORM_MODE_FOC,
2404 	DBG_BUS_STORM_MODE_EXT_STORE,
2405 	MAX_DBG_BUS_STORM_MODES
2406 };
2407 
2408 /* Debug bus target IDs */
2409 enum dbg_bus_targets {
2410 	DBG_BUS_TARGET_ID_INT_BUF,
2411 	DBG_BUS_TARGET_ID_NIG,
2412 	DBG_BUS_TARGET_ID_PCI,
2413 	MAX_DBG_BUS_TARGETS
2414 };
2415 
2416 /* GRC Dump data */
2417 struct dbg_grc_data {
2418 	u8 params_initialized;
2419 	u8 reserved1;
2420 	u16 reserved2;
2421 	u32 param_val[48];
2422 };
2423 
2424 /* Debug GRC params */
2425 enum dbg_grc_params {
2426 	DBG_GRC_PARAM_DUMP_TSTORM,
2427 	DBG_GRC_PARAM_DUMP_MSTORM,
2428 	DBG_GRC_PARAM_DUMP_USTORM,
2429 	DBG_GRC_PARAM_DUMP_XSTORM,
2430 	DBG_GRC_PARAM_DUMP_YSTORM,
2431 	DBG_GRC_PARAM_DUMP_PSTORM,
2432 	DBG_GRC_PARAM_DUMP_REGS,
2433 	DBG_GRC_PARAM_DUMP_RAM,
2434 	DBG_GRC_PARAM_DUMP_PBUF,
2435 	DBG_GRC_PARAM_DUMP_IOR,
2436 	DBG_GRC_PARAM_DUMP_VFC,
2437 	DBG_GRC_PARAM_DUMP_CM_CTX,
2438 	DBG_GRC_PARAM_DUMP_PXP,
2439 	DBG_GRC_PARAM_DUMP_RSS,
2440 	DBG_GRC_PARAM_DUMP_CAU,
2441 	DBG_GRC_PARAM_DUMP_QM,
2442 	DBG_GRC_PARAM_DUMP_MCP,
2443 	DBG_GRC_PARAM_DUMP_DORQ,
2444 	DBG_GRC_PARAM_DUMP_CFC,
2445 	DBG_GRC_PARAM_DUMP_IGU,
2446 	DBG_GRC_PARAM_DUMP_BRB,
2447 	DBG_GRC_PARAM_DUMP_BTB,
2448 	DBG_GRC_PARAM_DUMP_BMB,
2449 	DBG_GRC_PARAM_RESERVD1,
2450 	DBG_GRC_PARAM_DUMP_MULD,
2451 	DBG_GRC_PARAM_DUMP_PRS,
2452 	DBG_GRC_PARAM_DUMP_DMAE,
2453 	DBG_GRC_PARAM_DUMP_TM,
2454 	DBG_GRC_PARAM_DUMP_SDM,
2455 	DBG_GRC_PARAM_DUMP_DIF,
2456 	DBG_GRC_PARAM_DUMP_STATIC,
2457 	DBG_GRC_PARAM_UNSTALL,
2458 	DBG_GRC_PARAM_RESERVED2,
2459 	DBG_GRC_PARAM_MCP_TRACE_META_SIZE,
2460 	DBG_GRC_PARAM_EXCLUDE_ALL,
2461 	DBG_GRC_PARAM_CRASH,
2462 	DBG_GRC_PARAM_PARITY_SAFE,
2463 	DBG_GRC_PARAM_DUMP_CM,
2464 	DBG_GRC_PARAM_DUMP_PHY,
2465 	DBG_GRC_PARAM_NO_MCP,
2466 	DBG_GRC_PARAM_NO_FW_VER,
2467 	DBG_GRC_PARAM_RESERVED3,
2468 	DBG_GRC_PARAM_DUMP_MCP_HW_DUMP,
2469 	DBG_GRC_PARAM_DUMP_ILT_CDUC,
2470 	DBG_GRC_PARAM_DUMP_ILT_CDUT,
2471 	DBG_GRC_PARAM_DUMP_CAU_EXT,
2472 	MAX_DBG_GRC_PARAMS
2473 };
2474 
2475 /* Debug status codes */
2476 enum dbg_status {
2477 	DBG_STATUS_OK,
2478 	DBG_STATUS_APP_VERSION_NOT_SET,
2479 	DBG_STATUS_UNSUPPORTED_APP_VERSION,
2480 	DBG_STATUS_DBG_BLOCK_NOT_RESET,
2481 	DBG_STATUS_INVALID_ARGS,
2482 	DBG_STATUS_OUTPUT_ALREADY_SET,
2483 	DBG_STATUS_INVALID_PCI_BUF_SIZE,
2484 	DBG_STATUS_PCI_BUF_ALLOC_FAILED,
2485 	DBG_STATUS_PCI_BUF_NOT_ALLOCATED,
2486 	DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS,
2487 	DBG_STATUS_NO_MATCHING_FRAMING_MODE,
2488 	DBG_STATUS_VFC_READ_ERROR,
2489 	DBG_STATUS_STORM_ALREADY_ENABLED,
2490 	DBG_STATUS_STORM_NOT_ENABLED,
2491 	DBG_STATUS_BLOCK_ALREADY_ENABLED,
2492 	DBG_STATUS_BLOCK_NOT_ENABLED,
2493 	DBG_STATUS_NO_INPUT_ENABLED,
2494 	DBG_STATUS_NO_FILTER_TRIGGER_256B,
2495 	DBG_STATUS_FILTER_ALREADY_ENABLED,
2496 	DBG_STATUS_TRIGGER_ALREADY_ENABLED,
2497 	DBG_STATUS_TRIGGER_NOT_ENABLED,
2498 	DBG_STATUS_CANT_ADD_CONSTRAINT,
2499 	DBG_STATUS_TOO_MANY_TRIGGER_STATES,
2500 	DBG_STATUS_TOO_MANY_CONSTRAINTS,
2501 	DBG_STATUS_RECORDING_NOT_STARTED,
2502 	DBG_STATUS_DATA_DIDNT_TRIGGER,
2503 	DBG_STATUS_NO_DATA_RECORDED,
2504 	DBG_STATUS_DUMP_BUF_TOO_SMALL,
2505 	DBG_STATUS_DUMP_NOT_CHUNK_ALIGNED,
2506 	DBG_STATUS_UNKNOWN_CHIP,
2507 	DBG_STATUS_VIRT_MEM_ALLOC_FAILED,
2508 	DBG_STATUS_BLOCK_IN_RESET,
2509 	DBG_STATUS_INVALID_TRACE_SIGNATURE,
2510 	DBG_STATUS_INVALID_NVRAM_BUNDLE,
2511 	DBG_STATUS_NVRAM_GET_IMAGE_FAILED,
2512 	DBG_STATUS_NON_ALIGNED_NVRAM_IMAGE,
2513 	DBG_STATUS_NVRAM_READ_FAILED,
2514 	DBG_STATUS_IDLE_CHK_PARSE_FAILED,
2515 	DBG_STATUS_MCP_TRACE_BAD_DATA,
2516 	DBG_STATUS_MCP_TRACE_NO_META,
2517 	DBG_STATUS_MCP_COULD_NOT_HALT,
2518 	DBG_STATUS_MCP_COULD_NOT_RESUME,
2519 	DBG_STATUS_RESERVED0,
2520 	DBG_STATUS_SEMI_FIFO_NOT_EMPTY,
2521 	DBG_STATUS_IGU_FIFO_BAD_DATA,
2522 	DBG_STATUS_MCP_COULD_NOT_MASK_PRTY,
2523 	DBG_STATUS_FW_ASSERTS_PARSE_FAILED,
2524 	DBG_STATUS_REG_FIFO_BAD_DATA,
2525 	DBG_STATUS_PROTECTION_OVERRIDE_BAD_DATA,
2526 	DBG_STATUS_DBG_ARRAY_NOT_SET,
2527 	DBG_STATUS_RESERVED1,
2528 	DBG_STATUS_NON_MATCHING_LINES,
2529 	DBG_STATUS_INSUFFICIENT_HW_IDS,
2530 	DBG_STATUS_DBG_BUS_IN_USE,
2531 	DBG_STATUS_INVALID_STORM_DBG_MODE,
2532 	DBG_STATUS_OTHER_ENGINE_BB_ONLY,
2533 	DBG_STATUS_FILTER_SINGLE_HW_ID,
2534 	DBG_STATUS_TRIGGER_SINGLE_HW_ID,
2535 	DBG_STATUS_MISSING_TRIGGER_STATE_STORM,
2536 	MAX_DBG_STATUS
2537 };
2538 
2539 /* Debug Storms IDs */
2540 enum dbg_storms {
2541 	DBG_TSTORM_ID,
2542 	DBG_MSTORM_ID,
2543 	DBG_USTORM_ID,
2544 	DBG_XSTORM_ID,
2545 	DBG_YSTORM_ID,
2546 	DBG_PSTORM_ID,
2547 	MAX_DBG_STORMS
2548 };
2549 
2550 /* Idle Check data */
2551 struct idle_chk_data {
2552 	u32 buf_size;
2553 	u8 buf_size_set;
2554 	u8 reserved1;
2555 	u16 reserved2;
2556 };
2557 
2558 struct pretend_params {
2559 	u8 split_type;
2560 	u8 reserved;
2561 	u16 split_id;
2562 };
2563 
2564 /* Debug Tools data (per HW function)
2565  */
2566 struct dbg_tools_data {
2567 	struct dbg_grc_data grc;
2568 	struct dbg_bus_data bus;
2569 	struct idle_chk_data idle_chk;
2570 	u8 mode_enable[40];
2571 	u8 block_in_reset[132];
2572 	u8 chip_id;
2573 	u8 hw_type;
2574 	u8 num_ports;
2575 	u8 num_pfs_per_port;
2576 	u8 num_vfs;
2577 	u8 initialized;
2578 	u8 use_dmae;
2579 	u8 reserved;
2580 	struct pretend_params pretend;
2581 	u32 num_regs_read;
2582 };
2583 
2584 /* ILT Clients */
2585 enum ilt_clients {
2586 	ILT_CLI_CDUC,
2587 	ILT_CLI_CDUT,
2588 	ILT_CLI_QM,
2589 	ILT_CLI_TM,
2590 	ILT_CLI_SRC,
2591 	ILT_CLI_TSDM,
2592 	ILT_CLI_RGFS,
2593 	ILT_CLI_TGFS,
2594 	MAX_ILT_CLIENTS
2595 };
2596 
2597 /********************************/
2598 /* HSI Init Functions constants */
2599 /********************************/
2600 
2601 /* Number of VLAN priorities */
2602 #define NUM_OF_VLAN_PRIORITIES	8
2603 
2604 /* BRB RAM init requirements */
2605 struct init_brb_ram_req {
2606 	u32 guranteed_per_tc;
2607 	u32 headroom_per_tc;
2608 	u32 min_pkt_size;
2609 	u32 max_ports_per_engine;
2610 	u8 num_active_tcs[MAX_NUM_PORTS];
2611 };
2612 
2613 /* ETS per-TC init requirements */
2614 struct init_ets_tc_req {
2615 	u8 use_sp;
2616 	u8 use_wfq;
2617 	u16 weight;
2618 };
2619 
2620 /* ETS init requirements */
2621 struct init_ets_req {
2622 	u32 mtu;
2623 	struct init_ets_tc_req tc_req[NUM_OF_TCS];
2624 };
2625 
2626 /* NIG LB RL init requirements */
2627 struct init_nig_lb_rl_req {
2628 	u16 lb_mac_rate;
2629 	u16 lb_rate;
2630 	u32 mtu;
2631 	u16 tc_rate[NUM_OF_PHYS_TCS];
2632 };
2633 
2634 /* NIG TC mapping for each priority */
2635 struct init_nig_pri_tc_map_entry {
2636 	u8 tc_id;
2637 	u8 valid;
2638 };
2639 
2640 /* NIG priority to TC map init requirements */
2641 struct init_nig_pri_tc_map_req {
2642 	struct init_nig_pri_tc_map_entry pri[NUM_OF_VLAN_PRIORITIES];
2643 };
2644 
2645 /* QM per global RL init parameters */
2646 struct init_qm_global_rl_params {
2647 	u32 rate_limit;
2648 };
2649 
2650 /* QM per-port init parameters */
2651 struct init_qm_port_params {
2652 	u16 active_phys_tcs;
2653 	u16 num_pbf_cmd_lines;
2654 	u16 num_btb_blocks;
2655 	u8 active;
2656 	u8 reserved;
2657 };
2658 
2659 /* QM per-PQ init parameters */
2660 struct init_qm_pq_params {
2661 	u8 vport_id;
2662 	u8 tc_id;
2663 	u8 wrr_group;
2664 	u8 rl_valid;
2665 	u16 rl_id;
2666 	u8 port_id;
2667 	u8 reserved;
2668 };
2669 
2670 /* QM per-vport init parameters */
2671 struct init_qm_vport_params {
2672 	u16 wfq;
2673 	u16 first_tx_pq_id[NUM_OF_TCS];
2674 };
2675 
2676 /**************************************/
2677 /* Init Tool HSI constants and macros */
2678 /**************************************/
2679 
2680 /* Width of GRC address in bits (addresses are specified in dwords) */
2681 #define GRC_ADDR_BITS	23
2682 #define MAX_GRC_ADDR	(BIT(GRC_ADDR_BITS) - 1)
2683 
2684 /* indicates an init that should be applied to any phase ID */
2685 #define ANY_PHASE_ID	0xffff
2686 
2687 /* Max size in dwords of a zipped array */
2688 #define MAX_ZIPPED_SIZE	8192
2689 enum chip_ids {
2690 	CHIP_BB,
2691 	CHIP_K2,
2692 	MAX_CHIP_IDS
2693 };
2694 
2695 struct fw_asserts_ram_section {
2696 	__le16 section_ram_line_offset;
2697 	__le16 section_ram_line_size;
2698 	u8 list_dword_offset;
2699 	u8 list_element_dword_size;
2700 	u8 list_num_elements;
2701 	u8 list_next_index_dword_offset;
2702 };
2703 
2704 struct fw_ver_num {
2705 	u8 major;
2706 	u8 minor;
2707 	u8 rev;
2708 	u8 eng;
2709 };
2710 
2711 struct fw_ver_info {
2712 	__le16 tools_ver;
2713 	u8 image_id;
2714 	u8 reserved1;
2715 	struct fw_ver_num num;
2716 	__le32 timestamp;
2717 	__le32 reserved2;
2718 };
2719 
2720 struct fw_info {
2721 	struct fw_ver_info ver;
2722 	struct fw_asserts_ram_section fw_asserts_section;
2723 };
2724 
2725 struct fw_info_location {
2726 	__le32 grc_addr;
2727 	__le32 size;
2728 };
2729 
2730 enum init_modes {
2731 	MODE_RESERVED,
2732 	MODE_BB,
2733 	MODE_K2,
2734 	MODE_ASIC,
2735 	MODE_RESERVED2,
2736 	MODE_RESERVED3,
2737 	MODE_RESERVED4,
2738 	MODE_RESERVED5,
2739 	MODE_SF,
2740 	MODE_MF_SD,
2741 	MODE_MF_SI,
2742 	MODE_PORTS_PER_ENG_1,
2743 	MODE_PORTS_PER_ENG_2,
2744 	MODE_PORTS_PER_ENG_4,
2745 	MODE_100G,
2746 	MODE_RESERVED6,
2747 	MODE_RESERVED7,
2748 	MAX_INIT_MODES
2749 };
2750 
2751 enum init_phases {
2752 	PHASE_ENGINE,
2753 	PHASE_PORT,
2754 	PHASE_PF,
2755 	PHASE_VF,
2756 	PHASE_QM_PF,
2757 	MAX_INIT_PHASES
2758 };
2759 
2760 enum init_split_types {
2761 	SPLIT_TYPE_NONE,
2762 	SPLIT_TYPE_PORT,
2763 	SPLIT_TYPE_PF,
2764 	SPLIT_TYPE_PORT_PF,
2765 	SPLIT_TYPE_VF,
2766 	MAX_INIT_SPLIT_TYPES
2767 };
2768 
2769 /* Binary buffer header */
2770 struct bin_buffer_hdr {
2771 	u32 offset;
2772 	u32 length;
2773 };
2774 
2775 /* Binary init buffer types */
2776 enum bin_init_buffer_type {
2777 	BIN_BUF_INIT_FW_VER_INFO,
2778 	BIN_BUF_INIT_CMD,
2779 	BIN_BUF_INIT_VAL,
2780 	BIN_BUF_INIT_MODE_TREE,
2781 	BIN_BUF_INIT_IRO,
2782 	BIN_BUF_INIT_OVERLAYS,
2783 	MAX_BIN_INIT_BUFFER_TYPE
2784 };
2785 
2786 /* FW overlay buffer header */
2787 struct fw_overlay_buf_hdr {
2788 	u32 data;
2789 #define FW_OVERLAY_BUF_HDR_STORM_ID_MASK  0xFF
2790 #define FW_OVERLAY_BUF_HDR_STORM_ID_SHIFT 0
2791 #define FW_OVERLAY_BUF_HDR_BUF_SIZE_MASK  0xFFFFFF
2792 #define FW_OVERLAY_BUF_HDR_BUF_SIZE_SHIFT 8
2793 };
2794 
2795 /* init array header: raw */
2796 struct init_array_raw_hdr {
2797 	__le32						data;
2798 #define INIT_ARRAY_RAW_HDR_TYPE_MASK			0xF
2799 #define INIT_ARRAY_RAW_HDR_TYPE_SHIFT			0
2800 #define INIT_ARRAY_RAW_HDR_PARAMS_MASK			0xFFFFFFF
2801 #define INIT_ARRAY_RAW_HDR_PARAMS_SHIFT			4
2802 };
2803 
2804 /* init array header: standard */
2805 struct init_array_standard_hdr {
2806 	__le32						data;
2807 #define INIT_ARRAY_STANDARD_HDR_TYPE_MASK		0xF
2808 #define INIT_ARRAY_STANDARD_HDR_TYPE_SHIFT		0
2809 #define INIT_ARRAY_STANDARD_HDR_SIZE_MASK		0xFFFFFFF
2810 #define INIT_ARRAY_STANDARD_HDR_SIZE_SHIFT		4
2811 };
2812 
2813 /* init array header: zipped */
2814 struct init_array_zipped_hdr {
2815 	__le32						data;
2816 #define INIT_ARRAY_ZIPPED_HDR_TYPE_MASK			0xF
2817 #define INIT_ARRAY_ZIPPED_HDR_TYPE_SHIFT		0
2818 #define INIT_ARRAY_ZIPPED_HDR_ZIPPED_SIZE_MASK		0xFFFFFFF
2819 #define INIT_ARRAY_ZIPPED_HDR_ZIPPED_SIZE_SHIFT		4
2820 };
2821 
2822 /* init array header: pattern */
2823 struct init_array_pattern_hdr {
2824 	__le32						data;
2825 #define INIT_ARRAY_PATTERN_HDR_TYPE_MASK		0xF
2826 #define INIT_ARRAY_PATTERN_HDR_TYPE_SHIFT		0
2827 #define INIT_ARRAY_PATTERN_HDR_PATTERN_SIZE_MASK	0xF
2828 #define INIT_ARRAY_PATTERN_HDR_PATTERN_SIZE_SHIFT	4
2829 #define INIT_ARRAY_PATTERN_HDR_REPETITIONS_MASK		0xFFFFFF
2830 #define INIT_ARRAY_PATTERN_HDR_REPETITIONS_SHIFT	8
2831 };
2832 
2833 /* init array header union */
2834 union init_array_hdr {
2835 	struct init_array_raw_hdr			raw;
2836 	struct init_array_standard_hdr			standard;
2837 	struct init_array_zipped_hdr			zipped;
2838 	struct init_array_pattern_hdr			pattern;
2839 };
2840 
2841 /* init array types */
2842 enum init_array_types {
2843 	INIT_ARR_STANDARD,
2844 	INIT_ARR_ZIPPED,
2845 	INIT_ARR_PATTERN,
2846 	MAX_INIT_ARRAY_TYPES
2847 };
2848 
2849 /* init operation: callback */
2850 struct init_callback_op {
2851 	__le32						op_data;
2852 #define INIT_CALLBACK_OP_OP_MASK			0xF
2853 #define INIT_CALLBACK_OP_OP_SHIFT			0
2854 #define INIT_CALLBACK_OP_RESERVED_MASK			0xFFFFFFF
2855 #define INIT_CALLBACK_OP_RESERVED_SHIFT			4
2856 	__le16						callback_id;
2857 	__le16						block_id;
2858 };
2859 
2860 /* init operation: delay */
2861 struct init_delay_op {
2862 	__le32						op_data;
2863 #define INIT_DELAY_OP_OP_MASK				0xF
2864 #define INIT_DELAY_OP_OP_SHIFT				0
2865 #define INIT_DELAY_OP_RESERVED_MASK			0xFFFFFFF
2866 #define INIT_DELAY_OP_RESERVED_SHIFT			4
2867 	__le32						delay;
2868 };
2869 
2870 /* init operation: if_mode */
2871 struct init_if_mode_op {
2872 	__le32						op_data;
2873 #define INIT_IF_MODE_OP_OP_MASK				0xF
2874 #define INIT_IF_MODE_OP_OP_SHIFT			0
2875 #define INIT_IF_MODE_OP_RESERVED1_MASK			0xFFF
2876 #define INIT_IF_MODE_OP_RESERVED1_SHIFT			4
2877 #define INIT_IF_MODE_OP_CMD_OFFSET_MASK			0xFFFF
2878 #define INIT_IF_MODE_OP_CMD_OFFSET_SHIFT		16
2879 	__le16						reserved2;
2880 	__le16						modes_buf_offset;
2881 };
2882 
2883 /* init operation: if_phase */
2884 struct init_if_phase_op {
2885 	__le32						op_data;
2886 #define INIT_IF_PHASE_OP_OP_MASK			0xF
2887 #define INIT_IF_PHASE_OP_OP_SHIFT			0
2888 #define INIT_IF_PHASE_OP_RESERVED1_MASK			0xFFF
2889 #define INIT_IF_PHASE_OP_RESERVED1_SHIFT		4
2890 #define INIT_IF_PHASE_OP_CMD_OFFSET_MASK		0xFFFF
2891 #define INIT_IF_PHASE_OP_CMD_OFFSET_SHIFT		16
2892 	__le32						phase_data;
2893 #define INIT_IF_PHASE_OP_PHASE_MASK			0xFF
2894 #define INIT_IF_PHASE_OP_PHASE_SHIFT			0
2895 #define INIT_IF_PHASE_OP_RESERVED2_MASK			0xFF
2896 #define INIT_IF_PHASE_OP_RESERVED2_SHIFT		8
2897 #define INIT_IF_PHASE_OP_PHASE_ID_MASK			0xFFFF
2898 #define INIT_IF_PHASE_OP_PHASE_ID_SHIFT			16
2899 };
2900 
2901 /* init mode operators */
2902 enum init_mode_ops {
2903 	INIT_MODE_OP_NOT,
2904 	INIT_MODE_OP_OR,
2905 	INIT_MODE_OP_AND,
2906 	MAX_INIT_MODE_OPS
2907 };
2908 
2909 /* init operation: raw */
2910 struct init_raw_op {
2911 	__le32						op_data;
2912 #define INIT_RAW_OP_OP_MASK				0xF
2913 #define INIT_RAW_OP_OP_SHIFT				0
2914 #define INIT_RAW_OP_PARAM1_MASK				0xFFFFFFF
2915 #define INIT_RAW_OP_PARAM1_SHIFT			4
2916 	__le32						param2;
2917 };
2918 
2919 /* init array params */
2920 struct init_op_array_params {
2921 	__le16						size;
2922 	__le16						offset;
2923 };
2924 
2925 /* Write init operation arguments */
2926 union init_write_args {
2927 	__le32						inline_val;
2928 	__le32						zeros_count;
2929 	__le32						array_offset;
2930 	struct init_op_array_params			runtime;
2931 };
2932 
2933 /* init operation: write */
2934 struct init_write_op {
2935 	__le32						data;
2936 #define INIT_WRITE_OP_OP_MASK				0xF
2937 #define INIT_WRITE_OP_OP_SHIFT				0
2938 #define INIT_WRITE_OP_SOURCE_MASK			0x7
2939 #define INIT_WRITE_OP_SOURCE_SHIFT			4
2940 #define INIT_WRITE_OP_RESERVED_MASK			0x1
2941 #define INIT_WRITE_OP_RESERVED_SHIFT			7
2942 #define INIT_WRITE_OP_WIDE_BUS_MASK			0x1
2943 #define INIT_WRITE_OP_WIDE_BUS_SHIFT			8
2944 #define INIT_WRITE_OP_ADDRESS_MASK			0x7FFFFF
2945 #define INIT_WRITE_OP_ADDRESS_SHIFT			9
2946 	union init_write_args				args;
2947 };
2948 
2949 /* init operation: read */
2950 struct init_read_op {
2951 	__le32						op_data;
2952 #define INIT_READ_OP_OP_MASK				0xF
2953 #define INIT_READ_OP_OP_SHIFT				0
2954 #define INIT_READ_OP_POLL_TYPE_MASK			0xF
2955 #define INIT_READ_OP_POLL_TYPE_SHIFT			4
2956 #define INIT_READ_OP_RESERVED_MASK			0x1
2957 #define INIT_READ_OP_RESERVED_SHIFT			8
2958 #define INIT_READ_OP_ADDRESS_MASK			0x7FFFFF
2959 #define INIT_READ_OP_ADDRESS_SHIFT			9
2960 	__le32						expected_val;
2961 };
2962 
2963 /* Init operations union */
2964 union init_op {
2965 	struct init_raw_op				raw;
2966 	struct init_write_op				write;
2967 	struct init_read_op				read;
2968 	struct init_if_mode_op				if_mode;
2969 	struct init_if_phase_op				if_phase;
2970 	struct init_callback_op				callback;
2971 	struct init_delay_op				delay;
2972 };
2973 
2974 /* Init command operation types */
2975 enum init_op_types {
2976 	INIT_OP_READ,
2977 	INIT_OP_WRITE,
2978 	INIT_OP_IF_MODE,
2979 	INIT_OP_IF_PHASE,
2980 	INIT_OP_DELAY,
2981 	INIT_OP_CALLBACK,
2982 	MAX_INIT_OP_TYPES
2983 };
2984 
2985 /* init polling types */
2986 enum init_poll_types {
2987 	INIT_POLL_NONE,
2988 	INIT_POLL_EQ,
2989 	INIT_POLL_OR,
2990 	INIT_POLL_AND,
2991 	MAX_INIT_POLL_TYPES
2992 };
2993 
2994 /* init source types */
2995 enum init_source_types {
2996 	INIT_SRC_INLINE,
2997 	INIT_SRC_ZEROS,
2998 	INIT_SRC_ARRAY,
2999 	INIT_SRC_RUNTIME,
3000 	MAX_INIT_SOURCE_TYPES
3001 };
3002 
3003 /* Internal RAM Offsets macro data */
3004 struct iro {
3005 	u32 base;
3006 	u16 m1;
3007 	u16 m2;
3008 	u16 m3;
3009 	u16 size;
3010 };
3011 
3012 /***************************** Public Functions *******************************/
3013 
3014 /**
3015  * @brief qed_dbg_set_bin_ptr - Sets a pointer to the binary data with debug
3016  *	arrays.
3017  *
3018  * @param p_hwfn -	    HW device data
3019  * @param bin_ptr - a pointer to the binary data with debug arrays.
3020  */
3021 enum dbg_status qed_dbg_set_bin_ptr(struct qed_hwfn *p_hwfn,
3022 				    const u8 * const bin_ptr);
3023 
3024 /**
3025  * @brief qed_read_regs - Reads registers into a buffer (using GRC).
3026  *
3027  * @param p_hwfn - HW device data
3028  * @param p_ptt - Ptt window used for writing the registers.
3029  * @param buf - Destination buffer.
3030  * @param addr - Source GRC address in dwords.
3031  * @param len - Number of registers to read.
3032  */
3033 void qed_read_regs(struct qed_hwfn *p_hwfn,
3034 		   struct qed_ptt *p_ptt, u32 *buf, u32 addr, u32 len);
3035 
3036 /**
3037  * @brief qed_read_fw_info - Reads FW info from the chip.
3038  *
3039  * The FW info contains FW-related information, such as the FW version,
3040  * FW image (main/L2B/kuku), FW timestamp, etc.
3041  * The FW info is read from the internal RAM of the first Storm that is not in
3042  * reset.
3043  *
3044  * @param p_hwfn -	    HW device data
3045  * @param p_ptt -	    Ptt window used for writing the registers.
3046  * @param fw_info -	Out: a pointer to write the FW info into.
3047  *
3048  * @return true if the FW info was read successfully from one of the Storms,
3049  * or false if all Storms are in reset.
3050  */
3051 bool qed_read_fw_info(struct qed_hwfn *p_hwfn,
3052 		      struct qed_ptt *p_ptt, struct fw_info *fw_info);
3053 /**
3054  * @brief qed_dbg_grc_config - Sets the value of a GRC parameter.
3055  *
3056  * @param p_hwfn -	HW device data
3057  * @param grc_param -	GRC parameter
3058  * @param val -		Value to set.
3059  *
3060  * @return error if one of the following holds:
3061  *	- the version wasn't set
3062  *	- grc_param is invalid
3063  *	- val is outside the allowed boundaries
3064  */
3065 enum dbg_status qed_dbg_grc_config(struct qed_hwfn *p_hwfn,
3066 				   enum dbg_grc_params grc_param, u32 val);
3067 
3068 /**
3069  * @brief qed_dbg_grc_set_params_default - Reverts all GRC parameters to their
3070  *	default value.
3071  *
3072  * @param p_hwfn		- HW device data
3073  */
3074 void qed_dbg_grc_set_params_default(struct qed_hwfn *p_hwfn);
3075 /**
3076  * @brief qed_dbg_grc_get_dump_buf_size - Returns the required buffer size for
3077  *	GRC Dump.
3078  *
3079  * @param p_hwfn - HW device data
3080  * @param p_ptt - Ptt window used for writing the registers.
3081  * @param buf_size - OUT: required buffer size (in dwords) for the GRC Dump
3082  *	data.
3083  *
3084  * @return error if one of the following holds:
3085  *	- the version wasn't set
3086  * Otherwise, returns ok.
3087  */
3088 enum dbg_status qed_dbg_grc_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3089 					      struct qed_ptt *p_ptt,
3090 					      u32 *buf_size);
3091 
3092 /**
3093  * @brief qed_dbg_grc_dump - Dumps GRC data into the specified buffer.
3094  *
3095  * @param p_hwfn - HW device data
3096  * @param p_ptt - Ptt window used for writing the registers.
3097  * @param dump_buf - Pointer to write the collected GRC data into.
3098  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3099  * @param num_dumped_dwords - OUT: number of dumped dwords.
3100  *
3101  * @return error if one of the following holds:
3102  *	- the version wasn't set
3103  *	- the specified dump buffer is too small
3104  * Otherwise, returns ok.
3105  */
3106 enum dbg_status qed_dbg_grc_dump(struct qed_hwfn *p_hwfn,
3107 				 struct qed_ptt *p_ptt,
3108 				 u32 *dump_buf,
3109 				 u32 buf_size_in_dwords,
3110 				 u32 *num_dumped_dwords);
3111 
3112 /**
3113  * @brief qed_dbg_idle_chk_get_dump_buf_size - Returns the required buffer size
3114  *	for idle check results.
3115  *
3116  * @param p_hwfn - HW device data
3117  * @param p_ptt - Ptt window used for writing the registers.
3118  * @param buf_size - OUT: required buffer size (in dwords) for the idle check
3119  *	data.
3120  *
3121  * @return error if one of the following holds:
3122  *	- the version wasn't set
3123  * Otherwise, returns ok.
3124  */
3125 enum dbg_status qed_dbg_idle_chk_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3126 						   struct qed_ptt *p_ptt,
3127 						   u32 *buf_size);
3128 
3129 /**
3130  * @brief qed_dbg_idle_chk_dump - Performs idle check and writes the results
3131  *	into the specified buffer.
3132  *
3133  * @param p_hwfn - HW device data
3134  * @param p_ptt - Ptt window used for writing the registers.
3135  * @param dump_buf - Pointer to write the idle check data into.
3136  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3137  * @param num_dumped_dwords - OUT: number of dumped dwords.
3138  *
3139  * @return error if one of the following holds:
3140  *	- the version wasn't set
3141  *	- the specified buffer is too small
3142  * Otherwise, returns ok.
3143  */
3144 enum dbg_status qed_dbg_idle_chk_dump(struct qed_hwfn *p_hwfn,
3145 				      struct qed_ptt *p_ptt,
3146 				      u32 *dump_buf,
3147 				      u32 buf_size_in_dwords,
3148 				      u32 *num_dumped_dwords);
3149 
3150 /**
3151  * @brief qed_dbg_mcp_trace_get_dump_buf_size - Returns the required buffer size
3152  *	for mcp trace results.
3153  *
3154  * @param p_hwfn - HW device data
3155  * @param p_ptt - Ptt window used for writing the registers.
3156  * @param buf_size - OUT: required buffer size (in dwords) for mcp trace data.
3157  *
3158  * @return error if one of the following holds:
3159  *	- the version wasn't set
3160  *	- the trace data in MCP scratchpad contain an invalid signature
3161  *	- the bundle ID in NVRAM is invalid
3162  *	- the trace meta data cannot be found (in NVRAM or image file)
3163  * Otherwise, returns ok.
3164  */
3165 enum dbg_status qed_dbg_mcp_trace_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3166 						    struct qed_ptt *p_ptt,
3167 						    u32 *buf_size);
3168 
3169 /**
3170  * @brief qed_dbg_mcp_trace_dump - Performs mcp trace and writes the results
3171  *	into the specified buffer.
3172  *
3173  * @param p_hwfn - HW device data
3174  * @param p_ptt - Ptt window used for writing the registers.
3175  * @param dump_buf - Pointer to write the mcp trace data into.
3176  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3177  * @param num_dumped_dwords - OUT: number of dumped dwords.
3178  *
3179  * @return error if one of the following holds:
3180  *	- the version wasn't set
3181  *	- the specified buffer is too small
3182  *	- the trace data in MCP scratchpad contain an invalid signature
3183  *	- the bundle ID in NVRAM is invalid
3184  *	- the trace meta data cannot be found (in NVRAM or image file)
3185  *	- the trace meta data cannot be read (from NVRAM or image file)
3186  * Otherwise, returns ok.
3187  */
3188 enum dbg_status qed_dbg_mcp_trace_dump(struct qed_hwfn *p_hwfn,
3189 				       struct qed_ptt *p_ptt,
3190 				       u32 *dump_buf,
3191 				       u32 buf_size_in_dwords,
3192 				       u32 *num_dumped_dwords);
3193 
3194 /**
3195  * @brief qed_dbg_reg_fifo_get_dump_buf_size - Returns the required buffer size
3196  *	for grc trace fifo results.
3197  *
3198  * @param p_hwfn - HW device data
3199  * @param p_ptt - Ptt window used for writing the registers.
3200  * @param buf_size - OUT: required buffer size (in dwords) for reg fifo data.
3201  *
3202  * @return error if one of the following holds:
3203  *	- the version wasn't set
3204  * Otherwise, returns ok.
3205  */
3206 enum dbg_status qed_dbg_reg_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3207 						   struct qed_ptt *p_ptt,
3208 						   u32 *buf_size);
3209 
3210 /**
3211  * @brief qed_dbg_reg_fifo_dump - Reads the reg fifo and writes the results into
3212  *	the specified buffer.
3213  *
3214  * @param p_hwfn - HW device data
3215  * @param p_ptt - Ptt window used for writing the registers.
3216  * @param dump_buf - Pointer to write the reg fifo data into.
3217  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3218  * @param num_dumped_dwords - OUT: number of dumped dwords.
3219  *
3220  * @return error if one of the following holds:
3221  *	- the version wasn't set
3222  *	- the specified buffer is too small
3223  *	- DMAE transaction failed
3224  * Otherwise, returns ok.
3225  */
3226 enum dbg_status qed_dbg_reg_fifo_dump(struct qed_hwfn *p_hwfn,
3227 				      struct qed_ptt *p_ptt,
3228 				      u32 *dump_buf,
3229 				      u32 buf_size_in_dwords,
3230 				      u32 *num_dumped_dwords);
3231 
3232 /**
3233  * @brief qed_dbg_igu_fifo_get_dump_buf_size - Returns the required buffer size
3234  *	for the IGU fifo results.
3235  *
3236  * @param p_hwfn - HW device data
3237  * @param p_ptt - Ptt window used for writing the registers.
3238  * @param buf_size - OUT: required buffer size (in dwords) for the IGU fifo
3239  *	data.
3240  *
3241  * @return error if one of the following holds:
3242  *	- the version wasn't set
3243  * Otherwise, returns ok.
3244  */
3245 enum dbg_status qed_dbg_igu_fifo_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3246 						   struct qed_ptt *p_ptt,
3247 						   u32 *buf_size);
3248 
3249 /**
3250  * @brief qed_dbg_igu_fifo_dump - Reads the IGU fifo and writes the results into
3251  *	the specified buffer.
3252  *
3253  * @param p_hwfn - HW device data
3254  * @param p_ptt - Ptt window used for writing the registers.
3255  * @param dump_buf - Pointer to write the IGU fifo data into.
3256  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3257  * @param num_dumped_dwords - OUT: number of dumped dwords.
3258  *
3259  * @return error if one of the following holds:
3260  *	- the version wasn't set
3261  *	- the specified buffer is too small
3262  *	- DMAE transaction failed
3263  * Otherwise, returns ok.
3264  */
3265 enum dbg_status qed_dbg_igu_fifo_dump(struct qed_hwfn *p_hwfn,
3266 				      struct qed_ptt *p_ptt,
3267 				      u32 *dump_buf,
3268 				      u32 buf_size_in_dwords,
3269 				      u32 *num_dumped_dwords);
3270 
3271 /**
3272  * @brief qed_dbg_protection_override_get_dump_buf_size - Returns the required
3273  *	buffer size for protection override window results.
3274  *
3275  * @param p_hwfn - HW device data
3276  * @param p_ptt - Ptt window used for writing the registers.
3277  * @param buf_size - OUT: required buffer size (in dwords) for protection
3278  *	override data.
3279  *
3280  * @return error if one of the following holds:
3281  *	- the version wasn't set
3282  * Otherwise, returns ok.
3283  */
3284 enum dbg_status
3285 qed_dbg_protection_override_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3286 					      struct qed_ptt *p_ptt,
3287 					      u32 *buf_size);
3288 /**
3289  * @brief qed_dbg_protection_override_dump - Reads protection override window
3290  *	entries and writes the results into the specified buffer.
3291  *
3292  * @param p_hwfn - HW device data
3293  * @param p_ptt - Ptt window used for writing the registers.
3294  * @param dump_buf - Pointer to write the protection override data into.
3295  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3296  * @param num_dumped_dwords - OUT: number of dumped dwords.
3297  *
3298  * @return error if one of the following holds:
3299  *	- the version wasn't set
3300  *	- the specified buffer is too small
3301  *	- DMAE transaction failed
3302  * Otherwise, returns ok.
3303  */
3304 enum dbg_status qed_dbg_protection_override_dump(struct qed_hwfn *p_hwfn,
3305 						 struct qed_ptt *p_ptt,
3306 						 u32 *dump_buf,
3307 						 u32 buf_size_in_dwords,
3308 						 u32 *num_dumped_dwords);
3309 /**
3310  * @brief qed_dbg_fw_asserts_get_dump_buf_size - Returns the required buffer
3311  *	size for FW Asserts results.
3312  *
3313  * @param p_hwfn - HW device data
3314  * @param p_ptt - Ptt window used for writing the registers.
3315  * @param buf_size - OUT: required buffer size (in dwords) for FW Asserts data.
3316  *
3317  * @return error if one of the following holds:
3318  *	- the version wasn't set
3319  * Otherwise, returns ok.
3320  */
3321 enum dbg_status qed_dbg_fw_asserts_get_dump_buf_size(struct qed_hwfn *p_hwfn,
3322 						     struct qed_ptt *p_ptt,
3323 						     u32 *buf_size);
3324 /**
3325  * @brief qed_dbg_fw_asserts_dump - Reads the FW Asserts and writes the results
3326  *	into the specified buffer.
3327  *
3328  * @param p_hwfn - HW device data
3329  * @param p_ptt - Ptt window used for writing the registers.
3330  * @param dump_buf - Pointer to write the FW Asserts data into.
3331  * @param buf_size_in_dwords - Size of the specified buffer in dwords.
3332  * @param num_dumped_dwords - OUT: number of dumped dwords.
3333  *
3334  * @return error if one of the following holds:
3335  *	- the version wasn't set
3336  *	- the specified buffer is too small
3337  * Otherwise, returns ok.
3338  */
3339 enum dbg_status qed_dbg_fw_asserts_dump(struct qed_hwfn *p_hwfn,
3340 					struct qed_ptt *p_ptt,
3341 					u32 *dump_buf,
3342 					u32 buf_size_in_dwords,
3343 					u32 *num_dumped_dwords);
3344 
3345 /**
3346  * @brief qed_dbg_read_attn - Reads the attention registers of the specified
3347  * block and type, and writes the results into the specified buffer.
3348  *
3349  * @param p_hwfn -	 HW device data
3350  * @param p_ptt -	 Ptt window used for writing the registers.
3351  * @param block -	 Block ID.
3352  * @param attn_type -	 Attention type.
3353  * @param clear_status - Indicates if the attention status should be cleared.
3354  * @param results -	 OUT: Pointer to write the read results into
3355  *
3356  * @return error if one of the following holds:
3357  *	- the version wasn't set
3358  * Otherwise, returns ok.
3359  */
3360 enum dbg_status qed_dbg_read_attn(struct qed_hwfn *p_hwfn,
3361 				  struct qed_ptt *p_ptt,
3362 				  enum block_id block,
3363 				  enum dbg_attn_type attn_type,
3364 				  bool clear_status,
3365 				  struct dbg_attn_block_result *results);
3366 
3367 /**
3368  * @brief qed_dbg_print_attn - Prints attention registers values in the
3369  *	specified results struct.
3370  *
3371  * @param p_hwfn
3372  * @param results - Pointer to the attention read results
3373  *
3374  * @return error if one of the following holds:
3375  *	- the version wasn't set
3376  * Otherwise, returns ok.
3377  */
3378 enum dbg_status qed_dbg_print_attn(struct qed_hwfn *p_hwfn,
3379 				   struct dbg_attn_block_result *results);
3380 
3381 /******************************* Data Types **********************************/
3382 
3383 struct mcp_trace_format {
3384 	u32 data;
3385 #define MCP_TRACE_FORMAT_MODULE_MASK	0x0000ffff
3386 #define MCP_TRACE_FORMAT_MODULE_OFFSET	0
3387 #define MCP_TRACE_FORMAT_LEVEL_MASK	0x00030000
3388 #define MCP_TRACE_FORMAT_LEVEL_OFFSET	16
3389 #define MCP_TRACE_FORMAT_P1_SIZE_MASK	0x000c0000
3390 #define MCP_TRACE_FORMAT_P1_SIZE_OFFSET 18
3391 #define MCP_TRACE_FORMAT_P2_SIZE_MASK	0x00300000
3392 #define MCP_TRACE_FORMAT_P2_SIZE_OFFSET 20
3393 #define MCP_TRACE_FORMAT_P3_SIZE_MASK	0x00c00000
3394 #define MCP_TRACE_FORMAT_P3_SIZE_OFFSET 22
3395 #define MCP_TRACE_FORMAT_LEN_MASK	0xff000000
3396 #define MCP_TRACE_FORMAT_LEN_OFFSET	24
3397 
3398 	char *format_str;
3399 };
3400 
3401 /* MCP Trace Meta data structure */
3402 struct mcp_trace_meta {
3403 	u32 modules_num;
3404 	char **modules;
3405 	u32 formats_num;
3406 	struct mcp_trace_format *formats;
3407 	bool is_allocated;
3408 };
3409 
3410 /* Debug Tools user data */
3411 struct dbg_tools_user_data {
3412 	struct mcp_trace_meta mcp_trace_meta;
3413 	const u32 *mcp_trace_user_meta_buf;
3414 };
3415 
3416 /******************************** Constants **********************************/
3417 
3418 #define MAX_NAME_LEN	16
3419 
3420 /***************************** Public Functions *******************************/
3421 
3422 /**
3423  * @brief qed_dbg_user_set_bin_ptr - Sets a pointer to the binary data with
3424  *	debug arrays.
3425  *
3426  * @param p_hwfn - HW device data
3427  * @param bin_ptr - a pointer to the binary data with debug arrays.
3428  */
3429 enum dbg_status qed_dbg_user_set_bin_ptr(struct qed_hwfn *p_hwfn,
3430 					 const u8 * const bin_ptr);
3431 
3432 /**
3433  * @brief qed_dbg_alloc_user_data - Allocates user debug data.
3434  *
3435  * @param p_hwfn -		 HW device data
3436  * @param user_data_ptr - OUT: a pointer to the allocated memory.
3437  */
3438 enum dbg_status qed_dbg_alloc_user_data(struct qed_hwfn *p_hwfn,
3439 					void **user_data_ptr);
3440 
3441 /**
3442  * @brief qed_dbg_get_status_str - Returns a string for the specified status.
3443  *
3444  * @param status - a debug status code.
3445  *
3446  * @return a string for the specified status
3447  */
3448 const char *qed_dbg_get_status_str(enum dbg_status status);
3449 
3450 /**
3451  * @brief qed_get_idle_chk_results_buf_size - Returns the required buffer size
3452  *	for idle check results (in bytes).
3453  *
3454  * @param p_hwfn - HW device data
3455  * @param dump_buf - idle check dump buffer.
3456  * @param num_dumped_dwords - number of dwords that were dumped.
3457  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3458  *	results.
3459  *
3460  * @return error if the parsing fails, ok otherwise.
3461  */
3462 enum dbg_status qed_get_idle_chk_results_buf_size(struct qed_hwfn *p_hwfn,
3463 						  u32 *dump_buf,
3464 						  u32  num_dumped_dwords,
3465 						  u32 *results_buf_size);
3466 /**
3467  * @brief qed_print_idle_chk_results - Prints idle check results
3468  *
3469  * @param p_hwfn - HW device data
3470  * @param dump_buf - idle check dump buffer.
3471  * @param num_dumped_dwords - number of dwords that were dumped.
3472  * @param results_buf - buffer for printing the idle check results.
3473  * @param num_errors - OUT: number of errors found in idle check.
3474  * @param num_warnings - OUT: number of warnings found in idle check.
3475  *
3476  * @return error if the parsing fails, ok otherwise.
3477  */
3478 enum dbg_status qed_print_idle_chk_results(struct qed_hwfn *p_hwfn,
3479 					   u32 *dump_buf,
3480 					   u32 num_dumped_dwords,
3481 					   char *results_buf,
3482 					   u32 *num_errors,
3483 					   u32 *num_warnings);
3484 
3485 /**
3486  * @brief qed_dbg_mcp_trace_set_meta_data - Sets the MCP Trace meta data.
3487  *
3488  * Needed in case the MCP Trace dump doesn't contain the meta data (e.g. due to
3489  * no NVRAM access).
3490  *
3491  * @param data - pointer to MCP Trace meta data
3492  * @param size - size of MCP Trace meta data in dwords
3493  */
3494 void qed_dbg_mcp_trace_set_meta_data(struct qed_hwfn *p_hwfn,
3495 				     const u32 *meta_buf);
3496 
3497 /**
3498  * @brief qed_get_mcp_trace_results_buf_size - Returns the required buffer size
3499  *	for MCP Trace results (in bytes).
3500  *
3501  * @param p_hwfn - HW device data
3502  * @param dump_buf - MCP Trace dump buffer.
3503  * @param num_dumped_dwords - number of dwords that were dumped.
3504  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3505  *	results.
3506  *
3507  * @return error if the parsing fails, ok otherwise.
3508  */
3509 enum dbg_status qed_get_mcp_trace_results_buf_size(struct qed_hwfn *p_hwfn,
3510 						   u32 *dump_buf,
3511 						   u32 num_dumped_dwords,
3512 						   u32 *results_buf_size);
3513 
3514 /**
3515  * @brief qed_print_mcp_trace_results - Prints MCP Trace results
3516  *
3517  * @param p_hwfn - HW device data
3518  * @param dump_buf - mcp trace dump buffer, starting from the header.
3519  * @param num_dumped_dwords - number of dwords that were dumped.
3520  * @param results_buf - buffer for printing the mcp trace results.
3521  *
3522  * @return error if the parsing fails, ok otherwise.
3523  */
3524 enum dbg_status qed_print_mcp_trace_results(struct qed_hwfn *p_hwfn,
3525 					    u32 *dump_buf,
3526 					    u32 num_dumped_dwords,
3527 					    char *results_buf);
3528 
3529 /**
3530  * @brief qed_print_mcp_trace_results_cont - Prints MCP Trace results, and
3531  * keeps the MCP trace meta data allocated, to support continuous MCP Trace
3532  * parsing. After the continuous parsing ends, mcp_trace_free_meta_data should
3533  * be called to free the meta data.
3534  *
3535  * @param p_hwfn -	      HW device data
3536  * @param dump_buf -	      mcp trace dump buffer, starting from the header.
3537  * @param results_buf -	      buffer for printing the mcp trace results.
3538  *
3539  * @return error if the parsing fails, ok otherwise.
3540  */
3541 enum dbg_status qed_print_mcp_trace_results_cont(struct qed_hwfn *p_hwfn,
3542 						 u32 *dump_buf,
3543 						 char *results_buf);
3544 
3545 /**
3546  * @brief print_mcp_trace_line - Prints MCP Trace results for a single line
3547  *
3548  * @param p_hwfn -	      HW device data
3549  * @param dump_buf -	      mcp trace dump buffer, starting from the header.
3550  * @param num_dumped_bytes -  number of bytes that were dumped.
3551  * @param results_buf -	      buffer for printing the mcp trace results.
3552  *
3553  * @return error if the parsing fails, ok otherwise.
3554  */
3555 enum dbg_status qed_print_mcp_trace_line(struct qed_hwfn *p_hwfn,
3556 					 u8 *dump_buf,
3557 					 u32 num_dumped_bytes,
3558 					 char *results_buf);
3559 
3560 /**
3561  * @brief mcp_trace_free_meta_data - Frees the MCP Trace meta data.
3562  * Should be called after continuous MCP Trace parsing.
3563  *
3564  * @param p_hwfn - HW device data
3565  */
3566 void qed_mcp_trace_free_meta_data(struct qed_hwfn *p_hwfn);
3567 
3568 /**
3569  * @brief qed_get_reg_fifo_results_buf_size - Returns the required buffer size
3570  *	for reg_fifo results (in bytes).
3571  *
3572  * @param p_hwfn - HW device data
3573  * @param dump_buf - reg fifo dump buffer.
3574  * @param num_dumped_dwords - number of dwords that were dumped.
3575  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3576  *	results.
3577  *
3578  * @return error if the parsing fails, ok otherwise.
3579  */
3580 enum dbg_status qed_get_reg_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
3581 						  u32 *dump_buf,
3582 						  u32 num_dumped_dwords,
3583 						  u32 *results_buf_size);
3584 
3585 /**
3586  * @brief qed_print_reg_fifo_results - Prints reg fifo results
3587  *
3588  * @param p_hwfn - HW device data
3589  * @param dump_buf - reg fifo dump buffer, starting from the header.
3590  * @param num_dumped_dwords - number of dwords that were dumped.
3591  * @param results_buf - buffer for printing the reg fifo results.
3592  *
3593  * @return error if the parsing fails, ok otherwise.
3594  */
3595 enum dbg_status qed_print_reg_fifo_results(struct qed_hwfn *p_hwfn,
3596 					   u32 *dump_buf,
3597 					   u32 num_dumped_dwords,
3598 					   char *results_buf);
3599 
3600 /**
3601  * @brief qed_get_igu_fifo_results_buf_size - Returns the required buffer size
3602  *	for igu_fifo results (in bytes).
3603  *
3604  * @param p_hwfn - HW device data
3605  * @param dump_buf - IGU fifo dump buffer.
3606  * @param num_dumped_dwords - number of dwords that were dumped.
3607  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3608  *	results.
3609  *
3610  * @return error if the parsing fails, ok otherwise.
3611  */
3612 enum dbg_status qed_get_igu_fifo_results_buf_size(struct qed_hwfn *p_hwfn,
3613 						  u32 *dump_buf,
3614 						  u32 num_dumped_dwords,
3615 						  u32 *results_buf_size);
3616 
3617 /**
3618  * @brief qed_print_igu_fifo_results - Prints IGU fifo results
3619  *
3620  * @param p_hwfn - HW device data
3621  * @param dump_buf - IGU fifo dump buffer, starting from the header.
3622  * @param num_dumped_dwords - number of dwords that were dumped.
3623  * @param results_buf - buffer for printing the IGU fifo results.
3624  *
3625  * @return error if the parsing fails, ok otherwise.
3626  */
3627 enum dbg_status qed_print_igu_fifo_results(struct qed_hwfn *p_hwfn,
3628 					   u32 *dump_buf,
3629 					   u32 num_dumped_dwords,
3630 					   char *results_buf);
3631 
3632 /**
3633  * @brief qed_get_protection_override_results_buf_size - Returns the required
3634  *	buffer size for protection override results (in bytes).
3635  *
3636  * @param p_hwfn - HW device data
3637  * @param dump_buf - protection override dump buffer.
3638  * @param num_dumped_dwords - number of dwords that were dumped.
3639  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3640  *	results.
3641  *
3642  * @return error if the parsing fails, ok otherwise.
3643  */
3644 enum dbg_status
3645 qed_get_protection_override_results_buf_size(struct qed_hwfn *p_hwfn,
3646 					     u32 *dump_buf,
3647 					     u32 num_dumped_dwords,
3648 					     u32 *results_buf_size);
3649 
3650 /**
3651  * @brief qed_print_protection_override_results - Prints protection override
3652  *	results.
3653  *
3654  * @param p_hwfn - HW device data
3655  * @param dump_buf - protection override dump buffer, starting from the header.
3656  * @param num_dumped_dwords - number of dwords that were dumped.
3657  * @param results_buf - buffer for printing the reg fifo results.
3658  *
3659  * @return error if the parsing fails, ok otherwise.
3660  */
3661 enum dbg_status qed_print_protection_override_results(struct qed_hwfn *p_hwfn,
3662 						      u32 *dump_buf,
3663 						      u32 num_dumped_dwords,
3664 						      char *results_buf);
3665 
3666 /**
3667  * @brief qed_get_fw_asserts_results_buf_size - Returns the required buffer size
3668  *	for FW Asserts results (in bytes).
3669  *
3670  * @param p_hwfn - HW device data
3671  * @param dump_buf - FW Asserts dump buffer.
3672  * @param num_dumped_dwords - number of dwords that were dumped.
3673  * @param results_buf_size - OUT: required buffer size (in bytes) for the parsed
3674  *	results.
3675  *
3676  * @return error if the parsing fails, ok otherwise.
3677  */
3678 enum dbg_status qed_get_fw_asserts_results_buf_size(struct qed_hwfn *p_hwfn,
3679 						    u32 *dump_buf,
3680 						    u32 num_dumped_dwords,
3681 						    u32 *results_buf_size);
3682 
3683 /**
3684  * @brief qed_print_fw_asserts_results - Prints FW Asserts results
3685  *
3686  * @param p_hwfn - HW device data
3687  * @param dump_buf - FW Asserts dump buffer, starting from the header.
3688  * @param num_dumped_dwords - number of dwords that were dumped.
3689  * @param results_buf - buffer for printing the FW Asserts results.
3690  *
3691  * @return error if the parsing fails, ok otherwise.
3692  */
3693 enum dbg_status qed_print_fw_asserts_results(struct qed_hwfn *p_hwfn,
3694 					     u32 *dump_buf,
3695 					     u32 num_dumped_dwords,
3696 					     char *results_buf);
3697 
3698 /**
3699  * @brief qed_dbg_parse_attn - Parses and prints attention registers values in
3700  * the specified results struct.
3701  *
3702  * @param p_hwfn -  HW device data
3703  * @param results - Pointer to the attention read results
3704  *
3705  * @return error if one of the following holds:
3706  *	- the version wasn't set
3707  * Otherwise, returns ok.
3708  */
3709 enum dbg_status qed_dbg_parse_attn(struct qed_hwfn *p_hwfn,
3710 				   struct dbg_attn_block_result *results);
3711 
3712 /* Win 2 */
3713 #define GTT_BAR0_MAP_REG_IGU_CMD	0x00f000UL
3714 
3715 /* Win 3 */
3716 #define GTT_BAR0_MAP_REG_TSDM_RAM	0x010000UL
3717 
3718 /* Win 4 */
3719 #define GTT_BAR0_MAP_REG_MSDM_RAM	0x011000UL
3720 
3721 /* Win 5 */
3722 #define GTT_BAR0_MAP_REG_MSDM_RAM_1024	0x012000UL
3723 
3724 /* Win 6 */
3725 #define GTT_BAR0_MAP_REG_MSDM_RAM_2048	0x013000UL
3726 
3727 /* Win 7 */
3728 #define GTT_BAR0_MAP_REG_USDM_RAM	0x014000UL
3729 
3730 /* Win 8 */
3731 #define GTT_BAR0_MAP_REG_USDM_RAM_1024	0x015000UL
3732 
3733 /* Win 9 */
3734 #define GTT_BAR0_MAP_REG_USDM_RAM_2048	0x016000UL
3735 
3736 /* Win 10 */
3737 #define GTT_BAR0_MAP_REG_XSDM_RAM	0x017000UL
3738 
3739 /* Win 11 */
3740 #define GTT_BAR0_MAP_REG_XSDM_RAM_1024	0x018000UL
3741 
3742 /* Win 12 */
3743 #define GTT_BAR0_MAP_REG_YSDM_RAM	0x019000UL
3744 
3745 /* Win 13 */
3746 #define GTT_BAR0_MAP_REG_PSDM_RAM	0x01a000UL
3747 
3748 /**
3749  * @brief qed_qm_pf_mem_size - prepare QM ILT sizes
3750  *
3751  * Returns the required host memory size in 4KB units.
3752  * Must be called before all QM init HSI functions.
3753  *
3754  * @param num_pf_cids - number of connections used by this PF
3755  * @param num_vf_cids - number of connections used by VFs of this PF
3756  * @param num_tids - number of tasks used by this PF
3757  * @param num_pf_pqs - number of PQs used by this PF
3758  * @param num_vf_pqs - number of PQs used by VFs of this PF
3759  *
3760  * @return The required host memory size in 4KB units.
3761  */
3762 u32 qed_qm_pf_mem_size(u32 num_pf_cids,
3763 		       u32 num_vf_cids,
3764 		       u32 num_tids, u16 num_pf_pqs, u16 num_vf_pqs);
3765 
3766 struct qed_qm_common_rt_init_params {
3767 	u8 max_ports_per_engine;
3768 	u8 max_phys_tcs_per_port;
3769 	bool pf_rl_en;
3770 	bool pf_wfq_en;
3771 	bool global_rl_en;
3772 	bool vport_wfq_en;
3773 	struct init_qm_port_params *port_params;
3774 };
3775 
3776 int qed_qm_common_rt_init(struct qed_hwfn *p_hwfn,
3777 			  struct qed_qm_common_rt_init_params *p_params);
3778 
3779 struct qed_qm_pf_rt_init_params {
3780 	u8 port_id;
3781 	u8 pf_id;
3782 	u8 max_phys_tcs_per_port;
3783 	bool is_pf_loading;
3784 	u32 num_pf_cids;
3785 	u32 num_vf_cids;
3786 	u32 num_tids;
3787 	u16 start_pq;
3788 	u16 num_pf_pqs;
3789 	u16 num_vf_pqs;
3790 	u16 start_vport;
3791 	u16 num_vports;
3792 	u16 pf_wfq;
3793 	u32 pf_rl;
3794 	struct init_qm_pq_params *pq_params;
3795 	struct init_qm_vport_params *vport_params;
3796 };
3797 
3798 int qed_qm_pf_rt_init(struct qed_hwfn *p_hwfn,
3799 	struct qed_ptt *p_ptt,
3800 	struct qed_qm_pf_rt_init_params *p_params);
3801 
3802 /**
3803  * @brief qed_init_pf_wfq - Initializes the WFQ weight of the specified PF
3804  *
3805  * @param p_hwfn
3806  * @param p_ptt - ptt window used for writing the registers
3807  * @param pf_id - PF ID
3808  * @param pf_wfq - WFQ weight. Must be non-zero.
3809  *
3810  * @return 0 on success, -1 on error.
3811  */
3812 int qed_init_pf_wfq(struct qed_hwfn *p_hwfn,
3813 		    struct qed_ptt *p_ptt, u8 pf_id, u16 pf_wfq);
3814 
3815 /**
3816  * @brief qed_init_pf_rl - Initializes the rate limit of the specified PF
3817  *
3818  * @param p_hwfn
3819  * @param p_ptt - ptt window used for writing the registers
3820  * @param pf_id - PF ID
3821  * @param pf_rl - rate limit in Mb/sec units
3822  *
3823  * @return 0 on success, -1 on error.
3824  */
3825 int qed_init_pf_rl(struct qed_hwfn *p_hwfn,
3826 		   struct qed_ptt *p_ptt, u8 pf_id, u32 pf_rl);
3827 
3828 /**
3829  * @brief qed_init_vport_wfq Initializes the WFQ weight of the specified VPORT
3830  *
3831  * @param p_hwfn
3832  * @param p_ptt - ptt window used for writing the registers
3833  * @param first_tx_pq_id- An array containing the first Tx PQ ID associated
3834  *	  with the VPORT for each TC. This array is filled by
3835  *	  qed_qm_pf_rt_init
3836  * @param vport_wfq - WFQ weight. Must be non-zero.
3837  *
3838  * @return 0 on success, -1 on error.
3839  */
3840 int qed_init_vport_wfq(struct qed_hwfn *p_hwfn,
3841 		       struct qed_ptt *p_ptt,
3842 		       u16 first_tx_pq_id[NUM_OF_TCS], u16 wfq);
3843 
3844 /**
3845  * @brief qed_init_global_rl - Initializes the rate limit of the specified
3846  * rate limiter
3847  *
3848  * @param p_hwfn
3849  * @param p_ptt - ptt window used for writing the registers
3850  * @param rl_id - RL ID
3851  * @param rate_limit - rate limit in Mb/sec units
3852  *
3853  * @return 0 on success, -1 on error.
3854  */
3855 int qed_init_global_rl(struct qed_hwfn *p_hwfn,
3856 		       struct qed_ptt *p_ptt,
3857 		       u16 rl_id, u32 rate_limit);
3858 
3859 /**
3860  * @brief qed_send_qm_stop_cmd  Sends a stop command to the QM
3861  *
3862  * @param p_hwfn
3863  * @param p_ptt
3864  * @param is_release_cmd - true for release, false for stop.
3865  * @param is_tx_pq - true for Tx PQs, false for Other PQs.
3866  * @param start_pq - first PQ ID to stop
3867  * @param num_pqs - Number of PQs to stop, starting from start_pq.
3868  *
3869  * @return bool, true if successful, false if timeout occurred while waiting for
3870  *	QM command done.
3871  */
3872 bool qed_send_qm_stop_cmd(struct qed_hwfn *p_hwfn,
3873 			  struct qed_ptt *p_ptt,
3874 			  bool is_release_cmd,
3875 			  bool is_tx_pq, u16 start_pq, u16 num_pqs);
3876 
3877 /**
3878  * @brief qed_set_vxlan_dest_port - initializes vxlan tunnel destination udp port
3879  *
3880  * @param p_hwfn
3881  * @param p_ptt - ptt window used for writing the registers.
3882  * @param dest_port - vxlan destination udp port.
3883  */
3884 void qed_set_vxlan_dest_port(struct qed_hwfn *p_hwfn,
3885 			     struct qed_ptt *p_ptt, u16 dest_port);
3886 
3887 /**
3888  * @brief qed_set_vxlan_enable - enable or disable VXLAN tunnel in HW
3889  *
3890  * @param p_hwfn
3891  * @param p_ptt - ptt window used for writing the registers.
3892  * @param vxlan_enable - vxlan enable flag.
3893  */
3894 void qed_set_vxlan_enable(struct qed_hwfn *p_hwfn,
3895 			  struct qed_ptt *p_ptt, bool vxlan_enable);
3896 
3897 /**
3898  * @brief qed_set_gre_enable - enable or disable GRE tunnel in HW
3899  *
3900  * @param p_hwfn
3901  * @param p_ptt - ptt window used for writing the registers.
3902  * @param eth_gre_enable - eth GRE enable enable flag.
3903  * @param ip_gre_enable - IP GRE enable enable flag.
3904  */
3905 void qed_set_gre_enable(struct qed_hwfn *p_hwfn,
3906 			struct qed_ptt *p_ptt,
3907 			bool eth_gre_enable, bool ip_gre_enable);
3908 
3909 /**
3910  * @brief qed_set_geneve_dest_port - initializes geneve tunnel destination udp port
3911  *
3912  * @param p_hwfn
3913  * @param p_ptt - ptt window used for writing the registers.
3914  * @param dest_port - geneve destination udp port.
3915  */
3916 void qed_set_geneve_dest_port(struct qed_hwfn *p_hwfn,
3917 			      struct qed_ptt *p_ptt, u16 dest_port);
3918 
3919 /**
3920  * @brief qed_set_gre_enable - enable or disable GRE tunnel in HW
3921  *
3922  * @param p_ptt - ptt window used for writing the registers.
3923  * @param eth_geneve_enable - eth GENEVE enable enable flag.
3924  * @param ip_geneve_enable - IP GENEVE enable enable flag.
3925  */
3926 void qed_set_geneve_enable(struct qed_hwfn *p_hwfn,
3927 			   struct qed_ptt *p_ptt,
3928 			   bool eth_geneve_enable, bool ip_geneve_enable);
3929 
3930 void qed_set_vxlan_no_l2_enable(struct qed_hwfn *p_hwfn,
3931 				struct qed_ptt *p_ptt, bool enable);
3932 
3933 /**
3934  * @brief qed_gft_disable - Disable GFT
3935  *
3936  * @param p_hwfn
3937  * @param p_ptt - ptt window used for writing the registers.
3938  * @param pf_id - pf on which to disable GFT.
3939  */
3940 void qed_gft_disable(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt, u16 pf_id);
3941 
3942 /**
3943  * @brief qed_gft_config - Enable and configure HW for GFT
3944  *
3945  * @param p_hwfn - HW device data
3946  * @param p_ptt - ptt window used for writing the registers.
3947  * @param pf_id - pf on which to enable GFT.
3948  * @param tcp - set profile tcp packets.
3949  * @param udp - set profile udp  packet.
3950  * @param ipv4 - set profile ipv4 packet.
3951  * @param ipv6 - set profile ipv6 packet.
3952  * @param profile_type - define packet same fields. Use enum gft_profile_type.
3953  */
3954 void qed_gft_config(struct qed_hwfn *p_hwfn,
3955 		    struct qed_ptt *p_ptt,
3956 		    u16 pf_id,
3957 		    bool tcp,
3958 		    bool udp,
3959 		    bool ipv4, bool ipv6, enum gft_profile_type profile_type);
3960 
3961 /**
3962  * @brief qed_enable_context_validation - Enable and configure context
3963  *	validation.
3964  *
3965  * @param p_hwfn
3966  * @param p_ptt - ptt window used for writing the registers.
3967  */
3968 void qed_enable_context_validation(struct qed_hwfn *p_hwfn,
3969 				   struct qed_ptt *p_ptt);
3970 
3971 /**
3972  * @brief qed_calc_session_ctx_validation - Calcualte validation byte for
3973  *	session context.
3974  *
3975  * @param p_ctx_mem - pointer to context memory.
3976  * @param ctx_size - context size.
3977  * @param ctx_type - context type.
3978  * @param cid - context cid.
3979  */
3980 void qed_calc_session_ctx_validation(void *p_ctx_mem,
3981 				     u16 ctx_size, u8 ctx_type, u32 cid);
3982 
3983 /**
3984  * @brief qed_calc_task_ctx_validation - Calcualte validation byte for task
3985  *	context.
3986  *
3987  * @param p_ctx_mem - pointer to context memory.
3988  * @param ctx_size - context size.
3989  * @param ctx_type - context type.
3990  * @param tid - context tid.
3991  */
3992 void qed_calc_task_ctx_validation(void *p_ctx_mem,
3993 				  u16 ctx_size, u8 ctx_type, u32 tid);
3994 
3995 /**
3996  * @brief qed_memset_session_ctx - Memset session context to 0 while
3997  *	preserving validation bytes.
3998  *
3999  * @param p_hwfn -
4000  * @param p_ctx_mem - pointer to context memory.
4001  * @param ctx_size - size to initialzie.
4002  * @param ctx_type - context type.
4003  */
4004 void qed_memset_session_ctx(void *p_ctx_mem, u32 ctx_size, u8 ctx_type);
4005 
4006 /**
4007  * @brief qed_memset_task_ctx - Memset task context to 0 while preserving
4008  *	validation bytes.
4009  *
4010  * @param p_ctx_mem - pointer to context memory.
4011  * @param ctx_size - size to initialzie.
4012  * @param ctx_type - context type.
4013  */
4014 void qed_memset_task_ctx(void *p_ctx_mem, u32 ctx_size, u8 ctx_type);
4015 
4016 #define NUM_STORMS 6
4017 
4018 /**
4019  * @brief qed_set_rdma_error_level - Sets the RDMA assert level.
4020  *                                   If the severity of the error will be
4021  *                                   above the level, the FW will assert.
4022  * @param p_hwfn - HW device data
4023  * @param p_ptt - ptt window used for writing the registers
4024  * @param assert_level - An array of assert levels for each storm.
4025  *
4026  */
4027 void qed_set_rdma_error_level(struct qed_hwfn *p_hwfn,
4028 			      struct qed_ptt *p_ptt,
4029 			      u8 assert_level[NUM_STORMS]);
4030 /**
4031  * @brief qed_fw_overlay_mem_alloc - Allocates and fills the FW overlay memory.
4032  *
4033  * @param p_hwfn - HW device data
4034  * @param fw_overlay_in_buf - the input FW overlay buffer.
4035  * @param buf_size - the size of the input FW overlay buffer in bytes.
4036  *		     must be aligned to dwords.
4037  * @param fw_overlay_out_mem - OUT: a pointer to the allocated overlays memory.
4038  *
4039  * @return a pointer to the allocated overlays memory,
4040  * or NULL in case of failures.
4041  */
4042 struct phys_mem_desc *
4043 qed_fw_overlay_mem_alloc(struct qed_hwfn *p_hwfn,
4044 			 const u32 * const fw_overlay_in_buf,
4045 			 u32 buf_size_in_bytes);
4046 
4047 /**
4048  * @brief qed_fw_overlay_init_ram - Initializes the FW overlay RAM.
4049  *
4050  * @param p_hwfn - HW device data.
4051  * @param p_ptt - ptt window used for writing the registers.
4052  * @param fw_overlay_mem - the allocated FW overlay memory.
4053  */
4054 void qed_fw_overlay_init_ram(struct qed_hwfn *p_hwfn,
4055 			     struct qed_ptt *p_ptt,
4056 			     struct phys_mem_desc *fw_overlay_mem);
4057 
4058 /**
4059  * @brief qed_fw_overlay_mem_free - Frees the FW overlay memory.
4060  *
4061  * @param p_hwfn - HW device data.
4062  * @param fw_overlay_mem - the allocated FW overlay memory to free.
4063  */
4064 void qed_fw_overlay_mem_free(struct qed_hwfn *p_hwfn,
4065 			     struct phys_mem_desc *fw_overlay_mem);
4066 
4067 /* Ystorm flow control mode. Use enum fw_flow_ctrl_mode */
4068 #define YSTORM_FLOW_CONTROL_MODE_OFFSET			(IRO[0].base)
4069 #define YSTORM_FLOW_CONTROL_MODE_SIZE			(IRO[0].size)
4070 
4071 /* Tstorm port statistics */
4072 #define TSTORM_PORT_STAT_OFFSET(port_id) \
4073 	(IRO[1].base + ((port_id) * IRO[1].m1))
4074 #define TSTORM_PORT_STAT_SIZE				(IRO[1].size)
4075 
4076 /* Tstorm ll2 port statistics */
4077 #define TSTORM_LL2_PORT_STAT_OFFSET(port_id) \
4078 	(IRO[2].base + ((port_id) * IRO[2].m1))
4079 #define TSTORM_LL2_PORT_STAT_SIZE			(IRO[2].size)
4080 
4081 /* Ustorm VF-PF Channel ready flag */
4082 #define USTORM_VF_PF_CHANNEL_READY_OFFSET(vf_id) \
4083 	(IRO[3].base + ((vf_id) * IRO[3].m1))
4084 #define USTORM_VF_PF_CHANNEL_READY_SIZE			(IRO[3].size)
4085 
4086 /* Ustorm Final flr cleanup ack */
4087 #define USTORM_FLR_FINAL_ACK_OFFSET(pf_id) \
4088 	(IRO[4].base + ((pf_id) * IRO[4].m1))
4089 #define USTORM_FLR_FINAL_ACK_SIZE			(IRO[4].size)
4090 
4091 /* Ustorm Event ring consumer */
4092 #define USTORM_EQE_CONS_OFFSET(pf_id) \
4093 	(IRO[5].base + ((pf_id) * IRO[5].m1))
4094 #define USTORM_EQE_CONS_SIZE				(IRO[5].size)
4095 
4096 /* Ustorm eth queue zone */
4097 #define USTORM_ETH_QUEUE_ZONE_OFFSET(queue_zone_id) \
4098 	(IRO[6].base + ((queue_zone_id) * IRO[6].m1))
4099 #define USTORM_ETH_QUEUE_ZONE_SIZE			(IRO[6].size)
4100 
4101 /* Ustorm Common Queue ring consumer */
4102 #define USTORM_COMMON_QUEUE_CONS_OFFSET(queue_zone_id) \
4103 	(IRO[7].base + ((queue_zone_id) * IRO[7].m1))
4104 #define USTORM_COMMON_QUEUE_CONS_SIZE			(IRO[7].size)
4105 
4106 /* Xstorm common PQ info */
4107 #define XSTORM_PQ_INFO_OFFSET(pq_id) \
4108 	(IRO[8].base + ((pq_id) * IRO[8].m1))
4109 #define XSTORM_PQ_INFO_SIZE				(IRO[8].size)
4110 
4111 /* Xstorm Integration Test Data */
4112 #define XSTORM_INTEG_TEST_DATA_OFFSET			(IRO[9].base)
4113 #define XSTORM_INTEG_TEST_DATA_SIZE			(IRO[9].size)
4114 
4115 /* Ystorm Integration Test Data */
4116 #define YSTORM_INTEG_TEST_DATA_OFFSET			(IRO[10].base)
4117 #define YSTORM_INTEG_TEST_DATA_SIZE			(IRO[10].size)
4118 
4119 /* Pstorm Integration Test Data */
4120 #define PSTORM_INTEG_TEST_DATA_OFFSET			(IRO[11].base)
4121 #define PSTORM_INTEG_TEST_DATA_SIZE			(IRO[11].size)
4122 
4123 /* Tstorm Integration Test Data */
4124 #define TSTORM_INTEG_TEST_DATA_OFFSET			(IRO[12].base)
4125 #define TSTORM_INTEG_TEST_DATA_SIZE			(IRO[12].size)
4126 
4127 /* Mstorm Integration Test Data */
4128 #define MSTORM_INTEG_TEST_DATA_OFFSET			(IRO[13].base)
4129 #define MSTORM_INTEG_TEST_DATA_SIZE			(IRO[13].size)
4130 
4131 /* Ustorm Integration Test Data */
4132 #define USTORM_INTEG_TEST_DATA_OFFSET			(IRO[14].base)
4133 #define USTORM_INTEG_TEST_DATA_SIZE			(IRO[14].size)
4134 
4135 /* Xstorm overlay buffer host address */
4136 #define XSTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[15].base)
4137 #define XSTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[15].size)
4138 
4139 /* Ystorm overlay buffer host address */
4140 #define YSTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[16].base)
4141 #define YSTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[16].size)
4142 
4143 /* Pstorm overlay buffer host address */
4144 #define PSTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[17].base)
4145 #define PSTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[17].size)
4146 
4147 /* Tstorm overlay buffer host address */
4148 #define TSTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[18].base)
4149 #define TSTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[18].size)
4150 
4151 /* Mstorm overlay buffer host address */
4152 #define MSTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[19].base)
4153 #define MSTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[19].size)
4154 
4155 /* Ustorm overlay buffer host address */
4156 #define USTORM_OVERLAY_BUF_ADDR_OFFSET			(IRO[20].base)
4157 #define USTORM_OVERLAY_BUF_ADDR_SIZE			(IRO[20].size)
4158 
4159 /* Tstorm producers */
4160 #define TSTORM_LL2_RX_PRODS_OFFSET(core_rx_queue_id) \
4161 	(IRO[21].base + ((core_rx_queue_id) * IRO[21].m1))
4162 #define TSTORM_LL2_RX_PRODS_SIZE			(IRO[21].size)
4163 
4164 /* Tstorm LightL2 queue statistics */
4165 #define CORE_LL2_TSTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id) \
4166 	(IRO[22].base + ((core_rx_queue_id) * IRO[22].m1))
4167 #define CORE_LL2_TSTORM_PER_QUEUE_STAT_SIZE		(IRO[22].size)
4168 
4169 /* Ustorm LiteL2 queue statistics */
4170 #define CORE_LL2_USTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id) \
4171 	(IRO[23].base + ((core_rx_queue_id) * IRO[23].m1))
4172 #define CORE_LL2_USTORM_PER_QUEUE_STAT_SIZE		(IRO[23].size)
4173 
4174 /* Pstorm LiteL2 queue statistics */
4175 #define CORE_LL2_PSTORM_PER_QUEUE_STAT_OFFSET(core_tx_stats_id) \
4176 	(IRO[24].base + ((core_tx_stats_id) * IRO[24].m1))
4177 #define CORE_LL2_PSTORM_PER_QUEUE_STAT_SIZE		(IRO[24].size)
4178 
4179 /* Mstorm queue statistics */
4180 #define MSTORM_QUEUE_STAT_OFFSET(stat_counter_id) \
4181 	(IRO[25].base + ((stat_counter_id) * IRO[25].m1))
4182 #define MSTORM_QUEUE_STAT_SIZE				(IRO[25].size)
4183 
4184 /* TPA agregation timeout in us resolution (on ASIC) */
4185 #define MSTORM_TPA_TIMEOUT_US_OFFSET			(IRO[26].base)
4186 #define MSTORM_TPA_TIMEOUT_US_SIZE			(IRO[26].size)
4187 
4188 /* Mstorm ETH VF queues producers offset in RAM. Used in default VF zone size
4189  * mode
4190  */
4191 #define MSTORM_ETH_VF_PRODS_OFFSET(vf_id, vf_queue_id) \
4192 	(IRO[27].base + ((vf_id) * IRO[27].m1) + ((vf_queue_id) * IRO[27].m2))
4193 #define MSTORM_ETH_VF_PRODS_SIZE			(IRO[27].size)
4194 
4195 /* Mstorm ETH PF queues producers */
4196 #define MSTORM_ETH_PF_PRODS_OFFSET(queue_id) \
4197 	(IRO[28].base + ((queue_id) * IRO[28].m1))
4198 #define MSTORM_ETH_PF_PRODS_SIZE			(IRO[28].size)
4199 
4200 /* Mstorm pf statistics */
4201 #define MSTORM_ETH_PF_STAT_OFFSET(pf_id) \
4202 	(IRO[29].base + ((pf_id) * IRO[29].m1))
4203 #define MSTORM_ETH_PF_STAT_SIZE				(IRO[29].size)
4204 
4205 /* Ustorm queue statistics */
4206 #define USTORM_QUEUE_STAT_OFFSET(stat_counter_id) \
4207 	(IRO[30].base + ((stat_counter_id) * IRO[30].m1))
4208 #define USTORM_QUEUE_STAT_SIZE				(IRO[30].size)
4209 
4210 /* Ustorm pf statistics */
4211 #define USTORM_ETH_PF_STAT_OFFSET(pf_id) \
4212 	(IRO[31].base + ((pf_id) * IRO[31].m1))
4213 #define USTORM_ETH_PF_STAT_SIZE				(IRO[31].size)
4214 
4215 /* Pstorm queue statistics */
4216 #define PSTORM_QUEUE_STAT_OFFSET(stat_counter_id)	\
4217 	(IRO[32].base + ((stat_counter_id) * IRO[32].m1))
4218 #define PSTORM_QUEUE_STAT_SIZE				(IRO[32].size)
4219 
4220 /* Pstorm pf statistics */
4221 #define PSTORM_ETH_PF_STAT_OFFSET(pf_id) \
4222 	(IRO[33].base + ((pf_id) * IRO[33].m1))
4223 #define PSTORM_ETH_PF_STAT_SIZE				(IRO[33].size)
4224 
4225 /* Control frame's EthType configuration for TX control frame security */
4226 #define PSTORM_CTL_FRAME_ETHTYPE_OFFSET(eth_type_id)	\
4227 	(IRO[34].base + ((eth_type_id) * IRO[34].m1))
4228 #define PSTORM_CTL_FRAME_ETHTYPE_SIZE			(IRO[34].size)
4229 
4230 /* Tstorm last parser message */
4231 #define TSTORM_ETH_PRS_INPUT_OFFSET			(IRO[35].base)
4232 #define TSTORM_ETH_PRS_INPUT_SIZE			(IRO[35].size)
4233 
4234 /* Tstorm Eth limit Rx rate */
4235 #define ETH_RX_RATE_LIMIT_OFFSET(pf_id)	\
4236 	(IRO[36].base + ((pf_id) * IRO[36].m1))
4237 #define ETH_RX_RATE_LIMIT_SIZE				(IRO[36].size)
4238 
4239 /* RSS indirection table entry update command per PF offset in TSTORM PF BAR0.
4240  * Use eth_tstorm_rss_update_data for update
4241  */
4242 #define TSTORM_ETH_RSS_UPDATE_OFFSET(pf_id) \
4243 	(IRO[37].base + ((pf_id) * IRO[37].m1))
4244 #define TSTORM_ETH_RSS_UPDATE_SIZE			(IRO[37].size)
4245 
4246 /* Xstorm queue zone */
4247 #define XSTORM_ETH_QUEUE_ZONE_OFFSET(queue_id) \
4248 	(IRO[38].base + ((queue_id) * IRO[38].m1))
4249 #define XSTORM_ETH_QUEUE_ZONE_SIZE			(IRO[38].size)
4250 
4251 /* Ystorm cqe producer */
4252 #define YSTORM_TOE_CQ_PROD_OFFSET(rss_id) \
4253 	(IRO[39].base + ((rss_id) * IRO[39].m1))
4254 #define YSTORM_TOE_CQ_PROD_SIZE				(IRO[39].size)
4255 
4256 /* Ustorm cqe producer */
4257 #define USTORM_TOE_CQ_PROD_OFFSET(rss_id) \
4258 	(IRO[40].base + ((rss_id) * IRO[40].m1))
4259 #define USTORM_TOE_CQ_PROD_SIZE				(IRO[40].size)
4260 
4261 /* Ustorm grq producer */
4262 #define USTORM_TOE_GRQ_PROD_OFFSET(pf_id) \
4263 	(IRO[41].base + ((pf_id) * IRO[41].m1))
4264 #define USTORM_TOE_GRQ_PROD_SIZE			(IRO[41].size)
4265 
4266 /* Tstorm cmdq-cons of given command queue-id */
4267 #define TSTORM_SCSI_CMDQ_CONS_OFFSET(cmdq_queue_id) \
4268 	(IRO[42].base + ((cmdq_queue_id) * IRO[42].m1))
4269 #define TSTORM_SCSI_CMDQ_CONS_SIZE			(IRO[42].size)
4270 
4271 /* Tstorm (reflects M-Storm) bdq-external-producer of given function ID,
4272  * BDqueue-id
4273  */
4274 #define TSTORM_SCSI_BDQ_EXT_PROD_OFFSET(storage_func_id, bdq_id) \
4275 	(IRO[43].base + ((storage_func_id) * IRO[43].m1) + \
4276 	 ((bdq_id) * IRO[43].m2))
4277 #define TSTORM_SCSI_BDQ_EXT_PROD_SIZE			(IRO[43].size)
4278 
4279 /* Mstorm bdq-external-producer of given BDQ resource ID, BDqueue-id */
4280 #define MSTORM_SCSI_BDQ_EXT_PROD_OFFSET(storage_func_id, bdq_id) \
4281 	(IRO[44].base + ((storage_func_id) * IRO[44].m1) + \
4282 	 ((bdq_id) * IRO[44].m2))
4283 #define MSTORM_SCSI_BDQ_EXT_PROD_SIZE			(IRO[44].size)
4284 
4285 /* Tstorm iSCSI RX stats */
4286 #define TSTORM_ISCSI_RX_STATS_OFFSET(storage_func_id) \
4287 	(IRO[45].base + ((storage_func_id) * IRO[45].m1))
4288 #define TSTORM_ISCSI_RX_STATS_SIZE			(IRO[45].size)
4289 
4290 /* Mstorm iSCSI RX stats */
4291 #define MSTORM_ISCSI_RX_STATS_OFFSET(storage_func_id) \
4292 	(IRO[46].base + ((storage_func_id) * IRO[46].m1))
4293 #define MSTORM_ISCSI_RX_STATS_SIZE			(IRO[46].size)
4294 
4295 /* Ustorm iSCSI RX stats */
4296 #define USTORM_ISCSI_RX_STATS_OFFSET(storage_func_id) \
4297 	(IRO[47].base + ((storage_func_id) * IRO[47].m1))
4298 #define USTORM_ISCSI_RX_STATS_SIZE			(IRO[47].size)
4299 
4300 /* Xstorm iSCSI TX stats */
4301 #define XSTORM_ISCSI_TX_STATS_OFFSET(storage_func_id) \
4302 	(IRO[48].base + ((storage_func_id) * IRO[48].m1))
4303 #define XSTORM_ISCSI_TX_STATS_SIZE			(IRO[48].size)
4304 
4305 /* Ystorm iSCSI TX stats */
4306 #define YSTORM_ISCSI_TX_STATS_OFFSET(storage_func_id) \
4307 	(IRO[49].base + ((storage_func_id) * IRO[49].m1))
4308 #define YSTORM_ISCSI_TX_STATS_SIZE			(IRO[49].size)
4309 
4310 /* Pstorm iSCSI TX stats */
4311 #define PSTORM_ISCSI_TX_STATS_OFFSET(storage_func_id) \
4312 	(IRO[50].base + ((storage_func_id) * IRO[50].m1))
4313 #define PSTORM_ISCSI_TX_STATS_SIZE			(IRO[50].size)
4314 
4315 /* Tstorm FCoE RX stats */
4316 #define TSTORM_FCOE_RX_STATS_OFFSET(pf_id) \
4317 	(IRO[51].base + ((pf_id) * IRO[51].m1))
4318 #define TSTORM_FCOE_RX_STATS_SIZE			(IRO[51].size)
4319 
4320 /* Pstorm FCoE TX stats */
4321 #define PSTORM_FCOE_TX_STATS_OFFSET(pf_id) \
4322 	(IRO[52].base + ((pf_id) * IRO[52].m1))
4323 #define PSTORM_FCOE_TX_STATS_SIZE			(IRO[52].size)
4324 
4325 /* Pstorm RDMA queue statistics */
4326 #define PSTORM_RDMA_QUEUE_STAT_OFFSET(rdma_stat_counter_id) \
4327 	(IRO[53].base + ((rdma_stat_counter_id) * IRO[53].m1))
4328 #define PSTORM_RDMA_QUEUE_STAT_SIZE			(IRO[53].size)
4329 
4330 /* Tstorm RDMA queue statistics */
4331 #define TSTORM_RDMA_QUEUE_STAT_OFFSET(rdma_stat_counter_id) \
4332 	(IRO[54].base + ((rdma_stat_counter_id) * IRO[54].m1))
4333 #define TSTORM_RDMA_QUEUE_STAT_SIZE			(IRO[54].size)
4334 
4335 /* Xstorm error level for assert */
4336 #define XSTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4337 	(IRO[55].base + ((pf_id) * IRO[55].m1))
4338 #define XSTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[55].size)
4339 
4340 /* Ystorm error level for assert */
4341 #define YSTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4342 	(IRO[56].base + ((pf_id) * IRO[56].m1))
4343 #define YSTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[56].size)
4344 
4345 /* Pstorm error level for assert */
4346 #define PSTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4347 	(IRO[57].base + ((pf_id) * IRO[57].m1))
4348 #define PSTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[57].size)
4349 
4350 /* Tstorm error level for assert */
4351 #define TSTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4352 	(IRO[58].base + ((pf_id) * IRO[58].m1))
4353 #define TSTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[58].size)
4354 
4355 /* Mstorm error level for assert */
4356 #define MSTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4357 	(IRO[59].base + ((pf_id) * IRO[59].m1))
4358 #define MSTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[59].size)
4359 
4360 /* Ustorm error level for assert */
4361 #define USTORM_RDMA_ASSERT_LEVEL_OFFSET(pf_id) \
4362 	(IRO[60].base + ((pf_id) * IRO[60].m1))
4363 #define USTORM_RDMA_ASSERT_LEVEL_SIZE			(IRO[60].size)
4364 
4365 /* Xstorm iWARP rxmit stats */
4366 #define XSTORM_IWARP_RXMIT_STATS_OFFSET(pf_id) \
4367 	(IRO[61].base + ((pf_id) * IRO[61].m1))
4368 #define XSTORM_IWARP_RXMIT_STATS_SIZE			(IRO[61].size)
4369 
4370 /* Tstorm RoCE Event Statistics */
4371 #define TSTORM_ROCE_EVENTS_STAT_OFFSET(roce_pf_id)	\
4372 	(IRO[62].base + ((roce_pf_id) * IRO[62].m1))
4373 #define TSTORM_ROCE_EVENTS_STAT_SIZE			(IRO[62].size)
4374 
4375 /* DCQCN Received Statistics */
4376 #define YSTORM_ROCE_DCQCN_RECEIVED_STATS_OFFSET(roce_pf_id)\
4377 	(IRO[63].base + ((roce_pf_id) * IRO[63].m1))
4378 #define YSTORM_ROCE_DCQCN_RECEIVED_STATS_SIZE		(IRO[63].size)
4379 
4380 /* RoCE Error Statistics */
4381 #define YSTORM_ROCE_ERROR_STATS_OFFSET(roce_pf_id)	\
4382 	(IRO[64].base + ((roce_pf_id) * IRO[64].m1))
4383 #define YSTORM_ROCE_ERROR_STATS_SIZE			(IRO[64].size)
4384 
4385 /* DCQCN Sent Statistics */
4386 #define PSTORM_ROCE_DCQCN_SENT_STATS_OFFSET(roce_pf_id)	\
4387 	(IRO[65].base + ((roce_pf_id) * IRO[65].m1))
4388 #define PSTORM_ROCE_DCQCN_SENT_STATS_SIZE		(IRO[65].size)
4389 
4390 /* RoCE CQEs Statistics */
4391 #define USTORM_ROCE_CQE_STATS_OFFSET(roce_pf_id)	\
4392 	(IRO[66].base + ((roce_pf_id) * IRO[66].m1))
4393 #define USTORM_ROCE_CQE_STATS_SIZE			(IRO[66].size)
4394 
4395 /* Runtime array offsets */
4396 #define DORQ_REG_PF_MAX_ICID_0_RT_OFFSET				0
4397 #define DORQ_REG_PF_MAX_ICID_1_RT_OFFSET				1
4398 #define DORQ_REG_PF_MAX_ICID_2_RT_OFFSET				2
4399 #define DORQ_REG_PF_MAX_ICID_3_RT_OFFSET				3
4400 #define DORQ_REG_PF_MAX_ICID_4_RT_OFFSET				4
4401 #define DORQ_REG_PF_MAX_ICID_5_RT_OFFSET				5
4402 #define DORQ_REG_PF_MAX_ICID_6_RT_OFFSET				6
4403 #define DORQ_REG_PF_MAX_ICID_7_RT_OFFSET				7
4404 #define DORQ_REG_VF_MAX_ICID_0_RT_OFFSET				8
4405 #define DORQ_REG_VF_MAX_ICID_1_RT_OFFSET				9
4406 #define DORQ_REG_VF_MAX_ICID_2_RT_OFFSET				10
4407 #define DORQ_REG_VF_MAX_ICID_3_RT_OFFSET				11
4408 #define DORQ_REG_VF_MAX_ICID_4_RT_OFFSET				12
4409 #define DORQ_REG_VF_MAX_ICID_5_RT_OFFSET				13
4410 #define DORQ_REG_VF_MAX_ICID_6_RT_OFFSET				14
4411 #define DORQ_REG_VF_MAX_ICID_7_RT_OFFSET				15
4412 #define DORQ_REG_VF_ICID_BIT_SHIFT_NORM_RT_OFFSET			16
4413 #define DORQ_REG_PF_WAKE_ALL_RT_OFFSET					17
4414 #define DORQ_REG_TAG1_ETHERTYPE_RT_OFFSET				18
4415 #define IGU_REG_PF_CONFIGURATION_RT_OFFSET				19
4416 #define IGU_REG_VF_CONFIGURATION_RT_OFFSET				20
4417 #define IGU_REG_ATTN_MSG_ADDR_L_RT_OFFSET				21
4418 #define IGU_REG_ATTN_MSG_ADDR_H_RT_OFFSET				22
4419 #define IGU_REG_LEADING_EDGE_LATCH_RT_OFFSET				23
4420 #define IGU_REG_TRAILING_EDGE_LATCH_RT_OFFSET				24
4421 #define CAU_REG_CQE_AGG_UNIT_SIZE_RT_OFFSET				25
4422 #define CAU_REG_SB_VAR_MEMORY_RT_OFFSET					26
4423 #define CAU_REG_SB_VAR_MEMORY_RT_SIZE					736
4424 #define CAU_REG_SB_ADDR_MEMORY_RT_OFFSET				762
4425 #define CAU_REG_SB_ADDR_MEMORY_RT_SIZE					736
4426 #define CAU_REG_PI_MEMORY_RT_OFFSET					1498
4427 #define CAU_REG_PI_MEMORY_RT_SIZE					4416
4428 #define PRS_REG_SEARCH_RESP_INITIATOR_TYPE_RT_OFFSET			5914
4429 #define PRS_REG_TASK_ID_MAX_INITIATOR_PF_RT_OFFSET			5915
4430 #define PRS_REG_TASK_ID_MAX_INITIATOR_VF_RT_OFFSET			5916
4431 #define PRS_REG_TASK_ID_MAX_TARGET_PF_RT_OFFSET				5917
4432 #define PRS_REG_TASK_ID_MAX_TARGET_VF_RT_OFFSET				5918
4433 #define PRS_REG_SEARCH_TCP_RT_OFFSET					5919
4434 #define PRS_REG_SEARCH_FCOE_RT_OFFSET					5920
4435 #define PRS_REG_SEARCH_ROCE_RT_OFFSET					5921
4436 #define PRS_REG_ROCE_DEST_QP_MAX_VF_RT_OFFSET				5922
4437 #define PRS_REG_ROCE_DEST_QP_MAX_PF_RT_OFFSET				5923
4438 #define PRS_REG_SEARCH_OPENFLOW_RT_OFFSET				5924
4439 #define PRS_REG_SEARCH_NON_IP_AS_OPENFLOW_RT_OFFSET			5925
4440 #define PRS_REG_OPENFLOW_SUPPORT_ONLY_KNOWN_OVER_IP_RT_OFFSET		5926
4441 #define PRS_REG_OPENFLOW_SEARCH_KEY_MASK_RT_OFFSET			5927
4442 #define PRS_REG_TAG_ETHERTYPE_0_RT_OFFSET				5928
4443 #define PRS_REG_LIGHT_L2_ETHERTYPE_EN_RT_OFFSET				5929
4444 #define SRC_REG_FIRSTFREE_RT_OFFSET					5930
4445 #define SRC_REG_FIRSTFREE_RT_SIZE					2
4446 #define SRC_REG_LASTFREE_RT_OFFSET					5932
4447 #define SRC_REG_LASTFREE_RT_SIZE					2
4448 #define SRC_REG_COUNTFREE_RT_OFFSET					5934
4449 #define SRC_REG_NUMBER_HASH_BITS_RT_OFFSET				5935
4450 #define PSWRQ2_REG_CDUT_P_SIZE_RT_OFFSET				5936
4451 #define PSWRQ2_REG_CDUC_P_SIZE_RT_OFFSET				5937
4452 #define PSWRQ2_REG_TM_P_SIZE_RT_OFFSET					5938
4453 #define PSWRQ2_REG_QM_P_SIZE_RT_OFFSET					5939
4454 #define PSWRQ2_REG_SRC_P_SIZE_RT_OFFSET					5940
4455 #define PSWRQ2_REG_TSDM_P_SIZE_RT_OFFSET				5941
4456 #define PSWRQ2_REG_TM_FIRST_ILT_RT_OFFSET				5942
4457 #define PSWRQ2_REG_TM_LAST_ILT_RT_OFFSET				5943
4458 #define PSWRQ2_REG_QM_FIRST_ILT_RT_OFFSET				5944
4459 #define PSWRQ2_REG_QM_LAST_ILT_RT_OFFSET				5945
4460 #define PSWRQ2_REG_SRC_FIRST_ILT_RT_OFFSET				5946
4461 #define PSWRQ2_REG_SRC_LAST_ILT_RT_OFFSET				5947
4462 #define PSWRQ2_REG_CDUC_FIRST_ILT_RT_OFFSET				5948
4463 #define PSWRQ2_REG_CDUC_LAST_ILT_RT_OFFSET				5949
4464 #define PSWRQ2_REG_CDUT_FIRST_ILT_RT_OFFSET				5950
4465 #define PSWRQ2_REG_CDUT_LAST_ILT_RT_OFFSET				5951
4466 #define PSWRQ2_REG_TSDM_FIRST_ILT_RT_OFFSET				5952
4467 #define PSWRQ2_REG_TSDM_LAST_ILT_RT_OFFSET				5953
4468 #define PSWRQ2_REG_TM_NUMBER_OF_PF_BLOCKS_RT_OFFSET			5954
4469 #define PSWRQ2_REG_CDUT_NUMBER_OF_PF_BLOCKS_RT_OFFSET			5955
4470 #define PSWRQ2_REG_CDUC_NUMBER_OF_PF_BLOCKS_RT_OFFSET			5956
4471 #define PSWRQ2_REG_TM_VF_BLOCKS_RT_OFFSET				5957
4472 #define PSWRQ2_REG_CDUT_VF_BLOCKS_RT_OFFSET				5958
4473 #define PSWRQ2_REG_CDUC_VF_BLOCKS_RT_OFFSET				5959
4474 #define PSWRQ2_REG_TM_BLOCKS_FACTOR_RT_OFFSET				5960
4475 #define PSWRQ2_REG_CDUT_BLOCKS_FACTOR_RT_OFFSET				5961
4476 #define PSWRQ2_REG_CDUC_BLOCKS_FACTOR_RT_OFFSET				5962
4477 #define PSWRQ2_REG_VF_BASE_RT_OFFSET					5963
4478 #define PSWRQ2_REG_VF_LAST_ILT_RT_OFFSET				5964
4479 #define PSWRQ2_REG_DRAM_ALIGN_WR_RT_OFFSET				5965
4480 #define PSWRQ2_REG_DRAM_ALIGN_RD_RT_OFFSET				5966
4481 #define PSWRQ2_REG_ILT_MEMORY_RT_OFFSET					5967
4482 #define PSWRQ2_REG_ILT_MEMORY_RT_SIZE					22000
4483 #define PGLUE_REG_B_VF_BASE_RT_OFFSET					27967
4484 #define PGLUE_REG_B_MSDM_OFFSET_MASK_B_RT_OFFSET			27968
4485 #define PGLUE_REG_B_MSDM_VF_SHIFT_B_RT_OFFSET				27969
4486 #define PGLUE_REG_B_CACHE_LINE_SIZE_RT_OFFSET				27970
4487 #define PGLUE_REG_B_PF_BAR0_SIZE_RT_OFFSET				27971
4488 #define PGLUE_REG_B_PF_BAR1_SIZE_RT_OFFSET				27972
4489 #define PGLUE_REG_B_VF_BAR1_SIZE_RT_OFFSET				27973
4490 #define TM_REG_VF_ENABLE_CONN_RT_OFFSET					27974
4491 #define TM_REG_PF_ENABLE_CONN_RT_OFFSET					27975
4492 #define TM_REG_PF_ENABLE_TASK_RT_OFFSET					27976
4493 #define TM_REG_GROUP_SIZE_RESOLUTION_CONN_RT_OFFSET			27977
4494 #define TM_REG_GROUP_SIZE_RESOLUTION_TASK_RT_OFFSET			27978
4495 #define TM_REG_CONFIG_CONN_MEM_RT_OFFSET				27979
4496 #define TM_REG_CONFIG_CONN_MEM_RT_SIZE					416
4497 #define TM_REG_CONFIG_TASK_MEM_RT_OFFSET				28395
4498 #define TM_REG_CONFIG_TASK_MEM_RT_SIZE					512
4499 #define QM_REG_MAXPQSIZE_0_RT_OFFSET					28907
4500 #define QM_REG_MAXPQSIZE_1_RT_OFFSET					28908
4501 #define QM_REG_MAXPQSIZE_2_RT_OFFSET					28909
4502 #define QM_REG_MAXPQSIZETXSEL_0_RT_OFFSET				28910
4503 #define QM_REG_MAXPQSIZETXSEL_1_RT_OFFSET				28911
4504 #define QM_REG_MAXPQSIZETXSEL_2_RT_OFFSET				28912
4505 #define QM_REG_MAXPQSIZETXSEL_3_RT_OFFSET				28913
4506 #define QM_REG_MAXPQSIZETXSEL_4_RT_OFFSET				28914
4507 #define QM_REG_MAXPQSIZETXSEL_5_RT_OFFSET				28915
4508 #define QM_REG_MAXPQSIZETXSEL_6_RT_OFFSET				28916
4509 #define QM_REG_MAXPQSIZETXSEL_7_RT_OFFSET				28917
4510 #define QM_REG_MAXPQSIZETXSEL_8_RT_OFFSET				28918
4511 #define QM_REG_MAXPQSIZETXSEL_9_RT_OFFSET				28919
4512 #define QM_REG_MAXPQSIZETXSEL_10_RT_OFFSET				28920
4513 #define QM_REG_MAXPQSIZETXSEL_11_RT_OFFSET				28921
4514 #define QM_REG_MAXPQSIZETXSEL_12_RT_OFFSET				28922
4515 #define QM_REG_MAXPQSIZETXSEL_13_RT_OFFSET				28923
4516 #define QM_REG_MAXPQSIZETXSEL_14_RT_OFFSET				28924
4517 #define QM_REG_MAXPQSIZETXSEL_15_RT_OFFSET				28925
4518 #define QM_REG_MAXPQSIZETXSEL_16_RT_OFFSET				28926
4519 #define QM_REG_MAXPQSIZETXSEL_17_RT_OFFSET				28927
4520 #define QM_REG_MAXPQSIZETXSEL_18_RT_OFFSET				28928
4521 #define QM_REG_MAXPQSIZETXSEL_19_RT_OFFSET				28929
4522 #define QM_REG_MAXPQSIZETXSEL_20_RT_OFFSET				28930
4523 #define QM_REG_MAXPQSIZETXSEL_21_RT_OFFSET				28931
4524 #define QM_REG_MAXPQSIZETXSEL_22_RT_OFFSET				28932
4525 #define QM_REG_MAXPQSIZETXSEL_23_RT_OFFSET				28933
4526 #define QM_REG_MAXPQSIZETXSEL_24_RT_OFFSET				28934
4527 #define QM_REG_MAXPQSIZETXSEL_25_RT_OFFSET				28935
4528 #define QM_REG_MAXPQSIZETXSEL_26_RT_OFFSET				28936
4529 #define QM_REG_MAXPQSIZETXSEL_27_RT_OFFSET				28937
4530 #define QM_REG_MAXPQSIZETXSEL_28_RT_OFFSET				28938
4531 #define QM_REG_MAXPQSIZETXSEL_29_RT_OFFSET				28939
4532 #define QM_REG_MAXPQSIZETXSEL_30_RT_OFFSET				28940
4533 #define QM_REG_MAXPQSIZETXSEL_31_RT_OFFSET				28941
4534 #define QM_REG_MAXPQSIZETXSEL_32_RT_OFFSET				28942
4535 #define QM_REG_MAXPQSIZETXSEL_33_RT_OFFSET				28943
4536 #define QM_REG_MAXPQSIZETXSEL_34_RT_OFFSET				28944
4537 #define QM_REG_MAXPQSIZETXSEL_35_RT_OFFSET				28945
4538 #define QM_REG_MAXPQSIZETXSEL_36_RT_OFFSET				28946
4539 #define QM_REG_MAXPQSIZETXSEL_37_RT_OFFSET				28947
4540 #define QM_REG_MAXPQSIZETXSEL_38_RT_OFFSET				28948
4541 #define QM_REG_MAXPQSIZETXSEL_39_RT_OFFSET				28949
4542 #define QM_REG_MAXPQSIZETXSEL_40_RT_OFFSET				28950
4543 #define QM_REG_MAXPQSIZETXSEL_41_RT_OFFSET				28951
4544 #define QM_REG_MAXPQSIZETXSEL_42_RT_OFFSET				28952
4545 #define QM_REG_MAXPQSIZETXSEL_43_RT_OFFSET				28953
4546 #define QM_REG_MAXPQSIZETXSEL_44_RT_OFFSET				28954
4547 #define QM_REG_MAXPQSIZETXSEL_45_RT_OFFSET				28955
4548 #define QM_REG_MAXPQSIZETXSEL_46_RT_OFFSET				28956
4549 #define QM_REG_MAXPQSIZETXSEL_47_RT_OFFSET				28957
4550 #define QM_REG_MAXPQSIZETXSEL_48_RT_OFFSET				28958
4551 #define QM_REG_MAXPQSIZETXSEL_49_RT_OFFSET				28959
4552 #define QM_REG_MAXPQSIZETXSEL_50_RT_OFFSET				28960
4553 #define QM_REG_MAXPQSIZETXSEL_51_RT_OFFSET				28961
4554 #define QM_REG_MAXPQSIZETXSEL_52_RT_OFFSET				28962
4555 #define QM_REG_MAXPQSIZETXSEL_53_RT_OFFSET				28963
4556 #define QM_REG_MAXPQSIZETXSEL_54_RT_OFFSET				28964
4557 #define QM_REG_MAXPQSIZETXSEL_55_RT_OFFSET				28965
4558 #define QM_REG_MAXPQSIZETXSEL_56_RT_OFFSET				28966
4559 #define QM_REG_MAXPQSIZETXSEL_57_RT_OFFSET				28967
4560 #define QM_REG_MAXPQSIZETXSEL_58_RT_OFFSET				28968
4561 #define QM_REG_MAXPQSIZETXSEL_59_RT_OFFSET				28969
4562 #define QM_REG_MAXPQSIZETXSEL_60_RT_OFFSET				28970
4563 #define QM_REG_MAXPQSIZETXSEL_61_RT_OFFSET				28971
4564 #define QM_REG_MAXPQSIZETXSEL_62_RT_OFFSET				28972
4565 #define QM_REG_MAXPQSIZETXSEL_63_RT_OFFSET				28973
4566 #define QM_REG_BASEADDROTHERPQ_RT_OFFSET				28974
4567 #define QM_REG_BASEADDROTHERPQ_RT_SIZE					128
4568 #define QM_REG_PTRTBLOTHER_RT_OFFSET					29102
4569 #define QM_REG_PTRTBLOTHER_RT_SIZE					256
4570 #define QM_REG_VOQCRDLINE_RT_OFFSET					29358
4571 #define QM_REG_VOQCRDLINE_RT_SIZE					20
4572 #define QM_REG_VOQINITCRDLINE_RT_OFFSET					29378
4573 #define QM_REG_VOQINITCRDLINE_RT_SIZE					20
4574 #define QM_REG_AFULLQMBYPTHRPFWFQ_RT_OFFSET				29398
4575 #define QM_REG_AFULLQMBYPTHRVPWFQ_RT_OFFSET				29399
4576 #define QM_REG_AFULLQMBYPTHRPFRL_RT_OFFSET				29400
4577 #define QM_REG_AFULLQMBYPTHRGLBLRL_RT_OFFSET				29401
4578 #define QM_REG_AFULLOPRTNSTCCRDMASK_RT_OFFSET				29402
4579 #define QM_REG_WRROTHERPQGRP_0_RT_OFFSET				29403
4580 #define QM_REG_WRROTHERPQGRP_1_RT_OFFSET				29404
4581 #define QM_REG_WRROTHERPQGRP_2_RT_OFFSET				29405
4582 #define QM_REG_WRROTHERPQGRP_3_RT_OFFSET				29406
4583 #define QM_REG_WRROTHERPQGRP_4_RT_OFFSET				29407
4584 #define QM_REG_WRROTHERPQGRP_5_RT_OFFSET				29408
4585 #define QM_REG_WRROTHERPQGRP_6_RT_OFFSET				29409
4586 #define QM_REG_WRROTHERPQGRP_7_RT_OFFSET				29410
4587 #define QM_REG_WRROTHERPQGRP_8_RT_OFFSET				29411
4588 #define QM_REG_WRROTHERPQGRP_9_RT_OFFSET				29412
4589 #define QM_REG_WRROTHERPQGRP_10_RT_OFFSET				29413
4590 #define QM_REG_WRROTHERPQGRP_11_RT_OFFSET				29414
4591 #define QM_REG_WRROTHERPQGRP_12_RT_OFFSET				29415
4592 #define QM_REG_WRROTHERPQGRP_13_RT_OFFSET				29416
4593 #define QM_REG_WRROTHERPQGRP_14_RT_OFFSET				29417
4594 #define QM_REG_WRROTHERPQGRP_15_RT_OFFSET				29418
4595 #define QM_REG_WRROTHERGRPWEIGHT_0_RT_OFFSET				29419
4596 #define QM_REG_WRROTHERGRPWEIGHT_1_RT_OFFSET				29420
4597 #define QM_REG_WRROTHERGRPWEIGHT_2_RT_OFFSET				29421
4598 #define QM_REG_WRROTHERGRPWEIGHT_3_RT_OFFSET				29422
4599 #define QM_REG_WRRTXGRPWEIGHT_0_RT_OFFSET				29423
4600 #define QM_REG_WRRTXGRPWEIGHT_1_RT_OFFSET				29424
4601 #define QM_REG_PQTX2PF_0_RT_OFFSET					29425
4602 #define QM_REG_PQTX2PF_1_RT_OFFSET					29426
4603 #define QM_REG_PQTX2PF_2_RT_OFFSET					29427
4604 #define QM_REG_PQTX2PF_3_RT_OFFSET					29428
4605 #define QM_REG_PQTX2PF_4_RT_OFFSET					29429
4606 #define QM_REG_PQTX2PF_5_RT_OFFSET					29430
4607 #define QM_REG_PQTX2PF_6_RT_OFFSET					29431
4608 #define QM_REG_PQTX2PF_7_RT_OFFSET					29432
4609 #define QM_REG_PQTX2PF_8_RT_OFFSET					29433
4610 #define QM_REG_PQTX2PF_9_RT_OFFSET					29434
4611 #define QM_REG_PQTX2PF_10_RT_OFFSET					29435
4612 #define QM_REG_PQTX2PF_11_RT_OFFSET					29436
4613 #define QM_REG_PQTX2PF_12_RT_OFFSET					29437
4614 #define QM_REG_PQTX2PF_13_RT_OFFSET					29438
4615 #define QM_REG_PQTX2PF_14_RT_OFFSET					29439
4616 #define QM_REG_PQTX2PF_15_RT_OFFSET					29440
4617 #define QM_REG_PQTX2PF_16_RT_OFFSET					29441
4618 #define QM_REG_PQTX2PF_17_RT_OFFSET					29442
4619 #define QM_REG_PQTX2PF_18_RT_OFFSET					29443
4620 #define QM_REG_PQTX2PF_19_RT_OFFSET					29444
4621 #define QM_REG_PQTX2PF_20_RT_OFFSET					29445
4622 #define QM_REG_PQTX2PF_21_RT_OFFSET					29446
4623 #define QM_REG_PQTX2PF_22_RT_OFFSET					29447
4624 #define QM_REG_PQTX2PF_23_RT_OFFSET					29448
4625 #define QM_REG_PQTX2PF_24_RT_OFFSET					29449
4626 #define QM_REG_PQTX2PF_25_RT_OFFSET					29450
4627 #define QM_REG_PQTX2PF_26_RT_OFFSET					29451
4628 #define QM_REG_PQTX2PF_27_RT_OFFSET					29452
4629 #define QM_REG_PQTX2PF_28_RT_OFFSET					29453
4630 #define QM_REG_PQTX2PF_29_RT_OFFSET					29454
4631 #define QM_REG_PQTX2PF_30_RT_OFFSET					29455
4632 #define QM_REG_PQTX2PF_31_RT_OFFSET					29456
4633 #define QM_REG_PQTX2PF_32_RT_OFFSET					29457
4634 #define QM_REG_PQTX2PF_33_RT_OFFSET					29458
4635 #define QM_REG_PQTX2PF_34_RT_OFFSET					29459
4636 #define QM_REG_PQTX2PF_35_RT_OFFSET					29460
4637 #define QM_REG_PQTX2PF_36_RT_OFFSET					29461
4638 #define QM_REG_PQTX2PF_37_RT_OFFSET					29462
4639 #define QM_REG_PQTX2PF_38_RT_OFFSET					29463
4640 #define QM_REG_PQTX2PF_39_RT_OFFSET					29464
4641 #define QM_REG_PQTX2PF_40_RT_OFFSET					29465
4642 #define QM_REG_PQTX2PF_41_RT_OFFSET					29466
4643 #define QM_REG_PQTX2PF_42_RT_OFFSET					29467
4644 #define QM_REG_PQTX2PF_43_RT_OFFSET					29468
4645 #define QM_REG_PQTX2PF_44_RT_OFFSET					29469
4646 #define QM_REG_PQTX2PF_45_RT_OFFSET					29470
4647 #define QM_REG_PQTX2PF_46_RT_OFFSET					29471
4648 #define QM_REG_PQTX2PF_47_RT_OFFSET					29472
4649 #define QM_REG_PQTX2PF_48_RT_OFFSET					29473
4650 #define QM_REG_PQTX2PF_49_RT_OFFSET					29474
4651 #define QM_REG_PQTX2PF_50_RT_OFFSET					29475
4652 #define QM_REG_PQTX2PF_51_RT_OFFSET					29476
4653 #define QM_REG_PQTX2PF_52_RT_OFFSET					29477
4654 #define QM_REG_PQTX2PF_53_RT_OFFSET					29478
4655 #define QM_REG_PQTX2PF_54_RT_OFFSET					29479
4656 #define QM_REG_PQTX2PF_55_RT_OFFSET					29480
4657 #define QM_REG_PQTX2PF_56_RT_OFFSET					29481
4658 #define QM_REG_PQTX2PF_57_RT_OFFSET					29482
4659 #define QM_REG_PQTX2PF_58_RT_OFFSET					29483
4660 #define QM_REG_PQTX2PF_59_RT_OFFSET					29484
4661 #define QM_REG_PQTX2PF_60_RT_OFFSET					29485
4662 #define QM_REG_PQTX2PF_61_RT_OFFSET					29486
4663 #define QM_REG_PQTX2PF_62_RT_OFFSET					29487
4664 #define QM_REG_PQTX2PF_63_RT_OFFSET					29488
4665 #define QM_REG_PQOTHER2PF_0_RT_OFFSET					29489
4666 #define QM_REG_PQOTHER2PF_1_RT_OFFSET					29490
4667 #define QM_REG_PQOTHER2PF_2_RT_OFFSET					29491
4668 #define QM_REG_PQOTHER2PF_3_RT_OFFSET					29492
4669 #define QM_REG_PQOTHER2PF_4_RT_OFFSET					29493
4670 #define QM_REG_PQOTHER2PF_5_RT_OFFSET					29494
4671 #define QM_REG_PQOTHER2PF_6_RT_OFFSET					29495
4672 #define QM_REG_PQOTHER2PF_7_RT_OFFSET					29496
4673 #define QM_REG_PQOTHER2PF_8_RT_OFFSET					29497
4674 #define QM_REG_PQOTHER2PF_9_RT_OFFSET					29498
4675 #define QM_REG_PQOTHER2PF_10_RT_OFFSET					29499
4676 #define QM_REG_PQOTHER2PF_11_RT_OFFSET					29500
4677 #define QM_REG_PQOTHER2PF_12_RT_OFFSET					29501
4678 #define QM_REG_PQOTHER2PF_13_RT_OFFSET					29502
4679 #define QM_REG_PQOTHER2PF_14_RT_OFFSET					29503
4680 #define QM_REG_PQOTHER2PF_15_RT_OFFSET					29504
4681 #define QM_REG_RLGLBLPERIOD_0_RT_OFFSET					29505
4682 #define QM_REG_RLGLBLPERIOD_1_RT_OFFSET					29506
4683 #define QM_REG_RLGLBLPERIODTIMER_0_RT_OFFSET				29507
4684 #define QM_REG_RLGLBLPERIODTIMER_1_RT_OFFSET				29508
4685 #define QM_REG_RLGLBLPERIODSEL_0_RT_OFFSET				29509
4686 #define QM_REG_RLGLBLPERIODSEL_1_RT_OFFSET				29510
4687 #define QM_REG_RLGLBLPERIODSEL_2_RT_OFFSET				29511
4688 #define QM_REG_RLGLBLPERIODSEL_3_RT_OFFSET				29512
4689 #define QM_REG_RLGLBLPERIODSEL_4_RT_OFFSET				29513
4690 #define QM_REG_RLGLBLPERIODSEL_5_RT_OFFSET				29514
4691 #define QM_REG_RLGLBLPERIODSEL_6_RT_OFFSET				29515
4692 #define QM_REG_RLGLBLPERIODSEL_7_RT_OFFSET				29516
4693 #define QM_REG_RLGLBLINCVAL_RT_OFFSET					29517
4694 #define QM_REG_RLGLBLINCVAL_RT_SIZE					256
4695 #define QM_REG_RLGLBLUPPERBOUND_RT_OFFSET				29773
4696 #define QM_REG_RLGLBLUPPERBOUND_RT_SIZE					256
4697 #define QM_REG_RLGLBLCRD_RT_OFFSET					30029
4698 #define QM_REG_RLGLBLCRD_RT_SIZE					256
4699 #define QM_REG_RLGLBLENABLE_RT_OFFSET					30285
4700 #define QM_REG_RLPFPERIOD_RT_OFFSET					30286
4701 #define QM_REG_RLPFPERIODTIMER_RT_OFFSET				30287
4702 #define QM_REG_RLPFINCVAL_RT_OFFSET					30288
4703 #define QM_REG_RLPFINCVAL_RT_SIZE					16
4704 #define QM_REG_RLPFUPPERBOUND_RT_OFFSET					30304
4705 #define QM_REG_RLPFUPPERBOUND_RT_SIZE					16
4706 #define QM_REG_RLPFCRD_RT_OFFSET					30320
4707 #define QM_REG_RLPFCRD_RT_SIZE						16
4708 #define QM_REG_RLPFENABLE_RT_OFFSET					30336
4709 #define QM_REG_RLPFVOQENABLE_RT_OFFSET					30337
4710 #define QM_REG_WFQPFWEIGHT_RT_OFFSET					30338
4711 #define QM_REG_WFQPFWEIGHT_RT_SIZE					16
4712 #define QM_REG_WFQPFUPPERBOUND_RT_OFFSET				30354
4713 #define QM_REG_WFQPFUPPERBOUND_RT_SIZE					16
4714 #define QM_REG_WFQPFCRD_RT_OFFSET					30370
4715 #define QM_REG_WFQPFCRD_RT_SIZE						160
4716 #define QM_REG_WFQPFENABLE_RT_OFFSET					30530
4717 #define QM_REG_WFQVPENABLE_RT_OFFSET					30531
4718 #define QM_REG_BASEADDRTXPQ_RT_OFFSET					30532
4719 #define QM_REG_BASEADDRTXPQ_RT_SIZE					512
4720 #define QM_REG_TXPQMAP_RT_OFFSET					31044
4721 #define QM_REG_TXPQMAP_RT_SIZE						512
4722 #define QM_REG_WFQVPWEIGHT_RT_OFFSET					31556
4723 #define QM_REG_WFQVPWEIGHT_RT_SIZE					512
4724 #define QM_REG_WFQVPCRD_RT_OFFSET					32068
4725 #define QM_REG_WFQVPCRD_RT_SIZE						512
4726 #define QM_REG_WFQVPMAP_RT_OFFSET					32580
4727 #define QM_REG_WFQVPMAP_RT_SIZE						512
4728 #define QM_REG_PTRTBLTX_RT_OFFSET					33092
4729 #define QM_REG_PTRTBLTX_RT_SIZE						1024
4730 #define QM_REG_WFQPFCRD_MSB_RT_OFFSET					34116
4731 #define QM_REG_WFQPFCRD_MSB_RT_SIZE					160
4732 #define NIG_REG_TAG_ETHERTYPE_0_RT_OFFSET				34276
4733 #define NIG_REG_BRB_GATE_DNTFWD_PORT_RT_OFFSET				34277
4734 #define NIG_REG_OUTER_TAG_VALUE_LIST0_RT_OFFSET				34278
4735 #define NIG_REG_OUTER_TAG_VALUE_LIST1_RT_OFFSET				34279
4736 #define NIG_REG_OUTER_TAG_VALUE_LIST2_RT_OFFSET				34280
4737 #define NIG_REG_OUTER_TAG_VALUE_LIST3_RT_OFFSET				34281
4738 #define NIG_REG_LLH_FUNC_TAGMAC_CLS_TYPE_RT_OFFSET			34282
4739 #define NIG_REG_LLH_FUNC_TAG_EN_RT_OFFSET				34283
4740 #define NIG_REG_LLH_FUNC_TAG_EN_RT_SIZE					4
4741 #define NIG_REG_LLH_FUNC_TAG_VALUE_RT_OFFSET				34287
4742 #define NIG_REG_LLH_FUNC_TAG_VALUE_RT_SIZE				4
4743 #define NIG_REG_LLH_FUNC_FILTER_VALUE_RT_OFFSET				34291
4744 #define NIG_REG_LLH_FUNC_FILTER_VALUE_RT_SIZE				32
4745 #define NIG_REG_LLH_FUNC_FILTER_EN_RT_OFFSET				34323
4746 #define NIG_REG_LLH_FUNC_FILTER_EN_RT_SIZE				16
4747 #define NIG_REG_LLH_FUNC_FILTER_MODE_RT_OFFSET				34339
4748 #define NIG_REG_LLH_FUNC_FILTER_MODE_RT_SIZE				16
4749 #define NIG_REG_LLH_FUNC_FILTER_PROTOCOL_TYPE_RT_OFFSET			34355
4750 #define NIG_REG_LLH_FUNC_FILTER_PROTOCOL_TYPE_RT_SIZE			16
4751 #define NIG_REG_LLH_FUNC_FILTER_HDR_SEL_RT_OFFSET			34371
4752 #define NIG_REG_LLH_FUNC_FILTER_HDR_SEL_RT_SIZE				16
4753 #define NIG_REG_TX_EDPM_CTRL_RT_OFFSET					34387
4754 #define NIG_REG_PPF_TO_ENGINE_SEL_RT_OFFSET				34388
4755 #define NIG_REG_PPF_TO_ENGINE_SEL_RT_SIZE				8
4756 #define CDU_REG_CID_ADDR_PARAMS_RT_OFFSET				34396
4757 #define CDU_REG_SEGMENT0_PARAMS_RT_OFFSET				34397
4758 #define CDU_REG_SEGMENT1_PARAMS_RT_OFFSET				34398
4759 #define CDU_REG_PF_SEG0_TYPE_OFFSET_RT_OFFSET				34399
4760 #define CDU_REG_PF_SEG1_TYPE_OFFSET_RT_OFFSET				34400
4761 #define CDU_REG_PF_SEG2_TYPE_OFFSET_RT_OFFSET				34401
4762 #define CDU_REG_PF_SEG3_TYPE_OFFSET_RT_OFFSET				34402
4763 #define CDU_REG_PF_FL_SEG0_TYPE_OFFSET_RT_OFFSET			34403
4764 #define CDU_REG_PF_FL_SEG1_TYPE_OFFSET_RT_OFFSET			34404
4765 #define CDU_REG_PF_FL_SEG2_TYPE_OFFSET_RT_OFFSET			34405
4766 #define CDU_REG_PF_FL_SEG3_TYPE_OFFSET_RT_OFFSET			34406
4767 #define CDU_REG_VF_SEG_TYPE_OFFSET_RT_OFFSET				34407
4768 #define CDU_REG_VF_FL_SEG_TYPE_OFFSET_RT_OFFSET				34408
4769 #define PBF_REG_TAG_ETHERTYPE_0_RT_OFFSET				34409
4770 #define PBF_REG_BTB_SHARED_AREA_SIZE_RT_OFFSET				34410
4771 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ0_RT_OFFSET			34411
4772 #define PBF_REG_BTB_GUARANTEED_VOQ0_RT_OFFSET				34412
4773 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ0_RT_OFFSET			34413
4774 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ1_RT_OFFSET			34414
4775 #define PBF_REG_BTB_GUARANTEED_VOQ1_RT_OFFSET				34415
4776 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ1_RT_OFFSET			34416
4777 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ2_RT_OFFSET			34417
4778 #define PBF_REG_BTB_GUARANTEED_VOQ2_RT_OFFSET				34418
4779 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ2_RT_OFFSET			34419
4780 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ3_RT_OFFSET			34420
4781 #define PBF_REG_BTB_GUARANTEED_VOQ3_RT_OFFSET				34421
4782 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ3_RT_OFFSET			34422
4783 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ4_RT_OFFSET			34423
4784 #define PBF_REG_BTB_GUARANTEED_VOQ4_RT_OFFSET				34424
4785 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ4_RT_OFFSET			34425
4786 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ5_RT_OFFSET			34426
4787 #define PBF_REG_BTB_GUARANTEED_VOQ5_RT_OFFSET				34427
4788 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ5_RT_OFFSET			34428
4789 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ6_RT_OFFSET			34429
4790 #define PBF_REG_BTB_GUARANTEED_VOQ6_RT_OFFSET				34430
4791 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ6_RT_OFFSET			34431
4792 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ7_RT_OFFSET			34432
4793 #define PBF_REG_BTB_GUARANTEED_VOQ7_RT_OFFSET				34433
4794 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ7_RT_OFFSET			34434
4795 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ8_RT_OFFSET			34435
4796 #define PBF_REG_BTB_GUARANTEED_VOQ8_RT_OFFSET				34436
4797 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ8_RT_OFFSET			34437
4798 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ9_RT_OFFSET			34438
4799 #define PBF_REG_BTB_GUARANTEED_VOQ9_RT_OFFSET				34439
4800 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ9_RT_OFFSET			34440
4801 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ10_RT_OFFSET			34441
4802 #define PBF_REG_BTB_GUARANTEED_VOQ10_RT_OFFSET				34442
4803 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ10_RT_OFFSET			34443
4804 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ11_RT_OFFSET			34444
4805 #define PBF_REG_BTB_GUARANTEED_VOQ11_RT_OFFSET				34445
4806 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ11_RT_OFFSET			34446
4807 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ12_RT_OFFSET			34447
4808 #define PBF_REG_BTB_GUARANTEED_VOQ12_RT_OFFSET				34448
4809 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ12_RT_OFFSET			34449
4810 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ13_RT_OFFSET			34450
4811 #define PBF_REG_BTB_GUARANTEED_VOQ13_RT_OFFSET				34451
4812 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ13_RT_OFFSET			34452
4813 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ14_RT_OFFSET			34453
4814 #define PBF_REG_BTB_GUARANTEED_VOQ14_RT_OFFSET				34454
4815 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ14_RT_OFFSET			34455
4816 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ15_RT_OFFSET			34456
4817 #define PBF_REG_BTB_GUARANTEED_VOQ15_RT_OFFSET				34457
4818 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ15_RT_OFFSET			34458
4819 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ16_RT_OFFSET			34459
4820 #define PBF_REG_BTB_GUARANTEED_VOQ16_RT_OFFSET				34460
4821 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ16_RT_OFFSET			34461
4822 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ17_RT_OFFSET			34462
4823 #define PBF_REG_BTB_GUARANTEED_VOQ17_RT_OFFSET				34463
4824 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ17_RT_OFFSET			34464
4825 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ18_RT_OFFSET			34465
4826 #define PBF_REG_BTB_GUARANTEED_VOQ18_RT_OFFSET				34466
4827 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ18_RT_OFFSET			34467
4828 #define PBF_REG_YCMD_QS_NUM_LINES_VOQ19_RT_OFFSET			34468
4829 #define PBF_REG_BTB_GUARANTEED_VOQ19_RT_OFFSET				34469
4830 #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ19_RT_OFFSET			34470
4831 #define XCM_REG_CON_PHY_Q3_RT_OFFSET					34471
4832 
4833 #define RUNTIME_ARRAY_SIZE 34472
4834 
4835 /* Init Callbacks */
4836 #define DMAE_READY_CB	0
4837 
4838 /* The eth storm context for the Tstorm */
4839 struct tstorm_eth_conn_st_ctx {
4840 	__le32 reserved[4];
4841 };
4842 
4843 /* The eth storm context for the Pstorm */
4844 struct pstorm_eth_conn_st_ctx {
4845 	__le32 reserved[8];
4846 };
4847 
4848 /* The eth storm context for the Xstorm */
4849 struct xstorm_eth_conn_st_ctx {
4850 	__le32 reserved[60];
4851 };
4852 
4853 struct e4_xstorm_eth_conn_ag_ctx {
4854 	u8 reserved0;
4855 	u8 state;
4856 	u8 flags0;
4857 #define E4_XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
4858 #define E4_XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
4859 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED1_MASK	0x1
4860 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED1_SHIFT	1
4861 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED2_MASK	0x1
4862 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED2_SHIFT	2
4863 #define E4_XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
4864 #define E4_XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
4865 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED3_MASK	0x1
4866 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED3_SHIFT	4
4867 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED4_MASK	0x1
4868 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED4_SHIFT	5
4869 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED5_MASK	0x1
4870 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED5_SHIFT	6
4871 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED6_MASK	0x1
4872 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED6_SHIFT	7
4873 		u8 flags1;
4874 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED7_MASK	0x1
4875 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED7_SHIFT	0
4876 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED8_MASK	0x1
4877 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED8_SHIFT	1
4878 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED9_MASK	0x1
4879 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED9_SHIFT	2
4880 #define E4_XSTORM_ETH_CONN_AG_CTX_BIT11_MASK		0x1
4881 #define E4_XSTORM_ETH_CONN_AG_CTX_BIT11_SHIFT		3
4882 #define E4_XSTORM_ETH_CONN_AG_CTX_E5_RESERVED2_MASK	0x1
4883 #define E4_XSTORM_ETH_CONN_AG_CTX_E5_RESERVED2_SHIFT	4
4884 #define E4_XSTORM_ETH_CONN_AG_CTX_E5_RESERVED3_MASK	0x1
4885 #define E4_XSTORM_ETH_CONN_AG_CTX_E5_RESERVED3_SHIFT	5
4886 #define E4_XSTORM_ETH_CONN_AG_CTX_TX_RULE_ACTIVE_MASK	0x1
4887 #define E4_XSTORM_ETH_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT	6
4888 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_ACTIVE_MASK	0x1
4889 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT	7
4890 	u8 flags2;
4891 #define E4_XSTORM_ETH_CONN_AG_CTX_CF0_MASK	0x3
4892 #define E4_XSTORM_ETH_CONN_AG_CTX_CF0_SHIFT	0
4893 #define E4_XSTORM_ETH_CONN_AG_CTX_CF1_MASK	0x3
4894 #define E4_XSTORM_ETH_CONN_AG_CTX_CF1_SHIFT	2
4895 #define E4_XSTORM_ETH_CONN_AG_CTX_CF2_MASK	0x3
4896 #define E4_XSTORM_ETH_CONN_AG_CTX_CF2_SHIFT	4
4897 #define E4_XSTORM_ETH_CONN_AG_CTX_CF3_MASK	0x3
4898 #define E4_XSTORM_ETH_CONN_AG_CTX_CF3_SHIFT	6
4899 	u8 flags3;
4900 #define E4_XSTORM_ETH_CONN_AG_CTX_CF4_MASK	0x3
4901 #define E4_XSTORM_ETH_CONN_AG_CTX_CF4_SHIFT	0
4902 #define E4_XSTORM_ETH_CONN_AG_CTX_CF5_MASK	0x3
4903 #define E4_XSTORM_ETH_CONN_AG_CTX_CF5_SHIFT	2
4904 #define E4_XSTORM_ETH_CONN_AG_CTX_CF6_MASK	0x3
4905 #define E4_XSTORM_ETH_CONN_AG_CTX_CF6_SHIFT	4
4906 #define E4_XSTORM_ETH_CONN_AG_CTX_CF7_MASK	0x3
4907 #define E4_XSTORM_ETH_CONN_AG_CTX_CF7_SHIFT	6
4908 		u8 flags4;
4909 #define E4_XSTORM_ETH_CONN_AG_CTX_CF8_MASK	0x3
4910 #define E4_XSTORM_ETH_CONN_AG_CTX_CF8_SHIFT	0
4911 #define E4_XSTORM_ETH_CONN_AG_CTX_CF9_MASK	0x3
4912 #define E4_XSTORM_ETH_CONN_AG_CTX_CF9_SHIFT	2
4913 #define E4_XSTORM_ETH_CONN_AG_CTX_CF10_MASK	0x3
4914 #define E4_XSTORM_ETH_CONN_AG_CTX_CF10_SHIFT	4
4915 #define E4_XSTORM_ETH_CONN_AG_CTX_CF11_MASK	0x3
4916 #define E4_XSTORM_ETH_CONN_AG_CTX_CF11_SHIFT	6
4917 	u8 flags5;
4918 #define E4_XSTORM_ETH_CONN_AG_CTX_CF12_MASK	0x3
4919 #define E4_XSTORM_ETH_CONN_AG_CTX_CF12_SHIFT	0
4920 #define E4_XSTORM_ETH_CONN_AG_CTX_CF13_MASK	0x3
4921 #define E4_XSTORM_ETH_CONN_AG_CTX_CF13_SHIFT	2
4922 #define E4_XSTORM_ETH_CONN_AG_CTX_CF14_MASK	0x3
4923 #define E4_XSTORM_ETH_CONN_AG_CTX_CF14_SHIFT	4
4924 #define E4_XSTORM_ETH_CONN_AG_CTX_CF15_MASK	0x3
4925 #define E4_XSTORM_ETH_CONN_AG_CTX_CF15_SHIFT	6
4926 	u8 flags6;
4927 #define E4_XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_MASK		0x3
4928 #define E4_XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_SHIFT	0
4929 #define E4_XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_MASK		0x3
4930 #define E4_XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_SHIFT	2
4931 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_MASK			0x3
4932 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_SHIFT			4
4933 #define E4_XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_MASK		0x3
4934 #define E4_XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_SHIFT		6
4935 	u8 flags7;
4936 #define E4_XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_MASK		0x3
4937 #define E4_XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_SHIFT	0
4938 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED10_MASK	0x3
4939 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED10_SHIFT	2
4940 #define E4_XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_MASK	0x3
4941 #define E4_XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_SHIFT	4
4942 #define E4_XSTORM_ETH_CONN_AG_CTX_CF0EN_MASK		0x1
4943 #define E4_XSTORM_ETH_CONN_AG_CTX_CF0EN_SHIFT		6
4944 #define E4_XSTORM_ETH_CONN_AG_CTX_CF1EN_MASK		0x1
4945 #define E4_XSTORM_ETH_CONN_AG_CTX_CF1EN_SHIFT		7
4946 	u8 flags8;
4947 #define E4_XSTORM_ETH_CONN_AG_CTX_CF2EN_MASK	0x1
4948 #define E4_XSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT	0
4949 #define E4_XSTORM_ETH_CONN_AG_CTX_CF3EN_MASK	0x1
4950 #define E4_XSTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT	1
4951 #define E4_XSTORM_ETH_CONN_AG_CTX_CF4EN_MASK	0x1
4952 #define E4_XSTORM_ETH_CONN_AG_CTX_CF4EN_SHIFT	2
4953 #define E4_XSTORM_ETH_CONN_AG_CTX_CF5EN_MASK	0x1
4954 #define E4_XSTORM_ETH_CONN_AG_CTX_CF5EN_SHIFT	3
4955 #define E4_XSTORM_ETH_CONN_AG_CTX_CF6EN_MASK	0x1
4956 #define E4_XSTORM_ETH_CONN_AG_CTX_CF6EN_SHIFT	4
4957 #define E4_XSTORM_ETH_CONN_AG_CTX_CF7EN_MASK	0x1
4958 #define E4_XSTORM_ETH_CONN_AG_CTX_CF7EN_SHIFT	5
4959 #define E4_XSTORM_ETH_CONN_AG_CTX_CF8EN_MASK	0x1
4960 #define E4_XSTORM_ETH_CONN_AG_CTX_CF8EN_SHIFT	6
4961 #define E4_XSTORM_ETH_CONN_AG_CTX_CF9EN_MASK	0x1
4962 #define E4_XSTORM_ETH_CONN_AG_CTX_CF9EN_SHIFT	7
4963 	u8 flags9;
4964 #define E4_XSTORM_ETH_CONN_AG_CTX_CF10EN_MASK			0x1
4965 #define E4_XSTORM_ETH_CONN_AG_CTX_CF10EN_SHIFT			0
4966 #define E4_XSTORM_ETH_CONN_AG_CTX_CF11EN_MASK			0x1
4967 #define E4_XSTORM_ETH_CONN_AG_CTX_CF11EN_SHIFT			1
4968 #define E4_XSTORM_ETH_CONN_AG_CTX_CF12EN_MASK			0x1
4969 #define E4_XSTORM_ETH_CONN_AG_CTX_CF12EN_SHIFT			2
4970 #define E4_XSTORM_ETH_CONN_AG_CTX_CF13EN_MASK			0x1
4971 #define E4_XSTORM_ETH_CONN_AG_CTX_CF13EN_SHIFT			3
4972 #define E4_XSTORM_ETH_CONN_AG_CTX_CF14EN_MASK			0x1
4973 #define E4_XSTORM_ETH_CONN_AG_CTX_CF14EN_SHIFT			4
4974 #define E4_XSTORM_ETH_CONN_AG_CTX_CF15EN_MASK			0x1
4975 #define E4_XSTORM_ETH_CONN_AG_CTX_CF15EN_SHIFT			5
4976 #define E4_XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_MASK	0x1
4977 #define E4_XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_SHIFT	6
4978 #define E4_XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_EN_MASK	0x1
4979 #define E4_XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_EN_SHIFT	7
4980 	u8 flags10;
4981 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_EN_MASK			0x1
4982 #define E4_XSTORM_ETH_CONN_AG_CTX_DQ_CF_EN_SHIFT		0
4983 #define E4_XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_EN_MASK		0x1
4984 #define E4_XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT		1
4985 #define E4_XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_EN_MASK		0x1
4986 #define E4_XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT		2
4987 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED11_MASK		0x1
4988 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED11_SHIFT		3
4989 #define E4_XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_EN_MASK		0x1
4990 #define E4_XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_EN_SHIFT		4
4991 #define E4_XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_MASK	0x1
4992 #define E4_XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_SHIFT	5
4993 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED12_MASK		0x1
4994 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED12_SHIFT		6
4995 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED13_MASK		0x1
4996 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED13_SHIFT		7
4997 	u8 flags11;
4998 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED14_MASK	0x1
4999 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED14_SHIFT	0
5000 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED15_MASK	0x1
5001 #define E4_XSTORM_ETH_CONN_AG_CTX_RESERVED15_SHIFT	1
5002 #define E4_XSTORM_ETH_CONN_AG_CTX_TX_DEC_RULE_EN_MASK	0x1
5003 #define E4_XSTORM_ETH_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT	2
5004 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE5EN_MASK		0x1
5005 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT		3
5006 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE6EN_MASK		0x1
5007 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE6EN_SHIFT		4
5008 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE7EN_MASK		0x1
5009 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT		5
5010 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
5011 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
5012 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE9EN_MASK		0x1
5013 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE9EN_SHIFT		7
5014 	u8 flags12;
5015 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE10EN_MASK		0x1
5016 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE10EN_SHIFT	0
5017 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE11EN_MASK		0x1
5018 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE11EN_SHIFT	1
5019 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
5020 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
5021 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
5022 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
5023 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE14EN_MASK		0x1
5024 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE14EN_SHIFT	4
5025 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE15EN_MASK		0x1
5026 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE15EN_SHIFT	5
5027 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE16EN_MASK		0x1
5028 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE16EN_SHIFT	6
5029 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE17EN_MASK		0x1
5030 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE17EN_SHIFT	7
5031 	u8 flags13;
5032 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE18EN_MASK		0x1
5033 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE18EN_SHIFT	0
5034 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE19EN_MASK		0x1
5035 #define E4_XSTORM_ETH_CONN_AG_CTX_RULE19EN_SHIFT	1
5036 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED4_MASK	0x1
5037 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED4_SHIFT	2
5038 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED5_MASK	0x1
5039 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED5_SHIFT	3
5040 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED6_MASK	0x1
5041 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED6_SHIFT	4
5042 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED7_MASK	0x1
5043 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED7_SHIFT	5
5044 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED8_MASK	0x1
5045 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED8_SHIFT	6
5046 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED9_MASK	0x1
5047 #define E4_XSTORM_ETH_CONN_AG_CTX_A0_RESERVED9_SHIFT	7
5048 	u8 flags14;
5049 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_USE_EXT_HDR_MASK		0x1
5050 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_USE_EXT_HDR_SHIFT	0
5051 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_MASK	0x1
5052 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_SHIFT	1
5053 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_MASK	0x1
5054 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_SHIFT	2
5055 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_MASK	0x1
5056 #define E4_XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_SHIFT	3
5057 #define E4_XSTORM_ETH_CONN_AG_CTX_L2_EDPM_ENABLE_MASK		0x1
5058 #define E4_XSTORM_ETH_CONN_AG_CTX_L2_EDPM_ENABLE_SHIFT		4
5059 #define E4_XSTORM_ETH_CONN_AG_CTX_ROCE_EDPM_ENABLE_MASK		0x1
5060 #define E4_XSTORM_ETH_CONN_AG_CTX_ROCE_EDPM_ENABLE_SHIFT	5
5061 #define E4_XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_MASK		0x3
5062 #define E4_XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_SHIFT		6
5063 	u8 edpm_event_id;
5064 	__le16 physical_q0;
5065 	__le16 e5_reserved1;
5066 	__le16 edpm_num_bds;
5067 	__le16 tx_bd_cons;
5068 	__le16 tx_bd_prod;
5069 	__le16 updated_qm_pq_id;
5070 	__le16 conn_dpi;
5071 	u8 byte3;
5072 	u8 byte4;
5073 	u8 byte5;
5074 	u8 byte6;
5075 	__le32 reg0;
5076 	__le32 reg1;
5077 	__le32 reg2;
5078 	__le32 reg3;
5079 	__le32 reg4;
5080 	__le32 reg5;
5081 	__le32 reg6;
5082 	__le16 word7;
5083 	__le16 word8;
5084 	__le16 word9;
5085 	__le16 word10;
5086 	__le32 reg7;
5087 	__le32 reg8;
5088 	__le32 reg9;
5089 	u8 byte7;
5090 	u8 byte8;
5091 	u8 byte9;
5092 	u8 byte10;
5093 	u8 byte11;
5094 	u8 byte12;
5095 	u8 byte13;
5096 	u8 byte14;
5097 	u8 byte15;
5098 	u8 e5_reserved;
5099 	__le16 word11;
5100 	__le32 reg10;
5101 	__le32 reg11;
5102 	__le32 reg12;
5103 	__le32 reg13;
5104 	__le32 reg14;
5105 	__le32 reg15;
5106 	__le32 reg16;
5107 	__le32 reg17;
5108 	__le32 reg18;
5109 	__le32 reg19;
5110 	__le16 word12;
5111 	__le16 word13;
5112 	__le16 word14;
5113 	__le16 word15;
5114 };
5115 
5116 /* The eth storm context for the Ystorm */
5117 struct ystorm_eth_conn_st_ctx {
5118 	__le32 reserved[8];
5119 };
5120 
5121 struct e4_ystorm_eth_conn_ag_ctx {
5122 	u8 byte0;
5123 	u8 state;
5124 	u8 flags0;
5125 #define E4_YSTORM_ETH_CONN_AG_CTX_BIT0_MASK			0x1
5126 #define E4_YSTORM_ETH_CONN_AG_CTX_BIT0_SHIFT			0
5127 #define E4_YSTORM_ETH_CONN_AG_CTX_BIT1_MASK			0x1
5128 #define E4_YSTORM_ETH_CONN_AG_CTX_BIT1_SHIFT			1
5129 #define E4_YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_MASK	0x3
5130 #define E4_YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_SHIFT	2
5131 #define E4_YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_MASK		0x3
5132 #define E4_YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_SHIFT	4
5133 #define E4_YSTORM_ETH_CONN_AG_CTX_CF2_MASK			0x3
5134 #define E4_YSTORM_ETH_CONN_AG_CTX_CF2_SHIFT			6
5135 	u8 flags1;
5136 #define E4_YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_MASK	0x1
5137 #define E4_YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_SHIFT	0
5138 #define E4_YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_EN_MASK	0x1
5139 #define E4_YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_EN_SHIFT	1
5140 #define E4_YSTORM_ETH_CONN_AG_CTX_CF2EN_MASK			0x1
5141 #define E4_YSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT			2
5142 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE0EN_MASK			0x1
5143 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT			3
5144 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE1EN_MASK			0x1
5145 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT			4
5146 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE2EN_MASK			0x1
5147 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT			5
5148 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE3EN_MASK			0x1
5149 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT			6
5150 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE4EN_MASK			0x1
5151 #define E4_YSTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT			7
5152 	u8 tx_q0_int_coallecing_timeset;
5153 	u8 byte3;
5154 	__le16 word0;
5155 	__le32 terminate_spqe;
5156 	__le32 reg1;
5157 	__le16 tx_bd_cons_upd;
5158 	__le16 word2;
5159 	__le16 word3;
5160 	__le16 word4;
5161 	__le32 reg2;
5162 	__le32 reg3;
5163 };
5164 
5165 struct e4_tstorm_eth_conn_ag_ctx {
5166 	u8 byte0;
5167 	u8 byte1;
5168 	u8 flags0;
5169 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT0_MASK	0x1
5170 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT0_SHIFT	0
5171 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT1_MASK	0x1
5172 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT1_SHIFT	1
5173 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT2_MASK	0x1
5174 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT2_SHIFT	2
5175 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT3_MASK	0x1
5176 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT3_SHIFT	3
5177 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT4_MASK	0x1
5178 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT4_SHIFT	4
5179 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT5_MASK	0x1
5180 #define E4_TSTORM_ETH_CONN_AG_CTX_BIT5_SHIFT	5
5181 #define E4_TSTORM_ETH_CONN_AG_CTX_CF0_MASK	0x3
5182 #define E4_TSTORM_ETH_CONN_AG_CTX_CF0_SHIFT	6
5183 	u8 flags1;
5184 #define E4_TSTORM_ETH_CONN_AG_CTX_CF1_MASK	0x3
5185 #define E4_TSTORM_ETH_CONN_AG_CTX_CF1_SHIFT	0
5186 #define E4_TSTORM_ETH_CONN_AG_CTX_CF2_MASK	0x3
5187 #define E4_TSTORM_ETH_CONN_AG_CTX_CF2_SHIFT	2
5188 #define E4_TSTORM_ETH_CONN_AG_CTX_CF3_MASK	0x3
5189 #define E4_TSTORM_ETH_CONN_AG_CTX_CF3_SHIFT	4
5190 #define E4_TSTORM_ETH_CONN_AG_CTX_CF4_MASK	0x3
5191 #define E4_TSTORM_ETH_CONN_AG_CTX_CF4_SHIFT	6
5192 	u8 flags2;
5193 #define E4_TSTORM_ETH_CONN_AG_CTX_CF5_MASK	0x3
5194 #define E4_TSTORM_ETH_CONN_AG_CTX_CF5_SHIFT	0
5195 #define E4_TSTORM_ETH_CONN_AG_CTX_CF6_MASK	0x3
5196 #define E4_TSTORM_ETH_CONN_AG_CTX_CF6_SHIFT	2
5197 #define E4_TSTORM_ETH_CONN_AG_CTX_CF7_MASK	0x3
5198 #define E4_TSTORM_ETH_CONN_AG_CTX_CF7_SHIFT	4
5199 #define E4_TSTORM_ETH_CONN_AG_CTX_CF8_MASK	0x3
5200 #define E4_TSTORM_ETH_CONN_AG_CTX_CF8_SHIFT	6
5201 	u8 flags3;
5202 #define E4_TSTORM_ETH_CONN_AG_CTX_CF9_MASK	0x3
5203 #define E4_TSTORM_ETH_CONN_AG_CTX_CF9_SHIFT	0
5204 #define E4_TSTORM_ETH_CONN_AG_CTX_CF10_MASK	0x3
5205 #define E4_TSTORM_ETH_CONN_AG_CTX_CF10_SHIFT	2
5206 #define E4_TSTORM_ETH_CONN_AG_CTX_CF0EN_MASK	0x1
5207 #define E4_TSTORM_ETH_CONN_AG_CTX_CF0EN_SHIFT	4
5208 #define E4_TSTORM_ETH_CONN_AG_CTX_CF1EN_MASK	0x1
5209 #define E4_TSTORM_ETH_CONN_AG_CTX_CF1EN_SHIFT	5
5210 #define E4_TSTORM_ETH_CONN_AG_CTX_CF2EN_MASK	0x1
5211 #define E4_TSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT	6
5212 #define E4_TSTORM_ETH_CONN_AG_CTX_CF3EN_MASK	0x1
5213 #define E4_TSTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT	7
5214 	u8 flags4;
5215 #define E4_TSTORM_ETH_CONN_AG_CTX_CF4EN_MASK	0x1
5216 #define E4_TSTORM_ETH_CONN_AG_CTX_CF4EN_SHIFT	0
5217 #define E4_TSTORM_ETH_CONN_AG_CTX_CF5EN_MASK	0x1
5218 #define E4_TSTORM_ETH_CONN_AG_CTX_CF5EN_SHIFT	1
5219 #define E4_TSTORM_ETH_CONN_AG_CTX_CF6EN_MASK	0x1
5220 #define E4_TSTORM_ETH_CONN_AG_CTX_CF6EN_SHIFT	2
5221 #define E4_TSTORM_ETH_CONN_AG_CTX_CF7EN_MASK	0x1
5222 #define E4_TSTORM_ETH_CONN_AG_CTX_CF7EN_SHIFT	3
5223 #define E4_TSTORM_ETH_CONN_AG_CTX_CF8EN_MASK	0x1
5224 #define E4_TSTORM_ETH_CONN_AG_CTX_CF8EN_SHIFT	4
5225 #define E4_TSTORM_ETH_CONN_AG_CTX_CF9EN_MASK	0x1
5226 #define E4_TSTORM_ETH_CONN_AG_CTX_CF9EN_SHIFT	5
5227 #define E4_TSTORM_ETH_CONN_AG_CTX_CF10EN_MASK	0x1
5228 #define E4_TSTORM_ETH_CONN_AG_CTX_CF10EN_SHIFT	6
5229 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE0EN_MASK	0x1
5230 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT	7
5231 	u8 flags5;
5232 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE1EN_MASK		0x1
5233 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT		0
5234 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE2EN_MASK		0x1
5235 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT		1
5236 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE3EN_MASK		0x1
5237 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT		2
5238 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE4EN_MASK		0x1
5239 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT		3
5240 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE5EN_MASK		0x1
5241 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT		4
5242 #define E4_TSTORM_ETH_CONN_AG_CTX_RX_BD_EN_MASK		0x1
5243 #define E4_TSTORM_ETH_CONN_AG_CTX_RX_BD_EN_SHIFT	5
5244 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE7EN_MASK		0x1
5245 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT		6
5246 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE8EN_MASK		0x1
5247 #define E4_TSTORM_ETH_CONN_AG_CTX_RULE8EN_SHIFT		7
5248 	__le32 reg0;
5249 	__le32 reg1;
5250 	__le32 reg2;
5251 	__le32 reg3;
5252 	__le32 reg4;
5253 	__le32 reg5;
5254 	__le32 reg6;
5255 	__le32 reg7;
5256 	__le32 reg8;
5257 	u8 byte2;
5258 	u8 byte3;
5259 	__le16 rx_bd_cons;
5260 	u8 byte4;
5261 	u8 byte5;
5262 	__le16 rx_bd_prod;
5263 	__le16 word2;
5264 	__le16 word3;
5265 	__le32 reg9;
5266 	__le32 reg10;
5267 };
5268 
5269 struct e4_ustorm_eth_conn_ag_ctx {
5270 	u8 byte0;
5271 	u8 byte1;
5272 	u8 flags0;
5273 #define E4_USTORM_ETH_CONN_AG_CTX_BIT0_MASK			0x1
5274 #define E4_USTORM_ETH_CONN_AG_CTX_BIT0_SHIFT			0
5275 #define E4_USTORM_ETH_CONN_AG_CTX_BIT1_MASK			0x1
5276 #define E4_USTORM_ETH_CONN_AG_CTX_BIT1_SHIFT			1
5277 #define E4_USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_MASK	0x3
5278 #define E4_USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_SHIFT	2
5279 #define E4_USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_MASK	0x3
5280 #define E4_USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_SHIFT	4
5281 #define E4_USTORM_ETH_CONN_AG_CTX_CF2_MASK			0x3
5282 #define E4_USTORM_ETH_CONN_AG_CTX_CF2_SHIFT			6
5283 	u8 flags1;
5284 #define E4_USTORM_ETH_CONN_AG_CTX_CF3_MASK			0x3
5285 #define E4_USTORM_ETH_CONN_AG_CTX_CF3_SHIFT			0
5286 #define E4_USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_MASK		0x3
5287 #define E4_USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_SHIFT		2
5288 #define E4_USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_MASK		0x3
5289 #define E4_USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_SHIFT		4
5290 #define E4_USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_MASK	0x3
5291 #define E4_USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_SHIFT	6
5292 	u8 flags2;
5293 #define E4_USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_EN_MASK	0x1
5294 #define E4_USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_EN_SHIFT	0
5295 #define E4_USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_EN_MASK	0x1
5296 #define E4_USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_EN_SHIFT	1
5297 #define E4_USTORM_ETH_CONN_AG_CTX_CF2EN_MASK			0x1
5298 #define E4_USTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT			2
5299 #define E4_USTORM_ETH_CONN_AG_CTX_CF3EN_MASK			0x1
5300 #define E4_USTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT			3
5301 #define E4_USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_EN_MASK		0x1
5302 #define E4_USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_EN_SHIFT		4
5303 #define E4_USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_EN_MASK		0x1
5304 #define E4_USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_EN_SHIFT		5
5305 #define E4_USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_MASK	0x1
5306 #define E4_USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_SHIFT	6
5307 #define E4_USTORM_ETH_CONN_AG_CTX_RULE0EN_MASK			0x1
5308 #define E4_USTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT			7
5309 	u8 flags3;
5310 #define E4_USTORM_ETH_CONN_AG_CTX_RULE1EN_MASK	0x1
5311 #define E4_USTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT	0
5312 #define E4_USTORM_ETH_CONN_AG_CTX_RULE2EN_MASK	0x1
5313 #define E4_USTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT	1
5314 #define E4_USTORM_ETH_CONN_AG_CTX_RULE3EN_MASK	0x1
5315 #define E4_USTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT	2
5316 #define E4_USTORM_ETH_CONN_AG_CTX_RULE4EN_MASK	0x1
5317 #define E4_USTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT	3
5318 #define E4_USTORM_ETH_CONN_AG_CTX_RULE5EN_MASK	0x1
5319 #define E4_USTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT	4
5320 #define E4_USTORM_ETH_CONN_AG_CTX_RULE6EN_MASK	0x1
5321 #define E4_USTORM_ETH_CONN_AG_CTX_RULE6EN_SHIFT	5
5322 #define E4_USTORM_ETH_CONN_AG_CTX_RULE7EN_MASK	0x1
5323 #define E4_USTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT	6
5324 #define E4_USTORM_ETH_CONN_AG_CTX_RULE8EN_MASK	0x1
5325 #define E4_USTORM_ETH_CONN_AG_CTX_RULE8EN_SHIFT	7
5326 	u8 byte2;
5327 	u8 byte3;
5328 	__le16 word0;
5329 	__le16 tx_bd_cons;
5330 	__le32 reg0;
5331 	__le32 reg1;
5332 	__le32 reg2;
5333 	__le32 tx_int_coallecing_timeset;
5334 	__le16 tx_drv_bd_cons;
5335 	__le16 rx_drv_cqe_cons;
5336 };
5337 
5338 /* The eth storm context for the Ustorm */
5339 struct ustorm_eth_conn_st_ctx {
5340 	__le32 reserved[40];
5341 };
5342 
5343 /* The eth storm context for the Mstorm */
5344 struct mstorm_eth_conn_st_ctx {
5345 	__le32 reserved[8];
5346 };
5347 
5348 /* eth connection context */
5349 struct e4_eth_conn_context {
5350 	struct tstorm_eth_conn_st_ctx tstorm_st_context;
5351 	struct regpair tstorm_st_padding[2];
5352 	struct pstorm_eth_conn_st_ctx pstorm_st_context;
5353 	struct xstorm_eth_conn_st_ctx xstorm_st_context;
5354 	struct e4_xstorm_eth_conn_ag_ctx xstorm_ag_context;
5355 	struct e4_tstorm_eth_conn_ag_ctx tstorm_ag_context;
5356 	struct ystorm_eth_conn_st_ctx ystorm_st_context;
5357 	struct e4_ystorm_eth_conn_ag_ctx ystorm_ag_context;
5358 	struct e4_ustorm_eth_conn_ag_ctx ustorm_ag_context;
5359 	struct ustorm_eth_conn_st_ctx ustorm_st_context;
5360 	struct mstorm_eth_conn_st_ctx mstorm_st_context;
5361 };
5362 
5363 /* Ethernet filter types: mac/vlan/pair */
5364 enum eth_error_code {
5365 	ETH_OK = 0x00,
5366 	ETH_FILTERS_MAC_ADD_FAIL_FULL,
5367 	ETH_FILTERS_MAC_ADD_FAIL_FULL_MTT2,
5368 	ETH_FILTERS_MAC_ADD_FAIL_DUP_MTT2,
5369 	ETH_FILTERS_MAC_ADD_FAIL_DUP_STT2,
5370 	ETH_FILTERS_MAC_DEL_FAIL_NOF,
5371 	ETH_FILTERS_MAC_DEL_FAIL_NOF_MTT2,
5372 	ETH_FILTERS_MAC_DEL_FAIL_NOF_STT2,
5373 	ETH_FILTERS_MAC_ADD_FAIL_ZERO_MAC,
5374 	ETH_FILTERS_VLAN_ADD_FAIL_FULL,
5375 	ETH_FILTERS_VLAN_ADD_FAIL_DUP,
5376 	ETH_FILTERS_VLAN_DEL_FAIL_NOF,
5377 	ETH_FILTERS_VLAN_DEL_FAIL_NOF_TT1,
5378 	ETH_FILTERS_PAIR_ADD_FAIL_DUP,
5379 	ETH_FILTERS_PAIR_ADD_FAIL_FULL,
5380 	ETH_FILTERS_PAIR_ADD_FAIL_FULL_MAC,
5381 	ETH_FILTERS_PAIR_DEL_FAIL_NOF,
5382 	ETH_FILTERS_PAIR_DEL_FAIL_NOF_TT1,
5383 	ETH_FILTERS_PAIR_ADD_FAIL_ZERO_MAC,
5384 	ETH_FILTERS_VNI_ADD_FAIL_FULL,
5385 	ETH_FILTERS_VNI_ADD_FAIL_DUP,
5386 	ETH_FILTERS_GFT_UPDATE_FAIL,
5387 	ETH_RX_QUEUE_FAIL_LOAD_VF_DATA,
5388 	ETH_FILTERS_GFS_ADD_FILTER_FAIL_MAX_HOPS,
5389 	ETH_FILTERS_GFS_ADD_FILTER_FAIL_NO_FREE_ENRTY,
5390 	ETH_FILTERS_GFS_ADD_FILTER_FAIL_ALREADY_EXISTS,
5391 	ETH_FILTERS_GFS_ADD_FILTER_FAIL_PCI_ERROR,
5392 	ETH_FILTERS_GFS_ADD_FINLER_FAIL_MAGIC_NUM_ERROR,
5393 	ETH_FILTERS_GFS_DEL_FILTER_FAIL_MAX_HOPS,
5394 	ETH_FILTERS_GFS_DEL_FILTER_FAIL_NO_MATCH_ENRTY,
5395 	ETH_FILTERS_GFS_DEL_FILTER_FAIL_PCI_ERROR,
5396 	ETH_FILTERS_GFS_DEL_FILTER_FAIL_MAGIC_NUM_ERROR,
5397 	MAX_ETH_ERROR_CODE
5398 };
5399 
5400 /* Opcodes for the event ring */
5401 enum eth_event_opcode {
5402 	ETH_EVENT_UNUSED,
5403 	ETH_EVENT_VPORT_START,
5404 	ETH_EVENT_VPORT_UPDATE,
5405 	ETH_EVENT_VPORT_STOP,
5406 	ETH_EVENT_TX_QUEUE_START,
5407 	ETH_EVENT_TX_QUEUE_STOP,
5408 	ETH_EVENT_RX_QUEUE_START,
5409 	ETH_EVENT_RX_QUEUE_UPDATE,
5410 	ETH_EVENT_RX_QUEUE_STOP,
5411 	ETH_EVENT_FILTERS_UPDATE,
5412 	ETH_EVENT_RX_ADD_OPENFLOW_FILTER,
5413 	ETH_EVENT_RX_DELETE_OPENFLOW_FILTER,
5414 	ETH_EVENT_RX_CREATE_OPENFLOW_ACTION,
5415 	ETH_EVENT_RX_ADD_UDP_FILTER,
5416 	ETH_EVENT_RX_DELETE_UDP_FILTER,
5417 	ETH_EVENT_RX_CREATE_GFT_ACTION,
5418 	ETH_EVENT_RX_GFT_UPDATE_FILTER,
5419 	ETH_EVENT_TX_QUEUE_UPDATE,
5420 	ETH_EVENT_RGFS_ADD_FILTER,
5421 	ETH_EVENT_RGFS_DEL_FILTER,
5422 	ETH_EVENT_TGFS_ADD_FILTER,
5423 	ETH_EVENT_TGFS_DEL_FILTER,
5424 	ETH_EVENT_GFS_COUNTERS_REPORT_REQUEST,
5425 	MAX_ETH_EVENT_OPCODE
5426 };
5427 
5428 /* Classify rule types in E2/E3 */
5429 enum eth_filter_action {
5430 	ETH_FILTER_ACTION_UNUSED,
5431 	ETH_FILTER_ACTION_REMOVE,
5432 	ETH_FILTER_ACTION_ADD,
5433 	ETH_FILTER_ACTION_REMOVE_ALL,
5434 	MAX_ETH_FILTER_ACTION
5435 };
5436 
5437 /* Command for adding/removing a classification rule $$KEEP_ENDIANNESS$$ */
5438 struct eth_filter_cmd {
5439 	u8 type;
5440 	u8 vport_id;
5441 	u8 action;
5442 	u8 reserved0;
5443 	__le32 vni;
5444 	__le16 mac_lsb;
5445 	__le16 mac_mid;
5446 	__le16 mac_msb;
5447 	__le16 vlan_id;
5448 };
5449 
5450 /*	$$KEEP_ENDIANNESS$$ */
5451 struct eth_filter_cmd_header {
5452 	u8 rx;
5453 	u8 tx;
5454 	u8 cmd_cnt;
5455 	u8 assert_on_error;
5456 	u8 reserved1[4];
5457 };
5458 
5459 /* Ethernet filter types: mac/vlan/pair */
5460 enum eth_filter_type {
5461 	ETH_FILTER_TYPE_UNUSED,
5462 	ETH_FILTER_TYPE_MAC,
5463 	ETH_FILTER_TYPE_VLAN,
5464 	ETH_FILTER_TYPE_PAIR,
5465 	ETH_FILTER_TYPE_INNER_MAC,
5466 	ETH_FILTER_TYPE_INNER_VLAN,
5467 	ETH_FILTER_TYPE_INNER_PAIR,
5468 	ETH_FILTER_TYPE_INNER_MAC_VNI_PAIR,
5469 	ETH_FILTER_TYPE_MAC_VNI_PAIR,
5470 	ETH_FILTER_TYPE_VNI,
5471 	MAX_ETH_FILTER_TYPE
5472 };
5473 
5474 /* inner to inner vlan priority translation configurations */
5475 struct eth_in_to_in_pri_map_cfg {
5476 	u8 inner_vlan_pri_remap_en;
5477 	u8 reserved[7];
5478 	u8 non_rdma_in_to_in_pri_map[8];
5479 	u8 rdma_in_to_in_pri_map[8];
5480 };
5481 
5482 /* Eth IPv4 Fragment Type */
5483 enum eth_ipv4_frag_type {
5484 	ETH_IPV4_NOT_FRAG,
5485 	ETH_IPV4_FIRST_FRAG,
5486 	ETH_IPV4_NON_FIRST_FRAG,
5487 	MAX_ETH_IPV4_FRAG_TYPE
5488 };
5489 
5490 /* eth IPv4 Fragment Type */
5491 enum eth_ip_type {
5492 	ETH_IPV4,
5493 	ETH_IPV6,
5494 	MAX_ETH_IP_TYPE
5495 };
5496 
5497 /* Ethernet Ramrod Command IDs */
5498 enum eth_ramrod_cmd_id {
5499 	ETH_RAMROD_UNUSED,
5500 	ETH_RAMROD_VPORT_START,
5501 	ETH_RAMROD_VPORT_UPDATE,
5502 	ETH_RAMROD_VPORT_STOP,
5503 	ETH_RAMROD_RX_QUEUE_START,
5504 	ETH_RAMROD_RX_QUEUE_STOP,
5505 	ETH_RAMROD_TX_QUEUE_START,
5506 	ETH_RAMROD_TX_QUEUE_STOP,
5507 	ETH_RAMROD_FILTERS_UPDATE,
5508 	ETH_RAMROD_RX_QUEUE_UPDATE,
5509 	ETH_RAMROD_RX_CREATE_OPENFLOW_ACTION,
5510 	ETH_RAMROD_RX_ADD_OPENFLOW_FILTER,
5511 	ETH_RAMROD_RX_DELETE_OPENFLOW_FILTER,
5512 	ETH_RAMROD_RX_ADD_UDP_FILTER,
5513 	ETH_RAMROD_RX_DELETE_UDP_FILTER,
5514 	ETH_RAMROD_RX_CREATE_GFT_ACTION,
5515 	ETH_RAMROD_GFT_UPDATE_FILTER,
5516 	ETH_RAMROD_TX_QUEUE_UPDATE,
5517 	ETH_RAMROD_RGFS_FILTER_ADD,
5518 	ETH_RAMROD_RGFS_FILTER_DEL,
5519 	ETH_RAMROD_TGFS_FILTER_ADD,
5520 	ETH_RAMROD_TGFS_FILTER_DEL,
5521 	ETH_RAMROD_GFS_COUNTERS_REPORT_REQUEST,
5522 	MAX_ETH_RAMROD_CMD_ID
5523 };
5524 
5525 /* Return code from eth sp ramrods */
5526 struct eth_return_code {
5527 	u8 value;
5528 #define ETH_RETURN_CODE_ERR_CODE_MASK  0x3F
5529 #define ETH_RETURN_CODE_ERR_CODE_SHIFT 0
5530 #define ETH_RETURN_CODE_RESERVED_MASK  0x1
5531 #define ETH_RETURN_CODE_RESERVED_SHIFT 6
5532 #define ETH_RETURN_CODE_RX_TX_MASK     0x1
5533 #define ETH_RETURN_CODE_RX_TX_SHIFT    7
5534 };
5535 
5536 /* tx destination enum */
5537 enum eth_tx_dst_mode_config_enum {
5538 	ETH_TX_DST_MODE_CONFIG_DISABLE,
5539 	ETH_TX_DST_MODE_CONFIG_FORWARD_DATA_IN_BD,
5540 	ETH_TX_DST_MODE_CONFIG_FORWARD_DATA_IN_VPORT,
5541 	MAX_ETH_TX_DST_MODE_CONFIG_ENUM
5542 };
5543 
5544 /* What to do in case an error occurs */
5545 enum eth_tx_err {
5546 	ETH_TX_ERR_DROP,
5547 	ETH_TX_ERR_ASSERT_MALICIOUS,
5548 	MAX_ETH_TX_ERR
5549 };
5550 
5551 /* Array of the different error type behaviors */
5552 struct eth_tx_err_vals {
5553 	__le16 values;
5554 #define ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE_MASK			0x1
5555 #define ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE_SHIFT			0
5556 #define ETH_TX_ERR_VALS_PACKET_TOO_SMALL_MASK			0x1
5557 #define ETH_TX_ERR_VALS_PACKET_TOO_SMALL_SHIFT			1
5558 #define ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR_MASK			0x1
5559 #define ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR_SHIFT			2
5560 #define ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS_MASK		0x1
5561 #define ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS_SHIFT		3
5562 #define ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG_MASK	0x1
5563 #define ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG_SHIFT	4
5564 #define ETH_TX_ERR_VALS_MTU_VIOLATION_MASK			0x1
5565 #define ETH_TX_ERR_VALS_MTU_VIOLATION_SHIFT			5
5566 #define ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME_MASK		0x1
5567 #define ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME_SHIFT		6
5568 #define ETH_TX_ERR_VALS_ILLEGAL_BD_FLAGS_MASK			0x1
5569 #define ETH_TX_ERR_VALS_ILLEGAL_BD_FLAGS_SHIFT			7
5570 #define ETH_TX_ERR_VALS_RESERVED_MASK				0xFF
5571 #define ETH_TX_ERR_VALS_RESERVED_SHIFT				8
5572 };
5573 
5574 /* vport rss configuration data */
5575 struct eth_vport_rss_config {
5576 	__le16 capabilities;
5577 #define ETH_VPORT_RSS_CONFIG_IPV4_CAPABILITY_MASK		0x1
5578 #define ETH_VPORT_RSS_CONFIG_IPV4_CAPABILITY_SHIFT		0
5579 #define ETH_VPORT_RSS_CONFIG_IPV6_CAPABILITY_MASK		0x1
5580 #define ETH_VPORT_RSS_CONFIG_IPV6_CAPABILITY_SHIFT		1
5581 #define ETH_VPORT_RSS_CONFIG_IPV4_TCP_CAPABILITY_MASK		0x1
5582 #define ETH_VPORT_RSS_CONFIG_IPV4_TCP_CAPABILITY_SHIFT		2
5583 #define ETH_VPORT_RSS_CONFIG_IPV6_TCP_CAPABILITY_MASK		0x1
5584 #define ETH_VPORT_RSS_CONFIG_IPV6_TCP_CAPABILITY_SHIFT		3
5585 #define ETH_VPORT_RSS_CONFIG_IPV4_UDP_CAPABILITY_MASK		0x1
5586 #define ETH_VPORT_RSS_CONFIG_IPV4_UDP_CAPABILITY_SHIFT		4
5587 #define ETH_VPORT_RSS_CONFIG_IPV6_UDP_CAPABILITY_MASK		0x1
5588 #define ETH_VPORT_RSS_CONFIG_IPV6_UDP_CAPABILITY_SHIFT		5
5589 #define ETH_VPORT_RSS_CONFIG_EN_5_TUPLE_CAPABILITY_MASK		0x1
5590 #define ETH_VPORT_RSS_CONFIG_EN_5_TUPLE_CAPABILITY_SHIFT	6
5591 #define ETH_VPORT_RSS_CONFIG_RESERVED0_MASK			0x1FF
5592 #define ETH_VPORT_RSS_CONFIG_RESERVED0_SHIFT			7
5593 	u8 rss_id;
5594 	u8 rss_mode;
5595 	u8 update_rss_key;
5596 	u8 update_rss_ind_table;
5597 	u8 update_rss_capabilities;
5598 	u8 tbl_size;
5599 	__le32 reserved2[2];
5600 	__le16 indirection_table[ETH_RSS_IND_TABLE_ENTRIES_NUM];
5601 	__le32 rss_key[ETH_RSS_KEY_SIZE_REGS];
5602 	__le32 reserved3[2];
5603 };
5604 
5605 /* eth vport RSS mode */
5606 enum eth_vport_rss_mode {
5607 	ETH_VPORT_RSS_MODE_DISABLED,
5608 	ETH_VPORT_RSS_MODE_REGULAR,
5609 	MAX_ETH_VPORT_RSS_MODE
5610 };
5611 
5612 /* Command for setting classification flags for a vport $$KEEP_ENDIANNESS$$ */
5613 struct eth_vport_rx_mode {
5614 	__le16 state;
5615 #define ETH_VPORT_RX_MODE_UCAST_DROP_ALL_MASK		0x1
5616 #define ETH_VPORT_RX_MODE_UCAST_DROP_ALL_SHIFT		0
5617 #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL_MASK		0x1
5618 #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL_SHIFT	1
5619 #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_UNMATCHED_MASK	0x1
5620 #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_UNMATCHED_SHIFT	2
5621 #define ETH_VPORT_RX_MODE_MCAST_DROP_ALL_MASK		0x1
5622 #define ETH_VPORT_RX_MODE_MCAST_DROP_ALL_SHIFT		3
5623 #define ETH_VPORT_RX_MODE_MCAST_ACCEPT_ALL_MASK		0x1
5624 #define ETH_VPORT_RX_MODE_MCAST_ACCEPT_ALL_SHIFT	4
5625 #define ETH_VPORT_RX_MODE_BCAST_ACCEPT_ALL_MASK		0x1
5626 #define ETH_VPORT_RX_MODE_BCAST_ACCEPT_ALL_SHIFT	5
5627 #define ETH_VPORT_RX_MODE_ACCEPT_ANY_VNI_MASK		0x1
5628 #define ETH_VPORT_RX_MODE_ACCEPT_ANY_VNI_SHIFT		6
5629 #define ETH_VPORT_RX_MODE_RESERVED1_MASK		0x1FF
5630 #define ETH_VPORT_RX_MODE_RESERVED1_SHIFT		7
5631 };
5632 
5633 /* Command for setting tpa parameters */
5634 struct eth_vport_tpa_param {
5635 	u8 tpa_ipv4_en_flg;
5636 	u8 tpa_ipv6_en_flg;
5637 	u8 tpa_ipv4_tunn_en_flg;
5638 	u8 tpa_ipv6_tunn_en_flg;
5639 	u8 tpa_pkt_split_flg;
5640 	u8 tpa_hdr_data_split_flg;
5641 	u8 tpa_gro_consistent_flg;
5642 
5643 	u8 tpa_max_aggs_num;
5644 
5645 	__le16 tpa_max_size;
5646 	__le16 tpa_min_size_to_start;
5647 
5648 	__le16 tpa_min_size_to_cont;
5649 	u8 max_buff_num;
5650 	u8 reserved;
5651 };
5652 
5653 /* Command for setting classification flags for a vport $$KEEP_ENDIANNESS$$ */
5654 struct eth_vport_tx_mode {
5655 	__le16 state;
5656 #define ETH_VPORT_TX_MODE_UCAST_DROP_ALL_MASK		0x1
5657 #define ETH_VPORT_TX_MODE_UCAST_DROP_ALL_SHIFT		0
5658 #define ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL_MASK		0x1
5659 #define ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL_SHIFT	1
5660 #define ETH_VPORT_TX_MODE_MCAST_DROP_ALL_MASK		0x1
5661 #define ETH_VPORT_TX_MODE_MCAST_DROP_ALL_SHIFT		2
5662 #define ETH_VPORT_TX_MODE_MCAST_ACCEPT_ALL_MASK		0x1
5663 #define ETH_VPORT_TX_MODE_MCAST_ACCEPT_ALL_SHIFT	3
5664 #define ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL_MASK		0x1
5665 #define ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL_SHIFT	4
5666 #define ETH_VPORT_TX_MODE_RESERVED1_MASK		0x7FF
5667 #define ETH_VPORT_TX_MODE_RESERVED1_SHIFT		5
5668 };
5669 
5670 /* GFT filter update action type */
5671 enum gft_filter_update_action {
5672 	GFT_ADD_FILTER,
5673 	GFT_DELETE_FILTER,
5674 	MAX_GFT_FILTER_UPDATE_ACTION
5675 };
5676 
5677 /* Ramrod data for rx add openflow filter */
5678 struct rx_add_openflow_filter_data {
5679 	__le16 action_icid;
5680 	u8 priority;
5681 	u8 reserved0;
5682 	__le32 tenant_id;
5683 	__le16 dst_mac_hi;
5684 	__le16 dst_mac_mid;
5685 	__le16 dst_mac_lo;
5686 	__le16 src_mac_hi;
5687 	__le16 src_mac_mid;
5688 	__le16 src_mac_lo;
5689 	__le16 vlan_id;
5690 	__le16 l2_eth_type;
5691 	u8 ipv4_dscp;
5692 	u8 ipv4_frag_type;
5693 	u8 ipv4_over_ip;
5694 	u8 tenant_id_exists;
5695 	__le32 ipv4_dst_addr;
5696 	__le32 ipv4_src_addr;
5697 	__le16 l4_dst_port;
5698 	__le16 l4_src_port;
5699 };
5700 
5701 /* Ramrod data for rx create gft action */
5702 struct rx_create_gft_action_data {
5703 	u8 vport_id;
5704 	u8 reserved[7];
5705 };
5706 
5707 /* Ramrod data for rx create openflow action */
5708 struct rx_create_openflow_action_data {
5709 	u8 vport_id;
5710 	u8 reserved[7];
5711 };
5712 
5713 /* Ramrod data for rx queue start ramrod */
5714 struct rx_queue_start_ramrod_data {
5715 	__le16 rx_queue_id;
5716 	__le16 num_of_pbl_pages;
5717 	__le16 bd_max_bytes;
5718 	__le16 sb_id;
5719 	u8 sb_index;
5720 	u8 vport_id;
5721 	u8 default_rss_queue_flg;
5722 	u8 complete_cqe_flg;
5723 	u8 complete_event_flg;
5724 	u8 stats_counter_id;
5725 	u8 pin_context;
5726 	u8 pxp_tph_valid_bd;
5727 	u8 pxp_tph_valid_pkt;
5728 	u8 pxp_st_hint;
5729 
5730 	__le16 pxp_st_index;
5731 	u8 pmd_mode;
5732 
5733 	u8 notify_en;
5734 	u8 toggle_val;
5735 
5736 	u8 vf_rx_prod_index;
5737 	u8 vf_rx_prod_use_zone_a;
5738 	u8 reserved[5];
5739 	__le16 reserved1;
5740 	struct regpair cqe_pbl_addr;
5741 	struct regpair bd_base;
5742 	struct regpair reserved2;
5743 };
5744 
5745 /* Ramrod data for rx queue stop ramrod */
5746 struct rx_queue_stop_ramrod_data {
5747 	__le16 rx_queue_id;
5748 	u8 complete_cqe_flg;
5749 	u8 complete_event_flg;
5750 	u8 vport_id;
5751 	u8 reserved[3];
5752 };
5753 
5754 /* Ramrod data for rx queue update ramrod */
5755 struct rx_queue_update_ramrod_data {
5756 	__le16 rx_queue_id;
5757 	u8 complete_cqe_flg;
5758 	u8 complete_event_flg;
5759 	u8 vport_id;
5760 	u8 set_default_rss_queue;
5761 	u8 reserved[3];
5762 	u8 reserved1;
5763 	u8 reserved2;
5764 	u8 reserved3;
5765 	__le16 reserved4;
5766 	__le16 reserved5;
5767 	struct regpair reserved6;
5768 };
5769 
5770 /* Ramrod data for rx Add UDP Filter */
5771 struct rx_udp_filter_data {
5772 	__le16 action_icid;
5773 	__le16 vlan_id;
5774 	u8 ip_type;
5775 	u8 tenant_id_exists;
5776 	__le16 reserved1;
5777 	__le32 ip_dst_addr[4];
5778 	__le32 ip_src_addr[4];
5779 	__le16 udp_dst_port;
5780 	__le16 udp_src_port;
5781 	__le32 tenant_id;
5782 };
5783 
5784 /* Add or delete GFT filter - filter is packet header of type of packet wished
5785  * to pass certain FW flow.
5786  */
5787 struct rx_update_gft_filter_data {
5788 	struct regpair pkt_hdr_addr;
5789 	__le16 pkt_hdr_length;
5790 	__le16 action_icid;
5791 	__le16 rx_qid;
5792 	__le16 flow_id;
5793 	__le16 vport_id;
5794 	u8 action_icid_valid;
5795 	u8 rx_qid_valid;
5796 	u8 flow_id_valid;
5797 	u8 filter_action;
5798 	u8 assert_on_error;
5799 	u8 inner_vlan_removal_en;
5800 };
5801 
5802 /* Ramrod data for tx queue start ramrod */
5803 struct tx_queue_start_ramrod_data {
5804 	__le16 sb_id;
5805 	u8 sb_index;
5806 	u8 vport_id;
5807 	u8 reserved0;
5808 	u8 stats_counter_id;
5809 	__le16 qm_pq_id;
5810 	u8 flags;
5811 #define TX_QUEUE_START_RAMROD_DATA_DISABLE_OPPORTUNISTIC_MASK	0x1
5812 #define TX_QUEUE_START_RAMROD_DATA_DISABLE_OPPORTUNISTIC_SHIFT	0
5813 #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_PKT_DUP_MASK	0x1
5814 #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_PKT_DUP_SHIFT	1
5815 #define TX_QUEUE_START_RAMROD_DATA_PMD_MODE_MASK		0x1
5816 #define TX_QUEUE_START_RAMROD_DATA_PMD_MODE_SHIFT		2
5817 #define TX_QUEUE_START_RAMROD_DATA_NOTIFY_EN_MASK		0x1
5818 #define TX_QUEUE_START_RAMROD_DATA_NOTIFY_EN_SHIFT		3
5819 #define TX_QUEUE_START_RAMROD_DATA_PIN_CONTEXT_MASK		0x1
5820 #define TX_QUEUE_START_RAMROD_DATA_PIN_CONTEXT_SHIFT		4
5821 #define TX_QUEUE_START_RAMROD_DATA_RESERVED1_MASK		0x7
5822 #define TX_QUEUE_START_RAMROD_DATA_RESERVED1_SHIFT		5
5823 	u8 pxp_st_hint;
5824 	u8 pxp_tph_valid_bd;
5825 	u8 pxp_tph_valid_pkt;
5826 	__le16 pxp_st_index;
5827 	__le16 comp_agg_size;
5828 	__le16 queue_zone_id;
5829 	__le16 reserved2;
5830 	__le16 pbl_size;
5831 	__le16 tx_queue_id;
5832 	__le16 same_as_last_id;
5833 	__le16 reserved[3];
5834 	struct regpair pbl_base_addr;
5835 	struct regpair bd_cons_address;
5836 };
5837 
5838 /* Ramrod data for tx queue stop ramrod */
5839 struct tx_queue_stop_ramrod_data {
5840 	__le16 reserved[4];
5841 };
5842 
5843 /* Ramrod data for tx queue update ramrod */
5844 struct tx_queue_update_ramrod_data {
5845 	__le16 update_qm_pq_id_flg;
5846 	__le16 qm_pq_id;
5847 	__le32 reserved0;
5848 	struct regpair reserved1[5];
5849 };
5850 
5851 /* Inner to Inner VLAN priority map update mode */
5852 enum update_in_to_in_pri_map_mode_enum {
5853 	ETH_IN_TO_IN_PRI_MAP_UPDATE_DISABLED,
5854 	ETH_IN_TO_IN_PRI_MAP_UPDATE_NON_RDMA_TBL,
5855 	ETH_IN_TO_IN_PRI_MAP_UPDATE_RDMA_TBL,
5856 	MAX_UPDATE_IN_TO_IN_PRI_MAP_MODE_ENUM
5857 };
5858 
5859 /* Ramrod data for vport update ramrod */
5860 struct vport_filter_update_ramrod_data {
5861 	struct eth_filter_cmd_header filter_cmd_hdr;
5862 	struct eth_filter_cmd filter_cmds[ETH_FILTER_RULES_COUNT];
5863 };
5864 
5865 /* Ramrod data for vport start ramrod */
5866 struct vport_start_ramrod_data {
5867 	u8 vport_id;
5868 	u8 sw_fid;
5869 	__le16 mtu;
5870 	u8 drop_ttl0_en;
5871 	u8 inner_vlan_removal_en;
5872 	struct eth_vport_rx_mode rx_mode;
5873 	struct eth_vport_tx_mode tx_mode;
5874 	struct eth_vport_tpa_param tpa_param;
5875 	__le16 default_vlan;
5876 	u8 tx_switching_en;
5877 	u8 anti_spoofing_en;
5878 	u8 default_vlan_en;
5879 	u8 handle_ptp_pkts;
5880 	u8 silent_vlan_removal_en;
5881 	u8 untagged;
5882 	struct eth_tx_err_vals tx_err_behav;
5883 	u8 zero_placement_offset;
5884 	u8 ctl_frame_mac_check_en;
5885 	u8 ctl_frame_ethtype_check_en;
5886 	u8 reserved0;
5887 	u8 reserved1;
5888 	u8 tx_dst_port_mode_config;
5889 	u8 dst_vport_id;
5890 	u8 tx_dst_port_mode;
5891 	u8 dst_vport_id_valid;
5892 	u8 wipe_inner_vlan_pri_en;
5893 	u8 reserved2[2];
5894 	struct eth_in_to_in_pri_map_cfg in_to_in_vlan_pri_map_cfg;
5895 };
5896 
5897 /* Ramrod data for vport stop ramrod */
5898 struct vport_stop_ramrod_data {
5899 	u8 vport_id;
5900 	u8 reserved[7];
5901 };
5902 
5903 /* Ramrod data for vport update ramrod */
5904 struct vport_update_ramrod_data_cmn {
5905 	u8 vport_id;
5906 	u8 update_rx_active_flg;
5907 	u8 rx_active_flg;
5908 	u8 update_tx_active_flg;
5909 	u8 tx_active_flg;
5910 	u8 update_rx_mode_flg;
5911 	u8 update_tx_mode_flg;
5912 	u8 update_approx_mcast_flg;
5913 
5914 	u8 update_rss_flg;
5915 	u8 update_inner_vlan_removal_en_flg;
5916 
5917 	u8 inner_vlan_removal_en;
5918 	u8 update_tpa_param_flg;
5919 	u8 update_tpa_en_flg;
5920 	u8 update_tx_switching_en_flg;
5921 
5922 	u8 tx_switching_en;
5923 	u8 update_anti_spoofing_en_flg;
5924 
5925 	u8 anti_spoofing_en;
5926 	u8 update_handle_ptp_pkts;
5927 
5928 	u8 handle_ptp_pkts;
5929 	u8 update_default_vlan_en_flg;
5930 
5931 	u8 default_vlan_en;
5932 
5933 	u8 update_default_vlan_flg;
5934 
5935 	__le16 default_vlan;
5936 	u8 update_accept_any_vlan_flg;
5937 
5938 	u8 accept_any_vlan;
5939 	u8 silent_vlan_removal_en;
5940 	u8 update_mtu_flg;
5941 
5942 	__le16 mtu;
5943 	u8 update_ctl_frame_checks_en_flg;
5944 	u8 ctl_frame_mac_check_en;
5945 	u8 ctl_frame_ethtype_check_en;
5946 	u8 update_in_to_in_pri_map_mode;
5947 	u8 in_to_in_pri_map[8];
5948 	u8 reserved[6];
5949 };
5950 
5951 struct vport_update_ramrod_mcast {
5952 	__le32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
5953 };
5954 
5955 /* Ramrod data for vport update ramrod */
5956 struct vport_update_ramrod_data {
5957 	struct vport_update_ramrod_data_cmn common;
5958 
5959 	struct eth_vport_rx_mode rx_mode;
5960 	struct eth_vport_tx_mode tx_mode;
5961 	__le32 reserved[3];
5962 	struct eth_vport_tpa_param tpa_param;
5963 	struct vport_update_ramrod_mcast approx_mcast;
5964 	struct eth_vport_rss_config rss_config;
5965 };
5966 
5967 struct e4_xstorm_eth_conn_ag_ctx_dq_ext_ldpart {
5968 	u8 reserved0;
5969 	u8 state;
5970 	u8 flags0;
5971 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EXIST_IN_QM0_MASK	0x1
5972 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EXIST_IN_QM0_SHIFT	0
5973 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED1_MASK		0x1
5974 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED1_SHIFT		1
5975 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED2_MASK		0x1
5976 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED2_SHIFT		2
5977 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EXIST_IN_QM3_MASK	0x1
5978 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EXIST_IN_QM3_SHIFT	3
5979 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED3_MASK		0x1
5980 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED3_SHIFT		4
5981 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED4_MASK		0x1
5982 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED4_SHIFT		5
5983 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED5_MASK		0x1
5984 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED5_SHIFT		6
5985 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED6_MASK		0x1
5986 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED6_SHIFT		7
5987 	u8 flags1;
5988 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED7_MASK		0x1
5989 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED7_SHIFT		0
5990 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED8_MASK		0x1
5991 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED8_SHIFT		1
5992 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED9_MASK		0x1
5993 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED9_SHIFT		2
5994 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_BIT11_MASK		0x1
5995 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_BIT11_SHIFT		3
5996 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_E5_RESERVED2_MASK	0x1
5997 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_E5_RESERVED2_SHIFT	4
5998 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_E5_RESERVED3_MASK	0x1
5999 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_E5_RESERVED3_SHIFT	5
6000 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TX_RULE_ACTIVE_MASK	0x1
6001 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TX_RULE_ACTIVE_SHIFT	6
6002 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_ACTIVE_MASK	0x1
6003 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_ACTIVE_SHIFT	7
6004 	u8 flags2;
6005 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF0_MASK	0x3
6006 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF0_SHIFT	0
6007 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF1_MASK	0x3
6008 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF1_SHIFT	2
6009 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF2_MASK	0x3
6010 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF2_SHIFT	4
6011 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF3_MASK	0x3
6012 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF3_SHIFT	6
6013 	u8 flags3;
6014 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF4_MASK	0x3
6015 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF4_SHIFT	0
6016 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF5_MASK	0x3
6017 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF5_SHIFT	2
6018 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF6_MASK	0x3
6019 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF6_SHIFT	4
6020 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF7_MASK	0x3
6021 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF7_SHIFT	6
6022 	u8 flags4;
6023 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF8_MASK	0x3
6024 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF8_SHIFT	0
6025 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF9_MASK	0x3
6026 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF9_SHIFT	2
6027 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF10_MASK	0x3
6028 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF10_SHIFT	4
6029 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF11_MASK	0x3
6030 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF11_SHIFT	6
6031 	u8 flags5;
6032 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF12_MASK	0x3
6033 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF12_SHIFT	0
6034 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF13_MASK	0x3
6035 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF13_SHIFT	2
6036 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF14_MASK	0x3
6037 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF14_SHIFT	4
6038 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF15_MASK	0x3
6039 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF15_SHIFT	6
6040 	u8 flags6;
6041 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_GO_TO_BD_CONS_CF_MASK	0x3
6042 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_GO_TO_BD_CONS_CF_SHIFT	0
6043 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_MULTI_UNICAST_CF_MASK	0x3
6044 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_MULTI_UNICAST_CF_SHIFT	2
6045 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_MASK		0x3
6046 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_SHIFT		4
6047 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TERMINATE_CF_MASK	0x3
6048 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TERMINATE_CF_SHIFT	6
6049 	u8 flags7;
6050 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_FLUSH_Q0_MASK		0x3
6051 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_FLUSH_Q0_SHIFT		0
6052 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED10_MASK		0x3
6053 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED10_SHIFT	2
6054 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_SLOW_PATH_MASK		0x3
6055 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_SLOW_PATH_SHIFT		4
6056 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF0EN_MASK		0x1
6057 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF0EN_SHIFT		6
6058 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF1EN_MASK		0x1
6059 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF1EN_SHIFT		7
6060 	u8 flags8;
6061 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF2EN_MASK	0x1
6062 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF2EN_SHIFT	0
6063 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF3EN_MASK	0x1
6064 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF3EN_SHIFT	1
6065 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF4EN_MASK	0x1
6066 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF4EN_SHIFT	2
6067 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF5EN_MASK	0x1
6068 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF5EN_SHIFT	3
6069 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF6EN_MASK	0x1
6070 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF6EN_SHIFT	4
6071 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF7EN_MASK	0x1
6072 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF7EN_SHIFT	5
6073 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF8EN_MASK	0x1
6074 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF8EN_SHIFT	6
6075 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF9EN_MASK	0x1
6076 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF9EN_SHIFT	7
6077 	u8 flags9;
6078 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF10EN_MASK			0x1
6079 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF10EN_SHIFT			0
6080 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF11EN_MASK			0x1
6081 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF11EN_SHIFT			1
6082 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF12EN_MASK			0x1
6083 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF12EN_SHIFT			2
6084 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF13EN_MASK			0x1
6085 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF13EN_SHIFT			3
6086 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF14EN_MASK			0x1
6087 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF14EN_SHIFT			4
6088 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF15EN_MASK			0x1
6089 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_CF15EN_SHIFT			5
6090 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_GO_TO_BD_CONS_CF_EN_MASK	0x1
6091 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_GO_TO_BD_CONS_CF_EN_SHIFT	6
6092 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_MULTI_UNICAST_CF_EN_MASK	0x1
6093 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_MULTI_UNICAST_CF_EN_SHIFT	7
6094 	u8 flags10;
6095 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_EN_MASK			0x1
6096 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_DQ_CF_EN_SHIFT			0
6097 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TERMINATE_CF_EN_MASK		0x1
6098 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TERMINATE_CF_EN_SHIFT		1
6099 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_FLUSH_Q0_EN_MASK		0x1
6100 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_FLUSH_Q0_EN_SHIFT		2
6101 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED11_MASK			0x1
6102 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED11_SHIFT		3
6103 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_SLOW_PATH_EN_MASK		0x1
6104 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_SLOW_PATH_EN_SHIFT		4
6105 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TPH_ENABLE_EN_RESERVED_MASK	0x1
6106 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TPH_ENABLE_EN_RESERVED_SHIFT	5
6107 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED12_MASK			0x1
6108 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED12_SHIFT		6
6109 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED13_MASK			0x1
6110 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED13_SHIFT		7
6111 	u8 flags11;
6112 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED14_MASK		0x1
6113 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED14_SHIFT	0
6114 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED15_MASK		0x1
6115 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RESERVED15_SHIFT	1
6116 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TX_DEC_RULE_EN_MASK	0x1
6117 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TX_DEC_RULE_EN_SHIFT	2
6118 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE5EN_MASK		0x1
6119 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE5EN_SHIFT		3
6120 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE6EN_MASK		0x1
6121 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE6EN_SHIFT		4
6122 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE7EN_MASK		0x1
6123 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE7EN_SHIFT		5
6124 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED1_MASK	0x1
6125 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED1_SHIFT	6
6126 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE9EN_MASK		0x1
6127 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE9EN_SHIFT		7
6128 	u8 flags12;
6129 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE10EN_MASK		0x1
6130 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE10EN_SHIFT		0
6131 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE11EN_MASK		0x1
6132 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE11EN_SHIFT		1
6133 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED2_MASK	0x1
6134 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED2_SHIFT	2
6135 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED3_MASK	0x1
6136 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED3_SHIFT	3
6137 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE14EN_MASK		0x1
6138 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE14EN_SHIFT		4
6139 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE15EN_MASK		0x1
6140 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE15EN_SHIFT		5
6141 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE16EN_MASK		0x1
6142 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE16EN_SHIFT		6
6143 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE17EN_MASK		0x1
6144 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE17EN_SHIFT		7
6145 	u8 flags13;
6146 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE18EN_MASK		0x1
6147 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE18EN_SHIFT		0
6148 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE19EN_MASK		0x1
6149 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_RULE19EN_SHIFT		1
6150 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED4_MASK	0x1
6151 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED4_SHIFT	2
6152 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED5_MASK	0x1
6153 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED5_SHIFT	3
6154 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED6_MASK	0x1
6155 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED6_SHIFT	4
6156 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED7_MASK	0x1
6157 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED7_SHIFT	5
6158 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED8_MASK	0x1
6159 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED8_SHIFT	6
6160 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED9_MASK	0x1
6161 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_A0_RESERVED9_SHIFT	7
6162 	u8 flags14;
6163 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_USE_EXT_HDR_MASK		0x1
6164 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_USE_EXT_HDR_SHIFT		0
6165 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_SEND_RAW_L3L4_MASK		0x1
6166 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_SEND_RAW_L3L4_SHIFT	1
6167 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_INBAND_PROP_HDR_MASK	0x1
6168 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_INBAND_PROP_HDR_SHIFT	2
6169 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_SEND_EXT_TUNNEL_MASK	0x1
6170 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_EDPM_SEND_EXT_TUNNEL_SHIFT	3
6171 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_L2_EDPM_ENABLE_MASK		0x1
6172 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_L2_EDPM_ENABLE_SHIFT		4
6173 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_ROCE_EDPM_ENABLE_MASK		0x1
6174 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_ROCE_EDPM_ENABLE_SHIFT		5
6175 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TPH_ENABLE_MASK			0x3
6176 #define E4XSTORMETHCONNAGCTXDQEXTLDPART_TPH_ENABLE_SHIFT		6
6177 	u8 edpm_event_id;
6178 	__le16 physical_q0;
6179 	__le16 e5_reserved1;
6180 	__le16 edpm_num_bds;
6181 	__le16 tx_bd_cons;
6182 	__le16 tx_bd_prod;
6183 	__le16 updated_qm_pq_id;
6184 	__le16 conn_dpi;
6185 	u8 byte3;
6186 	u8 byte4;
6187 	u8 byte5;
6188 	u8 byte6;
6189 	__le32 reg0;
6190 	__le32 reg1;
6191 	__le32 reg2;
6192 	__le32 reg3;
6193 	__le32 reg4;
6194 };
6195 
6196 struct e4_mstorm_eth_conn_ag_ctx {
6197 	u8 byte0;
6198 	u8 byte1;
6199 	u8 flags0;
6200 #define E4_MSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
6201 #define E4_MSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	 0
6202 #define E4_MSTORM_ETH_CONN_AG_CTX_BIT1_MASK		0x1
6203 #define E4_MSTORM_ETH_CONN_AG_CTX_BIT1_SHIFT		1
6204 #define E4_MSTORM_ETH_CONN_AG_CTX_CF0_MASK		0x3
6205 #define E4_MSTORM_ETH_CONN_AG_CTX_CF0_SHIFT		2
6206 #define E4_MSTORM_ETH_CONN_AG_CTX_CF1_MASK		0x3
6207 #define E4_MSTORM_ETH_CONN_AG_CTX_CF1_SHIFT		4
6208 #define E4_MSTORM_ETH_CONN_AG_CTX_CF2_MASK		0x3
6209 #define E4_MSTORM_ETH_CONN_AG_CTX_CF2_SHIFT		6
6210 	u8 flags1;
6211 #define E4_MSTORM_ETH_CONN_AG_CTX_CF0EN_MASK	0x1
6212 #define E4_MSTORM_ETH_CONN_AG_CTX_CF0EN_SHIFT	0
6213 #define E4_MSTORM_ETH_CONN_AG_CTX_CF1EN_MASK	0x1
6214 #define E4_MSTORM_ETH_CONN_AG_CTX_CF1EN_SHIFT	1
6215 #define E4_MSTORM_ETH_CONN_AG_CTX_CF2EN_MASK	0x1
6216 #define E4_MSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT	2
6217 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE0EN_MASK	0x1
6218 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT	3
6219 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE1EN_MASK	0x1
6220 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT	4
6221 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE2EN_MASK	0x1
6222 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT	5
6223 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE3EN_MASK	0x1
6224 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT	6
6225 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE4EN_MASK	0x1
6226 #define E4_MSTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT	7
6227 	__le16 word0;
6228 	__le16 word1;
6229 	__le32 reg0;
6230 	__le32 reg1;
6231 };
6232 
6233 struct e4_xstorm_eth_hw_conn_ag_ctx {
6234 	u8 reserved0;
6235 	u8 state;
6236 	u8 flags0;
6237 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
6238 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
6239 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED1_MASK	0x1
6240 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED1_SHIFT	1
6241 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED2_MASK	0x1
6242 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED2_SHIFT	2
6243 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
6244 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
6245 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED3_MASK	0x1
6246 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED3_SHIFT	4
6247 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED4_MASK	0x1
6248 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED4_SHIFT	5
6249 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED5_MASK	0x1
6250 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED5_SHIFT	6
6251 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED6_MASK	0x1
6252 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED6_SHIFT	7
6253 	u8 flags1;
6254 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED7_MASK		0x1
6255 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED7_SHIFT		0
6256 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED8_MASK		0x1
6257 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED8_SHIFT		1
6258 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED9_MASK		0x1
6259 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED9_SHIFT		2
6260 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_BIT11_MASK			0x1
6261 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_BIT11_SHIFT		3
6262 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_E5_RESERVED2_MASK		0x1
6263 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_E5_RESERVED2_SHIFT		4
6264 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_E5_RESERVED3_MASK		0x1
6265 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_E5_RESERVED3_SHIFT		5
6266 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TX_RULE_ACTIVE_MASK	0x1
6267 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT	6
6268 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_ACTIVE_MASK		0x1
6269 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT		7
6270 	u8 flags2;
6271 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF0_MASK	0x3
6272 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF0_SHIFT	0
6273 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF1_MASK	0x3
6274 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF1_SHIFT	2
6275 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF2_MASK	0x3
6276 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF2_SHIFT	4
6277 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF3_MASK	0x3
6278 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF3_SHIFT	6
6279 	u8 flags3;
6280 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF4_MASK	0x3
6281 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF4_SHIFT	0
6282 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF5_MASK	0x3
6283 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF5_SHIFT	2
6284 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF6_MASK	0x3
6285 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF6_SHIFT	4
6286 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF7_MASK	0x3
6287 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF7_SHIFT	6
6288 	u8 flags4;
6289 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF8_MASK	0x3
6290 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF8_SHIFT	0
6291 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF9_MASK	0x3
6292 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF9_SHIFT	2
6293 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF10_MASK	0x3
6294 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF10_SHIFT	4
6295 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF11_MASK	0x3
6296 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF11_SHIFT	6
6297 	u8 flags5;
6298 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF12_MASK	0x3
6299 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF12_SHIFT	0
6300 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF13_MASK	0x3
6301 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF13_SHIFT	2
6302 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF14_MASK	0x3
6303 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF14_SHIFT	4
6304 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF15_MASK	0x3
6305 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF15_SHIFT	6
6306 	u8 flags6;
6307 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_GO_TO_BD_CONS_CF_MASK	0x3
6308 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_GO_TO_BD_CONS_CF_SHIFT	0
6309 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_MULTI_UNICAST_CF_MASK	0x3
6310 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_MULTI_UNICAST_CF_SHIFT	2
6311 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_MASK			0x3
6312 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_SHIFT		4
6313 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TERMINATE_CF_MASK		0x3
6314 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TERMINATE_CF_SHIFT		6
6315 	u8 flags7;
6316 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_FLUSH_Q0_MASK	0x3
6317 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_FLUSH_Q0_SHIFT	0
6318 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED10_MASK	0x3
6319 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED10_SHIFT	2
6320 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_SLOW_PATH_MASK	0x3
6321 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_SLOW_PATH_SHIFT	4
6322 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF0EN_MASK		0x1
6323 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF0EN_SHIFT	6
6324 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF1EN_MASK		0x1
6325 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF1EN_SHIFT	7
6326 	u8 flags8;
6327 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF2EN_MASK		0x1
6328 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF2EN_SHIFT	0
6329 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF3EN_MASK		0x1
6330 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF3EN_SHIFT	1
6331 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF4EN_MASK		0x1
6332 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF4EN_SHIFT	2
6333 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF5EN_MASK		0x1
6334 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF5EN_SHIFT	3
6335 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF6EN_MASK		0x1
6336 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF6EN_SHIFT	4
6337 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF7EN_MASK		0x1
6338 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF7EN_SHIFT	5
6339 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF8EN_MASK		0x1
6340 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF8EN_SHIFT	6
6341 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF9EN_MASK		0x1
6342 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF9EN_SHIFT	7
6343 	u8 flags9;
6344 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF10EN_MASK		0x1
6345 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF10EN_SHIFT		0
6346 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF11EN_MASK		0x1
6347 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF11EN_SHIFT		1
6348 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF12EN_MASK		0x1
6349 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF12EN_SHIFT		2
6350 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF13EN_MASK		0x1
6351 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF13EN_SHIFT		3
6352 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF14EN_MASK		0x1
6353 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF14EN_SHIFT		4
6354 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF15EN_MASK		0x1
6355 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_CF15EN_SHIFT		5
6356 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_MASK	0x1
6357 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_SHIFT	6
6358 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_MULTI_UNICAST_CF_EN_MASK	0x1
6359 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_MULTI_UNICAST_CF_EN_SHIFT	7
6360 	u8 flags10;
6361 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_EN_MASK			0x1
6362 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_DQ_CF_EN_SHIFT			0
6363 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TERMINATE_CF_EN_MASK		0x1
6364 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT		1
6365 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_FLUSH_Q0_EN_MASK			0x1
6366 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT			2
6367 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED11_MASK			0x1
6368 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED11_SHIFT			3
6369 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_SLOW_PATH_EN_MASK			0x1
6370 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_SLOW_PATH_EN_SHIFT			4
6371 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_MASK	0x1
6372 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_SHIFT	5
6373 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED12_MASK			0x1
6374 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED12_SHIFT			6
6375 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED13_MASK			0x1
6376 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED13_SHIFT			7
6377 	u8 flags11;
6378 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED14_MASK		0x1
6379 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED14_SHIFT		0
6380 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED15_MASK		0x1
6381 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RESERVED15_SHIFT		1
6382 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TX_DEC_RULE_EN_MASK	0x1
6383 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT	2
6384 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE5EN_MASK		0x1
6385 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE5EN_SHIFT		3
6386 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE6EN_MASK		0x1
6387 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE6EN_SHIFT		4
6388 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE7EN_MASK		0x1
6389 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE7EN_SHIFT		5
6390 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED1_MASK		0x1
6391 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED1_SHIFT		6
6392 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE9EN_MASK		0x1
6393 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE9EN_SHIFT		7
6394 	u8 flags12;
6395 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE10EN_MASK	0x1
6396 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE10EN_SHIFT	0
6397 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE11EN_MASK	0x1
6398 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE11EN_SHIFT	1
6399 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
6400 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
6401 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
6402 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
6403 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE14EN_MASK	0x1
6404 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE14EN_SHIFT	4
6405 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE15EN_MASK	0x1
6406 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE15EN_SHIFT	5
6407 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE16EN_MASK	0x1
6408 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE16EN_SHIFT	6
6409 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE17EN_MASK	0x1
6410 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE17EN_SHIFT	7
6411 	u8 flags13;
6412 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE18EN_MASK	0x1
6413 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE18EN_SHIFT	0
6414 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE19EN_MASK	0x1
6415 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_RULE19EN_SHIFT	1
6416 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED4_MASK	0x1
6417 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED4_SHIFT	2
6418 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED5_MASK	0x1
6419 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED5_SHIFT	3
6420 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED6_MASK	0x1
6421 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED6_SHIFT	4
6422 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED7_MASK	0x1
6423 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED7_SHIFT	5
6424 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED8_MASK	0x1
6425 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED8_SHIFT	6
6426 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED9_MASK	0x1
6427 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_A0_RESERVED9_SHIFT	7
6428 	u8 flags14;
6429 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_USE_EXT_HDR_MASK	0x1
6430 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_USE_EXT_HDR_SHIFT	0
6431 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_MASK	0x1
6432 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_SHIFT	1
6433 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_MASK	0x1
6434 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_SHIFT	2
6435 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_MASK	0x1
6436 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_SHIFT	3
6437 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_L2_EDPM_ENABLE_MASK	0x1
6438 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_L2_EDPM_ENABLE_SHIFT	4
6439 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_ROCE_EDPM_ENABLE_MASK	0x1
6440 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_ROCE_EDPM_ENABLE_SHIFT	5
6441 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TPH_ENABLE_MASK		0x3
6442 #define E4_XSTORM_ETH_HW_CONN_AG_CTX_TPH_ENABLE_SHIFT		6
6443 	u8 edpm_event_id;
6444 	__le16 physical_q0;
6445 	__le16 e5_reserved1;
6446 	__le16 edpm_num_bds;
6447 	__le16 tx_bd_cons;
6448 	__le16 tx_bd_prod;
6449 	__le16 updated_qm_pq_id;
6450 	__le16 conn_dpi;
6451 };
6452 
6453 /* GFT CAM line struct with fields breakout */
6454 struct gft_cam_line_mapped {
6455 	__le32 camline;
6456 #define GFT_CAM_LINE_MAPPED_VALID_MASK				0x1
6457 #define GFT_CAM_LINE_MAPPED_VALID_SHIFT				0
6458 #define GFT_CAM_LINE_MAPPED_IP_VERSION_MASK			0x1
6459 #define GFT_CAM_LINE_MAPPED_IP_VERSION_SHIFT			1
6460 #define GFT_CAM_LINE_MAPPED_TUNNEL_IP_VERSION_MASK		0x1
6461 #define GFT_CAM_LINE_MAPPED_TUNNEL_IP_VERSION_SHIFT		2
6462 #define GFT_CAM_LINE_MAPPED_UPPER_PROTOCOL_TYPE_MASK		0xF
6463 #define GFT_CAM_LINE_MAPPED_UPPER_PROTOCOL_TYPE_SHIFT		3
6464 #define GFT_CAM_LINE_MAPPED_TUNNEL_TYPE_MASK			0xF
6465 #define GFT_CAM_LINE_MAPPED_TUNNEL_TYPE_SHIFT			7
6466 #define GFT_CAM_LINE_MAPPED_PF_ID_MASK				0xF
6467 #define GFT_CAM_LINE_MAPPED_PF_ID_SHIFT				11
6468 #define GFT_CAM_LINE_MAPPED_IP_VERSION_MASK_MASK		0x1
6469 #define GFT_CAM_LINE_MAPPED_IP_VERSION_MASK_SHIFT		15
6470 #define GFT_CAM_LINE_MAPPED_TUNNEL_IP_VERSION_MASK_MASK		0x1
6471 #define GFT_CAM_LINE_MAPPED_TUNNEL_IP_VERSION_MASK_SHIFT	16
6472 #define GFT_CAM_LINE_MAPPED_UPPER_PROTOCOL_TYPE_MASK_MASK	0xF
6473 #define GFT_CAM_LINE_MAPPED_UPPER_PROTOCOL_TYPE_MASK_SHIFT	17
6474 #define GFT_CAM_LINE_MAPPED_TUNNEL_TYPE_MASK_MASK		0xF
6475 #define GFT_CAM_LINE_MAPPED_TUNNEL_TYPE_MASK_SHIFT		21
6476 #define GFT_CAM_LINE_MAPPED_PF_ID_MASK_MASK			0xF
6477 #define GFT_CAM_LINE_MAPPED_PF_ID_MASK_SHIFT			25
6478 #define GFT_CAM_LINE_MAPPED_RESERVED1_MASK			0x7
6479 #define GFT_CAM_LINE_MAPPED_RESERVED1_SHIFT			29
6480 };
6481 
6482 
6483 /* Used in gft_profile_key: Indication for ip version */
6484 enum gft_profile_ip_version {
6485 	GFT_PROFILE_IPV4 = 0,
6486 	GFT_PROFILE_IPV6 = 1,
6487 	MAX_GFT_PROFILE_IP_VERSION
6488 };
6489 
6490 /* Profile key stucr fot GFT logic in Prs */
6491 struct gft_profile_key {
6492 	__le16 profile_key;
6493 #define GFT_PROFILE_KEY_IP_VERSION_MASK			0x1
6494 #define GFT_PROFILE_KEY_IP_VERSION_SHIFT		0
6495 #define GFT_PROFILE_KEY_TUNNEL_IP_VERSION_MASK		0x1
6496 #define GFT_PROFILE_KEY_TUNNEL_IP_VERSION_SHIFT		1
6497 #define GFT_PROFILE_KEY_UPPER_PROTOCOL_TYPE_MASK	0xF
6498 #define GFT_PROFILE_KEY_UPPER_PROTOCOL_TYPE_SHIFT	2
6499 #define GFT_PROFILE_KEY_TUNNEL_TYPE_MASK		0xF
6500 #define GFT_PROFILE_KEY_TUNNEL_TYPE_SHIFT		6
6501 #define GFT_PROFILE_KEY_PF_ID_MASK			0xF
6502 #define GFT_PROFILE_KEY_PF_ID_SHIFT			10
6503 #define GFT_PROFILE_KEY_RESERVED0_MASK			0x3
6504 #define GFT_PROFILE_KEY_RESERVED0_SHIFT			14
6505 };
6506 
6507 /* Used in gft_profile_key: Indication for tunnel type */
6508 enum gft_profile_tunnel_type {
6509 	GFT_PROFILE_NO_TUNNEL = 0,
6510 	GFT_PROFILE_VXLAN_TUNNEL = 1,
6511 	GFT_PROFILE_GRE_MAC_OR_NVGRE_TUNNEL = 2,
6512 	GFT_PROFILE_GRE_IP_TUNNEL = 3,
6513 	GFT_PROFILE_GENEVE_MAC_TUNNEL = 4,
6514 	GFT_PROFILE_GENEVE_IP_TUNNEL = 5,
6515 	MAX_GFT_PROFILE_TUNNEL_TYPE
6516 };
6517 
6518 /* Used in gft_profile_key: Indication for protocol type */
6519 enum gft_profile_upper_protocol_type {
6520 	GFT_PROFILE_ROCE_PROTOCOL = 0,
6521 	GFT_PROFILE_RROCE_PROTOCOL = 1,
6522 	GFT_PROFILE_FCOE_PROTOCOL = 2,
6523 	GFT_PROFILE_ICMP_PROTOCOL = 3,
6524 	GFT_PROFILE_ARP_PROTOCOL = 4,
6525 	GFT_PROFILE_USER_TCP_SRC_PORT_1_INNER = 5,
6526 	GFT_PROFILE_USER_TCP_DST_PORT_1_INNER = 6,
6527 	GFT_PROFILE_TCP_PROTOCOL = 7,
6528 	GFT_PROFILE_USER_UDP_DST_PORT_1_INNER = 8,
6529 	GFT_PROFILE_USER_UDP_DST_PORT_2_OUTER = 9,
6530 	GFT_PROFILE_UDP_PROTOCOL = 10,
6531 	GFT_PROFILE_USER_IP_1_INNER = 11,
6532 	GFT_PROFILE_USER_IP_2_OUTER = 12,
6533 	GFT_PROFILE_USER_ETH_1_INNER = 13,
6534 	GFT_PROFILE_USER_ETH_2_OUTER = 14,
6535 	GFT_PROFILE_RAW = 15,
6536 	MAX_GFT_PROFILE_UPPER_PROTOCOL_TYPE
6537 };
6538 
6539 /* GFT RAM line struct */
6540 struct gft_ram_line {
6541 	__le32 lo;
6542 #define GFT_RAM_LINE_VLAN_SELECT_MASK			0x3
6543 #define GFT_RAM_LINE_VLAN_SELECT_SHIFT			0
6544 #define GFT_RAM_LINE_TUNNEL_ENTROPHY_MASK		0x1
6545 #define GFT_RAM_LINE_TUNNEL_ENTROPHY_SHIFT		2
6546 #define GFT_RAM_LINE_TUNNEL_TTL_EQUAL_ONE_MASK		0x1
6547 #define GFT_RAM_LINE_TUNNEL_TTL_EQUAL_ONE_SHIFT		3
6548 #define GFT_RAM_LINE_TUNNEL_TTL_MASK			0x1
6549 #define GFT_RAM_LINE_TUNNEL_TTL_SHIFT			4
6550 #define GFT_RAM_LINE_TUNNEL_ETHERTYPE_MASK		0x1
6551 #define GFT_RAM_LINE_TUNNEL_ETHERTYPE_SHIFT		5
6552 #define GFT_RAM_LINE_TUNNEL_DST_PORT_MASK		0x1
6553 #define GFT_RAM_LINE_TUNNEL_DST_PORT_SHIFT		6
6554 #define GFT_RAM_LINE_TUNNEL_SRC_PORT_MASK		0x1
6555 #define GFT_RAM_LINE_TUNNEL_SRC_PORT_SHIFT		7
6556 #define GFT_RAM_LINE_TUNNEL_DSCP_MASK			0x1
6557 #define GFT_RAM_LINE_TUNNEL_DSCP_SHIFT			8
6558 #define GFT_RAM_LINE_TUNNEL_OVER_IP_PROTOCOL_MASK	0x1
6559 #define GFT_RAM_LINE_TUNNEL_OVER_IP_PROTOCOL_SHIFT	9
6560 #define GFT_RAM_LINE_TUNNEL_DST_IP_MASK			0x1
6561 #define GFT_RAM_LINE_TUNNEL_DST_IP_SHIFT		10
6562 #define GFT_RAM_LINE_TUNNEL_SRC_IP_MASK			0x1
6563 #define GFT_RAM_LINE_TUNNEL_SRC_IP_SHIFT		11
6564 #define GFT_RAM_LINE_TUNNEL_PRIORITY_MASK		0x1
6565 #define GFT_RAM_LINE_TUNNEL_PRIORITY_SHIFT		12
6566 #define GFT_RAM_LINE_TUNNEL_PROVIDER_VLAN_MASK		0x1
6567 #define GFT_RAM_LINE_TUNNEL_PROVIDER_VLAN_SHIFT		13
6568 #define GFT_RAM_LINE_TUNNEL_VLAN_MASK			0x1
6569 #define GFT_RAM_LINE_TUNNEL_VLAN_SHIFT			14
6570 #define GFT_RAM_LINE_TUNNEL_DST_MAC_MASK		0x1
6571 #define GFT_RAM_LINE_TUNNEL_DST_MAC_SHIFT		15
6572 #define GFT_RAM_LINE_TUNNEL_SRC_MAC_MASK		0x1
6573 #define GFT_RAM_LINE_TUNNEL_SRC_MAC_SHIFT		16
6574 #define GFT_RAM_LINE_TTL_EQUAL_ONE_MASK			0x1
6575 #define GFT_RAM_LINE_TTL_EQUAL_ONE_SHIFT		17
6576 #define GFT_RAM_LINE_TTL_MASK				0x1
6577 #define GFT_RAM_LINE_TTL_SHIFT				18
6578 #define GFT_RAM_LINE_ETHERTYPE_MASK			0x1
6579 #define GFT_RAM_LINE_ETHERTYPE_SHIFT			19
6580 #define GFT_RAM_LINE_RESERVED0_MASK			0x1
6581 #define GFT_RAM_LINE_RESERVED0_SHIFT			20
6582 #define GFT_RAM_LINE_TCP_FLAG_FIN_MASK			0x1
6583 #define GFT_RAM_LINE_TCP_FLAG_FIN_SHIFT			21
6584 #define GFT_RAM_LINE_TCP_FLAG_SYN_MASK			0x1
6585 #define GFT_RAM_LINE_TCP_FLAG_SYN_SHIFT			22
6586 #define GFT_RAM_LINE_TCP_FLAG_RST_MASK			0x1
6587 #define GFT_RAM_LINE_TCP_FLAG_RST_SHIFT			23
6588 #define GFT_RAM_LINE_TCP_FLAG_PSH_MASK			0x1
6589 #define GFT_RAM_LINE_TCP_FLAG_PSH_SHIFT			24
6590 #define GFT_RAM_LINE_TCP_FLAG_ACK_MASK			0x1
6591 #define GFT_RAM_LINE_TCP_FLAG_ACK_SHIFT			25
6592 #define GFT_RAM_LINE_TCP_FLAG_URG_MASK			0x1
6593 #define GFT_RAM_LINE_TCP_FLAG_URG_SHIFT			26
6594 #define GFT_RAM_LINE_TCP_FLAG_ECE_MASK			0x1
6595 #define GFT_RAM_LINE_TCP_FLAG_ECE_SHIFT			27
6596 #define GFT_RAM_LINE_TCP_FLAG_CWR_MASK			0x1
6597 #define GFT_RAM_LINE_TCP_FLAG_CWR_SHIFT			28
6598 #define GFT_RAM_LINE_TCP_FLAG_NS_MASK			0x1
6599 #define GFT_RAM_LINE_TCP_FLAG_NS_SHIFT			29
6600 #define GFT_RAM_LINE_DST_PORT_MASK			0x1
6601 #define GFT_RAM_LINE_DST_PORT_SHIFT			30
6602 #define GFT_RAM_LINE_SRC_PORT_MASK			0x1
6603 #define GFT_RAM_LINE_SRC_PORT_SHIFT			31
6604 	__le32 hi;
6605 #define GFT_RAM_LINE_DSCP_MASK				0x1
6606 #define GFT_RAM_LINE_DSCP_SHIFT				0
6607 #define GFT_RAM_LINE_OVER_IP_PROTOCOL_MASK		0x1
6608 #define GFT_RAM_LINE_OVER_IP_PROTOCOL_SHIFT		1
6609 #define GFT_RAM_LINE_DST_IP_MASK			0x1
6610 #define GFT_RAM_LINE_DST_IP_SHIFT			2
6611 #define GFT_RAM_LINE_SRC_IP_MASK			0x1
6612 #define GFT_RAM_LINE_SRC_IP_SHIFT			3
6613 #define GFT_RAM_LINE_PRIORITY_MASK			0x1
6614 #define GFT_RAM_LINE_PRIORITY_SHIFT			4
6615 #define GFT_RAM_LINE_PROVIDER_VLAN_MASK			0x1
6616 #define GFT_RAM_LINE_PROVIDER_VLAN_SHIFT		5
6617 #define GFT_RAM_LINE_VLAN_MASK				0x1
6618 #define GFT_RAM_LINE_VLAN_SHIFT				6
6619 #define GFT_RAM_LINE_DST_MAC_MASK			0x1
6620 #define GFT_RAM_LINE_DST_MAC_SHIFT			7
6621 #define GFT_RAM_LINE_SRC_MAC_MASK			0x1
6622 #define GFT_RAM_LINE_SRC_MAC_SHIFT			8
6623 #define GFT_RAM_LINE_TENANT_ID_MASK			0x1
6624 #define GFT_RAM_LINE_TENANT_ID_SHIFT			9
6625 #define GFT_RAM_LINE_RESERVED1_MASK			0x3FFFFF
6626 #define GFT_RAM_LINE_RESERVED1_SHIFT			10
6627 };
6628 
6629 /* Used in the first 2 bits for gft_ram_line: Indication for vlan mask */
6630 enum gft_vlan_select {
6631 	INNER_PROVIDER_VLAN = 0,
6632 	INNER_VLAN = 1,
6633 	OUTER_PROVIDER_VLAN = 2,
6634 	OUTER_VLAN = 3,
6635 	MAX_GFT_VLAN_SELECT
6636 };
6637 
6638 /* The rdma task context of Mstorm */
6639 struct ystorm_rdma_task_st_ctx {
6640 	struct regpair temp[4];
6641 };
6642 
6643 struct e4_ystorm_rdma_task_ag_ctx {
6644 	u8 reserved;
6645 	u8 byte1;
6646 	__le16 msem_ctx_upd_seq;
6647 	u8 flags0;
6648 #define E4_YSTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_MASK		0xF
6649 #define E4_YSTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_SHIFT	0
6650 #define E4_YSTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_MASK		0x1
6651 #define E4_YSTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_SHIFT		4
6652 #define E4_YSTORM_RDMA_TASK_AG_CTX_BIT1_MASK			0x1
6653 #define E4_YSTORM_RDMA_TASK_AG_CTX_BIT1_SHIFT			5
6654 #define E4_YSTORM_RDMA_TASK_AG_CTX_VALID_MASK			0x1
6655 #define E4_YSTORM_RDMA_TASK_AG_CTX_VALID_SHIFT			6
6656 #define E4_YSTORM_RDMA_TASK_AG_CTX_DIF_FIRST_IO_MASK		0x1
6657 #define E4_YSTORM_RDMA_TASK_AG_CTX_DIF_FIRST_IO_SHIFT		7
6658 	u8 flags1;
6659 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF0_MASK		0x3
6660 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF0_SHIFT		0
6661 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF1_MASK		0x3
6662 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF1_SHIFT		2
6663 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF2SPECIAL_MASK	0x3
6664 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF2SPECIAL_SHIFT	4
6665 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF0EN_MASK		0x1
6666 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF0EN_SHIFT		6
6667 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF1EN_MASK		0x1
6668 #define E4_YSTORM_RDMA_TASK_AG_CTX_CF1EN_SHIFT		7
6669 	u8 flags2;
6670 #define E4_YSTORM_RDMA_TASK_AG_CTX_BIT4_MASK		0x1
6671 #define E4_YSTORM_RDMA_TASK_AG_CTX_BIT4_SHIFT		0
6672 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE0EN_MASK		0x1
6673 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE0EN_SHIFT	1
6674 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE1EN_MASK		0x1
6675 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE1EN_SHIFT	2
6676 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE2EN_MASK		0x1
6677 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE2EN_SHIFT	3
6678 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE3EN_MASK		0x1
6679 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE3EN_SHIFT	4
6680 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE4EN_MASK		0x1
6681 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE4EN_SHIFT	5
6682 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE5EN_MASK		0x1
6683 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE5EN_SHIFT	6
6684 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE6EN_MASK		0x1
6685 #define E4_YSTORM_RDMA_TASK_AG_CTX_RULE6EN_SHIFT	7
6686 	u8 key;
6687 	__le32 mw_cnt_or_qp_id;
6688 	u8 ref_cnt_seq;
6689 	u8 ctx_upd_seq;
6690 	__le16 dif_flags;
6691 	__le16 tx_ref_count;
6692 	__le16 last_used_ltid;
6693 	__le16 parent_mr_lo;
6694 	__le16 parent_mr_hi;
6695 	__le32 fbo_lo;
6696 	__le32 fbo_hi;
6697 };
6698 
6699 struct e4_mstorm_rdma_task_ag_ctx {
6700 	u8 reserved;
6701 	u8 byte1;
6702 	__le16 icid;
6703 	u8 flags0;
6704 #define E4_MSTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_MASK		0xF
6705 #define E4_MSTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_SHIFT	0
6706 #define E4_MSTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_MASK		0x1
6707 #define E4_MSTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_SHIFT		4
6708 #define E4_MSTORM_RDMA_TASK_AG_CTX_BIT1_MASK			0x1
6709 #define E4_MSTORM_RDMA_TASK_AG_CTX_BIT1_SHIFT			5
6710 #define E4_MSTORM_RDMA_TASK_AG_CTX_BIT2_MASK			0x1
6711 #define E4_MSTORM_RDMA_TASK_AG_CTX_BIT2_SHIFT			6
6712 #define E4_MSTORM_RDMA_TASK_AG_CTX_DIF_FIRST_IO_MASK		0x1
6713 #define E4_MSTORM_RDMA_TASK_AG_CTX_DIF_FIRST_IO_SHIFT		7
6714 	u8 flags1;
6715 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF0_MASK	0x3
6716 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF0_SHIFT	0
6717 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF1_MASK	0x3
6718 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF1_SHIFT	2
6719 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF2_MASK	0x3
6720 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF2_SHIFT	4
6721 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF0EN_MASK	0x1
6722 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF0EN_SHIFT	6
6723 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF1EN_MASK	0x1
6724 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF1EN_SHIFT	7
6725 	u8 flags2;
6726 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF2EN_MASK		0x1
6727 #define E4_MSTORM_RDMA_TASK_AG_CTX_CF2EN_SHIFT		0
6728 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE0EN_MASK		0x1
6729 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE0EN_SHIFT	1
6730 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE1EN_MASK		0x1
6731 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE1EN_SHIFT	2
6732 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE2EN_MASK		0x1
6733 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE2EN_SHIFT	3
6734 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE3EN_MASK		0x1
6735 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE3EN_SHIFT	4
6736 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE4EN_MASK		0x1
6737 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE4EN_SHIFT	5
6738 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE5EN_MASK		0x1
6739 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE5EN_SHIFT	6
6740 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE6EN_MASK		0x1
6741 #define E4_MSTORM_RDMA_TASK_AG_CTX_RULE6EN_SHIFT	7
6742 	u8 key;
6743 	__le32 mw_cnt_or_qp_id;
6744 	u8 ref_cnt_seq;
6745 	u8 ctx_upd_seq;
6746 	__le16 dif_flags;
6747 	__le16 tx_ref_count;
6748 	__le16 last_used_ltid;
6749 	__le16 parent_mr_lo;
6750 	__le16 parent_mr_hi;
6751 	__le32 fbo_lo;
6752 	__le32 fbo_hi;
6753 };
6754 
6755 /* The roce task context of Mstorm */
6756 struct mstorm_rdma_task_st_ctx {
6757 	struct regpair temp[4];
6758 };
6759 
6760 /* The roce task context of Ustorm */
6761 struct ustorm_rdma_task_st_ctx {
6762 	struct regpair temp[6];
6763 };
6764 
6765 struct e4_ustorm_rdma_task_ag_ctx {
6766 	u8 reserved;
6767 	u8 state;
6768 	__le16 icid;
6769 	u8 flags0;
6770 #define E4_USTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_MASK		0xF
6771 #define E4_USTORM_RDMA_TASK_AG_CTX_CONNECTION_TYPE_SHIFT	0
6772 #define E4_USTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_MASK		0x1
6773 #define E4_USTORM_RDMA_TASK_AG_CTX_EXIST_IN_QM0_SHIFT		4
6774 #define E4_USTORM_RDMA_TASK_AG_CTX_BIT1_MASK			0x1
6775 #define E4_USTORM_RDMA_TASK_AG_CTX_BIT1_SHIFT			5
6776 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_RESULT_CF_MASK	0x3
6777 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_RESULT_CF_SHIFT	6
6778 	u8 flags1;
6779 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_RESULT_TOGGLE_BIT_MASK	0x3
6780 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_RESULT_TOGGLE_BIT_SHIFT	0
6781 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_TX_IO_FLG_MASK		0x3
6782 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_TX_IO_FLG_SHIFT		2
6783 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_BLOCK_SIZE_MASK          0x3
6784 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_BLOCK_SIZE_SHIFT         4
6785 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_CF_MASK		0x3
6786 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_CF_SHIFT		6
6787 	u8 flags2;
6788 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_RESULT_CF_EN_MASK	0x1
6789 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_RESULT_CF_EN_SHIFT	0
6790 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED2_MASK		0x1
6791 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED2_SHIFT		1
6792 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED3_MASK		0x1
6793 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED3_SHIFT		2
6794 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED4_MASK               0x1
6795 #define E4_USTORM_RDMA_TASK_AG_CTX_RESERVED4_SHIFT              3
6796 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_CF_EN_MASK		0x1
6797 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_CF_EN_SHIFT	4
6798 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE0EN_MASK			0x1
6799 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE0EN_SHIFT		5
6800 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE1EN_MASK			0x1
6801 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE1EN_SHIFT		6
6802 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE2EN_MASK			0x1
6803 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE2EN_SHIFT		7
6804 	u8 flags3;
6805 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_RXMIT_PROD_CONS_EN_MASK	0x1
6806 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_RXMIT_PROD_CONS_EN_SHIFT	0
6807 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE4EN_MASK			0x1
6808 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE4EN_SHIFT		1
6809 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_PROD_CONS_EN_MASK	0x1
6810 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_WRITE_PROD_CONS_EN_SHIFT	2
6811 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE6EN_MASK			0x1
6812 #define E4_USTORM_RDMA_TASK_AG_CTX_RULE6EN_SHIFT		3
6813 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_TYPE_MASK		0xF
6814 #define E4_USTORM_RDMA_TASK_AG_CTX_DIF_ERROR_TYPE_SHIFT		4
6815 	__le32 dif_err_intervals;
6816 	__le32 dif_error_1st_interval;
6817 	__le32 dif_rxmit_cons;
6818 	__le32 dif_rxmit_prod;
6819 	__le32 sge_index;
6820 	__le32 sq_cons;
6821 	u8 byte2;
6822 	u8 byte3;
6823 	__le16 dif_write_cons;
6824 	__le16 dif_write_prod;
6825 	__le16 word3;
6826 	__le32 dif_error_buffer_address_lo;
6827 	__le32 dif_error_buffer_address_hi;
6828 };
6829 
6830 /* RDMA task context */
6831 struct e4_rdma_task_context {
6832 	struct ystorm_rdma_task_st_ctx ystorm_st_context;
6833 	struct e4_ystorm_rdma_task_ag_ctx ystorm_ag_context;
6834 	struct tdif_task_context tdif_context;
6835 	struct e4_mstorm_rdma_task_ag_ctx mstorm_ag_context;
6836 	struct mstorm_rdma_task_st_ctx mstorm_st_context;
6837 	struct rdif_task_context rdif_context;
6838 	struct ustorm_rdma_task_st_ctx ustorm_st_context;
6839 	struct regpair ustorm_st_padding[2];
6840 	struct e4_ustorm_rdma_task_ag_ctx ustorm_ag_context;
6841 };
6842 
6843 /* rdma function init ramrod data */
6844 struct rdma_close_func_ramrod_data {
6845 	u8 cnq_start_offset;
6846 	u8 num_cnqs;
6847 	u8 vf_id;
6848 	u8 vf_valid;
6849 	u8 reserved[4];
6850 };
6851 
6852 /* rdma function init CNQ parameters */
6853 struct rdma_cnq_params {
6854 	__le16 sb_num;
6855 	u8 sb_index;
6856 	u8 num_pbl_pages;
6857 	__le32 reserved;
6858 	struct regpair pbl_base_addr;
6859 	__le16 queue_zone_num;
6860 	u8 reserved1[6];
6861 };
6862 
6863 /* rdma create cq ramrod data */
6864 struct rdma_create_cq_ramrod_data {
6865 	struct regpair cq_handle;
6866 	struct regpair pbl_addr;
6867 	__le32 max_cqes;
6868 	__le16 pbl_num_pages;
6869 	__le16 dpi;
6870 	u8 is_two_level_pbl;
6871 	u8 cnq_id;
6872 	u8 pbl_log_page_size;
6873 	u8 toggle_bit;
6874 	__le16 int_timeout;
6875 	u8 vf_id;
6876 	u8 flags;
6877 #define RDMA_CREATE_CQ_RAMROD_DATA_VF_ID_VALID_MASK  0x1
6878 #define RDMA_CREATE_CQ_RAMROD_DATA_VF_ID_VALID_SHIFT 0
6879 #define RDMA_CREATE_CQ_RAMROD_DATA_RESERVED1_MASK    0x7F
6880 #define RDMA_CREATE_CQ_RAMROD_DATA_RESERVED1_SHIFT   1
6881 };
6882 
6883 /* rdma deregister tid ramrod data */
6884 struct rdma_deregister_tid_ramrod_data {
6885 	__le32 itid;
6886 	__le32 reserved;
6887 };
6888 
6889 /* rdma destroy cq output params */
6890 struct rdma_destroy_cq_output_params {
6891 	__le16 cnq_num;
6892 	__le16 reserved0;
6893 	__le32 reserved1;
6894 };
6895 
6896 /* rdma destroy cq ramrod data */
6897 struct rdma_destroy_cq_ramrod_data {
6898 	struct regpair output_params_addr;
6899 };
6900 
6901 /* RDMA slow path EQ cmd IDs */
6902 enum rdma_event_opcode {
6903 	RDMA_EVENT_UNUSED,
6904 	RDMA_EVENT_FUNC_INIT,
6905 	RDMA_EVENT_FUNC_CLOSE,
6906 	RDMA_EVENT_REGISTER_MR,
6907 	RDMA_EVENT_DEREGISTER_MR,
6908 	RDMA_EVENT_CREATE_CQ,
6909 	RDMA_EVENT_RESIZE_CQ,
6910 	RDMA_EVENT_DESTROY_CQ,
6911 	RDMA_EVENT_CREATE_SRQ,
6912 	RDMA_EVENT_MODIFY_SRQ,
6913 	RDMA_EVENT_DESTROY_SRQ,
6914 	MAX_RDMA_EVENT_OPCODE
6915 };
6916 
6917 /* RDMA FW return code for slow path ramrods */
6918 enum rdma_fw_return_code {
6919 	RDMA_RETURN_OK = 0,
6920 	RDMA_RETURN_REGISTER_MR_BAD_STATE_ERR,
6921 	RDMA_RETURN_DEREGISTER_MR_BAD_STATE_ERR,
6922 	RDMA_RETURN_RESIZE_CQ_ERR,
6923 	RDMA_RETURN_NIG_DRAIN_REQ,
6924 	RDMA_RETURN_GENERAL_ERR,
6925 	MAX_RDMA_FW_RETURN_CODE
6926 };
6927 
6928 /* rdma function init header */
6929 struct rdma_init_func_hdr {
6930 	u8 cnq_start_offset;
6931 	u8 num_cnqs;
6932 	u8 cq_ring_mode;
6933 	u8 vf_id;
6934 	u8 vf_valid;
6935 	u8 relaxed_ordering;
6936 	__le16 first_reg_srq_id;
6937 	__le32 reg_srq_base_addr;
6938 	u8 searcher_mode;
6939 	u8 pvrdma_mode;
6940 	u8 max_num_ns_log;
6941 	u8 reserved;
6942 };
6943 
6944 /* rdma function init ramrod data */
6945 struct rdma_init_func_ramrod_data {
6946 	struct rdma_init_func_hdr params_header;
6947 	struct rdma_cnq_params cnq_params[NUM_OF_GLOBAL_QUEUES];
6948 };
6949 
6950 /* RDMA ramrod command IDs */
6951 enum rdma_ramrod_cmd_id {
6952 	RDMA_RAMROD_UNUSED,
6953 	RDMA_RAMROD_FUNC_INIT,
6954 	RDMA_RAMROD_FUNC_CLOSE,
6955 	RDMA_RAMROD_REGISTER_MR,
6956 	RDMA_RAMROD_DEREGISTER_MR,
6957 	RDMA_RAMROD_CREATE_CQ,
6958 	RDMA_RAMROD_RESIZE_CQ,
6959 	RDMA_RAMROD_DESTROY_CQ,
6960 	RDMA_RAMROD_CREATE_SRQ,
6961 	RDMA_RAMROD_MODIFY_SRQ,
6962 	RDMA_RAMROD_DESTROY_SRQ,
6963 	MAX_RDMA_RAMROD_CMD_ID
6964 };
6965 
6966 /* rdma register tid ramrod data */
6967 struct rdma_register_tid_ramrod_data {
6968 	__le16 flags;
6969 #define RDMA_REGISTER_TID_RAMROD_DATA_PAGE_SIZE_LOG_MASK	0x1F
6970 #define RDMA_REGISTER_TID_RAMROD_DATA_PAGE_SIZE_LOG_SHIFT	0
6971 #define RDMA_REGISTER_TID_RAMROD_DATA_TWO_LEVEL_PBL_MASK	0x1
6972 #define RDMA_REGISTER_TID_RAMROD_DATA_TWO_LEVEL_PBL_SHIFT	5
6973 #define RDMA_REGISTER_TID_RAMROD_DATA_ZERO_BASED_MASK		0x1
6974 #define RDMA_REGISTER_TID_RAMROD_DATA_ZERO_BASED_SHIFT		6
6975 #define RDMA_REGISTER_TID_RAMROD_DATA_PHY_MR_MASK		0x1
6976 #define RDMA_REGISTER_TID_RAMROD_DATA_PHY_MR_SHIFT		7
6977 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_READ_MASK		0x1
6978 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_READ_SHIFT		8
6979 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_WRITE_MASK		0x1
6980 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_WRITE_SHIFT	9
6981 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_ATOMIC_MASK	0x1
6982 #define RDMA_REGISTER_TID_RAMROD_DATA_REMOTE_ATOMIC_SHIFT	10
6983 #define RDMA_REGISTER_TID_RAMROD_DATA_LOCAL_WRITE_MASK		0x1
6984 #define RDMA_REGISTER_TID_RAMROD_DATA_LOCAL_WRITE_SHIFT		11
6985 #define RDMA_REGISTER_TID_RAMROD_DATA_LOCAL_READ_MASK		0x1
6986 #define RDMA_REGISTER_TID_RAMROD_DATA_LOCAL_READ_SHIFT		12
6987 #define RDMA_REGISTER_TID_RAMROD_DATA_ENABLE_MW_BIND_MASK	0x1
6988 #define RDMA_REGISTER_TID_RAMROD_DATA_ENABLE_MW_BIND_SHIFT	13
6989 #define RDMA_REGISTER_TID_RAMROD_DATA_RESERVED_MASK		0x3
6990 #define RDMA_REGISTER_TID_RAMROD_DATA_RESERVED_SHIFT		14
6991 	u8 flags1;
6992 #define RDMA_REGISTER_TID_RAMROD_DATA_PBL_PAGE_SIZE_LOG_MASK	0x1F
6993 #define RDMA_REGISTER_TID_RAMROD_DATA_PBL_PAGE_SIZE_LOG_SHIFT	0
6994 #define RDMA_REGISTER_TID_RAMROD_DATA_TID_TYPE_MASK		0x7
6995 #define RDMA_REGISTER_TID_RAMROD_DATA_TID_TYPE_SHIFT		5
6996 	u8 flags2;
6997 #define RDMA_REGISTER_TID_RAMROD_DATA_DMA_MR_MASK		0x1
6998 #define RDMA_REGISTER_TID_RAMROD_DATA_DMA_MR_SHIFT		0
6999 #define RDMA_REGISTER_TID_RAMROD_DATA_DIF_ON_HOST_FLG_MASK	0x1
7000 #define RDMA_REGISTER_TID_RAMROD_DATA_DIF_ON_HOST_FLG_SHIFT	1
7001 #define RDMA_REGISTER_TID_RAMROD_DATA_RESERVED1_MASK		0x3F
7002 #define RDMA_REGISTER_TID_RAMROD_DATA_RESERVED1_SHIFT		2
7003 	u8 key;
7004 	u8 length_hi;
7005 	u8 vf_id;
7006 	u8 vf_valid;
7007 	__le16 pd;
7008 	__le16 reserved2;
7009 	__le32 length_lo;
7010 	__le32 itid;
7011 	__le32 reserved3;
7012 	struct regpair va;
7013 	struct regpair pbl_base;
7014 	struct regpair dif_error_addr;
7015 	__le32 reserved4[4];
7016 };
7017 
7018 /* rdma resize cq output params */
7019 struct rdma_resize_cq_output_params {
7020 	__le32 old_cq_cons;
7021 	__le32 old_cq_prod;
7022 };
7023 
7024 /* rdma resize cq ramrod data */
7025 struct rdma_resize_cq_ramrod_data {
7026 	u8 flags;
7027 #define RDMA_RESIZE_CQ_RAMROD_DATA_TOGGLE_BIT_MASK		0x1
7028 #define RDMA_RESIZE_CQ_RAMROD_DATA_TOGGLE_BIT_SHIFT		0
7029 #define RDMA_RESIZE_CQ_RAMROD_DATA_IS_TWO_LEVEL_PBL_MASK	0x1
7030 #define RDMA_RESIZE_CQ_RAMROD_DATA_IS_TWO_LEVEL_PBL_SHIFT	1
7031 #define RDMA_RESIZE_CQ_RAMROD_DATA_VF_ID_VALID_MASK		0x1
7032 #define RDMA_RESIZE_CQ_RAMROD_DATA_VF_ID_VALID_SHIFT		2
7033 #define RDMA_RESIZE_CQ_RAMROD_DATA_RESERVED_MASK		0x1F
7034 #define RDMA_RESIZE_CQ_RAMROD_DATA_RESERVED_SHIFT		3
7035 	u8 pbl_log_page_size;
7036 	__le16 pbl_num_pages;
7037 	__le32 max_cqes;
7038 	struct regpair pbl_addr;
7039 	struct regpair output_params_addr;
7040 	u8 vf_id;
7041 	u8 reserved1[7];
7042 };
7043 
7044 /* The rdma SRQ context */
7045 struct rdma_srq_context {
7046 	struct regpair temp[8];
7047 };
7048 
7049 /* rdma create qp requester ramrod data */
7050 struct rdma_srq_create_ramrod_data {
7051 	u8 flags;
7052 #define RDMA_SRQ_CREATE_RAMROD_DATA_XRC_FLAG_MASK         0x1
7053 #define RDMA_SRQ_CREATE_RAMROD_DATA_XRC_FLAG_SHIFT        0
7054 #define RDMA_SRQ_CREATE_RAMROD_DATA_RESERVED_KEY_EN_MASK  0x1
7055 #define RDMA_SRQ_CREATE_RAMROD_DATA_RESERVED_KEY_EN_SHIFT 1
7056 #define RDMA_SRQ_CREATE_RAMROD_DATA_RESERVED1_MASK        0x3F
7057 #define RDMA_SRQ_CREATE_RAMROD_DATA_RESERVED1_SHIFT       2
7058 	u8 reserved2;
7059 	__le16 xrc_domain;
7060 	__le32 xrc_srq_cq_cid;
7061 	struct regpair pbl_base_addr;
7062 	__le16 pages_in_srq_pbl;
7063 	__le16 pd_id;
7064 	struct rdma_srq_id srq_id;
7065 	__le16 page_size;
7066 	__le16 reserved3;
7067 	__le32 reserved4;
7068 	struct regpair producers_addr;
7069 };
7070 
7071 /* rdma create qp requester ramrod data */
7072 struct rdma_srq_destroy_ramrod_data {
7073 	struct rdma_srq_id srq_id;
7074 	__le32 reserved;
7075 };
7076 
7077 /* rdma create qp requester ramrod data */
7078 struct rdma_srq_modify_ramrod_data {
7079 	struct rdma_srq_id srq_id;
7080 	__le32 wqe_limit;
7081 };
7082 
7083 /* RDMA Tid type enumeration (for register_tid ramrod) */
7084 enum rdma_tid_type {
7085 	RDMA_TID_REGISTERED_MR,
7086 	RDMA_TID_FMR,
7087 	RDMA_TID_MW,
7088 	MAX_RDMA_TID_TYPE
7089 };
7090 
7091 /* The rdma XRC SRQ context */
7092 struct rdma_xrc_srq_context {
7093 	struct regpair temp[9];
7094 };
7095 
7096 struct e4_tstorm_rdma_task_ag_ctx {
7097 	u8 byte0;
7098 	u8 byte1;
7099 	__le16 word0;
7100 	u8 flags0;
7101 #define E4_TSTORM_RDMA_TASK_AG_CTX_NIBBLE0_MASK		0xF
7102 #define E4_TSTORM_RDMA_TASK_AG_CTX_NIBBLE0_SHIFT	0
7103 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT0_MASK		0x1
7104 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT0_SHIFT		4
7105 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT1_MASK		0x1
7106 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT1_SHIFT		5
7107 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT2_MASK		0x1
7108 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT2_SHIFT		6
7109 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT3_MASK		0x1
7110 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT3_SHIFT		7
7111 	u8 flags1;
7112 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT4_MASK	0x1
7113 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT4_SHIFT	0
7114 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT5_MASK	0x1
7115 #define E4_TSTORM_RDMA_TASK_AG_CTX_BIT5_SHIFT	1
7116 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF0_MASK	0x3
7117 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF0_SHIFT	2
7118 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF1_MASK	0x3
7119 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF1_SHIFT	4
7120 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF2_MASK	0x3
7121 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF2_SHIFT	6
7122 	u8 flags2;
7123 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF3_MASK	0x3
7124 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF3_SHIFT	0
7125 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF4_MASK	0x3
7126 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF4_SHIFT	2
7127 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF5_MASK	0x3
7128 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF5_SHIFT	4
7129 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF6_MASK	0x3
7130 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF6_SHIFT	6
7131 	u8 flags3;
7132 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF7_MASK	0x3
7133 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF7_SHIFT	0
7134 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF0EN_MASK	0x1
7135 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF0EN_SHIFT	2
7136 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF1EN_MASK	0x1
7137 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF1EN_SHIFT	3
7138 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF2EN_MASK	0x1
7139 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF2EN_SHIFT	4
7140 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF3EN_MASK	0x1
7141 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF3EN_SHIFT	5
7142 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF4EN_MASK	0x1
7143 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF4EN_SHIFT	6
7144 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF5EN_MASK	0x1
7145 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF5EN_SHIFT	7
7146 	u8 flags4;
7147 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF6EN_MASK		0x1
7148 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF6EN_SHIFT		0
7149 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF7EN_MASK		0x1
7150 #define E4_TSTORM_RDMA_TASK_AG_CTX_CF7EN_SHIFT		1
7151 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE0EN_MASK		0x1
7152 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE0EN_SHIFT	2
7153 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE1EN_MASK		0x1
7154 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE1EN_SHIFT	3
7155 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE2EN_MASK		0x1
7156 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE2EN_SHIFT	4
7157 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE3EN_MASK		0x1
7158 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE3EN_SHIFT	5
7159 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE4EN_MASK		0x1
7160 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE4EN_SHIFT	6
7161 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE5EN_MASK		0x1
7162 #define E4_TSTORM_RDMA_TASK_AG_CTX_RULE5EN_SHIFT	7
7163 	u8 byte2;
7164 	__le16 word1;
7165 	__le32 reg0;
7166 	u8 byte3;
7167 	u8 byte4;
7168 	__le16 word2;
7169 	__le16 word3;
7170 	__le16 word4;
7171 	__le32 reg1;
7172 	__le32 reg2;
7173 };
7174 
7175 struct e4_ustorm_rdma_conn_ag_ctx {
7176 	u8 reserved;
7177 	u8 byte1;
7178 	u8 flags0;
7179 #define E4_USTORM_RDMA_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
7180 #define E4_USTORM_RDMA_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
7181 #define E4_USTORM_RDMA_CONN_AG_CTX_DIF_ERROR_REPORTED_MASK  0x1
7182 #define E4_USTORM_RDMA_CONN_AG_CTX_DIF_ERROR_REPORTED_SHIFT 1
7183 #define E4_USTORM_RDMA_CONN_AG_CTX_FLUSH_Q0_CF_MASK	0x3
7184 #define E4_USTORM_RDMA_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT	2
7185 #define E4_USTORM_RDMA_CONN_AG_CTX_CF1_MASK		0x3
7186 #define E4_USTORM_RDMA_CONN_AG_CTX_CF1_SHIFT		4
7187 #define E4_USTORM_RDMA_CONN_AG_CTX_CF2_MASK		0x3
7188 #define E4_USTORM_RDMA_CONN_AG_CTX_CF2_SHIFT		6
7189 	u8 flags1;
7190 #define E4_USTORM_RDMA_CONN_AG_CTX_CF3_MASK		0x3
7191 #define E4_USTORM_RDMA_CONN_AG_CTX_CF3_SHIFT		0
7192 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_SE_CF_MASK	0x3
7193 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_SE_CF_SHIFT	2
7194 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_CF_MASK	0x3
7195 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_CF_SHIFT	4
7196 #define E4_USTORM_RDMA_CONN_AG_CTX_CF6_MASK		0x3
7197 #define E4_USTORM_RDMA_CONN_AG_CTX_CF6_SHIFT		6
7198 	u8 flags2;
7199 #define E4_USTORM_RDMA_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK		0x1
7200 #define E4_USTORM_RDMA_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT		0
7201 #define E4_USTORM_RDMA_CONN_AG_CTX_CF1EN_MASK			0x1
7202 #define E4_USTORM_RDMA_CONN_AG_CTX_CF1EN_SHIFT			1
7203 #define E4_USTORM_RDMA_CONN_AG_CTX_CF2EN_MASK			0x1
7204 #define E4_USTORM_RDMA_CONN_AG_CTX_CF2EN_SHIFT			2
7205 #define E4_USTORM_RDMA_CONN_AG_CTX_CF3EN_MASK			0x1
7206 #define E4_USTORM_RDMA_CONN_AG_CTX_CF3EN_SHIFT			3
7207 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_SE_CF_EN_MASK		0x1
7208 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_SE_CF_EN_SHIFT	4
7209 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_CF_EN_MASK		0x1
7210 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_ARM_CF_EN_SHIFT		5
7211 #define E4_USTORM_RDMA_CONN_AG_CTX_CF6EN_MASK			0x1
7212 #define E4_USTORM_RDMA_CONN_AG_CTX_CF6EN_SHIFT			6
7213 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_SE_EN_MASK		0x1
7214 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_SE_EN_SHIFT		7
7215 	u8 flags3;
7216 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_EN_MASK		0x1
7217 #define E4_USTORM_RDMA_CONN_AG_CTX_CQ_EN_SHIFT		0
7218 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE2EN_MASK		0x1
7219 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE2EN_SHIFT	1
7220 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE3EN_MASK		0x1
7221 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE3EN_SHIFT	2
7222 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE4EN_MASK		0x1
7223 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE4EN_SHIFT	3
7224 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE5EN_MASK		0x1
7225 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE5EN_SHIFT	4
7226 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE6EN_MASK		0x1
7227 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE6EN_SHIFT	5
7228 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE7EN_MASK		0x1
7229 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE7EN_SHIFT	6
7230 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE8EN_MASK		0x1
7231 #define E4_USTORM_RDMA_CONN_AG_CTX_RULE8EN_SHIFT	7
7232 	u8 byte2;
7233 	u8 nvmf_only;
7234 	__le16 conn_dpi;
7235 	__le16 word1;
7236 	__le32 cq_cons;
7237 	__le32 cq_se_prod;
7238 	__le32 cq_prod;
7239 	__le32 reg3;
7240 	__le16 int_timeout;
7241 	__le16 word3;
7242 };
7243 
7244 struct e4_xstorm_roce_conn_ag_ctx {
7245 	u8 reserved0;
7246 	u8 state;
7247 	u8 flags0;
7248 #define E4_XSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM0_MASK      0x1
7249 #define E4_XSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT     0
7250 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT1_MASK              0x1
7251 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT1_SHIFT             1
7252 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT2_MASK              0x1
7253 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT2_SHIFT             2
7254 #define E4_XSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM3_MASK      0x1
7255 #define E4_XSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT     3
7256 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT4_MASK              0x1
7257 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT4_SHIFT             4
7258 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT5_MASK              0x1
7259 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT5_SHIFT             5
7260 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT6_MASK              0x1
7261 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT6_SHIFT             6
7262 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT7_MASK              0x1
7263 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT7_SHIFT             7
7264 	u8 flags1;
7265 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT8_MASK              0x1
7266 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT8_SHIFT             0
7267 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT9_MASK              0x1
7268 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT9_SHIFT             1
7269 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT10_MASK             0x1
7270 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT10_SHIFT            2
7271 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT11_MASK             0x1
7272 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT11_SHIFT            3
7273 #define E4_XSTORM_ROCE_CONN_AG_CTX_MSDM_FLUSH_MASK        0x1
7274 #define E4_XSTORM_ROCE_CONN_AG_CTX_MSDM_FLUSH_SHIFT       4
7275 #define E4_XSTORM_ROCE_CONN_AG_CTX_MSEM_FLUSH_MASK        0x1
7276 #define E4_XSTORM_ROCE_CONN_AG_CTX_MSEM_FLUSH_SHIFT       5
7277 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT14_MASK	       0x1
7278 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT14_SHIFT	       6
7279 #define E4_XSTORM_ROCE_CONN_AG_CTX_YSTORM_FLUSH_MASK      0x1
7280 #define E4_XSTORM_ROCE_CONN_AG_CTX_YSTORM_FLUSH_SHIFT     7
7281 	u8 flags2;
7282 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF0_MASK               0x3
7283 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF0_SHIFT              0
7284 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF1_MASK               0x3
7285 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF1_SHIFT              2
7286 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF2_MASK               0x3
7287 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF2_SHIFT              4
7288 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF3_MASK               0x3
7289 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF3_SHIFT              6
7290 	u8 flags3;
7291 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF4_MASK               0x3
7292 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF4_SHIFT              0
7293 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF5_MASK               0x3
7294 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF5_SHIFT              2
7295 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF6_MASK               0x3
7296 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF6_SHIFT              4
7297 #define E4_XSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_MASK       0x3
7298 #define E4_XSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT      6
7299 	u8 flags4;
7300 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF8_MASK               0x3
7301 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF8_SHIFT              0
7302 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF9_MASK               0x3
7303 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF9_SHIFT              2
7304 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF10_MASK              0x3
7305 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF10_SHIFT             4
7306 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF11_MASK              0x3
7307 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF11_SHIFT             6
7308 	u8 flags5;
7309 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF12_MASK              0x3
7310 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF12_SHIFT             0
7311 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF13_MASK              0x3
7312 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF13_SHIFT             2
7313 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF14_MASK              0x3
7314 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF14_SHIFT             4
7315 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF15_MASK              0x3
7316 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF15_SHIFT             6
7317 	u8 flags6;
7318 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF16_MASK              0x3
7319 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF16_SHIFT             0
7320 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF17_MASK              0x3
7321 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF17_SHIFT             2
7322 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF18_MASK              0x3
7323 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF18_SHIFT             4
7324 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF19_MASK              0x3
7325 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF19_SHIFT             6
7326 	u8 flags7;
7327 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF20_MASK              0x3
7328 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF20_SHIFT             0
7329 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF21_MASK              0x3
7330 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF21_SHIFT             2
7331 #define E4_XSTORM_ROCE_CONN_AG_CTX_SLOW_PATH_MASK         0x3
7332 #define E4_XSTORM_ROCE_CONN_AG_CTX_SLOW_PATH_SHIFT        4
7333 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF0EN_MASK             0x1
7334 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF0EN_SHIFT            6
7335 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF1EN_MASK             0x1
7336 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF1EN_SHIFT            7
7337 	u8 flags8;
7338 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF2EN_MASK             0x1
7339 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF2EN_SHIFT            0
7340 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF3EN_MASK             0x1
7341 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF3EN_SHIFT            1
7342 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF4EN_MASK             0x1
7343 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF4EN_SHIFT            2
7344 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF5EN_MASK             0x1
7345 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF5EN_SHIFT            3
7346 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF6EN_MASK             0x1
7347 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF6EN_SHIFT            4
7348 #define E4_XSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK    0x1
7349 #define E4_XSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT   5
7350 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF8EN_MASK             0x1
7351 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF8EN_SHIFT            6
7352 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF9EN_MASK             0x1
7353 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF9EN_SHIFT            7
7354 	u8 flags9;
7355 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF10EN_MASK            0x1
7356 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF10EN_SHIFT           0
7357 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF11EN_MASK            0x1
7358 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF11EN_SHIFT           1
7359 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF12EN_MASK            0x1
7360 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF12EN_SHIFT           2
7361 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF13EN_MASK            0x1
7362 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF13EN_SHIFT           3
7363 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF14EN_MASK            0x1
7364 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF14EN_SHIFT           4
7365 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF15EN_MASK            0x1
7366 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF15EN_SHIFT           5
7367 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF16EN_MASK            0x1
7368 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF16EN_SHIFT           6
7369 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF17EN_MASK            0x1
7370 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF17EN_SHIFT           7
7371 	u8 flags10;
7372 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF18EN_MASK            0x1
7373 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF18EN_SHIFT           0
7374 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF19EN_MASK            0x1
7375 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF19EN_SHIFT           1
7376 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF20EN_MASK            0x1
7377 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF20EN_SHIFT           2
7378 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF21EN_MASK            0x1
7379 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF21EN_SHIFT           3
7380 #define E4_XSTORM_ROCE_CONN_AG_CTX_SLOW_PATH_EN_MASK      0x1
7381 #define E4_XSTORM_ROCE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT     4
7382 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF23EN_MASK            0x1
7383 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF23EN_SHIFT           5
7384 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE0EN_MASK           0x1
7385 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE0EN_SHIFT          6
7386 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE1EN_MASK           0x1
7387 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE1EN_SHIFT          7
7388 	u8 flags11;
7389 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE2EN_MASK           0x1
7390 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE2EN_SHIFT          0
7391 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE3EN_MASK           0x1
7392 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE3EN_SHIFT          1
7393 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE4EN_MASK           0x1
7394 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE4EN_SHIFT          2
7395 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE5EN_MASK           0x1
7396 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE5EN_SHIFT          3
7397 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE6EN_MASK           0x1
7398 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE6EN_SHIFT          4
7399 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE7EN_MASK           0x1
7400 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE7EN_SHIFT          5
7401 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED1_MASK      0x1
7402 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED1_SHIFT     6
7403 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE9EN_MASK           0x1
7404 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE9EN_SHIFT          7
7405 	u8 flags12;
7406 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE10EN_MASK          0x1
7407 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE10EN_SHIFT         0
7408 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE11EN_MASK          0x1
7409 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE11EN_SHIFT         1
7410 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED2_MASK      0x1
7411 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED2_SHIFT     2
7412 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED3_MASK      0x1
7413 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED3_SHIFT     3
7414 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE14EN_MASK          0x1
7415 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE14EN_SHIFT         4
7416 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE15EN_MASK          0x1
7417 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE15EN_SHIFT         5
7418 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE16EN_MASK          0x1
7419 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE16EN_SHIFT         6
7420 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE17EN_MASK          0x1
7421 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE17EN_SHIFT         7
7422 	u8 flags13;
7423 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE18EN_MASK          0x1
7424 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE18EN_SHIFT         0
7425 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE19EN_MASK          0x1
7426 #define E4_XSTORM_ROCE_CONN_AG_CTX_RULE19EN_SHIFT         1
7427 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED4_MASK      0x1
7428 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED4_SHIFT     2
7429 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED5_MASK      0x1
7430 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED5_SHIFT     3
7431 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED6_MASK      0x1
7432 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED6_SHIFT     4
7433 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED7_MASK      0x1
7434 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED7_SHIFT     5
7435 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED8_MASK      0x1
7436 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED8_SHIFT     6
7437 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED9_MASK      0x1
7438 #define E4_XSTORM_ROCE_CONN_AG_CTX_A0_RESERVED9_SHIFT     7
7439 	u8 flags14;
7440 #define E4_XSTORM_ROCE_CONN_AG_CTX_MIGRATION_MASK         0x1
7441 #define E4_XSTORM_ROCE_CONN_AG_CTX_MIGRATION_SHIFT        0
7442 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT17_MASK             0x1
7443 #define E4_XSTORM_ROCE_CONN_AG_CTX_BIT17_SHIFT            1
7444 #define E4_XSTORM_ROCE_CONN_AG_CTX_DPM_PORT_NUM_MASK      0x3
7445 #define E4_XSTORM_ROCE_CONN_AG_CTX_DPM_PORT_NUM_SHIFT     2
7446 #define E4_XSTORM_ROCE_CONN_AG_CTX_RESERVED_MASK          0x1
7447 #define E4_XSTORM_ROCE_CONN_AG_CTX_RESERVED_SHIFT         4
7448 #define E4_XSTORM_ROCE_CONN_AG_CTX_ROCE_EDPM_ENABLE_MASK  0x1
7449 #define E4_XSTORM_ROCE_CONN_AG_CTX_ROCE_EDPM_ENABLE_SHIFT 5
7450 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF23_MASK              0x3
7451 #define E4_XSTORM_ROCE_CONN_AG_CTX_CF23_SHIFT             6
7452 	u8 byte2;
7453 	__le16 physical_q0;
7454 	__le16 word1;
7455 	__le16 word2;
7456 	__le16 word3;
7457 	__le16 word4;
7458 	__le16 word5;
7459 	__le16 conn_dpi;
7460 	u8 byte3;
7461 	u8 byte4;
7462 	u8 byte5;
7463 	u8 byte6;
7464 	__le32 reg0;
7465 	__le32 reg1;
7466 	__le32 reg2;
7467 	__le32 snd_nxt_psn;
7468 	__le32 reg4;
7469 	__le32 reg5;
7470 	__le32 reg6;
7471 };
7472 
7473 struct e4_tstorm_roce_conn_ag_ctx {
7474 	u8 reserved0;
7475 	u8 byte1;
7476 	u8 flags0;
7477 #define E4_TSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM0_MASK          0x1
7478 #define E4_TSTORM_ROCE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT         0
7479 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT1_MASK                  0x1
7480 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT1_SHIFT                 1
7481 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT2_MASK                  0x1
7482 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT2_SHIFT                 2
7483 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT3_MASK                  0x1
7484 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT3_SHIFT                 3
7485 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT4_MASK                  0x1
7486 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT4_SHIFT                 4
7487 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT5_MASK                  0x1
7488 #define E4_TSTORM_ROCE_CONN_AG_CTX_BIT5_SHIFT                 5
7489 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF0_MASK                   0x3
7490 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF0_SHIFT                  6
7491 	u8 flags1;
7492 #define E4_TSTORM_ROCE_CONN_AG_CTX_MSTORM_FLUSH_CF_MASK       0x3
7493 #define E4_TSTORM_ROCE_CONN_AG_CTX_MSTORM_FLUSH_CF_SHIFT      0
7494 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF2_MASK                   0x3
7495 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF2_SHIFT                  2
7496 #define E4_TSTORM_ROCE_CONN_AG_CTX_TIMER_STOP_ALL_CF_MASK     0x3
7497 #define E4_TSTORM_ROCE_CONN_AG_CTX_TIMER_STOP_ALL_CF_SHIFT    4
7498 #define E4_TSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_MASK           0x3
7499 #define E4_TSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT          6
7500 	u8 flags2;
7501 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF5_MASK                   0x3
7502 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF5_SHIFT                  0
7503 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF6_MASK                   0x3
7504 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF6_SHIFT                  2
7505 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF7_MASK                   0x3
7506 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF7_SHIFT                  4
7507 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF8_MASK                   0x3
7508 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF8_SHIFT                  6
7509 	u8 flags3;
7510 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF9_MASK                   0x3
7511 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF9_SHIFT                  0
7512 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF10_MASK                  0x3
7513 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF10_SHIFT                 2
7514 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF0EN_MASK                 0x1
7515 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF0EN_SHIFT                4
7516 #define E4_TSTORM_ROCE_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_MASK    0x1
7517 #define E4_TSTORM_ROCE_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_SHIFT   5
7518 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF2EN_MASK                 0x1
7519 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF2EN_SHIFT                6
7520 #define E4_TSTORM_ROCE_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_MASK  0x1
7521 #define E4_TSTORM_ROCE_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_SHIFT 7
7522 	u8 flags4;
7523 #define E4_TSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK        0x1
7524 #define E4_TSTORM_ROCE_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT       0
7525 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF5EN_MASK                 0x1
7526 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF5EN_SHIFT                1
7527 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF6EN_MASK                 0x1
7528 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF6EN_SHIFT                2
7529 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF7EN_MASK                 0x1
7530 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF7EN_SHIFT                3
7531 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF8EN_MASK                 0x1
7532 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF8EN_SHIFT                4
7533 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF9EN_MASK                 0x1
7534 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF9EN_SHIFT                5
7535 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF10EN_MASK                0x1
7536 #define E4_TSTORM_ROCE_CONN_AG_CTX_CF10EN_SHIFT               6
7537 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE0EN_MASK               0x1
7538 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE0EN_SHIFT              7
7539 	u8 flags5;
7540 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE1EN_MASK               0x1
7541 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE1EN_SHIFT              0
7542 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE2EN_MASK               0x1
7543 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE2EN_SHIFT              1
7544 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE3EN_MASK               0x1
7545 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE3EN_SHIFT              2
7546 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE4EN_MASK               0x1
7547 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE4EN_SHIFT              3
7548 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE5EN_MASK               0x1
7549 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE5EN_SHIFT              4
7550 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE6EN_MASK               0x1
7551 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE6EN_SHIFT              5
7552 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE7EN_MASK               0x1
7553 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE7EN_SHIFT              6
7554 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE8EN_MASK               0x1
7555 #define E4_TSTORM_ROCE_CONN_AG_CTX_RULE8EN_SHIFT              7
7556 	__le32 reg0;
7557 	__le32 reg1;
7558 	__le32 reg2;
7559 	__le32 reg3;
7560 	__le32 reg4;
7561 	__le32 reg5;
7562 	__le32 reg6;
7563 	__le32 reg7;
7564 	__le32 reg8;
7565 	u8 byte2;
7566 	u8 byte3;
7567 	__le16 word0;
7568 	u8 byte4;
7569 	u8 byte5;
7570 	__le16 word1;
7571 	__le16 word2;
7572 	__le16 word3;
7573 	__le32 reg9;
7574 	__le32 reg10;
7575 };
7576 
7577 /* The roce storm context of Ystorm */
7578 struct ystorm_roce_conn_st_ctx {
7579 	struct regpair temp[2];
7580 };
7581 
7582 /* The roce storm context of Mstorm */
7583 struct pstorm_roce_conn_st_ctx {
7584 	struct regpair temp[16];
7585 };
7586 
7587 /* The roce storm context of Xstorm */
7588 struct xstorm_roce_conn_st_ctx {
7589 	struct regpair temp[24];
7590 };
7591 
7592 /* The roce storm context of Tstorm */
7593 struct tstorm_roce_conn_st_ctx {
7594 	struct regpair temp[30];
7595 };
7596 
7597 /* The roce storm context of Mstorm */
7598 struct mstorm_roce_conn_st_ctx {
7599 	struct regpair temp[6];
7600 };
7601 
7602 /* The roce storm context of Ustorm */
7603 struct ustorm_roce_conn_st_ctx {
7604 	struct regpair temp[14];
7605 };
7606 
7607 /* roce connection context */
7608 struct e4_roce_conn_context {
7609 	struct ystorm_roce_conn_st_ctx ystorm_st_context;
7610 	struct regpair ystorm_st_padding[2];
7611 	struct pstorm_roce_conn_st_ctx pstorm_st_context;
7612 	struct xstorm_roce_conn_st_ctx xstorm_st_context;
7613 	struct e4_xstorm_roce_conn_ag_ctx xstorm_ag_context;
7614 	struct e4_tstorm_roce_conn_ag_ctx tstorm_ag_context;
7615 	struct timers_context timer_context;
7616 	struct e4_ustorm_rdma_conn_ag_ctx ustorm_ag_context;
7617 	struct tstorm_roce_conn_st_ctx tstorm_st_context;
7618 	struct regpair tstorm_st_padding[2];
7619 	struct mstorm_roce_conn_st_ctx mstorm_st_context;
7620 	struct regpair mstorm_st_padding[2];
7621 	struct ustorm_roce_conn_st_ctx ustorm_st_context;
7622 	struct regpair ustorm_st_padding[2];
7623 };
7624 
7625 /* roce cqes statistics */
7626 struct roce_cqe_stats {
7627 	__le32 req_cqe_error;
7628 	__le32 req_remote_access_errors;
7629 	__le32 req_remote_invalid_request;
7630 	__le32 resp_cqe_error;
7631 	__le32 resp_local_length_error;
7632 	__le32 reserved;
7633 };
7634 
7635 /* roce create qp requester ramrod data */
7636 struct roce_create_qp_req_ramrod_data {
7637 	__le16 flags;
7638 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_ROCE_FLAVOR_MASK			0x3
7639 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_ROCE_FLAVOR_SHIFT		0
7640 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_FMR_AND_RESERVED_EN_MASK		0x1
7641 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_FMR_AND_RESERVED_EN_SHIFT	2
7642 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_SIGNALED_COMP_MASK		0x1
7643 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_SIGNALED_COMP_SHIFT		3
7644 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_PRI_MASK				0x7
7645 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_PRI_SHIFT			4
7646 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_XRC_FLAG_MASK			0x1
7647 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_XRC_FLAG_SHIFT			7
7648 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_MASK		0xF
7649 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_SHIFT		8
7650 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_MASK			0xF
7651 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_SHIFT		12
7652 	u8 max_ord;
7653 	u8 traffic_class;
7654 	u8 hop_limit;
7655 	u8 orq_num_pages;
7656 	__le16 p_key;
7657 	__le32 flow_label;
7658 	__le32 dst_qp_id;
7659 	__le32 ack_timeout_val;
7660 	__le32 initial_psn;
7661 	__le16 mtu;
7662 	__le16 pd;
7663 	__le16 sq_num_pages;
7664 	__le16 low_latency_phy_queue;
7665 	struct regpair sq_pbl_addr;
7666 	struct regpair orq_pbl_addr;
7667 	__le16 local_mac_addr[3];
7668 	__le16 remote_mac_addr[3];
7669 	__le16 vlan_id;
7670 	__le16 udp_src_port;
7671 	__le32 src_gid[4];
7672 	__le32 dst_gid[4];
7673 	__le32 cq_cid;
7674 	struct regpair qp_handle_for_cqe;
7675 	struct regpair qp_handle_for_async;
7676 	u8 stats_counter_id;
7677 	u8 vf_id;
7678 	u8 vport_id;
7679 	u8 flags2;
7680 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_EDPM_MODE_MASK			0x1
7681 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_EDPM_MODE_SHIFT			0
7682 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_VF_ID_VALID_MASK			0x1
7683 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_VF_ID_VALID_SHIFT		1
7684 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_RESERVED_MASK			0x3F
7685 #define ROCE_CREATE_QP_REQ_RAMROD_DATA_RESERVED_SHIFT			2
7686 	u8 name_space;
7687 	u8 reserved3[3];
7688 	__le16 regular_latency_phy_queue;
7689 	__le16 dpi;
7690 };
7691 
7692 /* roce create qp responder ramrod data */
7693 struct roce_create_qp_resp_ramrod_data {
7694 	__le32 flags;
7695 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_ROCE_FLAVOR_MASK		0x3
7696 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_ROCE_FLAVOR_SHIFT		0
7697 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RDMA_RD_EN_MASK			0x1
7698 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RDMA_RD_EN_SHIFT		2
7699 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RDMA_WR_EN_MASK			0x1
7700 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RDMA_WR_EN_SHIFT		3
7701 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_ATOMIC_EN_MASK			0x1
7702 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_ATOMIC_EN_SHIFT			4
7703 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_SRQ_FLG_MASK			0x1
7704 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_SRQ_FLG_SHIFT			5
7705 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_E2E_FLOW_CONTROL_EN_MASK	0x1
7706 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_E2E_FLOW_CONTROL_EN_SHIFT	6
7707 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RESERVED_KEY_EN_MASK		0x1
7708 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RESERVED_KEY_EN_SHIFT		7
7709 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_PRI_MASK			0x7
7710 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_PRI_SHIFT			8
7711 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_MASK		0x1F
7712 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_SHIFT		11
7713 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_XRC_FLAG_MASK             0x1
7714 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_XRC_FLAG_SHIFT            16
7715 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_VF_ID_VALID_MASK	0x1
7716 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_VF_ID_VALID_SHIFT	17
7717 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RESERVED_MASK		0x3FFF
7718 #define ROCE_CREATE_QP_RESP_RAMROD_DATA_RESERVED_SHIFT		18
7719 	__le16 xrc_domain;
7720 	u8 max_ird;
7721 	u8 traffic_class;
7722 	u8 hop_limit;
7723 	u8 irq_num_pages;
7724 	__le16 p_key;
7725 	__le32 flow_label;
7726 	__le32 dst_qp_id;
7727 	u8 stats_counter_id;
7728 	u8 reserved1;
7729 	__le16 mtu;
7730 	__le32 initial_psn;
7731 	__le16 pd;
7732 	__le16 rq_num_pages;
7733 	struct rdma_srq_id srq_id;
7734 	struct regpair rq_pbl_addr;
7735 	struct regpair irq_pbl_addr;
7736 	__le16 local_mac_addr[3];
7737 	__le16 remote_mac_addr[3];
7738 	__le16 vlan_id;
7739 	__le16 udp_src_port;
7740 	__le32 src_gid[4];
7741 	__le32 dst_gid[4];
7742 	struct regpair qp_handle_for_cqe;
7743 	struct regpair qp_handle_for_async;
7744 	__le16 low_latency_phy_queue;
7745 	u8 vf_id;
7746 	u8 vport_id;
7747 	__le32 cq_cid;
7748 	__le16 regular_latency_phy_queue;
7749 	__le16 dpi;
7750 	__le32 src_qp_id;
7751 	u8 name_space;
7752 	u8 reserved3[3];
7753 };
7754 
7755 /* roce DCQCN received statistics */
7756 struct roce_dcqcn_received_stats {
7757 	struct regpair ecn_pkt_rcv;
7758 	struct regpair cnp_pkt_rcv;
7759 };
7760 
7761 /* roce DCQCN sent statistics */
7762 struct roce_dcqcn_sent_stats {
7763 	struct regpair cnp_pkt_sent;
7764 };
7765 
7766 /* RoCE destroy qp requester output params */
7767 struct roce_destroy_qp_req_output_params {
7768 	__le32 cq_prod;
7769 	__le32 reserved;
7770 };
7771 
7772 /* RoCE destroy qp requester ramrod data */
7773 struct roce_destroy_qp_req_ramrod_data {
7774 	struct regpair output_params_addr;
7775 };
7776 
7777 /* RoCE destroy qp responder output params */
7778 struct roce_destroy_qp_resp_output_params {
7779 	__le32 cq_prod;
7780 	__le32 reserved;
7781 };
7782 
7783 /* RoCE destroy qp responder ramrod data */
7784 struct roce_destroy_qp_resp_ramrod_data {
7785 	struct regpair output_params_addr;
7786 	__le32 src_qp_id;
7787 	__le32 reserved;
7788 };
7789 
7790 /* roce error statistics */
7791 struct roce_error_stats {
7792 	__le32 resp_remote_access_errors;
7793 	__le32 reserved;
7794 };
7795 
7796 /* roce special events statistics */
7797 struct roce_events_stats {
7798 	__le32 silent_drops;
7799 	__le32 rnr_naks_sent;
7800 	__le32 retransmit_count;
7801 	__le32 icrc_error_count;
7802 	__le32 implied_nak_seq_err;
7803 	__le32 duplicate_request;
7804 	__le32 local_ack_timeout_err;
7805 	__le32 out_of_sequence;
7806 	__le32 packet_seq_err;
7807 	__le32 rnr_nak_retry_err;
7808 };
7809 
7810 /* roce slow path EQ cmd IDs */
7811 enum roce_event_opcode {
7812 	ROCE_EVENT_CREATE_QP = 11,
7813 	ROCE_EVENT_MODIFY_QP,
7814 	ROCE_EVENT_QUERY_QP,
7815 	ROCE_EVENT_DESTROY_QP,
7816 	ROCE_EVENT_CREATE_UD_QP,
7817 	ROCE_EVENT_DESTROY_UD_QP,
7818 	ROCE_EVENT_FUNC_UPDATE,
7819 	MAX_ROCE_EVENT_OPCODE
7820 };
7821 
7822 /* roce func init ramrod data */
7823 struct roce_init_func_params {
7824 	u8 ll2_queue_id;
7825 	u8 cnp_vlan_priority;
7826 	u8 cnp_dscp;
7827 	u8 flags;
7828 #define ROCE_INIT_FUNC_PARAMS_DCQCN_NP_EN_MASK		0x1
7829 #define ROCE_INIT_FUNC_PARAMS_DCQCN_NP_EN_SHIFT		0
7830 #define ROCE_INIT_FUNC_PARAMS_DCQCN_RP_EN_MASK		0x1
7831 #define ROCE_INIT_FUNC_PARAMS_DCQCN_RP_EN_SHIFT		1
7832 #define ROCE_INIT_FUNC_PARAMS_RESERVED0_MASK		0x3F
7833 #define ROCE_INIT_FUNC_PARAMS_RESERVED0_SHIFT		2
7834 	__le32 cnp_send_timeout;
7835 	__le16 rl_offset;
7836 	u8 rl_count_log;
7837 	u8 reserved1[5];
7838 };
7839 
7840 /* roce func init ramrod data */
7841 struct roce_init_func_ramrod_data {
7842 	struct rdma_init_func_ramrod_data rdma;
7843 	struct roce_init_func_params roce;
7844 };
7845 
7846 /* roce modify qp requester ramrod data */
7847 struct roce_modify_qp_req_ramrod_data {
7848 	__le16 flags;
7849 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MOVE_TO_ERR_FLG_MASK		0x1
7850 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MOVE_TO_ERR_FLG_SHIFT		0
7851 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MOVE_TO_SQD_FLG_MASK		0x1
7852 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MOVE_TO_SQD_FLG_SHIFT		1
7853 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_EN_SQD_ASYNC_NOTIFY_MASK		0x1
7854 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_EN_SQD_ASYNC_NOTIFY_SHIFT	2
7855 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_P_KEY_FLG_MASK			0x1
7856 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_P_KEY_FLG_SHIFT			3
7857 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ADDRESS_VECTOR_FLG_MASK		0x1
7858 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ADDRESS_VECTOR_FLG_SHIFT		4
7859 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MAX_ORD_FLG_MASK			0x1
7860 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_MAX_ORD_FLG_SHIFT		5
7861 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_FLG_MASK		0x1
7862 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_FLG_SHIFT		6
7863 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_FLG_MASK		0x1
7864 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_FLG_SHIFT		7
7865 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ACK_TIMEOUT_FLG_MASK		0x1
7866 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ACK_TIMEOUT_FLG_SHIFT		8
7867 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PRI_FLG_MASK			0x1
7868 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PRI_FLG_SHIFT			9
7869 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PRI_MASK				0x7
7870 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PRI_SHIFT			10
7871 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PHYSICAL_QUEUE_FLG_MASK		0x1
7872 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_PHYSICAL_QUEUE_FLG_SHIFT		13
7873 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RESERVED1_MASK			0x3
7874 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RESERVED1_SHIFT			14
7875 	u8 fields;
7876 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_MASK	0xF
7877 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_ERR_RETRY_CNT_SHIFT	0
7878 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_MASK		0xF
7879 #define ROCE_MODIFY_QP_REQ_RAMROD_DATA_RNR_NAK_CNT_SHIFT	4
7880 	u8 max_ord;
7881 	u8 traffic_class;
7882 	u8 hop_limit;
7883 	__le16 p_key;
7884 	__le32 flow_label;
7885 	__le32 ack_timeout_val;
7886 	__le16 mtu;
7887 	__le16 reserved2;
7888 	__le32 reserved3[2];
7889 	__le16 low_latency_phy_queue;
7890 	__le16 regular_latency_phy_queue;
7891 	__le32 src_gid[4];
7892 	__le32 dst_gid[4];
7893 };
7894 
7895 /* roce modify qp responder ramrod data */
7896 struct roce_modify_qp_resp_ramrod_data {
7897 	__le16 flags;
7898 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MOVE_TO_ERR_FLG_MASK		0x1
7899 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MOVE_TO_ERR_FLG_SHIFT		0
7900 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_RD_EN_MASK			0x1
7901 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_RD_EN_SHIFT		1
7902 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_WR_EN_MASK			0x1
7903 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_WR_EN_SHIFT		2
7904 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_ATOMIC_EN_MASK			0x1
7905 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_ATOMIC_EN_SHIFT			3
7906 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_P_KEY_FLG_MASK			0x1
7907 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_P_KEY_FLG_SHIFT			4
7908 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_ADDRESS_VECTOR_FLG_MASK		0x1
7909 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_ADDRESS_VECTOR_FLG_SHIFT	5
7910 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MAX_IRD_FLG_MASK		0x1
7911 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MAX_IRD_FLG_SHIFT		6
7912 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PRI_FLG_MASK			0x1
7913 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PRI_FLG_SHIFT			7
7914 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_FLG_MASK	0x1
7915 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_FLG_SHIFT	8
7916 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_OPS_EN_FLG_MASK		0x1
7917 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RDMA_OPS_EN_FLG_SHIFT		9
7918 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PHYSICAL_QUEUE_FLG_MASK		0x1
7919 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PHYSICAL_QUEUE_FLG_SHIFT	10
7920 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RESERVED1_MASK			0x1F
7921 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_RESERVED1_SHIFT			11
7922 	u8 fields;
7923 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PRI_MASK		0x7
7924 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_PRI_SHIFT		0
7925 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_MASK	0x1F
7926 #define ROCE_MODIFY_QP_RESP_RAMROD_DATA_MIN_RNR_NAK_TIMER_SHIFT	3
7927 	u8 max_ird;
7928 	u8 traffic_class;
7929 	u8 hop_limit;
7930 	__le16 p_key;
7931 	__le32 flow_label;
7932 	__le16 mtu;
7933 	__le16 low_latency_phy_queue;
7934 	__le16 regular_latency_phy_queue;
7935 	u8 reserved2[6];
7936 	__le32 src_gid[4];
7937 	__le32 dst_gid[4];
7938 };
7939 
7940 /* RoCE query qp requester output params */
7941 struct roce_query_qp_req_output_params {
7942 	__le32 psn;
7943 	__le32 flags;
7944 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_ERR_FLG_MASK		0x1
7945 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_ERR_FLG_SHIFT		0
7946 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_SQ_DRAINING_FLG_MASK	0x1
7947 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_SQ_DRAINING_FLG_SHIFT	1
7948 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_RESERVED0_MASK		0x3FFFFFFF
7949 #define ROCE_QUERY_QP_REQ_OUTPUT_PARAMS_RESERVED0_SHIFT		2
7950 };
7951 
7952 /* RoCE query qp requester ramrod data */
7953 struct roce_query_qp_req_ramrod_data {
7954 	struct regpair output_params_addr;
7955 };
7956 
7957 /* RoCE query qp responder output params */
7958 struct roce_query_qp_resp_output_params {
7959 	__le32 psn;
7960 	__le32 flags;
7961 #define ROCE_QUERY_QP_RESP_OUTPUT_PARAMS_ERROR_FLG_MASK  0x1
7962 #define ROCE_QUERY_QP_RESP_OUTPUT_PARAMS_ERROR_FLG_SHIFT 0
7963 #define ROCE_QUERY_QP_RESP_OUTPUT_PARAMS_RESERVED0_MASK  0x7FFFFFFF
7964 #define ROCE_QUERY_QP_RESP_OUTPUT_PARAMS_RESERVED0_SHIFT 1
7965 };
7966 
7967 /* RoCE query qp responder ramrod data */
7968 struct roce_query_qp_resp_ramrod_data {
7969 	struct regpair output_params_addr;
7970 };
7971 
7972 /* ROCE ramrod command IDs */
7973 enum roce_ramrod_cmd_id {
7974 	ROCE_RAMROD_CREATE_QP = 11,
7975 	ROCE_RAMROD_MODIFY_QP,
7976 	ROCE_RAMROD_QUERY_QP,
7977 	ROCE_RAMROD_DESTROY_QP,
7978 	ROCE_RAMROD_CREATE_UD_QP,
7979 	ROCE_RAMROD_DESTROY_UD_QP,
7980 	ROCE_RAMROD_FUNC_UPDATE,
7981 	MAX_ROCE_RAMROD_CMD_ID
7982 };
7983 
7984 /* RoCE func init ramrod data */
7985 struct roce_update_func_params {
7986 	u8 cnp_vlan_priority;
7987 	u8 cnp_dscp;
7988 	__le16 flags;
7989 #define ROCE_UPDATE_FUNC_PARAMS_DCQCN_NP_EN_MASK	0x1
7990 #define ROCE_UPDATE_FUNC_PARAMS_DCQCN_NP_EN_SHIFT	0
7991 #define ROCE_UPDATE_FUNC_PARAMS_DCQCN_RP_EN_MASK	0x1
7992 #define ROCE_UPDATE_FUNC_PARAMS_DCQCN_RP_EN_SHIFT	1
7993 #define ROCE_UPDATE_FUNC_PARAMS_RESERVED0_MASK		0x3FFF
7994 #define ROCE_UPDATE_FUNC_PARAMS_RESERVED0_SHIFT		2
7995 	__le32 cnp_send_timeout;
7996 };
7997 
7998 struct e4_xstorm_roce_conn_ag_ctx_dq_ext_ld_part {
7999 	u8 reserved0;
8000 	u8 state;
8001 	u8 flags0;
8002 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_EXIST_IN_QM0_MASK	0x1
8003 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_EXIST_IN_QM0_SHIFT	0
8004 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT1_MASK		0x1
8005 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT1_SHIFT		1
8006 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT2_MASK		0x1
8007 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT2_SHIFT		2
8008 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_EXIST_IN_QM3_MASK	0x1
8009 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_EXIST_IN_QM3_SHIFT	3
8010 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT4_MASK		0x1
8011 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT4_SHIFT		4
8012 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT5_MASK		0x1
8013 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT5_SHIFT		5
8014 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT6_MASK		0x1
8015 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT6_SHIFT		6
8016 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT7_MASK		0x1
8017 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT7_SHIFT		7
8018 	u8 flags1;
8019 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT8_MASK		0x1
8020 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT8_SHIFT		0
8021 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT9_MASK		0x1
8022 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT9_SHIFT		1
8023 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT10_MASK		0x1
8024 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT10_SHIFT		2
8025 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT11_MASK		0x1
8026 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT11_SHIFT		3
8027 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MSDM_FLUSH_MASK	0x1
8028 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MSDM_FLUSH_SHIFT	4
8029 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MSEM_FLUSH_MASK	0x1
8030 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MSEM_FLUSH_SHIFT	5
8031 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT14_MASK		0x1
8032 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT14_SHIFT		6
8033 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_YSTORM_FLUSH_MASK	0x1
8034 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_YSTORM_FLUSH_SHIFT	7
8035 	u8 flags2;
8036 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF0_MASK	0x3
8037 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF0_SHIFT	0
8038 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF1_MASK	0x3
8039 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF1_SHIFT	2
8040 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF2_MASK	0x3
8041 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF2_SHIFT	4
8042 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF3_MASK	0x3
8043 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF3_SHIFT	6
8044 	u8 flags3;
8045 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF4_MASK		0x3
8046 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF4_SHIFT		0
8047 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF5_MASK		0x3
8048 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF5_SHIFT		2
8049 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF6_MASK		0x3
8050 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF6_SHIFT		4
8051 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_FLUSH_Q0_CF_MASK	0x3
8052 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_FLUSH_Q0_CF_SHIFT	6
8053 	u8 flags4;
8054 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF8_MASK	0x3
8055 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF8_SHIFT	0
8056 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF9_MASK	0x3
8057 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF9_SHIFT	2
8058 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF10_MASK	0x3
8059 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF10_SHIFT	4
8060 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF11_MASK	0x3
8061 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF11_SHIFT	6
8062 	u8 flags5;
8063 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF12_MASK	0x3
8064 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF12_SHIFT	0
8065 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF13_MASK	0x3
8066 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF13_SHIFT	2
8067 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF14_MASK	0x3
8068 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF14_SHIFT	4
8069 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF15_MASK	0x3
8070 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF15_SHIFT	6
8071 	u8 flags6;
8072 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF16_MASK	0x3
8073 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF16_SHIFT	0
8074 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF17_MASK	0x3
8075 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF17_SHIFT	2
8076 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF18_MASK	0x3
8077 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF18_SHIFT	4
8078 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF19_MASK	0x3
8079 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF19_SHIFT	6
8080 	u8 flags7;
8081 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF20_MASK		0x3
8082 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF20_SHIFT		0
8083 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF21_MASK		0x3
8084 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF21_SHIFT		2
8085 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_SLOW_PATH_MASK		0x3
8086 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_SLOW_PATH_SHIFT	4
8087 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF0EN_MASK		0x1
8088 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF0EN_SHIFT		6
8089 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF1EN_MASK		0x1
8090 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF1EN_SHIFT		7
8091 	u8 flags8;
8092 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF2EN_MASK		0x1
8093 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF2EN_SHIFT		0
8094 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF3EN_MASK		0x1
8095 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF3EN_SHIFT		1
8096 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF4EN_MASK		0x1
8097 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF4EN_SHIFT		2
8098 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF5EN_MASK		0x1
8099 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF5EN_SHIFT		3
8100 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF6EN_MASK		0x1
8101 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF6EN_SHIFT		4
8102 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_FLUSH_Q0_CF_EN_MASK	0x1
8103 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_FLUSH_Q0_CF_EN_SHIFT	5
8104 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF8EN_MASK		0x1
8105 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF8EN_SHIFT		6
8106 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF9EN_MASK		0x1
8107 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF9EN_SHIFT		7
8108 	u8 flags9;
8109 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF10EN_MASK	0x1
8110 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF10EN_SHIFT	0
8111 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF11EN_MASK	0x1
8112 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF11EN_SHIFT	1
8113 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF12EN_MASK	0x1
8114 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF12EN_SHIFT	2
8115 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF13EN_MASK	0x1
8116 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF13EN_SHIFT	3
8117 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF14EN_MASK	0x1
8118 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF14EN_SHIFT	4
8119 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF15EN_MASK	0x1
8120 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF15EN_SHIFT	5
8121 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF16EN_MASK	0x1
8122 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF16EN_SHIFT	6
8123 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF17EN_MASK	0x1
8124 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF17EN_SHIFT	7
8125 	u8 flags10;
8126 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF18EN_MASK		0x1
8127 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF18EN_SHIFT		0
8128 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF19EN_MASK		0x1
8129 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF19EN_SHIFT		1
8130 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF20EN_MASK		0x1
8131 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF20EN_SHIFT		2
8132 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF21EN_MASK		0x1
8133 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF21EN_SHIFT		3
8134 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_SLOW_PATH_EN_MASK	0x1
8135 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_SLOW_PATH_EN_SHIFT	4
8136 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF23EN_MASK		0x1
8137 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF23EN_SHIFT		5
8138 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE0EN_MASK		0x1
8139 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE0EN_SHIFT		6
8140 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE1EN_MASK		0x1
8141 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE1EN_SHIFT		7
8142 	u8 flags11;
8143 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE2EN_MASK		0x1
8144 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE2EN_SHIFT		0
8145 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE3EN_MASK		0x1
8146 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE3EN_SHIFT		1
8147 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE4EN_MASK		0x1
8148 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE4EN_SHIFT		2
8149 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE5EN_MASK		0x1
8150 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE5EN_SHIFT		3
8151 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE6EN_MASK		0x1
8152 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE6EN_SHIFT		4
8153 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE7EN_MASK		0x1
8154 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE7EN_SHIFT		5
8155 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED1_MASK	0x1
8156 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED1_SHIFT	6
8157 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE9EN_MASK		0x1
8158 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE9EN_SHIFT		7
8159 	u8 flags12;
8160 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE10EN_MASK		0x1
8161 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE10EN_SHIFT		0
8162 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE11EN_MASK		0x1
8163 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE11EN_SHIFT		1
8164 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED2_MASK	0x1
8165 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED2_SHIFT	2
8166 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED3_MASK	0x1
8167 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED3_SHIFT	3
8168 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE14EN_MASK		0x1
8169 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE14EN_SHIFT		4
8170 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE15EN_MASK		0x1
8171 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE15EN_SHIFT		5
8172 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE16EN_MASK		0x1
8173 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE16EN_SHIFT		6
8174 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE17EN_MASK		0x1
8175 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE17EN_SHIFT		7
8176 	u8 flags13;
8177 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE18EN_MASK		0x1
8178 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE18EN_SHIFT		0
8179 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE19EN_MASK		0x1
8180 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RULE19EN_SHIFT		1
8181 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED4_MASK	0x1
8182 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED4_SHIFT	2
8183 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED5_MASK	0x1
8184 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED5_SHIFT	3
8185 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED6_MASK	0x1
8186 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED6_SHIFT	4
8187 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED7_MASK	0x1
8188 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED7_SHIFT	5
8189 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED8_MASK	0x1
8190 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED8_SHIFT	6
8191 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED9_MASK	0x1
8192 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_A0_RESERVED9_SHIFT	7
8193 	u8 flags14;
8194 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MIGRATION_MASK		0x1
8195 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_MIGRATION_SHIFT	0
8196 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT17_MASK		0x1
8197 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_BIT17_SHIFT		1
8198 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_DPM_PORT_NUM_MASK	0x3
8199 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_DPM_PORT_NUM_SHIFT	2
8200 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RESERVED_MASK		0x1
8201 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_RESERVED_SHIFT		4
8202 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_ROCE_EDPM_ENABLE_MASK	0x1
8203 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_ROCE_EDPM_ENABLE_SHIFT	5
8204 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF23_MASK		0x3
8205 #define E4XSTORMROCECONNAGCTXDQEXTLDPART_CF23_SHIFT		6
8206 	u8 byte2;
8207 	__le16 physical_q0;
8208 	__le16 word1;
8209 	__le16 word2;
8210 	__le16 word3;
8211 	__le16 word4;
8212 	__le16 word5;
8213 	__le16 conn_dpi;
8214 	u8 byte3;
8215 	u8 byte4;
8216 	u8 byte5;
8217 	u8 byte6;
8218 	__le32 reg0;
8219 	__le32 reg1;
8220 	__le32 reg2;
8221 	__le32 snd_nxt_psn;
8222 	__le32 reg4;
8223 };
8224 
8225 struct e4_mstorm_roce_conn_ag_ctx {
8226 	u8 byte0;
8227 	u8 byte1;
8228 	u8 flags0;
8229 #define E4_MSTORM_ROCE_CONN_AG_CTX_BIT0_MASK     0x1
8230 #define E4_MSTORM_ROCE_CONN_AG_CTX_BIT0_SHIFT    0
8231 #define E4_MSTORM_ROCE_CONN_AG_CTX_BIT1_MASK     0x1
8232 #define E4_MSTORM_ROCE_CONN_AG_CTX_BIT1_SHIFT    1
8233 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF0_MASK      0x3
8234 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF0_SHIFT     2
8235 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF1_MASK      0x3
8236 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF1_SHIFT     4
8237 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF2_MASK      0x3
8238 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF2_SHIFT     6
8239 	u8 flags1;
8240 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF0EN_MASK    0x1
8241 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF0EN_SHIFT   0
8242 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF1EN_MASK    0x1
8243 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF1EN_SHIFT   1
8244 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF2EN_MASK    0x1
8245 #define E4_MSTORM_ROCE_CONN_AG_CTX_CF2EN_SHIFT   2
8246 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE0EN_MASK  0x1
8247 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE0EN_SHIFT 3
8248 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE1EN_MASK  0x1
8249 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE1EN_SHIFT 4
8250 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE2EN_MASK  0x1
8251 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE2EN_SHIFT 5
8252 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE3EN_MASK  0x1
8253 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE3EN_SHIFT 6
8254 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE4EN_MASK  0x1
8255 #define E4_MSTORM_ROCE_CONN_AG_CTX_RULE4EN_SHIFT 7
8256 	__le16 word0;
8257 	__le16 word1;
8258 	__le32 reg0;
8259 	__le32 reg1;
8260 };
8261 
8262 struct e4_mstorm_roce_req_conn_ag_ctx {
8263 	u8 byte0;
8264 	u8 byte1;
8265 	u8 flags0;
8266 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_BIT0_MASK	0x1
8267 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_BIT0_SHIFT	0
8268 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_BIT1_MASK	0x1
8269 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_BIT1_SHIFT	1
8270 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF0_MASK		0x3
8271 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF0_SHIFT	2
8272 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF1_MASK		0x3
8273 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF1_SHIFT	4
8274 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF2_MASK		0x3
8275 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF2_SHIFT	6
8276 	u8 flags1;
8277 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_MASK	0x1
8278 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_SHIFT	0
8279 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_MASK	0x1
8280 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_SHIFT	1
8281 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_MASK	0x1
8282 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_SHIFT	2
8283 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_MASK	0x1
8284 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_SHIFT	3
8285 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_MASK	0x1
8286 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_SHIFT	4
8287 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_MASK	0x1
8288 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_SHIFT	5
8289 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_MASK	0x1
8290 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_SHIFT	6
8291 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_MASK	0x1
8292 #define E4_MSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_SHIFT	7
8293 	__le16 word0;
8294 	__le16 word1;
8295 	__le32 reg0;
8296 	__le32 reg1;
8297 };
8298 
8299 struct e4_mstorm_roce_resp_conn_ag_ctx {
8300 	u8 byte0;
8301 	u8 byte1;
8302 	u8 flags0;
8303 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_BIT0_MASK	0x1
8304 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_BIT0_SHIFT	0
8305 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_BIT1_MASK	0x1
8306 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_BIT1_SHIFT	1
8307 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF0_MASK	0x3
8308 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF0_SHIFT	2
8309 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF1_MASK	0x3
8310 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF1_SHIFT	4
8311 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF2_MASK	0x3
8312 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF2_SHIFT	6
8313 	u8 flags1;
8314 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_MASK	0x1
8315 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_SHIFT	0
8316 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_MASK	0x1
8317 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_SHIFT	1
8318 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_MASK	0x1
8319 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_SHIFT	2
8320 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_MASK	0x1
8321 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_SHIFT	3
8322 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_MASK	0x1
8323 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_SHIFT	4
8324 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_MASK	0x1
8325 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_SHIFT	5
8326 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_MASK	0x1
8327 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_SHIFT	6
8328 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_MASK	0x1
8329 #define E4_MSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_SHIFT	7
8330 	__le16 word0;
8331 	__le16 word1;
8332 	__le32 reg0;
8333 	__le32 reg1;
8334 };
8335 
8336 struct e4_tstorm_roce_req_conn_ag_ctx {
8337 	u8 reserved0;
8338 	u8 state;
8339 	u8 flags0;
8340 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM0_MASK		0x1
8341 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM0_SHIFT		0
8342 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_OCCURRED_MASK		0x1
8343 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_OCCURRED_SHIFT		1
8344 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_CQE_ERROR_OCCURRED_MASK	0x1
8345 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_CQE_ERROR_OCCURRED_SHIFT	2
8346 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_BIT3_MASK			0x1
8347 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_BIT3_SHIFT			3
8348 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_MASK		0x1
8349 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_SHIFT		4
8350 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_CACHED_ORQ_MASK			0x1
8351 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_CACHED_ORQ_SHIFT			5
8352 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_CF_MASK			0x3
8353 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_CF_SHIFT			6
8354 	u8 flags1;
8355 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_CF_MASK             0x3
8356 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_CF_SHIFT            0
8357 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_SQ_CF_MASK			0x3
8358 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_SQ_CF_SHIFT		2
8359 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_STOP_ALL_CF_MASK		0x3
8360 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_STOP_ALL_CF_SHIFT		4
8361 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_MASK			0x3
8362 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT		6
8363 	u8 flags2;
8364 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FORCE_COMP_CF_MASK               0x3
8365 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FORCE_COMP_CF_SHIFT              0
8366 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SET_TIMER_CF_MASK	0x3
8367 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SET_TIMER_CF_SHIFT	2
8368 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_ASYNC_ERROR_CF_MASK	0x3
8369 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_ASYNC_ERROR_CF_SHIFT	4
8370 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RXMIT_DONE_CF_MASK	0x3
8371 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RXMIT_DONE_CF_SHIFT	6
8372 	u8 flags3;
8373 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_SCAN_COMPLETED_CF_MASK	0x3
8374 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_SCAN_COMPLETED_CF_SHIFT	0
8375 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SQ_DRAIN_COMPLETED_CF_MASK	0x3
8376 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SQ_DRAIN_COMPLETED_CF_SHIFT	2
8377 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_CF_EN_MASK			0x1
8378 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_CF_EN_SHIFT		4
8379 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_MASK          0x1
8380 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_SHIFT         5
8381 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_SQ_CF_EN_MASK		0x1
8382 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_SQ_CF_EN_SHIFT		6
8383 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_MASK	0x1
8384 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_SHIFT	7
8385 	u8 flags4;
8386 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK		0x1
8387 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT		0
8388 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FORCE_COMP_CF_EN_MASK            0x1
8389 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_FORCE_COMP_CF_EN_SHIFT           1
8390 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SET_TIMER_CF_EN_MASK		0x1
8391 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SET_TIMER_CF_EN_SHIFT		2
8392 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_ASYNC_ERROR_CF_EN_MASK	0x1
8393 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_TX_ASYNC_ERROR_CF_EN_SHIFT	3
8394 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RXMIT_DONE_CF_EN_MASK		0x1
8395 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RXMIT_DONE_CF_EN_SHIFT		4
8396 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_SCAN_COMPLETED_CF_EN_MASK	0x1
8397 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_SCAN_COMPLETED_CF_EN_SHIFT	5
8398 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SQ_DRAIN_COMPLETED_CF_EN_MASK	0x1
8399 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SQ_DRAIN_COMPLETED_CF_EN_SHIFT	6
8400 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_MASK			0x1
8401 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_SHIFT			7
8402 	u8 flags5;
8403 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_MASK		0x1
8404 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_SHIFT		0
8405 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_DIF_CNT_EN_MASK		0x1
8406 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_DIF_CNT_EN_SHIFT		1
8407 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_MASK		0x1
8408 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_SHIFT		2
8409 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_MASK		0x1
8410 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_SHIFT		3
8411 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_MASK		0x1
8412 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_SHIFT		4
8413 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SND_SQ_CONS_EN_MASK	0x1
8414 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_SND_SQ_CONS_EN_SHIFT	5
8415 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE7EN_MASK		0x1
8416 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE7EN_SHIFT		6
8417 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE8EN_MASK		0x1
8418 #define E4_TSTORM_ROCE_REQ_CONN_AG_CTX_RULE8EN_SHIFT		7
8419 	__le32 dif_rxmit_cnt;
8420 	__le32 snd_nxt_psn;
8421 	__le32 snd_max_psn;
8422 	__le32 orq_prod;
8423 	__le32 reg4;
8424 	__le32 dif_acked_cnt;
8425 	__le32 dif_cnt;
8426 	__le32 reg7;
8427 	__le32 reg8;
8428 	u8 tx_cqe_error_type;
8429 	u8 orq_cache_idx;
8430 	__le16 snd_sq_cons_th;
8431 	u8 byte4;
8432 	u8 byte5;
8433 	__le16 snd_sq_cons;
8434 	__le16 conn_dpi;
8435 	__le16 force_comp_cons;
8436 	__le32 dif_rxmit_acked_cnt;
8437 	__le32 reg10;
8438 };
8439 
8440 struct e4_tstorm_roce_resp_conn_ag_ctx {
8441 	u8 byte0;
8442 	u8 state;
8443 	u8 flags0;
8444 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM0_MASK		0x1
8445 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT		0
8446 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_NOTIFY_REQUESTER_MASK	0x1
8447 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_NOTIFY_REQUESTER_SHIFT	1
8448 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT2_MASK			0x1
8449 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT2_SHIFT			2
8450 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT3_MASK			0x1
8451 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT3_SHIFT			3
8452 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_MASK		0x1
8453 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_SHIFT		4
8454 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT5_MASK			0x1
8455 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_BIT5_SHIFT			5
8456 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF0_MASK			0x3
8457 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF0_SHIFT			6
8458 	u8 flags1;
8459 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_CF_MASK            0x3
8460 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_CF_SHIFT           0
8461 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_TX_ERROR_CF_MASK	0x3
8462 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_TX_ERROR_CF_SHIFT	2
8463 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF3_MASK		0x3
8464 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF3_SHIFT		4
8465 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_MASK	0x3
8466 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT	6
8467 	u8 flags2;
8468 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_MASK                0x3
8469 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_SHIFT               0
8470 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF6_MASK		0x3
8471 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF6_SHIFT		2
8472 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF7_MASK		0x3
8473 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF7_SHIFT		4
8474 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF8_MASK		0x3
8475 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF8_SHIFT		6
8476 	u8 flags3;
8477 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF9_MASK		0x3
8478 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF9_SHIFT		0
8479 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF10_MASK		0x3
8480 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF10_SHIFT		2
8481 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_MASK		0x1
8482 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_SHIFT		4
8483 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_MASK         0x1
8484 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_MSTORM_FLUSH_CF_EN_SHIFT        5
8485 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_TX_ERROR_CF_EN_MASK	0x1
8486 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_TX_ERROR_CF_EN_SHIFT	6
8487 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_MASK		0x1
8488 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_SHIFT		7
8489 	u8 flags4;
8490 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK		0x1
8491 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT		0
8492 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_EN_MASK             0x1
8493 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_EN_SHIFT            1
8494 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF6EN_MASK			0x1
8495 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF6EN_SHIFT			2
8496 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF7EN_MASK			0x1
8497 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF7EN_SHIFT			3
8498 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF8EN_MASK			0x1
8499 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF8EN_SHIFT			4
8500 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF9EN_MASK			0x1
8501 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF9EN_SHIFT			5
8502 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF10EN_MASK			0x1
8503 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_CF10EN_SHIFT			6
8504 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_MASK			0x1
8505 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_SHIFT			7
8506 	u8 flags5;
8507 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_MASK		0x1
8508 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_SHIFT		0
8509 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_MASK		0x1
8510 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_SHIFT		1
8511 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_MASK		0x1
8512 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_SHIFT		2
8513 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_MASK		0x1
8514 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_SHIFT		3
8515 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_MASK		0x1
8516 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_SHIFT		4
8517 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RQ_RULE_EN_MASK		0x1
8518 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RQ_RULE_EN_SHIFT	5
8519 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_MASK		0x1
8520 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_SHIFT		6
8521 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE8EN_MASK		0x1
8522 #define E4_TSTORM_ROCE_RESP_CONN_AG_CTX_RULE8EN_SHIFT		7
8523 	__le32 psn_and_rxmit_id_echo;
8524 	__le32 reg1;
8525 	__le32 reg2;
8526 	__le32 reg3;
8527 	__le32 reg4;
8528 	__le32 reg5;
8529 	__le32 reg6;
8530 	__le32 reg7;
8531 	__le32 reg8;
8532 	u8 tx_async_error_type;
8533 	u8 byte3;
8534 	__le16 rq_cons;
8535 	u8 byte4;
8536 	u8 byte5;
8537 	__le16 rq_prod;
8538 	__le16 conn_dpi;
8539 	__le16 irq_cons;
8540 	__le32 reg9;
8541 	__le32 reg10;
8542 };
8543 
8544 struct e4_ustorm_roce_req_conn_ag_ctx {
8545 	u8 byte0;
8546 	u8 byte1;
8547 	u8 flags0;
8548 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_BIT0_MASK	0x1
8549 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_BIT0_SHIFT	0
8550 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_BIT1_MASK	0x1
8551 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_BIT1_SHIFT	1
8552 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF0_MASK		0x3
8553 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF0_SHIFT	2
8554 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF1_MASK		0x3
8555 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF1_SHIFT	4
8556 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF2_MASK		0x3
8557 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF2_SHIFT	6
8558 	u8 flags1;
8559 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF3_MASK		0x3
8560 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF3_SHIFT	0
8561 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF4_MASK		0x3
8562 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF4_SHIFT	2
8563 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF5_MASK		0x3
8564 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF5_SHIFT	4
8565 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF6_MASK		0x3
8566 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF6_SHIFT	6
8567 	u8 flags2;
8568 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_MASK	0x1
8569 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_SHIFT	0
8570 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_MASK	0x1
8571 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_SHIFT	1
8572 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_MASK	0x1
8573 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_SHIFT	2
8574 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF3EN_MASK	0x1
8575 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF3EN_SHIFT	3
8576 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF4EN_MASK	0x1
8577 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF4EN_SHIFT	4
8578 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF5EN_MASK	0x1
8579 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF5EN_SHIFT	5
8580 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF6EN_MASK	0x1
8581 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_CF6EN_SHIFT	6
8582 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_MASK	0x1
8583 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_SHIFT	7
8584 	u8 flags3;
8585 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_MASK	0x1
8586 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_SHIFT	0
8587 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_MASK	0x1
8588 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_SHIFT	1
8589 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_MASK	0x1
8590 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_SHIFT	2
8591 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_MASK	0x1
8592 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_SHIFT	3
8593 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_MASK	0x1
8594 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_SHIFT	4
8595 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE6EN_MASK	0x1
8596 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE6EN_SHIFT	5
8597 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE7EN_MASK	0x1
8598 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE7EN_SHIFT	6
8599 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE8EN_MASK	0x1
8600 #define E4_USTORM_ROCE_REQ_CONN_AG_CTX_RULE8EN_SHIFT	7
8601 	u8 byte2;
8602 	u8 byte3;
8603 	__le16 word0;
8604 	__le16 word1;
8605 	__le32 reg0;
8606 	__le32 reg1;
8607 	__le32 reg2;
8608 	__le32 reg3;
8609 	__le16 word2;
8610 	__le16 word3;
8611 };
8612 
8613 struct e4_ustorm_roce_resp_conn_ag_ctx {
8614 	u8 byte0;
8615 	u8 byte1;
8616 	u8 flags0;
8617 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_BIT0_MASK	0x1
8618 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_BIT0_SHIFT	0
8619 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_BIT1_MASK	0x1
8620 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_BIT1_SHIFT	1
8621 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF0_MASK	0x3
8622 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF0_SHIFT	2
8623 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF1_MASK	0x3
8624 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF1_SHIFT	4
8625 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF2_MASK	0x3
8626 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF2_SHIFT	6
8627 	u8 flags1;
8628 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF3_MASK	0x3
8629 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF3_SHIFT	0
8630 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF4_MASK	0x3
8631 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF4_SHIFT	2
8632 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF5_MASK	0x3
8633 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF5_SHIFT	4
8634 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF6_MASK	0x3
8635 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF6_SHIFT	6
8636 	u8 flags2;
8637 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_MASK	0x1
8638 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_SHIFT	0
8639 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_MASK	0x1
8640 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_SHIFT	1
8641 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_MASK	0x1
8642 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_SHIFT	2
8643 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_MASK	0x1
8644 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_SHIFT	3
8645 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF4EN_MASK	0x1
8646 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF4EN_SHIFT	4
8647 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF5EN_MASK	0x1
8648 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF5EN_SHIFT	5
8649 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF6EN_MASK	0x1
8650 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_CF6EN_SHIFT	6
8651 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_MASK	0x1
8652 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_SHIFT	7
8653 	u8 flags3;
8654 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_MASK	0x1
8655 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_SHIFT	0
8656 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_MASK	0x1
8657 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_SHIFT	1
8658 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_MASK	0x1
8659 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_SHIFT	2
8660 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_MASK	0x1
8661 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_SHIFT	3
8662 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_MASK	0x1
8663 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_SHIFT	4
8664 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE6EN_MASK	0x1
8665 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE6EN_SHIFT	5
8666 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_MASK	0x1
8667 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_SHIFT	6
8668 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE8EN_MASK	0x1
8669 #define E4_USTORM_ROCE_RESP_CONN_AG_CTX_RULE8EN_SHIFT	7
8670 	u8 byte2;
8671 	u8 byte3;
8672 	__le16 word0;
8673 	__le16 word1;
8674 	__le32 reg0;
8675 	__le32 reg1;
8676 	__le32 reg2;
8677 	__le32 reg3;
8678 	__le16 word2;
8679 	__le16 word3;
8680 };
8681 
8682 struct e4_xstorm_roce_req_conn_ag_ctx {
8683 	u8 reserved0;
8684 	u8 state;
8685 	u8 flags0;
8686 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
8687 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
8688 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED1_MASK		0x1
8689 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED1_SHIFT		1
8690 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED2_MASK		0x1
8691 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED2_SHIFT		2
8692 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
8693 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
8694 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED3_MASK		0x1
8695 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED3_SHIFT		4
8696 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED4_MASK		0x1
8697 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED4_SHIFT		5
8698 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED5_MASK		0x1
8699 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED5_SHIFT		6
8700 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED6_MASK		0x1
8701 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED6_SHIFT		7
8702 	u8 flags1;
8703 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED7_MASK		0x1
8704 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED7_SHIFT		0
8705 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED8_MASK		0x1
8706 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED8_SHIFT		1
8707 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT10_MASK		0x1
8708 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT10_SHIFT		2
8709 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT11_MASK		0x1
8710 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT11_SHIFT		3
8711 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MSDM_FLUSH_MASK		0x1
8712 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MSDM_FLUSH_SHIFT		4
8713 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MSEM_FLUSH_MASK		0x1
8714 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MSEM_FLUSH_SHIFT		5
8715 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_STATE_MASK		0x1
8716 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ERROR_STATE_SHIFT	6
8717 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_YSTORM_FLUSH_MASK	0x1
8718 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_YSTORM_FLUSH_SHIFT	7
8719 	u8 flags2;
8720 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF0_MASK		0x3
8721 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF0_SHIFT	0
8722 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF1_MASK		0x3
8723 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF1_SHIFT	2
8724 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF2_MASK		0x3
8725 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF2_SHIFT	4
8726 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF3_MASK		0x3
8727 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF3_SHIFT	6
8728 	u8 flags3;
8729 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_FLUSH_CF_MASK		0x3
8730 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_FLUSH_CF_SHIFT	0
8731 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_CF_MASK		0x3
8732 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_CF_SHIFT	2
8733 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SND_RXMIT_CF_MASK	0x3
8734 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SND_RXMIT_CF_SHIFT	4
8735 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_MASK		0x3
8736 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT	6
8737 	u8 flags4;
8738 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DIF_ERROR_CF_MASK        0x3
8739 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DIF_ERROR_CF_SHIFT       0
8740 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SCAN_SQ_FOR_COMP_CF_MASK     0x3
8741 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SCAN_SQ_FOR_COMP_CF_SHIFT    2
8742 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF10_MASK	0x3
8743 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF10_SHIFT	4
8744 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF11_MASK	0x3
8745 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF11_SHIFT	6
8746 	u8 flags5;
8747 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF12_MASK		0x3
8748 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF12_SHIFT		0
8749 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF13_MASK		0x3
8750 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF13_SHIFT		2
8751 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FMR_ENDED_CF_MASK	0x3
8752 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FMR_ENDED_CF_SHIFT	4
8753 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF15_MASK		0x3
8754 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF15_SHIFT		6
8755 	u8 flags6;
8756 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF16_MASK	0x3
8757 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF16_SHIFT	0
8758 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF17_MASK	0x3
8759 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF17_SHIFT	2
8760 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF18_MASK	0x3
8761 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF18_SHIFT	4
8762 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF19_MASK	0x3
8763 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF19_SHIFT	6
8764 	u8 flags7;
8765 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF20_MASK	0x3
8766 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF20_SHIFT	0
8767 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF21_MASK	0x3
8768 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF21_SHIFT	2
8769 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SLOW_PATH_MASK	0x3
8770 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SLOW_PATH_SHIFT	4
8771 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_MASK	0x1
8772 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_SHIFT	6
8773 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_MASK	0x1
8774 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_SHIFT	7
8775 	u8 flags8;
8776 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_MASK		0x1
8777 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_SHIFT		0
8778 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF3EN_MASK		0x1
8779 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF3EN_SHIFT		1
8780 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_FLUSH_CF_EN_MASK	0x1
8781 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_FLUSH_CF_EN_SHIFT	2
8782 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_CF_EN_MASK	0x1
8783 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RX_ERROR_CF_EN_SHIFT	3
8784 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SND_RXMIT_CF_EN_MASK	0x1
8785 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SND_RXMIT_CF_EN_SHIFT	4
8786 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK	0x1
8787 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT	5
8788 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DIF_ERROR_CF_EN_MASK     0x1
8789 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DIF_ERROR_CF_EN_SHIFT    6
8790 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SCAN_SQ_FOR_COMP_CF_EN_MASK  0x1
8791 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SCAN_SQ_FOR_COMP_CF_EN_SHIFT 7
8792 	u8 flags9;
8793 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF10EN_MASK		0x1
8794 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF10EN_SHIFT		0
8795 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF11EN_MASK		0x1
8796 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF11EN_SHIFT		1
8797 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF12EN_MASK		0x1
8798 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF12EN_SHIFT		2
8799 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF13EN_MASK		0x1
8800 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF13EN_SHIFT		3
8801 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FME_ENDED_CF_EN_MASK	0x1
8802 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_FME_ENDED_CF_EN_SHIFT	4
8803 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF15EN_MASK		0x1
8804 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF15EN_SHIFT		5
8805 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF16EN_MASK		0x1
8806 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF16EN_SHIFT		6
8807 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF17EN_MASK		0x1
8808 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF17EN_SHIFT		7
8809 	u8 flags10;
8810 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF18EN_MASK		0x1
8811 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF18EN_SHIFT		0
8812 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF19EN_MASK		0x1
8813 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF19EN_SHIFT		1
8814 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF20EN_MASK		0x1
8815 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF20EN_SHIFT		2
8816 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF21EN_MASK		0x1
8817 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF21EN_SHIFT		3
8818 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SLOW_PATH_EN_MASK	0x1
8819 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SLOW_PATH_EN_SHIFT	4
8820 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF23EN_MASK		0x1
8821 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF23EN_SHIFT		5
8822 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_MASK		0x1
8823 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_SHIFT		6
8824 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_MASK		0x1
8825 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_SHIFT		7
8826 	u8 flags11;
8827 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_MASK		0x1
8828 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_SHIFT		0
8829 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_MASK		0x1
8830 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_SHIFT		1
8831 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_MASK		0x1
8832 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_SHIFT		2
8833 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_MASK		0x1
8834 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE5EN_SHIFT		3
8835 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE6EN_MASK		0x1
8836 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE6EN_SHIFT		4
8837 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_E2E_CREDIT_RULE_EN_MASK	0x1
8838 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_E2E_CREDIT_RULE_EN_SHIFT	5
8839 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
8840 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
8841 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE9EN_MASK		0x1
8842 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE9EN_SHIFT		7
8843 	u8 flags12;
8844 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_PROD_EN_MASK		0x1
8845 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_SQ_PROD_EN_SHIFT		0
8846 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE11EN_MASK		0x1
8847 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE11EN_SHIFT		1
8848 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
8849 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
8850 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
8851 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
8852 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_INV_FENCE_RULE_EN_MASK	0x1
8853 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_INV_FENCE_RULE_EN_SHIFT	4
8854 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE15EN_MASK		0x1
8855 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE15EN_SHIFT		5
8856 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ORQ_FENCE_RULE_EN_MASK	0x1
8857 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ORQ_FENCE_RULE_EN_SHIFT	6
8858 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MAX_ORD_RULE_EN_MASK	0x1
8859 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MAX_ORD_RULE_EN_SHIFT	7
8860 	u8 flags13;
8861 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE18EN_MASK		0x1
8862 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE18EN_SHIFT		0
8863 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE19EN_MASK		0x1
8864 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RULE19EN_SHIFT		1
8865 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED4_MASK	0x1
8866 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED4_SHIFT	2
8867 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED5_MASK	0x1
8868 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED5_SHIFT	3
8869 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED6_MASK	0x1
8870 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED6_SHIFT	4
8871 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED7_MASK	0x1
8872 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED7_SHIFT	5
8873 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED8_MASK	0x1
8874 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED8_SHIFT	6
8875 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED9_MASK	0x1
8876 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_A0_RESERVED9_SHIFT	7
8877 	u8 flags14;
8878 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MIGRATION_FLAG_MASK	0x1
8879 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_MIGRATION_FLAG_SHIFT	0
8880 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT17_MASK		0x1
8881 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_BIT17_SHIFT		1
8882 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DPM_PORT_NUM_MASK	0x3
8883 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_DPM_PORT_NUM_SHIFT	2
8884 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED_MASK		0x1
8885 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_RESERVED_SHIFT		4
8886 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ROCE_EDPM_ENABLE_MASK	0x1
8887 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_ROCE_EDPM_ENABLE_SHIFT	5
8888 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF23_MASK		0x3
8889 #define E4_XSTORM_ROCE_REQ_CONN_AG_CTX_CF23_SHIFT		6
8890 	u8 byte2;
8891 	__le16 physical_q0;
8892 	__le16 word1;
8893 	__le16 sq_cmp_cons;
8894 	__le16 sq_cons;
8895 	__le16 sq_prod;
8896 	__le16 dif_error_first_sq_cons;
8897 	__le16 conn_dpi;
8898 	u8 dif_error_sge_index;
8899 	u8 byte4;
8900 	u8 byte5;
8901 	u8 byte6;
8902 	__le32 lsn;
8903 	__le32 ssn;
8904 	__le32 snd_una_psn;
8905 	__le32 snd_nxt_psn;
8906 	__le32 dif_error_offset;
8907 	__le32 orq_cons_th;
8908 	__le32 orq_cons;
8909 };
8910 
8911 struct e4_xstorm_roce_resp_conn_ag_ctx {
8912 	u8 reserved0;
8913 	u8 state;
8914 	u8 flags0;
8915 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
8916 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
8917 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED1_MASK		0x1
8918 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED1_SHIFT		1
8919 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED2_MASK		0x1
8920 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED2_SHIFT		2
8921 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
8922 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
8923 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED3_MASK		0x1
8924 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED3_SHIFT		4
8925 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED4_MASK		0x1
8926 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED4_SHIFT		5
8927 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED5_MASK		0x1
8928 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED5_SHIFT		6
8929 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED6_MASK		0x1
8930 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED6_SHIFT		7
8931 	u8 flags1;
8932 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED7_MASK		0x1
8933 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED7_SHIFT		0
8934 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED8_MASK		0x1
8935 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RESERVED8_SHIFT		1
8936 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT10_MASK		0x1
8937 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT10_SHIFT		2
8938 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT11_MASK		0x1
8939 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT11_SHIFT		3
8940 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_MSDM_FLUSH_MASK		0x1
8941 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_MSDM_FLUSH_SHIFT	4
8942 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_MSEM_FLUSH_MASK		0x1
8943 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_MSEM_FLUSH_SHIFT	5
8944 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_ERROR_STATE_MASK	0x1
8945 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_ERROR_STATE_SHIFT	6
8946 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_YSTORM_FLUSH_MASK	0x1
8947 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_YSTORM_FLUSH_SHIFT	7
8948 	u8 flags2;
8949 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF0_MASK	0x3
8950 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF0_SHIFT	0
8951 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF1_MASK	0x3
8952 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF1_SHIFT	2
8953 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF2_MASK	0x3
8954 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF2_SHIFT	4
8955 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF3_MASK	0x3
8956 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF3_SHIFT	6
8957 	u8 flags3;
8958 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RXMIT_CF_MASK		0x3
8959 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RXMIT_CF_SHIFT		0
8960 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_MASK	0x3
8961 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_SHIFT	2
8962 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FORCE_ACK_CF_MASK	0x3
8963 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FORCE_ACK_CF_SHIFT	4
8964 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_MASK	0x3
8965 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT	6
8966 	u8 flags4;
8967 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF8_MASK	0x3
8968 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF8_SHIFT	0
8969 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF9_MASK	0x3
8970 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF9_SHIFT	2
8971 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF10_MASK	0x3
8972 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF10_SHIFT	4
8973 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF11_MASK	0x3
8974 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF11_SHIFT	6
8975 	u8 flags5;
8976 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF12_MASK	0x3
8977 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF12_SHIFT	0
8978 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF13_MASK	0x3
8979 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF13_SHIFT	2
8980 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF14_MASK	0x3
8981 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF14_SHIFT	4
8982 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF15_MASK	0x3
8983 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF15_SHIFT	6
8984 	u8 flags6;
8985 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF16_MASK	0x3
8986 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF16_SHIFT	0
8987 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF17_MASK	0x3
8988 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF17_SHIFT	2
8989 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF18_MASK	0x3
8990 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF18_SHIFT	4
8991 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF19_MASK	0x3
8992 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF19_SHIFT	6
8993 	u8 flags7;
8994 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF20_MASK	0x3
8995 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF20_SHIFT	0
8996 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF21_MASK	0x3
8997 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF21_SHIFT	2
8998 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_SLOW_PATH_MASK	0x3
8999 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_SLOW_PATH_SHIFT	4
9000 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_MASK	0x1
9001 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_SHIFT	6
9002 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_MASK	0x1
9003 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_SHIFT	7
9004 	u8 flags8;
9005 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_MASK		0x1
9006 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_SHIFT		0
9007 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_MASK		0x1
9008 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF3EN_SHIFT		1
9009 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RXMIT_CF_EN_MASK	0x1
9010 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RXMIT_CF_EN_SHIFT	2
9011 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_EN_MASK	0x1
9012 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RX_ERROR_CF_EN_SHIFT	3
9013 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FORCE_ACK_CF_EN_MASK	0x1
9014 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FORCE_ACK_CF_EN_SHIFT	4
9015 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK	0x1
9016 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT	5
9017 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF8EN_MASK		0x1
9018 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF8EN_SHIFT		6
9019 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF9EN_MASK		0x1
9020 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF9EN_SHIFT		7
9021 	u8 flags9;
9022 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF10EN_MASK	0x1
9023 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF10EN_SHIFT	0
9024 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF11EN_MASK	0x1
9025 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF11EN_SHIFT	1
9026 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF12EN_MASK	0x1
9027 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF12EN_SHIFT	2
9028 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF13EN_MASK	0x1
9029 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF13EN_SHIFT	3
9030 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF14EN_MASK	0x1
9031 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF14EN_SHIFT	4
9032 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF15EN_MASK	0x1
9033 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF15EN_SHIFT	5
9034 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF16EN_MASK	0x1
9035 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF16EN_SHIFT	6
9036 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF17EN_MASK	0x1
9037 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF17EN_SHIFT	7
9038 	u8 flags10;
9039 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF18EN_MASK		0x1
9040 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF18EN_SHIFT		0
9041 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF19EN_MASK		0x1
9042 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF19EN_SHIFT		1
9043 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF20EN_MASK		0x1
9044 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF20EN_SHIFT		2
9045 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF21EN_MASK		0x1
9046 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF21EN_SHIFT		3
9047 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_SLOW_PATH_EN_MASK	0x1
9048 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_SLOW_PATH_EN_SHIFT	4
9049 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF23EN_MASK		0x1
9050 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF23EN_SHIFT		5
9051 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_MASK		0x1
9052 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_SHIFT		6
9053 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_MASK		0x1
9054 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_SHIFT		7
9055 	u8 flags11;
9056 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_MASK		0x1
9057 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_SHIFT		0
9058 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_MASK		0x1
9059 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_SHIFT		1
9060 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_MASK		0x1
9061 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_SHIFT		2
9062 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_MASK		0x1
9063 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE5EN_SHIFT		3
9064 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE6EN_MASK		0x1
9065 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE6EN_SHIFT		4
9066 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_MASK		0x1
9067 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE7EN_SHIFT		5
9068 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
9069 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
9070 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE9EN_MASK		0x1
9071 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE9EN_SHIFT		7
9072 	u8 flags12;
9073 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_IRQ_PROD_RULE_EN_MASK	0x1
9074 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_IRQ_PROD_RULE_EN_SHIFT	0
9075 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE11EN_MASK		0x1
9076 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE11EN_SHIFT		1
9077 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
9078 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
9079 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
9080 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
9081 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE14EN_MASK		0x1
9082 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE14EN_SHIFT		4
9083 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE15EN_MASK		0x1
9084 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE15EN_SHIFT		5
9085 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE16EN_MASK		0x1
9086 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE16EN_SHIFT		6
9087 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE17EN_MASK		0x1
9088 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE17EN_SHIFT		7
9089 	u8 flags13;
9090 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE18EN_MASK		0x1
9091 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE18EN_SHIFT		0
9092 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE19EN_MASK		0x1
9093 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_RULE19EN_SHIFT		1
9094 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED4_MASK	0x1
9095 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED4_SHIFT	2
9096 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED5_MASK	0x1
9097 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED5_SHIFT	3
9098 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED6_MASK	0x1
9099 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED6_SHIFT	4
9100 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED7_MASK	0x1
9101 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED7_SHIFT	5
9102 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED8_MASK	0x1
9103 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED8_SHIFT	6
9104 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED9_MASK	0x1
9105 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_A0_RESERVED9_SHIFT	7
9106 	u8 flags14;
9107 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT16_MASK	0x1
9108 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT16_SHIFT	0
9109 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT17_MASK	0x1
9110 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT17_SHIFT	1
9111 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT18_MASK	0x1
9112 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT18_SHIFT	2
9113 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT19_MASK	0x1
9114 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT19_SHIFT	3
9115 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT20_MASK	0x1
9116 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT20_SHIFT	4
9117 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT21_MASK	0x1
9118 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_BIT21_SHIFT	5
9119 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF23_MASK	0x3
9120 #define E4_XSTORM_ROCE_RESP_CONN_AG_CTX_CF23_SHIFT	6
9121 	u8 byte2;
9122 	__le16 physical_q0;
9123 	__le16 irq_prod_shadow;
9124 	__le16 word2;
9125 	__le16 irq_cons;
9126 	__le16 irq_prod;
9127 	__le16 e5_reserved1;
9128 	__le16 conn_dpi;
9129 	u8 rxmit_opcode;
9130 	u8 byte4;
9131 	u8 byte5;
9132 	u8 byte6;
9133 	__le32 rxmit_psn_and_id;
9134 	__le32 rxmit_bytes_length;
9135 	__le32 psn;
9136 	__le32 reg3;
9137 	__le32 reg4;
9138 	__le32 reg5;
9139 	__le32 msn_and_syndrome;
9140 };
9141 
9142 struct e4_ystorm_roce_conn_ag_ctx {
9143 	u8 byte0;
9144 	u8 byte1;
9145 	u8 flags0;
9146 #define E4_YSTORM_ROCE_CONN_AG_CTX_BIT0_MASK     0x1
9147 #define E4_YSTORM_ROCE_CONN_AG_CTX_BIT0_SHIFT    0
9148 #define E4_YSTORM_ROCE_CONN_AG_CTX_BIT1_MASK     0x1
9149 #define E4_YSTORM_ROCE_CONN_AG_CTX_BIT1_SHIFT    1
9150 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF0_MASK      0x3
9151 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF0_SHIFT     2
9152 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF1_MASK      0x3
9153 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF1_SHIFT     4
9154 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF2_MASK      0x3
9155 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF2_SHIFT     6
9156 	u8 flags1;
9157 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF0EN_MASK    0x1
9158 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF0EN_SHIFT   0
9159 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF1EN_MASK    0x1
9160 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF1EN_SHIFT   1
9161 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF2EN_MASK    0x1
9162 #define E4_YSTORM_ROCE_CONN_AG_CTX_CF2EN_SHIFT   2
9163 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE0EN_MASK  0x1
9164 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE0EN_SHIFT 3
9165 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE1EN_MASK  0x1
9166 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE1EN_SHIFT 4
9167 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE2EN_MASK  0x1
9168 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE2EN_SHIFT 5
9169 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE3EN_MASK  0x1
9170 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE3EN_SHIFT 6
9171 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE4EN_MASK  0x1
9172 #define E4_YSTORM_ROCE_CONN_AG_CTX_RULE4EN_SHIFT 7
9173 	u8 byte2;
9174 	u8 byte3;
9175 	__le16 word0;
9176 	__le32 reg0;
9177 	__le32 reg1;
9178 	__le16 word1;
9179 	__le16 word2;
9180 	__le16 word3;
9181 	__le16 word4;
9182 	__le32 reg2;
9183 	__le32 reg3;
9184 };
9185 
9186 struct e4_ystorm_roce_req_conn_ag_ctx {
9187 	u8 byte0;
9188 	u8 byte1;
9189 	u8 flags0;
9190 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_BIT0_MASK	0x1
9191 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_BIT0_SHIFT	0
9192 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_BIT1_MASK	0x1
9193 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_BIT1_SHIFT	1
9194 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF0_MASK		0x3
9195 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF0_SHIFT	2
9196 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF1_MASK		0x3
9197 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF1_SHIFT	4
9198 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF2_MASK		0x3
9199 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF2_SHIFT	6
9200 	u8 flags1;
9201 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_MASK	0x1
9202 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF0EN_SHIFT	0
9203 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_MASK	0x1
9204 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF1EN_SHIFT	1
9205 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_MASK	0x1
9206 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_CF2EN_SHIFT	2
9207 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_MASK	0x1
9208 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE0EN_SHIFT	3
9209 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_MASK	0x1
9210 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE1EN_SHIFT	4
9211 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_MASK	0x1
9212 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE2EN_SHIFT	5
9213 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_MASK	0x1
9214 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE3EN_SHIFT	6
9215 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_MASK	0x1
9216 #define E4_YSTORM_ROCE_REQ_CONN_AG_CTX_RULE4EN_SHIFT	7
9217 	u8 byte2;
9218 	u8 byte3;
9219 	__le16 word0;
9220 	__le32 reg0;
9221 	__le32 reg1;
9222 	__le16 word1;
9223 	__le16 word2;
9224 	__le16 word3;
9225 	__le16 word4;
9226 	__le32 reg2;
9227 	__le32 reg3;
9228 };
9229 
9230 struct e4_ystorm_roce_resp_conn_ag_ctx {
9231 	u8 byte0;
9232 	u8 byte1;
9233 	u8 flags0;
9234 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_BIT0_MASK	0x1
9235 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_BIT0_SHIFT	0
9236 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_BIT1_MASK	0x1
9237 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_BIT1_SHIFT	1
9238 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF0_MASK	0x3
9239 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF0_SHIFT	2
9240 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF1_MASK	0x3
9241 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF1_SHIFT	4
9242 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF2_MASK	0x3
9243 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF2_SHIFT	6
9244 	u8 flags1;
9245 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_MASK	0x1
9246 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF0EN_SHIFT	0
9247 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_MASK	0x1
9248 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF1EN_SHIFT	1
9249 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_MASK	0x1
9250 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_CF2EN_SHIFT	2
9251 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_MASK	0x1
9252 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE0EN_SHIFT	3
9253 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_MASK	0x1
9254 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE1EN_SHIFT	4
9255 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_MASK	0x1
9256 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE2EN_SHIFT	5
9257 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_MASK	0x1
9258 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE3EN_SHIFT	6
9259 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_MASK	0x1
9260 #define E4_YSTORM_ROCE_RESP_CONN_AG_CTX_RULE4EN_SHIFT	7
9261 	u8 byte2;
9262 	u8 byte3;
9263 	__le16 word0;
9264 	__le32 reg0;
9265 	__le32 reg1;
9266 	__le16 word1;
9267 	__le16 word2;
9268 	__le16 word3;
9269 	__le16 word4;
9270 	__le32 reg2;
9271 	__le32 reg3;
9272 };
9273 
9274 /* Roce doorbell data */
9275 enum roce_flavor {
9276 	PLAIN_ROCE,
9277 	RROCE_IPV4,
9278 	RROCE_IPV6,
9279 	MAX_ROCE_FLAVOR
9280 };
9281 
9282 /* The iwarp storm context of Ystorm */
9283 struct ystorm_iwarp_conn_st_ctx {
9284 	__le32 reserved[4];
9285 };
9286 
9287 /* The iwarp storm context of Pstorm */
9288 struct pstorm_iwarp_conn_st_ctx {
9289 	__le32 reserved[36];
9290 };
9291 
9292 /* The iwarp storm context of Xstorm */
9293 struct xstorm_iwarp_conn_st_ctx {
9294 	__le32 reserved[48];
9295 };
9296 
9297 struct e4_xstorm_iwarp_conn_ag_ctx {
9298 	u8 reserved0;
9299 	u8 state;
9300 	u8 flags0;
9301 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
9302 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
9303 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM1_MASK	0x1
9304 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM1_SHIFT	1
9305 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM2_MASK	0x1
9306 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM2_SHIFT	2
9307 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
9308 #define E4_XSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
9309 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT4_MASK		0x1
9310 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT4_SHIFT		4
9311 #define E4_XSTORM_IWARP_CONN_AG_CTX_RESERVED2_MASK	0x1
9312 #define E4_XSTORM_IWARP_CONN_AG_CTX_RESERVED2_SHIFT	5
9313 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT6_MASK		0x1
9314 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT6_SHIFT		6
9315 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT7_MASK		0x1
9316 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT7_SHIFT		7
9317 	u8 flags1;
9318 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT8_MASK				0x1
9319 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT8_SHIFT				0
9320 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT9_MASK				0x1
9321 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT9_SHIFT				1
9322 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT10_MASK				0x1
9323 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT10_SHIFT				2
9324 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT11_MASK				0x1
9325 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT11_SHIFT				3
9326 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT12_MASK				0x1
9327 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT12_SHIFT				4
9328 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT13_MASK				0x1
9329 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT13_SHIFT				5
9330 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT14_MASK				0x1
9331 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT14_SHIFT				6
9332 #define E4_XSTORM_IWARP_CONN_AG_CTX_YSTORM_FLUSH_OR_REWIND_SND_MAX_MASK	0x1
9333 #define E4_XSTORM_IWARP_CONN_AG_CTX_YSTORM_FLUSH_OR_REWIND_SND_MAX_SHIFT 7
9334 	u8 flags2;
9335 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF0_MASK			0x3
9336 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF0_SHIFT			0
9337 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF1_MASK			0x3
9338 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF1_SHIFT			2
9339 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF2_MASK			0x3
9340 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF2_SHIFT			4
9341 #define E4_XSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_MASK		0x3
9342 #define E4_XSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_SHIFT	6
9343 	u8 flags3;
9344 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF4_MASK	0x3
9345 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF4_SHIFT	0
9346 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF5_MASK	0x3
9347 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF5_SHIFT	2
9348 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF6_MASK	0x3
9349 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF6_SHIFT	4
9350 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF7_MASK	0x3
9351 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF7_SHIFT	6
9352 	u8 flags4;
9353 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF8_MASK	0x3
9354 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF8_SHIFT	0
9355 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF9_MASK	0x3
9356 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF9_SHIFT	2
9357 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF10_MASK	0x3
9358 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF10_SHIFT	4
9359 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF11_MASK	0x3
9360 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF11_SHIFT	6
9361 	u8 flags5;
9362 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF12_MASK		0x3
9363 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF12_SHIFT		0
9364 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF13_MASK		0x3
9365 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF13_SHIFT		2
9366 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FLUSH_CF_MASK	0x3
9367 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FLUSH_CF_SHIFT	4
9368 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF15_MASK		0x3
9369 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF15_SHIFT		6
9370 	u8 flags6;
9371 #define E4_XSTORM_IWARP_CONN_AG_CTX_MPA_OR_ERROR_WAKEUP_TRIGGER_CF_MASK	0x3
9372 #define E4_XSTORM_IWARP_CONN_AG_CTX_MPA_OR_ERROR_WAKEUP_TRIGGER_CF_SHIFT 0
9373 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF17_MASK				0x3
9374 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF17_SHIFT				2
9375 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF18_MASK				0x3
9376 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF18_SHIFT				4
9377 #define E4_XSTORM_IWARP_CONN_AG_CTX_DQ_FLUSH_MASK			0x3
9378 #define E4_XSTORM_IWARP_CONN_AG_CTX_DQ_FLUSH_SHIFT			6
9379 	u8 flags7;
9380 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_MASK	0x3
9381 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_SHIFT	0
9382 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q1_MASK	0x3
9383 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q1_SHIFT	2
9384 #define E4_XSTORM_IWARP_CONN_AG_CTX_SLOW_PATH_MASK	0x3
9385 #define E4_XSTORM_IWARP_CONN_AG_CTX_SLOW_PATH_SHIFT	4
9386 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF0EN_MASK		0x1
9387 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF0EN_SHIFT		6
9388 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF1EN_MASK		0x1
9389 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF1EN_SHIFT		7
9390 	u8 flags8;
9391 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF2EN_MASK			0x1
9392 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF2EN_SHIFT			0
9393 #define E4_XSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_EN_MASK	0x1
9394 #define E4_XSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_EN_SHIFT	1
9395 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF4EN_MASK			0x1
9396 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF4EN_SHIFT			2
9397 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF5EN_MASK			0x1
9398 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF5EN_SHIFT			3
9399 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF6EN_MASK			0x1
9400 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF6EN_SHIFT			4
9401 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF7EN_MASK			0x1
9402 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF7EN_SHIFT			5
9403 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF8EN_MASK			0x1
9404 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF8EN_SHIFT			6
9405 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF9EN_MASK			0x1
9406 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF9EN_SHIFT			7
9407 	u8 flags9;
9408 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF10EN_MASK				0x1
9409 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF10EN_SHIFT			0
9410 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF11EN_MASK				0x1
9411 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF11EN_SHIFT			1
9412 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF12EN_MASK				0x1
9413 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF12EN_SHIFT			2
9414 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF13EN_MASK				0x1
9415 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF13EN_SHIFT			3
9416 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FLUSH_CF_EN_MASK			0x1
9417 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FLUSH_CF_EN_SHIFT		4
9418 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF15EN_MASK				0x1
9419 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF15EN_SHIFT			5
9420 #define E4_XSTORM_IWARP_CONN_AG_CTX_MPA_OR_ERROR_WAKEUP_TRIGGER_CF_EN_MASK 0x1
9421 #define E4_XSTORM_IWARP_CONN_AG_CTX_MPA_OR_ERROR_WAKEUP_TRIGGER_CF_EN_SHIFT 6
9422 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF17EN_MASK				0x1
9423 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF17EN_SHIFT			7
9424 	u8 flags10;
9425 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF18EN_MASK			0x1
9426 #define E4_XSTORM_IWARP_CONN_AG_CTX_CF18EN_SHIFT		0
9427 #define E4_XSTORM_IWARP_CONN_AG_CTX_DQ_FLUSH_EN_MASK		0x1
9428 #define E4_XSTORM_IWARP_CONN_AG_CTX_DQ_FLUSH_EN_SHIFT		1
9429 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_EN_MASK		0x1
9430 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT		2
9431 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q1_EN_MASK		0x1
9432 #define E4_XSTORM_IWARP_CONN_AG_CTX_FLUSH_Q1_EN_SHIFT		3
9433 #define E4_XSTORM_IWARP_CONN_AG_CTX_SLOW_PATH_EN_MASK		0x1
9434 #define E4_XSTORM_IWARP_CONN_AG_CTX_SLOW_PATH_EN_SHIFT		4
9435 #define E4_XSTORM_IWARP_CONN_AG_CTX_SEND_TERMINATE_CF_EN_MASK               0x1
9436 #define E4_XSTORM_IWARP_CONN_AG_CTX_SEND_TERMINATE_CF_EN_SHIFT              5
9437 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE0EN_MASK		0x1
9438 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE0EN_SHIFT		6
9439 #define E4_XSTORM_IWARP_CONN_AG_CTX_MORE_TO_SEND_RULE_EN_MASK	0x1
9440 #define E4_XSTORM_IWARP_CONN_AG_CTX_MORE_TO_SEND_RULE_EN_SHIFT	7
9441 	u8 flags11;
9442 #define E4_XSTORM_IWARP_CONN_AG_CTX_TX_BLOCKED_EN_MASK	0x1
9443 #define E4_XSTORM_IWARP_CONN_AG_CTX_TX_BLOCKED_EN_SHIFT	0
9444 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE3EN_MASK	0x1
9445 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE3EN_SHIFT	1
9446 #define E4_XSTORM_IWARP_CONN_AG_CTX_RESERVED3_MASK	0x1
9447 #define E4_XSTORM_IWARP_CONN_AG_CTX_RESERVED3_SHIFT	2
9448 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE5EN_MASK	0x1
9449 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE5EN_SHIFT	3
9450 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE6EN_MASK	0x1
9451 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE6EN_SHIFT	4
9452 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE7EN_MASK	0x1
9453 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE7EN_SHIFT	5
9454 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
9455 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
9456 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE9EN_MASK	0x1
9457 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE9EN_SHIFT	7
9458 	u8 flags12;
9459 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_NOT_EMPTY_RULE_EN_MASK	0x1
9460 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_NOT_EMPTY_RULE_EN_SHIFT	0
9461 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE11EN_MASK		0x1
9462 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE11EN_SHIFT		1
9463 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED2_MASK		0x1
9464 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED2_SHIFT		2
9465 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED3_MASK		0x1
9466 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED3_SHIFT		3
9467 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FENCE_RULE_EN_MASK	0x1
9468 #define E4_XSTORM_IWARP_CONN_AG_CTX_SQ_FENCE_RULE_EN_SHIFT	4
9469 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE15EN_MASK		0x1
9470 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE15EN_SHIFT		5
9471 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE16EN_MASK		0x1
9472 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE16EN_SHIFT		6
9473 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE17EN_MASK		0x1
9474 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE17EN_SHIFT		7
9475 	u8 flags13;
9476 #define E4_XSTORM_IWARP_CONN_AG_CTX_IRQ_NOT_EMPTY_RULE_EN_MASK	0x1
9477 #define E4_XSTORM_IWARP_CONN_AG_CTX_IRQ_NOT_EMPTY_RULE_EN_SHIFT	0
9478 #define E4_XSTORM_IWARP_CONN_AG_CTX_HQ_NOT_FULL_RULE_EN_MASK	0x1
9479 #define E4_XSTORM_IWARP_CONN_AG_CTX_HQ_NOT_FULL_RULE_EN_SHIFT	1
9480 #define E4_XSTORM_IWARP_CONN_AG_CTX_ORQ_RD_FENCE_RULE_EN_MASK	0x1
9481 #define E4_XSTORM_IWARP_CONN_AG_CTX_ORQ_RD_FENCE_RULE_EN_SHIFT	2
9482 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE21EN_MASK		0x1
9483 #define E4_XSTORM_IWARP_CONN_AG_CTX_RULE21EN_SHIFT		3
9484 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED6_MASK		0x1
9485 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED6_SHIFT		4
9486 #define E4_XSTORM_IWARP_CONN_AG_CTX_ORQ_NOT_FULL_RULE_EN_MASK	0x1
9487 #define E4_XSTORM_IWARP_CONN_AG_CTX_ORQ_NOT_FULL_RULE_EN_SHIFT	5
9488 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED8_MASK		0x1
9489 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED8_SHIFT		6
9490 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED9_MASK		0x1
9491 #define E4_XSTORM_IWARP_CONN_AG_CTX_A0_RESERVED9_SHIFT		7
9492 	u8 flags14;
9493 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT16_MASK		0x1
9494 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT16_SHIFT		0
9495 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT17_MASK		0x1
9496 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT17_SHIFT		1
9497 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT18_MASK		0x1
9498 #define E4_XSTORM_IWARP_CONN_AG_CTX_BIT18_SHIFT		2
9499 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED1_MASK	0x1
9500 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED1_SHIFT	3
9501 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED2_MASK	0x1
9502 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED2_SHIFT	4
9503 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED3_MASK	0x1
9504 #define E4_XSTORM_IWARP_CONN_AG_CTX_E5_RESERVED3_SHIFT	5
9505 #define E4_XSTORM_IWARP_CONN_AG_CTX_SEND_TERMINATE_CF_MASK	0x3
9506 #define E4_XSTORM_IWARP_CONN_AG_CTX_SEND_TERMINATE_CF_SHIFT	6
9507 	u8 byte2;
9508 	__le16 physical_q0;
9509 	__le16 physical_q1;
9510 	__le16 sq_comp_cons;
9511 	__le16 sq_tx_cons;
9512 	__le16 sq_prod;
9513 	__le16 word5;
9514 	__le16 conn_dpi;
9515 	u8 byte3;
9516 	u8 byte4;
9517 	u8 byte5;
9518 	u8 byte6;
9519 	__le32 reg0;
9520 	__le32 reg1;
9521 	__le32 reg2;
9522 	__le32 more_to_send_seq;
9523 	__le32 reg4;
9524 	__le32 rewinded_snd_max_or_term_opcode;
9525 	__le32 rd_msn;
9526 	__le16 irq_prod_via_msdm;
9527 	__le16 irq_cons;
9528 	__le16 hq_cons_th_or_mpa_data;
9529 	__le16 hq_cons;
9530 	__le32 atom_msn;
9531 	__le32 orq_cons;
9532 	__le32 orq_cons_th;
9533 	u8 byte7;
9534 	u8 wqe_data_pad_bytes;
9535 	u8 max_ord;
9536 	u8 former_hq_prod;
9537 	u8 irq_prod_via_msem;
9538 	u8 byte12;
9539 	u8 max_pkt_pdu_size_lo;
9540 	u8 max_pkt_pdu_size_hi;
9541 	u8 byte15;
9542 	u8 e5_reserved;
9543 	__le16 e5_reserved4;
9544 	__le32 reg10;
9545 	__le32 reg11;
9546 	__le32 shared_queue_page_addr_lo;
9547 	__le32 shared_queue_page_addr_hi;
9548 	__le32 reg14;
9549 	__le32 reg15;
9550 	__le32 reg16;
9551 	__le32 reg17;
9552 };
9553 
9554 struct e4_tstorm_iwarp_conn_ag_ctx {
9555 	u8 reserved0;
9556 	u8 state;
9557 	u8 flags0;
9558 #define E4_TSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
9559 #define E4_TSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
9560 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT1_MASK		0x1
9561 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT1_SHIFT		1
9562 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT2_MASK		0x1
9563 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT2_SHIFT		2
9564 #define E4_TSTORM_IWARP_CONN_AG_CTX_MSTORM_FLUSH_OR_TERMINATE_SENT_MASK  0x1
9565 #define E4_TSTORM_IWARP_CONN_AG_CTX_MSTORM_FLUSH_OR_TERMINATE_SENT_SHIFT 3
9566 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT4_MASK		0x1
9567 #define E4_TSTORM_IWARP_CONN_AG_CTX_BIT4_SHIFT		4
9568 #define E4_TSTORM_IWARP_CONN_AG_CTX_CACHED_ORQ_MASK	0x1
9569 #define E4_TSTORM_IWARP_CONN_AG_CTX_CACHED_ORQ_SHIFT	5
9570 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF0_MASK		0x3
9571 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF0_SHIFT		6
9572 	u8 flags1;
9573 #define E4_TSTORM_IWARP_CONN_AG_CTX_RQ_POST_CF_MASK		0x3
9574 #define E4_TSTORM_IWARP_CONN_AG_CTX_RQ_POST_CF_SHIFT		0
9575 #define E4_TSTORM_IWARP_CONN_AG_CTX_MPA_TIMEOUT_CF_MASK		0x3
9576 #define E4_TSTORM_IWARP_CONN_AG_CTX_MPA_TIMEOUT_CF_SHIFT	2
9577 #define E4_TSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_MASK		0x3
9578 #define E4_TSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_SHIFT	4
9579 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF4_MASK			0x3
9580 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF4_SHIFT			6
9581 	u8 flags2;
9582 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF5_MASK	0x3
9583 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF5_SHIFT	0
9584 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF6_MASK	0x3
9585 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF6_SHIFT	2
9586 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF7_MASK	0x3
9587 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF7_SHIFT	4
9588 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF8_MASK	0x3
9589 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF8_SHIFT	6
9590 	u8 flags3;
9591 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_AND_TCP_HANDSHAKE_COMPLETE_MASK 0x3
9592 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_AND_TCP_HANDSHAKE_COMPLETE_SHIFT 0
9593 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_OR_ERROR_DETECTED_MASK	0x3
9594 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_OR_ERROR_DETECTED_SHIFT	2
9595 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF0EN_MASK				0x1
9596 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF0EN_SHIFT				4
9597 #define E4_TSTORM_IWARP_CONN_AG_CTX_RQ_POST_CF_EN_MASK			0x1
9598 #define E4_TSTORM_IWARP_CONN_AG_CTX_RQ_POST_CF_EN_SHIFT			5
9599 #define E4_TSTORM_IWARP_CONN_AG_CTX_MPA_TIMEOUT_CF_EN_MASK		0x1
9600 #define E4_TSTORM_IWARP_CONN_AG_CTX_MPA_TIMEOUT_CF_EN_SHIFT		6
9601 #define E4_TSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_EN_MASK		0x1
9602 #define E4_TSTORM_IWARP_CONN_AG_CTX_TIMER_STOP_ALL_EN_SHIFT		7
9603 	u8 flags4;
9604 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF4EN_MASK				0x1
9605 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF4EN_SHIFT				0
9606 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF5EN_MASK				0x1
9607 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF5EN_SHIFT				1
9608 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF6EN_MASK				0x1
9609 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF6EN_SHIFT				2
9610 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF7EN_MASK				0x1
9611 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF7EN_SHIFT				3
9612 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF8EN_MASK				0x1
9613 #define E4_TSTORM_IWARP_CONN_AG_CTX_CF8EN_SHIFT				4
9614 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_AND_TCP_HANDSHAKE_COMPL_EN_MASK 0x1
9615 #define	E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_Q0_AND_TCP_HANDSHAKE_COMPL_EN_SHIFT 5
9616 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_OR_ERROR_DETECTED_EN_MASK	0x1
9617 #define E4_TSTORM_IWARP_CONN_AG_CTX_FLUSH_OR_ERROR_DETECTED_EN_SHIFT	6
9618 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE0EN_MASK			0x1
9619 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE0EN_SHIFT			7
9620 	u8 flags5;
9621 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE1EN_MASK		0x1
9622 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE1EN_SHIFT		0
9623 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE2EN_MASK		0x1
9624 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE2EN_SHIFT		1
9625 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE3EN_MASK		0x1
9626 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE3EN_SHIFT		2
9627 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE4EN_MASK		0x1
9628 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE4EN_SHIFT		3
9629 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE5EN_MASK		0x1
9630 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE5EN_SHIFT		4
9631 #define E4_TSTORM_IWARP_CONN_AG_CTX_SND_SQ_CONS_RULE_MASK	0x1
9632 #define E4_TSTORM_IWARP_CONN_AG_CTX_SND_SQ_CONS_RULE_SHIFT	5
9633 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE7EN_MASK		0x1
9634 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE7EN_SHIFT		6
9635 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE8EN_MASK		0x1
9636 #define E4_TSTORM_IWARP_CONN_AG_CTX_RULE8EN_SHIFT		7
9637 	__le32 reg0;
9638 	__le32 reg1;
9639 	__le32 unaligned_nxt_seq;
9640 	__le32 reg3;
9641 	__le32 reg4;
9642 	__le32 reg5;
9643 	__le32 reg6;
9644 	__le32 reg7;
9645 	__le32 reg8;
9646 	u8 orq_cache_idx;
9647 	u8 hq_prod;
9648 	__le16 sq_tx_cons_th;
9649 	u8 orq_prod;
9650 	u8 irq_cons;
9651 	__le16 sq_tx_cons;
9652 	__le16 conn_dpi;
9653 	__le16 rq_prod;
9654 	__le32 snd_seq;
9655 	__le32 last_hq_sequence;
9656 };
9657 
9658 /* The iwarp storm context of Tstorm */
9659 struct tstorm_iwarp_conn_st_ctx {
9660 	__le32 reserved[60];
9661 };
9662 
9663 /* The iwarp storm context of Mstorm */
9664 struct mstorm_iwarp_conn_st_ctx {
9665 	__le32 reserved[32];
9666 };
9667 
9668 /* The iwarp storm context of Ustorm */
9669 struct ustorm_iwarp_conn_st_ctx {
9670 	struct regpair reserved[14];
9671 };
9672 
9673 /* iwarp connection context */
9674 struct e4_iwarp_conn_context {
9675 	struct ystorm_iwarp_conn_st_ctx ystorm_st_context;
9676 	struct regpair ystorm_st_padding[2];
9677 	struct pstorm_iwarp_conn_st_ctx pstorm_st_context;
9678 	struct regpair pstorm_st_padding[2];
9679 	struct xstorm_iwarp_conn_st_ctx xstorm_st_context;
9680 	struct e4_xstorm_iwarp_conn_ag_ctx xstorm_ag_context;
9681 	struct e4_tstorm_iwarp_conn_ag_ctx tstorm_ag_context;
9682 	struct timers_context timer_context;
9683 	struct e4_ustorm_rdma_conn_ag_ctx ustorm_ag_context;
9684 	struct tstorm_iwarp_conn_st_ctx tstorm_st_context;
9685 	struct regpair tstorm_st_padding[2];
9686 	struct mstorm_iwarp_conn_st_ctx mstorm_st_context;
9687 	struct ustorm_iwarp_conn_st_ctx ustorm_st_context;
9688 	struct regpair ustorm_st_padding[2];
9689 };
9690 
9691 /* iWARP create QP params passed by driver to FW in CreateQP Request Ramrod */
9692 struct iwarp_create_qp_ramrod_data {
9693 	u8 flags;
9694 #define IWARP_CREATE_QP_RAMROD_DATA_FMR_AND_RESERVED_EN_MASK	0x1
9695 #define IWARP_CREATE_QP_RAMROD_DATA_FMR_AND_RESERVED_EN_SHIFT	0
9696 #define IWARP_CREATE_QP_RAMROD_DATA_SIGNALED_COMP_MASK		0x1
9697 #define IWARP_CREATE_QP_RAMROD_DATA_SIGNALED_COMP_SHIFT		1
9698 #define IWARP_CREATE_QP_RAMROD_DATA_RDMA_RD_EN_MASK		0x1
9699 #define IWARP_CREATE_QP_RAMROD_DATA_RDMA_RD_EN_SHIFT		2
9700 #define IWARP_CREATE_QP_RAMROD_DATA_RDMA_WR_EN_MASK		0x1
9701 #define IWARP_CREATE_QP_RAMROD_DATA_RDMA_WR_EN_SHIFT		3
9702 #define IWARP_CREATE_QP_RAMROD_DATA_ATOMIC_EN_MASK		0x1
9703 #define IWARP_CREATE_QP_RAMROD_DATA_ATOMIC_EN_SHIFT		4
9704 #define IWARP_CREATE_QP_RAMROD_DATA_SRQ_FLG_MASK		0x1
9705 #define IWARP_CREATE_QP_RAMROD_DATA_SRQ_FLG_SHIFT		5
9706 #define IWARP_CREATE_QP_RAMROD_DATA_LOW_LATENCY_QUEUE_EN_MASK	0x1
9707 #define IWARP_CREATE_QP_RAMROD_DATA_LOW_LATENCY_QUEUE_EN_SHIFT	6
9708 #define IWARP_CREATE_QP_RAMROD_DATA_RESERVED0_MASK		0x1
9709 #define IWARP_CREATE_QP_RAMROD_DATA_RESERVED0_SHIFT		7
9710 	u8 reserved1;
9711 	__le16 pd;
9712 	__le16 sq_num_pages;
9713 	__le16 rq_num_pages;
9714 	__le32 reserved3[2];
9715 	struct regpair qp_handle_for_cqe;
9716 	struct rdma_srq_id srq_id;
9717 	__le32 cq_cid_for_sq;
9718 	__le32 cq_cid_for_rq;
9719 	__le16 dpi;
9720 	__le16 physical_q0;
9721 	__le16 physical_q1;
9722 	u8 reserved2[6];
9723 };
9724 
9725 /* iWARP completion queue types */
9726 enum iwarp_eqe_async_opcode {
9727 	IWARP_EVENT_TYPE_ASYNC_CONNECT_COMPLETE,
9728 	IWARP_EVENT_TYPE_ASYNC_ENHANCED_MPA_REPLY_ARRIVED,
9729 	IWARP_EVENT_TYPE_ASYNC_MPA_HANDSHAKE_COMPLETE,
9730 	IWARP_EVENT_TYPE_ASYNC_CID_CLEANED,
9731 	IWARP_EVENT_TYPE_ASYNC_EXCEPTION_DETECTED,
9732 	IWARP_EVENT_TYPE_ASYNC_QP_IN_ERROR_STATE,
9733 	IWARP_EVENT_TYPE_ASYNC_CQ_OVERFLOW,
9734 	IWARP_EVENT_TYPE_ASYNC_SRQ_EMPTY,
9735 	IWARP_EVENT_TYPE_ASYNC_SRQ_LIMIT,
9736 	MAX_IWARP_EQE_ASYNC_OPCODE
9737 };
9738 
9739 struct iwarp_eqe_data_mpa_async_completion {
9740 	__le16 ulp_data_len;
9741 	u8 rtr_type_sent;
9742 	u8 reserved[5];
9743 };
9744 
9745 struct iwarp_eqe_data_tcp_async_completion {
9746 	__le16 ulp_data_len;
9747 	u8 mpa_handshake_mode;
9748 	u8 reserved[5];
9749 };
9750 
9751 /* iWARP completion queue types */
9752 enum iwarp_eqe_sync_opcode {
9753 	IWARP_EVENT_TYPE_TCP_OFFLOAD =
9754 	11,
9755 	IWARP_EVENT_TYPE_MPA_OFFLOAD,
9756 	IWARP_EVENT_TYPE_MPA_OFFLOAD_SEND_RTR,
9757 	IWARP_EVENT_TYPE_CREATE_QP,
9758 	IWARP_EVENT_TYPE_QUERY_QP,
9759 	IWARP_EVENT_TYPE_MODIFY_QP,
9760 	IWARP_EVENT_TYPE_DESTROY_QP,
9761 	IWARP_EVENT_TYPE_ABORT_TCP_OFFLOAD,
9762 	MAX_IWARP_EQE_SYNC_OPCODE
9763 };
9764 
9765 /* iWARP EQE completion status */
9766 enum iwarp_fw_return_code {
9767 	IWARP_CONN_ERROR_TCP_CONNECT_INVALID_PACKET = 6,
9768 	IWARP_CONN_ERROR_TCP_CONNECTION_RST,
9769 	IWARP_CONN_ERROR_TCP_CONNECT_TIMEOUT,
9770 	IWARP_CONN_ERROR_MPA_ERROR_REJECT,
9771 	IWARP_CONN_ERROR_MPA_NOT_SUPPORTED_VER,
9772 	IWARP_CONN_ERROR_MPA_RST,
9773 	IWARP_CONN_ERROR_MPA_FIN,
9774 	IWARP_CONN_ERROR_MPA_RTR_MISMATCH,
9775 	IWARP_CONN_ERROR_MPA_INSUF_IRD,
9776 	IWARP_CONN_ERROR_MPA_INVALID_PACKET,
9777 	IWARP_CONN_ERROR_MPA_LOCAL_ERROR,
9778 	IWARP_CONN_ERROR_MPA_TIMEOUT,
9779 	IWARP_CONN_ERROR_MPA_TERMINATE,
9780 	IWARP_QP_IN_ERROR_GOOD_CLOSE,
9781 	IWARP_QP_IN_ERROR_BAD_CLOSE,
9782 	IWARP_EXCEPTION_DETECTED_LLP_CLOSED,
9783 	IWARP_EXCEPTION_DETECTED_LLP_RESET,
9784 	IWARP_EXCEPTION_DETECTED_IRQ_FULL,
9785 	IWARP_EXCEPTION_DETECTED_RQ_EMPTY,
9786 	IWARP_EXCEPTION_DETECTED_SRQ_EMPTY,
9787 	IWARP_EXCEPTION_DETECTED_SRQ_LIMIT,
9788 	IWARP_EXCEPTION_DETECTED_LLP_TIMEOUT,
9789 	IWARP_EXCEPTION_DETECTED_REMOTE_PROTECTION_ERROR,
9790 	IWARP_EXCEPTION_DETECTED_CQ_OVERFLOW,
9791 	IWARP_EXCEPTION_DETECTED_LOCAL_CATASTROPHIC,
9792 	IWARP_EXCEPTION_DETECTED_LOCAL_ACCESS_ERROR,
9793 	IWARP_EXCEPTION_DETECTED_REMOTE_OPERATION_ERROR,
9794 	IWARP_EXCEPTION_DETECTED_TERMINATE_RECEIVED,
9795 	MAX_IWARP_FW_RETURN_CODE
9796 };
9797 
9798 /* unaligned opaque data received from LL2 */
9799 struct iwarp_init_func_params {
9800 	u8 ll2_ooo_q_index;
9801 	u8 reserved1[7];
9802 };
9803 
9804 /* iwarp func init ramrod data */
9805 struct iwarp_init_func_ramrod_data {
9806 	struct rdma_init_func_ramrod_data rdma;
9807 	struct tcp_init_params tcp;
9808 	struct iwarp_init_func_params iwarp;
9809 };
9810 
9811 /* iWARP QP - possible states to transition to */
9812 enum iwarp_modify_qp_new_state_type {
9813 	IWARP_MODIFY_QP_STATE_CLOSING = 1,
9814 	IWARP_MODIFY_QP_STATE_ERROR = 2,
9815 	MAX_IWARP_MODIFY_QP_NEW_STATE_TYPE
9816 };
9817 
9818 /* iwarp modify qp responder ramrod data */
9819 struct iwarp_modify_qp_ramrod_data {
9820 	__le16 transition_to_state;
9821 	__le16 flags;
9822 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_RD_EN_MASK		0x1
9823 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_RD_EN_SHIFT		0
9824 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_WR_EN_MASK		0x1
9825 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_WR_EN_SHIFT		1
9826 #define IWARP_MODIFY_QP_RAMROD_DATA_ATOMIC_EN_MASK		0x1
9827 #define IWARP_MODIFY_QP_RAMROD_DATA_ATOMIC_EN_SHIFT		2
9828 #define IWARP_MODIFY_QP_RAMROD_DATA_STATE_TRANS_EN_MASK		0x1
9829 #define IWARP_MODIFY_QP_RAMROD_DATA_STATE_TRANS_EN_SHIFT	3
9830 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_OPS_EN_FLG_MASK	0x1
9831 #define IWARP_MODIFY_QP_RAMROD_DATA_RDMA_OPS_EN_FLG_SHIFT	4
9832 #define IWARP_MODIFY_QP_RAMROD_DATA_PHYSICAL_QUEUE_FLG_MASK	0x1
9833 #define IWARP_MODIFY_QP_RAMROD_DATA_PHYSICAL_QUEUE_FLG_SHIFT	5
9834 #define IWARP_MODIFY_QP_RAMROD_DATA_RESERVED_MASK		0x3FF
9835 #define IWARP_MODIFY_QP_RAMROD_DATA_RESERVED_SHIFT		6
9836 	__le16 physical_q0;
9837 	__le16 physical_q1;
9838 	__le32 reserved1[10];
9839 };
9840 
9841 /* MPA params for Enhanced mode */
9842 struct mpa_rq_params {
9843 	__le32 ird;
9844 	__le32 ord;
9845 };
9846 
9847 /* MPA host Address-Len for private data */
9848 struct mpa_ulp_buffer {
9849 	struct regpair addr;
9850 	__le16 len;
9851 	__le16 reserved[3];
9852 };
9853 
9854 /* iWARP MPA offload params common to Basic and Enhanced modes */
9855 struct mpa_outgoing_params {
9856 	u8 crc_needed;
9857 	u8 reject;
9858 	u8 reserved[6];
9859 	struct mpa_rq_params out_rq;
9860 	struct mpa_ulp_buffer outgoing_ulp_buffer;
9861 };
9862 
9863 /* iWARP MPA offload params passed by driver to FW in MPA Offload Request
9864  * Ramrod.
9865  */
9866 struct iwarp_mpa_offload_ramrod_data {
9867 	struct mpa_outgoing_params common;
9868 	__le32 tcp_cid;
9869 	u8 mode;
9870 	u8 tcp_connect_side;
9871 	u8 rtr_pref;
9872 #define IWARP_MPA_OFFLOAD_RAMROD_DATA_RTR_SUPPORTED_MASK	0x7
9873 #define IWARP_MPA_OFFLOAD_RAMROD_DATA_RTR_SUPPORTED_SHIFT	0
9874 #define IWARP_MPA_OFFLOAD_RAMROD_DATA_RESERVED1_MASK		0x1F
9875 #define IWARP_MPA_OFFLOAD_RAMROD_DATA_RESERVED1_SHIFT		3
9876 	u8 reserved2;
9877 	struct mpa_ulp_buffer incoming_ulp_buffer;
9878 	struct regpair async_eqe_output_buf;
9879 	struct regpair handle_for_async;
9880 	struct regpair shared_queue_addr;
9881 	__le16 rcv_wnd;
9882 	u8 stats_counter_id;
9883 	u8 reserved3[13];
9884 };
9885 
9886 /* iWARP TCP connection offload params passed by driver to FW */
9887 struct iwarp_offload_params {
9888 	struct mpa_ulp_buffer incoming_ulp_buffer;
9889 	struct regpair async_eqe_output_buf;
9890 	struct regpair handle_for_async;
9891 	__le16 physical_q0;
9892 	__le16 physical_q1;
9893 	u8 stats_counter_id;
9894 	u8 mpa_mode;
9895 	u8 reserved[10];
9896 };
9897 
9898 /* iWARP query QP output params */
9899 struct iwarp_query_qp_output_params {
9900 	__le32 flags;
9901 #define IWARP_QUERY_QP_OUTPUT_PARAMS_ERROR_FLG_MASK	0x1
9902 #define IWARP_QUERY_QP_OUTPUT_PARAMS_ERROR_FLG_SHIFT	0
9903 #define IWARP_QUERY_QP_OUTPUT_PARAMS_RESERVED0_MASK	0x7FFFFFFF
9904 #define IWARP_QUERY_QP_OUTPUT_PARAMS_RESERVED0_SHIFT	1
9905 	u8 reserved1[4];
9906 };
9907 
9908 /* iWARP query QP ramrod data */
9909 struct iwarp_query_qp_ramrod_data {
9910 	struct regpair output_params_addr;
9911 };
9912 
9913 /* iWARP Ramrod Command IDs */
9914 enum iwarp_ramrod_cmd_id {
9915 	IWARP_RAMROD_CMD_ID_TCP_OFFLOAD = 11,
9916 	IWARP_RAMROD_CMD_ID_MPA_OFFLOAD,
9917 	IWARP_RAMROD_CMD_ID_MPA_OFFLOAD_SEND_RTR,
9918 	IWARP_RAMROD_CMD_ID_CREATE_QP,
9919 	IWARP_RAMROD_CMD_ID_QUERY_QP,
9920 	IWARP_RAMROD_CMD_ID_MODIFY_QP,
9921 	IWARP_RAMROD_CMD_ID_DESTROY_QP,
9922 	IWARP_RAMROD_CMD_ID_ABORT_TCP_OFFLOAD,
9923 	MAX_IWARP_RAMROD_CMD_ID
9924 };
9925 
9926 /* Per PF iWARP retransmit path statistics */
9927 struct iwarp_rxmit_stats_drv {
9928 	struct regpair tx_go_to_slow_start_event_cnt;
9929 	struct regpair tx_fast_retransmit_event_cnt;
9930 };
9931 
9932 /* iWARP and TCP connection offload params passed by driver to FW in iWARP
9933  * offload ramrod.
9934  */
9935 struct iwarp_tcp_offload_ramrod_data {
9936 	struct tcp_offload_params_opt2 tcp;
9937 	struct iwarp_offload_params iwarp;
9938 };
9939 
9940 /* iWARP MPA negotiation types */
9941 enum mpa_negotiation_mode {
9942 	MPA_NEGOTIATION_TYPE_BASIC = 1,
9943 	MPA_NEGOTIATION_TYPE_ENHANCED = 2,
9944 	MAX_MPA_NEGOTIATION_MODE
9945 };
9946 
9947 /* iWARP MPA Enhanced mode RTR types */
9948 enum mpa_rtr_type {
9949 	MPA_RTR_TYPE_NONE = 0,
9950 	MPA_RTR_TYPE_ZERO_SEND = 1,
9951 	MPA_RTR_TYPE_ZERO_WRITE = 2,
9952 	MPA_RTR_TYPE_ZERO_SEND_AND_WRITE = 3,
9953 	MPA_RTR_TYPE_ZERO_READ = 4,
9954 	MPA_RTR_TYPE_ZERO_SEND_AND_READ = 5,
9955 	MPA_RTR_TYPE_ZERO_WRITE_AND_READ = 6,
9956 	MPA_RTR_TYPE_ZERO_SEND_AND_WRITE_AND_READ = 7,
9957 	MAX_MPA_RTR_TYPE
9958 };
9959 
9960 /* unaligned opaque data received from LL2 */
9961 struct unaligned_opaque_data {
9962 	__le16 first_mpa_offset;
9963 	u8 tcp_payload_offset;
9964 	u8 flags;
9965 #define UNALIGNED_OPAQUE_DATA_PKT_REACHED_WIN_RIGHT_EDGE_MASK	0x1
9966 #define UNALIGNED_OPAQUE_DATA_PKT_REACHED_WIN_RIGHT_EDGE_SHIFT	0
9967 #define UNALIGNED_OPAQUE_DATA_CONNECTION_CLOSED_MASK		0x1
9968 #define UNALIGNED_OPAQUE_DATA_CONNECTION_CLOSED_SHIFT		1
9969 #define UNALIGNED_OPAQUE_DATA_RESERVED_MASK			0x3F
9970 #define UNALIGNED_OPAQUE_DATA_RESERVED_SHIFT			2
9971 	__le32 cid;
9972 };
9973 
9974 struct e4_mstorm_iwarp_conn_ag_ctx {
9975 	u8 reserved;
9976 	u8 state;
9977 	u8 flags0;
9978 #define E4_MSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_MASK		0x1
9979 #define E4_MSTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT		0
9980 #define E4_MSTORM_IWARP_CONN_AG_CTX_BIT1_MASK			0x1
9981 #define E4_MSTORM_IWARP_CONN_AG_CTX_BIT1_SHIFT			1
9982 #define E4_MSTORM_IWARP_CONN_AG_CTX_INV_STAG_DONE_CF_MASK	0x3
9983 #define E4_MSTORM_IWARP_CONN_AG_CTX_INV_STAG_DONE_CF_SHIFT	2
9984 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF1_MASK			0x3
9985 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF1_SHIFT			4
9986 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF2_MASK			0x3
9987 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF2_SHIFT			6
9988 	u8 flags1;
9989 #define E4_MSTORM_IWARP_CONN_AG_CTX_INV_STAG_DONE_CF_EN_MASK	0x1
9990 #define E4_MSTORM_IWARP_CONN_AG_CTX_INV_STAG_DONE_CF_EN_SHIFT	0
9991 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF1EN_MASK			0x1
9992 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF1EN_SHIFT			1
9993 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF2EN_MASK			0x1
9994 #define E4_MSTORM_IWARP_CONN_AG_CTX_CF2EN_SHIFT			2
9995 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE0EN_MASK		0x1
9996 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE0EN_SHIFT		3
9997 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE1EN_MASK		0x1
9998 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE1EN_SHIFT		4
9999 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE2EN_MASK		0x1
10000 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE2EN_SHIFT		5
10001 #define E4_MSTORM_IWARP_CONN_AG_CTX_RCQ_CONS_EN_MASK		0x1
10002 #define E4_MSTORM_IWARP_CONN_AG_CTX_RCQ_CONS_EN_SHIFT		6
10003 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE4EN_MASK		0x1
10004 #define E4_MSTORM_IWARP_CONN_AG_CTX_RULE4EN_SHIFT		7
10005 	__le16 rcq_cons;
10006 	__le16 rcq_cons_th;
10007 	__le32 reg0;
10008 	__le32 reg1;
10009 };
10010 
10011 struct e4_ustorm_iwarp_conn_ag_ctx {
10012 	u8 reserved;
10013 	u8 byte1;
10014 	u8 flags0;
10015 #define E4_USTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
10016 #define E4_USTORM_IWARP_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
10017 #define E4_USTORM_IWARP_CONN_AG_CTX_BIT1_MASK		0x1
10018 #define E4_USTORM_IWARP_CONN_AG_CTX_BIT1_SHIFT		1
10019 #define E4_USTORM_IWARP_CONN_AG_CTX_CF0_MASK		0x3
10020 #define E4_USTORM_IWARP_CONN_AG_CTX_CF0_SHIFT		2
10021 #define E4_USTORM_IWARP_CONN_AG_CTX_CF1_MASK		0x3
10022 #define E4_USTORM_IWARP_CONN_AG_CTX_CF1_SHIFT		4
10023 #define E4_USTORM_IWARP_CONN_AG_CTX_CF2_MASK		0x3
10024 #define E4_USTORM_IWARP_CONN_AG_CTX_CF2_SHIFT		6
10025 	u8 flags1;
10026 #define E4_USTORM_IWARP_CONN_AG_CTX_CF3_MASK		0x3
10027 #define E4_USTORM_IWARP_CONN_AG_CTX_CF3_SHIFT		0
10028 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_SE_CF_MASK	0x3
10029 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_SE_CF_SHIFT	2
10030 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_CF_MASK	0x3
10031 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_CF_SHIFT	4
10032 #define E4_USTORM_IWARP_CONN_AG_CTX_CF6_MASK		0x3
10033 #define E4_USTORM_IWARP_CONN_AG_CTX_CF6_SHIFT		6
10034 	u8 flags2;
10035 #define E4_USTORM_IWARP_CONN_AG_CTX_CF0EN_MASK			0x1
10036 #define E4_USTORM_IWARP_CONN_AG_CTX_CF0EN_SHIFT			0
10037 #define E4_USTORM_IWARP_CONN_AG_CTX_CF1EN_MASK			0x1
10038 #define E4_USTORM_IWARP_CONN_AG_CTX_CF1EN_SHIFT			1
10039 #define E4_USTORM_IWARP_CONN_AG_CTX_CF2EN_MASK			0x1
10040 #define E4_USTORM_IWARP_CONN_AG_CTX_CF2EN_SHIFT			2
10041 #define E4_USTORM_IWARP_CONN_AG_CTX_CF3EN_MASK			0x1
10042 #define E4_USTORM_IWARP_CONN_AG_CTX_CF3EN_SHIFT			3
10043 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_SE_CF_EN_MASK	0x1
10044 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_SE_CF_EN_SHIFT	4
10045 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_CF_EN_MASK		0x1
10046 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_ARM_CF_EN_SHIFT		5
10047 #define E4_USTORM_IWARP_CONN_AG_CTX_CF6EN_MASK			0x1
10048 #define E4_USTORM_IWARP_CONN_AG_CTX_CF6EN_SHIFT			6
10049 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_SE_EN_MASK		0x1
10050 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_SE_EN_SHIFT		7
10051 	u8 flags3;
10052 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_EN_MASK		0x1
10053 #define E4_USTORM_IWARP_CONN_AG_CTX_CQ_EN_SHIFT		0
10054 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE2EN_MASK	0x1
10055 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE2EN_SHIFT	1
10056 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE3EN_MASK	0x1
10057 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE3EN_SHIFT	2
10058 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE4EN_MASK	0x1
10059 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE4EN_SHIFT	3
10060 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE5EN_MASK	0x1
10061 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE5EN_SHIFT	4
10062 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE6EN_MASK	0x1
10063 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE6EN_SHIFT	5
10064 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE7EN_MASK	0x1
10065 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE7EN_SHIFT	6
10066 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE8EN_MASK	0x1
10067 #define E4_USTORM_IWARP_CONN_AG_CTX_RULE8EN_SHIFT	7
10068 	u8 byte2;
10069 	u8 byte3;
10070 	__le16 word0;
10071 	__le16 word1;
10072 	__le32 cq_cons;
10073 	__le32 cq_se_prod;
10074 	__le32 cq_prod;
10075 	__le32 reg3;
10076 	__le16 word2;
10077 	__le16 word3;
10078 };
10079 
10080 struct e4_ystorm_iwarp_conn_ag_ctx {
10081 	u8 byte0;
10082 	u8 byte1;
10083 	u8 flags0;
10084 #define E4_YSTORM_IWARP_CONN_AG_CTX_BIT0_MASK	0x1
10085 #define E4_YSTORM_IWARP_CONN_AG_CTX_BIT0_SHIFT	0
10086 #define E4_YSTORM_IWARP_CONN_AG_CTX_BIT1_MASK	0x1
10087 #define E4_YSTORM_IWARP_CONN_AG_CTX_BIT1_SHIFT	1
10088 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF0_MASK	0x3
10089 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF0_SHIFT	2
10090 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF1_MASK	0x3
10091 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF1_SHIFT	4
10092 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF2_MASK	0x3
10093 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF2_SHIFT	6
10094 	u8 flags1;
10095 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF0EN_MASK		0x1
10096 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF0EN_SHIFT		0
10097 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF1EN_MASK		0x1
10098 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF1EN_SHIFT		1
10099 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF2EN_MASK		0x1
10100 #define E4_YSTORM_IWARP_CONN_AG_CTX_CF2EN_SHIFT		2
10101 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE0EN_MASK	0x1
10102 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE0EN_SHIFT	3
10103 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE1EN_MASK	0x1
10104 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE1EN_SHIFT	4
10105 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE2EN_MASK	0x1
10106 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE2EN_SHIFT	5
10107 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE3EN_MASK	0x1
10108 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE3EN_SHIFT	6
10109 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE4EN_MASK	0x1
10110 #define E4_YSTORM_IWARP_CONN_AG_CTX_RULE4EN_SHIFT	7
10111 	u8 byte2;
10112 	u8 byte3;
10113 	__le16 word0;
10114 	__le32 reg0;
10115 	__le32 reg1;
10116 	__le16 word1;
10117 	__le16 word2;
10118 	__le16 word3;
10119 	__le16 word4;
10120 	__le32 reg2;
10121 	__le32 reg3;
10122 };
10123 
10124 /* The fcoe storm context of Ystorm */
10125 struct ystorm_fcoe_conn_st_ctx {
10126 	u8 func_mode;
10127 	u8 cos;
10128 	u8 conf_version;
10129 	u8 eth_hdr_size;
10130 	__le16 stat_ram_addr;
10131 	__le16 mtu;
10132 	__le16 max_fc_payload_len;
10133 	__le16 tx_max_fc_pay_len;
10134 	u8 fcp_cmd_size;
10135 	u8 fcp_rsp_size;
10136 	__le16 mss;
10137 	struct regpair reserved;
10138 	__le16 min_frame_size;
10139 	u8 protection_info_flags;
10140 #define YSTORM_FCOE_CONN_ST_CTX_SUPPORT_PROTECTION_MASK		0x1
10141 #define YSTORM_FCOE_CONN_ST_CTX_SUPPORT_PROTECTION_SHIFT	0
10142 #define YSTORM_FCOE_CONN_ST_CTX_VALID_MASK			0x1
10143 #define YSTORM_FCOE_CONN_ST_CTX_VALID_SHIFT			1
10144 #define YSTORM_FCOE_CONN_ST_CTX_RESERVED1_MASK			0x3F
10145 #define YSTORM_FCOE_CONN_ST_CTX_RESERVED1_SHIFT			2
10146 	u8 dst_protection_per_mss;
10147 	u8 src_protection_per_mss;
10148 	u8 ptu_log_page_size;
10149 	u8 flags;
10150 #define YSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_MASK	0x1
10151 #define YSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_SHIFT	0
10152 #define YSTORM_FCOE_CONN_ST_CTX_OUTER_VLAN_FLAG_MASK	0x1
10153 #define YSTORM_FCOE_CONN_ST_CTX_OUTER_VLAN_FLAG_SHIFT	1
10154 #define YSTORM_FCOE_CONN_ST_CTX_RSRV_MASK		0x3F
10155 #define YSTORM_FCOE_CONN_ST_CTX_RSRV_SHIFT		2
10156 	u8 fcp_xfer_size;
10157 };
10158 
10159 /* FCoE 16-bits vlan structure */
10160 struct fcoe_vlan_fields {
10161 	__le16 fields;
10162 #define FCOE_VLAN_FIELDS_VID_MASK	0xFFF
10163 #define FCOE_VLAN_FIELDS_VID_SHIFT	0
10164 #define FCOE_VLAN_FIELDS_CLI_MASK	0x1
10165 #define FCOE_VLAN_FIELDS_CLI_SHIFT	12
10166 #define FCOE_VLAN_FIELDS_PRI_MASK	0x7
10167 #define FCOE_VLAN_FIELDS_PRI_SHIFT	13
10168 };
10169 
10170 /* FCoE 16-bits vlan union */
10171 union fcoe_vlan_field_union {
10172 	struct fcoe_vlan_fields fields;
10173 	__le16 val;
10174 };
10175 
10176 /* FCoE 16-bits vlan, vif union */
10177 union fcoe_vlan_vif_field_union {
10178 	union fcoe_vlan_field_union vlan;
10179 	__le16 vif;
10180 };
10181 
10182 /* Ethernet context section */
10183 struct pstorm_fcoe_eth_context_section {
10184 	u8 remote_addr_3;
10185 	u8 remote_addr_2;
10186 	u8 remote_addr_1;
10187 	u8 remote_addr_0;
10188 	u8 local_addr_1;
10189 	u8 local_addr_0;
10190 	u8 remote_addr_5;
10191 	u8 remote_addr_4;
10192 	u8 local_addr_5;
10193 	u8 local_addr_4;
10194 	u8 local_addr_3;
10195 	u8 local_addr_2;
10196 	union fcoe_vlan_vif_field_union vif_outer_vlan;
10197 	__le16 vif_outer_eth_type;
10198 	union fcoe_vlan_vif_field_union inner_vlan;
10199 	__le16 inner_eth_type;
10200 };
10201 
10202 /* The fcoe storm context of Pstorm */
10203 struct pstorm_fcoe_conn_st_ctx {
10204 	u8 func_mode;
10205 	u8 cos;
10206 	u8 conf_version;
10207 	u8 rsrv;
10208 	__le16 stat_ram_addr;
10209 	__le16 mss;
10210 	struct regpair abts_cleanup_addr;
10211 	struct pstorm_fcoe_eth_context_section eth;
10212 	u8 sid_2;
10213 	u8 sid_1;
10214 	u8 sid_0;
10215 	u8 flags;
10216 #define PSTORM_FCOE_CONN_ST_CTX_VNTAG_VLAN_MASK			0x1
10217 #define PSTORM_FCOE_CONN_ST_CTX_VNTAG_VLAN_SHIFT		0
10218 #define PSTORM_FCOE_CONN_ST_CTX_SUPPORT_REC_RR_TOV_MASK		0x1
10219 #define PSTORM_FCOE_CONN_ST_CTX_SUPPORT_REC_RR_TOV_SHIFT	1
10220 #define PSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_MASK		0x1
10221 #define PSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_SHIFT		2
10222 #define PSTORM_FCOE_CONN_ST_CTX_OUTER_VLAN_FLAG_MASK		0x1
10223 #define PSTORM_FCOE_CONN_ST_CTX_OUTER_VLAN_FLAG_SHIFT		3
10224 #define PSTORM_FCOE_CONN_ST_CTX_SINGLE_VLAN_FLAG_MASK		0x1
10225 #define PSTORM_FCOE_CONN_ST_CTX_SINGLE_VLAN_FLAG_SHIFT		4
10226 #define PSTORM_FCOE_CONN_ST_CTX_RESERVED_MASK			0x7
10227 #define PSTORM_FCOE_CONN_ST_CTX_RESERVED_SHIFT			5
10228 	u8 did_2;
10229 	u8 did_1;
10230 	u8 did_0;
10231 	u8 src_mac_index;
10232 	__le16 rec_rr_tov_val;
10233 	u8 q_relative_offset;
10234 	u8 reserved1;
10235 };
10236 
10237 /* The fcoe storm context of Xstorm */
10238 struct xstorm_fcoe_conn_st_ctx {
10239 	u8 func_mode;
10240 	u8 src_mac_index;
10241 	u8 conf_version;
10242 	u8 cached_wqes_avail;
10243 	__le16 stat_ram_addr;
10244 	u8 flags;
10245 #define XSTORM_FCOE_CONN_ST_CTX_SQ_DEFERRED_MASK		0x1
10246 #define XSTORM_FCOE_CONN_ST_CTX_SQ_DEFERRED_SHIFT		0
10247 #define XSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_MASK		0x1
10248 #define XSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_SHIFT		1
10249 #define XSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_ORIG_MASK	0x1
10250 #define XSTORM_FCOE_CONN_ST_CTX_INNER_VLAN_FLAG_ORIG_SHIFT	2
10251 #define XSTORM_FCOE_CONN_ST_CTX_LAST_QUEUE_HANDLED_MASK		0x3
10252 #define XSTORM_FCOE_CONN_ST_CTX_LAST_QUEUE_HANDLED_SHIFT	3
10253 #define XSTORM_FCOE_CONN_ST_CTX_RSRV_MASK			0x7
10254 #define XSTORM_FCOE_CONN_ST_CTX_RSRV_SHIFT			5
10255 	u8 cached_wqes_offset;
10256 	u8 reserved2;
10257 	u8 eth_hdr_size;
10258 	u8 seq_id;
10259 	u8 max_conc_seqs;
10260 	__le16 num_pages_in_pbl;
10261 	__le16 reserved;
10262 	struct regpair sq_pbl_addr;
10263 	struct regpair sq_curr_page_addr;
10264 	struct regpair sq_next_page_addr;
10265 	struct regpair xferq_pbl_addr;
10266 	struct regpair xferq_curr_page_addr;
10267 	struct regpair xferq_next_page_addr;
10268 	struct regpair respq_pbl_addr;
10269 	struct regpair respq_curr_page_addr;
10270 	struct regpair respq_next_page_addr;
10271 	__le16 mtu;
10272 	__le16 tx_max_fc_pay_len;
10273 	__le16 max_fc_payload_len;
10274 	__le16 min_frame_size;
10275 	__le16 sq_pbl_next_index;
10276 	__le16 respq_pbl_next_index;
10277 	u8 fcp_cmd_byte_credit;
10278 	u8 fcp_rsp_byte_credit;
10279 	__le16 protection_info;
10280 #define XSTORM_FCOE_CONN_ST_CTX_PROTECTION_PERF_MASK		0x1
10281 #define XSTORM_FCOE_CONN_ST_CTX_PROTECTION_PERF_SHIFT		0
10282 #define XSTORM_FCOE_CONN_ST_CTX_SUPPORT_PROTECTION_MASK		0x1
10283 #define XSTORM_FCOE_CONN_ST_CTX_SUPPORT_PROTECTION_SHIFT	1
10284 #define XSTORM_FCOE_CONN_ST_CTX_VALID_MASK			0x1
10285 #define XSTORM_FCOE_CONN_ST_CTX_VALID_SHIFT			2
10286 #define XSTORM_FCOE_CONN_ST_CTX_FRAME_PROT_ALIGNED_MASK		0x1
10287 #define XSTORM_FCOE_CONN_ST_CTX_FRAME_PROT_ALIGNED_SHIFT	3
10288 #define XSTORM_FCOE_CONN_ST_CTX_RESERVED3_MASK			0xF
10289 #define XSTORM_FCOE_CONN_ST_CTX_RESERVED3_SHIFT			4
10290 #define XSTORM_FCOE_CONN_ST_CTX_DST_PROTECTION_PER_MSS_MASK	0xFF
10291 #define XSTORM_FCOE_CONN_ST_CTX_DST_PROTECTION_PER_MSS_SHIFT	8
10292 	__le16 xferq_pbl_next_index;
10293 	__le16 page_size;
10294 	u8 mid_seq;
10295 	u8 fcp_xfer_byte_credit;
10296 	u8 reserved1[2];
10297 	struct fcoe_wqe cached_wqes[16];
10298 };
10299 
10300 struct e4_xstorm_fcoe_conn_ag_ctx {
10301 	u8 reserved0;
10302 	u8 state;
10303 	u8 flags0;
10304 #define E4_XSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
10305 #define E4_XSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
10306 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED1_MASK	0x1
10307 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED1_SHIFT	1
10308 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED2_MASK	0x1
10309 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED2_SHIFT	2
10310 #define E4_XSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
10311 #define E4_XSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
10312 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED3_MASK	0x1
10313 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED3_SHIFT	4
10314 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED4_MASK	0x1
10315 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED4_SHIFT	5
10316 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED5_MASK	0x1
10317 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED5_SHIFT	6
10318 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED6_MASK	0x1
10319 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED6_SHIFT	7
10320 	u8 flags1;
10321 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED7_MASK	0x1
10322 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED7_SHIFT	0
10323 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED8_MASK	0x1
10324 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED8_SHIFT	1
10325 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED9_MASK	0x1
10326 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED9_SHIFT	2
10327 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT11_MASK		0x1
10328 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT11_SHIFT		3
10329 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT12_MASK		0x1
10330 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT12_SHIFT		4
10331 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT13_MASK		0x1
10332 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT13_SHIFT		5
10333 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT14_MASK		0x1
10334 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT14_SHIFT		6
10335 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT15_MASK		0x1
10336 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT15_SHIFT		7
10337 	u8 flags2;
10338 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF0_MASK	0x3
10339 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF0_SHIFT	0
10340 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF1_MASK	0x3
10341 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF1_SHIFT	2
10342 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF2_MASK	0x3
10343 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF2_SHIFT	4
10344 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF3_MASK	0x3
10345 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF3_SHIFT	6
10346 	u8 flags3;
10347 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF4_MASK	0x3
10348 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF4_SHIFT	0
10349 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF5_MASK	0x3
10350 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF5_SHIFT	2
10351 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF6_MASK	0x3
10352 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF6_SHIFT	4
10353 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF7_MASK	0x3
10354 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF7_SHIFT	6
10355 	u8 flags4;
10356 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF8_MASK	0x3
10357 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF8_SHIFT	0
10358 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF9_MASK	0x3
10359 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF9_SHIFT	2
10360 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF10_MASK	0x3
10361 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF10_SHIFT	4
10362 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF11_MASK	0x3
10363 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF11_SHIFT	6
10364 	u8 flags5;
10365 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF12_MASK	0x3
10366 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF12_SHIFT	0
10367 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF13_MASK	0x3
10368 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF13_SHIFT	2
10369 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF14_MASK	0x3
10370 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF14_SHIFT	4
10371 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF15_MASK	0x3
10372 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF15_SHIFT	6
10373 	u8 flags6;
10374 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF16_MASK	0x3
10375 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF16_SHIFT	0
10376 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF17_MASK	0x3
10377 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF17_SHIFT	2
10378 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF18_MASK	0x3
10379 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF18_SHIFT	4
10380 #define E4_XSTORM_FCOE_CONN_AG_CTX_DQ_CF_MASK	0x3
10381 #define E4_XSTORM_FCOE_CONN_AG_CTX_DQ_CF_SHIFT	6
10382 	u8 flags7;
10383 #define E4_XSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_MASK	0x3
10384 #define E4_XSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_SHIFT	0
10385 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED10_MASK	0x3
10386 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED10_SHIFT	2
10387 #define E4_XSTORM_FCOE_CONN_AG_CTX_SLOW_PATH_MASK	0x3
10388 #define E4_XSTORM_FCOE_CONN_AG_CTX_SLOW_PATH_SHIFT	4
10389 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF0EN_MASK		0x1
10390 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF0EN_SHIFT		6
10391 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF1EN_MASK		0x1
10392 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF1EN_SHIFT		7
10393 	u8 flags8;
10394 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF2EN_MASK	0x1
10395 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF2EN_SHIFT	0
10396 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF3EN_MASK	0x1
10397 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF3EN_SHIFT	1
10398 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF4EN_MASK	0x1
10399 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF4EN_SHIFT	2
10400 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF5EN_MASK	0x1
10401 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF5EN_SHIFT	3
10402 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF6EN_MASK	0x1
10403 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF6EN_SHIFT	4
10404 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF7EN_MASK	0x1
10405 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF7EN_SHIFT	5
10406 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF8EN_MASK	0x1
10407 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF8EN_SHIFT	6
10408 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF9EN_MASK	0x1
10409 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF9EN_SHIFT	7
10410 	u8 flags9;
10411 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF10EN_MASK	0x1
10412 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF10EN_SHIFT	0
10413 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF11EN_MASK	0x1
10414 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF11EN_SHIFT	1
10415 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF12EN_MASK	0x1
10416 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF12EN_SHIFT	2
10417 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF13EN_MASK	0x1
10418 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF13EN_SHIFT	3
10419 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF14EN_MASK	0x1
10420 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF14EN_SHIFT	4
10421 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF15EN_MASK	0x1
10422 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF15EN_SHIFT	5
10423 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF16EN_MASK	0x1
10424 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF16EN_SHIFT	6
10425 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF17EN_MASK	0x1
10426 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF17EN_SHIFT	7
10427 	u8 flags10;
10428 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF18EN_MASK		0x1
10429 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF18EN_SHIFT		0
10430 #define E4_XSTORM_FCOE_CONN_AG_CTX_DQ_CF_EN_MASK	0x1
10431 #define E4_XSTORM_FCOE_CONN_AG_CTX_DQ_CF_EN_SHIFT	1
10432 #define E4_XSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_EN_MASK	0x1
10433 #define E4_XSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT	2
10434 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED11_MASK	0x1
10435 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED11_SHIFT	3
10436 #define E4_XSTORM_FCOE_CONN_AG_CTX_SLOW_PATH_EN_MASK	0x1
10437 #define E4_XSTORM_FCOE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT	4
10438 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF23EN_MASK		0x1
10439 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF23EN_SHIFT		5
10440 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED12_MASK	0x1
10441 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED12_SHIFT	6
10442 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED13_MASK	0x1
10443 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED13_SHIFT	7
10444 	u8 flags11;
10445 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED14_MASK		0x1
10446 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED14_SHIFT		0
10447 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED15_MASK		0x1
10448 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED15_SHIFT		1
10449 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED16_MASK		0x1
10450 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESERVED16_SHIFT		2
10451 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE5EN_MASK			0x1
10452 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE5EN_SHIFT		3
10453 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE6EN_MASK			0x1
10454 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE6EN_SHIFT		4
10455 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE7EN_MASK			0x1
10456 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE7EN_SHIFT		5
10457 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED1_MASK		0x1
10458 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED1_SHIFT		6
10459 #define E4_XSTORM_FCOE_CONN_AG_CTX_XFERQ_DECISION_EN_MASK	0x1
10460 #define E4_XSTORM_FCOE_CONN_AG_CTX_XFERQ_DECISION_EN_SHIFT	7
10461 	u8 flags12;
10462 #define E4_XSTORM_FCOE_CONN_AG_CTX_SQ_DECISION_EN_MASK	0x1
10463 #define E4_XSTORM_FCOE_CONN_AG_CTX_SQ_DECISION_EN_SHIFT	0
10464 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE11EN_MASK	0x1
10465 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE11EN_SHIFT	1
10466 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED2_MASK	0x1
10467 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED2_SHIFT	2
10468 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED3_MASK	0x1
10469 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED3_SHIFT	3
10470 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE14EN_MASK	0x1
10471 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE14EN_SHIFT	4
10472 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE15EN_MASK	0x1
10473 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE15EN_SHIFT	5
10474 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE16EN_MASK	0x1
10475 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE16EN_SHIFT	6
10476 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE17EN_MASK	0x1
10477 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE17EN_SHIFT	7
10478 	u8 flags13;
10479 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESPQ_DECISION_EN_MASK	0x1
10480 #define E4_XSTORM_FCOE_CONN_AG_CTX_RESPQ_DECISION_EN_SHIFT	0
10481 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE19EN_MASK		0x1
10482 #define E4_XSTORM_FCOE_CONN_AG_CTX_RULE19EN_SHIFT		1
10483 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED4_MASK		0x1
10484 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED4_SHIFT		2
10485 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED5_MASK		0x1
10486 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED5_SHIFT		3
10487 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED6_MASK		0x1
10488 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED6_SHIFT		4
10489 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED7_MASK		0x1
10490 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED7_SHIFT		5
10491 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED8_MASK		0x1
10492 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED8_SHIFT		6
10493 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED9_MASK		0x1
10494 #define E4_XSTORM_FCOE_CONN_AG_CTX_A0_RESERVED9_SHIFT		7
10495 	u8 flags14;
10496 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT16_MASK	0x1
10497 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT16_SHIFT	0
10498 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT17_MASK	0x1
10499 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT17_SHIFT	1
10500 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT18_MASK	0x1
10501 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT18_SHIFT	2
10502 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT19_MASK	0x1
10503 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT19_SHIFT	3
10504 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT20_MASK	0x1
10505 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT20_SHIFT	4
10506 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT21_MASK	0x1
10507 #define E4_XSTORM_FCOE_CONN_AG_CTX_BIT21_SHIFT	5
10508 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF23_MASK	0x3
10509 #define E4_XSTORM_FCOE_CONN_AG_CTX_CF23_SHIFT	6
10510 	u8 byte2;
10511 	__le16 physical_q0;
10512 	__le16 word1;
10513 	__le16 word2;
10514 	__le16 sq_cons;
10515 	__le16 sq_prod;
10516 	__le16 xferq_prod;
10517 	__le16 xferq_cons;
10518 	u8 byte3;
10519 	u8 byte4;
10520 	u8 byte5;
10521 	u8 byte6;
10522 	__le32 remain_io;
10523 	__le32 reg1;
10524 	__le32 reg2;
10525 	__le32 reg3;
10526 	__le32 reg4;
10527 	__le32 reg5;
10528 	__le32 reg6;
10529 	__le16 respq_prod;
10530 	__le16 respq_cons;
10531 	__le16 word9;
10532 	__le16 word10;
10533 	__le32 reg7;
10534 	__le32 reg8;
10535 };
10536 
10537 /* The fcoe storm context of Ustorm */
10538 struct ustorm_fcoe_conn_st_ctx {
10539 	struct regpair respq_pbl_addr;
10540 	__le16 num_pages_in_pbl;
10541 	u8 ptu_log_page_size;
10542 	u8 log_page_size;
10543 	__le16 respq_prod;
10544 	u8 reserved[2];
10545 };
10546 
10547 struct e4_tstorm_fcoe_conn_ag_ctx {
10548 	u8 reserved0;
10549 	u8 state;
10550 	u8 flags0;
10551 #define E4_TSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
10552 #define E4_TSTORM_FCOE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
10553 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT1_MASK		0x1
10554 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT1_SHIFT		1
10555 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT2_MASK		0x1
10556 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT2_SHIFT		2
10557 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT3_MASK		0x1
10558 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT3_SHIFT		3
10559 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT4_MASK		0x1
10560 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT4_SHIFT		4
10561 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT5_MASK		0x1
10562 #define E4_TSTORM_FCOE_CONN_AG_CTX_BIT5_SHIFT		5
10563 #define E4_TSTORM_FCOE_CONN_AG_CTX_DUMMY_TIMER_CF_MASK	0x3
10564 #define E4_TSTORM_FCOE_CONN_AG_CTX_DUMMY_TIMER_CF_SHIFT	6
10565 	u8 flags1;
10566 #define E4_TSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_CF_MASK		0x3
10567 #define E4_TSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_CF_SHIFT		0
10568 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF2_MASK			0x3
10569 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF2_SHIFT			2
10570 #define E4_TSTORM_FCOE_CONN_AG_CTX_TIMER_STOP_ALL_CF_MASK	0x3
10571 #define E4_TSTORM_FCOE_CONN_AG_CTX_TIMER_STOP_ALL_CF_SHIFT	4
10572 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF4_MASK			0x3
10573 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF4_SHIFT			6
10574 	u8 flags2;
10575 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF5_MASK	0x3
10576 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF5_SHIFT	0
10577 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF6_MASK	0x3
10578 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF6_SHIFT	2
10579 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF7_MASK	0x3
10580 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF7_SHIFT	4
10581 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF8_MASK	0x3
10582 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF8_SHIFT	6
10583 	u8 flags3;
10584 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF9_MASK			0x3
10585 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF9_SHIFT			0
10586 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF10_MASK			0x3
10587 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF10_SHIFT			2
10588 #define E4_TSTORM_FCOE_CONN_AG_CTX_DUMMY_TIMER_CF_EN_MASK	0x1
10589 #define E4_TSTORM_FCOE_CONN_AG_CTX_DUMMY_TIMER_CF_EN_SHIFT	4
10590 #define E4_TSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_CF_EN_MASK		0x1
10591 #define E4_TSTORM_FCOE_CONN_AG_CTX_FLUSH_Q0_CF_EN_SHIFT		5
10592 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF2EN_MASK			0x1
10593 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF2EN_SHIFT			6
10594 #define E4_TSTORM_FCOE_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_MASK	0x1
10595 #define E4_TSTORM_FCOE_CONN_AG_CTX_TIMER_STOP_ALL_CF_EN_SHIFT	7
10596 	u8 flags4;
10597 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF4EN_MASK		0x1
10598 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF4EN_SHIFT		0
10599 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF5EN_MASK		0x1
10600 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF5EN_SHIFT		1
10601 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF6EN_MASK		0x1
10602 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF6EN_SHIFT		2
10603 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF7EN_MASK		0x1
10604 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF7EN_SHIFT		3
10605 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF8EN_MASK		0x1
10606 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF8EN_SHIFT		4
10607 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF9EN_MASK		0x1
10608 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF9EN_SHIFT		5
10609 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF10EN_MASK		0x1
10610 #define E4_TSTORM_FCOE_CONN_AG_CTX_CF10EN_SHIFT		6
10611 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE0EN_MASK		0x1
10612 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE0EN_SHIFT	7
10613 	u8 flags5;
10614 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE1EN_MASK		0x1
10615 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE1EN_SHIFT	0
10616 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE2EN_MASK		0x1
10617 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE2EN_SHIFT	1
10618 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE3EN_MASK		0x1
10619 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE3EN_SHIFT	2
10620 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE4EN_MASK		0x1
10621 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE4EN_SHIFT	3
10622 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE5EN_MASK		0x1
10623 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE5EN_SHIFT	4
10624 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE6EN_MASK		0x1
10625 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE6EN_SHIFT	5
10626 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE7EN_MASK		0x1
10627 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE7EN_SHIFT	6
10628 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE8EN_MASK		0x1
10629 #define E4_TSTORM_FCOE_CONN_AG_CTX_RULE8EN_SHIFT	7
10630 	__le32 reg0;
10631 	__le32 reg1;
10632 };
10633 
10634 struct e4_ustorm_fcoe_conn_ag_ctx {
10635 	u8 byte0;
10636 	u8 byte1;
10637 	u8 flags0;
10638 #define E4_USTORM_FCOE_CONN_AG_CTX_BIT0_MASK	0x1
10639 #define E4_USTORM_FCOE_CONN_AG_CTX_BIT0_SHIFT	0
10640 #define E4_USTORM_FCOE_CONN_AG_CTX_BIT1_MASK	0x1
10641 #define E4_USTORM_FCOE_CONN_AG_CTX_BIT1_SHIFT	1
10642 #define E4_USTORM_FCOE_CONN_AG_CTX_CF0_MASK	0x3
10643 #define E4_USTORM_FCOE_CONN_AG_CTX_CF0_SHIFT	2
10644 #define E4_USTORM_FCOE_CONN_AG_CTX_CF1_MASK	0x3
10645 #define E4_USTORM_FCOE_CONN_AG_CTX_CF1_SHIFT	4
10646 #define E4_USTORM_FCOE_CONN_AG_CTX_CF2_MASK	0x3
10647 #define E4_USTORM_FCOE_CONN_AG_CTX_CF2_SHIFT	6
10648 	u8 flags1;
10649 #define E4_USTORM_FCOE_CONN_AG_CTX_CF3_MASK	0x3
10650 #define E4_USTORM_FCOE_CONN_AG_CTX_CF3_SHIFT	0
10651 #define E4_USTORM_FCOE_CONN_AG_CTX_CF4_MASK	0x3
10652 #define E4_USTORM_FCOE_CONN_AG_CTX_CF4_SHIFT	2
10653 #define E4_USTORM_FCOE_CONN_AG_CTX_CF5_MASK	0x3
10654 #define E4_USTORM_FCOE_CONN_AG_CTX_CF5_SHIFT	4
10655 #define E4_USTORM_FCOE_CONN_AG_CTX_CF6_MASK	0x3
10656 #define E4_USTORM_FCOE_CONN_AG_CTX_CF6_SHIFT	6
10657 	u8 flags2;
10658 #define E4_USTORM_FCOE_CONN_AG_CTX_CF0EN_MASK		0x1
10659 #define E4_USTORM_FCOE_CONN_AG_CTX_CF0EN_SHIFT		0
10660 #define E4_USTORM_FCOE_CONN_AG_CTX_CF1EN_MASK		0x1
10661 #define E4_USTORM_FCOE_CONN_AG_CTX_CF1EN_SHIFT		1
10662 #define E4_USTORM_FCOE_CONN_AG_CTX_CF2EN_MASK		0x1
10663 #define E4_USTORM_FCOE_CONN_AG_CTX_CF2EN_SHIFT		2
10664 #define E4_USTORM_FCOE_CONN_AG_CTX_CF3EN_MASK		0x1
10665 #define E4_USTORM_FCOE_CONN_AG_CTX_CF3EN_SHIFT		3
10666 #define E4_USTORM_FCOE_CONN_AG_CTX_CF4EN_MASK		0x1
10667 #define E4_USTORM_FCOE_CONN_AG_CTX_CF4EN_SHIFT		4
10668 #define E4_USTORM_FCOE_CONN_AG_CTX_CF5EN_MASK		0x1
10669 #define E4_USTORM_FCOE_CONN_AG_CTX_CF5EN_SHIFT		5
10670 #define E4_USTORM_FCOE_CONN_AG_CTX_CF6EN_MASK		0x1
10671 #define E4_USTORM_FCOE_CONN_AG_CTX_CF6EN_SHIFT		6
10672 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE0EN_MASK		0x1
10673 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE0EN_SHIFT	7
10674 	u8 flags3;
10675 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE1EN_MASK		0x1
10676 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE1EN_SHIFT	0
10677 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE2EN_MASK		0x1
10678 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE2EN_SHIFT	1
10679 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE3EN_MASK		0x1
10680 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE3EN_SHIFT	2
10681 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE4EN_MASK		0x1
10682 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE4EN_SHIFT	3
10683 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE5EN_MASK		0x1
10684 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE5EN_SHIFT	4
10685 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE6EN_MASK		0x1
10686 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE6EN_SHIFT	5
10687 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE7EN_MASK		0x1
10688 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE7EN_SHIFT	6
10689 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE8EN_MASK		0x1
10690 #define E4_USTORM_FCOE_CONN_AG_CTX_RULE8EN_SHIFT	7
10691 	u8 byte2;
10692 	u8 byte3;
10693 	__le16 word0;
10694 	__le16 word1;
10695 	__le32 reg0;
10696 	__le32 reg1;
10697 	__le32 reg2;
10698 	__le32 reg3;
10699 	__le16 word2;
10700 	__le16 word3;
10701 };
10702 
10703 /* The fcoe storm context of Tstorm */
10704 struct tstorm_fcoe_conn_st_ctx {
10705 	__le16 stat_ram_addr;
10706 	__le16 rx_max_fc_payload_len;
10707 	__le16 e_d_tov_val;
10708 	u8 flags;
10709 #define TSTORM_FCOE_CONN_ST_CTX_INC_SEQ_CNT_MASK	0x1
10710 #define TSTORM_FCOE_CONN_ST_CTX_INC_SEQ_CNT_SHIFT	0
10711 #define TSTORM_FCOE_CONN_ST_CTX_SUPPORT_CONF_MASK	0x1
10712 #define TSTORM_FCOE_CONN_ST_CTX_SUPPORT_CONF_SHIFT	1
10713 #define TSTORM_FCOE_CONN_ST_CTX_DEF_Q_IDX_MASK		0x3F
10714 #define TSTORM_FCOE_CONN_ST_CTX_DEF_Q_IDX_SHIFT		2
10715 	u8 timers_cleanup_invocation_cnt;
10716 	__le32 reserved1[2];
10717 	__le32 dst_mac_address_bytes_0_to_3;
10718 	__le16 dst_mac_address_bytes_4_to_5;
10719 	__le16 ramrod_echo;
10720 	u8 flags1;
10721 #define TSTORM_FCOE_CONN_ST_CTX_MODE_MASK	0x3
10722 #define TSTORM_FCOE_CONN_ST_CTX_MODE_SHIFT	0
10723 #define TSTORM_FCOE_CONN_ST_CTX_RESERVED_MASK	0x3F
10724 #define TSTORM_FCOE_CONN_ST_CTX_RESERVED_SHIFT	2
10725 	u8 cq_relative_offset;
10726 	u8 cmdq_relative_offset;
10727 	u8 bdq_resource_id;
10728 	u8 reserved0[4];
10729 };
10730 
10731 struct e4_mstorm_fcoe_conn_ag_ctx {
10732 	u8 byte0;
10733 	u8 byte1;
10734 	u8 flags0;
10735 #define E4_MSTORM_FCOE_CONN_AG_CTX_BIT0_MASK	0x1
10736 #define E4_MSTORM_FCOE_CONN_AG_CTX_BIT0_SHIFT	0
10737 #define E4_MSTORM_FCOE_CONN_AG_CTX_BIT1_MASK	0x1
10738 #define E4_MSTORM_FCOE_CONN_AG_CTX_BIT1_SHIFT	1
10739 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF0_MASK	0x3
10740 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF0_SHIFT	2
10741 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF1_MASK	0x3
10742 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF1_SHIFT	4
10743 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF2_MASK	0x3
10744 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF2_SHIFT	6
10745 	u8 flags1;
10746 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF0EN_MASK		0x1
10747 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF0EN_SHIFT		0
10748 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF1EN_MASK		0x1
10749 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF1EN_SHIFT		1
10750 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF2EN_MASK		0x1
10751 #define E4_MSTORM_FCOE_CONN_AG_CTX_CF2EN_SHIFT		2
10752 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE0EN_MASK		0x1
10753 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE0EN_SHIFT	3
10754 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE1EN_MASK		0x1
10755 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE1EN_SHIFT	4
10756 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE2EN_MASK		0x1
10757 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE2EN_SHIFT	5
10758 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE3EN_MASK		0x1
10759 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE3EN_SHIFT	6
10760 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE4EN_MASK		0x1
10761 #define E4_MSTORM_FCOE_CONN_AG_CTX_RULE4EN_SHIFT	7
10762 	__le16 word0;
10763 	__le16 word1;
10764 	__le32 reg0;
10765 	__le32 reg1;
10766 };
10767 
10768 /* Fast path part of the fcoe storm context of Mstorm */
10769 struct fcoe_mstorm_fcoe_conn_st_ctx_fp {
10770 	__le16 xfer_prod;
10771 	u8 num_cqs;
10772 	u8 reserved1;
10773 	u8 protection_info;
10774 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_SUPPORT_PROTECTION_MASK  0x1
10775 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_SUPPORT_PROTECTION_SHIFT 0
10776 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_VALID_MASK               0x1
10777 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_VALID_SHIFT              1
10778 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_RESERVED0_MASK           0x3F
10779 #define FCOE_MSTORM_FCOE_CONN_ST_CTX_FP_RESERVED0_SHIFT          2
10780 	u8 q_relative_offset;
10781 	u8 reserved2[2];
10782 };
10783 
10784 /* Non fast path part of the fcoe storm context of Mstorm */
10785 struct fcoe_mstorm_fcoe_conn_st_ctx_non_fp {
10786 	__le16 conn_id;
10787 	__le16 stat_ram_addr;
10788 	__le16 num_pages_in_pbl;
10789 	u8 ptu_log_page_size;
10790 	u8 log_page_size;
10791 	__le16 unsolicited_cq_count;
10792 	__le16 cmdq_count;
10793 	u8 bdq_resource_id;
10794 	u8 reserved0[3];
10795 	struct regpair xferq_pbl_addr;
10796 	struct regpair reserved1;
10797 	struct regpair reserved2[3];
10798 };
10799 
10800 /* The fcoe storm context of Mstorm */
10801 struct mstorm_fcoe_conn_st_ctx {
10802 	struct fcoe_mstorm_fcoe_conn_st_ctx_fp fp;
10803 	struct fcoe_mstorm_fcoe_conn_st_ctx_non_fp non_fp;
10804 };
10805 
10806 /* fcoe connection context */
10807 struct e4_fcoe_conn_context {
10808 	struct ystorm_fcoe_conn_st_ctx ystorm_st_context;
10809 	struct pstorm_fcoe_conn_st_ctx pstorm_st_context;
10810 	struct regpair pstorm_st_padding[2];
10811 	struct xstorm_fcoe_conn_st_ctx xstorm_st_context;
10812 	struct e4_xstorm_fcoe_conn_ag_ctx xstorm_ag_context;
10813 	struct regpair xstorm_ag_padding[6];
10814 	struct ustorm_fcoe_conn_st_ctx ustorm_st_context;
10815 	struct regpair ustorm_st_padding[2];
10816 	struct e4_tstorm_fcoe_conn_ag_ctx tstorm_ag_context;
10817 	struct regpair tstorm_ag_padding[2];
10818 	struct timers_context timer_context;
10819 	struct e4_ustorm_fcoe_conn_ag_ctx ustorm_ag_context;
10820 	struct tstorm_fcoe_conn_st_ctx tstorm_st_context;
10821 	struct e4_mstorm_fcoe_conn_ag_ctx mstorm_ag_context;
10822 	struct mstorm_fcoe_conn_st_ctx mstorm_st_context;
10823 };
10824 
10825 /* FCoE connection offload params passed by driver to FW in FCoE offload
10826  * ramrod.
10827  */
10828 struct fcoe_conn_offload_ramrod_params {
10829 	struct fcoe_conn_offload_ramrod_data offload_ramrod_data;
10830 };
10831 
10832 /* FCoE connection terminate params passed by driver to FW in FCoE terminate
10833  * conn ramrod.
10834  */
10835 struct fcoe_conn_terminate_ramrod_params {
10836 	struct fcoe_conn_terminate_ramrod_data terminate_ramrod_data;
10837 };
10838 
10839 /* FCoE event type */
10840 enum fcoe_event_type {
10841 	FCOE_EVENT_INIT_FUNC,
10842 	FCOE_EVENT_DESTROY_FUNC,
10843 	FCOE_EVENT_STAT_FUNC,
10844 	FCOE_EVENT_OFFLOAD_CONN,
10845 	FCOE_EVENT_TERMINATE_CONN,
10846 	FCOE_EVENT_ERROR,
10847 	MAX_FCOE_EVENT_TYPE
10848 };
10849 
10850 /* FCoE init params passed by driver to FW in FCoE init ramrod */
10851 struct fcoe_init_ramrod_params {
10852 	struct fcoe_init_func_ramrod_data init_ramrod_data;
10853 };
10854 
10855 /* FCoE ramrod Command IDs */
10856 enum fcoe_ramrod_cmd_id {
10857 	FCOE_RAMROD_CMD_ID_INIT_FUNC,
10858 	FCOE_RAMROD_CMD_ID_DESTROY_FUNC,
10859 	FCOE_RAMROD_CMD_ID_STAT_FUNC,
10860 	FCOE_RAMROD_CMD_ID_OFFLOAD_CONN,
10861 	FCOE_RAMROD_CMD_ID_TERMINATE_CONN,
10862 	MAX_FCOE_RAMROD_CMD_ID
10863 };
10864 
10865 /* FCoE statistics params buffer passed by driver to FW in FCoE statistics
10866  * ramrod.
10867  */
10868 struct fcoe_stat_ramrod_params {
10869 	struct fcoe_stat_ramrod_data stat_ramrod_data;
10870 };
10871 
10872 struct e4_ystorm_fcoe_conn_ag_ctx {
10873 	u8 byte0;
10874 	u8 byte1;
10875 	u8 flags0;
10876 #define E4_YSTORM_FCOE_CONN_AG_CTX_BIT0_MASK	0x1
10877 #define E4_YSTORM_FCOE_CONN_AG_CTX_BIT0_SHIFT	0
10878 #define E4_YSTORM_FCOE_CONN_AG_CTX_BIT1_MASK	0x1
10879 #define E4_YSTORM_FCOE_CONN_AG_CTX_BIT1_SHIFT	1
10880 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF0_MASK	0x3
10881 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF0_SHIFT	2
10882 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF1_MASK	0x3
10883 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF1_SHIFT	4
10884 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF2_MASK	0x3
10885 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF2_SHIFT	6
10886 	u8 flags1;
10887 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF0EN_MASK		0x1
10888 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF0EN_SHIFT		0
10889 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF1EN_MASK		0x1
10890 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF1EN_SHIFT		1
10891 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF2EN_MASK		0x1
10892 #define E4_YSTORM_FCOE_CONN_AG_CTX_CF2EN_SHIFT		2
10893 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE0EN_MASK		0x1
10894 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE0EN_SHIFT	3
10895 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE1EN_MASK		0x1
10896 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE1EN_SHIFT	4
10897 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE2EN_MASK		0x1
10898 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE2EN_SHIFT	5
10899 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE3EN_MASK		0x1
10900 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE3EN_SHIFT	6
10901 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE4EN_MASK		0x1
10902 #define E4_YSTORM_FCOE_CONN_AG_CTX_RULE4EN_SHIFT	7
10903 	u8 byte2;
10904 	u8 byte3;
10905 	__le16 word0;
10906 	__le32 reg0;
10907 	__le32 reg1;
10908 	__le16 word1;
10909 	__le16 word2;
10910 	__le16 word3;
10911 	__le16 word4;
10912 	__le32 reg2;
10913 	__le32 reg3;
10914 };
10915 
10916 /* The iscsi storm connection context of Ystorm */
10917 struct ystorm_iscsi_conn_st_ctx {
10918 	__le32 reserved[8];
10919 };
10920 
10921 /* Combined iSCSI and TCP storm connection of Pstorm */
10922 struct pstorm_iscsi_tcp_conn_st_ctx {
10923 	__le32 tcp[32];
10924 	__le32 iscsi[4];
10925 };
10926 
10927 /* The combined tcp and iscsi storm context of Xstorm */
10928 struct xstorm_iscsi_tcp_conn_st_ctx {
10929 	__le32 reserved_tcp[4];
10930 	__le32 reserved_iscsi[44];
10931 };
10932 
10933 struct e4_xstorm_iscsi_conn_ag_ctx {
10934 	u8 cdu_validation;
10935 	u8 state;
10936 	u8 flags0;
10937 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
10938 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
10939 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM1_MASK	0x1
10940 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM1_SHIFT	1
10941 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED1_MASK	0x1
10942 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED1_SHIFT	2
10943 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM3_MASK	0x1
10944 #define E4_XSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM3_SHIFT	3
10945 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT4_MASK		0x1
10946 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT4_SHIFT		4
10947 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED2_MASK	0x1
10948 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED2_SHIFT	5
10949 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT6_MASK		0x1
10950 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT6_SHIFT		6
10951 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT7_MASK		0x1
10952 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT7_SHIFT		7
10953 	u8 flags1;
10954 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT8_MASK		0x1
10955 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT8_SHIFT		0
10956 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT9_MASK		0x1
10957 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT9_SHIFT		1
10958 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT10_MASK		0x1
10959 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT10_SHIFT		2
10960 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT11_MASK		0x1
10961 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT11_SHIFT		3
10962 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT12_MASK		0x1
10963 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT12_SHIFT		4
10964 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT13_MASK		0x1
10965 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT13_SHIFT		5
10966 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT14_MASK		0x1
10967 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT14_SHIFT		6
10968 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TX_TRUNCATE_MASK	0x1
10969 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TX_TRUNCATE_SHIFT	7
10970 	u8 flags2;
10971 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF0_MASK			0x3
10972 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF0_SHIFT			0
10973 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF1_MASK			0x3
10974 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF1_SHIFT			2
10975 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF2_MASK			0x3
10976 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF2_SHIFT			4
10977 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_MASK		0x3
10978 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_SHIFT	6
10979 	u8 flags3;
10980 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF4_MASK	0x3
10981 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF4_SHIFT	0
10982 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF5_MASK	0x3
10983 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF5_SHIFT	2
10984 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF6_MASK	0x3
10985 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF6_SHIFT	4
10986 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF7_MASK	0x3
10987 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF7_SHIFT	6
10988 	u8 flags4;
10989 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF8_MASK	0x3
10990 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF8_SHIFT	0
10991 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF9_MASK	0x3
10992 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF9_SHIFT	2
10993 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF10_MASK	0x3
10994 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF10_SHIFT	4
10995 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF11_MASK	0x3
10996 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF11_SHIFT	6
10997 	u8 flags5;
10998 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF12_MASK				0x3
10999 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF12_SHIFT				0
11000 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF13_MASK				0x3
11001 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF13_SHIFT				2
11002 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF14_MASK				0x3
11003 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF14_SHIFT				4
11004 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UPDATE_STATE_TO_BASE_CF_MASK	0x3
11005 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UPDATE_STATE_TO_BASE_CF_SHIFT	6
11006 	u8 flags6;
11007 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF16_MASK		0x3
11008 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF16_SHIFT		0
11009 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF17_MASK		0x3
11010 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF17_SHIFT		2
11011 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF18_MASK		0x3
11012 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF18_SHIFT		4
11013 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DQ_FLUSH_MASK	0x3
11014 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DQ_FLUSH_SHIFT	6
11015 	u8 flags7;
11016 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MST_XCM_Q0_FLUSH_CF_MASK	0x3
11017 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MST_XCM_Q0_FLUSH_CF_SHIFT	0
11018 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UST_XCM_Q1_FLUSH_CF_MASK	0x3
11019 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UST_XCM_Q1_FLUSH_CF_SHIFT	2
11020 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SLOW_PATH_MASK		0x3
11021 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SLOW_PATH_SHIFT		4
11022 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF0EN_MASK			0x1
11023 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF0EN_SHIFT			6
11024 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF1EN_MASK			0x1
11025 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF1EN_SHIFT			7
11026 	u8 flags8;
11027 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF2EN_MASK			0x1
11028 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF2EN_SHIFT			0
11029 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_EN_MASK	0x1
11030 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_EN_SHIFT	1
11031 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF4EN_MASK			0x1
11032 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF4EN_SHIFT			2
11033 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF5EN_MASK			0x1
11034 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF5EN_SHIFT			3
11035 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF6EN_MASK			0x1
11036 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF6EN_SHIFT			4
11037 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF7EN_MASK			0x1
11038 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF7EN_SHIFT			5
11039 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF8EN_MASK			0x1
11040 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF8EN_SHIFT			6
11041 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF9EN_MASK			0x1
11042 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF9EN_SHIFT			7
11043 	u8 flags9;
11044 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF10EN_MASK				0x1
11045 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF10EN_SHIFT			0
11046 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF11EN_MASK				0x1
11047 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF11EN_SHIFT			1
11048 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF12EN_MASK				0x1
11049 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF12EN_SHIFT			2
11050 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF13EN_MASK				0x1
11051 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF13EN_SHIFT			3
11052 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF14EN_MASK				0x1
11053 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF14EN_SHIFT			4
11054 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UPDATE_STATE_TO_BASE_CF_EN_MASK	0x1
11055 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UPDATE_STATE_TO_BASE_CF_EN_SHIFT	5
11056 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF16EN_MASK				0x1
11057 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF16EN_SHIFT			6
11058 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF17EN_MASK				0x1
11059 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF17EN_SHIFT			7
11060 	u8 flags10;
11061 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF18EN_MASK				0x1
11062 #define E4_XSTORM_ISCSI_CONN_AG_CTX_CF18EN_SHIFT			0
11063 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DQ_FLUSH_EN_MASK			0x1
11064 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DQ_FLUSH_EN_SHIFT			1
11065 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MST_XCM_Q0_FLUSH_CF_EN_MASK		0x1
11066 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MST_XCM_Q0_FLUSH_CF_EN_SHIFT	2
11067 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UST_XCM_Q1_FLUSH_CF_EN_MASK		0x1
11068 #define E4_XSTORM_ISCSI_CONN_AG_CTX_UST_XCM_Q1_FLUSH_CF_EN_SHIFT	3
11069 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SLOW_PATH_EN_MASK			0x1
11070 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SLOW_PATH_EN_SHIFT			4
11071 #define E4_XSTORM_ISCSI_CONN_AG_CTX_PROC_ONLY_CLEANUP_EN_MASK		0x1
11072 #define E4_XSTORM_ISCSI_CONN_AG_CTX_PROC_ONLY_CLEANUP_EN_SHIFT		5
11073 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE0EN_MASK			0x1
11074 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE0EN_SHIFT			6
11075 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MORE_TO_SEND_DEC_RULE_EN_MASK	0x1
11076 #define E4_XSTORM_ISCSI_CONN_AG_CTX_MORE_TO_SEND_DEC_RULE_EN_SHIFT	7
11077 	u8 flags11;
11078 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TX_BLOCKED_EN_MASK	0x1
11079 #define E4_XSTORM_ISCSI_CONN_AG_CTX_TX_BLOCKED_EN_SHIFT	0
11080 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE3EN_MASK	0x1
11081 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE3EN_SHIFT	1
11082 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED3_MASK	0x1
11083 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RESERVED3_SHIFT	2
11084 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE5EN_MASK	0x1
11085 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE5EN_SHIFT	3
11086 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE6EN_MASK	0x1
11087 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE6EN_SHIFT	4
11088 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE7EN_MASK	0x1
11089 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE7EN_SHIFT	5
11090 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED1_MASK	0x1
11091 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED1_SHIFT	6
11092 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE9EN_MASK	0x1
11093 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE9EN_SHIFT	7
11094 	u8 flags12;
11095 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SQ_DEC_RULE_EN_MASK		0x1
11096 #define E4_XSTORM_ISCSI_CONN_AG_CTX_SQ_DEC_RULE_EN_SHIFT	0
11097 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE11EN_MASK		0x1
11098 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE11EN_SHIFT		1
11099 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED2_MASK		0x1
11100 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED2_SHIFT		2
11101 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED3_MASK		0x1
11102 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED3_SHIFT		3
11103 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE14EN_MASK		0x1
11104 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE14EN_SHIFT		4
11105 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE15EN_MASK		0x1
11106 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE15EN_SHIFT		5
11107 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE16EN_MASK		0x1
11108 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE16EN_SHIFT		6
11109 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE17EN_MASK		0x1
11110 #define E4_XSTORM_ISCSI_CONN_AG_CTX_RULE17EN_SHIFT		7
11111 	u8 flags13;
11112 #define E4_XSTORM_ISCSI_CONN_AG_CTX_R2TQ_DEC_RULE_EN_MASK	0x1
11113 #define E4_XSTORM_ISCSI_CONN_AG_CTX_R2TQ_DEC_RULE_EN_SHIFT	0
11114 #define E4_XSTORM_ISCSI_CONN_AG_CTX_HQ_DEC_RULE_EN_MASK		0x1
11115 #define E4_XSTORM_ISCSI_CONN_AG_CTX_HQ_DEC_RULE_EN_SHIFT	1
11116 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED4_MASK		0x1
11117 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED4_SHIFT		2
11118 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED5_MASK		0x1
11119 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED5_SHIFT		3
11120 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED6_MASK		0x1
11121 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED6_SHIFT		4
11122 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED7_MASK		0x1
11123 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED7_SHIFT		5
11124 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED8_MASK		0x1
11125 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED8_SHIFT		6
11126 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED9_MASK		0x1
11127 #define E4_XSTORM_ISCSI_CONN_AG_CTX_A0_RESERVED9_SHIFT		7
11128 	u8 flags14;
11129 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT16_MASK			0x1
11130 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT16_SHIFT			0
11131 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT17_MASK			0x1
11132 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT17_SHIFT			1
11133 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT18_MASK			0x1
11134 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT18_SHIFT			2
11135 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT19_MASK			0x1
11136 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT19_SHIFT			3
11137 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT20_MASK			0x1
11138 #define E4_XSTORM_ISCSI_CONN_AG_CTX_BIT20_SHIFT			4
11139 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DUMMY_READ_DONE_MASK	0x1
11140 #define E4_XSTORM_ISCSI_CONN_AG_CTX_DUMMY_READ_DONE_SHIFT	5
11141 #define E4_XSTORM_ISCSI_CONN_AG_CTX_PROC_ONLY_CLEANUP_MASK	0x3
11142 #define E4_XSTORM_ISCSI_CONN_AG_CTX_PROC_ONLY_CLEANUP_SHIFT	6
11143 	u8 byte2;
11144 	__le16 physical_q0;
11145 	__le16 physical_q1;
11146 	__le16 dummy_dorq_var;
11147 	__le16 sq_cons;
11148 	__le16 sq_prod;
11149 	__le16 word5;
11150 	__le16 slow_io_total_data_tx_update;
11151 	u8 byte3;
11152 	u8 byte4;
11153 	u8 byte5;
11154 	u8 byte6;
11155 	__le32 reg0;
11156 	__le32 reg1;
11157 	__le32 reg2;
11158 	__le32 more_to_send_seq;
11159 	__le32 reg4;
11160 	__le32 reg5;
11161 	__le32 hq_scan_next_relevant_ack;
11162 	__le16 r2tq_prod;
11163 	__le16 r2tq_cons;
11164 	__le16 hq_prod;
11165 	__le16 hq_cons;
11166 	__le32 remain_seq;
11167 	__le32 bytes_to_next_pdu;
11168 	__le32 hq_tcp_seq;
11169 	u8 byte7;
11170 	u8 byte8;
11171 	u8 byte9;
11172 	u8 byte10;
11173 	u8 byte11;
11174 	u8 byte12;
11175 	u8 byte13;
11176 	u8 byte14;
11177 	u8 byte15;
11178 	u8 e5_reserved;
11179 	__le16 word11;
11180 	__le32 reg10;
11181 	__le32 reg11;
11182 	__le32 exp_stat_sn;
11183 	__le32 ongoing_fast_rxmit_seq;
11184 	__le32 reg14;
11185 	__le32 reg15;
11186 	__le32 reg16;
11187 	__le32 reg17;
11188 };
11189 
11190 struct e4_tstorm_iscsi_conn_ag_ctx {
11191 	u8 reserved0;
11192 	u8 state;
11193 	u8 flags0;
11194 #define E4_TSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM0_MASK	0x1
11195 #define E4_TSTORM_ISCSI_CONN_AG_CTX_EXIST_IN_QM0_SHIFT	0
11196 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT1_MASK		0x1
11197 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT1_SHIFT		1
11198 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT2_MASK		0x1
11199 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT2_SHIFT		2
11200 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT3_MASK		0x1
11201 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT3_SHIFT		3
11202 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT4_MASK		0x1
11203 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT4_SHIFT		4
11204 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT5_MASK		0x1
11205 #define E4_TSTORM_ISCSI_CONN_AG_CTX_BIT5_SHIFT		5
11206 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF0_MASK		0x3
11207 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF0_SHIFT		6
11208 	u8 flags1;
11209 #define E4_TSTORM_ISCSI_CONN_AG_CTX_P2T_FLUSH_CF_MASK		0x3
11210 #define E4_TSTORM_ISCSI_CONN_AG_CTX_P2T_FLUSH_CF_SHIFT		0
11211 #define E4_TSTORM_ISCSI_CONN_AG_CTX_M2T_FLUSH_CF_MASK		0x3
11212 #define E4_TSTORM_ISCSI_CONN_AG_CTX_M2T_FLUSH_CF_SHIFT		2
11213 #define E4_TSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_MASK		0x3
11214 #define E4_TSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_SHIFT	4
11215 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF4_MASK			0x3
11216 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF4_SHIFT			6
11217 	u8 flags2;
11218 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF5_MASK	0x3
11219 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF5_SHIFT	0
11220 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF6_MASK	0x3
11221 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF6_SHIFT	2
11222 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF7_MASK	0x3
11223 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF7_SHIFT	4
11224 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF8_MASK	0x3
11225 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF8_SHIFT	6
11226 	u8 flags3;
11227 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_Q0_MASK		0x3
11228 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_Q0_SHIFT		0
11229 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_OOO_ISLES_CF_MASK	0x3
11230 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_OOO_ISLES_CF_SHIFT	2
11231 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF0EN_MASK			0x1
11232 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF0EN_SHIFT			4
11233 #define E4_TSTORM_ISCSI_CONN_AG_CTX_P2T_FLUSH_CF_EN_MASK	0x1
11234 #define E4_TSTORM_ISCSI_CONN_AG_CTX_P2T_FLUSH_CF_EN_SHIFT	5
11235 #define E4_TSTORM_ISCSI_CONN_AG_CTX_M2T_FLUSH_CF_EN_MASK	0x1
11236 #define E4_TSTORM_ISCSI_CONN_AG_CTX_M2T_FLUSH_CF_EN_SHIFT	6
11237 #define E4_TSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_EN_MASK	0x1
11238 #define E4_TSTORM_ISCSI_CONN_AG_CTX_TIMER_STOP_ALL_EN_SHIFT	7
11239 	u8 flags4;
11240 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF4EN_MASK		0x1
11241 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF4EN_SHIFT		0
11242 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF5EN_MASK		0x1
11243 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF5EN_SHIFT		1
11244 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF6EN_MASK		0x1
11245 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF6EN_SHIFT		2
11246 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF7EN_MASK		0x1
11247 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF7EN_SHIFT		3
11248 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF8EN_MASK		0x1
11249 #define E4_TSTORM_ISCSI_CONN_AG_CTX_CF8EN_SHIFT		4
11250 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_Q0_EN_MASK	0x1
11251 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT	5
11252 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_OOO_ISLES_CF_EN_MASK	0x1
11253 #define E4_TSTORM_ISCSI_CONN_AG_CTX_FLUSH_OOO_ISLES_CF_EN_SHIFT	6
11254 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE0EN_MASK	0x1
11255 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE0EN_SHIFT	7
11256 	u8 flags5;
11257 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE1EN_MASK	0x1
11258 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE1EN_SHIFT	0
11259 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE2EN_MASK	0x1
11260 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE2EN_SHIFT	1
11261 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE3EN_MASK	0x1
11262 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE3EN_SHIFT	2
11263 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE4EN_MASK	0x1
11264 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE4EN_SHIFT	3
11265 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE5EN_MASK	0x1
11266 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE5EN_SHIFT	4
11267 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE6EN_MASK	0x1
11268 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE6EN_SHIFT	5
11269 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE7EN_MASK	0x1
11270 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE7EN_SHIFT	6
11271 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE8EN_MASK	0x1
11272 #define E4_TSTORM_ISCSI_CONN_AG_CTX_RULE8EN_SHIFT	7
11273 	__le32 reg0;
11274 	__le32 reg1;
11275 	__le32 rx_tcp_checksum_err_cnt;
11276 	__le32 reg3;
11277 	__le32 reg4;
11278 	__le32 reg5;
11279 	__le32 reg6;
11280 	__le32 reg7;
11281 	__le32 reg8;
11282 	u8 cid_offload_cnt;
11283 	u8 byte3;
11284 	__le16 word0;
11285 };
11286 
11287 struct e4_ustorm_iscsi_conn_ag_ctx {
11288 	u8 byte0;
11289 	u8 byte1;
11290 	u8 flags0;
11291 #define E4_USTORM_ISCSI_CONN_AG_CTX_BIT0_MASK	0x1
11292 #define E4_USTORM_ISCSI_CONN_AG_CTX_BIT0_SHIFT	0
11293 #define E4_USTORM_ISCSI_CONN_AG_CTX_BIT1_MASK	0x1
11294 #define E4_USTORM_ISCSI_CONN_AG_CTX_BIT1_SHIFT	1
11295 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF0_MASK	0x3
11296 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF0_SHIFT	2
11297 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF1_MASK	0x3
11298 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF1_SHIFT	4
11299 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF2_MASK	0x3
11300 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF2_SHIFT	6
11301 	u8 flags1;
11302 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF3_MASK	0x3
11303 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF3_SHIFT	0
11304 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF4_MASK	0x3
11305 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF4_SHIFT	2
11306 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF5_MASK	0x3
11307 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF5_SHIFT	4
11308 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF6_MASK	0x3
11309 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF6_SHIFT	6
11310 	u8 flags2;
11311 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF0EN_MASK		0x1
11312 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF0EN_SHIFT		0
11313 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF1EN_MASK		0x1
11314 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF1EN_SHIFT		1
11315 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF2EN_MASK		0x1
11316 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF2EN_SHIFT		2
11317 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF3EN_MASK		0x1
11318 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF3EN_SHIFT		3
11319 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF4EN_MASK		0x1
11320 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF4EN_SHIFT		4
11321 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF5EN_MASK		0x1
11322 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF5EN_SHIFT		5
11323 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF6EN_MASK		0x1
11324 #define E4_USTORM_ISCSI_CONN_AG_CTX_CF6EN_SHIFT		6
11325 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE0EN_MASK	0x1
11326 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE0EN_SHIFT	7
11327 	u8 flags3;
11328 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE1EN_MASK	0x1
11329 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE1EN_SHIFT	0
11330 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE2EN_MASK	0x1
11331 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE2EN_SHIFT	1
11332 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE3EN_MASK	0x1
11333 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE3EN_SHIFT	2
11334 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE4EN_MASK	0x1
11335 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE4EN_SHIFT	3
11336 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE5EN_MASK	0x1
11337 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE5EN_SHIFT	4
11338 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE6EN_MASK	0x1
11339 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE6EN_SHIFT	5
11340 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE7EN_MASK	0x1
11341 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE7EN_SHIFT	6
11342 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE8EN_MASK	0x1
11343 #define E4_USTORM_ISCSI_CONN_AG_CTX_RULE8EN_SHIFT	7
11344 	u8 byte2;
11345 	u8 byte3;
11346 	__le16 word0;
11347 	__le16 word1;
11348 	__le32 reg0;
11349 	__le32 reg1;
11350 	__le32 reg2;
11351 	__le32 reg3;
11352 	__le16 word2;
11353 	__le16 word3;
11354 };
11355 
11356 /* The iscsi storm connection context of Tstorm */
11357 struct tstorm_iscsi_conn_st_ctx {
11358 	__le32 reserved[44];
11359 };
11360 
11361 struct e4_mstorm_iscsi_conn_ag_ctx {
11362 	u8 reserved;
11363 	u8 state;
11364 	u8 flags0;
11365 #define E4_MSTORM_ISCSI_CONN_AG_CTX_BIT0_MASK	0x1
11366 #define E4_MSTORM_ISCSI_CONN_AG_CTX_BIT0_SHIFT	0
11367 #define E4_MSTORM_ISCSI_CONN_AG_CTX_BIT1_MASK	0x1
11368 #define E4_MSTORM_ISCSI_CONN_AG_CTX_BIT1_SHIFT	1
11369 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF0_MASK	0x3
11370 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF0_SHIFT	2
11371 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF1_MASK	0x3
11372 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF1_SHIFT	4
11373 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF2_MASK	0x3
11374 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF2_SHIFT	6
11375 	u8 flags1;
11376 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF0EN_MASK		0x1
11377 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF0EN_SHIFT		0
11378 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF1EN_MASK		0x1
11379 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF1EN_SHIFT		1
11380 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF2EN_MASK		0x1
11381 #define E4_MSTORM_ISCSI_CONN_AG_CTX_CF2EN_SHIFT		2
11382 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE0EN_MASK	0x1
11383 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE0EN_SHIFT	3
11384 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE1EN_MASK	0x1
11385 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE1EN_SHIFT	4
11386 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE2EN_MASK	0x1
11387 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE2EN_SHIFT	5
11388 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE3EN_MASK	0x1
11389 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE3EN_SHIFT	6
11390 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE4EN_MASK	0x1
11391 #define E4_MSTORM_ISCSI_CONN_AG_CTX_RULE4EN_SHIFT	7
11392 	__le16 word0;
11393 	__le16 word1;
11394 	__le32 reg0;
11395 	__le32 reg1;
11396 };
11397 
11398 /* Combined iSCSI and TCP storm connection of Mstorm */
11399 struct mstorm_iscsi_tcp_conn_st_ctx {
11400 	__le32 reserved_tcp[20];
11401 	__le32 reserved_iscsi[12];
11402 };
11403 
11404 /* The iscsi storm context of Ustorm */
11405 struct ustorm_iscsi_conn_st_ctx {
11406 	__le32 reserved[52];
11407 };
11408 
11409 /* iscsi connection context */
11410 struct e4_iscsi_conn_context {
11411 	struct ystorm_iscsi_conn_st_ctx ystorm_st_context;
11412 	struct pstorm_iscsi_tcp_conn_st_ctx pstorm_st_context;
11413 	struct regpair pstorm_st_padding[2];
11414 	struct pb_context xpb2_context;
11415 	struct xstorm_iscsi_tcp_conn_st_ctx xstorm_st_context;
11416 	struct regpair xstorm_st_padding[2];
11417 	struct e4_xstorm_iscsi_conn_ag_ctx xstorm_ag_context;
11418 	struct e4_tstorm_iscsi_conn_ag_ctx tstorm_ag_context;
11419 	struct regpair tstorm_ag_padding[2];
11420 	struct timers_context timer_context;
11421 	struct e4_ustorm_iscsi_conn_ag_ctx ustorm_ag_context;
11422 	struct pb_context upb_context;
11423 	struct tstorm_iscsi_conn_st_ctx tstorm_st_context;
11424 	struct regpair tstorm_st_padding[2];
11425 	struct e4_mstorm_iscsi_conn_ag_ctx mstorm_ag_context;
11426 	struct mstorm_iscsi_tcp_conn_st_ctx mstorm_st_context;
11427 	struct ustorm_iscsi_conn_st_ctx ustorm_st_context;
11428 };
11429 
11430 /* iSCSI init params passed by driver to FW in iSCSI init ramrod */
11431 struct iscsi_init_ramrod_params {
11432 	struct iscsi_spe_func_init iscsi_init_spe;
11433 	struct tcp_init_params tcp_init;
11434 };
11435 
11436 struct e4_ystorm_iscsi_conn_ag_ctx {
11437 	u8 byte0;
11438 	u8 byte1;
11439 	u8 flags0;
11440 #define E4_YSTORM_ISCSI_CONN_AG_CTX_BIT0_MASK	0x1
11441 #define E4_YSTORM_ISCSI_CONN_AG_CTX_BIT0_SHIFT	0
11442 #define E4_YSTORM_ISCSI_CONN_AG_CTX_BIT1_MASK	0x1
11443 #define E4_YSTORM_ISCSI_CONN_AG_CTX_BIT1_SHIFT	1
11444 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF0_MASK	0x3
11445 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF0_SHIFT	2
11446 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF1_MASK	0x3
11447 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF1_SHIFT	4
11448 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF2_MASK	0x3
11449 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF2_SHIFT	6
11450 	u8 flags1;
11451 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF0EN_MASK		0x1
11452 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF0EN_SHIFT		0
11453 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF1EN_MASK		0x1
11454 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF1EN_SHIFT		1
11455 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF2EN_MASK		0x1
11456 #define E4_YSTORM_ISCSI_CONN_AG_CTX_CF2EN_SHIFT		2
11457 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE0EN_MASK	0x1
11458 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE0EN_SHIFT	3
11459 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE1EN_MASK	0x1
11460 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE1EN_SHIFT	4
11461 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE2EN_MASK	0x1
11462 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE2EN_SHIFT	5
11463 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE3EN_MASK	0x1
11464 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE3EN_SHIFT	6
11465 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE4EN_MASK	0x1
11466 #define E4_YSTORM_ISCSI_CONN_AG_CTX_RULE4EN_SHIFT	7
11467 	u8 byte2;
11468 	u8 byte3;
11469 	__le16 word0;
11470 	__le32 reg0;
11471 	__le32 reg1;
11472 	__le16 word1;
11473 	__le16 word2;
11474 	__le16 word3;
11475 	__le16 word4;
11476 	__le32 reg2;
11477 	__le32 reg3;
11478 };
11479 
11480 #define MFW_TRACE_SIGNATURE     0x25071946
11481 
11482 /* The trace in the buffer */
11483 #define MFW_TRACE_EVENTID_MASK          0x00ffff
11484 #define MFW_TRACE_PRM_SIZE_MASK         0x0f0000
11485 #define MFW_TRACE_PRM_SIZE_OFFSET	16
11486 #define MFW_TRACE_ENTRY_SIZE            3
11487 
11488 struct mcp_trace {
11489 	u32 signature;		/* Help to identify that the trace is valid */
11490 	u32 size;		/* the size of the trace buffer in bytes */
11491 	u32 curr_level;		/* 2 - all will be written to the buffer
11492 				 * 1 - debug trace will not be written
11493 				 * 0 - just errors will be written to the buffer
11494 				 */
11495 	u32 modules_mask[2];	/* a bit per module, 1 means write it, 0 means
11496 				 * mask it.
11497 				 */
11498 
11499 	/* Warning: the following pointers are assumed to be 32bits as they are
11500 	 * used only in the MFW.
11501 	 */
11502 	u32 trace_prod; /* The next trace will be written to this offset */
11503 	u32 trace_oldest; /* The oldest valid trace starts at this offset
11504 			   * (usually very close after the current producer).
11505 			   */
11506 };
11507 
11508 #define VF_MAX_STATIC 192
11509 
11510 #define MCP_GLOB_PATH_MAX	2
11511 #define MCP_PORT_MAX		2
11512 #define MCP_GLOB_PORT_MAX	4
11513 #define MCP_GLOB_FUNC_MAX	16
11514 
11515 typedef u32 offsize_t;		/* In DWORDS !!! */
11516 /* Offset from the beginning of the MCP scratchpad */
11517 #define OFFSIZE_OFFSET_SHIFT	0
11518 #define OFFSIZE_OFFSET_MASK	0x0000ffff
11519 /* Size of specific element (not the whole array if any) */
11520 #define OFFSIZE_SIZE_SHIFT	16
11521 #define OFFSIZE_SIZE_MASK	0xffff0000
11522 
11523 #define SECTION_OFFSET(_offsize) ((((_offsize &			\
11524 				     OFFSIZE_OFFSET_MASK) >>	\
11525 				    OFFSIZE_OFFSET_SHIFT) << 2))
11526 
11527 #define QED_SECTION_SIZE(_offsize) (((_offsize &		\
11528 				      OFFSIZE_SIZE_MASK) >>	\
11529 				     OFFSIZE_SIZE_SHIFT) << 2)
11530 
11531 #define SECTION_ADDR(_offsize, idx) (MCP_REG_SCRATCH +			\
11532 				     SECTION_OFFSET(_offsize) +		\
11533 				     (QED_SECTION_SIZE(_offsize) * idx))
11534 
11535 #define SECTION_OFFSIZE_ADDR(_pub_base, _section)	\
11536 	(_pub_base + offsetof(struct mcp_public_data, sections[_section]))
11537 
11538 /* PHY configuration */
11539 struct eth_phy_cfg {
11540 	u32					speed;
11541 #define ETH_SPEED_AUTONEG			0x0
11542 #define ETH_SPEED_SMARTLINQ			0x8
11543 
11544 	u32					pause;
11545 #define ETH_PAUSE_NONE				0x0
11546 #define ETH_PAUSE_AUTONEG			0x1
11547 #define ETH_PAUSE_RX				0x2
11548 #define ETH_PAUSE_TX				0x4
11549 
11550 	u32					adv_speed;
11551 
11552 	u32					loopback_mode;
11553 #define ETH_LOOPBACK_NONE			0x0
11554 #define ETH_LOOPBACK_INT_PHY			0x1
11555 #define ETH_LOOPBACK_EXT_PHY			0x2
11556 #define ETH_LOOPBACK_EXT			0x3
11557 #define ETH_LOOPBACK_MAC			0x4
11558 #define ETH_LOOPBACK_CNIG_AH_ONLY_0123		0x5
11559 #define ETH_LOOPBACK_CNIG_AH_ONLY_2301		0x6
11560 #define ETH_LOOPBACK_PCS_AH_ONLY		0x7
11561 #define ETH_LOOPBACK_REVERSE_MAC_AH_ONLY	0x8
11562 #define ETH_LOOPBACK_INT_PHY_FEA_AH_ONLY	0x9
11563 
11564 	u32					eee_cfg;
11565 #define EEE_CFG_EEE_ENABLED			BIT(0)
11566 #define EEE_CFG_TX_LPI				BIT(1)
11567 #define EEE_CFG_ADV_SPEED_1G			BIT(2)
11568 #define EEE_CFG_ADV_SPEED_10G			BIT(3)
11569 #define EEE_TX_TIMER_USEC_MASK			0xfffffff0
11570 #define EEE_TX_TIMER_USEC_OFFSET		4
11571 #define EEE_TX_TIMER_USEC_BALANCED_TIME		0xa00
11572 #define EEE_TX_TIMER_USEC_AGGRESSIVE_TIME	0x100
11573 #define EEE_TX_TIMER_USEC_LATENCY_TIME		0x6000
11574 
11575 	u32					deprecated;
11576 
11577 	u32					fec_mode;
11578 #define FEC_FORCE_MODE_MASK			0x000000ff
11579 #define FEC_FORCE_MODE_OFFSET			0
11580 #define FEC_FORCE_MODE_NONE			0x00
11581 #define FEC_FORCE_MODE_FIRECODE			0x01
11582 #define FEC_FORCE_MODE_RS			0x02
11583 #define FEC_FORCE_MODE_AUTO			0x07
11584 #define FEC_EXTENDED_MODE_MASK			0xffffff00
11585 #define FEC_EXTENDED_MODE_OFFSET		8
11586 #define ETH_EXT_FEC_NONE			0x00000100
11587 #define ETH_EXT_FEC_10G_NONE			0x00000200
11588 #define ETH_EXT_FEC_10G_BASE_R			0x00000400
11589 #define ETH_EXT_FEC_20G_NONE			0x00000800
11590 #define ETH_EXT_FEC_20G_BASE_R			0x00001000
11591 #define ETH_EXT_FEC_25G_NONE			0x00002000
11592 #define ETH_EXT_FEC_25G_BASE_R			0x00004000
11593 #define ETH_EXT_FEC_25G_RS528			0x00008000
11594 #define ETH_EXT_FEC_40G_NONE			0x00010000
11595 #define ETH_EXT_FEC_40G_BASE_R			0x00020000
11596 #define ETH_EXT_FEC_50G_NONE			0x00040000
11597 #define ETH_EXT_FEC_50G_BASE_R			0x00080000
11598 #define ETH_EXT_FEC_50G_RS528			0x00100000
11599 #define ETH_EXT_FEC_50G_RS544			0x00200000
11600 #define ETH_EXT_FEC_100G_NONE			0x00400000
11601 #define ETH_EXT_FEC_100G_BASE_R			0x00800000
11602 #define ETH_EXT_FEC_100G_RS528			0x01000000
11603 #define ETH_EXT_FEC_100G_RS544			0x02000000
11604 
11605 	u32					extended_speed;
11606 #define ETH_EXT_SPEED_MASK			0x0000ffff
11607 #define ETH_EXT_SPEED_OFFSET			0
11608 #define ETH_EXT_SPEED_AN			0x00000001
11609 #define ETH_EXT_SPEED_1G			0x00000002
11610 #define ETH_EXT_SPEED_10G			0x00000004
11611 #define ETH_EXT_SPEED_20G			0x00000008
11612 #define ETH_EXT_SPEED_25G			0x00000010
11613 #define ETH_EXT_SPEED_40G			0x00000020
11614 #define ETH_EXT_SPEED_50G_BASE_R		0x00000040
11615 #define ETH_EXT_SPEED_50G_BASE_R2		0x00000080
11616 #define ETH_EXT_SPEED_100G_BASE_R2		0x00000100
11617 #define ETH_EXT_SPEED_100G_BASE_R4		0x00000200
11618 #define ETH_EXT_SPEED_100G_BASE_P4		0x00000400
11619 #define ETH_EXT_ADV_SPEED_MASK			0xffff0000
11620 #define ETH_EXT_ADV_SPEED_OFFSET		16
11621 #define ETH_EXT_ADV_SPEED_RESERVED		0x00010000
11622 #define ETH_EXT_ADV_SPEED_1G			0x00020000
11623 #define ETH_EXT_ADV_SPEED_10G			0x00040000
11624 #define ETH_EXT_ADV_SPEED_20G			0x00080000
11625 #define ETH_EXT_ADV_SPEED_25G			0x00100000
11626 #define ETH_EXT_ADV_SPEED_40G			0x00200000
11627 #define ETH_EXT_ADV_SPEED_50G_BASE_R		0x00400000
11628 #define ETH_EXT_ADV_SPEED_50G_BASE_R2		0x00800000
11629 #define ETH_EXT_ADV_SPEED_100G_BASE_R2		0x01000000
11630 #define ETH_EXT_ADV_SPEED_100G_BASE_R4		0x02000000
11631 #define ETH_EXT_ADV_SPEED_100G_BASE_P4		0x04000000
11632 };
11633 
11634 struct port_mf_cfg {
11635 	u32 dynamic_cfg;
11636 #define PORT_MF_CFG_OV_TAG_MASK		0x0000ffff
11637 #define PORT_MF_CFG_OV_TAG_SHIFT	0
11638 #define PORT_MF_CFG_OV_TAG_DEFAULT	PORT_MF_CFG_OV_TAG_MASK
11639 
11640 	u32 reserved[1];
11641 };
11642 
11643 struct eth_stats {
11644 	u64 r64;
11645 	u64 r127;
11646 	u64 r255;
11647 	u64 r511;
11648 	u64 r1023;
11649 	u64 r1518;
11650 
11651 	union {
11652 		struct {
11653 			u64 r1522;
11654 			u64 r2047;
11655 			u64 r4095;
11656 			u64 r9216;
11657 			u64 r16383;
11658 		} bb0;
11659 		struct {
11660 			u64 unused1;
11661 			u64 r1519_to_max;
11662 			u64 unused2;
11663 			u64 unused3;
11664 			u64 unused4;
11665 		} ah0;
11666 	} u0;
11667 
11668 	u64 rfcs;
11669 	u64 rxcf;
11670 	u64 rxpf;
11671 	u64 rxpp;
11672 	u64 raln;
11673 	u64 rfcr;
11674 	u64 rovr;
11675 	u64 rjbr;
11676 	u64 rund;
11677 	u64 rfrg;
11678 	u64 t64;
11679 	u64 t127;
11680 	u64 t255;
11681 	u64 t511;
11682 	u64 t1023;
11683 	u64 t1518;
11684 
11685 	union {
11686 		struct {
11687 			u64 t2047;
11688 			u64 t4095;
11689 			u64 t9216;
11690 			u64 t16383;
11691 		} bb1;
11692 		struct {
11693 			u64 t1519_to_max;
11694 			u64 unused6;
11695 			u64 unused7;
11696 			u64 unused8;
11697 		} ah1;
11698 	} u1;
11699 
11700 	u64 txpf;
11701 	u64 txpp;
11702 
11703 	union {
11704 		struct {
11705 			u64 tlpiec;
11706 			u64 tncl;
11707 		} bb2;
11708 		struct {
11709 			u64 unused9;
11710 			u64 unused10;
11711 		} ah2;
11712 	} u2;
11713 
11714 	u64 rbyte;
11715 	u64 rxuca;
11716 	u64 rxmca;
11717 	u64 rxbca;
11718 	u64 rxpok;
11719 	u64 tbyte;
11720 	u64 txuca;
11721 	u64 txmca;
11722 	u64 txbca;
11723 	u64 txcf;
11724 };
11725 
11726 struct brb_stats {
11727 	u64 brb_truncate[8];
11728 	u64 brb_discard[8];
11729 };
11730 
11731 struct port_stats {
11732 	struct brb_stats brb;
11733 	struct eth_stats eth;
11734 };
11735 
11736 struct couple_mode_teaming {
11737 	u8 port_cmt[MCP_GLOB_PORT_MAX];
11738 #define PORT_CMT_IN_TEAM	(1 << 0)
11739 
11740 #define PORT_CMT_PORT_ROLE	(1 << 1)
11741 #define PORT_CMT_PORT_INACTIVE	(0 << 1)
11742 #define PORT_CMT_PORT_ACTIVE	(1 << 1)
11743 
11744 #define PORT_CMT_TEAM_MASK	(1 << 2)
11745 #define PORT_CMT_TEAM0		(0 << 2)
11746 #define PORT_CMT_TEAM1		(1 << 2)
11747 };
11748 
11749 #define LLDP_CHASSIS_ID_STAT_LEN	4
11750 #define LLDP_PORT_ID_STAT_LEN		4
11751 #define DCBX_MAX_APP_PROTOCOL		32
11752 #define MAX_SYSTEM_LLDP_TLV_DATA	32
11753 
11754 enum _lldp_agent {
11755 	LLDP_NEAREST_BRIDGE = 0,
11756 	LLDP_NEAREST_NON_TPMR_BRIDGE,
11757 	LLDP_NEAREST_CUSTOMER_BRIDGE,
11758 	LLDP_MAX_LLDP_AGENTS
11759 };
11760 
11761 struct lldp_config_params_s {
11762 	u32 config;
11763 #define LLDP_CONFIG_TX_INTERVAL_MASK	0x000000ff
11764 #define LLDP_CONFIG_TX_INTERVAL_SHIFT	0
11765 #define LLDP_CONFIG_HOLD_MASK		0x00000f00
11766 #define LLDP_CONFIG_HOLD_SHIFT		8
11767 #define LLDP_CONFIG_MAX_CREDIT_MASK	0x0000f000
11768 #define LLDP_CONFIG_MAX_CREDIT_SHIFT	12
11769 #define LLDP_CONFIG_ENABLE_RX_MASK	0x40000000
11770 #define LLDP_CONFIG_ENABLE_RX_SHIFT	30
11771 #define LLDP_CONFIG_ENABLE_TX_MASK	0x80000000
11772 #define LLDP_CONFIG_ENABLE_TX_SHIFT	31
11773 	u32 local_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
11774 	u32 local_port_id[LLDP_PORT_ID_STAT_LEN];
11775 };
11776 
11777 struct lldp_status_params_s {
11778 	u32 prefix_seq_num;
11779 	u32 status;
11780 	u32 peer_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
11781 	u32 peer_port_id[LLDP_PORT_ID_STAT_LEN];
11782 	u32 suffix_seq_num;
11783 };
11784 
11785 struct dcbx_ets_feature {
11786 	u32 flags;
11787 #define DCBX_ETS_ENABLED_MASK	0x00000001
11788 #define DCBX_ETS_ENABLED_SHIFT	0
11789 #define DCBX_ETS_WILLING_MASK	0x00000002
11790 #define DCBX_ETS_WILLING_SHIFT	1
11791 #define DCBX_ETS_ERROR_MASK	0x00000004
11792 #define DCBX_ETS_ERROR_SHIFT	2
11793 #define DCBX_ETS_CBS_MASK	0x00000008
11794 #define DCBX_ETS_CBS_SHIFT	3
11795 #define DCBX_ETS_MAX_TCS_MASK	0x000000f0
11796 #define DCBX_ETS_MAX_TCS_SHIFT	4
11797 #define DCBX_OOO_TC_MASK	0x00000f00
11798 #define DCBX_OOO_TC_SHIFT	8
11799 	u32 pri_tc_tbl[1];
11800 #define DCBX_TCP_OOO_TC		(4)
11801 
11802 #define NIG_ETS_ISCSI_OOO_CLIENT_OFFSET	(DCBX_TCP_OOO_TC + 1)
11803 #define DCBX_CEE_STRICT_PRIORITY	0xf
11804 	u32 tc_bw_tbl[2];
11805 	u32 tc_tsa_tbl[2];
11806 #define DCBX_ETS_TSA_STRICT	0
11807 #define DCBX_ETS_TSA_CBS	1
11808 #define DCBX_ETS_TSA_ETS	2
11809 };
11810 
11811 #define DCBX_TCP_OOO_TC			(4)
11812 #define DCBX_TCP_OOO_K2_4PORT_TC	(3)
11813 
11814 struct dcbx_app_priority_entry {
11815 	u32 entry;
11816 #define DCBX_APP_PRI_MAP_MASK		0x000000ff
11817 #define DCBX_APP_PRI_MAP_SHIFT		0
11818 #define DCBX_APP_PRI_0			0x01
11819 #define DCBX_APP_PRI_1			0x02
11820 #define DCBX_APP_PRI_2			0x04
11821 #define DCBX_APP_PRI_3			0x08
11822 #define DCBX_APP_PRI_4			0x10
11823 #define DCBX_APP_PRI_5			0x20
11824 #define DCBX_APP_PRI_6			0x40
11825 #define DCBX_APP_PRI_7			0x80
11826 #define DCBX_APP_SF_MASK		0x00000300
11827 #define DCBX_APP_SF_SHIFT		8
11828 #define DCBX_APP_SF_ETHTYPE		0
11829 #define DCBX_APP_SF_PORT		1
11830 #define DCBX_APP_SF_IEEE_MASK		0x0000f000
11831 #define DCBX_APP_SF_IEEE_SHIFT		12
11832 #define DCBX_APP_SF_IEEE_RESERVED	0
11833 #define DCBX_APP_SF_IEEE_ETHTYPE	1
11834 #define DCBX_APP_SF_IEEE_TCP_PORT	2
11835 #define DCBX_APP_SF_IEEE_UDP_PORT	3
11836 #define DCBX_APP_SF_IEEE_TCP_UDP_PORT	4
11837 
11838 #define DCBX_APP_PROTOCOL_ID_MASK	0xffff0000
11839 #define DCBX_APP_PROTOCOL_ID_SHIFT	16
11840 };
11841 
11842 struct dcbx_app_priority_feature {
11843 	u32 flags;
11844 #define DCBX_APP_ENABLED_MASK		0x00000001
11845 #define DCBX_APP_ENABLED_SHIFT		0
11846 #define DCBX_APP_WILLING_MASK		0x00000002
11847 #define DCBX_APP_WILLING_SHIFT		1
11848 #define DCBX_APP_ERROR_MASK		0x00000004
11849 #define DCBX_APP_ERROR_SHIFT		2
11850 #define DCBX_APP_MAX_TCS_MASK		0x0000f000
11851 #define DCBX_APP_MAX_TCS_SHIFT		12
11852 #define DCBX_APP_NUM_ENTRIES_MASK	0x00ff0000
11853 #define DCBX_APP_NUM_ENTRIES_SHIFT	16
11854 	struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
11855 };
11856 
11857 struct dcbx_features {
11858 	struct dcbx_ets_feature ets;
11859 	u32 pfc;
11860 #define DCBX_PFC_PRI_EN_BITMAP_MASK	0x000000ff
11861 #define DCBX_PFC_PRI_EN_BITMAP_SHIFT	0
11862 #define DCBX_PFC_PRI_EN_BITMAP_PRI_0	0x01
11863 #define DCBX_PFC_PRI_EN_BITMAP_PRI_1	0x02
11864 #define DCBX_PFC_PRI_EN_BITMAP_PRI_2	0x04
11865 #define DCBX_PFC_PRI_EN_BITMAP_PRI_3	0x08
11866 #define DCBX_PFC_PRI_EN_BITMAP_PRI_4	0x10
11867 #define DCBX_PFC_PRI_EN_BITMAP_PRI_5	0x20
11868 #define DCBX_PFC_PRI_EN_BITMAP_PRI_6	0x40
11869 #define DCBX_PFC_PRI_EN_BITMAP_PRI_7	0x80
11870 
11871 #define DCBX_PFC_FLAGS_MASK		0x0000ff00
11872 #define DCBX_PFC_FLAGS_SHIFT		8
11873 #define DCBX_PFC_CAPS_MASK		0x00000f00
11874 #define DCBX_PFC_CAPS_SHIFT		8
11875 #define DCBX_PFC_MBC_MASK		0x00004000
11876 #define DCBX_PFC_MBC_SHIFT		14
11877 #define DCBX_PFC_WILLING_MASK		0x00008000
11878 #define DCBX_PFC_WILLING_SHIFT		15
11879 #define DCBX_PFC_ENABLED_MASK		0x00010000
11880 #define DCBX_PFC_ENABLED_SHIFT		16
11881 #define DCBX_PFC_ERROR_MASK		0x00020000
11882 #define DCBX_PFC_ERROR_SHIFT		17
11883 
11884 	struct dcbx_app_priority_feature app;
11885 };
11886 
11887 struct dcbx_local_params {
11888 	u32 config;
11889 #define DCBX_CONFIG_VERSION_MASK	0x00000007
11890 #define DCBX_CONFIG_VERSION_SHIFT	0
11891 #define DCBX_CONFIG_VERSION_DISABLED	0
11892 #define DCBX_CONFIG_VERSION_IEEE	1
11893 #define DCBX_CONFIG_VERSION_CEE		2
11894 #define DCBX_CONFIG_VERSION_STATIC	4
11895 
11896 	u32 flags;
11897 	struct dcbx_features features;
11898 };
11899 
11900 struct dcbx_mib {
11901 	u32 prefix_seq_num;
11902 	u32 flags;
11903 	struct dcbx_features features;
11904 	u32 suffix_seq_num;
11905 };
11906 
11907 struct lldp_system_tlvs_buffer_s {
11908 	u16 valid;
11909 	u16 length;
11910 	u32 data[MAX_SYSTEM_LLDP_TLV_DATA];
11911 };
11912 
11913 struct dcb_dscp_map {
11914 	u32 flags;
11915 #define DCB_DSCP_ENABLE_MASK	0x1
11916 #define DCB_DSCP_ENABLE_SHIFT	0
11917 #define DCB_DSCP_ENABLE	1
11918 	u32 dscp_pri_map[8];
11919 };
11920 
11921 struct public_global {
11922 	u32 max_path;
11923 	u32 max_ports;
11924 #define MODE_1P 1
11925 #define MODE_2P 2
11926 #define MODE_3P 3
11927 #define MODE_4P 4
11928 	u32 debug_mb_offset;
11929 	u32 phymod_dbg_mb_offset;
11930 	struct couple_mode_teaming cmt;
11931 	s32 internal_temperature;
11932 	u32 mfw_ver;
11933 	u32 running_bundle_id;
11934 	s32 external_temperature;
11935 	u32 mdump_reason;
11936 	u64 reserved;
11937 	u32 data_ptr;
11938 	u32 data_size;
11939 };
11940 
11941 struct fw_flr_mb {
11942 	u32 aggint;
11943 	u32 opgen_addr;
11944 	u32 accum_ack;
11945 };
11946 
11947 struct public_path {
11948 	struct fw_flr_mb flr_mb;
11949 	u32 mcp_vf_disabled[VF_MAX_STATIC / 32];
11950 
11951 	u32 process_kill;
11952 #define PROCESS_KILL_COUNTER_MASK	0x0000ffff
11953 #define PROCESS_KILL_COUNTER_SHIFT	0
11954 #define PROCESS_KILL_GLOB_AEU_BIT_MASK	0xffff0000
11955 #define PROCESS_KILL_GLOB_AEU_BIT_SHIFT	16
11956 #define GLOBAL_AEU_BIT(aeu_reg_id, aeu_bit) (aeu_reg_id * 32 + aeu_bit)
11957 };
11958 
11959 struct public_port {
11960 	u32						validity_map;
11961 
11962 	u32						link_status;
11963 #define LINK_STATUS_LINK_UP				0x00000001
11964 #define LINK_STATUS_SPEED_AND_DUPLEX_MASK		0x0000001e
11965 #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD		(1 << 1)
11966 #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD		(2 << 1)
11967 #define LINK_STATUS_SPEED_AND_DUPLEX_10G		(3 << 1)
11968 #define LINK_STATUS_SPEED_AND_DUPLEX_20G		(4 << 1)
11969 #define LINK_STATUS_SPEED_AND_DUPLEX_40G		(5 << 1)
11970 #define LINK_STATUS_SPEED_AND_DUPLEX_50G		(6 << 1)
11971 #define LINK_STATUS_SPEED_AND_DUPLEX_100G		(7 << 1)
11972 #define LINK_STATUS_SPEED_AND_DUPLEX_25G		(8 << 1)
11973 #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED		0x00000020
11974 #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE		0x00000040
11975 #define LINK_STATUS_PARALLEL_DETECTION_USED		0x00000080
11976 #define LINK_STATUS_PFC_ENABLED				0x00000100
11977 #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE	0x00000200
11978 #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE	0x00000400
11979 #define LINK_STATUS_LINK_PARTNER_10G_CAPABLE		0x00000800
11980 #define LINK_STATUS_LINK_PARTNER_20G_CAPABLE		0x00001000
11981 #define LINK_STATUS_LINK_PARTNER_40G_CAPABLE		0x00002000
11982 #define LINK_STATUS_LINK_PARTNER_50G_CAPABLE		0x00004000
11983 #define LINK_STATUS_LINK_PARTNER_100G_CAPABLE		0x00008000
11984 #define LINK_STATUS_LINK_PARTNER_25G_CAPABLE		0x00010000
11985 #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK	0x000c0000
11986 #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE	(0 << 18)
11987 #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE	(1 << 18)
11988 #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE	(2 << 18)
11989 #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE		(3 << 18)
11990 #define LINK_STATUS_SFP_TX_FAULT			0x00100000
11991 #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED		0x00200000
11992 #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED		0x00400000
11993 #define LINK_STATUS_RX_SIGNAL_PRESENT			0x00800000
11994 #define LINK_STATUS_MAC_LOCAL_FAULT			0x01000000
11995 #define LINK_STATUS_MAC_REMOTE_FAULT			0x02000000
11996 #define LINK_STATUS_UNSUPPORTED_SPD_REQ			0x04000000
11997 
11998 #define LINK_STATUS_FEC_MODE_MASK			0x38000000
11999 #define LINK_STATUS_FEC_MODE_NONE			(0 << 27)
12000 #define LINK_STATUS_FEC_MODE_FIRECODE_CL74		(1 << 27)
12001 #define LINK_STATUS_FEC_MODE_RS_CL91			(2 << 27)
12002 
12003 	u32 link_status1;
12004 	u32 ext_phy_fw_version;
12005 	u32 drv_phy_cfg_addr;
12006 
12007 	u32 port_stx;
12008 
12009 	u32 stat_nig_timer;
12010 
12011 	struct port_mf_cfg port_mf_config;
12012 	struct port_stats stats;
12013 
12014 	u32 media_type;
12015 #define MEDIA_UNSPECIFIED	0x0
12016 #define MEDIA_SFPP_10G_FIBER	0x1
12017 #define MEDIA_XFP_FIBER		0x2
12018 #define MEDIA_DA_TWINAX		0x3
12019 #define MEDIA_BASE_T		0x4
12020 #define MEDIA_SFP_1G_FIBER	0x5
12021 #define MEDIA_MODULE_FIBER	0x6
12022 #define MEDIA_KR		0xf0
12023 #define MEDIA_NOT_PRESENT	0xff
12024 
12025 	u32 lfa_status;
12026 	u32 link_change_count;
12027 
12028 	struct lldp_config_params_s lldp_config_params[LLDP_MAX_LLDP_AGENTS];
12029 	struct lldp_status_params_s lldp_status_params[LLDP_MAX_LLDP_AGENTS];
12030 	struct lldp_system_tlvs_buffer_s system_lldp_tlvs_buf;
12031 
12032 	/* DCBX related MIB */
12033 	struct dcbx_local_params local_admin_dcbx_mib;
12034 	struct dcbx_mib remote_dcbx_mib;
12035 	struct dcbx_mib operational_dcbx_mib;
12036 
12037 	u32 reserved[2];
12038 
12039 	u32						transceiver_data;
12040 #define ETH_TRANSCEIVER_STATE_MASK			0x000000ff
12041 #define ETH_TRANSCEIVER_STATE_SHIFT			0x00000000
12042 #define ETH_TRANSCEIVER_STATE_OFFSET			0x00000000
12043 #define ETH_TRANSCEIVER_STATE_UNPLUGGED			0x00000000
12044 #define ETH_TRANSCEIVER_STATE_PRESENT			0x00000001
12045 #define ETH_TRANSCEIVER_STATE_VALID			0x00000003
12046 #define ETH_TRANSCEIVER_STATE_UPDATING			0x00000008
12047 #define ETH_TRANSCEIVER_TYPE_MASK			0x0000ff00
12048 #define ETH_TRANSCEIVER_TYPE_OFFSET			0x8
12049 #define ETH_TRANSCEIVER_TYPE_NONE			0x00
12050 #define ETH_TRANSCEIVER_TYPE_UNKNOWN			0xff
12051 #define ETH_TRANSCEIVER_TYPE_1G_PCC			0x01
12052 #define ETH_TRANSCEIVER_TYPE_1G_ACC			0x02
12053 #define ETH_TRANSCEIVER_TYPE_1G_LX			0x03
12054 #define ETH_TRANSCEIVER_TYPE_1G_SX			0x04
12055 #define ETH_TRANSCEIVER_TYPE_10G_SR			0x05
12056 #define ETH_TRANSCEIVER_TYPE_10G_LR			0x06
12057 #define ETH_TRANSCEIVER_TYPE_10G_LRM			0x07
12058 #define ETH_TRANSCEIVER_TYPE_10G_ER			0x08
12059 #define ETH_TRANSCEIVER_TYPE_10G_PCC			0x09
12060 #define ETH_TRANSCEIVER_TYPE_10G_ACC			0x0a
12061 #define ETH_TRANSCEIVER_TYPE_XLPPI			0x0b
12062 #define ETH_TRANSCEIVER_TYPE_40G_LR4			0x0c
12063 #define ETH_TRANSCEIVER_TYPE_40G_SR4			0x0d
12064 #define ETH_TRANSCEIVER_TYPE_40G_CR4			0x0e
12065 #define ETH_TRANSCEIVER_TYPE_100G_AOC			0x0f
12066 #define ETH_TRANSCEIVER_TYPE_100G_SR4			0x10
12067 #define ETH_TRANSCEIVER_TYPE_100G_LR4			0x11
12068 #define ETH_TRANSCEIVER_TYPE_100G_ER4			0x12
12069 #define ETH_TRANSCEIVER_TYPE_100G_ACC			0x13
12070 #define ETH_TRANSCEIVER_TYPE_100G_CR4			0x14
12071 #define ETH_TRANSCEIVER_TYPE_4x10G_SR			0x15
12072 #define ETH_TRANSCEIVER_TYPE_25G_CA_N			0x16
12073 #define ETH_TRANSCEIVER_TYPE_25G_ACC_S			0x17
12074 #define ETH_TRANSCEIVER_TYPE_25G_CA_S			0x18
12075 #define ETH_TRANSCEIVER_TYPE_25G_ACC_M			0x19
12076 #define ETH_TRANSCEIVER_TYPE_25G_CA_L			0x1a
12077 #define ETH_TRANSCEIVER_TYPE_25G_ACC_L			0x1b
12078 #define ETH_TRANSCEIVER_TYPE_25G_SR			0x1c
12079 #define ETH_TRANSCEIVER_TYPE_25G_LR			0x1d
12080 #define ETH_TRANSCEIVER_TYPE_25G_AOC			0x1e
12081 #define ETH_TRANSCEIVER_TYPE_4x10G			0x1f
12082 #define ETH_TRANSCEIVER_TYPE_4x25G_CR			0x20
12083 #define ETH_TRANSCEIVER_TYPE_1000BASET			0x21
12084 #define ETH_TRANSCEIVER_TYPE_10G_BASET			0x22
12085 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_10G_40G_SR	0x30
12086 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_10G_40G_CR	0x31
12087 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_10G_40G_LR	0x32
12088 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_40G_100G_SR	0x33
12089 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_40G_100G_CR	0x34
12090 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_40G_100G_LR	0x35
12091 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_40G_100G_AOC	0x36
12092 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_10G_25G_SR	0x37
12093 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_10G_25G_LR	0x38
12094 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_1G_10G_SR	0x39
12095 #define ETH_TRANSCEIVER_TYPE_MULTI_RATE_1G_10G_LR	0x3a
12096 
12097 	u32 wol_info;
12098 	u32 wol_pkt_len;
12099 	u32 wol_pkt_details;
12100 	struct dcb_dscp_map dcb_dscp_map;
12101 
12102 	u32 eee_status;
12103 #define EEE_ACTIVE_BIT			BIT(0)
12104 #define EEE_LD_ADV_STATUS_MASK		0x000000f0
12105 #define EEE_LD_ADV_STATUS_OFFSET	4
12106 #define EEE_1G_ADV			BIT(1)
12107 #define EEE_10G_ADV			BIT(2)
12108 #define EEE_LP_ADV_STATUS_MASK		0x00000f00
12109 #define EEE_LP_ADV_STATUS_OFFSET	8
12110 #define EEE_SUPPORTED_SPEED_MASK	0x0000f000
12111 #define EEE_SUPPORTED_SPEED_OFFSET	12
12112 #define EEE_1G_SUPPORTED		BIT(1)
12113 #define EEE_10G_SUPPORTED		BIT(2)
12114 
12115 	u32 eee_remote;
12116 #define EEE_REMOTE_TW_TX_MASK   0x0000ffff
12117 #define EEE_REMOTE_TW_TX_OFFSET 0
12118 #define EEE_REMOTE_TW_RX_MASK   0xffff0000
12119 #define EEE_REMOTE_TW_RX_OFFSET 16
12120 
12121 	u32 reserved1;
12122 	u32 oem_cfg_port;
12123 #define OEM_CFG_CHANNEL_TYPE_MASK                       0x00000003
12124 #define OEM_CFG_CHANNEL_TYPE_OFFSET                     0
12125 #define OEM_CFG_CHANNEL_TYPE_VLAN_PARTITION             0x1
12126 #define OEM_CFG_CHANNEL_TYPE_STAGGED                    0x2
12127 #define OEM_CFG_SCHED_TYPE_MASK                         0x0000000C
12128 #define OEM_CFG_SCHED_TYPE_OFFSET                       2
12129 #define OEM_CFG_SCHED_TYPE_ETS                          0x1
12130 #define OEM_CFG_SCHED_TYPE_VNIC_BW                      0x2
12131 };
12132 
12133 struct public_func {
12134 	u32 reserved0[2];
12135 
12136 	u32 mtu_size;
12137 
12138 	u32 reserved[7];
12139 
12140 	u32 config;
12141 #define FUNC_MF_CFG_FUNC_HIDE			0x00000001
12142 #define FUNC_MF_CFG_PAUSE_ON_HOST_RING		0x00000002
12143 #define FUNC_MF_CFG_PAUSE_ON_HOST_RING_SHIFT	0x00000001
12144 
12145 #define FUNC_MF_CFG_PROTOCOL_MASK	0x000000f0
12146 #define FUNC_MF_CFG_PROTOCOL_SHIFT	4
12147 #define FUNC_MF_CFG_PROTOCOL_ETHERNET	0x00000000
12148 #define FUNC_MF_CFG_PROTOCOL_ISCSI              0x00000010
12149 #define FUNC_MF_CFG_PROTOCOL_FCOE               0x00000020
12150 #define FUNC_MF_CFG_PROTOCOL_ROCE               0x00000030
12151 #define FUNC_MF_CFG_PROTOCOL_NVMETCP    0x00000040
12152 #define FUNC_MF_CFG_PROTOCOL_MAX	0x00000040
12153 
12154 #define FUNC_MF_CFG_MIN_BW_MASK		0x0000ff00
12155 #define FUNC_MF_CFG_MIN_BW_SHIFT	8
12156 #define FUNC_MF_CFG_MIN_BW_DEFAULT	0x00000000
12157 #define FUNC_MF_CFG_MAX_BW_MASK		0x00ff0000
12158 #define FUNC_MF_CFG_MAX_BW_SHIFT	16
12159 #define FUNC_MF_CFG_MAX_BW_DEFAULT	0x00640000
12160 
12161 	u32 status;
12162 #define FUNC_STATUS_VIRTUAL_LINK_UP	0x00000001
12163 
12164 	u32 mac_upper;
12165 #define FUNC_MF_CFG_UPPERMAC_MASK	0x0000ffff
12166 #define FUNC_MF_CFG_UPPERMAC_SHIFT	0
12167 #define FUNC_MF_CFG_UPPERMAC_DEFAULT	FUNC_MF_CFG_UPPERMAC_MASK
12168 	u32 mac_lower;
12169 #define FUNC_MF_CFG_LOWERMAC_DEFAULT	0xffffffff
12170 
12171 	u32 fcoe_wwn_port_name_upper;
12172 	u32 fcoe_wwn_port_name_lower;
12173 
12174 	u32 fcoe_wwn_node_name_upper;
12175 	u32 fcoe_wwn_node_name_lower;
12176 
12177 	u32 ovlan_stag;
12178 #define FUNC_MF_CFG_OV_STAG_MASK	0x0000ffff
12179 #define FUNC_MF_CFG_OV_STAG_SHIFT	0
12180 #define FUNC_MF_CFG_OV_STAG_DEFAULT	FUNC_MF_CFG_OV_STAG_MASK
12181 
12182 	u32 pf_allocation;
12183 
12184 	u32 preserve_data;
12185 
12186 	u32 driver_last_activity_ts;
12187 
12188 	u32 drv_ack_vf_disabled[VF_MAX_STATIC / 32];
12189 
12190 	u32 drv_id;
12191 #define DRV_ID_PDA_COMP_VER_MASK	0x0000ffff
12192 #define DRV_ID_PDA_COMP_VER_SHIFT	0
12193 
12194 #define LOAD_REQ_HSI_VERSION		2
12195 #define DRV_ID_MCP_HSI_VER_MASK		0x00ff0000
12196 #define DRV_ID_MCP_HSI_VER_SHIFT	16
12197 #define DRV_ID_MCP_HSI_VER_CURRENT	(LOAD_REQ_HSI_VERSION << \
12198 					 DRV_ID_MCP_HSI_VER_SHIFT)
12199 
12200 #define DRV_ID_DRV_TYPE_MASK		0x7f000000
12201 #define DRV_ID_DRV_TYPE_SHIFT		24
12202 #define DRV_ID_DRV_TYPE_UNKNOWN		(0 << DRV_ID_DRV_TYPE_SHIFT)
12203 #define DRV_ID_DRV_TYPE_LINUX		(1 << DRV_ID_DRV_TYPE_SHIFT)
12204 
12205 #define DRV_ID_DRV_INIT_HW_MASK		0x80000000
12206 #define DRV_ID_DRV_INIT_HW_SHIFT	31
12207 #define DRV_ID_DRV_INIT_HW_FLAG		(1 << DRV_ID_DRV_INIT_HW_SHIFT)
12208 
12209 	u32 oem_cfg_func;
12210 #define OEM_CFG_FUNC_TC_MASK                    0x0000000F
12211 #define OEM_CFG_FUNC_TC_OFFSET                  0
12212 #define OEM_CFG_FUNC_TC_0                       0x0
12213 #define OEM_CFG_FUNC_TC_1                       0x1
12214 #define OEM_CFG_FUNC_TC_2                       0x2
12215 #define OEM_CFG_FUNC_TC_3                       0x3
12216 #define OEM_CFG_FUNC_TC_4                       0x4
12217 #define OEM_CFG_FUNC_TC_5                       0x5
12218 #define OEM_CFG_FUNC_TC_6                       0x6
12219 #define OEM_CFG_FUNC_TC_7                       0x7
12220 
12221 #define OEM_CFG_FUNC_HOST_PRI_CTRL_MASK         0x00000030
12222 #define OEM_CFG_FUNC_HOST_PRI_CTRL_OFFSET       4
12223 #define OEM_CFG_FUNC_HOST_PRI_CTRL_VNIC         0x1
12224 #define OEM_CFG_FUNC_HOST_PRI_CTRL_OS           0x2
12225 };
12226 
12227 struct mcp_mac {
12228 	u32 mac_upper;
12229 	u32 mac_lower;
12230 };
12231 
12232 struct mcp_val64 {
12233 	u32 lo;
12234 	u32 hi;
12235 };
12236 
12237 struct mcp_file_att {
12238 	u32 nvm_start_addr;
12239 	u32 len;
12240 };
12241 
12242 struct bist_nvm_image_att {
12243 	u32 return_code;
12244 	u32 image_type;
12245 	u32 nvm_start_addr;
12246 	u32 len;
12247 };
12248 
12249 #define MCP_DRV_VER_STR_SIZE 16
12250 #define MCP_DRV_VER_STR_SIZE_DWORD (MCP_DRV_VER_STR_SIZE / sizeof(u32))
12251 #define MCP_DRV_NVM_BUF_LEN 32
12252 struct drv_version_stc {
12253 	u32 version;
12254 	u8 name[MCP_DRV_VER_STR_SIZE - 4];
12255 };
12256 
12257 struct lan_stats_stc {
12258 	u64 ucast_rx_pkts;
12259 	u64 ucast_tx_pkts;
12260 	u32 fcs_err;
12261 	u32 rserved;
12262 };
12263 
12264 struct fcoe_stats_stc {
12265 	u64 rx_pkts;
12266 	u64 tx_pkts;
12267 	u32 fcs_err;
12268 	u32 login_failure;
12269 };
12270 
12271 struct ocbb_data_stc {
12272 	u32 ocbb_host_addr;
12273 	u32 ocsd_host_addr;
12274 	u32 ocsd_req_update_interval;
12275 };
12276 
12277 #define MAX_NUM_OF_SENSORS 7
12278 struct temperature_status_stc {
12279 	u32 num_of_sensors;
12280 	u32 sensor[MAX_NUM_OF_SENSORS];
12281 };
12282 
12283 /* crash dump configuration header */
12284 struct mdump_config_stc {
12285 	u32 version;
12286 	u32 config;
12287 	u32 epoc;
12288 	u32 num_of_logs;
12289 	u32 valid_logs;
12290 };
12291 
12292 enum resource_id_enum {
12293 	RESOURCE_NUM_SB_E = 0,
12294 	RESOURCE_NUM_L2_QUEUE_E = 1,
12295 	RESOURCE_NUM_VPORT_E = 2,
12296 	RESOURCE_NUM_VMQ_E = 3,
12297 	RESOURCE_FACTOR_NUM_RSS_PF_E = 4,
12298 	RESOURCE_FACTOR_RSS_PER_VF_E = 5,
12299 	RESOURCE_NUM_RL_E = 6,
12300 	RESOURCE_NUM_PQ_E = 7,
12301 	RESOURCE_NUM_VF_E = 8,
12302 	RESOURCE_VFC_FILTER_E = 9,
12303 	RESOURCE_ILT_E = 10,
12304 	RESOURCE_CQS_E = 11,
12305 	RESOURCE_GFT_PROFILES_E = 12,
12306 	RESOURCE_NUM_TC_E = 13,
12307 	RESOURCE_NUM_RSS_ENGINES_E = 14,
12308 	RESOURCE_LL2_QUEUE_E = 15,
12309 	RESOURCE_RDMA_STATS_QUEUE_E = 16,
12310 	RESOURCE_BDQ_E = 17,
12311 	RESOURCE_QCN_E = 18,
12312 	RESOURCE_LLH_FILTER_E = 19,
12313 	RESOURCE_VF_MAC_ADDR = 20,
12314 	RESOURCE_LL2_CQS_E = 21,
12315 	RESOURCE_VF_CNQS = 22,
12316 	RESOURCE_MAX_NUM,
12317 	RESOURCE_NUM_INVALID = 0xFFFFFFFF
12318 };
12319 
12320 /* Resource ID is to be filled by the driver in the MB request
12321  * Size, offset & flags to be filled by the MFW in the MB response
12322  */
12323 struct resource_info {
12324 	enum resource_id_enum res_id;
12325 	u32 size;		/* number of allocated resources */
12326 	u32 offset;		/* Offset of the 1st resource */
12327 	u32 vf_size;
12328 	u32 vf_offset;
12329 	u32 flags;
12330 #define RESOURCE_ELEMENT_STRICT (1 << 0)
12331 };
12332 
12333 #define DRV_ROLE_NONE           0
12334 #define DRV_ROLE_PREBOOT        1
12335 #define DRV_ROLE_OS             2
12336 #define DRV_ROLE_KDUMP          3
12337 
12338 struct load_req_stc {
12339 	u32 drv_ver_0;
12340 	u32 drv_ver_1;
12341 	u32 fw_ver;
12342 	u32 misc0;
12343 #define LOAD_REQ_ROLE_MASK              0x000000FF
12344 #define LOAD_REQ_ROLE_SHIFT             0
12345 #define LOAD_REQ_LOCK_TO_MASK           0x0000FF00
12346 #define LOAD_REQ_LOCK_TO_SHIFT          8
12347 #define LOAD_REQ_LOCK_TO_DEFAULT        0
12348 #define LOAD_REQ_LOCK_TO_NONE           255
12349 #define LOAD_REQ_FORCE_MASK             0x000F0000
12350 #define LOAD_REQ_FORCE_SHIFT            16
12351 #define LOAD_REQ_FORCE_NONE             0
12352 #define LOAD_REQ_FORCE_PF               1
12353 #define LOAD_REQ_FORCE_ALL              2
12354 #define LOAD_REQ_FLAGS0_MASK            0x00F00000
12355 #define LOAD_REQ_FLAGS0_SHIFT           20
12356 #define LOAD_REQ_FLAGS0_AVOID_RESET     (0x1 << 0)
12357 };
12358 
12359 struct load_rsp_stc {
12360 	u32 drv_ver_0;
12361 	u32 drv_ver_1;
12362 	u32 fw_ver;
12363 	u32 misc0;
12364 #define LOAD_RSP_ROLE_MASK              0x000000FF
12365 #define LOAD_RSP_ROLE_SHIFT             0
12366 #define LOAD_RSP_HSI_MASK               0x0000FF00
12367 #define LOAD_RSP_HSI_SHIFT              8
12368 #define LOAD_RSP_FLAGS0_MASK            0x000F0000
12369 #define LOAD_RSP_FLAGS0_SHIFT           16
12370 #define LOAD_RSP_FLAGS0_DRV_EXISTS      (0x1 << 0)
12371 };
12372 
12373 struct mdump_retain_data_stc {
12374 	u32 valid;
12375 	u32 epoch;
12376 	u32 pf;
12377 	u32 status;
12378 };
12379 
12380 union drv_union_data {
12381 	u32 ver_str[MCP_DRV_VER_STR_SIZE_DWORD];
12382 	struct mcp_mac wol_mac;
12383 
12384 	struct eth_phy_cfg drv_phy_cfg;
12385 
12386 	struct mcp_val64 val64;
12387 
12388 	u8 raw_data[MCP_DRV_NVM_BUF_LEN];
12389 
12390 	struct mcp_file_att file_att;
12391 
12392 	u32 ack_vf_disabled[VF_MAX_STATIC / 32];
12393 
12394 	struct drv_version_stc drv_version;
12395 
12396 	struct lan_stats_stc lan_stats;
12397 	struct fcoe_stats_stc fcoe_stats;
12398 	struct ocbb_data_stc ocbb_info;
12399 	struct temperature_status_stc temp_info;
12400 	struct resource_info resource;
12401 	struct bist_nvm_image_att nvm_image_att;
12402 	struct mdump_config_stc mdump_config;
12403 };
12404 
12405 struct public_drv_mb {
12406 	u32 drv_mb_header;
12407 #define DRV_MSG_CODE_MASK			0xffff0000
12408 #define DRV_MSG_CODE_LOAD_REQ			0x10000000
12409 #define DRV_MSG_CODE_LOAD_DONE			0x11000000
12410 #define DRV_MSG_CODE_INIT_HW			0x12000000
12411 #define DRV_MSG_CODE_CANCEL_LOAD_REQ            0x13000000
12412 #define DRV_MSG_CODE_UNLOAD_REQ			0x20000000
12413 #define DRV_MSG_CODE_UNLOAD_DONE		0x21000000
12414 #define DRV_MSG_CODE_INIT_PHY			0x22000000
12415 #define DRV_MSG_CODE_LINK_RESET			0x23000000
12416 #define DRV_MSG_CODE_SET_DCBX			0x25000000
12417 #define DRV_MSG_CODE_OV_UPDATE_CURR_CFG         0x26000000
12418 #define DRV_MSG_CODE_OV_UPDATE_BUS_NUM          0x27000000
12419 #define DRV_MSG_CODE_OV_UPDATE_BOOT_PROGRESS    0x28000000
12420 #define DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER     0x29000000
12421 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE     0x31000000
12422 #define DRV_MSG_CODE_BW_UPDATE_ACK              0x32000000
12423 #define DRV_MSG_CODE_OV_UPDATE_MTU              0x33000000
12424 #define DRV_MSG_GET_RESOURCE_ALLOC_MSG		0x34000000
12425 #define DRV_MSG_SET_RESOURCE_VALUE_MSG		0x35000000
12426 #define DRV_MSG_CODE_OV_UPDATE_WOL              0x38000000
12427 #define DRV_MSG_CODE_OV_UPDATE_ESWITCH_MODE     0x39000000
12428 #define DRV_MSG_CODE_GET_OEM_UPDATES            0x41000000
12429 
12430 #define DRV_MSG_CODE_BW_UPDATE_ACK		0x32000000
12431 #define DRV_MSG_CODE_NIG_DRAIN			0x30000000
12432 #define DRV_MSG_CODE_S_TAG_UPDATE_ACK		0x3b000000
12433 #define DRV_MSG_CODE_GET_NVM_CFG_OPTION		0x003e0000
12434 #define DRV_MSG_CODE_SET_NVM_CFG_OPTION		0x003f0000
12435 #define DRV_MSG_CODE_INITIATE_PF_FLR            0x02010000
12436 #define DRV_MSG_CODE_VF_DISABLED_DONE		0xc0000000
12437 #define DRV_MSG_CODE_CFG_VF_MSIX		0xc0010000
12438 #define DRV_MSG_CODE_CFG_PF_VFS_MSIX		0xc0020000
12439 #define DRV_MSG_CODE_NVM_PUT_FILE_BEGIN		0x00010000
12440 #define DRV_MSG_CODE_NVM_PUT_FILE_DATA		0x00020000
12441 #define DRV_MSG_CODE_NVM_GET_FILE_ATT		0x00030000
12442 #define DRV_MSG_CODE_NVM_READ_NVRAM		0x00050000
12443 #define DRV_MSG_CODE_NVM_WRITE_NVRAM		0x00060000
12444 #define DRV_MSG_CODE_MCP_RESET			0x00090000
12445 #define DRV_MSG_CODE_SET_VERSION		0x000f0000
12446 #define DRV_MSG_CODE_MCP_HALT                   0x00100000
12447 #define DRV_MSG_CODE_SET_VMAC                   0x00110000
12448 #define DRV_MSG_CODE_GET_VMAC                   0x00120000
12449 #define DRV_MSG_CODE_VMAC_TYPE_SHIFT            4
12450 #define DRV_MSG_CODE_VMAC_TYPE_MASK             0x30
12451 #define DRV_MSG_CODE_VMAC_TYPE_MAC              1
12452 #define DRV_MSG_CODE_VMAC_TYPE_WWNN             2
12453 #define DRV_MSG_CODE_VMAC_TYPE_WWPN             3
12454 
12455 #define DRV_MSG_CODE_GET_STATS                  0x00130000
12456 #define DRV_MSG_CODE_STATS_TYPE_LAN             1
12457 #define DRV_MSG_CODE_STATS_TYPE_FCOE            2
12458 #define DRV_MSG_CODE_STATS_TYPE_ISCSI           3
12459 #define DRV_MSG_CODE_STATS_TYPE_RDMA            4
12460 
12461 #define DRV_MSG_CODE_TRANSCEIVER_READ           0x00160000
12462 
12463 #define DRV_MSG_CODE_MASK_PARITIES              0x001a0000
12464 
12465 #define DRV_MSG_CODE_BIST_TEST			0x001e0000
12466 #define DRV_MSG_CODE_SET_LED_MODE		0x00200000
12467 #define DRV_MSG_CODE_RESOURCE_CMD		0x00230000
12468 /* Send crash dump commands with param[3:0] - opcode */
12469 #define DRV_MSG_CODE_MDUMP_CMD			0x00250000
12470 #define DRV_MSG_CODE_GET_TLV_DONE		0x002f0000
12471 #define DRV_MSG_CODE_GET_ENGINE_CONFIG		0x00370000
12472 #define DRV_MSG_CODE_GET_PPFID_BITMAP		0x43000000
12473 
12474 #define DRV_MSG_CODE_DEBUG_DATA_SEND		0xc0040000
12475 
12476 #define RESOURCE_CMD_REQ_RESC_MASK		0x0000001F
12477 #define RESOURCE_CMD_REQ_RESC_SHIFT		0
12478 #define RESOURCE_CMD_REQ_OPCODE_MASK		0x000000E0
12479 #define RESOURCE_CMD_REQ_OPCODE_SHIFT		5
12480 #define RESOURCE_OPCODE_REQ			1
12481 #define RESOURCE_OPCODE_REQ_WO_AGING		2
12482 #define RESOURCE_OPCODE_REQ_W_AGING		3
12483 #define RESOURCE_OPCODE_RELEASE			4
12484 #define RESOURCE_OPCODE_FORCE_RELEASE		5
12485 #define RESOURCE_CMD_REQ_AGE_MASK		0x0000FF00
12486 #define RESOURCE_CMD_REQ_AGE_SHIFT		8
12487 
12488 #define RESOURCE_CMD_RSP_OWNER_MASK		0x000000FF
12489 #define RESOURCE_CMD_RSP_OWNER_SHIFT		0
12490 #define RESOURCE_CMD_RSP_OPCODE_MASK		0x00000700
12491 #define RESOURCE_CMD_RSP_OPCODE_SHIFT		8
12492 #define RESOURCE_OPCODE_GNT			1
12493 #define RESOURCE_OPCODE_BUSY			2
12494 #define RESOURCE_OPCODE_RELEASED		3
12495 #define RESOURCE_OPCODE_RELEASED_PREVIOUS	4
12496 #define RESOURCE_OPCODE_WRONG_OWNER		5
12497 #define RESOURCE_OPCODE_UNKNOWN_CMD		255
12498 
12499 #define RESOURCE_DUMP				0
12500 
12501 /* DRV_MSG_CODE_MDUMP_CMD parameters */
12502 #define MDUMP_DRV_PARAM_OPCODE_MASK             0x0000000f
12503 #define DRV_MSG_CODE_MDUMP_ACK                  0x01
12504 #define DRV_MSG_CODE_MDUMP_SET_VALUES           0x02
12505 #define DRV_MSG_CODE_MDUMP_TRIGGER              0x03
12506 #define DRV_MSG_CODE_MDUMP_GET_CONFIG           0x04
12507 #define DRV_MSG_CODE_MDUMP_SET_ENABLE           0x05
12508 #define DRV_MSG_CODE_MDUMP_CLEAR_LOGS           0x06
12509 #define DRV_MSG_CODE_MDUMP_GET_RETAIN           0x07
12510 #define DRV_MSG_CODE_MDUMP_CLR_RETAIN           0x08
12511 
12512 #define DRV_MSG_CODE_HW_DUMP_TRIGGER            0x0a
12513 #define DRV_MSG_CODE_MDUMP_GEN_MDUMP2           0x0b
12514 #define DRV_MSG_CODE_MDUMP_FREE_MDUMP2          0x0c
12515 
12516 #define DRV_MSG_CODE_GET_PF_RDMA_PROTOCOL	0x002b0000
12517 #define DRV_MSG_CODE_OS_WOL			0x002e0000
12518 
12519 #define DRV_MSG_CODE_FEATURE_SUPPORT		0x00300000
12520 #define DRV_MSG_CODE_GET_MFW_FEATURE_SUPPORT	0x00310000
12521 #define DRV_MSG_SEQ_NUMBER_MASK			0x0000ffff
12522 
12523 	u32 drv_mb_param;
12524 #define DRV_MB_PARAM_UNLOAD_WOL_UNKNOWN         0x00000000
12525 #define DRV_MB_PARAM_UNLOAD_WOL_MCP             0x00000001
12526 #define DRV_MB_PARAM_UNLOAD_WOL_DISABLED        0x00000002
12527 #define DRV_MB_PARAM_UNLOAD_WOL_ENABLED         0x00000003
12528 #define DRV_MB_PARAM_DCBX_NOTIFY_MASK		0x000000FF
12529 #define DRV_MB_PARAM_DCBX_NOTIFY_SHIFT		3
12530 
12531 #define DRV_MB_PARAM_NVM_PUT_FILE_BEGIN_MBI     0x3
12532 #define DRV_MB_PARAM_NVM_OFFSET_OFFSET          0
12533 #define DRV_MB_PARAM_NVM_OFFSET_MASK            0x00FFFFFF
12534 #define DRV_MB_PARAM_NVM_LEN_OFFSET		24
12535 #define DRV_MB_PARAM_NVM_LEN_MASK               0xFF000000
12536 
12537 #define DRV_MB_PARAM_CFG_VF_MSIX_VF_ID_SHIFT	0
12538 #define DRV_MB_PARAM_CFG_VF_MSIX_VF_ID_MASK	0x000000FF
12539 #define DRV_MB_PARAM_CFG_VF_MSIX_SB_NUM_SHIFT	8
12540 #define DRV_MB_PARAM_CFG_VF_MSIX_SB_NUM_MASK	0x0000FF00
12541 #define DRV_MB_PARAM_LLDP_SEND_MASK		0x00000001
12542 #define DRV_MB_PARAM_LLDP_SEND_SHIFT		0
12543 
12544 #define DRV_MB_PARAM_OV_CURR_CFG_SHIFT		0
12545 #define DRV_MB_PARAM_OV_CURR_CFG_MASK		0x0000000F
12546 #define DRV_MB_PARAM_OV_CURR_CFG_NONE		0
12547 #define DRV_MB_PARAM_OV_CURR_CFG_OS		1
12548 #define DRV_MB_PARAM_OV_CURR_CFG_VENDOR_SPEC	2
12549 #define DRV_MB_PARAM_OV_CURR_CFG_OTHER		3
12550 
12551 #define DRV_MB_PARAM_OV_STORM_FW_VER_SHIFT	0
12552 #define DRV_MB_PARAM_OV_STORM_FW_VER_MASK	0xFFFFFFFF
12553 #define DRV_MB_PARAM_OV_STORM_FW_VER_MAJOR_MASK	0xFF000000
12554 #define DRV_MB_PARAM_OV_STORM_FW_VER_MINOR_MASK	0x00FF0000
12555 #define DRV_MB_PARAM_OV_STORM_FW_VER_BUILD_MASK	0x0000FF00
12556 #define DRV_MB_PARAM_OV_STORM_FW_VER_DROP_MASK	0x000000FF
12557 
12558 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_SHIFT	0
12559 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_MASK	0xF
12560 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_UNKNOWN	0x1
12561 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_NOT_LOADED	0x2
12562 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_LOADING	0x3
12563 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_DISABLED	0x4
12564 #define DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE_ACTIVE	0x5
12565 
12566 #define DRV_MB_PARAM_OV_MTU_SIZE_SHIFT	0
12567 #define DRV_MB_PARAM_OV_MTU_SIZE_MASK	0xFFFFFFFF
12568 
12569 #define DRV_MB_PARAM_WOL_MASK	(DRV_MB_PARAM_WOL_DEFAULT | \
12570 				 DRV_MB_PARAM_WOL_DISABLED | \
12571 				 DRV_MB_PARAM_WOL_ENABLED)
12572 #define DRV_MB_PARAM_WOL_DEFAULT	DRV_MB_PARAM_UNLOAD_WOL_MCP
12573 #define DRV_MB_PARAM_WOL_DISABLED	DRV_MB_PARAM_UNLOAD_WOL_DISABLED
12574 #define DRV_MB_PARAM_WOL_ENABLED	DRV_MB_PARAM_UNLOAD_WOL_ENABLED
12575 
12576 #define DRV_MB_PARAM_ESWITCH_MODE_MASK	(DRV_MB_PARAM_ESWITCH_MODE_NONE | \
12577 					 DRV_MB_PARAM_ESWITCH_MODE_VEB | \
12578 					 DRV_MB_PARAM_ESWITCH_MODE_VEPA)
12579 #define DRV_MB_PARAM_ESWITCH_MODE_NONE	0x0
12580 #define DRV_MB_PARAM_ESWITCH_MODE_VEB	0x1
12581 #define DRV_MB_PARAM_ESWITCH_MODE_VEPA	0x2
12582 
12583 #define DRV_MB_PARAM_DUMMY_OEM_UPDATES_MASK	0x1
12584 #define DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET	0
12585 
12586 #define DRV_MB_PARAM_SET_LED_MODE_OPER		0x0
12587 #define DRV_MB_PARAM_SET_LED_MODE_ON		0x1
12588 #define DRV_MB_PARAM_SET_LED_MODE_OFF		0x2
12589 
12590 #define DRV_MB_PARAM_TRANSCEIVER_PORT_OFFSET			0
12591 #define DRV_MB_PARAM_TRANSCEIVER_PORT_MASK			0x00000003
12592 #define DRV_MB_PARAM_TRANSCEIVER_SIZE_OFFSET			2
12593 #define DRV_MB_PARAM_TRANSCEIVER_SIZE_MASK			0x000000fc
12594 #define DRV_MB_PARAM_TRANSCEIVER_I2C_ADDRESS_OFFSET		8
12595 #define DRV_MB_PARAM_TRANSCEIVER_I2C_ADDRESS_MASK		0x0000ff00
12596 #define DRV_MB_PARAM_TRANSCEIVER_OFFSET_OFFSET			16
12597 #define DRV_MB_PARAM_TRANSCEIVER_OFFSET_MASK			0xffff0000
12598 
12599 	/* Resource Allocation params - Driver version support */
12600 #define DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_MASK		0xffff0000
12601 #define DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_SHIFT		16
12602 #define DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_MASK		0x0000ffff
12603 #define DRV_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_SHIFT		0
12604 
12605 #define DRV_MB_PARAM_BIST_REGISTER_TEST				1
12606 #define DRV_MB_PARAM_BIST_CLOCK_TEST				2
12607 #define DRV_MB_PARAM_BIST_NVM_TEST_NUM_IMAGES			3
12608 #define DRV_MB_PARAM_BIST_NVM_TEST_IMAGE_BY_INDEX		4
12609 
12610 #define DRV_MB_PARAM_BIST_RC_UNKNOWN				0
12611 #define DRV_MB_PARAM_BIST_RC_PASSED				1
12612 #define DRV_MB_PARAM_BIST_RC_FAILED				2
12613 #define DRV_MB_PARAM_BIST_RC_INVALID_PARAMETER			3
12614 
12615 #define DRV_MB_PARAM_BIST_TEST_INDEX_SHIFT			0
12616 #define DRV_MB_PARAM_BIST_TEST_INDEX_MASK			0x000000ff
12617 #define DRV_MB_PARAM_BIST_TEST_IMAGE_INDEX_SHIFT		8
12618 #define DRV_MB_PARAM_BIST_TEST_IMAGE_INDEX_MASK			0x0000ff00
12619 
12620 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_MASK			0x0000ffff
12621 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_OFFSET		0
12622 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_EEE			0x00000002
12623 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_FEC_CONTROL		0x00000004
12624 #define DRV_MB_PARAM_FEATURE_SUPPORT_PORT_EXT_SPEED_FEC_CONTROL	0x00000008
12625 #define DRV_MB_PARAM_FEATURE_SUPPORT_FUNC_VLINK			0x00010000
12626 
12627 /* DRV_MSG_CODE_DEBUG_DATA_SEND parameters */
12628 #define DRV_MSG_CODE_DEBUG_DATA_SEND_SIZE_OFFSET		0
12629 #define DRV_MSG_CODE_DEBUG_DATA_SEND_SIZE_MASK			0xff
12630 
12631 /* Driver attributes params */
12632 #define DRV_MB_PARAM_ATTRIBUTE_KEY_OFFSET			0
12633 #define DRV_MB_PARAM_ATTRIBUTE_KEY_MASK				0x00ffffff
12634 #define DRV_MB_PARAM_ATTRIBUTE_CMD_OFFSET			24
12635 #define DRV_MB_PARAM_ATTRIBUTE_CMD_MASK				0xff000000
12636 
12637 #define DRV_MB_PARAM_NVM_CFG_OPTION_ID_OFFSET			0
12638 #define DRV_MB_PARAM_NVM_CFG_OPTION_ID_SHIFT			0
12639 #define DRV_MB_PARAM_NVM_CFG_OPTION_ID_MASK			0x0000ffff
12640 #define DRV_MB_PARAM_NVM_CFG_OPTION_ALL_SHIFT			16
12641 #define DRV_MB_PARAM_NVM_CFG_OPTION_ALL_MASK			0x00010000
12642 #define DRV_MB_PARAM_NVM_CFG_OPTION_INIT_SHIFT			17
12643 #define DRV_MB_PARAM_NVM_CFG_OPTION_INIT_MASK			0x00020000
12644 #define DRV_MB_PARAM_NVM_CFG_OPTION_COMMIT_SHIFT		18
12645 #define DRV_MB_PARAM_NVM_CFG_OPTION_COMMIT_MASK			0x00040000
12646 #define DRV_MB_PARAM_NVM_CFG_OPTION_FREE_SHIFT			19
12647 #define DRV_MB_PARAM_NVM_CFG_OPTION_FREE_MASK			0x00080000
12648 #define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_SEL_SHIFT		20
12649 #define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_SEL_MASK		0x00100000
12650 #define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_ID_SHIFT		24
12651 #define DRV_MB_PARAM_NVM_CFG_OPTION_ENTITY_ID_MASK		0x0f000000
12652 
12653 	u32 fw_mb_header;
12654 #define FW_MSG_CODE_MASK			0xffff0000
12655 #define FW_MSG_CODE_UNSUPPORTED                 0x00000000
12656 #define FW_MSG_CODE_DRV_LOAD_ENGINE		0x10100000
12657 #define FW_MSG_CODE_DRV_LOAD_PORT		0x10110000
12658 #define FW_MSG_CODE_DRV_LOAD_FUNCTION		0x10120000
12659 #define FW_MSG_CODE_DRV_LOAD_REFUSED_PDA	0x10200000
12660 #define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI_1	0x10210000
12661 #define FW_MSG_CODE_DRV_LOAD_REFUSED_DIAG	0x10220000
12662 #define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI        0x10230000
12663 #define FW_MSG_CODE_DRV_LOAD_REFUSED_REQUIRES_FORCE 0x10300000
12664 #define FW_MSG_CODE_DRV_LOAD_REFUSED_REJECT     0x10310000
12665 #define FW_MSG_CODE_DRV_LOAD_DONE		0x11100000
12666 #define FW_MSG_CODE_DRV_UNLOAD_ENGINE		0x20110000
12667 #define FW_MSG_CODE_DRV_UNLOAD_PORT		0x20120000
12668 #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION		0x20130000
12669 #define FW_MSG_CODE_DRV_UNLOAD_DONE		0x21100000
12670 #define FW_MSG_CODE_RESOURCE_ALLOC_OK           0x34000000
12671 #define FW_MSG_CODE_RESOURCE_ALLOC_UNKNOWN      0x35000000
12672 #define FW_MSG_CODE_RESOURCE_ALLOC_DEPRECATED   0x36000000
12673 #define FW_MSG_CODE_S_TAG_UPDATE_ACK_DONE	0x3b000000
12674 #define FW_MSG_CODE_DRV_CFG_VF_MSIX_DONE	0xb0010000
12675 
12676 #define FW_MSG_CODE_NVM_OK			0x00010000
12677 #define FW_MSG_CODE_NVM_PUT_FILE_FINISH_OK	0x00400000
12678 #define FW_MSG_CODE_PHY_OK			0x00110000
12679 #define FW_MSG_CODE_OK				0x00160000
12680 #define FW_MSG_CODE_ERROR			0x00170000
12681 #define FW_MSG_CODE_TRANSCEIVER_DIAG_OK		0x00160000
12682 #define FW_MSG_CODE_TRANSCEIVER_DIAG_ERROR	0x00170000
12683 #define FW_MSG_CODE_TRANSCEIVER_NOT_PRESENT	0x00020000
12684 
12685 #define FW_MSG_CODE_OS_WOL_SUPPORTED            0x00800000
12686 #define FW_MSG_CODE_OS_WOL_NOT_SUPPORTED        0x00810000
12687 #define FW_MSG_CODE_DRV_CFG_PF_VFS_MSIX_DONE	0x00870000
12688 #define FW_MSG_SEQ_NUMBER_MASK			0x0000ffff
12689 
12690 #define FW_MSG_CODE_DEBUG_DATA_SEND_INV_ARG	0xb0070000
12691 #define FW_MSG_CODE_DEBUG_DATA_SEND_BUF_FULL	0xb0080000
12692 #define FW_MSG_CODE_DEBUG_DATA_SEND_NO_BUF	0xb0090000
12693 #define FW_MSG_CODE_DEBUG_NOT_ENABLED		0xb00a0000
12694 #define FW_MSG_CODE_DEBUG_DATA_SEND_OK		0xb00b0000
12695 
12696 #define FW_MSG_CODE_MDUMP_INVALID_CMD		0x00030000
12697 
12698 	u32							fw_mb_param;
12699 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_MASK		0xffff0000
12700 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MAJOR_SHIFT		16
12701 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_MASK		0x0000ffff
12702 #define FW_MB_PARAM_RESOURCE_ALLOC_VERSION_MINOR_SHIFT		0
12703 
12704 	/* Get PF RDMA protocol command response */
12705 #define FW_MB_PARAM_GET_PF_RDMA_NONE				0x0
12706 #define FW_MB_PARAM_GET_PF_RDMA_ROCE				0x1
12707 #define FW_MB_PARAM_GET_PF_RDMA_IWARP				0x2
12708 #define FW_MB_PARAM_GET_PF_RDMA_BOTH				0x3
12709 
12710 	/* Get MFW feature support response */
12711 #define FW_MB_PARAM_FEATURE_SUPPORT_SMARTLINQ			BIT(0)
12712 #define FW_MB_PARAM_FEATURE_SUPPORT_EEE				BIT(1)
12713 #define FW_MB_PARAM_FEATURE_SUPPORT_FEC_CONTROL			BIT(5)
12714 #define FW_MB_PARAM_FEATURE_SUPPORT_EXT_SPEED_FEC_CONTROL	BIT(6)
12715 #define FW_MB_PARAM_FEATURE_SUPPORT_VLINK			BIT(16)
12716 
12717 #define FW_MB_PARAM_LOAD_DONE_DID_EFUSE_ERROR			BIT(0)
12718 
12719 #define FW_MB_PARAM_ENG_CFG_FIR_AFFIN_VALID_MASK		0x00000001
12720 #define FW_MB_PARAM_ENG_CFG_FIR_AFFIN_VALID_SHIFT		0
12721 #define FW_MB_PARAM_ENG_CFG_FIR_AFFIN_VALUE_MASK		0x00000002
12722 #define FW_MB_PARAM_ENG_CFG_FIR_AFFIN_VALUE_SHIFT		1
12723 #define FW_MB_PARAM_ENG_CFG_L2_AFFIN_VALID_MASK			0x00000004
12724 #define FW_MB_PARAM_ENG_CFG_L2_AFFIN_VALID_SHIFT		2
12725 #define FW_MB_PARAM_ENG_CFG_L2_AFFIN_VALUE_MASK			0x00000008
12726 #define FW_MB_PARAM_ENG_CFG_L2_AFFIN_VALUE_SHIFT		3
12727 
12728 #define FW_MB_PARAM_PPFID_BITMAP_MASK				0xff
12729 #define FW_MB_PARAM_PPFID_BITMAP_SHIFT				0
12730 
12731 	u32							drv_pulse_mb;
12732 #define DRV_PULSE_SEQ_MASK					0x00007fff
12733 #define DRV_PULSE_SYSTEM_TIME_MASK				0xffff0000
12734 #define DRV_PULSE_ALWAYS_ALIVE					0x00008000
12735 
12736 	u32							mcp_pulse_mb;
12737 #define MCP_PULSE_SEQ_MASK					0x00007fff
12738 #define MCP_PULSE_ALWAYS_ALIVE					0x00008000
12739 #define MCP_EVENT_MASK						0xffff0000
12740 #define MCP_EVENT_OTHER_DRIVER_RESET_REQ			0x00010000
12741 
12742 	union drv_union_data					union_data;
12743 };
12744 
12745 #define FW_MB_PARAM_NVM_PUT_FILE_REQ_OFFSET_MASK		0x00ffffff
12746 #define FW_MB_PARAM_NVM_PUT_FILE_REQ_OFFSET_SHIFT		0
12747 #define FW_MB_PARAM_NVM_PUT_FILE_REQ_SIZE_MASK			0xff000000
12748 #define FW_MB_PARAM_NVM_PUT_FILE_REQ_SIZE_SHIFT			24
12749 
12750 enum MFW_DRV_MSG_TYPE {
12751 	MFW_DRV_MSG_LINK_CHANGE,
12752 	MFW_DRV_MSG_FLR_FW_ACK_FAILED,
12753 	MFW_DRV_MSG_VF_DISABLED,
12754 	MFW_DRV_MSG_LLDP_DATA_UPDATED,
12755 	MFW_DRV_MSG_DCBX_REMOTE_MIB_UPDATED,
12756 	MFW_DRV_MSG_DCBX_OPERATIONAL_MIB_UPDATED,
12757 	MFW_DRV_MSG_ERROR_RECOVERY,
12758 	MFW_DRV_MSG_BW_UPDATE,
12759 	MFW_DRV_MSG_S_TAG_UPDATE,
12760 	MFW_DRV_MSG_GET_LAN_STATS,
12761 	MFW_DRV_MSG_GET_FCOE_STATS,
12762 	MFW_DRV_MSG_GET_ISCSI_STATS,
12763 	MFW_DRV_MSG_GET_RDMA_STATS,
12764 	MFW_DRV_MSG_FAILURE_DETECTED,
12765 	MFW_DRV_MSG_TRANSCEIVER_STATE_CHANGE,
12766 	MFW_DRV_MSG_CRITICAL_ERROR_OCCURRED,
12767 	MFW_DRV_MSG_RESERVED,
12768 	MFW_DRV_MSG_GET_TLV_REQ,
12769 	MFW_DRV_MSG_OEM_CFG_UPDATE,
12770 	MFW_DRV_MSG_MAX
12771 };
12772 
12773 #define MFW_DRV_MSG_MAX_DWORDS(msgs)	(((msgs - 1) >> 2) + 1)
12774 #define MFW_DRV_MSG_DWORD(msg_id)	(msg_id >> 2)
12775 #define MFW_DRV_MSG_OFFSET(msg_id)	((msg_id & 0x3) << 3)
12776 #define MFW_DRV_MSG_MASK(msg_id)	(0xff << MFW_DRV_MSG_OFFSET(msg_id))
12777 
12778 struct public_mfw_mb {
12779 	u32 sup_msgs;
12780 	u32 msg[MFW_DRV_MSG_MAX_DWORDS(MFW_DRV_MSG_MAX)];
12781 	u32 ack[MFW_DRV_MSG_MAX_DWORDS(MFW_DRV_MSG_MAX)];
12782 };
12783 
12784 enum public_sections {
12785 	PUBLIC_DRV_MB,
12786 	PUBLIC_MFW_MB,
12787 	PUBLIC_GLOBAL,
12788 	PUBLIC_PATH,
12789 	PUBLIC_PORT,
12790 	PUBLIC_FUNC,
12791 	PUBLIC_MAX_SECTIONS
12792 };
12793 
12794 struct mcp_public_data {
12795 	u32 num_sections;
12796 	u32 sections[PUBLIC_MAX_SECTIONS];
12797 	struct public_drv_mb drv_mb[MCP_GLOB_FUNC_MAX];
12798 	struct public_mfw_mb mfw_mb[MCP_GLOB_FUNC_MAX];
12799 	struct public_global global;
12800 	struct public_path path[MCP_GLOB_PATH_MAX];
12801 	struct public_port port[MCP_GLOB_PORT_MAX];
12802 	struct public_func func[MCP_GLOB_FUNC_MAX];
12803 };
12804 
12805 #define MAX_I2C_TRANSACTION_SIZE	16
12806 
12807 /* OCBB definitions */
12808 enum tlvs {
12809 	/* Category 1: Device Properties */
12810 	DRV_TLV_CLP_STR,
12811 	DRV_TLV_CLP_STR_CTD,
12812 	/* Category 6: Device Configuration */
12813 	DRV_TLV_SCSI_TO,
12814 	DRV_TLV_R_T_TOV,
12815 	DRV_TLV_R_A_TOV,
12816 	DRV_TLV_E_D_TOV,
12817 	DRV_TLV_CR_TOV,
12818 	DRV_TLV_BOOT_TYPE,
12819 	/* Category 8: Port Configuration */
12820 	DRV_TLV_NPIV_ENABLED,
12821 	/* Category 10: Function Configuration */
12822 	DRV_TLV_FEATURE_FLAGS,
12823 	DRV_TLV_LOCAL_ADMIN_ADDR,
12824 	DRV_TLV_ADDITIONAL_MAC_ADDR_1,
12825 	DRV_TLV_ADDITIONAL_MAC_ADDR_2,
12826 	DRV_TLV_LSO_MAX_OFFLOAD_SIZE,
12827 	DRV_TLV_LSO_MIN_SEGMENT_COUNT,
12828 	DRV_TLV_PROMISCUOUS_MODE,
12829 	DRV_TLV_TX_DESCRIPTORS_QUEUE_SIZE,
12830 	DRV_TLV_RX_DESCRIPTORS_QUEUE_SIZE,
12831 	DRV_TLV_NUM_OF_NET_QUEUE_VMQ_CFG,
12832 	DRV_TLV_FLEX_NIC_OUTER_VLAN_ID,
12833 	DRV_TLV_OS_DRIVER_STATES,
12834 	DRV_TLV_PXE_BOOT_PROGRESS,
12835 	/* Category 12: FC/FCoE Configuration */
12836 	DRV_TLV_NPIV_STATE,
12837 	DRV_TLV_NUM_OF_NPIV_IDS,
12838 	DRV_TLV_SWITCH_NAME,
12839 	DRV_TLV_SWITCH_PORT_NUM,
12840 	DRV_TLV_SWITCH_PORT_ID,
12841 	DRV_TLV_VENDOR_NAME,
12842 	DRV_TLV_SWITCH_MODEL,
12843 	DRV_TLV_SWITCH_FW_VER,
12844 	DRV_TLV_QOS_PRIORITY_PER_802_1P,
12845 	DRV_TLV_PORT_ALIAS,
12846 	DRV_TLV_PORT_STATE,
12847 	DRV_TLV_FIP_TX_DESCRIPTORS_QUEUE_SIZE,
12848 	DRV_TLV_FCOE_RX_DESCRIPTORS_QUEUE_SIZE,
12849 	DRV_TLV_LINK_FAILURE_COUNT,
12850 	DRV_TLV_FCOE_BOOT_PROGRESS,
12851 	/* Category 13: iSCSI Configuration */
12852 	DRV_TLV_TARGET_LLMNR_ENABLED,
12853 	DRV_TLV_HEADER_DIGEST_FLAG_ENABLED,
12854 	DRV_TLV_DATA_DIGEST_FLAG_ENABLED,
12855 	DRV_TLV_AUTHENTICATION_METHOD,
12856 	DRV_TLV_ISCSI_BOOT_TARGET_PORTAL,
12857 	DRV_TLV_MAX_FRAME_SIZE,
12858 	DRV_TLV_PDU_TX_DESCRIPTORS_QUEUE_SIZE,
12859 	DRV_TLV_PDU_RX_DESCRIPTORS_QUEUE_SIZE,
12860 	DRV_TLV_ISCSI_BOOT_PROGRESS,
12861 	/* Category 20: Device Data */
12862 	DRV_TLV_PCIE_BUS_RX_UTILIZATION,
12863 	DRV_TLV_PCIE_BUS_TX_UTILIZATION,
12864 	DRV_TLV_DEVICE_CPU_CORES_UTILIZATION,
12865 	DRV_TLV_LAST_VALID_DCC_TLV_RECEIVED,
12866 	DRV_TLV_NCSI_RX_BYTES_RECEIVED,
12867 	DRV_TLV_NCSI_TX_BYTES_SENT,
12868 	/* Category 22: Base Port Data */
12869 	DRV_TLV_RX_DISCARDS,
12870 	DRV_TLV_RX_ERRORS,
12871 	DRV_TLV_TX_ERRORS,
12872 	DRV_TLV_TX_DISCARDS,
12873 	DRV_TLV_RX_FRAMES_RECEIVED,
12874 	DRV_TLV_TX_FRAMES_SENT,
12875 	/* Category 23: FC/FCoE Port Data */
12876 	DRV_TLV_RX_BROADCAST_PACKETS,
12877 	DRV_TLV_TX_BROADCAST_PACKETS,
12878 	/* Category 28: Base Function Data */
12879 	DRV_TLV_NUM_OFFLOADED_CONNECTIONS_TCP_IPV4,
12880 	DRV_TLV_NUM_OFFLOADED_CONNECTIONS_TCP_IPV6,
12881 	DRV_TLV_TX_DESCRIPTOR_QUEUE_AVG_DEPTH,
12882 	DRV_TLV_RX_DESCRIPTORS_QUEUE_AVG_DEPTH,
12883 	DRV_TLV_PF_RX_FRAMES_RECEIVED,
12884 	DRV_TLV_RX_BYTES_RECEIVED,
12885 	DRV_TLV_PF_TX_FRAMES_SENT,
12886 	DRV_TLV_TX_BYTES_SENT,
12887 	DRV_TLV_IOV_OFFLOAD,
12888 	DRV_TLV_PCI_ERRORS_CAP_ID,
12889 	DRV_TLV_UNCORRECTABLE_ERROR_STATUS,
12890 	DRV_TLV_UNCORRECTABLE_ERROR_MASK,
12891 	DRV_TLV_CORRECTABLE_ERROR_STATUS,
12892 	DRV_TLV_CORRECTABLE_ERROR_MASK,
12893 	DRV_TLV_PCI_ERRORS_AECC_REGISTER,
12894 	DRV_TLV_TX_QUEUES_EMPTY,
12895 	DRV_TLV_RX_QUEUES_EMPTY,
12896 	DRV_TLV_TX_QUEUES_FULL,
12897 	DRV_TLV_RX_QUEUES_FULL,
12898 	/* Category 29: FC/FCoE Function Data */
12899 	DRV_TLV_FCOE_TX_DESCRIPTOR_QUEUE_AVG_DEPTH,
12900 	DRV_TLV_FCOE_RX_DESCRIPTORS_QUEUE_AVG_DEPTH,
12901 	DRV_TLV_FCOE_RX_FRAMES_RECEIVED,
12902 	DRV_TLV_FCOE_RX_BYTES_RECEIVED,
12903 	DRV_TLV_FCOE_TX_FRAMES_SENT,
12904 	DRV_TLV_FCOE_TX_BYTES_SENT,
12905 	DRV_TLV_CRC_ERROR_COUNT,
12906 	DRV_TLV_CRC_ERROR_1_RECEIVED_SOURCE_FC_ID,
12907 	DRV_TLV_CRC_ERROR_1_TIMESTAMP,
12908 	DRV_TLV_CRC_ERROR_2_RECEIVED_SOURCE_FC_ID,
12909 	DRV_TLV_CRC_ERROR_2_TIMESTAMP,
12910 	DRV_TLV_CRC_ERROR_3_RECEIVED_SOURCE_FC_ID,
12911 	DRV_TLV_CRC_ERROR_3_TIMESTAMP,
12912 	DRV_TLV_CRC_ERROR_4_RECEIVED_SOURCE_FC_ID,
12913 	DRV_TLV_CRC_ERROR_4_TIMESTAMP,
12914 	DRV_TLV_CRC_ERROR_5_RECEIVED_SOURCE_FC_ID,
12915 	DRV_TLV_CRC_ERROR_5_TIMESTAMP,
12916 	DRV_TLV_LOSS_OF_SYNC_ERROR_COUNT,
12917 	DRV_TLV_LOSS_OF_SIGNAL_ERRORS,
12918 	DRV_TLV_PRIMITIVE_SEQUENCE_PROTOCOL_ERROR_COUNT,
12919 	DRV_TLV_DISPARITY_ERROR_COUNT,
12920 	DRV_TLV_CODE_VIOLATION_ERROR_COUNT,
12921 	DRV_TLV_LAST_FLOGI_ISSUED_COMMON_PARAMETERS_WORD_1,
12922 	DRV_TLV_LAST_FLOGI_ISSUED_COMMON_PARAMETERS_WORD_2,
12923 	DRV_TLV_LAST_FLOGI_ISSUED_COMMON_PARAMETERS_WORD_3,
12924 	DRV_TLV_LAST_FLOGI_ISSUED_COMMON_PARAMETERS_WORD_4,
12925 	DRV_TLV_LAST_FLOGI_TIMESTAMP,
12926 	DRV_TLV_LAST_FLOGI_ACC_COMMON_PARAMETERS_WORD_1,
12927 	DRV_TLV_LAST_FLOGI_ACC_COMMON_PARAMETERS_WORD_2,
12928 	DRV_TLV_LAST_FLOGI_ACC_COMMON_PARAMETERS_WORD_3,
12929 	DRV_TLV_LAST_FLOGI_ACC_COMMON_PARAMETERS_WORD_4,
12930 	DRV_TLV_LAST_FLOGI_ACC_TIMESTAMP,
12931 	DRV_TLV_LAST_FLOGI_RJT,
12932 	DRV_TLV_LAST_FLOGI_RJT_TIMESTAMP,
12933 	DRV_TLV_FDISCS_SENT_COUNT,
12934 	DRV_TLV_FDISC_ACCS_RECEIVED,
12935 	DRV_TLV_FDISC_RJTS_RECEIVED,
12936 	DRV_TLV_PLOGI_SENT_COUNT,
12937 	DRV_TLV_PLOGI_ACCS_RECEIVED,
12938 	DRV_TLV_PLOGI_RJTS_RECEIVED,
12939 	DRV_TLV_PLOGI_1_SENT_DESTINATION_FC_ID,
12940 	DRV_TLV_PLOGI_1_TIMESTAMP,
12941 	DRV_TLV_PLOGI_2_SENT_DESTINATION_FC_ID,
12942 	DRV_TLV_PLOGI_2_TIMESTAMP,
12943 	DRV_TLV_PLOGI_3_SENT_DESTINATION_FC_ID,
12944 	DRV_TLV_PLOGI_3_TIMESTAMP,
12945 	DRV_TLV_PLOGI_4_SENT_DESTINATION_FC_ID,
12946 	DRV_TLV_PLOGI_4_TIMESTAMP,
12947 	DRV_TLV_PLOGI_5_SENT_DESTINATION_FC_ID,
12948 	DRV_TLV_PLOGI_5_TIMESTAMP,
12949 	DRV_TLV_PLOGI_1_ACC_RECEIVED_SOURCE_FC_ID,
12950 	DRV_TLV_PLOGI_1_ACC_TIMESTAMP,
12951 	DRV_TLV_PLOGI_2_ACC_RECEIVED_SOURCE_FC_ID,
12952 	DRV_TLV_PLOGI_2_ACC_TIMESTAMP,
12953 	DRV_TLV_PLOGI_3_ACC_RECEIVED_SOURCE_FC_ID,
12954 	DRV_TLV_PLOGI_3_ACC_TIMESTAMP,
12955 	DRV_TLV_PLOGI_4_ACC_RECEIVED_SOURCE_FC_ID,
12956 	DRV_TLV_PLOGI_4_ACC_TIMESTAMP,
12957 	DRV_TLV_PLOGI_5_ACC_RECEIVED_SOURCE_FC_ID,
12958 	DRV_TLV_PLOGI_5_ACC_TIMESTAMP,
12959 	DRV_TLV_LOGOS_ISSUED,
12960 	DRV_TLV_LOGO_ACCS_RECEIVED,
12961 	DRV_TLV_LOGO_RJTS_RECEIVED,
12962 	DRV_TLV_LOGO_1_RECEIVED_SOURCE_FC_ID,
12963 	DRV_TLV_LOGO_1_TIMESTAMP,
12964 	DRV_TLV_LOGO_2_RECEIVED_SOURCE_FC_ID,
12965 	DRV_TLV_LOGO_2_TIMESTAMP,
12966 	DRV_TLV_LOGO_3_RECEIVED_SOURCE_FC_ID,
12967 	DRV_TLV_LOGO_3_TIMESTAMP,
12968 	DRV_TLV_LOGO_4_RECEIVED_SOURCE_FC_ID,
12969 	DRV_TLV_LOGO_4_TIMESTAMP,
12970 	DRV_TLV_LOGO_5_RECEIVED_SOURCE_FC_ID,
12971 	DRV_TLV_LOGO_5_TIMESTAMP,
12972 	DRV_TLV_LOGOS_RECEIVED,
12973 	DRV_TLV_ACCS_ISSUED,
12974 	DRV_TLV_PRLIS_ISSUED,
12975 	DRV_TLV_ACCS_RECEIVED,
12976 	DRV_TLV_ABTS_SENT_COUNT,
12977 	DRV_TLV_ABTS_ACCS_RECEIVED,
12978 	DRV_TLV_ABTS_RJTS_RECEIVED,
12979 	DRV_TLV_ABTS_1_SENT_DESTINATION_FC_ID,
12980 	DRV_TLV_ABTS_1_TIMESTAMP,
12981 	DRV_TLV_ABTS_2_SENT_DESTINATION_FC_ID,
12982 	DRV_TLV_ABTS_2_TIMESTAMP,
12983 	DRV_TLV_ABTS_3_SENT_DESTINATION_FC_ID,
12984 	DRV_TLV_ABTS_3_TIMESTAMP,
12985 	DRV_TLV_ABTS_4_SENT_DESTINATION_FC_ID,
12986 	DRV_TLV_ABTS_4_TIMESTAMP,
12987 	DRV_TLV_ABTS_5_SENT_DESTINATION_FC_ID,
12988 	DRV_TLV_ABTS_5_TIMESTAMP,
12989 	DRV_TLV_RSCNS_RECEIVED,
12990 	DRV_TLV_LAST_RSCN_RECEIVED_N_PORT_1,
12991 	DRV_TLV_LAST_RSCN_RECEIVED_N_PORT_2,
12992 	DRV_TLV_LAST_RSCN_RECEIVED_N_PORT_3,
12993 	DRV_TLV_LAST_RSCN_RECEIVED_N_PORT_4,
12994 	DRV_TLV_LUN_RESETS_ISSUED,
12995 	DRV_TLV_ABORT_TASK_SETS_ISSUED,
12996 	DRV_TLV_TPRLOS_SENT,
12997 	DRV_TLV_NOS_SENT_COUNT,
12998 	DRV_TLV_NOS_RECEIVED_COUNT,
12999 	DRV_TLV_OLS_COUNT,
13000 	DRV_TLV_LR_COUNT,
13001 	DRV_TLV_LRR_COUNT,
13002 	DRV_TLV_LIP_SENT_COUNT,
13003 	DRV_TLV_LIP_RECEIVED_COUNT,
13004 	DRV_TLV_EOFA_COUNT,
13005 	DRV_TLV_EOFNI_COUNT,
13006 	DRV_TLV_SCSI_STATUS_CHECK_CONDITION_COUNT,
13007 	DRV_TLV_SCSI_STATUS_CONDITION_MET_COUNT,
13008 	DRV_TLV_SCSI_STATUS_BUSY_COUNT,
13009 	DRV_TLV_SCSI_STATUS_INTERMEDIATE_COUNT,
13010 	DRV_TLV_SCSI_STATUS_INTERMEDIATE_CONDITION_MET_COUNT,
13011 	DRV_TLV_SCSI_STATUS_RESERVATION_CONFLICT_COUNT,
13012 	DRV_TLV_SCSI_STATUS_TASK_SET_FULL_COUNT,
13013 	DRV_TLV_SCSI_STATUS_ACA_ACTIVE_COUNT,
13014 	DRV_TLV_SCSI_STATUS_TASK_ABORTED_COUNT,
13015 	DRV_TLV_SCSI_CHECK_CONDITION_1_RECEIVED_SK_ASC_ASCQ,
13016 	DRV_TLV_SCSI_CHECK_1_TIMESTAMP,
13017 	DRV_TLV_SCSI_CHECK_CONDITION_2_RECEIVED_SK_ASC_ASCQ,
13018 	DRV_TLV_SCSI_CHECK_2_TIMESTAMP,
13019 	DRV_TLV_SCSI_CHECK_CONDITION_3_RECEIVED_SK_ASC_ASCQ,
13020 	DRV_TLV_SCSI_CHECK_3_TIMESTAMP,
13021 	DRV_TLV_SCSI_CHECK_CONDITION_4_RECEIVED_SK_ASC_ASCQ,
13022 	DRV_TLV_SCSI_CHECK_4_TIMESTAMP,
13023 	DRV_TLV_SCSI_CHECK_CONDITION_5_RECEIVED_SK_ASC_ASCQ,
13024 	DRV_TLV_SCSI_CHECK_5_TIMESTAMP,
13025 	/* Category 30: iSCSI Function Data */
13026 	DRV_TLV_PDU_TX_DESCRIPTOR_QUEUE_AVG_DEPTH,
13027 	DRV_TLV_PDU_RX_DESCRIPTORS_QUEUE_AVG_DEPTH,
13028 	DRV_TLV_ISCSI_PDU_RX_FRAMES_RECEIVED,
13029 	DRV_TLV_ISCSI_PDU_RX_BYTES_RECEIVED,
13030 	DRV_TLV_ISCSI_PDU_TX_FRAMES_SENT,
13031 	DRV_TLV_ISCSI_PDU_TX_BYTES_SENT
13032 };
13033 
13034 struct nvm_cfg_mac_address {
13035 	u32							mac_addr_hi;
13036 #define NVM_CFG_MAC_ADDRESS_HI_MASK				0x0000ffff
13037 #define NVM_CFG_MAC_ADDRESS_HI_OFFSET				0
13038 
13039 	u32							mac_addr_lo;
13040 };
13041 
13042 struct nvm_cfg1_glob {
13043 	u32							generic_cont0;
13044 #define NVM_CFG1_GLOB_MF_MODE_MASK				0x00000ff0
13045 #define NVM_CFG1_GLOB_MF_MODE_OFFSET				4
13046 #define NVM_CFG1_GLOB_MF_MODE_MF_ALLOWED			0x0
13047 #define NVM_CFG1_GLOB_MF_MODE_DEFAULT				0x1
13048 #define NVM_CFG1_GLOB_MF_MODE_SPIO4				0x2
13049 #define NVM_CFG1_GLOB_MF_MODE_NPAR1_0				0x3
13050 #define NVM_CFG1_GLOB_MF_MODE_NPAR1_5				0x4
13051 #define NVM_CFG1_GLOB_MF_MODE_NPAR2_0				0x5
13052 #define NVM_CFG1_GLOB_MF_MODE_BD				0x6
13053 #define NVM_CFG1_GLOB_MF_MODE_UFP				0x7
13054 
13055 	u32							engineering_change[3];
13056 	u32							manufacturing_id;
13057 	u32							serial_number[4];
13058 	u32							pcie_cfg;
13059 	u32							mgmt_traffic;
13060 
13061 	u32							core_cfg;
13062 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_MASK			0x000000ff
13063 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_OFFSET			0
13064 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_BB_2X40G		0x0
13065 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X50G			0x1
13066 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_BB_1X100G		0x2
13067 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_4X10G_F			0x3
13068 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_BB_4X10G_E		0x4
13069 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_BB_4X20G		0x5
13070 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X40G			0xb
13071 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X25G			0xc
13072 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_1X25G			0xd
13073 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_4X25G			0xe
13074 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_2X10G			0xf
13075 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_AHP_2X50G_R1		0x11
13076 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_AHP_4X50G_R1		0x12
13077 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_AHP_1X100G_R2		0x13
13078 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_AHP_2X100G_R2		0x14
13079 #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_AHP_1X100G_R4		0x15
13080 
13081 	u32							e_lane_cfg1;
13082 	u32							e_lane_cfg2;
13083 	u32							f_lane_cfg1;
13084 	u32							f_lane_cfg2;
13085 	u32							mps10_preemphasis;
13086 	u32							mps10_driver_current;
13087 	u32							mps25_preemphasis;
13088 	u32							mps25_driver_current;
13089 	u32							pci_id;
13090 	u32							pci_subsys_id;
13091 	u32							bar;
13092 	u32							mps10_txfir_main;
13093 	u32							mps10_txfir_post;
13094 	u32							mps25_txfir_main;
13095 	u32							mps25_txfir_post;
13096 	u32							manufacture_ver;
13097 	u32							manufacture_time;
13098 	u32							led_global_settings;
13099 	u32							generic_cont1;
13100 
13101 	u32							mbi_version;
13102 #define NVM_CFG1_GLOB_MBI_VERSION_0_MASK			0x000000ff
13103 #define NVM_CFG1_GLOB_MBI_VERSION_0_OFFSET			0
13104 #define NVM_CFG1_GLOB_MBI_VERSION_1_MASK			0x0000ff00
13105 #define NVM_CFG1_GLOB_MBI_VERSION_1_OFFSET			8
13106 #define NVM_CFG1_GLOB_MBI_VERSION_2_MASK			0x00ff0000
13107 #define NVM_CFG1_GLOB_MBI_VERSION_2_OFFSET			16
13108 
13109 	u32							mbi_date;
13110 	u32							misc_sig;
13111 
13112 	u32							device_capabilities;
13113 #define NVM_CFG1_GLOB_DEVICE_CAPABILITIES_ETHERNET		0x1
13114 #define NVM_CFG1_GLOB_DEVICE_CAPABILITIES_FCOE			0x2
13115 #define NVM_CFG1_GLOB_DEVICE_CAPABILITIES_ISCSI			0x4
13116 #define NVM_CFG1_GLOB_DEVICE_CAPABILITIES_ROCE			0x8
13117 
13118 	u32							power_dissipated;
13119 	u32							power_consumed;
13120 	u32							efi_version;
13121 	u32							multi_net_modes_cap;
13122 	u32							reserved[41];
13123 };
13124 
13125 struct nvm_cfg1_path {
13126 	u32							reserved[30];
13127 };
13128 
13129 struct nvm_cfg1_port {
13130 	u32							rel_to_opt123;
13131 	u32							rel_to_opt124;
13132 
13133 	u32							generic_cont0;
13134 #define NVM_CFG1_PORT_DCBX_MODE_MASK				0x000f0000
13135 #define NVM_CFG1_PORT_DCBX_MODE_OFFSET				16
13136 #define NVM_CFG1_PORT_DCBX_MODE_DISABLED			0x0
13137 #define NVM_CFG1_PORT_DCBX_MODE_IEEE				0x1
13138 #define NVM_CFG1_PORT_DCBX_MODE_CEE				0x2
13139 #define NVM_CFG1_PORT_DCBX_MODE_DYNAMIC				0x3
13140 #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_MASK		0x00f00000
13141 #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_OFFSET		20
13142 #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_ETHERNET	0x1
13143 #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_FCOE		0x2
13144 #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_ISCSI		0x4
13145 
13146 	u32							pcie_cfg;
13147 	u32							features;
13148 
13149 	u32							speed_cap_mask;
13150 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK		0x0000ffff
13151 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_OFFSET		0
13152 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G		0x1
13153 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G		0x2
13154 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_20G		0x4
13155 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G		0x8
13156 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G		0x10
13157 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G		0x20
13158 #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_BB_100G		0x40
13159 
13160 	u32							link_settings;
13161 #define NVM_CFG1_PORT_DRV_LINK_SPEED_MASK			0x0000000f
13162 #define NVM_CFG1_PORT_DRV_LINK_SPEED_OFFSET			0
13163 #define NVM_CFG1_PORT_DRV_LINK_SPEED_AUTONEG			0x0
13164 #define NVM_CFG1_PORT_DRV_LINK_SPEED_1G				0x1
13165 #define NVM_CFG1_PORT_DRV_LINK_SPEED_10G			0x2
13166 #define NVM_CFG1_PORT_DRV_LINK_SPEED_20G			0x3
13167 #define NVM_CFG1_PORT_DRV_LINK_SPEED_25G			0x4
13168 #define NVM_CFG1_PORT_DRV_LINK_SPEED_40G			0x5
13169 #define NVM_CFG1_PORT_DRV_LINK_SPEED_50G			0x6
13170 #define NVM_CFG1_PORT_DRV_LINK_SPEED_BB_100G			0x7
13171 #define NVM_CFG1_PORT_DRV_LINK_SPEED_SMARTLINQ			0x8
13172 #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK			0x00000070
13173 #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET			4
13174 #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_AUTONEG			0x1
13175 #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_RX			0x2
13176 #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_TX			0x4
13177 #define NVM_CFG1_PORT_FEC_FORCE_MODE_MASK			0x000e0000
13178 #define NVM_CFG1_PORT_FEC_FORCE_MODE_OFFSET			17
13179 #define NVM_CFG1_PORT_FEC_FORCE_MODE_NONE			0x0
13180 #define NVM_CFG1_PORT_FEC_FORCE_MODE_FIRECODE			0x1
13181 #define NVM_CFG1_PORT_FEC_FORCE_MODE_RS				0x2
13182 #define NVM_CFG1_PORT_FEC_FORCE_MODE_AUTO			0x7
13183 
13184 	u32							phy_cfg;
13185 	u32							mgmt_traffic;
13186 
13187 	u32							ext_phy;
13188 	/* EEE power saving mode */
13189 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_MASK		0x00ff0000
13190 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_OFFSET		16
13191 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_DISABLED		0x0
13192 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_BALANCED		0x1
13193 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_AGGRESSIVE		0x2
13194 #define NVM_CFG1_PORT_EEE_POWER_SAVING_MODE_LOW_LATENCY		0x3
13195 
13196 	u32							mba_cfg1;
13197 	u32							mba_cfg2;
13198 	u32							vf_cfg;
13199 	struct nvm_cfg_mac_address				lldp_mac_address;
13200 	u32							led_port_settings;
13201 	u32							transceiver_00;
13202 	u32							device_ids;
13203 
13204 	u32							board_cfg;
13205 #define NVM_CFG1_PORT_PORT_TYPE_MASK				0x000000ff
13206 #define NVM_CFG1_PORT_PORT_TYPE_OFFSET				0
13207 #define NVM_CFG1_PORT_PORT_TYPE_UNDEFINED			0x0
13208 #define NVM_CFG1_PORT_PORT_TYPE_MODULE				0x1
13209 #define NVM_CFG1_PORT_PORT_TYPE_BACKPLANE			0x2
13210 #define NVM_CFG1_PORT_PORT_TYPE_EXT_PHY				0x3
13211 #define NVM_CFG1_PORT_PORT_TYPE_MODULE_SLAVE			0x4
13212 
13213 	u32							mnm_10g_cap;
13214 	u32							mnm_10g_ctrl;
13215 	u32							mnm_10g_misc;
13216 	u32							mnm_25g_cap;
13217 	u32							mnm_25g_ctrl;
13218 	u32							mnm_25g_misc;
13219 	u32							mnm_40g_cap;
13220 	u32							mnm_40g_ctrl;
13221 	u32							mnm_40g_misc;
13222 	u32							mnm_50g_cap;
13223 	u32							mnm_50g_ctrl;
13224 	u32							mnm_50g_misc;
13225 	u32							mnm_100g_cap;
13226 	u32							mnm_100g_ctrl;
13227 	u32							mnm_100g_misc;
13228 
13229 	u32							temperature;
13230 	u32							ext_phy_cfg1;
13231 
13232 	u32							extended_speed;
13233 #define NVM_CFG1_PORT_EXTENDED_SPEED_MASK			0x0000ffff
13234 #define NVM_CFG1_PORT_EXTENDED_SPEED_OFFSET			0
13235 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_AN		0x1
13236 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_1G		0x2
13237 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_10G		0x4
13238 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_20G		0x8
13239 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_25G		0x10
13240 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_40G		0x20
13241 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_50G_R		0x40
13242 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_50G_R2		0x80
13243 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_R2		0x100
13244 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_R4		0x200
13245 #define NVM_CFG1_PORT_EXTENDED_SPEED_EXTND_SPD_100G_P4		0x400
13246 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_MASK			0xffff0000
13247 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_OFFSET			16
13248 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_RESERVED	0x1
13249 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_1G		0x2
13250 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_10G		0x4
13251 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_20G		0x8
13252 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_25G		0x10
13253 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_40G		0x20
13254 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_50G_R	0x40
13255 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_50G_R2	0x80
13256 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_R2	0x100
13257 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_R4	0x200
13258 #define NVM_CFG1_PORT_EXTENDED_SPEED_CAP_EXTND_SPD_100G_P4	0x400
13259 
13260 	u32							extended_fec_mode;
13261 
13262 	u32							reserved[112];
13263 };
13264 
13265 struct nvm_cfg1_func {
13266 	struct nvm_cfg_mac_address mac_address;
13267 	u32 rsrv1;
13268 	u32 rsrv2;
13269 	u32 device_id;
13270 	u32 cmn_cfg;
13271 	u32 pci_cfg;
13272 	struct nvm_cfg_mac_address fcoe_node_wwn_mac_addr;
13273 	struct nvm_cfg_mac_address fcoe_port_wwn_mac_addr;
13274 	u32 preboot_generic_cfg;
13275 	u32 reserved[8];
13276 };
13277 
13278 struct nvm_cfg1 {
13279 	struct nvm_cfg1_glob glob;
13280 	struct nvm_cfg1_path path[MCP_GLOB_PATH_MAX];
13281 	struct nvm_cfg1_port port[MCP_GLOB_PORT_MAX];
13282 	struct nvm_cfg1_func func[MCP_GLOB_FUNC_MAX];
13283 };
13284 
13285 enum spad_sections {
13286 	SPAD_SECTION_TRACE,
13287 	SPAD_SECTION_NVM_CFG,
13288 	SPAD_SECTION_PUBLIC,
13289 	SPAD_SECTION_PRIVATE,
13290 	SPAD_SECTION_MAX
13291 };
13292 
13293 #define MCP_TRACE_SIZE          2048	/* 2kb */
13294 
13295 /* This section is located at a fixed location in the beginning of the
13296  * scratchpad, to ensure that the MCP trace is not run over during MFW upgrade.
13297  * All the rest of data has a floating location which differs from version to
13298  * version, and is pointed by the mcp_meta_data below.
13299  * Moreover, the spad_layout section is part of the MFW firmware, and is loaded
13300  * with it from nvram in order to clear this portion.
13301  */
13302 struct static_init {
13303 	u32 num_sections;
13304 	offsize_t sections[SPAD_SECTION_MAX];
13305 #define SECTION(_sec_) (*((offsize_t *)(STRUCT_OFFSET(sections[_sec_]))))
13306 
13307 	struct mcp_trace trace;
13308 #define MCP_TRACE_P ((struct mcp_trace *)(STRUCT_OFFSET(trace)))
13309 	u8 trace_buffer[MCP_TRACE_SIZE];
13310 #define MCP_TRACE_BUF ((u8 *)(STRUCT_OFFSET(trace_buffer)))
13311 	/* running_mfw has the same definition as in nvm_map.h.
13312 	 * This bit indicate both the running dir, and the running bundle.
13313 	 * It is set once when the LIM is loaded.
13314 	 */
13315 	u32 running_mfw;
13316 #define RUNNING_MFW (*((u32 *)(STRUCT_OFFSET(running_mfw))))
13317 	u32 build_time;
13318 #define MFW_BUILD_TIME (*((u32 *)(STRUCT_OFFSET(build_time))))
13319 	u32 reset_type;
13320 #define RESET_TYPE (*((u32 *)(STRUCT_OFFSET(reset_type))))
13321 	u32 mfw_secure_mode;
13322 #define MFW_SECURE_MODE (*((u32 *)(STRUCT_OFFSET(mfw_secure_mode))))
13323 	u16 pme_status_pf_bitmap;
13324 #define PME_STATUS_PF_BITMAP (*((u16 *)(STRUCT_OFFSET(pme_status_pf_bitmap))))
13325 	u16 pme_enable_pf_bitmap;
13326 #define PME_ENABLE_PF_BITMAP (*((u16 *)(STRUCT_OFFSET(pme_enable_pf_bitmap))))
13327 	u32 mim_nvm_addr;
13328 	u32 mim_start_addr;
13329 	u32 ah_pcie_link_params;
13330 #define AH_PCIE_LINK_PARAMS_LINK_SPEED_MASK     (0x000000ff)
13331 #define AH_PCIE_LINK_PARAMS_LINK_SPEED_SHIFT    (0)
13332 #define AH_PCIE_LINK_PARAMS_LINK_WIDTH_MASK     (0x0000ff00)
13333 #define AH_PCIE_LINK_PARAMS_LINK_WIDTH_SHIFT    (8)
13334 #define AH_PCIE_LINK_PARAMS_ASPM_MODE_MASK      (0x00ff0000)
13335 #define AH_PCIE_LINK_PARAMS_ASPM_MODE_SHIFT     (16)
13336 #define AH_PCIE_LINK_PARAMS_ASPM_CAP_MASK       (0xff000000)
13337 #define AH_PCIE_LINK_PARAMS_ASPM_CAP_SHIFT      (24)
13338 #define AH_PCIE_LINK_PARAMS (*((u32 *)(STRUCT_OFFSET(ah_pcie_link_params))))
13339 
13340 	u32 rsrv_persist[5];	/* Persist reserved for MFW upgrades */
13341 };
13342 
13343 #define NVM_MAGIC_VALUE		0x669955aa
13344 
13345 enum nvm_image_type {
13346 	NVM_TYPE_TIM1 = 0x01,
13347 	NVM_TYPE_TIM2 = 0x02,
13348 	NVM_TYPE_MIM1 = 0x03,
13349 	NVM_TYPE_MIM2 = 0x04,
13350 	NVM_TYPE_MBA = 0x05,
13351 	NVM_TYPE_MODULES_PN = 0x06,
13352 	NVM_TYPE_VPD = 0x07,
13353 	NVM_TYPE_MFW_TRACE1 = 0x08,
13354 	NVM_TYPE_MFW_TRACE2 = 0x09,
13355 	NVM_TYPE_NVM_CFG1 = 0x0a,
13356 	NVM_TYPE_L2B = 0x0b,
13357 	NVM_TYPE_DIR1 = 0x0c,
13358 	NVM_TYPE_EAGLE_FW1 = 0x0d,
13359 	NVM_TYPE_FALCON_FW1 = 0x0e,
13360 	NVM_TYPE_PCIE_FW1 = 0x0f,
13361 	NVM_TYPE_HW_SET = 0x10,
13362 	NVM_TYPE_LIM = 0x11,
13363 	NVM_TYPE_AVS_FW1 = 0x12,
13364 	NVM_TYPE_DIR2 = 0x13,
13365 	NVM_TYPE_CCM = 0x14,
13366 	NVM_TYPE_EAGLE_FW2 = 0x15,
13367 	NVM_TYPE_FALCON_FW2 = 0x16,
13368 	NVM_TYPE_PCIE_FW2 = 0x17,
13369 	NVM_TYPE_AVS_FW2 = 0x18,
13370 	NVM_TYPE_INIT_HW = 0x19,
13371 	NVM_TYPE_DEFAULT_CFG = 0x1a,
13372 	NVM_TYPE_MDUMP = 0x1b,
13373 	NVM_TYPE_META = 0x1c,
13374 	NVM_TYPE_ISCSI_CFG = 0x1d,
13375 	NVM_TYPE_FCOE_CFG = 0x1f,
13376 	NVM_TYPE_ETH_PHY_FW1 = 0x20,
13377 	NVM_TYPE_ETH_PHY_FW2 = 0x21,
13378 	NVM_TYPE_BDN = 0x22,
13379 	NVM_TYPE_8485X_PHY_FW = 0x23,
13380 	NVM_TYPE_PUB_KEY = 0x24,
13381 	NVM_TYPE_RECOVERY = 0x25,
13382 	NVM_TYPE_PLDM = 0x26,
13383 	NVM_TYPE_UPK1 = 0x27,
13384 	NVM_TYPE_UPK2 = 0x28,
13385 	NVM_TYPE_MASTER_KC = 0x29,
13386 	NVM_TYPE_BACKUP_KC = 0x2a,
13387 	NVM_TYPE_HW_DUMP = 0x2b,
13388 	NVM_TYPE_HW_DUMP_OUT = 0x2c,
13389 	NVM_TYPE_BIN_NVM_META = 0x30,
13390 	NVM_TYPE_ROM_TEST = 0xf0,
13391 	NVM_TYPE_88X33X0_PHY_FW = 0x31,
13392 	NVM_TYPE_88X33X0_PHY_SLAVE_FW = 0x32,
13393 	NVM_TYPE_MAX,
13394 };
13395 
13396 #define DIR_ID_1    (0)
13397 
13398 #endif
13399