wbm_buffer_ring.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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. // $ATH_LICENSE_HW_HDR_C$
  17. //
  18. // DO NOT EDIT! This file is automatically generated
  19. // These definitions are tied to a particular hardware layout
  20. #ifndef _WBM_BUFFER_RING_H_
  21. #define _WBM_BUFFER_RING_H_
  22. #if !defined(__ASSEMBLER__)
  23. #endif
  24. #include "buffer_addr_info.h"
  25. // ################ START SUMMARY #################
  26. //
  27. // Dword Fields
  28. // 0-1 struct buffer_addr_info buf_addr_info;
  29. //
  30. // ################ END SUMMARY #################
  31. #define NUM_OF_DWORDS_WBM_BUFFER_RING 2
  32. struct wbm_buffer_ring {
  33. struct buffer_addr_info buf_addr_info;
  34. };
  35. /*
  36. struct buffer_addr_info buf_addr_info
  37. Consumer: WBM
  38. Producer: WBM
  39. Details of the physical address of the buffer + source
  40. buffer owner + some SW meta data.
  41. All modules getting this buffer address info, shall keep
  42. all the 64 bits of info in this descriptor together and
  43. eventually all 64 bits shall be given back to WMB when the
  44. buffer is released.
  45. */
  46. /* EXTERNAL REFERENCE : struct buffer_addr_info buf_addr_info */
  47. /* Description WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0
  48. Address (lower 32 bits) of the MSDU buffer OR
  49. MSDU_EXTENSION descriptor OR Link Descriptor
  50. In case of 'NULL' pointer, this field is set to 0
  51. <legal all>
  52. */
  53. #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  54. #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  55. #define WBM_BUFFER_RING_0_BUF_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  56. /* Description WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32
  57. Address (upper 8 bits) of the MSDU buffer OR
  58. MSDU_EXTENSION descriptor OR Link Descriptor
  59. In case of 'NULL' pointer, this field is set to 0
  60. <legal all>
  61. */
  62. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  63. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  64. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  65. /* Description WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER
  66. Consumer: WBM
  67. Producer: SW/FW
  68. In case of 'NULL' pointer, this field is set to 0
  69. Indicates to which buffer manager the buffer OR
  70. MSDU_EXTENSION descriptor OR link descriptor that is being
  71. pointed to shall be returned after the frame has been
  72. processed. It is used by WBM for routing purposes.
  73. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  74. to the WMB buffer idle list
  75. <enum 1 WBM_IDLE_DESC_LIST> This buffer shall be
  76. returned to the WMB idle link descriptor idle list
  77. <enum 2 FW_BM> This buffer shall be returned to the FW
  78. <enum 3 SW0_BM> This buffer shall be returned to the SW,
  79. ring 0
  80. <enum 4 SW1_BM> This buffer shall be returned to the SW,
  81. ring 1
  82. <enum 5 SW2_BM> This buffer shall be returned to the SW,
  83. ring 2
  84. <enum 6 SW3_BM> This buffer shall be returned to the SW,
  85. ring 3
  86. <enum 7 SW4_BM> This buffer shall be returned to the SW,
  87. ring 3
  88. <legal all>
  89. */
  90. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  91. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  92. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000700
  93. /* Description WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE
  94. Cookie field exclusively used by SW.
  95. In case of 'NULL' pointer, this field is set to 0
  96. HW ignores the contents, accept that it passes the
  97. programmed value on to other descriptors together with the
  98. physical address
  99. Field can be used by SW to for example associate the
  100. buffers physical address with the virtual address
  101. The bit definitions as used by SW are within SW HLD
  102. specification
  103. NOTE:
  104. The three most significant bits can have a special
  105. meaning in case this struct is embedded in a TX_MPDU_DETAILS
  106. STRUCT, and field transmit_bw_restriction is set
  107. In case of NON punctured transmission:
  108. Sw_buffer_cookie[20:19] = 2'b00: 20 MHz TX only
  109. Sw_buffer_cookie[20:19] = 2'b01: 40 MHz TX only
  110. Sw_buffer_cookie[20:19] = 2'b10: 80 MHz TX only
  111. Sw_buffer_cookie[20:19] = 2'b11: 160 MHz TX only
  112. In case of punctured transmission:
  113. Sw_buffer_cookie[20:18] = 3'b000: pattern 0 only
  114. Sw_buffer_cookie[20:18] = 3'b001: pattern 1 only
  115. Sw_buffer_cookie[20:18] = 3'b010: pattern 2 only
  116. Sw_buffer_cookie[20:18] = 3'b011: pattern 3 only
  117. Sw_buffer_cookie[20:18] = 3'b100: pattern 4 only
  118. Sw_buffer_cookie[20:18] = 3'b101: pattern 5 only
  119. Sw_buffer_cookie[20:18] = 3'b110: pattern 6 only
  120. Sw_buffer_cookie[20:18] = 3'b111: pattern 7 only
  121. Note: a punctured transmission is indicated by the
  122. presence of TLV TX_PUNCTURE_SETUP embedded in the scheduler
  123. TLV
  124. <legal all>
  125. */
  126. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  127. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_LSB 11
  128. #define WBM_BUFFER_RING_1_BUF_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff800
  129. #endif // _WBM_BUFFER_RING_H_