1 
2 /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 #ifndef _CE_STAT_DESC_H_
27 #define _CE_STAT_DESC_H_
28 #if !defined(__ASSEMBLER__)
29 #endif
30 
31 #define NUM_OF_DWORDS_CE_STAT_DESC 4
32 
33 
34 struct ce_stat_desc {
35 #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
36              uint32_t ce_res_5                                                :  8,
37                       toeplitz_en                                             :  1,
38                       src_swap                                                :  1,
39                       dest_swap                                               :  1,
40                       gather                                                  :  1,
41                       barrier_read                                            :  1,
42                       ce_res_6                                                :  3,
43                       length                                                  : 16;
44              uint32_t toeplitz_hash_0                                         : 32;
45              uint32_t toeplitz_hash_1                                         : 32;
46              uint32_t fw_metadata                                             : 16,
47                       ce_res_7                                                :  4,
48                       ring_id                                                 :  8,
49                       looping_count                                           :  4;
50 #else
51              uint32_t length                                                  : 16,
52                       ce_res_6                                                :  3,
53                       barrier_read                                            :  1,
54                       gather                                                  :  1,
55                       dest_swap                                               :  1,
56                       src_swap                                                :  1,
57                       toeplitz_en                                             :  1,
58                       ce_res_5                                                :  8;
59              uint32_t toeplitz_hash_0                                         : 32;
60              uint32_t toeplitz_hash_1                                         : 32;
61              uint32_t looping_count                                           :  4,
62                       ring_id                                                 :  8,
63                       ce_res_7                                                :  4,
64                       fw_metadata                                             : 16;
65 #endif
66 };
67 
68 
69 
70 
71 #define CE_STAT_DESC_CE_RES_5_OFFSET                                                0x00000000
72 #define CE_STAT_DESC_CE_RES_5_LSB                                                   0
73 #define CE_STAT_DESC_CE_RES_5_MSB                                                   7
74 #define CE_STAT_DESC_CE_RES_5_MASK                                                  0x000000ff
75 
76 
77 
78 
79 #define CE_STAT_DESC_TOEPLITZ_EN_OFFSET                                             0x00000000
80 #define CE_STAT_DESC_TOEPLITZ_EN_LSB                                                8
81 #define CE_STAT_DESC_TOEPLITZ_EN_MSB                                                8
82 #define CE_STAT_DESC_TOEPLITZ_EN_MASK                                               0x00000100
83 
84 
85 
86 
87 #define CE_STAT_DESC_SRC_SWAP_OFFSET                                                0x00000000
88 #define CE_STAT_DESC_SRC_SWAP_LSB                                                   9
89 #define CE_STAT_DESC_SRC_SWAP_MSB                                                   9
90 #define CE_STAT_DESC_SRC_SWAP_MASK                                                  0x00000200
91 
92 
93 
94 
95 #define CE_STAT_DESC_DEST_SWAP_OFFSET                                               0x00000000
96 #define CE_STAT_DESC_DEST_SWAP_LSB                                                  10
97 #define CE_STAT_DESC_DEST_SWAP_MSB                                                  10
98 #define CE_STAT_DESC_DEST_SWAP_MASK                                                 0x00000400
99 
100 
101 
102 
103 #define CE_STAT_DESC_GATHER_OFFSET                                                  0x00000000
104 #define CE_STAT_DESC_GATHER_LSB                                                     11
105 #define CE_STAT_DESC_GATHER_MSB                                                     11
106 #define CE_STAT_DESC_GATHER_MASK                                                    0x00000800
107 
108 
109 
110 
111 #define CE_STAT_DESC_BARRIER_READ_OFFSET                                            0x00000000
112 #define CE_STAT_DESC_BARRIER_READ_LSB                                               12
113 #define CE_STAT_DESC_BARRIER_READ_MSB                                               12
114 #define CE_STAT_DESC_BARRIER_READ_MASK                                              0x00001000
115 
116 
117 
118 
119 #define CE_STAT_DESC_CE_RES_6_OFFSET                                                0x00000000
120 #define CE_STAT_DESC_CE_RES_6_LSB                                                   13
121 #define CE_STAT_DESC_CE_RES_6_MSB                                                   15
122 #define CE_STAT_DESC_CE_RES_6_MASK                                                  0x0000e000
123 
124 
125 
126 
127 #define CE_STAT_DESC_LENGTH_OFFSET                                                  0x00000000
128 #define CE_STAT_DESC_LENGTH_LSB                                                     16
129 #define CE_STAT_DESC_LENGTH_MSB                                                     31
130 #define CE_STAT_DESC_LENGTH_MASK                                                    0xffff0000
131 
132 
133 
134 
135 #define CE_STAT_DESC_TOEPLITZ_HASH_0_OFFSET                                         0x00000004
136 #define CE_STAT_DESC_TOEPLITZ_HASH_0_LSB                                            0
137 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MSB                                            31
138 #define CE_STAT_DESC_TOEPLITZ_HASH_0_MASK                                           0xffffffff
139 
140 
141 
142 
143 #define CE_STAT_DESC_TOEPLITZ_HASH_1_OFFSET                                         0x00000008
144 #define CE_STAT_DESC_TOEPLITZ_HASH_1_LSB                                            0
145 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MSB                                            31
146 #define CE_STAT_DESC_TOEPLITZ_HASH_1_MASK                                           0xffffffff
147 
148 
149 
150 
151 #define CE_STAT_DESC_FW_METADATA_OFFSET                                             0x0000000c
152 #define CE_STAT_DESC_FW_METADATA_LSB                                                0
153 #define CE_STAT_DESC_FW_METADATA_MSB                                                15
154 #define CE_STAT_DESC_FW_METADATA_MASK                                               0x0000ffff
155 
156 
157 
158 
159 #define CE_STAT_DESC_CE_RES_7_OFFSET                                                0x0000000c
160 #define CE_STAT_DESC_CE_RES_7_LSB                                                   16
161 #define CE_STAT_DESC_CE_RES_7_MSB                                                   19
162 #define CE_STAT_DESC_CE_RES_7_MASK                                                  0x000f0000
163 
164 
165 
166 
167 #define CE_STAT_DESC_RING_ID_OFFSET                                                 0x0000000c
168 #define CE_STAT_DESC_RING_ID_LSB                                                    20
169 #define CE_STAT_DESC_RING_ID_MSB                                                    27
170 #define CE_STAT_DESC_RING_ID_MASK                                                   0x0ff00000
171 
172 
173 
174 
175 #define CE_STAT_DESC_LOOPING_COUNT_OFFSET                                           0x0000000c
176 #define CE_STAT_DESC_LOOPING_COUNT_LSB                                              28
177 #define CE_STAT_DESC_LOOPING_COUNT_MSB                                              31
178 #define CE_STAT_DESC_LOOPING_COUNT_MASK                                             0xf0000000
179 
180 
181 
182 #endif
183