buffer_addr_info.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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. #ifndef _BUFFER_ADDR_INFO_H_
  19. #define _BUFFER_ADDR_INFO_H_
  20. #if !defined(__ASSEMBLER__)
  21. #endif
  22. // ################ START SUMMARY #################
  23. //
  24. // Dword Fields
  25. // 0 buffer_addr_31_0[31:0]
  26. // 1 buffer_addr_39_32[7:0], return_buffer_manager[10:8], sw_buffer_cookie[31:11]
  27. //
  28. // ################ END SUMMARY #################
  29. #define NUM_OF_DWORDS_BUFFER_ADDR_INFO 2
  30. struct buffer_addr_info {
  31. uint32_t buffer_addr_31_0 : 32; //[31:0]
  32. uint32_t buffer_addr_39_32 : 8, //[7:0]
  33. return_buffer_manager : 3, //[10:8]
  34. sw_buffer_cookie : 21; //[31:11]
  35. };
  36. /*
  37. buffer_addr_31_0
  38. Address (lower 32 bits) of the MSDU buffer OR
  39. MSDU_EXTENSION descriptor OR Link Descriptor
  40. In case of 'NULL' pointer, this field is set to 0
  41. <legal all>
  42. buffer_addr_39_32
  43. Address (upper 8 bits) of the MSDU buffer OR
  44. MSDU_EXTENSION descriptor OR Link Descriptor
  45. In case of 'NULL' pointer, this field is set to 0
  46. <legal all>
  47. return_buffer_manager
  48. Consumer: WBM
  49. Producer: SW/FW
  50. In case of 'NULL' pointer, this field is set to 0
  51. Indicates to which buffer manager the buffer OR
  52. MSDU_EXTENSION descriptor OR link descriptor that is being
  53. pointed to shall be returned after the frame has been
  54. processed. It is used by WBM for routing purposes.
  55. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  56. to the WMB buffer idle list
  57. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  58. returned to the WMB idle link descriptor idle list
  59. <enum 2 FW_BM> This buffer shall be returned to the FW
  60. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  61. ring 0
  62. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  63. ring 1
  64. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  65. ring 2
  66. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  67. ring 3
  68. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  69. ring 4
  70. <legal all>
  71. sw_buffer_cookie
  72. Cookie field exclusively used by SW.
  73. In case of 'NULL' pointer, this field is set to 0
  74. HW ignores the contents, accept that it passes the
  75. programmed value on to other descriptors together with the
  76. physical address
  77. Field can be used by SW to for example associate the
  78. buffers physical address with the virtual address
  79. The bit definitions as used by SW are within SW HLD
  80. specification
  81. NOTE:
  82. The two most significant bits can have a special meaning
  83. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  84. and field transmit_bw_restriction is set
  85. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  86. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  87. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  88. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  89. <legal all>
  90. */
  91. /* Description BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0
  92. Address (lower 32 bits) of the MSDU buffer OR
  93. MSDU_EXTENSION descriptor OR Link Descriptor
  94. In case of 'NULL' pointer, this field is set to 0
  95. <legal all>
  96. */
  97. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_OFFSET 0x00000000
  98. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_LSB 0
  99. #define BUFFER_ADDR_INFO_0_BUFFER_ADDR_31_0_MASK 0xffffffff
  100. /* Description BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32
  101. Address (upper 8 bits) of the MSDU buffer OR
  102. MSDU_EXTENSION descriptor OR Link Descriptor
  103. In case of 'NULL' pointer, this field is set to 0
  104. <legal all>
  105. */
  106. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_OFFSET 0x00000004
  107. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_LSB 0
  108. #define BUFFER_ADDR_INFO_1_BUFFER_ADDR_39_32_MASK 0x000000ff
  109. /* Description BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER
  110. Consumer: WBM
  111. Producer: SW/FW
  112. In case of 'NULL' pointer, this field is set to 0
  113. Indicates to which buffer manager the buffer OR
  114. MSDU_EXTENSION descriptor OR link descriptor that is being
  115. pointed to shall be returned after the frame has been
  116. processed. It is used by WBM for routing purposes.
  117. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  118. to the WMB buffer idle list
  119. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  120. returned to the WMB idle link descriptor idle list
  121. <enum 2 FW_BM> This buffer shall be returned to the FW
  122. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  123. ring 0
  124. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  125. ring 1
  126. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  127. ring 2
  128. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  129. ring 3
  130. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  131. ring 4
  132. <legal all>
  133. */
  134. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  135. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_LSB 8
  136. #define BUFFER_ADDR_INFO_1_RETURN_BUFFER_MANAGER_MASK 0x00000700
  137. /* Description BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE
  138. Cookie field exclusively used by SW.
  139. In case of 'NULL' pointer, this field is set to 0
  140. HW ignores the contents, accept that it passes the
  141. programmed value on to other descriptors together with the
  142. physical address
  143. Field can be used by SW to for example associate the
  144. buffers physical address with the virtual address
  145. The bit definitions as used by SW are within SW HLD
  146. specification
  147. NOTE:
  148. The two most significant bits can have a special meaning
  149. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  150. and field transmit_bw_restriction is set
  151. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  152. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  153. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  154. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  155. <legal all>
  156. */
  157. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_OFFSET 0x00000004
  158. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_LSB 11
  159. #define BUFFER_ADDR_INFO_1_SW_BUFFER_COOKIE_MASK 0xfffff800
  160. #endif // _BUFFER_ADDR_INFO_H_