xref: /wlan-driver/fw-api/hw/qcn6122/rxpt_classify_info.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 _RXPT_CLASSIFY_INFO_H_
18 #define _RXPT_CLASSIFY_INFO_H_
19 #if !defined(__ASSEMBLER__)
20 #endif
21 
22 
23 // ################ START SUMMARY #################
24 //
25 //	Dword	Fields
26 //	0	reo_destination_indication[4:0], lmac_peer_id_msb[6:5], use_flow_id_toeplitz_clfy[7], pkt_selection_fp_ucast_data[8], pkt_selection_fp_mcast_data[9], pkt_selection_fp_1000[10], rxdma0_source_ring_selection[12:11], rxdma0_destination_ring_selection[14:13], reserved_0b[31:15]
27 //
28 // ################ END SUMMARY #################
29 
30 #define NUM_OF_DWORDS_RXPT_CLASSIFY_INFO 1
31 
32 struct rxpt_classify_info {
33              uint32_t reo_destination_indication      :  5, //[4:0]
34                       lmac_peer_id_msb                :  2, //[6:5]
35                       use_flow_id_toeplitz_clfy       :  1, //[7]
36                       pkt_selection_fp_ucast_data     :  1, //[8]
37                       pkt_selection_fp_mcast_data     :  1, //[9]
38                       pkt_selection_fp_1000           :  1, //[10]
39                       rxdma0_source_ring_selection    :  2, //[12:11]
40                       rxdma0_destination_ring_selection:  2, //[14:13]
41                       reserved_0b                     : 17; //[31:15]
42 };
43 
44 /*
45 
46 reo_destination_indication
47 
48 			The ID of the REO exit ring where the MSDU frame shall
49 			push after (MPDU level) reordering has finished.
50 
51 
52 
53 			<enum 0 reo_destination_tcl> Reo will push the frame
54 			into the REO2TCL ring
55 
56 			<enum 1 reo_destination_sw1> Reo will push the frame
57 			into the REO2SW1 ring
58 
59 			<enum 2 reo_destination_sw2> Reo will push the frame
60 			into the REO2SW2 ring
61 
62 			<enum 3 reo_destination_sw3> Reo will push the frame
63 			into the REO2SW3 ring
64 
65 			<enum 4 reo_destination_sw4> Reo will push the frame
66 			into the REO2SW4 ring
67 
68 			<enum 5 reo_destination_release> Reo will push the frame
69 			into the REO_release ring
70 
71 			<enum 6 reo_destination_fw> Reo will push the frame into
72 			the REO2FW ring
73 
74 			<enum 7 reo_destination_sw5> Reo will push the frame
75 			into the REO2SW5 ring (REO remaps this in chips without
76 			REO2SW5 ring, e.g. Pine)
77 
78 			<enum 8 reo_destination_sw6> Reo will push the frame
79 			into the REO2SW6 ring (REO remaps this in chips without
80 			REO2SW6 ring, e.g. Pine)
81 
82 			<enum 9 reo_destination_9> REO remaps this <enum 10
83 			reo_destination_10> REO remaps this
84 
85 			<enum 11 reo_destination_11> REO remaps this
86 
87 			<enum 12 reo_destination_12> REO remaps this <enum 13
88 			reo_destination_13> REO remaps this
89 
90 			<enum 14 reo_destination_14> REO remaps this
91 
92 			<enum 15 reo_destination_15> REO remaps this
93 
94 			<enum 16 reo_destination_16> REO remaps this
95 
96 			<enum 17 reo_destination_17> REO remaps this
97 
98 			<enum 18 reo_destination_18> REO remaps this
99 
100 			<enum 19 reo_destination_19> REO remaps this
101 
102 			<enum 20 reo_destination_20> REO remaps this
103 
104 			<enum 21 reo_destination_21> REO remaps this
105 
106 			<enum 22 reo_destination_22> REO remaps this
107 
108 			<enum 23 reo_destination_23> REO remaps this
109 
110 			<enum 24 reo_destination_24> REO remaps this
111 
112 			<enum 25 reo_destination_25> REO remaps this
113 
114 			<enum 26 reo_destination_26> REO remaps this
115 
116 			<enum 27 reo_destination_27> REO remaps this
117 
118 			<enum 28 reo_destination_28> REO remaps this
119 
120 			<enum 29 reo_destination_29> REO remaps this
121 
122 			<enum 30 reo_destination_30> REO remaps this
123 
124 			<enum 31 reo_destination_31> REO remaps this
125 
126 
127 
128 			<legal all>
129 
130 lmac_peer_id_msb
131 
132 			If use_flow_id_toeplitz_clfy is set and lmac_peer_id_'sb
133 			is 2'b00, Rx OLE uses a REO desination indicati'n of {1'b1,
134 			hash[3:0]} using the chosen Toeplitz hash from Common Parser
135 			if flow search fails.
136 
137 			If use_flow_id_toeplitz_clfy is set and lmac_peer_id_msb
138 			's not 2'b00, Rx OLE uses a REO desination indication of
139 			{lmac_peer_id_msb, hash[2:0]} using the chosen Toeplitz hash
140 			from Common Parser if flow search fails.
141 
142 			This LMAC/peer-based routing is not supported in
143 			Hastings80 and HastingsPrime.
144 
145 			<legal all>
146 
147 use_flow_id_toeplitz_clfy
148 
149 			Indication to Rx OLE to enable REO destination routing
150 			based on the chosen Toeplitz hash from Common Parser, in
151 			case flow search fails
152 
153 			<legal all>
154 
155 pkt_selection_fp_ucast_data
156 
157 			Filter pass Unicast data frame (matching
158 			rxpcu_filter_pass and sw_frame_group_Unicast_data) routing
159 			selection
160 
161 
162 
163 			1'b0: source and destination rings are selected from the
164 			RxOLE register settings for the packet type
165 
166 
167 
168 			1'b1: source ring and destination ring is selected from
169 			the rxdma0_source_ring_selection and
170 			rxdma0_destination_ring_selection fields in this STRUCT
171 
172 			<legal all>
173 
174 pkt_selection_fp_mcast_data
175 
176 			Filter pass Multicast data frame (matching
177 			rxpcu_filter_pass and sw_frame_group_Multicast_data) routing
178 			selection
179 
180 
181 
182 			1'b0: source and destination rings are selected from the
183 			RxOLE register settings for the packet type
184 
185 
186 
187 			1'b1: source ring and destination ring is selected from
188 			the rxdma0_source_ring_selection and
189 			rxdma0_destination_ring_selection fields in this STRUCT
190 
191 			<legal all>
192 
193 pkt_selection_fp_1000
194 
195 			Filter pass BAR frame (matching rxpcu_filter_pass and
196 			sw_frame_group_ctrl_1000) routing selection
197 
198 
199 
200 			1'b0: source and destination rings are selected from the
201 			RxOLE register settings for the packet type
202 
203 
204 
205 			1'b1: source ring and destination ring is selected from
206 			the rxdma0_source_ring_selection and
207 			rxdma0_destination_ring_selection fields in this STRUCT
208 
209 			<legal all>
210 
211 rxdma0_source_ring_selection
212 
213 			Field only valid when for the received frame type the
214 			corresponding pkt_selection_fp_... bit is set
215 
216 
217 
218 			<enum 0 wbm2rxdma_buf_source_ring> The data buffer for
219 
220 			<enum 1 fw2rxdma_buf_source_ring> The data buffer for
221 			this frame shall be sourced by fw2rxdma buffer source ring.
222 
223 			<enum 2 sw2rxdma_buf_source_ring> The data buffer for
224 			this frame shall be sourced by sw2rxdma buffer source ring.
225 
226 			<enum 3 no_buffer_ring> The frame shall not be written
227 			to any data buffer.
228 
229 
230 
231 			<legal all>
232 
233 rxdma0_destination_ring_selection
234 
235 			Field only valid when for the received frame type the
236 			corresponding pkt_selection_fp_... bit is set
237 
238 
239 
240 			<enum 0  rxdma_release_ring> RXDMA0 shall push the frame
241 			to the Release ring. Effectively this means the frame needs
242 			to be dropped.
243 
244 			<enum 1  rxdma2fw_ring> RXDMA0 shall push the frame to
245 			the FW ring.
246 
247 			<enum 2  rxdma2sw_ring> RXDMA0 shall push the frame to
248 			the SW ring.
249 
250 			<enum 3  rxdma2reo_ring> RXDMA0 shall push the frame to
251 			the REO entrance ring.
252 
253 
254 
255 			<legal all>
256 
257 reserved_0b
258 
259 			<legal 0>
260 */
261 
262 
263 /* Description		RXPT_CLASSIFY_INFO_0_REO_DESTINATION_INDICATION
264 
265 			The ID of the REO exit ring where the MSDU frame shall
266 			push after (MPDU level) reordering has finished.
267 
268 
269 
270 			<enum 0 reo_destination_tcl> Reo will push the frame
271 			into the REO2TCL ring
272 
273 			<enum 1 reo_destination_sw1> Reo will push the frame
274 			into the REO2SW1 ring
275 
276 			<enum 2 reo_destination_sw2> Reo will push the frame
277 			into the REO2SW2 ring
278 
279 			<enum 3 reo_destination_sw3> Reo will push the frame
280 			into the REO2SW3 ring
281 
282 			<enum 4 reo_destination_sw4> Reo will push the frame
283 			into the REO2SW4 ring
284 
285 			<enum 5 reo_destination_release> Reo will push the frame
286 			into the REO_release ring
287 
288 			<enum 6 reo_destination_fw> Reo will push the frame into
289 			the REO2FW ring
290 
291 			<enum 7 reo_destination_sw5> Reo will push the frame
292 			into the REO2SW5 ring (REO remaps this in chips without
293 			REO2SW5 ring, e.g. Pine)
294 
295 			<enum 8 reo_destination_sw6> Reo will push the frame
296 			into the REO2SW6 ring (REO remaps this in chips without
297 			REO2SW6 ring, e.g. Pine)
298 
299 			<enum 9 reo_destination_9> REO remaps this <enum 10
300 			reo_destination_10> REO remaps this
301 
302 			<enum 11 reo_destination_11> REO remaps this
303 
304 			<enum 12 reo_destination_12> REO remaps this <enum 13
305 			reo_destination_13> REO remaps this
306 
307 			<enum 14 reo_destination_14> REO remaps this
308 
309 			<enum 15 reo_destination_15> REO remaps this
310 
311 			<enum 16 reo_destination_16> REO remaps this
312 
313 			<enum 17 reo_destination_17> REO remaps this
314 
315 			<enum 18 reo_destination_18> REO remaps this
316 
317 			<enum 19 reo_destination_19> REO remaps this
318 
319 			<enum 20 reo_destination_20> REO remaps this
320 
321 			<enum 21 reo_destination_21> REO remaps this
322 
323 			<enum 22 reo_destination_22> REO remaps this
324 
325 			<enum 23 reo_destination_23> REO remaps this
326 
327 			<enum 24 reo_destination_24> REO remaps this
328 
329 			<enum 25 reo_destination_25> REO remaps this
330 
331 			<enum 26 reo_destination_26> REO remaps this
332 
333 			<enum 27 reo_destination_27> REO remaps this
334 
335 			<enum 28 reo_destination_28> REO remaps this
336 
337 			<enum 29 reo_destination_29> REO remaps this
338 
339 			<enum 30 reo_destination_30> REO remaps this
340 
341 			<enum 31 reo_destination_31> REO remaps this
342 
343 
344 
345 			<legal all>
346 */
347 #define RXPT_CLASSIFY_INFO_0_REO_DESTINATION_INDICATION_OFFSET       0x00000000
348 #define RXPT_CLASSIFY_INFO_0_REO_DESTINATION_INDICATION_LSB          0
349 #define RXPT_CLASSIFY_INFO_0_REO_DESTINATION_INDICATION_MASK         0x0000001f
350 
351 /* Description		RXPT_CLASSIFY_INFO_0_LMAC_PEER_ID_MSB
352 
353 			If use_flow_id_toeplitz_clfy is set and lmac_peer_id_'sb
354 			is 2'b00, Rx OLE uses a REO desination indicati'n of {1'b1,
355 			hash[3:0]} using the chosen Toeplitz hash from Common Parser
356 			if flow search fails.
357 
358 			If use_flow_id_toeplitz_clfy is set and lmac_peer_id_msb
359 			's not 2'b00, Rx OLE uses a REO desination indication of
360 			{lmac_peer_id_msb, hash[2:0]} using the chosen Toeplitz hash
361 			from Common Parser if flow search fails.
362 
363 			This LMAC/peer-based routing is not supported in
364 			Hastings80 and HastingsPrime.
365 
366 			<legal all>
367 */
368 #define RXPT_CLASSIFY_INFO_0_LMAC_PEER_ID_MSB_OFFSET                 0x00000000
369 #define RXPT_CLASSIFY_INFO_0_LMAC_PEER_ID_MSB_LSB                    5
370 #define RXPT_CLASSIFY_INFO_0_LMAC_PEER_ID_MSB_MASK                   0x00000060
371 
372 /* Description		RXPT_CLASSIFY_INFO_0_USE_FLOW_ID_TOEPLITZ_CLFY
373 
374 			Indication to Rx OLE to enable REO destination routing
375 			based on the chosen Toeplitz hash from Common Parser, in
376 			case flow search fails
377 
378 			<legal all>
379 */
380 #define RXPT_CLASSIFY_INFO_0_USE_FLOW_ID_TOEPLITZ_CLFY_OFFSET        0x00000000
381 #define RXPT_CLASSIFY_INFO_0_USE_FLOW_ID_TOEPLITZ_CLFY_LSB           7
382 #define RXPT_CLASSIFY_INFO_0_USE_FLOW_ID_TOEPLITZ_CLFY_MASK          0x00000080
383 
384 /* Description		RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_UCAST_DATA
385 
386 			Filter pass Unicast data frame (matching
387 			rxpcu_filter_pass and sw_frame_group_Unicast_data) routing
388 			selection
389 
390 
391 
392 			1'b0: source and destination rings are selected from the
393 			RxOLE register settings for the packet type
394 
395 
396 
397 			1'b1: source ring and destination ring is selected from
398 			the rxdma0_source_ring_selection and
399 			rxdma0_destination_ring_selection fields in this STRUCT
400 
401 			<legal all>
402 */
403 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_UCAST_DATA_OFFSET      0x00000000
404 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_UCAST_DATA_LSB         8
405 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_UCAST_DATA_MASK        0x00000100
406 
407 /* Description		RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_MCAST_DATA
408 
409 			Filter pass Multicast data frame (matching
410 			rxpcu_filter_pass and sw_frame_group_Multicast_data) routing
411 			selection
412 
413 
414 
415 			1'b0: source and destination rings are selected from the
416 			RxOLE register settings for the packet type
417 
418 
419 
420 			1'b1: source ring and destination ring is selected from
421 			the rxdma0_source_ring_selection and
422 			rxdma0_destination_ring_selection fields in this STRUCT
423 
424 			<legal all>
425 */
426 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_MCAST_DATA_OFFSET      0x00000000
427 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_MCAST_DATA_LSB         9
428 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_MCAST_DATA_MASK        0x00000200
429 
430 /* Description		RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_1000
431 
432 			Filter pass BAR frame (matching rxpcu_filter_pass and
433 			sw_frame_group_ctrl_1000) routing selection
434 
435 
436 
437 			1'b0: source and destination rings are selected from the
438 			RxOLE register settings for the packet type
439 
440 
441 
442 			1'b1: source ring and destination ring is selected from
443 			the rxdma0_source_ring_selection and
444 			rxdma0_destination_ring_selection fields in this STRUCT
445 
446 			<legal all>
447 */
448 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_1000_OFFSET            0x00000000
449 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_1000_LSB               10
450 #define RXPT_CLASSIFY_INFO_0_PKT_SELECTION_FP_1000_MASK              0x00000400
451 
452 /* Description		RXPT_CLASSIFY_INFO_0_RXDMA0_SOURCE_RING_SELECTION
453 
454 			Field only valid when for the received frame type the
455 			corresponding pkt_selection_fp_... bit is set
456 
457 
458 
459 			<enum 0 wbm2rxdma_buf_source_ring> The data buffer for
460 
461 			<enum 1 fw2rxdma_buf_source_ring> The data buffer for
462 			this frame shall be sourced by fw2rxdma buffer source ring.
463 
464 			<enum 2 sw2rxdma_buf_source_ring> The data buffer for
465 			this frame shall be sourced by sw2rxdma buffer source ring.
466 
467 			<enum 3 no_buffer_ring> The frame shall not be written
468 			to any data buffer.
469 
470 
471 
472 			<legal all>
473 */
474 #define RXPT_CLASSIFY_INFO_0_RXDMA0_SOURCE_RING_SELECTION_OFFSET     0x00000000
475 #define RXPT_CLASSIFY_INFO_0_RXDMA0_SOURCE_RING_SELECTION_LSB        11
476 #define RXPT_CLASSIFY_INFO_0_RXDMA0_SOURCE_RING_SELECTION_MASK       0x00001800
477 
478 /* Description		RXPT_CLASSIFY_INFO_0_RXDMA0_DESTINATION_RING_SELECTION
479 
480 			Field only valid when for the received frame type the
481 			corresponding pkt_selection_fp_... bit is set
482 
483 
484 
485 			<enum 0  rxdma_release_ring> RXDMA0 shall push the frame
486 			to the Release ring. Effectively this means the frame needs
487 			to be dropped.
488 
489 			<enum 1  rxdma2fw_ring> RXDMA0 shall push the frame to
490 			the FW ring.
491 
492 			<enum 2  rxdma2sw_ring> RXDMA0 shall push the frame to
493 			the SW ring.
494 
495 			<enum 3  rxdma2reo_ring> RXDMA0 shall push the frame to
496 			the REO entrance ring.
497 
498 
499 
500 			<legal all>
501 */
502 #define RXPT_CLASSIFY_INFO_0_RXDMA0_DESTINATION_RING_SELECTION_OFFSET 0x00000000
503 #define RXPT_CLASSIFY_INFO_0_RXDMA0_DESTINATION_RING_SELECTION_LSB   13
504 #define RXPT_CLASSIFY_INFO_0_RXDMA0_DESTINATION_RING_SELECTION_MASK  0x00006000
505 
506 /* Description		RXPT_CLASSIFY_INFO_0_RESERVED_0B
507 
508 			<legal 0>
509 */
510 #define RXPT_CLASSIFY_INFO_0_RESERVED_0B_OFFSET                      0x00000000
511 #define RXPT_CLASSIFY_INFO_0_RESERVED_0B_LSB                         15
512 #define RXPT_CLASSIFY_INFO_0_RESERVED_0B_MASK                        0xffff8000
513 
514 
515 #endif // _RXPT_CLASSIFY_INFO_H_
516