]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/qlnx/qlnxe/ecore_hsi_common.h
Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
[FreeBSD/FreeBSD.git] / sys / dev / qlnx / qlnxe / ecore_hsi_common.h
1 /*
2  * Copyright (c) 2017-2018 Cavium, Inc. 
3  * All rights reserved.
4  *
5  *  Redistribution and use in source and binary forms, with or without
6  *  modification, are permitted provided that the following conditions
7  *  are met:
8  *
9  *  1. Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  *  2. Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  *  POSSIBILITY OF SUCH DAMAGE.
26  *
27  * $FreeBSD$
28  *
29  */
30
31 #ifndef __ECORE_HSI_COMMON__
32 #define __ECORE_HSI_COMMON__ 
33 /********************************/
34 /* Add include to common target */
35 /********************************/
36 #include "common_hsi.h"
37
38
39 /*
40  * opcodes for the event ring
41  */
42 enum common_event_opcode
43 {
44         COMMON_EVENT_PF_START,
45         COMMON_EVENT_PF_STOP,
46         COMMON_EVENT_VF_START,
47         COMMON_EVENT_VF_STOP,
48         COMMON_EVENT_VF_PF_CHANNEL,
49         COMMON_EVENT_VF_FLR,
50         COMMON_EVENT_PF_UPDATE,
51         COMMON_EVENT_MALICIOUS_VF,
52         COMMON_EVENT_RL_UPDATE,
53         COMMON_EVENT_EMPTY,
54         MAX_COMMON_EVENT_OPCODE
55 };
56
57
58 /*
59  * Common Ramrod Command IDs
60  */
61 enum common_ramrod_cmd_id
62 {
63         COMMON_RAMROD_UNUSED,
64         COMMON_RAMROD_PF_START /* PF Function Start Ramrod */,
65         COMMON_RAMROD_PF_STOP /* PF Function Stop Ramrod */,
66         COMMON_RAMROD_VF_START /* VF Function Start */,
67         COMMON_RAMROD_VF_STOP /* VF Function Stop Ramrod */,
68         COMMON_RAMROD_PF_UPDATE /* PF update Ramrod */,
69         COMMON_RAMROD_RL_UPDATE /* QCN/DCQCN RL update Ramrod */,
70         COMMON_RAMROD_EMPTY /* Empty Ramrod */,
71         MAX_COMMON_RAMROD_CMD_ID
72 };
73
74
75 /*
76  * How ll2 should deal with packet upon errors
77  */
78 enum core_error_handle
79 {
80         LL2_DROP_PACKET /* If error occurs drop packet */,
81         LL2_DO_NOTHING /* If error occurs do nothing */,
82         LL2_ASSERT /* If error occurs assert */,
83         MAX_CORE_ERROR_HANDLE
84 };
85
86
87 /*
88  * opcodes for the event ring
89  */
90 enum core_event_opcode
91 {
92         CORE_EVENT_TX_QUEUE_START,
93         CORE_EVENT_TX_QUEUE_STOP,
94         CORE_EVENT_RX_QUEUE_START,
95         CORE_EVENT_RX_QUEUE_STOP,
96         CORE_EVENT_RX_QUEUE_FLUSH,
97         MAX_CORE_EVENT_OPCODE
98 };
99
100
101 /*
102  * The L4 pseudo checksum mode for Core
103  */
104 enum core_l4_pseudo_checksum_mode
105 {
106         CORE_L4_PSEUDO_CSUM_CORRECT_LENGTH /* Pseudo Checksum on packet is calculated with the correct packet length. */,
107         CORE_L4_PSEUDO_CSUM_ZERO_LENGTH /* Pseudo Checksum on packet is calculated with zero length. */,
108         MAX_CORE_L4_PSEUDO_CHECKSUM_MODE
109 };
110
111
112 /*
113  * Light-L2 RX Producers in Tstorm RAM
114  */
115 struct core_ll2_port_stats
116 {
117         struct regpair gsi_invalid_hdr;
118         struct regpair gsi_invalid_pkt_length;
119         struct regpair gsi_unsupported_pkt_typ;
120         struct regpair gsi_crcchksm_error;
121 };
122
123
124 /*
125  * Ethernet TX Per Queue Stats
126  */
127 struct core_ll2_pstorm_per_queue_stat
128 {
129         struct regpair sent_ucast_bytes /* number of total bytes sent without errors */;
130         struct regpair sent_mcast_bytes /* number of total bytes sent without errors */;
131         struct regpair sent_bcast_bytes /* number of total bytes sent without errors */;
132         struct regpair sent_ucast_pkts /* number of total packets sent without errors */;
133         struct regpair sent_mcast_pkts /* number of total packets sent without errors */;
134         struct regpair sent_bcast_pkts /* number of total packets sent without errors */;
135 };
136
137
138 /*
139  * Light-L2 RX Producers in Tstorm RAM
140  */
141 struct core_ll2_rx_prod
142 {
143         __le16 bd_prod /* BD Producer */;
144         __le16 cqe_prod /* CQE Producer */;
145         __le32 reserved;
146 };
147
148
149 struct core_ll2_tstorm_per_queue_stat
150 {
151         struct regpair packet_too_big_discard /* Number of packets discarded because they are bigger than MTU */;
152         struct regpair no_buff_discard /* Number of packets discarded due to lack of host buffers */;
153 };
154
155
156 struct core_ll2_ustorm_per_queue_stat
157 {
158         struct regpair rcv_ucast_bytes;
159         struct regpair rcv_mcast_bytes;
160         struct regpair rcv_bcast_bytes;
161         struct regpair rcv_ucast_pkts;
162         struct regpair rcv_mcast_pkts;
163         struct regpair rcv_bcast_pkts;
164 };
165
166
167 /*
168  * Core Ramrod Command IDs (light L2)
169  */
170 enum core_ramrod_cmd_id
171 {
172         CORE_RAMROD_UNUSED,
173         CORE_RAMROD_RX_QUEUE_START /* RX Queue Start Ramrod */,
174         CORE_RAMROD_TX_QUEUE_START /* TX Queue Start Ramrod */,
175         CORE_RAMROD_RX_QUEUE_STOP /* RX Queue Stop Ramrod */,
176         CORE_RAMROD_TX_QUEUE_STOP /* TX Queue Stop Ramrod */,
177         CORE_RAMROD_RX_QUEUE_FLUSH /* RX Flush queue Ramrod */,
178         MAX_CORE_RAMROD_CMD_ID
179 };
180
181
182 /*
183  * Core RX CQE Type for Light L2
184  */
185 enum core_roce_flavor_type
186 {
187         CORE_ROCE,
188         CORE_RROCE,
189         MAX_CORE_ROCE_FLAVOR_TYPE
190 };
191
192
193 /*
194  * Specifies how ll2 should deal with packets errors: packet_too_big and no_buff
195  */
196 struct core_rx_action_on_error
197 {
198         u8 error_type;
199 #define CORE_RX_ACTION_ON_ERROR_PACKET_TOO_BIG_MASK  0x3 /* ll2 how to handle error packet_too_big (use enum core_error_handle) */
200 #define CORE_RX_ACTION_ON_ERROR_PACKET_TOO_BIG_SHIFT 0
201 #define CORE_RX_ACTION_ON_ERROR_NO_BUFF_MASK         0x3 /* ll2 how to handle error with no_buff  (use enum core_error_handle) */
202 #define CORE_RX_ACTION_ON_ERROR_NO_BUFF_SHIFT        2
203 #define CORE_RX_ACTION_ON_ERROR_RESERVED_MASK        0xF
204 #define CORE_RX_ACTION_ON_ERROR_RESERVED_SHIFT       4
205 };
206
207
208 /*
209  * Core RX BD for Light L2
210  */
211 struct core_rx_bd
212 {
213         struct regpair addr;
214         __le16 reserved[4];
215 };
216
217
218 /*
219  * Core RX CM offload BD for Light L2
220  */
221 struct core_rx_bd_with_buff_len
222 {
223         struct regpair addr;
224         __le16 buff_length;
225         __le16 reserved[3];
226 };
227
228 /*
229  * Core RX CM offload BD for Light L2
230  */
231 union core_rx_bd_union
232 {
233         struct core_rx_bd rx_bd /* Core Rx Bd static buffer size */;
234         struct core_rx_bd_with_buff_len rx_bd_with_len /* Core Rx Bd with dynamic buffer length */;
235 };
236
237
238
239 /*
240  * Opaque Data for Light L2 RX CQE . 
241  */
242 struct core_rx_cqe_opaque_data
243 {
244         __le32 data[2] /* Opaque CQE Data */;
245 };
246
247
248 /*
249  * Core RX CQE Type for Light L2
250  */
251 enum core_rx_cqe_type
252 {
253         CORE_RX_CQE_ILLIGAL_TYPE /* Bad RX Cqe type */,
254         CORE_RX_CQE_TYPE_REGULAR /* Regular Core RX CQE */,
255         CORE_RX_CQE_TYPE_GSI_OFFLOAD /* Fp Gsi offload RX CQE */,
256         CORE_RX_CQE_TYPE_SLOW_PATH /* Slow path Core RX CQE */,
257         MAX_CORE_RX_CQE_TYPE
258 };
259
260
261 /*
262  * Core RX CQE for Light L2 . 
263  */
264 struct core_rx_fast_path_cqe
265 {
266         u8 type /* CQE type */;
267         u8 placement_offset /* Offset (in bytes) of the packet from start of the buffer */;
268         struct parsing_and_err_flags parse_flags /* Parsing and error flags from the parser */;
269         __le16 packet_length /* Total packet length (from the parser) */;
270         __le16 vlan /* 802.1q VLAN tag */;
271         struct core_rx_cqe_opaque_data opaque_data /* Opaque Data */;
272         struct parsing_err_flags err_flags /* bit- map: each bit represents a specific error. errors indications are provided by the cracker. see spec for detailed description */;
273         __le16 reserved0;
274         __le32 reserved1[3];
275 };
276
277 /*
278  * Core Rx CM offload CQE . 
279  */
280 struct core_rx_gsi_offload_cqe
281 {
282         u8 type /* CQE type */;
283         u8 data_length_error /* set if gsi data is bigger than buff */;
284         struct parsing_and_err_flags parse_flags /* Parsing and error flags from the parser */;
285         __le16 data_length /* Total packet length (from the parser) */;
286         __le16 vlan /* 802.1q VLAN tag */;
287         __le32 src_mac_addrhi /* hi 4 bytes source mac address */;
288         __le16 src_mac_addrlo /* lo 2 bytes of source mac address */;
289         __le16 qp_id /* These are the lower 16 bit of QP id in RoCE BTH header */;
290         __le32 gid_dst[4] /* Gid destination address */;
291 };
292
293 /*
294  * Core RX CQE for Light L2 . 
295  */
296 struct core_rx_slow_path_cqe
297 {
298         u8 type /* CQE type */;
299         u8 ramrod_cmd_id;
300         __le16 echo;
301         struct core_rx_cqe_opaque_data opaque_data /* Opaque Data */;
302         __le32 reserved1[5];
303 };
304
305 /*
306  * Core RX CM offload BD for Light L2
307  */
308 union core_rx_cqe_union
309 {
310         struct core_rx_fast_path_cqe rx_cqe_fp /* Fast path CQE */;
311         struct core_rx_gsi_offload_cqe rx_cqe_gsi /* GSI offload CQE */;
312         struct core_rx_slow_path_cqe rx_cqe_sp /* Slow path CQE */;
313 };
314
315
316
317
318
319 /*
320  * Ramrod data for rx queue start ramrod
321  */
322 struct core_rx_start_ramrod_data
323 {
324         struct regpair bd_base /* bd address of the first bd page */;
325         struct regpair cqe_pbl_addr /* Base address on host of CQE PBL */;
326         __le16 mtu /* Maximum transmission unit */;
327         __le16 sb_id /* Status block ID */;
328         u8 sb_index /* index of the protocol index */;
329         u8 complete_cqe_flg /* post completion to the CQE ring if set */;
330         u8 complete_event_flg /* post completion to the event ring if set */;
331         u8 drop_ttl0_flg /* drop packet with ttl0 if set */;
332         __le16 num_of_pbl_pages /* Num of pages in CQE PBL */;
333         u8 inner_vlan_removal_en /* if set, 802.1q tags will be removed and copied to CQE */;
334         u8 queue_id /* Light L2 RX Queue ID */;
335         u8 main_func_queue /* Is this the main queue for the PF */;
336         u8 mf_si_bcast_accept_all /* Duplicate broadcast packets to LL2 main queue in mf_si mode. Valid if main_func_queue is set. */;
337         u8 mf_si_mcast_accept_all /* Duplicate multicast packets to LL2 main queue in mf_si mode. Valid if main_func_queue is set. */;
338         struct core_rx_action_on_error action_on_error /* Specifies how ll2 should deal with packets errors: packet_too_big and no_buff */;
339         u8 gsi_offload_flag /* set when in GSI offload mode on ROCE connection */;
340         u8 reserved[7];
341 };
342
343
344 /*
345  * Ramrod data for rx queue stop ramrod
346  */
347 struct core_rx_stop_ramrod_data
348 {
349         u8 complete_cqe_flg /* post completion to the CQE ring if set */;
350         u8 complete_event_flg /* post completion to the event ring if set */;
351         u8 queue_id /* Light L2 RX Queue ID */;
352         u8 reserved1;
353         __le16 reserved2[2];
354 };
355
356
357 /*
358  * Flags for Core TX BD
359  */
360 struct core_tx_bd_data
361 {
362         __le16 as_bitfield;
363 #define CORE_TX_BD_DATA_FORCE_VLAN_MODE_MASK      0x1 /* Do not allow additional VLAN manipulations on this packet (DCB) */
364 #define CORE_TX_BD_DATA_FORCE_VLAN_MODE_SHIFT     0
365 #define CORE_TX_BD_DATA_VLAN_INSERTION_MASK       0x1 /* Insert VLAN into packet */
366 #define CORE_TX_BD_DATA_VLAN_INSERTION_SHIFT      1
367 #define CORE_TX_BD_DATA_START_BD_MASK             0x1 /* This is the first BD of the packet (for debug) */
368 #define CORE_TX_BD_DATA_START_BD_SHIFT            2
369 #define CORE_TX_BD_DATA_IP_CSUM_MASK              0x1 /* Calculate the IP checksum for the packet */
370 #define CORE_TX_BD_DATA_IP_CSUM_SHIFT             3
371 #define CORE_TX_BD_DATA_L4_CSUM_MASK              0x1 /* Calculate the L4 checksum for the packet */
372 #define CORE_TX_BD_DATA_L4_CSUM_SHIFT             4
373 #define CORE_TX_BD_DATA_IPV6_EXT_MASK             0x1 /* Packet is IPv6 with extensions */
374 #define CORE_TX_BD_DATA_IPV6_EXT_SHIFT            5
375 #define CORE_TX_BD_DATA_L4_PROTOCOL_MASK          0x1 /* If IPv6+ext, and if l4_csum is 1, than this field indicates L4 protocol: 0-TCP, 1-UDP */
376 #define CORE_TX_BD_DATA_L4_PROTOCOL_SHIFT         6
377 #define CORE_TX_BD_DATA_L4_PSEUDO_CSUM_MODE_MASK  0x1 /* The pseudo checksum mode to place in the L4 checksum field. Required only when IPv6+ext and l4_csum is set. (use enum core_l4_pseudo_checksum_mode) */
378 #define CORE_TX_BD_DATA_L4_PSEUDO_CSUM_MODE_SHIFT 7
379 #define CORE_TX_BD_DATA_NBDS_MASK                 0xF /* Number of BDs that make up one packet - width wide enough to present CORE_LL2_TX_MAX_BDS_PER_PACKET */
380 #define CORE_TX_BD_DATA_NBDS_SHIFT                8
381 #define CORE_TX_BD_DATA_ROCE_FLAV_MASK            0x1 /* Use roce_flavor enum - Differentiate between Roce flavors is valid when connType is ROCE (use enum core_roce_flavor_type) */
382 #define CORE_TX_BD_DATA_ROCE_FLAV_SHIFT           12
383 #define CORE_TX_BD_DATA_IP_LEN_MASK               0x1 /* Calculate ip length */
384 #define CORE_TX_BD_DATA_IP_LEN_SHIFT              13
385 #define CORE_TX_BD_DATA_RESERVED0_MASK            0x3
386 #define CORE_TX_BD_DATA_RESERVED0_SHIFT           14
387 };
388
389 /*
390  * Core TX BD for Light L2
391  */
392 struct core_tx_bd
393 {
394         struct regpair addr /* Buffer Address */;
395         __le16 nbytes /* Number of Bytes in Buffer */;
396         __le16 nw_vlan_or_lb_echo /* Network packets: VLAN to insert to packet (if insertion flag set) LoopBack packets: echo data to pass to Rx */;
397         struct core_tx_bd_data bd_data /* BD flags */;
398         __le16 bitfield1;
399 #define CORE_TX_BD_L4_HDR_OFFSET_W_MASK  0x3FFF /* L4 Header Offset from start of packet (in Words). This is needed if both l4_csum and ipv6_ext are set */
400 #define CORE_TX_BD_L4_HDR_OFFSET_W_SHIFT 0
401 #define CORE_TX_BD_TX_DST_MASK           0x3 /* Packet destination - Network, Loopback or Drop (use enum core_tx_dest) */
402 #define CORE_TX_BD_TX_DST_SHIFT          14
403 };
404
405
406
407 /*
408  * Light L2 TX Destination
409  */
410 enum core_tx_dest
411 {
412         CORE_TX_DEST_NW /* TX Destination to the Network */,
413         CORE_TX_DEST_LB /* TX Destination to the Loopback */,
414         CORE_TX_DEST_RESERVED,
415         CORE_TX_DEST_DROP /* TX Drop */,
416         MAX_CORE_TX_DEST
417 };
418
419
420 /*
421  * Ramrod data for tx queue start ramrod
422  */
423 struct core_tx_start_ramrod_data
424 {
425         struct regpair pbl_base_addr /* Address of the pbl page */;
426         __le16 mtu /* Maximum transmission unit */;
427         __le16 sb_id /* Status block ID */;
428         u8 sb_index /* Status block protocol index */;
429         u8 stats_en /* Statistics Enable */;
430         u8 stats_id /* Statistics Counter ID */;
431         u8 conn_type /* connection type that loaded ll2 */;
432         __le16 pbl_size /* Number of BD pages pointed by PBL */;
433         __le16 qm_pq_id /* QM PQ ID */;
434         u8 gsi_offload_flag /* set when in GSI offload mode on ROCE connection */;
435         u8 resrved[3];
436 };
437
438
439 /*
440  * Ramrod data for tx queue stop ramrod
441  */
442 struct core_tx_stop_ramrod_data
443 {
444         __le32 reserved0[2];
445 };
446
447
448 /*
449  * Enum flag for what type of dcb data to update
450  */
451 enum dcb_dscp_update_mode
452 {
453         DONT_UPDATE_DCB_DSCP /* use when no change should be done to dcb data */,
454         UPDATE_DCB /* use to update only l2 (vlan) priority */,
455         UPDATE_DSCP /* use to update only l3 dscp */,
456         UPDATE_DCB_DSCP /* update vlan pri and dscp */,
457         MAX_DCB_DSCP_UPDATE_MODE
458 };
459
460
461 /*
462  * The core storm context for the Ystorm
463  */
464 struct ystorm_core_conn_st_ctx
465 {
466         __le32 reserved[4];
467 };
468
469 /*
470  * The core storm context for the Pstorm
471  */
472 struct pstorm_core_conn_st_ctx
473 {
474         __le32 reserved[4];
475 };
476
477 /*
478  * Core Slowpath Connection storm context of Xstorm
479  */
480 struct xstorm_core_conn_st_ctx
481 {
482         __le32 spq_base_lo /* SPQ Ring Base Address low dword */;
483         __le32 spq_base_hi /* SPQ Ring Base Address high dword */;
484         struct regpair consolid_base_addr /* Consolidation Ring Base Address */;
485         __le16 spq_cons /* SPQ Ring Consumer */;
486         __le16 consolid_cons /* Consolidation Ring Consumer */;
487         __le32 reserved0[55] /* Pad to 15 cycles */;
488 };
489
490 struct e4_xstorm_core_conn_ag_ctx
491 {
492         u8 reserved0 /* cdu_validation */;
493         u8 core_state /* state */;
494         u8 flags0;
495 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_MASK         0x1 /* exist_in_qm0 */
496 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT        0
497 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED1_MASK            0x1 /* exist_in_qm1 */
498 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED1_SHIFT           1
499 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED2_MASK            0x1 /* exist_in_qm2 */
500 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED2_SHIFT           2
501 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_MASK         0x1 /* exist_in_qm3 */
502 #define E4_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT        3
503 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED3_MASK            0x1 /* bit4 */
504 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED3_SHIFT           4
505 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED4_MASK            0x1 /* cf_array_active */
506 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED4_SHIFT           5
507 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED5_MASK            0x1 /* bit6 */
508 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED5_SHIFT           6
509 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED6_MASK            0x1 /* bit7 */
510 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED6_SHIFT           7
511         u8 flags1;
512 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED7_MASK            0x1 /* bit8 */
513 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED7_SHIFT           0
514 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED8_MASK            0x1 /* bit9 */
515 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED8_SHIFT           1
516 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED9_MASK            0x1 /* bit10 */
517 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED9_SHIFT           2
518 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT11_MASK                0x1 /* bit11 */
519 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT11_SHIFT               3
520 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT12_MASK                0x1 /* bit12 */
521 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT12_SHIFT               4
522 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT13_MASK                0x1 /* bit13 */
523 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT13_SHIFT               5
524 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_MASK       0x1 /* bit14 */
525 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT      6
526 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_MASK         0x1 /* bit15 */
527 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT        7
528         u8 flags2;
529 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0_MASK                  0x3 /* timer0cf */
530 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0_SHIFT                 0
531 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1_MASK                  0x3 /* timer1cf */
532 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1_SHIFT                 2
533 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2_MASK                  0x3 /* timer2cf */
534 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2_SHIFT                 4
535 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3_MASK                  0x3 /* timer_stop_all */
536 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3_SHIFT                 6
537         u8 flags3;
538 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4_MASK                  0x3 /* cf4 */
539 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4_SHIFT                 0
540 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5_MASK                  0x3 /* cf5 */
541 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5_SHIFT                 2
542 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6_MASK                  0x3 /* cf6 */
543 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6_SHIFT                 4
544 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7_MASK                  0x3 /* cf7 */
545 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7_SHIFT                 6
546         u8 flags4;
547 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8_MASK                  0x3 /* cf8 */
548 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8_SHIFT                 0
549 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9_MASK                  0x3 /* cf9 */
550 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9_SHIFT                 2
551 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10_MASK                 0x3 /* cf10 */
552 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10_SHIFT                4
553 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11_MASK                 0x3 /* cf11 */
554 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11_SHIFT                6
555         u8 flags5;
556 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12_MASK                 0x3 /* cf12 */
557 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12_SHIFT                0
558 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13_MASK                 0x3 /* cf13 */
559 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13_SHIFT                2
560 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14_MASK                 0x3 /* cf14 */
561 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14_SHIFT                4
562 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15_MASK                 0x3 /* cf15 */
563 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15_SHIFT                6
564         u8 flags6;
565 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_MASK     0x3 /* cf16 */
566 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_SHIFT    0
567 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17_MASK                 0x3 /* cf_array_cf */
568 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17_SHIFT                2
569 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_MASK                0x3 /* cf18 */
570 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_SHIFT               4
571 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_MASK         0x3 /* cf19 */
572 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_SHIFT        6
573         u8 flags7;
574 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_MASK             0x3 /* cf20 */
575 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_SHIFT            0
576 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED10_MASK           0x3 /* cf21 */
577 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED10_SHIFT          2
578 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_MASK            0x3 /* cf22 */
579 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_SHIFT           4
580 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0EN_MASK                0x1 /* cf0en */
581 #define E4_XSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT               6
582 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1EN_MASK                0x1 /* cf1en */
583 #define E4_XSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT               7
584         u8 flags8;
585 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2EN_MASK                0x1 /* cf2en */
586 #define E4_XSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT               0
587 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3EN_MASK                0x1 /* cf3en */
588 #define E4_XSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT               1
589 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4EN_MASK                0x1 /* cf4en */
590 #define E4_XSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT               2
591 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5EN_MASK                0x1 /* cf5en */
592 #define E4_XSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT               3
593 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6EN_MASK                0x1 /* cf6en */
594 #define E4_XSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT               4
595 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7EN_MASK                0x1 /* cf7en */
596 #define E4_XSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT               5
597 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8EN_MASK                0x1 /* cf8en */
598 #define E4_XSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT               6
599 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9EN_MASK                0x1 /* cf9en */
600 #define E4_XSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT               7
601         u8 flags9;
602 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10EN_MASK               0x1 /* cf10en */
603 #define E4_XSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT              0
604 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11EN_MASK               0x1 /* cf11en */
605 #define E4_XSTORM_CORE_CONN_AG_CTX_CF11EN_SHIFT              1
606 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12EN_MASK               0x1 /* cf12en */
607 #define E4_XSTORM_CORE_CONN_AG_CTX_CF12EN_SHIFT              2
608 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13EN_MASK               0x1 /* cf13en */
609 #define E4_XSTORM_CORE_CONN_AG_CTX_CF13EN_SHIFT              3
610 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14EN_MASK               0x1 /* cf14en */
611 #define E4_XSTORM_CORE_CONN_AG_CTX_CF14EN_SHIFT              4
612 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15EN_MASK               0x1 /* cf15en */
613 #define E4_XSTORM_CORE_CONN_AG_CTX_CF15EN_SHIFT              5
614 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_MASK  0x1 /* cf16en */
615 #define E4_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_SHIFT 6
616 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17EN_MASK               0x1 /* cf_array_cf_en */
617 #define E4_XSTORM_CORE_CONN_AG_CTX_CF17EN_SHIFT              7
618         u8 flags10;
619 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_MASK             0x1 /* cf18en */
620 #define E4_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_SHIFT            0
621 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_MASK      0x1 /* cf19en */
622 #define E4_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT     1
623 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_MASK          0x1 /* cf20en */
624 #define E4_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT         2
625 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED11_MASK           0x1 /* cf21en */
626 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED11_SHIFT          3
627 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_MASK         0x1 /* cf22en */
628 #define E4_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT        4
629 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23EN_MASK               0x1 /* cf23en */
630 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23EN_SHIFT              5
631 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED12_MASK           0x1 /* rule0en */
632 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED12_SHIFT          6
633 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED13_MASK           0x1 /* rule1en */
634 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED13_SHIFT          7
635         u8 flags11;
636 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED14_MASK           0x1 /* rule2en */
637 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED14_SHIFT          0
638 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED15_MASK           0x1 /* rule3en */
639 #define E4_XSTORM_CORE_CONN_AG_CTX_RESERVED15_SHIFT          1
640 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_MASK       0x1 /* rule4en */
641 #define E4_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT      2
642 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK              0x1 /* rule5en */
643 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT             3
644 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK              0x1 /* rule6en */
645 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT             4
646 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK              0x1 /* rule7en */
647 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT             5
648 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_MASK         0x1 /* rule8en */
649 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_SHIFT        6
650 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE9EN_MASK              0x1 /* rule9en */
651 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE9EN_SHIFT             7
652         u8 flags12;
653 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE10EN_MASK             0x1 /* rule10en */
654 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE10EN_SHIFT            0
655 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE11EN_MASK             0x1 /* rule11en */
656 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE11EN_SHIFT            1
657 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_MASK         0x1 /* rule12en */
658 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_SHIFT        2
659 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_MASK         0x1 /* rule13en */
660 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_SHIFT        3
661 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE14EN_MASK             0x1 /* rule14en */
662 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE14EN_SHIFT            4
663 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE15EN_MASK             0x1 /* rule15en */
664 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE15EN_SHIFT            5
665 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE16EN_MASK             0x1 /* rule16en */
666 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE16EN_SHIFT            6
667 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE17EN_MASK             0x1 /* rule17en */
668 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE17EN_SHIFT            7
669         u8 flags13;
670 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE18EN_MASK             0x1 /* rule18en */
671 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE18EN_SHIFT            0
672 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE19EN_MASK             0x1 /* rule19en */
673 #define E4_XSTORM_CORE_CONN_AG_CTX_RULE19EN_SHIFT            1
674 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_MASK         0x1 /* rule20en */
675 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_SHIFT        2
676 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_MASK         0x1 /* rule21en */
677 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_SHIFT        3
678 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_MASK         0x1 /* rule22en */
679 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_SHIFT        4
680 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_MASK         0x1 /* rule23en */
681 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_SHIFT        5
682 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_MASK         0x1 /* rule24en */
683 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_SHIFT        6
684 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_MASK         0x1 /* rule25en */
685 #define E4_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_SHIFT        7
686         u8 flags14;
687 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT16_MASK                0x1 /* bit16 */
688 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT16_SHIFT               0
689 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT17_MASK                0x1 /* bit17 */
690 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT17_SHIFT               1
691 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT18_MASK                0x1 /* bit18 */
692 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT18_SHIFT               2
693 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT19_MASK                0x1 /* bit19 */
694 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT19_SHIFT               3
695 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT20_MASK                0x1 /* bit20 */
696 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT20_SHIFT               4
697 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT21_MASK                0x1 /* bit21 */
698 #define E4_XSTORM_CORE_CONN_AG_CTX_BIT21_SHIFT               5
699 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23_MASK                 0x3 /* cf23 */
700 #define E4_XSTORM_CORE_CONN_AG_CTX_CF23_SHIFT                6
701         u8 byte2 /* byte2 */;
702         __le16 physical_q0 /* physical_q0 */;
703         __le16 consolid_prod /* physical_q1 */;
704         __le16 reserved16 /* physical_q2 */;
705         __le16 tx_bd_cons /* word3 */;
706         __le16 tx_bd_or_spq_prod /* word4 */;
707         __le16 word5 /* word5 */;
708         __le16 conn_dpi /* conn_dpi */;
709         u8 byte3 /* byte3 */;
710         u8 byte4 /* byte4 */;
711         u8 byte5 /* byte5 */;
712         u8 byte6 /* byte6 */;
713         __le32 reg0 /* reg0 */;
714         __le32 reg1 /* reg1 */;
715         __le32 reg2 /* reg2 */;
716         __le32 reg3 /* reg3 */;
717         __le32 reg4 /* reg4 */;
718         __le32 reg5 /* cf_array0 */;
719         __le32 reg6 /* cf_array1 */;
720         __le16 word7 /* word7 */;
721         __le16 word8 /* word8 */;
722         __le16 word9 /* word9 */;
723         __le16 word10 /* word10 */;
724         __le32 reg7 /* reg7 */;
725         __le32 reg8 /* reg8 */;
726         __le32 reg9 /* reg9 */;
727         u8 byte7 /* byte7 */;
728         u8 byte8 /* byte8 */;
729         u8 byte9 /* byte9 */;
730         u8 byte10 /* byte10 */;
731         u8 byte11 /* byte11 */;
732         u8 byte12 /* byte12 */;
733         u8 byte13 /* byte13 */;
734         u8 byte14 /* byte14 */;
735         u8 byte15 /* byte15 */;
736         u8 e5_reserved /* e5_reserved */;
737         __le16 word11 /* word11 */;
738         __le32 reg10 /* reg10 */;
739         __le32 reg11 /* reg11 */;
740         __le32 reg12 /* reg12 */;
741         __le32 reg13 /* reg13 */;
742         __le32 reg14 /* reg14 */;
743         __le32 reg15 /* reg15 */;
744         __le32 reg16 /* reg16 */;
745         __le32 reg17 /* reg17 */;
746         __le32 reg18 /* reg18 */;
747         __le32 reg19 /* reg19 */;
748         __le16 word12 /* word12 */;
749         __le16 word13 /* word13 */;
750         __le16 word14 /* word14 */;
751         __le16 word15 /* word15 */;
752 };
753
754 struct e4_tstorm_core_conn_ag_ctx
755 {
756         u8 byte0 /* cdu_validation */;
757         u8 byte1 /* state */;
758         u8 flags0;
759 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
760 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
761 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
762 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
763 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT2_MASK     0x1 /* bit2 */
764 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT2_SHIFT    2
765 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT3_MASK     0x1 /* bit3 */
766 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT3_SHIFT    3
767 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT4_MASK     0x1 /* bit4 */
768 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT4_SHIFT    4
769 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT5_MASK     0x1 /* bit5 */
770 #define E4_TSTORM_CORE_CONN_AG_CTX_BIT5_SHIFT    5
771 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* timer0cf */
772 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     6
773         u8 flags1;
774 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* timer1cf */
775 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     0
776 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* timer2cf */
777 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     2
778 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3_MASK      0x3 /* timer_stop_all */
779 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3_SHIFT     4
780 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4_MASK      0x3 /* cf4 */
781 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4_SHIFT     6
782         u8 flags2;
783 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5_MASK      0x3 /* cf5 */
784 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5_SHIFT     0
785 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6_MASK      0x3 /* cf6 */
786 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6_SHIFT     2
787 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7_MASK      0x3 /* cf7 */
788 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7_SHIFT     4
789 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8_MASK      0x3 /* cf8 */
790 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8_SHIFT     6
791         u8 flags3;
792 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9_MASK      0x3 /* cf9 */
793 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9_SHIFT     0
794 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10_MASK     0x3 /* cf10 */
795 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10_SHIFT    2
796 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
797 #define E4_TSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   4
798 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
799 #define E4_TSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   5
800 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
801 #define E4_TSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   6
802 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3EN_MASK    0x1 /* cf3en */
803 #define E4_TSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT   7
804         u8 flags4;
805 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4EN_MASK    0x1 /* cf4en */
806 #define E4_TSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT   0
807 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5EN_MASK    0x1 /* cf5en */
808 #define E4_TSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT   1
809 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6EN_MASK    0x1 /* cf6en */
810 #define E4_TSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT   2
811 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7EN_MASK    0x1 /* cf7en */
812 #define E4_TSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT   3
813 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8EN_MASK    0x1 /* cf8en */
814 #define E4_TSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT   4
815 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9EN_MASK    0x1 /* cf9en */
816 #define E4_TSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT   5
817 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10EN_MASK   0x1 /* cf10en */
818 #define E4_TSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT  6
819 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
820 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 7
821         u8 flags5;
822 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
823 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 0
824 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
825 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 1
826 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
827 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 2
828 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
829 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 3
830 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK  0x1 /* rule5en */
831 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT 4
832 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK  0x1 /* rule6en */
833 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT 5
834 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK  0x1 /* rule7en */
835 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT 6
836 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE8EN_MASK  0x1 /* rule8en */
837 #define E4_TSTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT 7
838         __le32 reg0 /* reg0 */;
839         __le32 reg1 /* reg1 */;
840         __le32 reg2 /* reg2 */;
841         __le32 reg3 /* reg3 */;
842         __le32 reg4 /* reg4 */;
843         __le32 reg5 /* reg5 */;
844         __le32 reg6 /* reg6 */;
845         __le32 reg7 /* reg7 */;
846         __le32 reg8 /* reg8 */;
847         u8 byte2 /* byte2 */;
848         u8 byte3 /* byte3 */;
849         __le16 word0 /* word0 */;
850         u8 byte4 /* byte4 */;
851         u8 byte5 /* byte5 */;
852         __le16 word1 /* word1 */;
853         __le16 word2 /* conn_dpi */;
854         __le16 word3 /* word3 */;
855         __le32 reg9 /* reg9 */;
856         __le32 reg10 /* reg10 */;
857 };
858
859 struct e4_ustorm_core_conn_ag_ctx
860 {
861         u8 reserved /* cdu_validation */;
862         u8 byte1 /* state */;
863         u8 flags0;
864 #define E4_USTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
865 #define E4_USTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
866 #define E4_USTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
867 #define E4_USTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
868 #define E4_USTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* timer0cf */
869 #define E4_USTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
870 #define E4_USTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* timer1cf */
871 #define E4_USTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
872 #define E4_USTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* timer2cf */
873 #define E4_USTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
874         u8 flags1;
875 #define E4_USTORM_CORE_CONN_AG_CTX_CF3_MASK      0x3 /* timer_stop_all */
876 #define E4_USTORM_CORE_CONN_AG_CTX_CF3_SHIFT     0
877 #define E4_USTORM_CORE_CONN_AG_CTX_CF4_MASK      0x3 /* cf4 */
878 #define E4_USTORM_CORE_CONN_AG_CTX_CF4_SHIFT     2
879 #define E4_USTORM_CORE_CONN_AG_CTX_CF5_MASK      0x3 /* cf5 */
880 #define E4_USTORM_CORE_CONN_AG_CTX_CF5_SHIFT     4
881 #define E4_USTORM_CORE_CONN_AG_CTX_CF6_MASK      0x3 /* cf6 */
882 #define E4_USTORM_CORE_CONN_AG_CTX_CF6_SHIFT     6
883         u8 flags2;
884 #define E4_USTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
885 #define E4_USTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
886 #define E4_USTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
887 #define E4_USTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
888 #define E4_USTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
889 #define E4_USTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
890 #define E4_USTORM_CORE_CONN_AG_CTX_CF3EN_MASK    0x1 /* cf3en */
891 #define E4_USTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT   3
892 #define E4_USTORM_CORE_CONN_AG_CTX_CF4EN_MASK    0x1 /* cf4en */
893 #define E4_USTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT   4
894 #define E4_USTORM_CORE_CONN_AG_CTX_CF5EN_MASK    0x1 /* cf5en */
895 #define E4_USTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT   5
896 #define E4_USTORM_CORE_CONN_AG_CTX_CF6EN_MASK    0x1 /* cf6en */
897 #define E4_USTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT   6
898 #define E4_USTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
899 #define E4_USTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 7
900         u8 flags3;
901 #define E4_USTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
902 #define E4_USTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 0
903 #define E4_USTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
904 #define E4_USTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 1
905 #define E4_USTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
906 #define E4_USTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 2
907 #define E4_USTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
908 #define E4_USTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 3
909 #define E4_USTORM_CORE_CONN_AG_CTX_RULE5EN_MASK  0x1 /* rule5en */
910 #define E4_USTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT 4
911 #define E4_USTORM_CORE_CONN_AG_CTX_RULE6EN_MASK  0x1 /* rule6en */
912 #define E4_USTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT 5
913 #define E4_USTORM_CORE_CONN_AG_CTX_RULE7EN_MASK  0x1 /* rule7en */
914 #define E4_USTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT 6
915 #define E4_USTORM_CORE_CONN_AG_CTX_RULE8EN_MASK  0x1 /* rule8en */
916 #define E4_USTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT 7
917         u8 byte2 /* byte2 */;
918         u8 byte3 /* byte3 */;
919         __le16 word0 /* conn_dpi */;
920         __le16 word1 /* word1 */;
921         __le32 rx_producers /* reg0 */;
922         __le32 reg1 /* reg1 */;
923         __le32 reg2 /* reg2 */;
924         __le32 reg3 /* reg3 */;
925         __le16 word2 /* word2 */;
926         __le16 word3 /* word3 */;
927 };
928
929 /*
930  * The core storm context for the Mstorm
931  */
932 struct mstorm_core_conn_st_ctx
933 {
934         __le32 reserved[24];
935 };
936
937 /*
938  * The core storm context for the Ustorm
939  */
940 struct ustorm_core_conn_st_ctx
941 {
942         __le32 reserved[4];
943 };
944
945 /*
946  * core connection context
947  */
948 struct e4_core_conn_context
949 {
950         struct ystorm_core_conn_st_ctx ystorm_st_context /* ystorm storm context */;
951         struct regpair ystorm_st_padding[2] /* padding */;
952         struct pstorm_core_conn_st_ctx pstorm_st_context /* pstorm storm context */;
953         struct regpair pstorm_st_padding[2] /* padding */;
954         struct xstorm_core_conn_st_ctx xstorm_st_context /* xstorm storm context */;
955         struct e4_xstorm_core_conn_ag_ctx xstorm_ag_context /* xstorm aggregative context */;
956         struct e4_tstorm_core_conn_ag_ctx tstorm_ag_context /* tstorm aggregative context */;
957         struct e4_ustorm_core_conn_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
958         struct mstorm_core_conn_st_ctx mstorm_st_context /* mstorm storm context */;
959         struct ustorm_core_conn_st_ctx ustorm_st_context /* ustorm storm context */;
960         struct regpair ustorm_st_padding[2] /* padding */;
961 };
962
963
964 struct e5_xstorm_core_conn_ag_ctx
965 {
966         u8 reserved0 /* cdu_validation */;
967         u8 state_and_core_id /* state_and_core_id */;
968         u8 flags0;
969 #define E5_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_MASK         0x1 /* exist_in_qm0 */
970 #define E5_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT        0
971 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED1_MASK            0x1 /* exist_in_qm1 */
972 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED1_SHIFT           1
973 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED2_MASK            0x1 /* exist_in_qm2 */
974 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED2_SHIFT           2
975 #define E5_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_MASK         0x1 /* exist_in_qm3 */
976 #define E5_XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT        3
977 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED3_MASK            0x1 /* bit4 */
978 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED3_SHIFT           4
979 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED4_MASK            0x1 /* cf_array_active */
980 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED4_SHIFT           5
981 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED5_MASK            0x1 /* bit6 */
982 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED5_SHIFT           6
983 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED6_MASK            0x1 /* bit7 */
984 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED6_SHIFT           7
985         u8 flags1;
986 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED7_MASK            0x1 /* bit8 */
987 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED7_SHIFT           0
988 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED8_MASK            0x1 /* bit9 */
989 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED8_SHIFT           1
990 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED9_MASK            0x1 /* bit10 */
991 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED9_SHIFT           2
992 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT11_MASK                0x1 /* bit11 */
993 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT11_SHIFT               3
994 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT12_MASK                0x1 /* bit12 */
995 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT12_SHIFT               4
996 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT13_MASK                0x1 /* bit13 */
997 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT13_SHIFT               5
998 #define E5_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_MASK       0x1 /* bit14 */
999 #define E5_XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT      6
1000 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_MASK         0x1 /* bit15 */
1001 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT        7
1002         u8 flags2;
1003 #define E5_XSTORM_CORE_CONN_AG_CTX_CF0_MASK                  0x3 /* timer0cf */
1004 #define E5_XSTORM_CORE_CONN_AG_CTX_CF0_SHIFT                 0
1005 #define E5_XSTORM_CORE_CONN_AG_CTX_CF1_MASK                  0x3 /* timer1cf */
1006 #define E5_XSTORM_CORE_CONN_AG_CTX_CF1_SHIFT                 2
1007 #define E5_XSTORM_CORE_CONN_AG_CTX_CF2_MASK                  0x3 /* timer2cf */
1008 #define E5_XSTORM_CORE_CONN_AG_CTX_CF2_SHIFT                 4
1009 #define E5_XSTORM_CORE_CONN_AG_CTX_CF3_MASK                  0x3 /* timer_stop_all */
1010 #define E5_XSTORM_CORE_CONN_AG_CTX_CF3_SHIFT                 6
1011         u8 flags3;
1012 #define E5_XSTORM_CORE_CONN_AG_CTX_CF4_MASK                  0x3 /* cf4 */
1013 #define E5_XSTORM_CORE_CONN_AG_CTX_CF4_SHIFT                 0
1014 #define E5_XSTORM_CORE_CONN_AG_CTX_CF5_MASK                  0x3 /* cf5 */
1015 #define E5_XSTORM_CORE_CONN_AG_CTX_CF5_SHIFT                 2
1016 #define E5_XSTORM_CORE_CONN_AG_CTX_CF6_MASK                  0x3 /* cf6 */
1017 #define E5_XSTORM_CORE_CONN_AG_CTX_CF6_SHIFT                 4
1018 #define E5_XSTORM_CORE_CONN_AG_CTX_CF7_MASK                  0x3 /* cf7 */
1019 #define E5_XSTORM_CORE_CONN_AG_CTX_CF7_SHIFT                 6
1020         u8 flags4;
1021 #define E5_XSTORM_CORE_CONN_AG_CTX_CF8_MASK                  0x3 /* cf8 */
1022 #define E5_XSTORM_CORE_CONN_AG_CTX_CF8_SHIFT                 0
1023 #define E5_XSTORM_CORE_CONN_AG_CTX_CF9_MASK                  0x3 /* cf9 */
1024 #define E5_XSTORM_CORE_CONN_AG_CTX_CF9_SHIFT                 2
1025 #define E5_XSTORM_CORE_CONN_AG_CTX_CF10_MASK                 0x3 /* cf10 */
1026 #define E5_XSTORM_CORE_CONN_AG_CTX_CF10_SHIFT                4
1027 #define E5_XSTORM_CORE_CONN_AG_CTX_CF11_MASK                 0x3 /* cf11 */
1028 #define E5_XSTORM_CORE_CONN_AG_CTX_CF11_SHIFT                6
1029         u8 flags5;
1030 #define E5_XSTORM_CORE_CONN_AG_CTX_CF12_MASK                 0x3 /* cf12 */
1031 #define E5_XSTORM_CORE_CONN_AG_CTX_CF12_SHIFT                0
1032 #define E5_XSTORM_CORE_CONN_AG_CTX_CF13_MASK                 0x3 /* cf13 */
1033 #define E5_XSTORM_CORE_CONN_AG_CTX_CF13_SHIFT                2
1034 #define E5_XSTORM_CORE_CONN_AG_CTX_CF14_MASK                 0x3 /* cf14 */
1035 #define E5_XSTORM_CORE_CONN_AG_CTX_CF14_SHIFT                4
1036 #define E5_XSTORM_CORE_CONN_AG_CTX_CF15_MASK                 0x3 /* cf15 */
1037 #define E5_XSTORM_CORE_CONN_AG_CTX_CF15_SHIFT                6
1038         u8 flags6;
1039 #define E5_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_MASK     0x3 /* cf16 */
1040 #define E5_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_SHIFT    0
1041 #define E5_XSTORM_CORE_CONN_AG_CTX_CF17_MASK                 0x3 /* cf_array_cf */
1042 #define E5_XSTORM_CORE_CONN_AG_CTX_CF17_SHIFT                2
1043 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_MASK                0x3 /* cf18 */
1044 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_SHIFT               4
1045 #define E5_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_MASK         0x3 /* cf19 */
1046 #define E5_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_SHIFT        6
1047         u8 flags7;
1048 #define E5_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_MASK             0x3 /* cf20 */
1049 #define E5_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_SHIFT            0
1050 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED10_MASK           0x3 /* cf21 */
1051 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED10_SHIFT          2
1052 #define E5_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_MASK            0x3 /* cf22 */
1053 #define E5_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_SHIFT           4
1054 #define E5_XSTORM_CORE_CONN_AG_CTX_CF0EN_MASK                0x1 /* cf0en */
1055 #define E5_XSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT               6
1056 #define E5_XSTORM_CORE_CONN_AG_CTX_CF1EN_MASK                0x1 /* cf1en */
1057 #define E5_XSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT               7
1058         u8 flags8;
1059 #define E5_XSTORM_CORE_CONN_AG_CTX_CF2EN_MASK                0x1 /* cf2en */
1060 #define E5_XSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT               0
1061 #define E5_XSTORM_CORE_CONN_AG_CTX_CF3EN_MASK                0x1 /* cf3en */
1062 #define E5_XSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT               1
1063 #define E5_XSTORM_CORE_CONN_AG_CTX_CF4EN_MASK                0x1 /* cf4en */
1064 #define E5_XSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT               2
1065 #define E5_XSTORM_CORE_CONN_AG_CTX_CF5EN_MASK                0x1 /* cf5en */
1066 #define E5_XSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT               3
1067 #define E5_XSTORM_CORE_CONN_AG_CTX_CF6EN_MASK                0x1 /* cf6en */
1068 #define E5_XSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT               4
1069 #define E5_XSTORM_CORE_CONN_AG_CTX_CF7EN_MASK                0x1 /* cf7en */
1070 #define E5_XSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT               5
1071 #define E5_XSTORM_CORE_CONN_AG_CTX_CF8EN_MASK                0x1 /* cf8en */
1072 #define E5_XSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT               6
1073 #define E5_XSTORM_CORE_CONN_AG_CTX_CF9EN_MASK                0x1 /* cf9en */
1074 #define E5_XSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT               7
1075         u8 flags9;
1076 #define E5_XSTORM_CORE_CONN_AG_CTX_CF10EN_MASK               0x1 /* cf10en */
1077 #define E5_XSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT              0
1078 #define E5_XSTORM_CORE_CONN_AG_CTX_CF11EN_MASK               0x1 /* cf11en */
1079 #define E5_XSTORM_CORE_CONN_AG_CTX_CF11EN_SHIFT              1
1080 #define E5_XSTORM_CORE_CONN_AG_CTX_CF12EN_MASK               0x1 /* cf12en */
1081 #define E5_XSTORM_CORE_CONN_AG_CTX_CF12EN_SHIFT              2
1082 #define E5_XSTORM_CORE_CONN_AG_CTX_CF13EN_MASK               0x1 /* cf13en */
1083 #define E5_XSTORM_CORE_CONN_AG_CTX_CF13EN_SHIFT              3
1084 #define E5_XSTORM_CORE_CONN_AG_CTX_CF14EN_MASK               0x1 /* cf14en */
1085 #define E5_XSTORM_CORE_CONN_AG_CTX_CF14EN_SHIFT              4
1086 #define E5_XSTORM_CORE_CONN_AG_CTX_CF15EN_MASK               0x1 /* cf15en */
1087 #define E5_XSTORM_CORE_CONN_AG_CTX_CF15EN_SHIFT              5
1088 #define E5_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_MASK  0x1 /* cf16en */
1089 #define E5_XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_SHIFT 6
1090 #define E5_XSTORM_CORE_CONN_AG_CTX_CF17EN_MASK               0x1 /* cf_array_cf_en */
1091 #define E5_XSTORM_CORE_CONN_AG_CTX_CF17EN_SHIFT              7
1092         u8 flags10;
1093 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_MASK             0x1 /* cf18en */
1094 #define E5_XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_SHIFT            0
1095 #define E5_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_MASK      0x1 /* cf19en */
1096 #define E5_XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT     1
1097 #define E5_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_MASK          0x1 /* cf20en */
1098 #define E5_XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT         2
1099 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED11_MASK           0x1 /* cf21en */
1100 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED11_SHIFT          3
1101 #define E5_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_MASK         0x1 /* cf22en */
1102 #define E5_XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT        4
1103 #define E5_XSTORM_CORE_CONN_AG_CTX_CF23EN_MASK               0x1 /* cf23en */
1104 #define E5_XSTORM_CORE_CONN_AG_CTX_CF23EN_SHIFT              5
1105 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED12_MASK           0x1 /* rule0en */
1106 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED12_SHIFT          6
1107 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED13_MASK           0x1 /* rule1en */
1108 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED13_SHIFT          7
1109         u8 flags11;
1110 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED14_MASK           0x1 /* rule2en */
1111 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED14_SHIFT          0
1112 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED15_MASK           0x1 /* rule3en */
1113 #define E5_XSTORM_CORE_CONN_AG_CTX_RESERVED15_SHIFT          1
1114 #define E5_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_MASK       0x1 /* rule4en */
1115 #define E5_XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT      2
1116 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK              0x1 /* rule5en */
1117 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT             3
1118 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK              0x1 /* rule6en */
1119 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT             4
1120 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK              0x1 /* rule7en */
1121 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT             5
1122 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_MASK         0x1 /* rule8en */
1123 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_SHIFT        6
1124 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE9EN_MASK              0x1 /* rule9en */
1125 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE9EN_SHIFT             7
1126         u8 flags12;
1127 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE10EN_MASK             0x1 /* rule10en */
1128 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE10EN_SHIFT            0
1129 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE11EN_MASK             0x1 /* rule11en */
1130 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE11EN_SHIFT            1
1131 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_MASK         0x1 /* rule12en */
1132 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_SHIFT        2
1133 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_MASK         0x1 /* rule13en */
1134 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_SHIFT        3
1135 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE14EN_MASK             0x1 /* rule14en */
1136 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE14EN_SHIFT            4
1137 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE15EN_MASK             0x1 /* rule15en */
1138 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE15EN_SHIFT            5
1139 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE16EN_MASK             0x1 /* rule16en */
1140 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE16EN_SHIFT            6
1141 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE17EN_MASK             0x1 /* rule17en */
1142 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE17EN_SHIFT            7
1143         u8 flags13;
1144 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE18EN_MASK             0x1 /* rule18en */
1145 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE18EN_SHIFT            0
1146 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE19EN_MASK             0x1 /* rule19en */
1147 #define E5_XSTORM_CORE_CONN_AG_CTX_RULE19EN_SHIFT            1
1148 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_MASK         0x1 /* rule20en */
1149 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_SHIFT        2
1150 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_MASK         0x1 /* rule21en */
1151 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_SHIFT        3
1152 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_MASK         0x1 /* rule22en */
1153 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_SHIFT        4
1154 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_MASK         0x1 /* rule23en */
1155 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_SHIFT        5
1156 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_MASK         0x1 /* rule24en */
1157 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_SHIFT        6
1158 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_MASK         0x1 /* rule25en */
1159 #define E5_XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_SHIFT        7
1160         u8 flags14;
1161 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT16_MASK                0x1 /* bit16 */
1162 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT16_SHIFT               0
1163 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT17_MASK                0x1 /* bit17 */
1164 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT17_SHIFT               1
1165 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT18_MASK                0x1 /* bit18 */
1166 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT18_SHIFT               2
1167 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT19_MASK                0x1 /* bit19 */
1168 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT19_SHIFT               3
1169 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT20_MASK                0x1 /* bit20 */
1170 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT20_SHIFT               4
1171 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT21_MASK                0x1 /* bit21 */
1172 #define E5_XSTORM_CORE_CONN_AG_CTX_BIT21_SHIFT               5
1173 #define E5_XSTORM_CORE_CONN_AG_CTX_CF23_MASK                 0x3 /* cf23 */
1174 #define E5_XSTORM_CORE_CONN_AG_CTX_CF23_SHIFT                6
1175         u8 byte2 /* byte2 */;
1176         __le16 physical_q0 /* physical_q0 */;
1177         __le16 consolid_prod /* physical_q1 */;
1178         __le16 reserved16 /* physical_q2 */;
1179         __le16 tx_bd_cons /* word3 */;
1180         __le16 tx_bd_or_spq_prod /* word4 */;
1181         __le16 word5 /* word5 */;
1182         __le16 conn_dpi /* conn_dpi */;
1183         u8 byte3 /* byte3 */;
1184         u8 byte4 /* byte4 */;
1185         u8 byte5 /* byte5 */;
1186         u8 byte6 /* byte6 */;
1187         __le32 reg0 /* reg0 */;
1188         __le32 reg1 /* reg1 */;
1189         __le32 reg2 /* reg2 */;
1190         __le32 reg3 /* reg3 */;
1191         __le32 reg4 /* reg4 */;
1192         __le32 reg5 /* cf_array0 */;
1193         __le32 reg6 /* cf_array1 */;
1194         u8 flags15;
1195 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED1_MASK         0x1 /* bit22 */
1196 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED1_SHIFT        0
1197 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED2_MASK         0x1 /* bit23 */
1198 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED2_SHIFT        1
1199 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED3_MASK         0x1 /* bit24 */
1200 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED3_SHIFT        2
1201 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED4_MASK         0x3 /* cf24 */
1202 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED4_SHIFT        3
1203 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED5_MASK         0x1 /* cf24en */
1204 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED5_SHIFT        5
1205 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED6_MASK         0x1 /* rule26en */
1206 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED6_SHIFT        6
1207 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED7_MASK         0x1 /* rule27en */
1208 #define E5_XSTORM_CORE_CONN_AG_CTX_E4_RESERVED7_SHIFT        7
1209         u8 byte7 /* byte7 */;
1210         __le16 word7 /* word7 */;
1211         __le16 word8 /* word8 */;
1212         __le16 word9 /* word9 */;
1213         __le16 word10 /* word10 */;
1214         __le16 word11 /* word11 */;
1215         __le32 reg7 /* reg7 */;
1216         __le32 reg8 /* reg8 */;
1217         __le32 reg9 /* reg9 */;
1218         u8 byte8 /* byte8 */;
1219         u8 byte9 /* byte9 */;
1220         u8 byte10 /* byte10 */;
1221         u8 byte11 /* byte11 */;
1222         u8 byte12 /* byte12 */;
1223         u8 byte13 /* byte13 */;
1224         u8 byte14 /* byte14 */;
1225         u8 byte15 /* byte15 */;
1226         __le32 reg10 /* reg10 */;
1227         __le32 reg11 /* reg11 */;
1228         __le32 reg12 /* reg12 */;
1229         __le32 reg13 /* reg13 */;
1230         __le32 reg14 /* reg14 */;
1231         __le32 reg15 /* reg15 */;
1232         __le32 reg16 /* reg16 */;
1233         __le32 reg17 /* reg17 */;
1234         __le32 reg18 /* reg18 */;
1235         __le32 reg19 /* reg19 */;
1236         __le16 word12 /* word12 */;
1237         __le16 word13 /* word13 */;
1238         __le16 word14 /* word14 */;
1239         __le16 word15 /* word15 */;
1240 };
1241
1242 struct e5_tstorm_core_conn_ag_ctx
1243 {
1244         u8 byte0 /* cdu_validation */;
1245         u8 byte1 /* state_and_core_id */;
1246         u8 flags0;
1247 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT0_MASK          0x1 /* exist_in_qm0 */
1248 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT         0
1249 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT1_MASK          0x1 /* exist_in_qm1 */
1250 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT         1
1251 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT2_MASK          0x1 /* bit2 */
1252 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT2_SHIFT         2
1253 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT3_MASK          0x1 /* bit3 */
1254 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT3_SHIFT         3
1255 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT4_MASK          0x1 /* bit4 */
1256 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT4_SHIFT         4
1257 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT5_MASK          0x1 /* bit5 */
1258 #define E5_TSTORM_CORE_CONN_AG_CTX_BIT5_SHIFT         5
1259 #define E5_TSTORM_CORE_CONN_AG_CTX_CF0_MASK           0x3 /* timer0cf */
1260 #define E5_TSTORM_CORE_CONN_AG_CTX_CF0_SHIFT          6
1261         u8 flags1;
1262 #define E5_TSTORM_CORE_CONN_AG_CTX_CF1_MASK           0x3 /* timer1cf */
1263 #define E5_TSTORM_CORE_CONN_AG_CTX_CF1_SHIFT          0
1264 #define E5_TSTORM_CORE_CONN_AG_CTX_CF2_MASK           0x3 /* timer2cf */
1265 #define E5_TSTORM_CORE_CONN_AG_CTX_CF2_SHIFT          2
1266 #define E5_TSTORM_CORE_CONN_AG_CTX_CF3_MASK           0x3 /* timer_stop_all */
1267 #define E5_TSTORM_CORE_CONN_AG_CTX_CF3_SHIFT          4
1268 #define E5_TSTORM_CORE_CONN_AG_CTX_CF4_MASK           0x3 /* cf4 */
1269 #define E5_TSTORM_CORE_CONN_AG_CTX_CF4_SHIFT          6
1270         u8 flags2;
1271 #define E5_TSTORM_CORE_CONN_AG_CTX_CF5_MASK           0x3 /* cf5 */
1272 #define E5_TSTORM_CORE_CONN_AG_CTX_CF5_SHIFT          0
1273 #define E5_TSTORM_CORE_CONN_AG_CTX_CF6_MASK           0x3 /* cf6 */
1274 #define E5_TSTORM_CORE_CONN_AG_CTX_CF6_SHIFT          2
1275 #define E5_TSTORM_CORE_CONN_AG_CTX_CF7_MASK           0x3 /* cf7 */
1276 #define E5_TSTORM_CORE_CONN_AG_CTX_CF7_SHIFT          4
1277 #define E5_TSTORM_CORE_CONN_AG_CTX_CF8_MASK           0x3 /* cf8 */
1278 #define E5_TSTORM_CORE_CONN_AG_CTX_CF8_SHIFT          6
1279         u8 flags3;
1280 #define E5_TSTORM_CORE_CONN_AG_CTX_CF9_MASK           0x3 /* cf9 */
1281 #define E5_TSTORM_CORE_CONN_AG_CTX_CF9_SHIFT          0
1282 #define E5_TSTORM_CORE_CONN_AG_CTX_CF10_MASK          0x3 /* cf10 */
1283 #define E5_TSTORM_CORE_CONN_AG_CTX_CF10_SHIFT         2
1284 #define E5_TSTORM_CORE_CONN_AG_CTX_CF0EN_MASK         0x1 /* cf0en */
1285 #define E5_TSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT        4
1286 #define E5_TSTORM_CORE_CONN_AG_CTX_CF1EN_MASK         0x1 /* cf1en */
1287 #define E5_TSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT        5
1288 #define E5_TSTORM_CORE_CONN_AG_CTX_CF2EN_MASK         0x1 /* cf2en */
1289 #define E5_TSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT        6
1290 #define E5_TSTORM_CORE_CONN_AG_CTX_CF3EN_MASK         0x1 /* cf3en */
1291 #define E5_TSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT        7
1292         u8 flags4;
1293 #define E5_TSTORM_CORE_CONN_AG_CTX_CF4EN_MASK         0x1 /* cf4en */
1294 #define E5_TSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT        0
1295 #define E5_TSTORM_CORE_CONN_AG_CTX_CF5EN_MASK         0x1 /* cf5en */
1296 #define E5_TSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT        1
1297 #define E5_TSTORM_CORE_CONN_AG_CTX_CF6EN_MASK         0x1 /* cf6en */
1298 #define E5_TSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT        2
1299 #define E5_TSTORM_CORE_CONN_AG_CTX_CF7EN_MASK         0x1 /* cf7en */
1300 #define E5_TSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT        3
1301 #define E5_TSTORM_CORE_CONN_AG_CTX_CF8EN_MASK         0x1 /* cf8en */
1302 #define E5_TSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT        4
1303 #define E5_TSTORM_CORE_CONN_AG_CTX_CF9EN_MASK         0x1 /* cf9en */
1304 #define E5_TSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT        5
1305 #define E5_TSTORM_CORE_CONN_AG_CTX_CF10EN_MASK        0x1 /* cf10en */
1306 #define E5_TSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT       6
1307 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK       0x1 /* rule0en */
1308 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT      7
1309         u8 flags5;
1310 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK       0x1 /* rule1en */
1311 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT      0
1312 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK       0x1 /* rule2en */
1313 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT      1
1314 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK       0x1 /* rule3en */
1315 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT      2
1316 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK       0x1 /* rule4en */
1317 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT      3
1318 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK       0x1 /* rule5en */
1319 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT      4
1320 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK       0x1 /* rule6en */
1321 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT      5
1322 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK       0x1 /* rule7en */
1323 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT      6
1324 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE8EN_MASK       0x1 /* rule8en */
1325 #define E5_TSTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT      7
1326         u8 flags6;
1327 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED1_MASK  0x1 /* bit6 */
1328 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED1_SHIFT 0
1329 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED2_MASK  0x1 /* bit7 */
1330 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED2_SHIFT 1
1331 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED3_MASK  0x1 /* bit8 */
1332 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED3_SHIFT 2
1333 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED4_MASK  0x3 /* cf11 */
1334 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED4_SHIFT 3
1335 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED5_MASK  0x1 /* cf11en */
1336 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED5_SHIFT 5
1337 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED6_MASK  0x1 /* rule9en */
1338 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED6_SHIFT 6
1339 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED7_MASK  0x1 /* rule10en */
1340 #define E5_TSTORM_CORE_CONN_AG_CTX_E4_RESERVED7_SHIFT 7
1341         u8 byte2 /* byte2 */;
1342         __le16 word0 /* word0 */;
1343         __le32 reg0 /* reg0 */;
1344         __le32 reg1 /* reg1 */;
1345         __le32 reg2 /* reg2 */;
1346         __le32 reg3 /* reg3 */;
1347         __le32 reg4 /* reg4 */;
1348         __le32 reg5 /* reg5 */;
1349         __le32 reg6 /* reg6 */;
1350         __le32 reg7 /* reg7 */;
1351         __le32 reg8 /* reg8 */;
1352         u8 byte3 /* byte3 */;
1353         u8 byte4 /* byte4 */;
1354         u8 byte5 /* byte5 */;
1355         u8 e4_reserved8 /* byte6 */;
1356         __le16 word1 /* word1 */;
1357         __le16 word2 /* conn_dpi */;
1358         __le32 reg9 /* reg9 */;
1359         __le16 word3 /* word3 */;
1360         __le16 e4_reserved9 /* word4 */;
1361 };
1362
1363 struct e5_ustorm_core_conn_ag_ctx
1364 {
1365         u8 reserved /* cdu_validation */;
1366         u8 byte1 /* state_and_core_id */;
1367         u8 flags0;
1368 #define E5_USTORM_CORE_CONN_AG_CTX_BIT0_MASK          0x1 /* exist_in_qm0 */
1369 #define E5_USTORM_CORE_CONN_AG_CTX_BIT0_SHIFT         0
1370 #define E5_USTORM_CORE_CONN_AG_CTX_BIT1_MASK          0x1 /* exist_in_qm1 */
1371 #define E5_USTORM_CORE_CONN_AG_CTX_BIT1_SHIFT         1
1372 #define E5_USTORM_CORE_CONN_AG_CTX_CF0_MASK           0x3 /* timer0cf */
1373 #define E5_USTORM_CORE_CONN_AG_CTX_CF0_SHIFT          2
1374 #define E5_USTORM_CORE_CONN_AG_CTX_CF1_MASK           0x3 /* timer1cf */
1375 #define E5_USTORM_CORE_CONN_AG_CTX_CF1_SHIFT          4
1376 #define E5_USTORM_CORE_CONN_AG_CTX_CF2_MASK           0x3 /* timer2cf */
1377 #define E5_USTORM_CORE_CONN_AG_CTX_CF2_SHIFT          6
1378         u8 flags1;
1379 #define E5_USTORM_CORE_CONN_AG_CTX_CF3_MASK           0x3 /* timer_stop_all */
1380 #define E5_USTORM_CORE_CONN_AG_CTX_CF3_SHIFT          0
1381 #define E5_USTORM_CORE_CONN_AG_CTX_CF4_MASK           0x3 /* cf4 */
1382 #define E5_USTORM_CORE_CONN_AG_CTX_CF4_SHIFT          2
1383 #define E5_USTORM_CORE_CONN_AG_CTX_CF5_MASK           0x3 /* cf5 */
1384 #define E5_USTORM_CORE_CONN_AG_CTX_CF5_SHIFT          4
1385 #define E5_USTORM_CORE_CONN_AG_CTX_CF6_MASK           0x3 /* cf6 */
1386 #define E5_USTORM_CORE_CONN_AG_CTX_CF6_SHIFT          6
1387         u8 flags2;
1388 #define E5_USTORM_CORE_CONN_AG_CTX_CF0EN_MASK         0x1 /* cf0en */
1389 #define E5_USTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT        0
1390 #define E5_USTORM_CORE_CONN_AG_CTX_CF1EN_MASK         0x1 /* cf1en */
1391 #define E5_USTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT        1
1392 #define E5_USTORM_CORE_CONN_AG_CTX_CF2EN_MASK         0x1 /* cf2en */
1393 #define E5_USTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT        2
1394 #define E5_USTORM_CORE_CONN_AG_CTX_CF3EN_MASK         0x1 /* cf3en */
1395 #define E5_USTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT        3
1396 #define E5_USTORM_CORE_CONN_AG_CTX_CF4EN_MASK         0x1 /* cf4en */
1397 #define E5_USTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT        4
1398 #define E5_USTORM_CORE_CONN_AG_CTX_CF5EN_MASK         0x1 /* cf5en */
1399 #define E5_USTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT        5
1400 #define E5_USTORM_CORE_CONN_AG_CTX_CF6EN_MASK         0x1 /* cf6en */
1401 #define E5_USTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT        6
1402 #define E5_USTORM_CORE_CONN_AG_CTX_RULE0EN_MASK       0x1 /* rule0en */
1403 #define E5_USTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT      7
1404         u8 flags3;
1405 #define E5_USTORM_CORE_CONN_AG_CTX_RULE1EN_MASK       0x1 /* rule1en */
1406 #define E5_USTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT      0
1407 #define E5_USTORM_CORE_CONN_AG_CTX_RULE2EN_MASK       0x1 /* rule2en */
1408 #define E5_USTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT      1
1409 #define E5_USTORM_CORE_CONN_AG_CTX_RULE3EN_MASK       0x1 /* rule3en */
1410 #define E5_USTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT      2
1411 #define E5_USTORM_CORE_CONN_AG_CTX_RULE4EN_MASK       0x1 /* rule4en */
1412 #define E5_USTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT      3
1413 #define E5_USTORM_CORE_CONN_AG_CTX_RULE5EN_MASK       0x1 /* rule5en */
1414 #define E5_USTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT      4
1415 #define E5_USTORM_CORE_CONN_AG_CTX_RULE6EN_MASK       0x1 /* rule6en */
1416 #define E5_USTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT      5
1417 #define E5_USTORM_CORE_CONN_AG_CTX_RULE7EN_MASK       0x1 /* rule7en */
1418 #define E5_USTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT      6
1419 #define E5_USTORM_CORE_CONN_AG_CTX_RULE8EN_MASK       0x1 /* rule8en */
1420 #define E5_USTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT      7
1421         u8 flags4;
1422 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED1_MASK  0x1 /* bit2 */
1423 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED1_SHIFT 0
1424 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED2_MASK  0x1 /* bit3 */
1425 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED2_SHIFT 1
1426 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED3_MASK  0x3 /* cf7 */
1427 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED3_SHIFT 2
1428 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED4_MASK  0x3 /* cf8 */
1429 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED4_SHIFT 4
1430 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED5_MASK  0x1 /* cf7en */
1431 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED5_SHIFT 6
1432 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED6_MASK  0x1 /* cf8en */
1433 #define E5_USTORM_CORE_CONN_AG_CTX_E4_RESERVED6_SHIFT 7
1434         u8 byte2 /* byte2 */;
1435         __le16 word0 /* conn_dpi */;
1436         __le16 word1 /* word1 */;
1437         __le32 rx_producers /* reg0 */;
1438         __le32 reg1 /* reg1 */;
1439         __le32 reg2 /* reg2 */;
1440         __le32 reg3 /* reg3 */;
1441         __le16 word2 /* word2 */;
1442         __le16 word3 /* word3 */;
1443 };
1444
1445 /*
1446  * core connection context
1447  */
1448 struct e5_core_conn_context
1449 {
1450         struct ystorm_core_conn_st_ctx ystorm_st_context /* ystorm storm context */;
1451         struct regpair ystorm_st_padding[2] /* padding */;
1452         struct pstorm_core_conn_st_ctx pstorm_st_context /* pstorm storm context */;
1453         struct regpair pstorm_st_padding[2] /* padding */;
1454         struct xstorm_core_conn_st_ctx xstorm_st_context /* xstorm storm context */;
1455         struct e5_xstorm_core_conn_ag_ctx xstorm_ag_context /* xstorm aggregative context */;
1456         struct e5_tstorm_core_conn_ag_ctx tstorm_ag_context /* tstorm aggregative context */;
1457         struct e5_ustorm_core_conn_ag_ctx ustorm_ag_context /* ustorm aggregative context */;
1458         struct mstorm_core_conn_st_ctx mstorm_st_context /* mstorm storm context */;
1459         struct ustorm_core_conn_st_ctx ustorm_st_context /* ustorm storm context */;
1460         struct regpair ustorm_st_padding[2] /* padding */;
1461 };
1462
1463
1464 struct eth_mstorm_per_pf_stat
1465 {
1466         struct regpair gre_discard_pkts /* Dropped GRE RX packets */;
1467         struct regpair vxlan_discard_pkts /* Dropped VXLAN RX packets */;
1468         struct regpair geneve_discard_pkts /* Dropped GENEVE RX packets */;
1469         struct regpair lb_discard_pkts /* Dropped Tx switched packets */;
1470 };
1471
1472
1473 struct eth_mstorm_per_queue_stat
1474 {
1475         struct regpair ttl0_discard /* Number of packets discarded because TTL=0 (in IPv4) or hopLimit=0 (in IPv6) */;
1476         struct regpair packet_too_big_discard /* Number of packets discarded because they are bigger than MTU */;
1477         struct regpair no_buff_discard /* Number of packets discarded due to lack of host buffers (BDs/SGEs/CQEs) */;
1478         struct regpair not_active_discard /* Number of packets discarded because of no active Rx connection */;
1479         struct regpair tpa_coalesced_pkts /* number of coalesced packets in all TPA aggregations */;
1480         struct regpair tpa_coalesced_events /* total number of TPA aggregations */;
1481         struct regpair tpa_aborts_num /* number of aggregations, which abnormally ended */;
1482         struct regpair tpa_coalesced_bytes /* total TCP payload length in all TPA aggregations */;
1483 };
1484
1485
1486 /*
1487  * Ethernet TX Per PF
1488  */
1489 struct eth_pstorm_per_pf_stat
1490 {
1491         struct regpair sent_lb_ucast_bytes /* number of total ucast bytes sent on loopback port without errors */;
1492         struct regpair sent_lb_mcast_bytes /* number of total mcast bytes sent on loopback port without errors */;
1493         struct regpair sent_lb_bcast_bytes /* number of total bcast bytes sent on loopback port without errors */;
1494         struct regpair sent_lb_ucast_pkts /* number of total ucast packets sent on loopback port without errors */;
1495         struct regpair sent_lb_mcast_pkts /* number of total mcast packets sent on loopback port without errors */;
1496         struct regpair sent_lb_bcast_pkts /* number of total bcast packets sent on loopback port without errors */;
1497         struct regpair sent_gre_bytes /* Sent GRE bytes */;
1498         struct regpair sent_vxlan_bytes /* Sent VXLAN bytes */;
1499         struct regpair sent_geneve_bytes /* Sent GENEVE bytes */;
1500         struct regpair sent_gre_pkts /* Sent GRE packets */;
1501         struct regpair sent_vxlan_pkts /* Sent VXLAN packets */;
1502         struct regpair sent_geneve_pkts /* Sent GENEVE packets */;
1503         struct regpair gre_drop_pkts /* Dropped GRE TX packets */;
1504         struct regpair vxlan_drop_pkts /* Dropped VXLAN TX packets */;
1505         struct regpair geneve_drop_pkts /* Dropped GENEVE TX packets */;
1506 };
1507
1508
1509 /*
1510  * Ethernet TX Per Queue Stats
1511  */
1512 struct eth_pstorm_per_queue_stat
1513 {
1514         struct regpair sent_ucast_bytes /* number of total bytes sent without errors */;
1515         struct regpair sent_mcast_bytes /* number of total bytes sent without errors */;
1516         struct regpair sent_bcast_bytes /* number of total bytes sent without errors */;
1517         struct regpair sent_ucast_pkts /* number of total packets sent without errors */;
1518         struct regpair sent_mcast_pkts /* number of total packets sent without errors */;
1519         struct regpair sent_bcast_pkts /* number of total packets sent without errors */;
1520         struct regpair error_drop_pkts /* number of total packets dropped due to errors */;
1521 };
1522
1523
1524 /*
1525  * ETH Rx producers data
1526  */
1527 struct eth_rx_rate_limit
1528 {
1529         __le16 mult /* Rate Limit Multiplier - (Storm Clock (MHz) * 8 / Desired Bandwidth (MB/s)) */;
1530         __le16 cnst /* Constant term to add (or subtract from number of cycles) */;
1531         u8 add_sub_cnst /* Add (1) or subtract (0) constant term */;
1532         u8 reserved0;
1533         __le16 reserved1;
1534 };
1535
1536
1537 struct eth_ustorm_per_pf_stat
1538 {
1539         struct regpair rcv_lb_ucast_bytes /* number of total ucast bytes received on loopback port without errors */;
1540         struct regpair rcv_lb_mcast_bytes /* number of total mcast bytes received on loopback port without errors */;
1541         struct regpair rcv_lb_bcast_bytes /* number of total bcast bytes received on loopback port without errors */;
1542         struct regpair rcv_lb_ucast_pkts /* number of total ucast packets received on loopback port without errors */;
1543         struct regpair rcv_lb_mcast_pkts /* number of total mcast packets received on loopback port without errors */;
1544         struct regpair rcv_lb_bcast_pkts /* number of total bcast packets received on loopback port without errors */;
1545         struct regpair rcv_gre_bytes /* Received GRE bytes */;
1546         struct regpair rcv_vxlan_bytes /* Received VXLAN bytes */;
1547         struct regpair rcv_geneve_bytes /* Received GENEVE bytes */;
1548         struct regpair rcv_gre_pkts /* Received GRE packets */;
1549         struct regpair rcv_vxlan_pkts /* Received VXLAN packets */;
1550         struct regpair rcv_geneve_pkts /* Received GENEVE packets */;
1551 };
1552
1553
1554 struct eth_ustorm_per_queue_stat
1555 {
1556         struct regpair rcv_ucast_bytes;
1557         struct regpair rcv_mcast_bytes;
1558         struct regpair rcv_bcast_bytes;
1559         struct regpair rcv_ucast_pkts;
1560         struct regpair rcv_mcast_pkts;
1561         struct regpair rcv_bcast_pkts;
1562 };
1563
1564
1565 /*
1566  * Event Ring Next Page Address
1567  */
1568 struct event_ring_next_addr
1569 {
1570         struct regpair addr /* Next Page Address */;
1571         __le32 reserved[2] /* Reserved */;
1572 };
1573
1574 /*
1575  * Event Ring Element
1576  */
1577 union event_ring_element
1578 {
1579         struct event_ring_entry entry /* Event Ring Entry */;
1580         struct event_ring_next_addr next_addr /* Event Ring Next Page Address */;
1581 };
1582
1583
1584
1585 /*
1586  * Ports mode
1587  */
1588 enum fw_flow_ctrl_mode
1589 {
1590         flow_ctrl_pause,
1591         flow_ctrl_pfc,
1592         MAX_FW_FLOW_CTRL_MODE
1593 };
1594
1595
1596 /*
1597  * Major and Minor hsi Versions
1598  */
1599 struct hsi_fp_ver_struct
1600 {
1601         u8 minor_ver_arr[2] /* Minor Version of hsi loading pf */;
1602         u8 major_ver_arr[2] /* Major Version of driver loading pf */;
1603 };
1604
1605
1606 /*
1607  * Integration Phase
1608  */
1609 enum integ_phase
1610 {
1611         INTEG_PHASE_BB_A0_LATEST=3 /* BB A0 latest integration phase */,
1612         INTEG_PHASE_BB_B0_NO_MCP=10 /* BB B0 without MCP */,
1613         INTEG_PHASE_BB_B0_WITH_MCP=11 /* BB B0 with MCP */,
1614         MAX_INTEG_PHASE
1615 };
1616
1617
1618 /*
1619  * Ports mode
1620  */
1621 enum iwarp_ll2_tx_queues
1622 {
1623         IWARP_LL2_IN_ORDER_TX_QUEUE=1 /* LL2 queue for OOO packets sent in-order by the driver */,
1624         IWARP_LL2_ALIGNED_TX_QUEUE /* LL2 queue for unaligned packets sent aligned by the driver */,
1625         IWARP_LL2_ALIGNED_RIGHT_TRIMMED_TX_QUEUE /* LL2 queue for unaligned packets sent aligned and was right-trimmed by the driver */,
1626         IWARP_LL2_ERROR /* Error indication */,
1627         MAX_IWARP_LL2_TX_QUEUES
1628 };
1629
1630
1631 /*
1632  * Malicious VF error ID
1633  */
1634 enum malicious_vf_error_id
1635 {
1636         MALICIOUS_VF_NO_ERROR /* Zero placeholder value */,
1637         VF_PF_CHANNEL_NOT_READY /* Writing to VF/PF channel when it is not ready */,
1638         VF_ZONE_MSG_NOT_VALID /* VF channel message is not valid */,
1639         VF_ZONE_FUNC_NOT_ENABLED /* Parent PF of VF channel is not active */,
1640         ETH_PACKET_TOO_SMALL /* TX packet is shorter then reported on BDs or from minimal size */,
1641         ETH_ILLEGAL_VLAN_MODE /* Tx packet with marked as insert VLAN when its illegal */,
1642         ETH_MTU_VIOLATION /* TX packet is greater then MTU */,
1643         ETH_ILLEGAL_INBAND_TAGS /* TX packet has illegal inband tags marked */,
1644         ETH_VLAN_INSERT_AND_INBAND_VLAN /* Vlan cant be added to inband tag */,
1645         ETH_ILLEGAL_NBDS /* indicated number of BDs for the packet is illegal */,
1646         ETH_FIRST_BD_WO_SOP /* 1st BD must have start_bd flag set */,
1647         ETH_INSUFFICIENT_BDS /* There are not enough BDs for transmission of even one packet */,
1648         ETH_ILLEGAL_LSO_HDR_NBDS /* Header NBDs value is illegal */,
1649         ETH_ILLEGAL_LSO_MSS /* LSO MSS value is more than allowed */,
1650         ETH_ZERO_SIZE_BD /* empty BD (which not contains control flags) is illegal  */,
1651         ETH_ILLEGAL_LSO_HDR_LEN /* LSO header size is above the limit  */,
1652         ETH_INSUFFICIENT_PAYLOAD /* In LSO its expected that on the local BD ring there will be at least MSS bytes of data */,
1653         ETH_EDPM_OUT_OF_SYNC /* Valid BDs on local ring after EDPM L2 sync */,
1654         ETH_TUNN_IPV6_EXT_NBD_ERR /* Tunneled packet with IPv6+Ext without a proper number of BDs */,
1655         ETH_CONTROL_PACKET_VIOLATION /* VF sent control frame such as PFC */,
1656         ETH_ANTI_SPOOFING_ERR /* Anti-Spoofing verification failure */,
1657         MAX_MALICIOUS_VF_ERROR_ID
1658 };
1659
1660
1661
1662 /*
1663  * Mstorm non-triggering VF zone
1664  */
1665 struct mstorm_non_trigger_vf_zone
1666 {
1667         struct eth_mstorm_per_queue_stat eth_queue_stat /* VF statistic bucket */;
1668         struct eth_rx_prod_data eth_rx_queue_producers[ETH_MAX_NUM_RX_QUEUES_PER_VF_QUAD] /* VF RX queues producers */;
1669 };
1670
1671
1672 /*
1673  * Mstorm VF zone
1674  */
1675 struct mstorm_vf_zone
1676 {
1677         struct mstorm_non_trigger_vf_zone non_trigger /* non-interrupt-triggering zone */;
1678 };
1679
1680
1681 /*
1682  * personality per PF
1683  */
1684 enum personality_type
1685 {
1686         BAD_PERSONALITY_TYP,
1687         PERSONALITY_ISCSI /* iSCSI and LL2 */,
1688         PERSONALITY_FCOE /* Fcoe and LL2 */,
1689         PERSONALITY_RDMA_AND_ETH /* Roce or Iwarp, Eth and LL2 */,
1690         PERSONALITY_RDMA /* Roce and LL2 */,
1691         PERSONALITY_CORE /* CORE(LL2) */,
1692         PERSONALITY_ETH /* Ethernet */,
1693         PERSONALITY_TOE /* Toe and LL2 */,
1694         MAX_PERSONALITY_TYPE
1695 };
1696
1697
1698 /*
1699  * tunnel configuration
1700  */
1701 struct pf_start_tunnel_config
1702 {
1703         u8 set_vxlan_udp_port_flg /* Set VXLAN tunnel UDP destination port to vxlan_udp_port. If not set - FW will use a default port */;
1704         u8 set_geneve_udp_port_flg /* Set GENEVE tunnel UDP destination port to geneve_udp_port. If not set - FW will use a default port */;
1705         u8 tunnel_clss_vxlan /* Rx classification scheme for VXLAN tunnel. */;
1706         u8 tunnel_clss_l2geneve /* Rx classification scheme for l2 GENEVE tunnel. */;
1707         u8 tunnel_clss_ipgeneve /* Rx classification scheme for ip GENEVE tunnel. */;
1708         u8 tunnel_clss_l2gre /* Rx classification scheme for l2 GRE tunnel. */;
1709         u8 tunnel_clss_ipgre /* Rx classification scheme for ip GRE tunnel. */;
1710         u8 reserved;
1711         __le16 vxlan_udp_port /* VXLAN tunnel UDP destination port. Valid if set_vxlan_udp_port_flg=1 */;
1712         __le16 geneve_udp_port /* GENEVE tunnel UDP destination port. Valid if set_geneve_udp_port_flg=1 */;
1713 };
1714
1715 /*
1716  * Ramrod data for PF start ramrod
1717  */
1718 struct pf_start_ramrod_data
1719 {
1720         struct regpair event_ring_pbl_addr /* Address of event ring PBL */;
1721         struct regpair consolid_q_pbl_addr /* PBL address of consolidation queue */;
1722         struct pf_start_tunnel_config tunnel_config /* tunnel configuration. */;
1723         __le32 reserved;
1724         __le16 event_ring_sb_id /* Status block ID */;
1725         u8 base_vf_id /* All VfIds owned by Pf will be from baseVfId till baseVfId+numVfs */;
1726         u8 num_vfs /* Amount of vfs owned by PF */;
1727         u8 event_ring_num_pages /* Number of PBL pages in event ring */;
1728         u8 event_ring_sb_index /* Status block index */;
1729         u8 path_id /* HW path ID (engine ID) */;
1730         u8 warning_as_error /* In FW asserts, treat warning as error */;
1731         u8 dont_log_ramrods /* If not set - throw a warning for each ramrod (for debug) */;
1732         u8 personality /* define what type of personality is new PF */;
1733         __le16 log_type_mask /* Log type mask. Each bit set enables a corresponding event type logging. Event types are defined as ASSERT_LOG_TYPE_xxx */;
1734         u8 mf_mode /* Multi function mode */;
1735         u8 integ_phase /* Integration phase */;
1736         u8 allow_npar_tx_switching /* If set, inter-pf tx switching is allowed in Switch Independent function mode */;
1737         u8 inner_to_outer_pri_map[8] /* Map from inner to outer priority. Set pri_map_valid when init map */;
1738         u8 pri_map_valid /* If inner_to_outer_pri_map is initialize then set pri_map_valid */;
1739         __le32 outer_tag /* In case mf_mode is MF_OVLAN, this field specifies the outer vlan (lower 16 bits) and ethType to use (higher 16 bits) */;
1740         struct hsi_fp_ver_struct hsi_fp_ver /* FP HSI version to be used by FW */;
1741 };
1742
1743
1744
1745 /*
1746  * Data for port update ramrod
1747  */
1748 struct protocol_dcb_data
1749 {
1750         u8 dcb_enable_flag /* dcbEnable flag value */;
1751         u8 dscp_enable_flag /* If set use dscp value */;
1752         u8 dcb_priority /* dcbPri flag value */;
1753         u8 dcb_tc /* dcb TC value */;
1754         u8 dscp_val /* dscp value to write if dscp_enable_flag is set */;
1755         u8 reserved0;
1756 };
1757
1758 /*
1759  * Update tunnel configuration
1760  */
1761 struct pf_update_tunnel_config
1762 {
1763         u8 update_rx_pf_clss /* Update RX per PF tunnel classification scheme. */;
1764         u8 update_rx_def_ucast_clss /* Update per PORT default tunnel RX classification scheme for traffic with unknown unicast outer MAC in NPAR mode. */;
1765         u8 update_rx_def_non_ucast_clss /* Update per PORT default tunnel RX classification scheme for traffic with non unicast outer MAC in NPAR mode. */;
1766         u8 set_vxlan_udp_port_flg /* Update VXLAN tunnel UDP destination port. */;
1767         u8 set_geneve_udp_port_flg /* Update GENEVE tunnel UDP destination port. */;
1768         u8 tunnel_clss_vxlan /* Classification scheme for VXLAN tunnel. */;
1769         u8 tunnel_clss_l2geneve /* Classification scheme for l2 GENEVE tunnel. */;
1770         u8 tunnel_clss_ipgeneve /* Classification scheme for ip GENEVE tunnel. */;
1771         u8 tunnel_clss_l2gre /* Classification scheme for l2 GRE tunnel. */;
1772         u8 tunnel_clss_ipgre /* Classification scheme for ip GRE tunnel. */;
1773         __le16 vxlan_udp_port /* VXLAN tunnel UDP destination port. */;
1774         __le16 geneve_udp_port /* GENEVE tunnel UDP destination port. */;
1775         __le16 reserved;
1776 };
1777
1778 /*
1779  * Data for port update ramrod
1780  */
1781 struct pf_update_ramrod_data
1782 {
1783         u8 pf_id;
1784         u8 update_eth_dcb_data_mode /* Update Eth DCB  data indication */;
1785         u8 update_fcoe_dcb_data_mode /* Update FCOE DCB  data indication */;
1786         u8 update_iscsi_dcb_data_mode /* Update iSCSI DCB  data indication */;
1787         u8 update_roce_dcb_data_mode /* Update ROCE DCB  data indication */;
1788         u8 update_rroce_dcb_data_mode /* Update RROCE (RoceV2) DCB  data indication */;
1789         u8 update_iwarp_dcb_data_mode /* Update IWARP DCB  data indication */;
1790         u8 update_mf_vlan_flag /* Update MF outer vlan Id */;
1791         struct protocol_dcb_data eth_dcb_data /* core eth related fields */;
1792         struct protocol_dcb_data fcoe_dcb_data /* core fcoe related fields */;
1793         struct protocol_dcb_data iscsi_dcb_data /* core iscsi related fields */;
1794         struct protocol_dcb_data roce_dcb_data /* core roce related fields */;
1795         struct protocol_dcb_data rroce_dcb_data /* core roce related fields */;
1796         struct protocol_dcb_data iwarp_dcb_data /* core iwarp related fields */;
1797         __le16 mf_vlan /* new outer vlan id value */;
1798         __le16 reserved;
1799         struct pf_update_tunnel_config tunnel_config /* tunnel configuration. */;
1800 };
1801
1802
1803
1804 /*
1805  * Ports mode
1806  */
1807 enum ports_mode
1808 {
1809         ENGX2_PORTX1 /* 2 engines x 1 port */,
1810         ENGX2_PORTX2 /* 2 engines x 2 ports */,
1811         ENGX1_PORTX1 /* 1 engine  x 1 port */,
1812         ENGX1_PORTX2 /* 1 engine  x 2 ports */,
1813         ENGX1_PORTX4 /* 1 engine  x 4 ports */,
1814         MAX_PORTS_MODE
1815 };
1816
1817
1818
1819 /*
1820  * use to index in hsi_fp_[major|minor]_ver_arr per protocol
1821  */
1822 enum protocol_version_array_key
1823 {
1824         ETH_VER_KEY=0,
1825         ROCE_VER_KEY,
1826         MAX_PROTOCOL_VERSION_ARRAY_KEY
1827 };
1828
1829
1830
1831 /*
1832  * RDMA TX Stats
1833  */
1834 struct rdma_sent_stats
1835 {
1836         struct regpair sent_bytes /* number of total RDMA bytes sent */;
1837         struct regpair sent_pkts /* number of total RDMA packets sent */;
1838 };
1839
1840 /*
1841  * Pstorm non-triggering VF zone
1842  */
1843 struct pstorm_non_trigger_vf_zone
1844 {
1845         struct eth_pstorm_per_queue_stat eth_queue_stat /* VF statistic bucket */;
1846         struct rdma_sent_stats rdma_stats /* RoCE sent statistics */;
1847 };
1848
1849
1850 /*
1851  * Pstorm VF zone
1852  */
1853 struct pstorm_vf_zone
1854 {
1855         struct pstorm_non_trigger_vf_zone non_trigger /* non-interrupt-triggering zone */;
1856         struct regpair reserved[7] /* vf_zone size mus be power of 2 */;
1857 };
1858
1859
1860 /*
1861  * Ramrod Header of SPQE
1862  */
1863 struct ramrod_header
1864 {
1865         __le32 cid /* Slowpath Connection CID */;
1866         u8 cmd_id /* Ramrod Cmd (Per Protocol Type) */;
1867         u8 protocol_id /* Ramrod Protocol ID */;
1868         __le16 echo /* Ramrod echo */;
1869 };
1870
1871
1872 /*
1873  * RDMA RX Stats
1874  */
1875 struct rdma_rcv_stats
1876 {
1877         struct regpair rcv_bytes /* number of total RDMA bytes received */;
1878         struct regpair rcv_pkts /* number of total RDMA packets received */;
1879 };
1880
1881
1882
1883 /*
1884  * Data for update QCN/DCQCN RL ramrod
1885  */
1886 struct rl_update_ramrod_data
1887 {
1888         u8 qcn_update_param_flg /* Update QCN global params: timeout. */;
1889         u8 dcqcn_update_param_flg /* Update DCQCN global params: timeout, g, k. */;
1890         u8 rl_init_flg /* Init RL parameters, when RL disabled. */;
1891         u8 rl_start_flg /* Start RL in IDLE state. Set rate to maximum. */;
1892         u8 rl_stop_flg /* Stop RL. */;
1893         u8 rl_id_first /* ID of first or single RL, that will be updated. */;
1894         u8 rl_id_last /* ID of last RL, that will be updated. If clear, single RL will updated. */;
1895         u8 rl_dc_qcn_flg /* If set, RL will used for DCQCN. */;
1896         __le32 rl_bc_rate /* Byte Counter Limit. */;
1897         __le16 rl_max_rate /* Maximum rate in 1.6 Mbps resolution. */;
1898         __le16 rl_r_ai /* Active increase rate. */;
1899         __le16 rl_r_hai /* Hyper active increase rate. */;
1900         __le16 dcqcn_g /* DCQCN Alpha update gain in 1/64K resolution . */;
1901         __le32 dcqcn_k_us /* DCQCN Alpha update interval. */;
1902         __le32 dcqcn_timeuot_us /* DCQCN timeout. */;
1903         __le32 qcn_timeuot_us /* QCN timeout. */;
1904         __le32 reserved[2];
1905 };
1906
1907
1908 /*
1909  * Slowpath Element (SPQE)
1910  */
1911 struct slow_path_element
1912 {
1913         struct ramrod_header hdr /* Ramrod Header */;
1914         struct regpair data_ptr /* Pointer to the Ramrod Data on the Host */;
1915 };
1916
1917
1918 /*
1919  * Tstorm non-triggering VF zone
1920  */
1921 struct tstorm_non_trigger_vf_zone
1922 {
1923         struct rdma_rcv_stats rdma_stats /* RoCE received statistics */;
1924 };
1925
1926
1927 struct tstorm_per_port_stat
1928 {
1929         struct regpair trunc_error_discard /* packet is dropped because it was truncated in NIG */;
1930         struct regpair mac_error_discard /* packet is dropped because of Ethernet FCS error */;
1931         struct regpair mftag_filter_discard /* packet is dropped because classification was unsuccessful */;
1932         struct regpair eth_mac_filter_discard /* packet was passed to Ethernet and dropped because of no mac filter match */;
1933         struct regpair ll2_mac_filter_discard /* packet passed to Light L2 and dropped because Light L2 is not configured for this PF */;
1934         struct regpair ll2_conn_disabled_discard /* packet passed to Light L2 and dropped because Light L2 is not configured for this PF */;
1935         struct regpair iscsi_irregular_pkt /* packet is an ISCSI irregular packet */;
1936         struct regpair fcoe_irregular_pkt /* packet is an FCOE irregular packet */;
1937         struct regpair roce_irregular_pkt /* packet is an ROCE irregular packet */;
1938         struct regpair iwarp_irregular_pkt /* packet is an IWARP irregular packet */;
1939         struct regpair eth_irregular_pkt /* packet is an ETH irregular packet */;
1940         struct regpair toe_irregular_pkt /* packet is an TOE irregular packet */;
1941         struct regpair preroce_irregular_pkt /* packet is an PREROCE irregular packet */;
1942         struct regpair eth_gre_tunn_filter_discard /* GRE dropped packets */;
1943         struct regpair eth_vxlan_tunn_filter_discard /* VXLAN dropped packets */;
1944         struct regpair eth_geneve_tunn_filter_discard /* GENEVE dropped packets */;
1945 };
1946
1947
1948 /*
1949  * Tstorm VF zone
1950  */
1951 struct tstorm_vf_zone
1952 {
1953         struct tstorm_non_trigger_vf_zone non_trigger /* non-interrupt-triggering zone */;
1954 };
1955
1956
1957 /*
1958  * Tunnel classification scheme
1959  */
1960 enum tunnel_clss
1961 {
1962         TUNNEL_CLSS_MAC_VLAN=0 /* Use MAC and VLAN from first L2 header for vport classification. */,
1963         TUNNEL_CLSS_MAC_VNI /* Use MAC from first L2 header and VNI from tunnel header for vport classification */,
1964         TUNNEL_CLSS_INNER_MAC_VLAN /* Use MAC and VLAN from last L2 header for vport classification */,
1965         TUNNEL_CLSS_INNER_MAC_VNI /* Use MAC from last L2 header and VNI from tunnel header for vport classification */,
1966         TUNNEL_CLSS_MAC_VLAN_DUAL_STAGE /* Use MAC and VLAN from last L2 header for vport classification. If no exact match, use MAC and VLAN from first L2 header for classification. */,
1967         MAX_TUNNEL_CLSS
1968 };
1969
1970
1971
1972 /*
1973  * Ustorm non-triggering VF zone
1974  */
1975 struct ustorm_non_trigger_vf_zone
1976 {
1977         struct eth_ustorm_per_queue_stat eth_queue_stat /* VF statistic bucket */;
1978         struct regpair vf_pf_msg_addr /* VF-PF message address */;
1979 };
1980
1981
1982 /*
1983  * Ustorm triggering VF zone
1984  */
1985 struct ustorm_trigger_vf_zone
1986 {
1987         u8 vf_pf_msg_valid /* VF-PF message valid flag */;
1988         u8 reserved[7];
1989 };
1990
1991
1992 /*
1993  * Ustorm VF zone
1994  */
1995 struct ustorm_vf_zone
1996 {
1997         struct ustorm_non_trigger_vf_zone non_trigger /* non-interrupt-triggering zone */;
1998         struct ustorm_trigger_vf_zone trigger /* interrupt triggering zone */;
1999 };
2000
2001
2002 /*
2003  * VF-PF channel data
2004  */
2005 struct vf_pf_channel_data
2006 {
2007         __le32 ready /* 0: VF-PF Channel NOT ready. Waiting for ack from PF driver. 1: VF-PF Channel is ready for a new transaction. */;
2008         u8 valid /* 0: VF-PF Channel is invalid because of malicious VF. 1: VF-PF Channel is valid. */;
2009         u8 reserved0;
2010         __le16 reserved1;
2011 };
2012
2013
2014 /*
2015  * Ramrod data for VF start ramrod
2016  */
2017 struct vf_start_ramrod_data
2018 {
2019         u8 vf_id /* VF ID */;
2020         u8 enable_flr_ack /* If set, initial cleanup ack will be sent to parent PF SP event queue */;
2021         __le16 opaque_fid /* VF opaque FID */;
2022         u8 personality /* define what type of personality is new VF */;
2023         u8 reserved[7];
2024         struct hsi_fp_ver_struct hsi_fp_ver /* FP HSI version to be used by FW */;
2025 };
2026
2027
2028 /*
2029  * Ramrod data for VF start ramrod
2030  */
2031 struct vf_stop_ramrod_data
2032 {
2033         u8 vf_id /* VF ID */;
2034         u8 reserved0;
2035         __le16 reserved1;
2036         __le32 reserved2;
2037 };
2038
2039
2040 /*
2041  * VF zone size mode.
2042  */
2043 enum vf_zone_size_mode
2044 {
2045         VF_ZONE_SIZE_MODE_DEFAULT /* Default VF zone size. Up to 192 VF supported. */,
2046         VF_ZONE_SIZE_MODE_DOUBLE /* Doubled VF zone size. Up to 96 VF supported. */,
2047         VF_ZONE_SIZE_MODE_QUAD /* Quad VF zone size. Up to 48 VF supported. */,
2048         MAX_VF_ZONE_SIZE_MODE
2049 };
2050
2051
2052
2053
2054 /*
2055  * Attentions status block
2056  */
2057 struct atten_status_block
2058 {
2059         __le32 atten_bits;
2060         __le32 atten_ack;
2061         __le16 reserved0;
2062         __le16 sb_index /* status block running index */;
2063         __le32 reserved1;
2064 };
2065
2066
2067 /*
2068  * Igu cleanup bit values to distinguish between clean or producer consumer update.
2069  */
2070 enum command_type_bit
2071 {
2072         IGU_COMMAND_TYPE_NOP=0,
2073         IGU_COMMAND_TYPE_SET=1,
2074         MAX_COMMAND_TYPE_BIT
2075 };
2076
2077
2078 /*
2079  * DMAE command
2080  */
2081 struct dmae_cmd
2082 {
2083         __le32 opcode;
2084 #define DMAE_CMD_SRC_MASK              0x1 /* DMA Source. 0 - PCIe, 1 - GRC (use enum dmae_cmd_src_enum) */
2085 #define DMAE_CMD_SRC_SHIFT             0
2086 #define DMAE_CMD_DST_MASK              0x3 /* DMA destination. 0 - None, 1 - PCIe, 2 - GRC, 3 - None (use enum dmae_cmd_dst_enum) */
2087 #define DMAE_CMD_DST_SHIFT             1
2088 #define DMAE_CMD_C_DST_MASK            0x1 /* Completion destination. 0 - PCie, 1 - GRC (use enum dmae_cmd_c_dst_enum) */
2089 #define DMAE_CMD_C_DST_SHIFT           3
2090 #define DMAE_CMD_CRC_RESET_MASK        0x1 /* Reset the CRC result (do not use the previous result as the seed) */
2091 #define DMAE_CMD_CRC_RESET_SHIFT       4
2092 #define DMAE_CMD_SRC_ADDR_RESET_MASK   0x1 /* Reset the source address in the next go to the same source address of the previous go */
2093 #define DMAE_CMD_SRC_ADDR_RESET_SHIFT  5
2094 #define DMAE_CMD_DST_ADDR_RESET_MASK   0x1 /* Reset the destination address in the next go to the same destination address of the previous go */
2095 #define DMAE_CMD_DST_ADDR_RESET_SHIFT  6
2096 #define DMAE_CMD_COMP_FUNC_MASK        0x1 /* 0   completion function is the same as src function, 1 - 0   completion function is the same as dst function (use enum dmae_cmd_comp_func_enum) */
2097 #define DMAE_CMD_COMP_FUNC_SHIFT       7
2098 #define DMAE_CMD_COMP_WORD_EN_MASK     0x1 /* 0 - Do not write a completion word, 1 - Write a completion word (use enum dmae_cmd_comp_word_en_enum) */
2099 #define DMAE_CMD_COMP_WORD_EN_SHIFT    8
2100 #define DMAE_CMD_COMP_CRC_EN_MASK      0x1 /* 0 - Do not write a CRC word, 1 - Write a CRC word (use enum dmae_cmd_comp_crc_en_enum) */
2101 #define DMAE_CMD_COMP_CRC_EN_SHIFT     9
2102 #define DMAE_CMD_COMP_CRC_OFFSET_MASK  0x7 /* The CRC word should be taken from the DMAE address space from address 9+X, where X is the value in these bits. */
2103 #define DMAE_CMD_COMP_CRC_OFFSET_SHIFT 10
2104 #define DMAE_CMD_RESERVED1_MASK        0x1
2105 #define DMAE_CMD_RESERVED1_SHIFT       13
2106 #define DMAE_CMD_ENDIANITY_MODE_MASK   0x3
2107 #define DMAE_CMD_ENDIANITY_MODE_SHIFT  14
2108 #define DMAE_CMD_ERR_HANDLING_MASK     0x3 /* The field specifies how the completion word is affected by PCIe read error. 0   Send a regular completion, 1 - Send a completion with an error indication, 2   do not send a completion (use enum dmae_cmd_error_handling_enum) */
2109 #define DMAE_CMD_ERR_HANDLING_SHIFT    16
2110 #define DMAE_CMD_PORT_ID_MASK          0x3 /* The port ID to be placed on the  RF FID  field of the GRC bus. this field is used both when GRC is the destination and when it is the source of the DMAE transaction. */
2111 #define DMAE_CMD_PORT_ID_SHIFT         18
2112 #define DMAE_CMD_SRC_PF_ID_MASK        0xF /* Source PCI function number [3:0] */
2113 #define DMAE_CMD_SRC_PF_ID_SHIFT       20
2114 #define DMAE_CMD_DST_PF_ID_MASK        0xF /* Destination PCI function number [3:0] */
2115 #define DMAE_CMD_DST_PF_ID_SHIFT       24
2116 #define DMAE_CMD_SRC_VF_ID_VALID_MASK  0x1 /* Source VFID valid */
2117 #define DMAE_CMD_SRC_VF_ID_VALID_SHIFT 28
2118 #define DMAE_CMD_DST_VF_ID_VALID_MASK  0x1 /* Destination VFID valid */
2119 #define DMAE_CMD_DST_VF_ID_VALID_SHIFT 29
2120 #define DMAE_CMD_RESERVED2_MASK        0x3
2121 #define DMAE_CMD_RESERVED2_SHIFT       30
2122         __le32 src_addr_lo /* PCIe source address low in bytes or GRC source address in DW */;
2123         __le32 src_addr_hi /* PCIe source address high in bytes or reserved (if source is GRC) */;
2124         __le32 dst_addr_lo /* PCIe destination address low in bytes or GRC destination address in DW */;
2125         __le32 dst_addr_hi /* PCIe destination address high in bytes or reserved (if destination is GRC) */;
2126         __le16 length_dw /* Length in DW */;
2127         __le16 opcode_b;
2128 #define DMAE_CMD_SRC_VF_ID_MASK        0xFF /* Source VF id */
2129 #define DMAE_CMD_SRC_VF_ID_SHIFT       0
2130 #define DMAE_CMD_DST_VF_ID_MASK        0xFF /* Destination VF id */
2131 #define DMAE_CMD_DST_VF_ID_SHIFT       8
2132         __le32 comp_addr_lo /* PCIe completion address low in bytes or GRC completion address in DW */;
2133         __le32 comp_addr_hi /* PCIe completion address high in bytes or reserved (if completion address is GRC) */;
2134         __le32 comp_val /* Value to write to completion address */;
2135         __le32 crc32 /* crc16 result */;
2136         __le32 crc_32_c /* crc32_c result */;
2137         __le16 crc16 /* crc16 result */;
2138         __le16 crc16_c /* crc16_c result */;
2139         __le16 crc10 /* crc_t10 result */;
2140         __le16 reserved;
2141         __le16 xsum16 /* checksum16 result  */;
2142         __le16 xsum8 /* checksum8 result  */;
2143 };
2144
2145
2146 enum dmae_cmd_comp_crc_en_enum
2147 {
2148         dmae_cmd_comp_crc_disabled /* Do not write a CRC word */,
2149         dmae_cmd_comp_crc_enabled /* Write a CRC word */,
2150         MAX_DMAE_CMD_COMP_CRC_EN_ENUM
2151 };
2152
2153
2154 enum dmae_cmd_comp_func_enum
2155 {
2156         dmae_cmd_comp_func_to_src /* completion word and/or CRC will be sent to SRC-PCI function/SRC VFID */,
2157         dmae_cmd_comp_func_to_dst /* completion word and/or CRC will be sent to DST-PCI function/DST VFID */,
2158         MAX_DMAE_CMD_COMP_FUNC_ENUM
2159 };
2160
2161
2162 enum dmae_cmd_comp_word_en_enum
2163 {
2164         dmae_cmd_comp_word_disabled /* Do not write a completion word */,
2165         dmae_cmd_comp_word_enabled /* Write the completion word */,
2166         MAX_DMAE_CMD_COMP_WORD_EN_ENUM
2167 };
2168
2169
2170 enum dmae_cmd_c_dst_enum
2171 {
2172         dmae_cmd_c_dst_pcie,
2173         dmae_cmd_c_dst_grc,
2174         MAX_DMAE_CMD_C_DST_ENUM
2175 };
2176
2177
2178 enum dmae_cmd_dst_enum
2179 {
2180         dmae_cmd_dst_none_0,
2181         dmae_cmd_dst_pcie,
2182         dmae_cmd_dst_grc,
2183         dmae_cmd_dst_none_3,
2184         MAX_DMAE_CMD_DST_ENUM
2185 };
2186
2187
2188 enum dmae_cmd_error_handling_enum
2189 {
2190         dmae_cmd_error_handling_send_regular_comp /* Send a regular completion (with no error indication) */,
2191         dmae_cmd_error_handling_send_comp_with_err /* Send a completion with an error indication (i.e. set bit 31 of the completion word) */,
2192         dmae_cmd_error_handling_dont_send_comp /* Do not send a completion */,
2193         MAX_DMAE_CMD_ERROR_HANDLING_ENUM
2194 };
2195
2196
2197 enum dmae_cmd_src_enum
2198 {
2199         dmae_cmd_src_pcie /* The source is the PCIe */,
2200         dmae_cmd_src_grc /* The source is the GRC */,
2201         MAX_DMAE_CMD_SRC_ENUM
2202 };
2203
2204
2205 struct e4_mstorm_core_conn_ag_ctx
2206 {
2207         u8 byte0 /* cdu_validation */;
2208         u8 byte1 /* state */;
2209         u8 flags0;
2210 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
2211 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
2212 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
2213 #define E4_MSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
2214 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* cf0 */
2215 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
2216 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* cf1 */
2217 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
2218 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* cf2 */
2219 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
2220         u8 flags1;
2221 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
2222 #define E4_MSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
2223 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
2224 #define E4_MSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
2225 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
2226 #define E4_MSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
2227 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
2228 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 3
2229 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
2230 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 4
2231 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
2232 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 5
2233 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
2234 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 6
2235 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
2236 #define E4_MSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 7
2237         __le16 word0 /* word0 */;
2238         __le16 word1 /* word1 */;
2239         __le32 reg0 /* reg0 */;
2240         __le32 reg1 /* reg1 */;
2241 };
2242
2243
2244
2245
2246
2247 struct e4_ystorm_core_conn_ag_ctx
2248 {
2249         u8 byte0 /* cdu_validation */;
2250         u8 byte1 /* state */;
2251         u8 flags0;
2252 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
2253 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
2254 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
2255 #define E4_YSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
2256 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* cf0 */
2257 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
2258 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* cf1 */
2259 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
2260 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* cf2 */
2261 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
2262         u8 flags1;
2263 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
2264 #define E4_YSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
2265 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
2266 #define E4_YSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
2267 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
2268 #define E4_YSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
2269 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
2270 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 3
2271 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
2272 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 4
2273 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
2274 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 5
2275 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
2276 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 6
2277 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
2278 #define E4_YSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 7
2279         u8 byte2 /* byte2 */;
2280         u8 byte3 /* byte3 */;
2281         __le16 word0 /* word0 */;
2282         __le32 reg0 /* reg0 */;
2283         __le32 reg1 /* reg1 */;
2284         __le16 word1 /* word1 */;
2285         __le16 word2 /* word2 */;
2286         __le16 word3 /* word3 */;
2287         __le16 word4 /* word4 */;
2288         __le32 reg2 /* reg2 */;
2289         __le32 reg3 /* reg3 */;
2290 };
2291
2292
2293 struct e5_mstorm_core_conn_ag_ctx
2294 {
2295         u8 byte0 /* cdu_validation */;
2296         u8 byte1 /* state_and_core_id */;
2297         u8 flags0;
2298 #define E5_MSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
2299 #define E5_MSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
2300 #define E5_MSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
2301 #define E5_MSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
2302 #define E5_MSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* cf0 */
2303 #define E5_MSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
2304 #define E5_MSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* cf1 */
2305 #define E5_MSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
2306 #define E5_MSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* cf2 */
2307 #define E5_MSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
2308         u8 flags1;
2309 #define E5_MSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
2310 #define E5_MSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
2311 #define E5_MSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
2312 #define E5_MSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
2313 #define E5_MSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
2314 #define E5_MSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
2315 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
2316 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 3
2317 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
2318 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 4
2319 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
2320 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 5
2321 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
2322 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 6
2323 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
2324 #define E5_MSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 7
2325         __le16 word0 /* word0 */;
2326         __le16 word1 /* word1 */;
2327         __le32 reg0 /* reg0 */;
2328         __le32 reg1 /* reg1 */;
2329 };
2330
2331
2332
2333
2334
2335 struct e5_ystorm_core_conn_ag_ctx
2336 {
2337         u8 byte0 /* cdu_validation */;
2338         u8 byte1 /* state_and_core_id */;
2339         u8 flags0;
2340 #define E5_YSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1 /* exist_in_qm0 */
2341 #define E5_YSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
2342 #define E5_YSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1 /* exist_in_qm1 */
2343 #define E5_YSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
2344 #define E5_YSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3 /* cf0 */
2345 #define E5_YSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
2346 #define E5_YSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3 /* cf1 */
2347 #define E5_YSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
2348 #define E5_YSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3 /* cf2 */
2349 #define E5_YSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
2350         u8 flags1;
2351 #define E5_YSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1 /* cf0en */
2352 #define E5_YSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
2353 #define E5_YSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1 /* cf1en */
2354 #define E5_YSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
2355 #define E5_YSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1 /* cf2en */
2356 #define E5_YSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
2357 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1 /* rule0en */
2358 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 3
2359 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1 /* rule1en */
2360 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 4
2361 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1 /* rule2en */
2362 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 5
2363 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1 /* rule3en */
2364 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 6
2365 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1 /* rule4en */
2366 #define E5_YSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 7
2367         u8 byte2 /* byte2 */;
2368         u8 byte3 /* byte3 */;
2369         __le16 word0 /* word0 */;
2370         __le32 reg0 /* reg0 */;
2371         __le32 reg1 /* reg1 */;
2372         __le16 word1 /* word1 */;
2373         __le16 word2 /* word2 */;
2374         __le16 word3 /* word3 */;
2375         __le16 word4 /* word4 */;
2376         __le32 reg2 /* reg2 */;
2377         __le32 reg3 /* reg3 */;
2378 };
2379
2380
2381 /*
2382  * IGU cleanup command
2383  */
2384 struct igu_cleanup
2385 {
2386         __le32 sb_id_and_flags;
2387 #define IGU_CLEANUP_RESERVED0_MASK     0x7FFFFFF
2388 #define IGU_CLEANUP_RESERVED0_SHIFT    0
2389 #define IGU_CLEANUP_CLEANUP_SET_MASK   0x1 /* cleanup clear - 0, set - 1 */
2390 #define IGU_CLEANUP_CLEANUP_SET_SHIFT  27
2391 #define IGU_CLEANUP_CLEANUP_TYPE_MASK  0x7
2392 #define IGU_CLEANUP_CLEANUP_TYPE_SHIFT 28
2393 #define IGU_CLEANUP_COMMAND_TYPE_MASK  0x1 /* must always be set (use enum command_type_bit) */
2394 #define IGU_CLEANUP_COMMAND_TYPE_SHIFT 31
2395         __le32 reserved1;
2396 };
2397
2398
2399 /*
2400  * IGU firmware driver command
2401  */
2402 union igu_command
2403 {
2404         struct igu_prod_cons_update prod_cons_update;
2405         struct igu_cleanup cleanup;
2406 };
2407
2408
2409 /*
2410  * IGU firmware driver command
2411  */
2412 struct igu_command_reg_ctrl
2413 {
2414         __le16 opaque_fid;
2415         __le16 igu_command_reg_ctrl_fields;
2416 #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_MASK  0xFFF
2417 #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_SHIFT 0
2418 #define IGU_COMMAND_REG_CTRL_RESERVED_MASK      0x7
2419 #define IGU_COMMAND_REG_CTRL_RESERVED_SHIFT     12
2420 #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_MASK  0x1 /* command typ: 0 - read, 1 - write */
2421 #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_SHIFT 15
2422 };
2423
2424
2425 /*
2426  * IGU mapping line structure
2427  */
2428 struct igu_mapping_line
2429 {
2430         __le32 igu_mapping_line_fields;
2431 #define IGU_MAPPING_LINE_VALID_MASK            0x1
2432 #define IGU_MAPPING_LINE_VALID_SHIFT           0
2433 #define IGU_MAPPING_LINE_VECTOR_NUMBER_MASK    0xFF
2434 #define IGU_MAPPING_LINE_VECTOR_NUMBER_SHIFT   1
2435 #define IGU_MAPPING_LINE_FUNCTION_NUMBER_MASK  0xFF /* In BB: VF-0-120, PF-0-7; In K2: VF-0-191, PF-0-15 */
2436 #define IGU_MAPPING_LINE_FUNCTION_NUMBER_SHIFT 9
2437 #define IGU_MAPPING_LINE_PF_VALID_MASK         0x1 /* PF-1, VF-0 */
2438 #define IGU_MAPPING_LINE_PF_VALID_SHIFT        17
2439 #define IGU_MAPPING_LINE_IPS_GROUP_MASK        0x3F
2440 #define IGU_MAPPING_LINE_IPS_GROUP_SHIFT       18
2441 #define IGU_MAPPING_LINE_RESERVED_MASK         0xFF
2442 #define IGU_MAPPING_LINE_RESERVED_SHIFT        24
2443 };
2444
2445
2446 /*
2447  * IGU MSIX line structure
2448  */
2449 struct igu_msix_vector
2450 {
2451         struct regpair address;
2452         __le32 data;
2453         __le32 msix_vector_fields;
2454 #define IGU_MSIX_VECTOR_MASK_BIT_MASK      0x1
2455 #define IGU_MSIX_VECTOR_MASK_BIT_SHIFT     0
2456 #define IGU_MSIX_VECTOR_RESERVED0_MASK     0x7FFF
2457 #define IGU_MSIX_VECTOR_RESERVED0_SHIFT    1
2458 #define IGU_MSIX_VECTOR_STEERING_TAG_MASK  0xFF
2459 #define IGU_MSIX_VECTOR_STEERING_TAG_SHIFT 16
2460 #define IGU_MSIX_VECTOR_RESERVED1_MASK     0xFF
2461 #define IGU_MSIX_VECTOR_RESERVED1_SHIFT    24
2462 };
2463
2464
2465 /*
2466  * per encapsulation type enabling flags
2467  */
2468 struct prs_reg_encapsulation_type_en
2469 {
2470         u8 flags;
2471 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_MASK     0x1 /* Enable bit for Ethernet-over-GRE (L2 GRE) encapsulation. */
2472 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_SHIFT    0
2473 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_MASK      0x1 /* Enable bit for IP-over-GRE (IP GRE) encapsulation. */
2474 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_SHIFT     1
2475 #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_MASK            0x1 /* Enable bit for VXLAN encapsulation. */
2476 #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_SHIFT           2
2477 #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_MASK            0x1 /* Enable bit for T-Tag encapsulation. */
2478 #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_SHIFT           3
2479 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_MASK  0x1 /* Enable bit for Ethernet-over-GENEVE (L2 GENEVE) encapsulation. */
2480 #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_SHIFT 4
2481 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_MASK   0x1 /* Enable bit for IP-over-GENEVE (IP GENEVE) encapsulation. */
2482 #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_SHIFT  5
2483 #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_MASK                0x3
2484 #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_SHIFT               6
2485 };
2486
2487
2488 enum pxp_tph_st_hint
2489 {
2490         TPH_ST_HINT_BIDIR /* Read/Write access by Host and Device */,
2491         TPH_ST_HINT_REQUESTER /* Read/Write access by Device */,
2492         TPH_ST_HINT_TARGET /* Device Write and Host Read, or Host Write and Device Read */,
2493         TPH_ST_HINT_TARGET_PRIO /* Device Write and Host Read, or Host Write and Device Read - with temporal reuse */,
2494         MAX_PXP_TPH_ST_HINT
2495 };
2496
2497
2498 /*
2499  * QM hardware structure of enable bypass credit mask
2500  */
2501 struct qm_rf_bypass_mask
2502 {
2503         u8 flags;
2504 #define QM_RF_BYPASS_MASK_LINEVOQ_MASK    0x1
2505 #define QM_RF_BYPASS_MASK_LINEVOQ_SHIFT   0
2506 #define QM_RF_BYPASS_MASK_RESERVED0_MASK  0x1
2507 #define QM_RF_BYPASS_MASK_RESERVED0_SHIFT 1
2508 #define QM_RF_BYPASS_MASK_PFWFQ_MASK      0x1
2509 #define QM_RF_BYPASS_MASK_PFWFQ_SHIFT     2
2510 #define QM_RF_BYPASS_MASK_VPWFQ_MASK      0x1
2511 #define QM_RF_BYPASS_MASK_VPWFQ_SHIFT     3
2512 #define QM_RF_BYPASS_MASK_PFRL_MASK       0x1
2513 #define QM_RF_BYPASS_MASK_PFRL_SHIFT      4
2514 #define QM_RF_BYPASS_MASK_VPQCNRL_MASK    0x1
2515 #define QM_RF_BYPASS_MASK_VPQCNRL_SHIFT   5
2516 #define QM_RF_BYPASS_MASK_FWPAUSE_MASK    0x1
2517 #define QM_RF_BYPASS_MASK_FWPAUSE_SHIFT   6
2518 #define QM_RF_BYPASS_MASK_RESERVED1_MASK  0x1
2519 #define QM_RF_BYPASS_MASK_RESERVED1_SHIFT 7
2520 };
2521
2522
2523 /*
2524  * QM hardware structure of opportunistic credit mask
2525  */
2526 struct qm_rf_opportunistic_mask
2527 {
2528         __le16 flags;
2529 #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_MASK     0x1
2530 #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_SHIFT    0
2531 #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_MASK     0x1
2532 #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_SHIFT    1
2533 #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_MASK       0x1
2534 #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_SHIFT      2
2535 #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_MASK       0x1
2536 #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_SHIFT      3
2537 #define QM_RF_OPPORTUNISTIC_MASK_PFRL_MASK        0x1
2538 #define QM_RF_OPPORTUNISTIC_MASK_PFRL_SHIFT       4
2539 #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_MASK     0x1
2540 #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_SHIFT    5
2541 #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_MASK     0x1
2542 #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_SHIFT    6
2543 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_MASK   0x1
2544 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_SHIFT  7
2545 #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_MASK  0x1
2546 #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_SHIFT 8
2547 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_MASK   0x7F
2548 #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_SHIFT  9
2549 };
2550
2551
2552 /*
2553  * E4 QM hardware structure of QM map memory
2554  */
2555 struct qm_rf_pq_map_e4
2556 {
2557         __le32 reg;
2558 #define QM_RF_PQ_MAP_E4_PQ_VALID_MASK          0x1 /* PQ active */
2559 #define QM_RF_PQ_MAP_E4_PQ_VALID_SHIFT         0
2560 #define QM_RF_PQ_MAP_E4_RL_ID_MASK             0xFF /* RL ID */
2561 #define QM_RF_PQ_MAP_E4_RL_ID_SHIFT            1
2562 #define QM_RF_PQ_MAP_E4_VP_PQ_ID_MASK          0x1FF /* the first PQ associated with the VPORT and VOQ of this PQ */
2563 #define QM_RF_PQ_MAP_E4_VP_PQ_ID_SHIFT         9
2564 #define QM_RF_PQ_MAP_E4_VOQ_MASK               0x1F /* VOQ */
2565 #define QM_RF_PQ_MAP_E4_VOQ_SHIFT              18
2566 #define QM_RF_PQ_MAP_E4_WRR_WEIGHT_GROUP_MASK  0x3 /* WRR weight */
2567 #define QM_RF_PQ_MAP_E4_WRR_WEIGHT_GROUP_SHIFT 23
2568 #define QM_RF_PQ_MAP_E4_RL_VALID_MASK          0x1 /* RL active */
2569 #define QM_RF_PQ_MAP_E4_RL_VALID_SHIFT         25
2570 #define QM_RF_PQ_MAP_E4_RESERVED_MASK          0x3F
2571 #define QM_RF_PQ_MAP_E4_RESERVED_SHIFT         26
2572 };
2573
2574
2575 /*
2576  * E5 QM hardware structure of QM map memory
2577  */
2578 struct qm_rf_pq_map_e5
2579 {
2580         __le32 reg;
2581 #define QM_RF_PQ_MAP_E5_PQ_VALID_MASK          0x1 /* PQ active */
2582 #define QM_RF_PQ_MAP_E5_PQ_VALID_SHIFT         0
2583 #define QM_RF_PQ_MAP_E5_RL_ID_MASK             0xFF /* RL ID */
2584 #define QM_RF_PQ_MAP_E5_RL_ID_SHIFT            1
2585 #define QM_RF_PQ_MAP_E5_VP_PQ_ID_MASK          0x1FF /* the first PQ associated with the VPORT and VOQ of this PQ */
2586 #define QM_RF_PQ_MAP_E5_VP_PQ_ID_SHIFT         9
2587 #define QM_RF_PQ_MAP_E5_VOQ_MASK               0x3F /* VOQ */
2588 #define QM_RF_PQ_MAP_E5_VOQ_SHIFT              18
2589 #define QM_RF_PQ_MAP_E5_WRR_WEIGHT_GROUP_MASK  0x3 /* WRR weight */
2590 #define QM_RF_PQ_MAP_E5_WRR_WEIGHT_GROUP_SHIFT 24
2591 #define QM_RF_PQ_MAP_E5_RL_VALID_MASK          0x1 /* RL active */
2592 #define QM_RF_PQ_MAP_E5_RL_VALID_SHIFT         26
2593 #define QM_RF_PQ_MAP_E5_RESERVED_MASK          0x1F
2594 #define QM_RF_PQ_MAP_E5_RESERVED_SHIFT         27
2595 };
2596
2597
2598 /*
2599  * Completion params for aggregated interrupt completion
2600  */
2601 struct sdm_agg_int_comp_params
2602 {
2603         __le16 params;
2604 #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_MASK      0x3F /* the number of aggregated interrupt, 0-31 */
2605 #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_SHIFT     0
2606 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_MASK  0x1 /* 1 - set a bit in aggregated vector, 0 - dont set */
2607 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_SHIFT 6
2608 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_MASK     0x1FF /* Number of bit in the aggregated vector, 0-279 (TBD) */
2609 #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_SHIFT    7
2610 };
2611
2612
2613 /*
2614  * SDM operation gen command (generate aggregative interrupt)
2615  */
2616 struct sdm_op_gen
2617 {
2618         __le32 command;
2619 #define SDM_OP_GEN_COMP_PARAM_MASK  0xFFFF /* completion parameters 0-15 */
2620 #define SDM_OP_GEN_COMP_PARAM_SHIFT 0
2621 #define SDM_OP_GEN_COMP_TYPE_MASK   0xF /* completion type 16-19 */
2622 #define SDM_OP_GEN_COMP_TYPE_SHIFT  16
2623 #define SDM_OP_GEN_RESERVED_MASK    0xFFF /* reserved 20-31 */
2624 #define SDM_OP_GEN_RESERVED_SHIFT   20
2625 };
2626
2627 #endif /* __ECORE_HSI_COMMON__ */