xref: /wlan-driver/fw-api/hw/qca8074/v1/wbm_release_ring.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016 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 // $ATH_LICENSE_HW_HDR_C$
20 //
21 // DO NOT EDIT!  This file is automatically generated
22 //               These definitions are tied to a particular hardware layout
23 
24 
25 #ifndef _WBM_RELEASE_RING_H_
26 #define _WBM_RELEASE_RING_H_
27 #if !defined(__ASSEMBLER__)
28 #endif
29 
30 #include "buffer_addr_info.h"
31 #include "tx_rate_stats_info.h"
32 
33 // ################ START SUMMARY #################
34 //
35 //	Dword	Fields
36 //	0-1	struct buffer_addr_info released_buff_or_desc_addr_info;
37 //	2	release_source_module[2:0], bm_action[5:3], buffer_or_desc_type[8:6], first_msdu_index[12:9], tqm_release_reason[15:13], rxdma_push_reason[17:16], rxdma_error_code[22:18], reo_push_reason[24:23], reo_error_code[29:25], wbm_internal_error[30], reserved_2[31]
38 //	3	tqm_status_number[23:0], transmit_count[30:24], reserved_3a[31]
39 //	4	ack_frame_rssi[7:0], sw_release_details_valid[8], first_msdu[9], last_msdu[10], msdu_part_of_amsdu[11], fw_tx_notify_frame[12], buffer_timestamp[31:13]
40 //	5-6	struct tx_rate_stats_info tx_rate_stats;
41 //	7	sw_peer_id[15:0], tid[19:16], ring_id[27:20], looping_count[31:28]
42 //
43 // ################ END SUMMARY #################
44 
45 #define NUM_OF_DWORDS_WBM_RELEASE_RING 8
46 
47 struct wbm_release_ring {
48     struct            buffer_addr_info                       released_buff_or_desc_addr_info;
49              uint32_t release_source_module           :  3, //[2:0]
50                       bm_action                       :  3, //[5:3]
51                       buffer_or_desc_type             :  3, //[8:6]
52                       first_msdu_index                :  4, //[12:9]
53                       tqm_release_reason              :  3, //[15:13]
54                       rxdma_push_reason               :  2, //[17:16]
55                       rxdma_error_code                :  5, //[22:18]
56                       reo_push_reason                 :  2, //[24:23]
57                       reo_error_code                  :  5, //[29:25]
58                       wbm_internal_error              :  1, //[30]
59                       reserved_2                      :  1; //[31]
60              uint32_t tqm_status_number               : 24, //[23:0]
61                       transmit_count                  :  7, //[30:24]
62                       reserved_3a                     :  1; //[31]
63              uint32_t ack_frame_rssi                  :  8, //[7:0]
64                       sw_release_details_valid        :  1, //[8]
65                       first_msdu                      :  1, //[9]
66                       last_msdu                       :  1, //[10]
67                       msdu_part_of_amsdu              :  1, //[11]
68                       fw_tx_notify_frame              :  1, //[12]
69                       buffer_timestamp                : 19; //[31:13]
70     struct            tx_rate_stats_info                       tx_rate_stats;
71              uint32_t sw_peer_id                      : 16, //[15:0]
72                       tid                             :  4, //[19:16]
73                       ring_id                         :  8, //[27:20]
74                       looping_count                   :  4; //[31:28]
75 };
76 
77 /*
78 
79 struct buffer_addr_info released_buff_or_desc_addr_info
80 
81 			Consumer: WBM/SW/FW
82 
83 			Producer: SW/TQM/RXDMA/REO/SWITCH
84 
85 
86 
87 			Details of the physical address of the buffer or link
88 			descriptor that is being released. Note that within this
89 			descriptor, WBM will look at the 'owner' of the released
90 			buffer/descriptor and forward it to SW/FW is WBM is not the
91 			owner.
92 
93 release_source_module
94 
95 			Indicates which module initiated the release of this
96 			buffer or descriptor
97 
98 
99 
100 			<enum 0 release_source_TQM> TQM released this buffer or
101 			descriptor
102 
103 			<enum 1 release_source_RXDMA> RXDMA released this buffer
104 			or descriptor
105 
106 			<enum 2 release_source_REO> REO released this buffer or
107 			descriptor
108 
109 			<enum 3 release_source_FW> FW released this buffer or
110 			descriptor
111 
112 			<enum 4 release_source_SW> SW released this buffer or
113 			descriptor
114 
115 			<legal 0-4>
116 
117 bm_action
118 
119 			Consumer: WBM/SW/FW
120 
121 			Producer: SW/TQM/RXDMA/REO/SWITCH
122 
123 
124 
125 			Field only valid when the field return_buffer_manager in
126 			the Released_buff_or_desc_addr_info indicates:
127 
128 			WBM_IDLE_BUF_LIST or
129 
130 			WBM_IDLE_DESC_LIST
131 
132 
133 
134 			An MSDU extension descriptor shall never be marked as
135 
136 
137 
138 			<enum 0 Put_in_idle_list> Put the buffer or descriptor
139 			back in the idle list. In case of MSDU or MDPU link
140 			descriptor, BM does not need to check to release any
141 			individual MSDU buffers
142 
143 
144 
145 			<enum 1 release_msdu_list > This BM action can only be
146 			used in combination with buffer_or_desc_type being
147 			msdu_link_descriptor. Field first_msdu_index points out
148 			which MSDU pointer in the MSDU link descriptor is the first
149 			of an MPDU that is released.
150 
151 			BM shall release all the MSDU buffers linked to this
152 			first MSDU buffer pointer. All related MSDU buffer pointer
153 			entries shall be set to value 0, which represents the 'NULL
154 			pointer. When all MSDU buffer pointers in the MSDU link
155 			descriptor are 'NULL', the MSDU link descriptor itself shall
156 			also be released.
157 
158 
159 
160 			<enum 2 Put_in_idle_list_expanded> CURRENTLY NOT
161 			IMPLEMENTED....
162 
163 			Put the buffer or descriptor back in the idle list. Only
164 			valid in combination with buffer_or_desc_type indicating
165 			MDPU_link_descriptor.
166 
167 			BM shall release the MPDU link descriptor as well as all
168 			MSDUs that are linked to the MPDUs in this descriptor.
169 
170 
171 
172 			<legal 0-2>
173 
174 buffer_or_desc_type
175 
176 			Consumer: WBM/SW/FW
177 
178 			Producer: SW/TQM/RXDMA/REO/SWITCH
179 
180 
181 
182 			Field only valid when WBM is marked as the
183 			return_buffer_manager in the Released_Buffer_address_info
184 
185 
186 
187 			Indicates that type of buffer or descriptor is being
188 			released
189 
190 
191 
192 			<enum 0 MSDU_rel_buffer> The address points to an MSDU
193 			buffer
194 
195 			<enum 1 msdu_link_descriptor> The address points to an
196 			TX MSDU link descriptor
197 
198 			<enum 2 mpdu_link_descriptor> The address points to an
199 			MPDU link descriptor
200 
201 			<enum 3 msdu_ext_descriptor > The address points to an
202 			MSDU extension descriptor.
203 
204 			In case BM finds this one in a release ring, it passes
205 			it on to FW...
206 
207 			<enum 4 queue_ext_descriptor> The address points to an
208 			TQM queue extension descriptor. WBM should treat this is the
209 			same way as a link descriptor. That is, put the 128 byte
210 			buffer back in the link buffer idle list.
211 
212 
213 
214 			<legal 0-4>
215 
216 first_msdu_index
217 
218 			Consumer: WBM/SW/FW
219 
220 			Producer: SW/TQM/RXDMA/REO/SWITCH
221 
222 
223 
224 			Field only valid for the bm_action release_msdu_list.
225 
226 
227 
228 			The index of the first MSDU in an MSDU link descriptor
229 			all belonging to the same MPDU.
230 
231 
232 
233 			<legal 0-6>
234 
235 tqm_release_reason
236 
237 			Consumer: WBM/SW/FW
238 
239 			Producer: TQM
240 
241 
242 
243 			Field only valid when Release_source_module is set to
244 			release_source_TQM
245 
246 
247 
248 			(rr = Release Reason)
249 
250 			<enum 0 tqm_rr_frame_acked> frame is removed because an
251 			ACK of BA for it was received
252 
253 			<enum 1 tqm_rr_rem_cmd_rem> frame is removed because a
254 			remove command of type Remove_mpdus initiated by SW
255 
256 			<enum 2 tqm_rr_rem_cmd_tx> frame is removed because a
257 			remove command of type Remove_transmitted_mpdus initiated by
258 			SW
259 
260 			<enum 3 tqm_rr_rem_cmd_notx> frame is removed because a
261 			remove command of type Remove_untransmitted_mpdus initiated
262 			by SW
263 
264 			<enum 4 tqm_rr_rem_cmd_aged> frame is removed because a
265 			remove command of type Remove_aged_mpdus or
266 			Remove_aged_msdus initiated by SW
267 
268 			<enum 5 tqm_fw_reason1> frame is removed because a
269 			remove command where fw indicated that remove reason is
270 			fw_reason1
271 
272 			<enum 6 tqm_fw_reason2> frame is removed because a
273 			remove command where fw indicated that remove reason is
274 			fw_reason1
275 
276 			<enum 7 tqm_fw_reason3> frame is removed because a
277 			remove command where fw indicated that remove reason is
278 			fw_reason1
279 
280 
281 
282 			<legal 0-7>
283 
284 rxdma_push_reason
285 
286 			Field only valid when Release_source_module is set to
287 			release_source_RXDMA
288 
289 
290 
291 			Indicates why rxdma pushed the frame to this ring
292 
293 
294 
295 			<enum 0 rxdma_error_detected> RXDMA detected an error an
296 			pushed this frame to this queue
297 
298 			<enum 1 rxdma_routing_instruction> RXDMA pushed the
299 			frame to this queue per received routing instructions. No
300 			error within RXDMA was detected
301 
302 
303 
304 			<legal 0 - 1>
305 
306 rxdma_error_code
307 
308 			Field only valid when 'rxdma_push_reason' set to
309 			'rxdma_error_detected'.
310 
311 
312 
313 			<enum 0 rxdma_overflow_err>MPDU frame is not complete
314 			due to a FIFO overflow error in RXPCU.
315 
316 			<enum 1 rxdma_mpdu_length_err>MPDU frame is not complete
317 			due to receiving incomplete MPDU from the PHY
318 
319 
320 			<enum 3 rxdma_decrypt_err>CRYPTO reported a decryption
321 			error
322 
323 			<enum 4 rxdma_tkip_mic_err>CRYPTO reported a TKIP MIC
324 			error
325 
326 			<enum 5 rxdma_unecrypted_err>CRYPTO reported an
327 			unencrypted frame error when encrypted was expected
328 
329 			<enum 6 rxdma_msdu_len_err>RX OLE reported an MSDU
330 			length error
331 
332 			<enum 7 rxdma_msdu_limit_err>RX OLE reported that max
333 			number of MSDUs allowed in an MPDU got exceeded
334 
335 			<enum 8 rxdma_wifi_parse_err>RX OLE reported a parsing
336 			error
337 
338 			<enum 9 rxdma_amsdu_parse_err>RX OLE reported an A-MSDU
339 			parsing error
340 
341 			<enum 10 rxdma_sa_timeout_err>RX OLE reported a timeout
342 			during SA search
343 
344 			<enum 11 rxdma_da_timeout_err>RX OLE reported a timeout
345 			during DA search
346 
347 			<enum 12 rxdma_flow_timeout_err>RX OLE reported a
348 			timeout during flow search
349 
350 			<enum 13 Rxdma_flush_request>RXDMA received a flush
351 			request
352 
353 reo_push_reason
354 
355 			Field only valid when Release_source_module is set to
356 			release_source_REO
357 
358 
359 
360 			Indicates why REO pushed the frame to this release ring
361 
362 
363 
364 			<enum 0 reo_error_detected> Reo detected an error an
365 			pushed this frame to this queue
366 
367 			<enum 1 reo_routing_instruction> Reo pushed the frame to
368 			this queue per received routing instructions. No error
369 			within REO was detected
370 
371 
372 
373 			<legal 0 - 1>
374 
375 reo_error_code
376 
377 			Field only valid when 'Reo_push_reason' set to
378 			'reo_error_detected'.
379 
380 
381 
382 			<enum 0 reo_queue_desc_addr_zero> Reo queue descriptor
383 			provided in the REO_ENTRANCE ring is set to 0
384 
385 			<enum 1 reo_queue_desc_not_valid> Reo queue descriptor
386 			valid bit is NOT set
387 
388 			<enum 2 ampdu_in_non_ba> AMPDU frame received without BA
389 			session having been setup.
390 
391 			<enum 3 non_ba_duplicate> Non-BA session, SN equal to
392 			SSN, Retry bit set: duplicate frame
393 
394 			<enum 4 ba_duplicate> BA session, duplicate frame
395 
396 			<enum 5 regular_frame_2k_jump> A normal (management/data
397 			frame) received with 2K jump in SN
398 
399 			<enum 6 bar_frame_2k_jump> A bar received with 2K jump
400 			in SSN
401 
402 			<enum 7 regular_frame_OOR> A normal (management/data
403 			frame) received with SN falling within the OOR window
404 
405 			<enum 8 bar_frame_OOR> A bar received with SSN falling
406 			within the OOR window
407 
408 			<enum 9 bar_frame_no_ba_session> A bar received without
409 			a BA session
410 
411 			<enum 10 bar_frame_sn_equals_ssn> A bar received with
412 			SSN equal to SN
413 
414 			<enum 11 pn_check_failed> PN Check Failed packet.
415 
416 			<enum 12 2k_error_handling_flag_set> Frame is forwarded
417 			as a result of the 'Seq_2k_error_detected_flag' been set in
418 			the REO Queue descriptor
419 
420 			<enum 13 pn_error_handling_flag_set> Frame is forwarded
421 			as a result of the 'pn_error_detected_flag' been set in the
422 			REO Queue descriptor
423 
424 			<enum 14 queue_descriptor_blocked_set> Frame is
425 			forwarded as a result of the queue descriptor(address) being
426 			blocked as SW/FW seems to be currently in the process of
427 			making updates to this descriptor...
428 
429 
430 
431 			<legal 0-14>
432 
433 wbm_internal_error
434 
435 			Can only be set by WBM.
436 
437 
438 
439 			Is set when WBM got a buffer pointer but the action was
440 			to push it to the idle link descriptor ring or do link
441 			related activity
442 
443 			OR
444 
445 			Is set when WBM got a link buffer pointer but the action
446 			was to push it to the buffer  descriptor ring
447 
448 
449 
450 			<legal all>
451 
452 reserved_2
453 
454 			<legal 0>
455 
456 tqm_status_number
457 
458 			Field only valid when Release_source_module is set to
459 			release_source_TQM
460 
461 
462 
463 			The value in this field is equal to value of the
464 			'TQM_CMD_Number' field the TQM command or the
465 			'TQM_add_cmd_Number' field from the TQM entrance ring
466 			descriptor
467 
468 
469 
470 			This field helps to correlate the statuses with the TQM
471 			commands.
472 
473 
474 
475 			NOTE that SW could program this number to be equal to
476 			the PPDU_ID number in case direct correlation with the PPDU
477 			ID is desired
478 
479 
480 
481 			<legal all>
482 
483 transmit_count
484 
485 			Field only valid when Release_source_module is set to
486 			release_source_TQM
487 
488 
489 
490 			The number of times this frame has been transmitted
491 
492 reserved_3a
493 
494 			<legal 0>
495 
496 ack_frame_rssi
497 
498 			This field is only valid when the source is TQM.
499 
500 
501 
502 			If this frame is removed as the result of the reception
503 			of an ACK or BA, this field indicates the RSSI of the
504 			received ACK or BA frame.
505 
506 
507 
508 			When the frame is removed as result of a direct remove
509 			command from the SW,  this field is set to 0x0 (which is
510 			never a valid value when real RSSI is available)
511 
512 
513 
514 			<legal all>
515 
516 sw_release_details_valid
517 
518 			Consumer: SW
519 
520 			Producer: WBM
521 
522 
523 
524 			When set, some WBM specific release info for SW is
525 			valid.
526 
527 			This is set when WMB got a 'release_msdu_list' command
528 			from TQM and the return buffer manager is not WMB. WBM will
529 			then de-aggregate all the MSDUs and pass them one at a time
530 			on to the 'buffer owner'
531 
532 
533 
534 			<legal all>
535 
536 first_msdu
537 
538 			Field only valid when SW_release_details_valid is set.
539 
540 
541 
542 			Consumer: SW
543 
544 			Producer: WBM
545 
546 
547 
548 			When set, this MSDU is the first MSDU pointed to in the
549 			'release_msdu_list' command.
550 
551 
552 
553 			<legal all>
554 
555 last_msdu
556 
557 			Field only valid when SW_release_details_valid is set.
558 
559 
560 
561 			Consumer: SW
562 
563 			Producer: WBM
564 
565 
566 
567 			When set, this MSDU is the last MSDU pointed to in the
568 			'release_msdu_list' command.
569 
570 
571 
572 			<legal all>
573 
574 msdu_part_of_amsdu
575 
576 			Field only valid when SW_release_details_valid is set.
577 
578 
579 
580 			Consumer: SW
581 
582 			Producer: WBM
583 
584 
585 
586 			When set, this MSDU was part of an A-MSDU in MPDU
587 
588 			<legal all>
589 
590 fw_tx_notify_frame
591 
592 			Field only valid when SW_release_details_valid is set.
593 
594 
595 
596 			Consumer: SW
597 
598 			Producer: WBM
599 
600 
601 
602 			This is the FW_tx_notify_frame field from the
603 
604 			<legal all>
605 
606 buffer_timestamp
607 
608 			Field only valid when SW_release_details_valid is set.
609 
610 
611 
612 			Consumer: SW
613 
614 			Producer: WBM
615 
616 
617 
618 			This is the Buffer_timestamp field from the
619 
620 			<legal all>
621 
622 struct tx_rate_stats_info tx_rate_stats
623 
624 			Consumer: TQM
625 
626 			Producer: SW/SCH(from TXPCU, PDG)
627 
628 
629 
630 			Details for command execution tracking purposes.
631 
632 sw_peer_id
633 
634 			Field only valid when Release_source_module is set to
635 			release_source_TQM
636 
637 
638 
639 			Sw_peer_id from the TX_MSDU_FLOW descriptor or
640 			TX_MPDU_QUEUE descriptor
641 
642 			<legal all>
643 
644 tid
645 
646 			Field only valid when Release_source_module is set to
647 			release_source_TQM
648 
649 
650 
651 			TID of the flow or MPDU queue
652 
653 			<legal all>
654 
655 ring_id
656 
657 			Consumer: TQM/REO/RXDMA/SW
658 
659 			Producer: SRNG (of RXDMA)
660 
661 
662 
663 			For debugging.
664 
665 			This field is filled in by the SRNG module.
666 
667 			It help to identify the ring that is being looked <legal
668 			all>
669 
670 looping_count
671 
672 			Consumer: WBM/SW/FW
673 
674 			Producer: SW/TQM/RXDMA/REO/SWITCH
675 
676 
677 
678 			A count value that indicates the number of times the
679 			producer of entries into the Buffer Manager Ring has looped
680 			around the ring.
681 
682 			At initialization time, this value is set to 0. On the
683 			first loop, this value is set to 1. After the max value is
684 			reached allowed by the number of bits for this field, the
685 			count value continues with 0 again.
686 
687 
688 
689 			In case SW is the consumer of the ring entries, it can
690 			use this field to figure out up to where the producer of
691 			entries has created new entries. This eliminates the need to
692 			check where the head pointer' of the ring is located once
693 			the SW starts processing an interrupt indicating that new
694 			entries have been put into this ring...
695 
696 
697 
698 			Also note that SW if it wants only needs to look at the
699 			LSB bit of this count value.
700 
701 			<legal all>
702 */
703 
704 #define WBM_RELEASE_RING_0_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_OFFSET 0x00000000
705 #define WBM_RELEASE_RING_0_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_LSB 28
706 #define WBM_RELEASE_RING_0_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_MASK 0xffffffff
707 #define WBM_RELEASE_RING_1_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_OFFSET 0x00000004
708 #define WBM_RELEASE_RING_1_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_LSB 28
709 #define WBM_RELEASE_RING_1_BUFFER_ADDR_INFO_RELEASED_BUFF_OR_DESC_ADDR_INFO_MASK 0xffffffff
710 
711 /* Description		WBM_RELEASE_RING_2_RELEASE_SOURCE_MODULE
712 
713 			Indicates which module initiated the release of this
714 			buffer or descriptor
715 
716 
717 
718 			<enum 0 release_source_TQM> TQM released this buffer or
719 			descriptor
720 
721 			<enum 1 release_source_RXDMA> RXDMA released this buffer
722 			or descriptor
723 
724 			<enum 2 release_source_REO> REO released this buffer or
725 			descriptor
726 
727 			<enum 3 release_source_FW> FW released this buffer or
728 			descriptor
729 
730 			<enum 4 release_source_SW> SW released this buffer or
731 			descriptor
732 
733 			<legal 0-4>
734 */
735 #define WBM_RELEASE_RING_2_RELEASE_SOURCE_MODULE_OFFSET              0x00000008
736 #define WBM_RELEASE_RING_2_RELEASE_SOURCE_MODULE_LSB                 0
737 #define WBM_RELEASE_RING_2_RELEASE_SOURCE_MODULE_MASK                0x00000007
738 
739 /* Description		WBM_RELEASE_RING_2_BM_ACTION
740 
741 			Consumer: WBM/SW/FW
742 
743 			Producer: SW/TQM/RXDMA/REO/SWITCH
744 
745 
746 
747 			Field only valid when the field return_buffer_manager in
748 			the Released_buff_or_desc_addr_info indicates:
749 
750 			WBM_IDLE_BUF_LIST or
751 
752 			WBM_IDLE_DESC_LIST
753 
754 
755 
756 			An MSDU extension descriptor shall never be marked as
757 
758 
759 
760 			<enum 0 Put_in_idle_list> Put the buffer or descriptor
761 			back in the idle list. In case of MSDU or MDPU link
762 			descriptor, BM does not need to check to release any
763 			individual MSDU buffers
764 
765 
766 
767 			<enum 1 release_msdu_list > This BM action can only be
768 			used in combination with buffer_or_desc_type being
769 			msdu_link_descriptor. Field first_msdu_index points out
770 			which MSDU pointer in the MSDU link descriptor is the first
771 			of an MPDU that is released.
772 
773 			BM shall release all the MSDU buffers linked to this
774 			first MSDU buffer pointer. All related MSDU buffer pointer
775 			entries shall be set to value 0, which represents the 'NULL
776 			pointer. When all MSDU buffer pointers in the MSDU link
777 			descriptor are 'NULL', the MSDU link descriptor itself shall
778 			also be released.
779 
780 
781 
782 			<enum 2 Put_in_idle_list_expanded> CURRENTLY NOT
783 			IMPLEMENTED....
784 
785 			Put the buffer or descriptor back in the idle list. Only
786 			valid in combination with buffer_or_desc_type indicating
787 			MDPU_link_descriptor.
788 
789 			BM shall release the MPDU link descriptor as well as all
790 			MSDUs that are linked to the MPDUs in this descriptor.
791 
792 
793 
794 			<legal 0-2>
795 */
796 #define WBM_RELEASE_RING_2_BM_ACTION_OFFSET                          0x00000008
797 #define WBM_RELEASE_RING_2_BM_ACTION_LSB                             3
798 #define WBM_RELEASE_RING_2_BM_ACTION_MASK                            0x00000038
799 
800 /* Description		WBM_RELEASE_RING_2_BUFFER_OR_DESC_TYPE
801 
802 			Consumer: WBM/SW/FW
803 
804 			Producer: SW/TQM/RXDMA/REO/SWITCH
805 
806 
807 
808 			Field only valid when WBM is marked as the
809 			return_buffer_manager in the Released_Buffer_address_info
810 
811 
812 
813 			Indicates that type of buffer or descriptor is being
814 			released
815 
816 
817 
818 			<enum 0 MSDU_rel_buffer> The address points to an MSDU
819 			buffer
820 
821 			<enum 1 msdu_link_descriptor> The address points to an
822 			TX MSDU link descriptor
823 
824 			<enum 2 mpdu_link_descriptor> The address points to an
825 			MPDU link descriptor
826 
827 			<enum 3 msdu_ext_descriptor > The address points to an
828 			MSDU extension descriptor.
829 
830 			In case BM finds this one in a release ring, it passes
831 			it on to FW...
832 
833 			<enum 4 queue_ext_descriptor> The address points to an
834 			TQM queue extension descriptor. WBM should treat this is the
835 			same way as a link descriptor. That is, put the 128 byte
836 			buffer back in the link buffer idle list.
837 
838 
839 
840 			<legal 0-4>
841 */
842 #define WBM_RELEASE_RING_2_BUFFER_OR_DESC_TYPE_OFFSET                0x00000008
843 #define WBM_RELEASE_RING_2_BUFFER_OR_DESC_TYPE_LSB                   6
844 #define WBM_RELEASE_RING_2_BUFFER_OR_DESC_TYPE_MASK                  0x000001c0
845 
846 /* Description		WBM_RELEASE_RING_2_FIRST_MSDU_INDEX
847 
848 			Consumer: WBM/SW/FW
849 
850 			Producer: SW/TQM/RXDMA/REO/SWITCH
851 
852 
853 
854 			Field only valid for the bm_action release_msdu_list.
855 
856 
857 
858 			The index of the first MSDU in an MSDU link descriptor
859 			all belonging to the same MPDU.
860 
861 
862 
863 			<legal 0-6>
864 */
865 #define WBM_RELEASE_RING_2_FIRST_MSDU_INDEX_OFFSET                   0x00000008
866 #define WBM_RELEASE_RING_2_FIRST_MSDU_INDEX_LSB                      9
867 #define WBM_RELEASE_RING_2_FIRST_MSDU_INDEX_MASK                     0x00001e00
868 
869 /* Description		WBM_RELEASE_RING_2_TQM_RELEASE_REASON
870 
871 			Consumer: WBM/SW/FW
872 
873 			Producer: TQM
874 
875 
876 
877 			Field only valid when Release_source_module is set to
878 			release_source_TQM
879 
880 
881 
882 			(rr = Release Reason)
883 
884 			<enum 0 tqm_rr_frame_acked> frame is removed because an
885 			ACK of BA for it was received
886 
887 			<enum 1 tqm_rr_rem_cmd_rem> frame is removed because a
888 			remove command of type Remove_mpdus initiated by SW
889 
890 			<enum 2 tqm_rr_rem_cmd_tx> frame is removed because a
891 			remove command of type Remove_transmitted_mpdus initiated by
892 			SW
893 
894 			<enum 3 tqm_rr_rem_cmd_notx> frame is removed because a
895 			remove command of type Remove_untransmitted_mpdus initiated
896 			by SW
897 
898 			<enum 4 tqm_rr_rem_cmd_aged> frame is removed because a
899 			remove command of type Remove_aged_mpdus or
900 			Remove_aged_msdus initiated by SW
901 
902 			<enum 5 tqm_fw_reason1> frame is removed because a
903 			remove command where fw indicated that remove reason is
904 			fw_reason1
905 
906 			<enum 6 tqm_fw_reason2> frame is removed because a
907 			remove command where fw indicated that remove reason is
908 			fw_reason1
909 
910 			<enum 7 tqm_fw_reason3> frame is removed because a
911 			remove command where fw indicated that remove reason is
912 			fw_reason1
913 
914 
915 
916 			<legal 0-7>
917 */
918 #define WBM_RELEASE_RING_2_TQM_RELEASE_REASON_OFFSET                 0x00000008
919 #define WBM_RELEASE_RING_2_TQM_RELEASE_REASON_LSB                    13
920 #define WBM_RELEASE_RING_2_TQM_RELEASE_REASON_MASK                   0x0000e000
921 
922 /* Description		WBM_RELEASE_RING_2_RXDMA_PUSH_REASON
923 
924 			Field only valid when Release_source_module is set to
925 			release_source_RXDMA
926 
927 
928 
929 			Indicates why rxdma pushed the frame to this ring
930 
931 
932 
933 			<enum 0 rxdma_error_detected> RXDMA detected an error an
934 			pushed this frame to this queue
935 
936 			<enum 1 rxdma_routing_instruction> RXDMA pushed the
937 			frame to this queue per received routing instructions. No
938 			error within RXDMA was detected
939 
940 
941 
942 			<legal 0 - 1>
943 */
944 #define WBM_RELEASE_RING_2_RXDMA_PUSH_REASON_OFFSET                  0x00000008
945 #define WBM_RELEASE_RING_2_RXDMA_PUSH_REASON_LSB                     16
946 #define WBM_RELEASE_RING_2_RXDMA_PUSH_REASON_MASK                    0x00030000
947 
948 /* Description		WBM_RELEASE_RING_2_RXDMA_ERROR_CODE
949 
950 			Field only valid when 'rxdma_push_reason' set to
951 			'rxdma_error_detected'.
952 
953 
954 
955 			<enum 0 rxdma_overflow_err>MPDU frame is not complete
956 			due to a FIFO overflow error in RXPCU.
957 
958 			<enum 1 rxdma_mpdu_length_err>MPDU frame is not complete
959 			due to receiving incomplete MPDU from the PHY
960 
961 
962 			<enum 3 rxdma_decrypt_err>CRYPTO reported a decryption
963 			error
964 
965 			<enum 4 rxdma_tkip_mic_err>CRYPTO reported a TKIP MIC
966 			error
967 
968 			<enum 5 rxdma_unecrypted_err>CRYPTO reported an
969 			unencrypted frame error when encrypted was expected
970 
971 			<enum 6 rxdma_msdu_len_err>RX OLE reported an MSDU
972 			length error
973 
974 			<enum 7 rxdma_msdu_limit_err>RX OLE reported that max
975 			number of MSDUs allowed in an MPDU got exceeded
976 
977 			<enum 8 rxdma_wifi_parse_err>RX OLE reported a parsing
978 			error
979 
980 			<enum 9 rxdma_amsdu_parse_err>RX OLE reported an A-MSDU
981 			parsing error
982 
983 			<enum 10 rxdma_sa_timeout_err>RX OLE reported a timeout
984 			during SA search
985 
986 			<enum 11 rxdma_da_timeout_err>RX OLE reported a timeout
987 			during DA search
988 
989 			<enum 12 rxdma_flow_timeout_err>RX OLE reported a
990 			timeout during flow search
991 
992 			<enum 13 Rxdma_flush_request>RXDMA received a flush
993 			request
994 */
995 #define WBM_RELEASE_RING_2_RXDMA_ERROR_CODE_OFFSET                   0x00000008
996 #define WBM_RELEASE_RING_2_RXDMA_ERROR_CODE_LSB                      18
997 #define WBM_RELEASE_RING_2_RXDMA_ERROR_CODE_MASK                     0x007c0000
998 
999 /* Description		WBM_RELEASE_RING_2_REO_PUSH_REASON
1000 
1001 			Field only valid when Release_source_module is set to
1002 			release_source_REO
1003 
1004 
1005 
1006 			Indicates why REO pushed the frame to this release ring
1007 
1008 
1009 
1010 			<enum 0 reo_error_detected> Reo detected an error an
1011 			pushed this frame to this queue
1012 
1013 			<enum 1 reo_routing_instruction> Reo pushed the frame to
1014 			this queue per received routing instructions. No error
1015 			within REO was detected
1016 
1017 
1018 
1019 			<legal 0 - 1>
1020 */
1021 #define WBM_RELEASE_RING_2_REO_PUSH_REASON_OFFSET                    0x00000008
1022 #define WBM_RELEASE_RING_2_REO_PUSH_REASON_LSB                       23
1023 #define WBM_RELEASE_RING_2_REO_PUSH_REASON_MASK                      0x01800000
1024 
1025 /* Description		WBM_RELEASE_RING_2_REO_ERROR_CODE
1026 
1027 			Field only valid when 'Reo_push_reason' set to
1028 			'reo_error_detected'.
1029 
1030 
1031 
1032 			<enum 0 reo_queue_desc_addr_zero> Reo queue descriptor
1033 			provided in the REO_ENTRANCE ring is set to 0
1034 
1035 			<enum 1 reo_queue_desc_not_valid> Reo queue descriptor
1036 			valid bit is NOT set
1037 
1038 			<enum 2 ampdu_in_non_ba> AMPDU frame received without BA
1039 			session having been setup.
1040 
1041 			<enum 3 non_ba_duplicate> Non-BA session, SN equal to
1042 			SSN, Retry bit set: duplicate frame
1043 
1044 			<enum 4 ba_duplicate> BA session, duplicate frame
1045 
1046 			<enum 5 regular_frame_2k_jump> A normal (management/data
1047 			frame) received with 2K jump in SN
1048 
1049 			<enum 6 bar_frame_2k_jump> A bar received with 2K jump
1050 			in SSN
1051 
1052 			<enum 7 regular_frame_OOR> A normal (management/data
1053 			frame) received with SN falling within the OOR window
1054 
1055 			<enum 8 bar_frame_OOR> A bar received with SSN falling
1056 			within the OOR window
1057 
1058 			<enum 9 bar_frame_no_ba_session> A bar received without
1059 			a BA session
1060 
1061 			<enum 10 bar_frame_sn_equals_ssn> A bar received with
1062 			SSN equal to SN
1063 
1064 			<enum 11 pn_check_failed> PN Check Failed packet.
1065 
1066 			<enum 12 2k_error_handling_flag_set> Frame is forwarded
1067 			as a result of the 'Seq_2k_error_detected_flag' been set in
1068 			the REO Queue descriptor
1069 
1070 			<enum 13 pn_error_handling_flag_set> Frame is forwarded
1071 			as a result of the 'pn_error_detected_flag' been set in the
1072 			REO Queue descriptor
1073 
1074 			<enum 14 queue_descriptor_blocked_set> Frame is
1075 			forwarded as a result of the queue descriptor(address) being
1076 			blocked as SW/FW seems to be currently in the process of
1077 			making updates to this descriptor...
1078 
1079 
1080 
1081 			<legal 0-14>
1082 */
1083 #define WBM_RELEASE_RING_2_REO_ERROR_CODE_OFFSET                     0x00000008
1084 #define WBM_RELEASE_RING_2_REO_ERROR_CODE_LSB                        25
1085 #define WBM_RELEASE_RING_2_REO_ERROR_CODE_MASK                       0x3e000000
1086 
1087 /* Description		WBM_RELEASE_RING_2_WBM_INTERNAL_ERROR
1088 
1089 			Can only be set by WBM.
1090 
1091 
1092 
1093 			Is set when WBM got a buffer pointer but the action was
1094 			to push it to the idle link descriptor ring or do link
1095 			related activity
1096 
1097 			OR
1098 
1099 			Is set when WBM got a link buffer pointer but the action
1100 			was to push it to the buffer  descriptor ring
1101 
1102 
1103 
1104 			<legal all>
1105 */
1106 #define WBM_RELEASE_RING_2_WBM_INTERNAL_ERROR_OFFSET                 0x00000008
1107 #define WBM_RELEASE_RING_2_WBM_INTERNAL_ERROR_LSB                    30
1108 #define WBM_RELEASE_RING_2_WBM_INTERNAL_ERROR_MASK                   0x40000000
1109 
1110 /* Description		WBM_RELEASE_RING_2_RESERVED_2
1111 
1112 			<legal 0>
1113 */
1114 #define WBM_RELEASE_RING_2_RESERVED_2_OFFSET                         0x00000008
1115 #define WBM_RELEASE_RING_2_RESERVED_2_LSB                            31
1116 #define WBM_RELEASE_RING_2_RESERVED_2_MASK                           0x80000000
1117 
1118 /* Description		WBM_RELEASE_RING_3_TQM_STATUS_NUMBER
1119 
1120 			Field only valid when Release_source_module is set to
1121 			release_source_TQM
1122 
1123 
1124 
1125 			The value in this field is equal to value of the
1126 			'TQM_CMD_Number' field the TQM command or the
1127 			'TQM_add_cmd_Number' field from the TQM entrance ring
1128 			descriptor
1129 
1130 
1131 
1132 			This field helps to correlate the statuses with the TQM
1133 			commands.
1134 
1135 
1136 
1137 			NOTE that SW could program this number to be equal to
1138 			the PPDU_ID number in case direct correlation with the PPDU
1139 			ID is desired
1140 
1141 
1142 
1143 			<legal all>
1144 */
1145 #define WBM_RELEASE_RING_3_TQM_STATUS_NUMBER_OFFSET                  0x0000000c
1146 #define WBM_RELEASE_RING_3_TQM_STATUS_NUMBER_LSB                     0
1147 #define WBM_RELEASE_RING_3_TQM_STATUS_NUMBER_MASK                    0x00ffffff
1148 
1149 /* Description		WBM_RELEASE_RING_3_TRANSMIT_COUNT
1150 
1151 			Field only valid when Release_source_module is set to
1152 			release_source_TQM
1153 
1154 
1155 
1156 			The number of times this frame has been transmitted
1157 */
1158 #define WBM_RELEASE_RING_3_TRANSMIT_COUNT_OFFSET                     0x0000000c
1159 #define WBM_RELEASE_RING_3_TRANSMIT_COUNT_LSB                        24
1160 #define WBM_RELEASE_RING_3_TRANSMIT_COUNT_MASK                       0x7f000000
1161 
1162 /* Description		WBM_RELEASE_RING_3_RESERVED_3A
1163 
1164 			<legal 0>
1165 */
1166 #define WBM_RELEASE_RING_3_RESERVED_3A_OFFSET                        0x0000000c
1167 #define WBM_RELEASE_RING_3_RESERVED_3A_LSB                           31
1168 #define WBM_RELEASE_RING_3_RESERVED_3A_MASK                          0x80000000
1169 
1170 /* Description		WBM_RELEASE_RING_4_ACK_FRAME_RSSI
1171 
1172 			This field is only valid when the source is TQM.
1173 
1174 
1175 
1176 			If this frame is removed as the result of the reception
1177 			of an ACK or BA, this field indicates the RSSI of the
1178 			received ACK or BA frame.
1179 
1180 
1181 
1182 			When the frame is removed as result of a direct remove
1183 			command from the SW,  this field is set to 0x0 (which is
1184 			never a valid value when real RSSI is available)
1185 
1186 
1187 
1188 			<legal all>
1189 */
1190 #define WBM_RELEASE_RING_4_ACK_FRAME_RSSI_OFFSET                     0x00000010
1191 #define WBM_RELEASE_RING_4_ACK_FRAME_RSSI_LSB                        0
1192 #define WBM_RELEASE_RING_4_ACK_FRAME_RSSI_MASK                       0x000000ff
1193 
1194 /* Description		WBM_RELEASE_RING_4_SW_RELEASE_DETAILS_VALID
1195 
1196 			Consumer: SW
1197 
1198 			Producer: WBM
1199 
1200 
1201 
1202 			When set, some WBM specific release info for SW is
1203 			valid.
1204 
1205 			This is set when WMB got a 'release_msdu_list' command
1206 			from TQM and the return buffer manager is not WMB. WBM will
1207 			then de-aggregate all the MSDUs and pass them one at a time
1208 			on to the 'buffer owner'
1209 
1210 
1211 
1212 			<legal all>
1213 */
1214 #define WBM_RELEASE_RING_4_SW_RELEASE_DETAILS_VALID_OFFSET           0x00000010
1215 #define WBM_RELEASE_RING_4_SW_RELEASE_DETAILS_VALID_LSB              8
1216 #define WBM_RELEASE_RING_4_SW_RELEASE_DETAILS_VALID_MASK             0x00000100
1217 
1218 /* Description		WBM_RELEASE_RING_4_FIRST_MSDU
1219 
1220 			Field only valid when SW_release_details_valid is set.
1221 
1222 
1223 
1224 			Consumer: SW
1225 
1226 			Producer: WBM
1227 
1228 
1229 
1230 			When set, this MSDU is the first MSDU pointed to in the
1231 			'release_msdu_list' command.
1232 
1233 
1234 
1235 			<legal all>
1236 */
1237 #define WBM_RELEASE_RING_4_FIRST_MSDU_OFFSET                         0x00000010
1238 #define WBM_RELEASE_RING_4_FIRST_MSDU_LSB                            9
1239 #define WBM_RELEASE_RING_4_FIRST_MSDU_MASK                           0x00000200
1240 
1241 /* Description		WBM_RELEASE_RING_4_LAST_MSDU
1242 
1243 			Field only valid when SW_release_details_valid is set.
1244 
1245 
1246 
1247 			Consumer: SW
1248 
1249 			Producer: WBM
1250 
1251 
1252 
1253 			When set, this MSDU is the last MSDU pointed to in the
1254 			'release_msdu_list' command.
1255 
1256 
1257 
1258 			<legal all>
1259 */
1260 #define WBM_RELEASE_RING_4_LAST_MSDU_OFFSET                          0x00000010
1261 #define WBM_RELEASE_RING_4_LAST_MSDU_LSB                             10
1262 #define WBM_RELEASE_RING_4_LAST_MSDU_MASK                            0x00000400
1263 
1264 /* Description		WBM_RELEASE_RING_4_MSDU_PART_OF_AMSDU
1265 
1266 			Field only valid when SW_release_details_valid is set.
1267 
1268 
1269 
1270 			Consumer: SW
1271 
1272 			Producer: WBM
1273 
1274 
1275 
1276 			When set, this MSDU was part of an A-MSDU in MPDU
1277 
1278 			<legal all>
1279 */
1280 #define WBM_RELEASE_RING_4_MSDU_PART_OF_AMSDU_OFFSET                 0x00000010
1281 #define WBM_RELEASE_RING_4_MSDU_PART_OF_AMSDU_LSB                    11
1282 #define WBM_RELEASE_RING_4_MSDU_PART_OF_AMSDU_MASK                   0x00000800
1283 
1284 /* Description		WBM_RELEASE_RING_4_FW_TX_NOTIFY_FRAME
1285 
1286 			Field only valid when SW_release_details_valid is set.
1287 
1288 
1289 
1290 			Consumer: SW
1291 
1292 			Producer: WBM
1293 
1294 
1295 
1296 			This is the FW_tx_notify_frame field from the
1297 
1298 			<legal all>
1299 */
1300 #define WBM_RELEASE_RING_4_FW_TX_NOTIFY_FRAME_OFFSET                 0x00000010
1301 #define WBM_RELEASE_RING_4_FW_TX_NOTIFY_FRAME_LSB                    12
1302 #define WBM_RELEASE_RING_4_FW_TX_NOTIFY_FRAME_MASK                   0x00001000
1303 
1304 /* Description		WBM_RELEASE_RING_4_BUFFER_TIMESTAMP
1305 
1306 			Field only valid when SW_release_details_valid is set.
1307 
1308 
1309 
1310 			Consumer: SW
1311 
1312 			Producer: WBM
1313 
1314 
1315 
1316 			This is the Buffer_timestamp field from the
1317 
1318 			<legal all>
1319 */
1320 #define WBM_RELEASE_RING_4_BUFFER_TIMESTAMP_OFFSET                   0x00000010
1321 #define WBM_RELEASE_RING_4_BUFFER_TIMESTAMP_LSB                      13
1322 #define WBM_RELEASE_RING_4_BUFFER_TIMESTAMP_MASK                     0xffffe000
1323 #define WBM_RELEASE_RING_5_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET   0x00000014
1324 #define WBM_RELEASE_RING_5_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB      13
1325 #define WBM_RELEASE_RING_5_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK     0xffffffff
1326 #define WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_OFFSET   0x00000018
1327 #define WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_LSB      13
1328 #define WBM_RELEASE_RING_6_TX_RATE_STATS_INFO_TX_RATE_STATS_MASK     0xffffffff
1329 
1330 /* Description		WBM_RELEASE_RING_7_SW_PEER_ID
1331 
1332 			Field only valid when Release_source_module is set to
1333 			release_source_TQM
1334 
1335 
1336 
1337 			Sw_peer_id from the TX_MSDU_FLOW descriptor or
1338 			TX_MPDU_QUEUE descriptor
1339 
1340 			<legal all>
1341 */
1342 #define WBM_RELEASE_RING_7_SW_PEER_ID_OFFSET                         0x0000001c
1343 #define WBM_RELEASE_RING_7_SW_PEER_ID_LSB                            0
1344 #define WBM_RELEASE_RING_7_SW_PEER_ID_MASK                           0x0000ffff
1345 
1346 /* Description		WBM_RELEASE_RING_7_TID
1347 
1348 			Field only valid when Release_source_module is set to
1349 			release_source_TQM
1350 
1351 
1352 
1353 			TID of the flow or MPDU queue
1354 
1355 			<legal all>
1356 */
1357 #define WBM_RELEASE_RING_7_TID_OFFSET                                0x0000001c
1358 #define WBM_RELEASE_RING_7_TID_LSB                                   16
1359 #define WBM_RELEASE_RING_7_TID_MASK                                  0x000f0000
1360 
1361 /* Description		WBM_RELEASE_RING_7_RING_ID
1362 
1363 			Consumer: TQM/REO/RXDMA/SW
1364 
1365 			Producer: SRNG (of RXDMA)
1366 
1367 
1368 
1369 			For debugging.
1370 
1371 			This field is filled in by the SRNG module.
1372 
1373 			It help to identify the ring that is being looked <legal
1374 			all>
1375 */
1376 #define WBM_RELEASE_RING_7_RING_ID_OFFSET                            0x0000001c
1377 #define WBM_RELEASE_RING_7_RING_ID_LSB                               20
1378 #define WBM_RELEASE_RING_7_RING_ID_MASK                              0x0ff00000
1379 
1380 /* Description		WBM_RELEASE_RING_7_LOOPING_COUNT
1381 
1382 			Consumer: WBM/SW/FW
1383 
1384 			Producer: SW/TQM/RXDMA/REO/SWITCH
1385 
1386 
1387 
1388 			A count value that indicates the number of times the
1389 			producer of entries into the Buffer Manager Ring has looped
1390 			around the ring.
1391 
1392 			At initialization time, this value is set to 0. On the
1393 			first loop, this value is set to 1. After the max value is
1394 			reached allowed by the number of bits for this field, the
1395 			count value continues with 0 again.
1396 
1397 
1398 
1399 			In case SW is the consumer of the ring entries, it can
1400 			use this field to figure out up to where the producer of
1401 			entries has created new entries. This eliminates the need to
1402 			check where the head pointer' of the ring is located once
1403 			the SW starts processing an interrupt indicating that new
1404 			entries have been put into this ring...
1405 
1406 
1407 
1408 			Also note that SW if it wants only needs to look at the
1409 			LSB bit of this count value.
1410 
1411 			<legal all>
1412 */
1413 #define WBM_RELEASE_RING_7_LOOPING_COUNT_OFFSET                      0x0000001c
1414 #define WBM_RELEASE_RING_7_LOOPING_COUNT_LSB                         28
1415 #define WBM_RELEASE_RING_7_LOOPING_COUNT_MASK                        0xf0000000
1416 
1417 
1418 #endif // _WBM_RELEASE_RING_H_
1419