xref: /wlan-driver/fw-api/hw/qcn6122/reo_flush_timeout_list.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, The Linux Foundation. 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 #ifndef _REO_FLUSH_TIMEOUT_LIST_H_
18 #define _REO_FLUSH_TIMEOUT_LIST_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 #include "uniform_reo_cmd_header.h"
23 
24 // ################ START SUMMARY #################
25 //
26 //	Dword	Fields
27 //	0	struct uniform_reo_cmd_header cmd_header;
28 //	1	ac_timout_list[1:0], reserved_1[31:2]
29 //	2	minimum_release_desc_count[15:0], minimum_forward_buf_count[31:16]
30 //	3	reserved_3a[31:0]
31 //	4	reserved_4a[31:0]
32 //	5	reserved_5a[31:0]
33 //	6	reserved_6a[31:0]
34 //	7	reserved_7a[31:0]
35 //	8	reserved_8a[31:0]
36 //
37 // ################ END SUMMARY #################
38 
39 #define NUM_OF_DWORDS_REO_FLUSH_TIMEOUT_LIST 9
40 
41 struct reo_flush_timeout_list {
42     struct            uniform_reo_cmd_header                       cmd_header;
43              uint32_t ac_timout_list                  :  2, //[1:0]
44                       reserved_1                      : 30; //[31:2]
45              uint32_t minimum_release_desc_count      : 16, //[15:0]
46                       minimum_forward_buf_count       : 16; //[31:16]
47              uint32_t reserved_3a                     : 32; //[31:0]
48              uint32_t reserved_4a                     : 32; //[31:0]
49              uint32_t reserved_5a                     : 32; //[31:0]
50              uint32_t reserved_6a                     : 32; //[31:0]
51              uint32_t reserved_7a                     : 32; //[31:0]
52              uint32_t reserved_8a                     : 32; //[31:0]
53 };
54 
55 /*
56 
57 struct uniform_reo_cmd_header cmd_header
58 
59 			Consumer: REO
60 
61 			Producer: SW
62 
63 
64 
65 			Details for command execution tracking purposes.
66 
67 ac_timout_list
68 
69 			Consumer: REO
70 
71 			Producer: SW
72 
73 
74 
75 			The AC_timeout list to be used for this command
76 
77 			<legal all>
78 
79 reserved_1
80 
81 			<legal 0>
82 
83 minimum_release_desc_count
84 
85 			Consumer: REO
86 
87 			Producer: SW
88 
89 
90 
91 			The minimum number of link descriptors requested to be
92 			released. If set to 0, only buffer release counts seems to
93 			be important... When set to very high value, likely the
94 			entire timeout list will be exhausted before this count is
95 			reached or maybe this count will not get reached. REO
96 			however will stop here as it can not do anything else.
97 
98 
99 
100 			When both this field and field Minimum_forward_buf_count
101 			are > 0, REO needs to meet both requirements. When both
102 			entries are 0 (which should be a programming error), REO
103 			does not need to do anything.
104 
105 
106 
107 			Note that this includes counts of MPDU link Desc as well
108 			as MSDU link Desc. Where the count of MSDU link Desc is not
109 			known to REO it's approximated by deriving from MSDU count
110 
111 			<legal all>
112 
113 minimum_forward_buf_count
114 
115 			Consumer: REO
116 
117 			Producer: SW
118 
119 
120 
121 			The minimum number of buffer descriptors requested to be
122 			passed on to the REO destination rings.
123 
124 
125 
126 			If set to 0, only descriptor release counts seems to be
127 			important...
128 
129 
130 
131 			When set to very high value, likely the entire timeout
132 			list will be exhausted before this count is reached or maybe
133 			this count will not get reached. REO however will stop here
134 			as it can not do anything else.
135 
136 
137 
138 			Note that REO does not know the exact buffer count. This
139 			can be approximated by using the MSDU_COUNT
140 
141 			<legal all>
142 
143 reserved_3a
144 
145 			<legal 0>
146 
147 reserved_4a
148 
149 			<legal 0>
150 
151 reserved_5a
152 
153 			<legal 0>
154 
155 reserved_6a
156 
157 			<legal 0>
158 
159 reserved_7a
160 
161 			<legal 0>
162 
163 reserved_8a
164 
165 			<legal 0>
166 */
167 
168 
169  /* EXTERNAL REFERENCE : struct uniform_reo_cmd_header cmd_header */
170 
171 
172 /* Description		REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_CMD_NUMBER
173 
174 			Consumer: REO/SW/DEBUG
175 
176 			Producer: SW
177 
178 
179 
180 			This number can be used by SW to track, identify and
181 			link the created commands with the command statusses
182 
183 
184 
185 
186 
187 			<legal all>
188 */
189 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_CMD_NUMBER_OFFSET    0x00000000
190 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_CMD_NUMBER_LSB       0
191 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_CMD_NUMBER_MASK      0x0000ffff
192 
193 /* Description		REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_STATUS_REQUIRED
194 
195 			Consumer: REO
196 
197 			Producer: SW
198 
199 
200 
201 			<enum 0 NoStatus> REO does not need to generate a status
202 			TLV for the execution of this command
203 
204 			<enum 1 StatusRequired> REO shall generate a status TLV
205 			for the execution of this command
206 
207 
208 
209 			<legal all>
210 */
211 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_STATUS_REQUIRED_OFFSET 0x00000000
212 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_STATUS_REQUIRED_LSB  16
213 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_REO_STATUS_REQUIRED_MASK 0x00010000
214 
215 /* Description		REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_RESERVED_0A
216 
217 			<legal 0>
218 */
219 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_RESERVED_0A_OFFSET       0x00000000
220 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_RESERVED_0A_LSB          17
221 #define REO_FLUSH_TIMEOUT_LIST_0_CMD_HEADER_RESERVED_0A_MASK         0xfffe0000
222 
223 /* Description		REO_FLUSH_TIMEOUT_LIST_1_AC_TIMOUT_LIST
224 
225 			Consumer: REO
226 
227 			Producer: SW
228 
229 
230 
231 			The AC_timeout list to be used for this command
232 
233 			<legal all>
234 */
235 #define REO_FLUSH_TIMEOUT_LIST_1_AC_TIMOUT_LIST_OFFSET               0x00000004
236 #define REO_FLUSH_TIMEOUT_LIST_1_AC_TIMOUT_LIST_LSB                  0
237 #define REO_FLUSH_TIMEOUT_LIST_1_AC_TIMOUT_LIST_MASK                 0x00000003
238 
239 /* Description		REO_FLUSH_TIMEOUT_LIST_1_RESERVED_1
240 
241 			<legal 0>
242 */
243 #define REO_FLUSH_TIMEOUT_LIST_1_RESERVED_1_OFFSET                   0x00000004
244 #define REO_FLUSH_TIMEOUT_LIST_1_RESERVED_1_LSB                      2
245 #define REO_FLUSH_TIMEOUT_LIST_1_RESERVED_1_MASK                     0xfffffffc
246 
247 /* Description		REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_RELEASE_DESC_COUNT
248 
249 			Consumer: REO
250 
251 			Producer: SW
252 
253 
254 
255 			The minimum number of link descriptors requested to be
256 			released. If set to 0, only buffer release counts seems to
257 			be important... When set to very high value, likely the
258 			entire timeout list will be exhausted before this count is
259 			reached or maybe this count will not get reached. REO
260 			however will stop here as it can not do anything else.
261 
262 
263 
264 			When both this field and field Minimum_forward_buf_count
265 			are > 0, REO needs to meet both requirements. When both
266 			entries are 0 (which should be a programming error), REO
267 			does not need to do anything.
268 
269 
270 
271 			Note that this includes counts of MPDU link Desc as well
272 			as MSDU link Desc. Where the count of MSDU link Desc is not
273 			known to REO it's approximated by deriving from MSDU count
274 
275 			<legal all>
276 */
277 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_RELEASE_DESC_COUNT_OFFSET   0x00000008
278 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_RELEASE_DESC_COUNT_LSB      0
279 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_RELEASE_DESC_COUNT_MASK     0x0000ffff
280 
281 /* Description		REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_FORWARD_BUF_COUNT
282 
283 			Consumer: REO
284 
285 			Producer: SW
286 
287 
288 
289 			The minimum number of buffer descriptors requested to be
290 			passed on to the REO destination rings.
291 
292 
293 
294 			If set to 0, only descriptor release counts seems to be
295 			important...
296 
297 
298 
299 			When set to very high value, likely the entire timeout
300 			list will be exhausted before this count is reached or maybe
301 			this count will not get reached. REO however will stop here
302 			as it can not do anything else.
303 
304 
305 
306 			Note that REO does not know the exact buffer count. This
307 			can be approximated by using the MSDU_COUNT
308 
309 			<legal all>
310 */
311 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_FORWARD_BUF_COUNT_OFFSET    0x00000008
312 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_FORWARD_BUF_COUNT_LSB       16
313 #define REO_FLUSH_TIMEOUT_LIST_2_MINIMUM_FORWARD_BUF_COUNT_MASK      0xffff0000
314 
315 /* Description		REO_FLUSH_TIMEOUT_LIST_3_RESERVED_3A
316 
317 			<legal 0>
318 */
319 #define REO_FLUSH_TIMEOUT_LIST_3_RESERVED_3A_OFFSET                  0x0000000c
320 #define REO_FLUSH_TIMEOUT_LIST_3_RESERVED_3A_LSB                     0
321 #define REO_FLUSH_TIMEOUT_LIST_3_RESERVED_3A_MASK                    0xffffffff
322 
323 /* Description		REO_FLUSH_TIMEOUT_LIST_4_RESERVED_4A
324 
325 			<legal 0>
326 */
327 #define REO_FLUSH_TIMEOUT_LIST_4_RESERVED_4A_OFFSET                  0x00000010
328 #define REO_FLUSH_TIMEOUT_LIST_4_RESERVED_4A_LSB                     0
329 #define REO_FLUSH_TIMEOUT_LIST_4_RESERVED_4A_MASK                    0xffffffff
330 
331 /* Description		REO_FLUSH_TIMEOUT_LIST_5_RESERVED_5A
332 
333 			<legal 0>
334 */
335 #define REO_FLUSH_TIMEOUT_LIST_5_RESERVED_5A_OFFSET                  0x00000014
336 #define REO_FLUSH_TIMEOUT_LIST_5_RESERVED_5A_LSB                     0
337 #define REO_FLUSH_TIMEOUT_LIST_5_RESERVED_5A_MASK                    0xffffffff
338 
339 /* Description		REO_FLUSH_TIMEOUT_LIST_6_RESERVED_6A
340 
341 			<legal 0>
342 */
343 #define REO_FLUSH_TIMEOUT_LIST_6_RESERVED_6A_OFFSET                  0x00000018
344 #define REO_FLUSH_TIMEOUT_LIST_6_RESERVED_6A_LSB                     0
345 #define REO_FLUSH_TIMEOUT_LIST_6_RESERVED_6A_MASK                    0xffffffff
346 
347 /* Description		REO_FLUSH_TIMEOUT_LIST_7_RESERVED_7A
348 
349 			<legal 0>
350 */
351 #define REO_FLUSH_TIMEOUT_LIST_7_RESERVED_7A_OFFSET                  0x0000001c
352 #define REO_FLUSH_TIMEOUT_LIST_7_RESERVED_7A_LSB                     0
353 #define REO_FLUSH_TIMEOUT_LIST_7_RESERVED_7A_MASK                    0xffffffff
354 
355 /* Description		REO_FLUSH_TIMEOUT_LIST_8_RESERVED_8A
356 
357 			<legal 0>
358 */
359 #define REO_FLUSH_TIMEOUT_LIST_8_RESERVED_8A_OFFSET                  0x00000020
360 #define REO_FLUSH_TIMEOUT_LIST_8_RESERVED_8A_LSB                     0
361 #define REO_FLUSH_TIMEOUT_LIST_8_RESERVED_8A_MASK                    0xffffffff
362 
363 
364 #endif // _REO_FLUSH_TIMEOUT_LIST_H_
365