1*25730d8bSEdward Cree /* SPDX-License-Identifier: GPL-2.0-only */
2*25730d8bSEdward Cree /****************************************************************************
3*25730d8bSEdward Cree  * Driver for Solarflare network controllers and boards
4*25730d8bSEdward Cree  * Copyright 2020 Xilinx, Inc.
5*25730d8bSEdward Cree  *
6*25730d8bSEdward Cree  * This program is free software; you can redistribute it and/or modify it
7*25730d8bSEdward Cree  * under the terms of the GNU General Public License version 2 as published
8*25730d8bSEdward Cree  * by the Free Software Foundation, incorporated herein by reference.
9*25730d8bSEdward Cree  */
10*25730d8bSEdward Cree 
11*25730d8bSEdward Cree /* Format of counter packets (version 2) from the ef100 Match-Action Engine */
12*25730d8bSEdward Cree 
13*25730d8bSEdward Cree #ifndef EFX_MAE_COUNTER_FORMAT_H
14*25730d8bSEdward Cree #define EFX_MAE_COUNTER_FORMAT_H
15*25730d8bSEdward Cree 
16*25730d8bSEdward Cree 
17*25730d8bSEdward Cree /*------------------------------------------------------------*/
18*25730d8bSEdward Cree /*
19*25730d8bSEdward Cree  * ER_RX_SL_PACKETISER_HEADER_WORD(160bit):
20*25730d8bSEdward Cree  *
21*25730d8bSEdward Cree  */
22*25730d8bSEdward Cree #define ER_RX_SL_PACKETISER_HEADER_WORD_SIZE 20
23*25730d8bSEdward Cree #define ER_RX_SL_PACKETISER_HEADER_WORD_WIDTH 160
24*25730d8bSEdward Cree 
25*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_VERSION_LBN 0
26*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_VERSION_WIDTH 8
27*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_VERSION_VALUE 2
28*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_LBN 8
29*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_WIDTH 8
30*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_AR 0
31*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_CT 1
32*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_IDENTIFIER_OR 2
33*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_LBN 16
34*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_WIDTH 8
35*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_HEADER_OFFSET_DEFAULT 0x4
36*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_LBN 24
37*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_WIDTH 8
38*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_PAYLOAD_OFFSET_DEFAULT 0x14
39*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_INDEX_LBN 32
40*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_INDEX_WIDTH 16
41*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_COUNT_LBN 48
42*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_COUNT_WIDTH 16
43*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_0_LBN 64
44*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_0_WIDTH 32
45*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_1_LBN 96
46*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_1_WIDTH 32
47*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_2_LBN 128
48*25730d8bSEdward Cree #define ERF_SC_PACKETISER_HEADER_RESERVED_2_WIDTH 32
49*25730d8bSEdward Cree 
50*25730d8bSEdward Cree 
51*25730d8bSEdward Cree /*------------------------------------------------------------*/
52*25730d8bSEdward Cree /*
53*25730d8bSEdward Cree  * ER_RX_SL_PACKETISER_PAYLOAD_WORD(128bit):
54*25730d8bSEdward Cree  *
55*25730d8bSEdward Cree  */
56*25730d8bSEdward Cree #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_SIZE 16
57*25730d8bSEdward Cree #define ER_RX_SL_PACKETISER_PAYLOAD_WORD_WIDTH 128
58*25730d8bSEdward Cree 
59*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_LBN 0
60*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_COUNTER_INDEX_WIDTH 24
61*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_LBN 24
62*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_RESERVED_WIDTH 8
63*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_OFST 4
64*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_SIZE 6
65*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_LBN 32
66*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_PACKET_COUNT_WIDTH 48
67*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_OFST 10
68*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_SIZE 6
69*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_LBN 80
70*25730d8bSEdward Cree #define ERF_SC_PACKETISER_PAYLOAD_BYTE_COUNT_WIDTH 48
71*25730d8bSEdward Cree 
72*25730d8bSEdward Cree 
73*25730d8bSEdward Cree #endif /* EFX_MAE_COUNTER_FORMAT_H */
74