rx_mpdu_link_ptr.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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 _RX_MPDU_LINK_PTR_H_
  17. #define _RX_MPDU_LINK_PTR_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "buffer_addr_info.h"
  21. #define NUM_OF_DWORDS_RX_MPDU_LINK_PTR 2
  22. struct rx_mpdu_link_ptr {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. struct buffer_addr_info mpdu_link_desc_addr_info;
  25. #else
  26. struct buffer_addr_info mpdu_link_desc_addr_info;
  27. #endif
  28. };
  29. /* Description MPDU_LINK_DESC_ADDR_INFO
  30. Details of the physical address of an MPDU link descriptor
  31. */
  32. /* Description BUFFER_ADDR_31_0
  33. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  34. descriptor OR Link Descriptor
  35. In case of 'NULL' pointer, this field is set to 0
  36. <legal all>
  37. */
  38. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  39. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  40. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  41. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  42. /* Description BUFFER_ADDR_39_32
  43. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  44. descriptor OR Link Descriptor
  45. In case of 'NULL' pointer, this field is set to 0
  46. <legal all>
  47. */
  48. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  49. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  50. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  51. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  52. /* Description RETURN_BUFFER_MANAGER
  53. Consumer: WBM
  54. Producer: SW/FW
  55. In case of 'NULL' pointer, this field is set to 0
  56. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  57. descriptor OR link descriptor that is being pointed to
  58. shall be returned after the frame has been processed. It
  59. is used by WBM for routing purposes.
  60. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  61. to the WMB buffer idle list
  62. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  63. to the WBM idle link descriptor idle list, where the chip
  64. 0 WBM is chosen in case of a multi-chip config
  65. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  66. to the chip 1 WBM idle link descriptor idle list
  67. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  68. to the chip 2 WBM idle link descriptor idle list
  69. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  70. returned to chip 3 WBM idle link descriptor idle list
  71. <enum 4 FW_BM> This buffer shall be returned to the FW
  72. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  73. ring 0
  74. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  75. ring 1
  76. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  77. ring 2
  78. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  79. ring 3
  80. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  81. ring 4
  82. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  83. ring 5
  84. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  85. ring 6
  86. <legal 0-12>
  87. */
  88. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  89. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  90. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  91. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  92. /* Description SW_BUFFER_COOKIE
  93. Cookie field exclusively used by SW.
  94. In case of 'NULL' pointer, this field is set to 0
  95. HW ignores the contents, accept that it passes the programmed
  96. value on to other descriptors together with the physical
  97. address
  98. Field can be used by SW to for example associate the buffers
  99. physical address with the virtual address
  100. The bit definitions as used by SW are within SW HLD specification
  101. NOTE1:
  102. The three most significant bits can have a special meaning
  103. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  104. and field transmit_bw_restriction is set
  105. In case of NON punctured transmission:
  106. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  107. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  108. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  109. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  110. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  111. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  112. Sw_buffer_cookie[19:18] = 2'b11: reserved
  113. In case of punctured transmission:
  114. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  115. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  116. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  117. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  118. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  119. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  120. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  121. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  122. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  123. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  124. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  125. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  126. Sw_buffer_cookie[19:18] = 2'b11: reserved
  127. Note: a punctured transmission is indicated by the presence
  128. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  129. <legal all>
  130. */
  131. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  132. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  133. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  134. #define RX_MPDU_LINK_PTR_MPDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  135. #endif // RX_MPDU_LINK_PTR