mon_ingress_ring.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _MON_INGRESS_RING_H_
  16. #define _MON_INGRESS_RING_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #include "buffer_addr_info.h"
  20. #define NUM_OF_DWORDS_MON_INGRESS_RING 4
  21. struct mon_ingress_ring {
  22. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  23. struct buffer_addr_info buffer_addr_info_details;
  24. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  25. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  26. #else
  27. struct buffer_addr_info buffer_addr_info_details;
  28. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  29. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  30. #endif
  31. };
  32. /* Description BUFFER_ADDR_INFO_DETAILS
  33. Consumer: TXMON/RXMON
  34. Producer: SW
  35. Details of the physical address of the buffer
  36. 'Sw_buffer_cookie' and 'Return_buffer_manager' sub-fields
  37. are reserved and unused by TXMON/RXMON.
  38. */
  39. /* Description BUFFER_ADDR_31_0
  40. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  41. descriptor OR Link Descriptor
  42. In case of 'NULL' pointer, this field is set to 0
  43. <legal all>
  44. */
  45. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET 0x00000000
  46. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_LSB 0
  47. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_MSB 31
  48. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_MASK 0xffffffff
  49. /* Description BUFFER_ADDR_39_32
  50. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  51. descriptor OR Link Descriptor
  52. In case of 'NULL' pointer, this field is set to 0
  53. <legal all>
  54. */
  55. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_OFFSET 0x00000004
  56. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_LSB 0
  57. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_MSB 7
  58. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_39_32_MASK 0x000000ff
  59. /* Description RETURN_BUFFER_MANAGER
  60. Consumer: WBM
  61. Producer: SW/FW
  62. In case of 'NULL' pointer, this field is set to 0
  63. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  64. descriptor OR link descriptor that is being pointed to
  65. shall be returned after the frame has been processed. It
  66. is used by WBM for routing purposes.
  67. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  68. to the WMB buffer idle list
  69. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  70. to the WBM idle link descriptor idle list, where the chip
  71. 0 WBM is chosen in case of a multi-chip config
  72. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  73. to the chip 1 WBM idle link descriptor idle list
  74. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  75. to the chip 2 WBM idle link descriptor idle list
  76. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  77. returned to chip 3 WBM idle link descriptor idle list
  78. <enum 4 FW_BM> This buffer shall be returned to the FW
  79. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  80. ring 0
  81. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  82. ring 1
  83. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  84. ring 2
  85. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  86. ring 3
  87. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  88. ring 4
  89. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  90. ring 5
  91. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  92. ring 6
  93. <legal 0-12>
  94. */
  95. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  96. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_LSB 8
  97. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_MSB 11
  98. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  99. /* Description SW_BUFFER_COOKIE
  100. Cookie field exclusively used by SW.
  101. In case of 'NULL' pointer, this field is set to 0
  102. HW ignores the contents, accept that it passes the programmed
  103. value on to other descriptors together with the physical
  104. address
  105. Field can be used by SW to for example associate the buffers
  106. physical address with the virtual address
  107. The bit definitions as used by SW are within SW HLD specification
  108. NOTE1:
  109. The three most significant bits can have a special meaning
  110. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  111. and field transmit_bw_restriction is set
  112. In case of NON punctured transmission:
  113. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  114. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  115. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  116. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  117. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  118. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  119. Sw_buffer_cookie[19:18] = 2'b11: reserved
  120. In case of punctured transmission:
  121. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  122. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  123. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  124. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  125. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  126. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  127. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  128. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  129. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  130. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  131. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  132. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  133. Sw_buffer_cookie[19:18] = 2'b11: reserved
  134. Note: a punctured transmission is indicated by the presence
  135. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  136. <legal all>
  137. */
  138. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_OFFSET 0x00000004
  139. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_LSB 12
  140. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_MSB 31
  141. #define MON_INGRESS_RING_BUFFER_ADDR_INFO_DETAILS_SW_BUFFER_COOKIE_MASK 0xfffff000
  142. /* Description BUFFER_VIRT_ADDR_31_0
  143. Lower 32 bits of the 64-bit virtual address corresponding
  144. to Buffer_addr_info_details
  145. <legal all>
  146. */
  147. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_31_0_OFFSET 0x00000008
  148. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_31_0_LSB 0
  149. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_31_0_MSB 31
  150. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_31_0_MASK 0xffffffff
  151. /* Description BUFFER_VIRT_ADDR_63_32
  152. Upper 32 bits of the 64-bit virtual address corresponding
  153. to Buffer_addr_info_details
  154. <legal all>
  155. */
  156. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_63_32_OFFSET 0x0000000c
  157. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_63_32_LSB 0
  158. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_63_32_MSB 31
  159. #define MON_INGRESS_RING_BUFFER_VIRT_ADDR_63_32_MASK 0xffffffff
  160. #endif // MON_INGRESS_RING