xref: /wlan-driver/fw-api/hw/qca6390/v1/rx_msdu_desc_info.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _RX_MSDU_DESC_INFO_H_
20 #define _RX_MSDU_DESC_INFO_H_
21 #if !defined(__ASSEMBLER__)
22 #endif
23 
24 
25 // ################ START SUMMARY #################
26 //
27 //	Dword	Fields
28 //	0	first_msdu_in_mpdu_flag[0], last_msdu_in_mpdu_flag[1], msdu_continuation[2], msdu_length[16:3], reo_destination_indication[21:17], msdu_drop[22], sa_is_valid[23], sa_idx_timeout[24], da_is_valid[25], da_is_mcbc[26], da_idx_timeout[27], reserved_0a[31:28]
29 //	1	reserved_1a[31:0]
30 //
31 // ################ END SUMMARY #################
32 
33 #define NUM_OF_DWORDS_RX_MSDU_DESC_INFO 2
34 
35 struct rx_msdu_desc_info {
36              uint32_t first_msdu_in_mpdu_flag         :  1, //[0]
37                       last_msdu_in_mpdu_flag          :  1, //[1]
38                       msdu_continuation               :  1, //[2]
39                       msdu_length                     : 14, //[16:3]
40                       reo_destination_indication      :  5, //[21:17]
41                       msdu_drop                       :  1, //[22]
42                       sa_is_valid                     :  1, //[23]
43                       sa_idx_timeout                  :  1, //[24]
44                       da_is_valid                     :  1, //[25]
45                       da_is_mcbc                      :  1, //[26]
46                       da_idx_timeout                  :  1, //[27]
47                       reserved_0a                     :  4; //[31:28]
48              uint32_t reserved_1a                     : 32; //[31:0]
49 };
50 
51 /*
52 
53 first_msdu_in_mpdu_flag
54 
55 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
56 			over multiple buffers, this field will be valid in the Last
57 			buffer used by the MSDU
58 
59 
60 
61 			<enum 0 Not_first_msdu> This is not the first MSDU in
62 			the MPDU.
63 
64 			<enum 1 first_msdu> This MSDU is the first one in the
65 			MPDU.
66 
67 
68 
69 			<legal all>
70 
71 last_msdu_in_mpdu_flag
72 
73 			Consumer: WBM/REO/SW/FW
74 
75 			Producer: RXDMA
76 
77 
78 
79 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
80 			over multiple buffers, this field will be valid in the Last
81 			buffer used by the MSDU
82 
83 
84 
85 			<enum 0 Not_last_msdu> There are more MSDUs linked to
86 			this MSDU that belongs to this MPDU
87 
88 			<enum 1 Last_msdu> this MSDU is the last one in the
89 			MPDU. This setting is only allowed in combination with
90 			'Msdu_continuation' set to 0. This implies that when an msdu
91 			is spread out over multiple buffers and thus
92 			msdu_continuation is set, only for the very last buffer of
93 			the msdu, can the 'last_msdu_in_mpdu_flag' be set.
94 
95 
96 
97 			When both first_msdu_in_mpdu_flag and
98 			last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
99 			belongs to only contains a single MSDU.
100 
101 
102 
103 
104 
105 			<legal all>
106 
107 msdu_continuation
108 
109 			When set, this MSDU buffer was not able to hold the
110 			entire MSDU. The next buffer will therefor contain
111 			additional information related to this MSDU.
112 
113 
114 
115 			<legal all>
116 
117 msdu_length
118 
119 			Parsed from RX_MSDU_START TLV . In the case MSDU spans
120 			over multiple buffers, this field will be valid in the First
121 			buffer used by MSDU.
122 
123 
124 
125 			Full MSDU length in bytes after decapsulation.
126 
127 
128 
129 			This field is still valid for MPDU frames without
130 			A-MSDU.  It still represents MSDU length after decapsulation
131 
132 
133 
134 			Or in case of RAW MPDUs, it indicates the length of the
135 			entire MPDU (without FCS field)
136 
137 			<legal all>
138 
139 reo_destination_indication
140 
141 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
142 			over multiple buffers, this field will be valid in the Last
143 			buffer used by the MSDU
144 
145 
146 
147 			The ID of the REO exit ring where the MSDU frame shall
148 			push after (MPDU level) reordering has finished.
149 
150 
151 
152 			<enum 0 reo_destination_tcl> Reo will push the frame
153 			into the REO2TCL ring
154 
155 			<enum 1 reo_destination_sw1> Reo will push the frame
156 			into the REO2SW1 ring
157 
158 			<enum 2 reo_destination_sw2> Reo will push the frame
159 			into the REO2SW1 ring
160 
161 			<enum 3 reo_destination_sw3> Reo will push the frame
162 			into the REO2SW1 ring
163 
164 			<enum 4 reo_destination_sw4> Reo will push the frame
165 			into the REO2SW1 ring
166 
167 			<enum 5 reo_destination_release> Reo will push the frame
168 			into the REO_release ring
169 
170 			<enum 6 reo_destination_fw> Reo will push the frame into
171 			the REO2FW ring
172 
173 			<enum 7 reo_destination_7> REO remaps this
174 
175 			<enum 8 reo_destination_8> REO remaps this <enum 9
176 			reo_destination_9> REO remaps this <enum 10
177 			reo_destination_10> REO remaps this
178 
179 			<enum 11 reo_destination_11> REO remaps this
180 
181 			<enum 12 reo_destination_12> REO remaps this <enum 13
182 			reo_destination_13> REO remaps this
183 
184 			<enum 14 reo_destination_14> REO remaps this
185 
186 			<enum 15 reo_destination_15> REO remaps this
187 
188 			<enum 16 reo_destination_16> REO remaps this
189 
190 			<enum 17 reo_destination_17> REO remaps this
191 
192 			<enum 18 reo_destination_18> REO remaps this
193 
194 			<enum 19 reo_destination_19> REO remaps this
195 
196 			<enum 20 reo_destination_20> REO remaps this
197 
198 			<enum 21 reo_destination_21> REO remaps this
199 
200 			<enum 22 reo_destination_22> REO remaps this
201 
202 			<enum 23 reo_destination_23> REO remaps this
203 
204 			<enum 24 reo_destination_24> REO remaps this
205 
206 			<enum 25 reo_destination_25> REO remaps this
207 
208 			<enum 26 reo_destination_26> REO remaps this
209 
210 			<enum 27 reo_destination_27> REO remaps this
211 
212 			<enum 28 reo_destination_28> REO remaps this
213 
214 			<enum 29 reo_destination_29> REO remaps this
215 
216 			<enum 30 reo_destination_30> REO remaps this
217 
218 			<enum 31 reo_destination_31> REO remaps this
219 
220 
221 
222 			<legal all>
223 
224 msdu_drop
225 
226 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
227 			over multiple buffers, this field will be valid in the Last
228 			buffer used by the MSDU
229 
230 
231 
232 			When set, REO shall drop this MSDU and not forward it to
233 			any other ring...
234 
235 			<legal all>
236 
237 sa_is_valid
238 
239 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
240 			over multiple buffers, this field will be valid in the Last
241 			buffer used by the MSDU
242 
243 
244 
245 			Indicates that OLE found a valid SA entry for this MSDU
246 
247 			<legal all>
248 
249 sa_idx_timeout
250 
251 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
252 			over multiple buffers, this field will be valid in the Last
253 			buffer used by the MSDU
254 
255 
256 
257 			Indicates an unsuccessful MAC source address search due
258 			to the expiring of the search timer for this MSDU
259 
260 			<legal all>
261 
262 da_is_valid
263 
264 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
265 			over multiple buffers, this field will be valid in the Last
266 			buffer used by the MSDU
267 
268 
269 
270 			Indicates that OLE found a valid DA entry for this MSDU
271 
272 			<legal all>
273 
274 da_is_mcbc
275 
276 			Field Only valid if da_is_valid is set
277 
278 
279 
280 			Indicates the DA address was a Multicast of Broadcast
281 			address for this MSDU
282 
283 			<legal all>
284 
285 da_idx_timeout
286 
287 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
288 			over multiple buffers, this field will be valid in the Last
289 			buffer used by the MSDU
290 
291 
292 
293 			Indicates an unsuccessful MAC destination address search
294 			due to the expiring of the search timer for this MSDU
295 
296 			<legal all>
297 
298 reserved_0a
299 
300 			<legal 0>
301 
302 reserved_1a
303 
304 			<legal 0>
305 */
306 
307 
308 /* Description		RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG
309 
310 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
311 			over multiple buffers, this field will be valid in the Last
312 			buffer used by the MSDU
313 
314 
315 
316 			<enum 0 Not_first_msdu> This is not the first MSDU in
317 			the MPDU.
318 
319 			<enum 1 first_msdu> This MSDU is the first one in the
320 			MPDU.
321 
322 
323 
324 			<legal all>
325 */
326 #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_OFFSET           0x00000000
327 #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_LSB              0
328 #define RX_MSDU_DESC_INFO_0_FIRST_MSDU_IN_MPDU_FLAG_MASK             0x00000001
329 
330 /* Description		RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG
331 
332 			Consumer: WBM/REO/SW/FW
333 
334 			Producer: RXDMA
335 
336 
337 
338 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
339 			over multiple buffers, this field will be valid in the Last
340 			buffer used by the MSDU
341 
342 
343 
344 			<enum 0 Not_last_msdu> There are more MSDUs linked to
345 			this MSDU that belongs to this MPDU
346 
347 			<enum 1 Last_msdu> this MSDU is the last one in the
348 			MPDU. This setting is only allowed in combination with
349 			'Msdu_continuation' set to 0. This implies that when an msdu
350 			is spread out over multiple buffers and thus
351 			msdu_continuation is set, only for the very last buffer of
352 			the msdu, can the 'last_msdu_in_mpdu_flag' be set.
353 
354 
355 
356 			When both first_msdu_in_mpdu_flag and
357 			last_msdu_in_mpdu_flag are set, the MPDU that this MSDU
358 			belongs to only contains a single MSDU.
359 
360 
361 
362 
363 
364 			<legal all>
365 */
366 #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_OFFSET            0x00000000
367 #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_LSB               1
368 #define RX_MSDU_DESC_INFO_0_LAST_MSDU_IN_MPDU_FLAG_MASK              0x00000002
369 
370 /* Description		RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION
371 
372 			When set, this MSDU buffer was not able to hold the
373 			entire MSDU. The next buffer will therefor contain
374 			additional information related to this MSDU.
375 
376 
377 
378 			<legal all>
379 */
380 #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_OFFSET                 0x00000000
381 #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_LSB                    2
382 #define RX_MSDU_DESC_INFO_0_MSDU_CONTINUATION_MASK                   0x00000004
383 
384 /* Description		RX_MSDU_DESC_INFO_0_MSDU_LENGTH
385 
386 			Parsed from RX_MSDU_START TLV . In the case MSDU spans
387 			over multiple buffers, this field will be valid in the First
388 			buffer used by MSDU.
389 
390 
391 
392 			Full MSDU length in bytes after decapsulation.
393 
394 
395 
396 			This field is still valid for MPDU frames without
397 			A-MSDU.  It still represents MSDU length after decapsulation
398 
399 
400 
401 			Or in case of RAW MPDUs, it indicates the length of the
402 			entire MPDU (without FCS field)
403 
404 			<legal all>
405 */
406 #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_OFFSET                       0x00000000
407 #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_LSB                          3
408 #define RX_MSDU_DESC_INFO_0_MSDU_LENGTH_MASK                         0x0001fff8
409 
410 /* Description		RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION
411 
412 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
413 			over multiple buffers, this field will be valid in the Last
414 			buffer used by the MSDU
415 
416 
417 
418 			The ID of the REO exit ring where the MSDU frame shall
419 			push after (MPDU level) reordering has finished.
420 
421 
422 
423 			<enum 0 reo_destination_tcl> Reo will push the frame
424 			into the REO2TCL ring
425 
426 			<enum 1 reo_destination_sw1> Reo will push the frame
427 			into the REO2SW1 ring
428 
429 			<enum 2 reo_destination_sw2> Reo will push the frame
430 			into the REO2SW1 ring
431 
432 			<enum 3 reo_destination_sw3> Reo will push the frame
433 			into the REO2SW1 ring
434 
435 			<enum 4 reo_destination_sw4> Reo will push the frame
436 			into the REO2SW1 ring
437 
438 			<enum 5 reo_destination_release> Reo will push the frame
439 			into the REO_release ring
440 
441 			<enum 6 reo_destination_fw> Reo will push the frame into
442 			the REO2FW ring
443 
444 			<enum 7 reo_destination_7> REO remaps this
445 
446 			<enum 8 reo_destination_8> REO remaps this <enum 9
447 			reo_destination_9> REO remaps this <enum 10
448 			reo_destination_10> REO remaps this
449 
450 			<enum 11 reo_destination_11> REO remaps this
451 
452 			<enum 12 reo_destination_12> REO remaps this <enum 13
453 			reo_destination_13> REO remaps this
454 
455 			<enum 14 reo_destination_14> REO remaps this
456 
457 			<enum 15 reo_destination_15> REO remaps this
458 
459 			<enum 16 reo_destination_16> REO remaps this
460 
461 			<enum 17 reo_destination_17> REO remaps this
462 
463 			<enum 18 reo_destination_18> REO remaps this
464 
465 			<enum 19 reo_destination_19> REO remaps this
466 
467 			<enum 20 reo_destination_20> REO remaps this
468 
469 			<enum 21 reo_destination_21> REO remaps this
470 
471 			<enum 22 reo_destination_22> REO remaps this
472 
473 			<enum 23 reo_destination_23> REO remaps this
474 
475 			<enum 24 reo_destination_24> REO remaps this
476 
477 			<enum 25 reo_destination_25> REO remaps this
478 
479 			<enum 26 reo_destination_26> REO remaps this
480 
481 			<enum 27 reo_destination_27> REO remaps this
482 
483 			<enum 28 reo_destination_28> REO remaps this
484 
485 			<enum 29 reo_destination_29> REO remaps this
486 
487 			<enum 30 reo_destination_30> REO remaps this
488 
489 			<enum 31 reo_destination_31> REO remaps this
490 
491 
492 
493 			<legal all>
494 */
495 #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_OFFSET        0x00000000
496 #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_LSB           17
497 #define RX_MSDU_DESC_INFO_0_REO_DESTINATION_INDICATION_MASK          0x003e0000
498 
499 /* Description		RX_MSDU_DESC_INFO_0_MSDU_DROP
500 
501 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
502 			over multiple buffers, this field will be valid in the Last
503 			buffer used by the MSDU
504 
505 
506 
507 			When set, REO shall drop this MSDU and not forward it to
508 			any other ring...
509 
510 			<legal all>
511 */
512 #define RX_MSDU_DESC_INFO_0_MSDU_DROP_OFFSET                         0x00000000
513 #define RX_MSDU_DESC_INFO_0_MSDU_DROP_LSB                            22
514 #define RX_MSDU_DESC_INFO_0_MSDU_DROP_MASK                           0x00400000
515 
516 /* Description		RX_MSDU_DESC_INFO_0_SA_IS_VALID
517 
518 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
519 			over multiple buffers, this field will be valid in the Last
520 			buffer used by the MSDU
521 
522 
523 
524 			Indicates that OLE found a valid SA entry for this MSDU
525 
526 			<legal all>
527 */
528 #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_OFFSET                       0x00000000
529 #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_LSB                          23
530 #define RX_MSDU_DESC_INFO_0_SA_IS_VALID_MASK                         0x00800000
531 
532 /* Description		RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT
533 
534 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
535 			over multiple buffers, this field will be valid in the Last
536 			buffer used by the MSDU
537 
538 
539 
540 			Indicates an unsuccessful MAC source address search due
541 			to the expiring of the search timer for this MSDU
542 
543 			<legal all>
544 */
545 #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_OFFSET                    0x00000000
546 #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_LSB                       24
547 #define RX_MSDU_DESC_INFO_0_SA_IDX_TIMEOUT_MASK                      0x01000000
548 
549 /* Description		RX_MSDU_DESC_INFO_0_DA_IS_VALID
550 
551 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
552 			over multiple buffers, this field will be valid in the Last
553 			buffer used by the MSDU
554 
555 
556 
557 			Indicates that OLE found a valid DA entry for this MSDU
558 
559 			<legal all>
560 */
561 #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_OFFSET                       0x00000000
562 #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_LSB                          25
563 #define RX_MSDU_DESC_INFO_0_DA_IS_VALID_MASK                         0x02000000
564 
565 /* Description		RX_MSDU_DESC_INFO_0_DA_IS_MCBC
566 
567 			Field Only valid if da_is_valid is set
568 
569 
570 
571 			Indicates the DA address was a Multicast of Broadcast
572 			address for this MSDU
573 
574 			<legal all>
575 */
576 #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_OFFSET                        0x00000000
577 #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_LSB                           26
578 #define RX_MSDU_DESC_INFO_0_DA_IS_MCBC_MASK                          0x04000000
579 
580 /* Description		RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT
581 
582 			Parsed from RX_MSDU_END TLV . In the case MSDU spans
583 			over multiple buffers, this field will be valid in the Last
584 			buffer used by the MSDU
585 
586 
587 
588 			Indicates an unsuccessful MAC destination address search
589 			due to the expiring of the search timer for this MSDU
590 
591 			<legal all>
592 */
593 #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_OFFSET                    0x00000000
594 #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_LSB                       27
595 #define RX_MSDU_DESC_INFO_0_DA_IDX_TIMEOUT_MASK                      0x08000000
596 
597 /* Description		RX_MSDU_DESC_INFO_0_RESERVED_0A
598 
599 			<legal 0>
600 */
601 #define RX_MSDU_DESC_INFO_0_RESERVED_0A_OFFSET                       0x00000000
602 #define RX_MSDU_DESC_INFO_0_RESERVED_0A_LSB                          28
603 #define RX_MSDU_DESC_INFO_0_RESERVED_0A_MASK                         0xf0000000
604 
605 /* Description		RX_MSDU_DESC_INFO_1_RESERVED_1A
606 
607 			<legal 0>
608 */
609 #define RX_MSDU_DESC_INFO_1_RESERVED_1A_OFFSET                       0x00000004
610 #define RX_MSDU_DESC_INFO_1_RESERVED_1A_LSB                          0
611 #define RX_MSDU_DESC_INFO_1_RESERVED_1A_MASK                         0xffffffff
612 
613 
614 #endif // _RX_MSDU_DESC_INFO_H_
615