buffer_addr_info.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. #ifndef _BUFFER_ADDR_INFO_H_
  17. #define _BUFFER_ADDR_INFO_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. // ################ START SUMMARY #################
  21. //
  22. // Dword Fields
  23. // 0 buffer_addr_31_0[31:0]
  24. // 1 buffer_addr_39_32[7:0], return_buffer_manager[10:8], sw_buffer_cookie[31:11]
  25. //
  26. // ################ END SUMMARY #################
  27. #define NUM_OF_DWORDS_BUFFER_ADDR_INFO 2
  28. struct buffer_addr_info {
  29. uint32_t buffer_addr_31_0 : 32; //[31:0]
  30. uint32_t buffer_addr_39_32 : 8, //[7:0]
  31. return_buffer_manager : 3, //[10:8]
  32. sw_buffer_cookie : 21; //[31:11]
  33. };
  34. /*
  35. buffer_addr_31_0
  36. Address (lower 32 bits) of the MSDU buffer OR
  37. MSDU_EXTENSION descriptor OR Link Descriptor
  38. In case of 'NULL' pointer, this field is set to 0
  39. <legal all>
  40. buffer_addr_39_32
  41. Address (upper 8 bits) of the MSDU buffer OR
  42. MSDU_EXTENSION descriptor OR Link Descriptor
  43. In case of 'NULL' pointer, this field is set to 0
  44. <legal all>
  45. return_buffer_manager
  46. Consumer: WBM
  47. Producer: SW/FW
  48. In case of 'NULL' pointer, this field is set to 0
  49. Indicates to which buffer manager the buffer OR
  50. MSDU_EXTENSION descriptor OR link descriptor that is being
  51. pointed to shall be returned after the frame has been
  52. processed. It is used by WBM for routing purposes.
  53. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  54. to the WMB buffer idle list
  55. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  56. returned to the WMB idle link descriptor idle list
  57. <enum 2 FW_BM> This buffer shall be returned to the FW
  58. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  59. ring 0
  60. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  61. ring 1
  62. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  63. ring 2
  64. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  65. ring 3
  66. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  67. ring 4
  68. <legal all>
  69. sw_buffer_cookie
  70. Cookie field exclusively used by SW.
  71. In case of 'NULL' pointer, this field is set to 0
  72. HW ignores the contents, accept that it passes the
  73. programmed value on to other descriptors together with the
  74. physical address
  75. Field can be used by SW to for example associate the
  76. buffers physical address with the virtual address
  77. The bit definitions as used by SW are within SW HLD
  78. specification
  79. NOTE1:
  80. The three most significant bits can have a special
  81. meaning in case this struct is embedded in a TX_MPDU_DETAILS
  82. STRUCT, and field transmit_bw_restriction is set
  83. In case of NON punctured transmission:
  84. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  85. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  86. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  87. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  88. In case of punctured transmission:
  89. Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
  90. Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
  91. Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
  92. Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
  93. Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
  94. Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
  95. Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
  96. Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
  97. Note: a punctured transmission is indicated by the
  98. presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
  99. TLV
  100. NOTE 2:The five most significant bits can have a special
  101. meaning in case this struct is embedded in an
  102. RX_MSDU_DETAILS STRUCT, and Maple/Spruce Rx DMA is
  103. configured for passing on the additional info
  104. from 'RX_MPDU_INFO' structure in 'RX_MPDU_START' TLV
  105. (FR56821). This is not supported in HastingsPrime, Pine or
  106. Moselle.
  107. Sw_buffer_cookie[20:17]: Tid: The TID field in the QoS
  108. control field
  109. Sw_buffer_cookie[16]: Mpdu_qos_control_valid: This field
  110. indicates MPDUs with a QoS control field.
  111. <legal all>
  112. */
  113. /* Description BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0
  114. Address (lower 32 bits) of the MSDU buffer OR
  115. MSDU_EXTENSION descriptor OR Link Descriptor
  116. In case of 'NULL' pointer, this field is set to 0
  117. <legal all>
  118. */
  119. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_OFFSET 0x00000000
  120. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB 0
  121. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK 0xffffffff
  122. /* Description BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32
  123. Address (upper 8 bits) of the MSDU buffer OR
  124. MSDU_EXTENSION descriptor OR Link Descriptor
  125. In case of 'NULL' pointer, this field is set to 0
  126. <legal all>
  127. */
  128. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_OFFSET 0x00000004
  129. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB 0
  130. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK 0x000000ff
  131. /* Description BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER
  132. Consumer: WBM
  133. Producer: SW/FW
  134. In case of 'NULL' pointer, this field is set to 0
  135. Indicates to which buffer manager the buffer OR
  136. MSDU_EXTENSION descriptor OR link descriptor that is being
  137. pointed to shall be returned after the frame has been
  138. processed. It is used by WBM for routing purposes.
  139. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  140. to the WMB buffer idle list
  141. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  142. returned to the WMB idle link descriptor idle list
  143. <enum 2 FW_BM> This buffer shall be returned to the FW
  144. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  145. ring 0
  146. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  147. ring 1
  148. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  149. ring 2
  150. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  151. ring 3
  152. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  153. ring 4
  154. <legal all>
  155. */
  156. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  157. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB 8
  158. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK 0x00000700
  159. /* Description BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE
  160. Cookie field exclusively used by SW.
  161. In case of 'NULL' pointer, this field is set to 0
  162. HW ignores the contents, accept that it passes the
  163. programmed value on to other descriptors together with the
  164. physical address
  165. Field can be used by SW to for example associate the
  166. buffers physical address with the virtual address
  167. The bit definitions as used by SW are within SW HLD
  168. specification
  169. NOTE1:
  170. The three most significant bits can have a special
  171. meaning in case this struct is embedded in a TX_MPDU_DETAILS
  172. STRUCT, and field transmit_bw_restriction is set
  173. In case of NON punctured transmission:
  174. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  175. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  176. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  177. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  178. In case of punctured transmission:
  179. Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
  180. Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
  181. Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
  182. Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
  183. Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
  184. Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
  185. Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
  186. Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
  187. Note: a punctured transmission is indicated by the
  188. presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
  189. TLV
  190. NOTE 2:The five most significant bits can have a special
  191. meaning in case this struct is embedded in an
  192. RX_MSDU_DETAILS STRUCT, and Maple/Spruce Rx DMA is
  193. configured for passing on the additional info
  194. from 'RX_MPDU_INFO' structure in 'RX_MPDU_START' TLV
  195. (FR56821). This is not supported in HastingsPrime, Pine or
  196. Moselle.
  197. Sw_buffer_cookie[20:17]: Tid: The TID field in the QoS
  198. control field
  199. Sw_buffer_cookie[16]: Mpdu_qos_control_valid: This field
  200. indicates MPDUs with a QoS control field.
  201. <legal all>
  202. */
  203. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET 0x00000004
  204. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB 11
  205. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK 0xfffff800
  206. #endif // _BUFFER_ADDR_INFO_H_