rx_mpdu_details.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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_DETAILS_H_
  17. #define _RX_MPDU_DETAILS_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "rx_mpdu_desc_info.h"
  21. #include "buffer_addr_info.h"
  22. #define NUM_OF_DWORDS_RX_MPDU_DETAILS 4
  23. struct rx_mpdu_details {
  24. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  25. struct buffer_addr_info msdu_link_desc_addr_info;
  26. struct rx_mpdu_desc_info rx_mpdu_desc_info_details;
  27. #else
  28. struct buffer_addr_info msdu_link_desc_addr_info;
  29. struct rx_mpdu_desc_info rx_mpdu_desc_info_details;
  30. #endif
  31. };
  32. /* Description MSDU_LINK_DESC_ADDR_INFO
  33. Consumer: REO/SW/FW
  34. Producer: RXDMA
  35. Details of the physical address of the MSDU link descriptor
  36. that contains pointers to MSDUs related to this MPDU
  37. */
  38. /* Description BUFFER_ADDR_31_0
  39. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  40. descriptor OR Link Descriptor
  41. In case of 'NULL' pointer, this field is set to 0
  42. <legal all>
  43. */
  44. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  45. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  46. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  47. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  48. /* Description BUFFER_ADDR_39_32
  49. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  50. descriptor OR Link Descriptor
  51. In case of 'NULL' pointer, this field is set to 0
  52. <legal all>
  53. */
  54. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  55. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  56. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  57. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  58. /* Description RETURN_BUFFER_MANAGER
  59. Consumer: WBM
  60. Producer: SW/FW
  61. In case of 'NULL' pointer, this field is set to 0
  62. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  63. descriptor OR link descriptor that is being pointed to
  64. shall be returned after the frame has been processed. It
  65. is used by WBM for routing purposes.
  66. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  67. to the WMB buffer idle list
  68. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  69. to the WBM idle link descriptor idle list, where the chip
  70. 0 WBM is chosen in case of a multi-chip config
  71. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  72. to the chip 1 WBM idle link descriptor idle list
  73. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  74. to the chip 2 WBM idle link descriptor idle list
  75. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  76. returned to chip 3 WBM idle link descriptor idle list
  77. <enum 4 FW_BM> This buffer shall be returned to the FW
  78. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  79. ring 0
  80. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  81. ring 1
  82. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  83. ring 2
  84. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  85. ring 3
  86. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  87. ring 4
  88. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  89. ring 5
  90. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  91. ring 6
  92. <legal 0-12>
  93. */
  94. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  95. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  96. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  97. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  98. /* Description SW_BUFFER_COOKIE
  99. Cookie field exclusively used by SW.
  100. In case of 'NULL' pointer, this field is set to 0
  101. HW ignores the contents, accept that it passes the programmed
  102. value on to other descriptors together with the physical
  103. address
  104. Field can be used by SW to for example associate the buffers
  105. physical address with the virtual address
  106. The bit definitions as used by SW are within SW HLD specification
  107. NOTE1:
  108. The three most significant bits can have a special meaning
  109. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  110. and field transmit_bw_restriction is set
  111. In case of NON punctured transmission:
  112. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  113. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  114. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  115. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  116. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  117. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  118. Sw_buffer_cookie[19:18] = 2'b11: reserved
  119. In case of punctured transmission:
  120. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  121. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  122. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  123. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  124. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  125. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  126. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  127. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  128. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  129. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  130. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  131. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  132. Sw_buffer_cookie[19:18] = 2'b11: reserved
  133. Note: a punctured transmission is indicated by the presence
  134. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  135. <legal all>
  136. */
  137. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  138. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  139. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  140. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  141. /* Description RX_MPDU_DESC_INFO_DETAILS
  142. Consumer: REO/SW/FW
  143. Producer: RXDMA
  144. General information related to the MPDU that should be passed
  145. on from REO entrance ring to the REO destination ring
  146. */
  147. /* Description MSDU_COUNT
  148. Consumer: REO/SW/FW
  149. Producer: RXDMA
  150. The number of MSDUs within the MPDU
  151. <legal all>
  152. */
  153. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET 0x00000008
  154. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_LSB 0
  155. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MSB 7
  156. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MASK 0x000000ff
  157. /* Description FRAGMENT_FLAG
  158. Consumer: REO/SW/FW
  159. Producer: RXDMA
  160. When set, this MPDU is a fragment and REO should forward
  161. this fragment MPDU to the REO destination ring without
  162. any reorder checks, pn checks or bitmap update. This implies
  163. that REO is forwarding the pointer to the MSDU link descriptor.
  164. The destination ring is coming from a programmable register
  165. setting in REO
  166. <legal all>
  167. */
  168. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_OFFSET 0x00000008
  169. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_LSB 8
  170. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MSB 8
  171. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MASK 0x00000100
  172. /* Description MPDU_RETRY_BIT
  173. Consumer: REO/SW/FW
  174. Producer: RXDMA
  175. The retry bit setting from the MPDU header of the received
  176. frame
  177. <legal all>
  178. */
  179. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_OFFSET 0x00000008
  180. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_LSB 9
  181. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MSB 9
  182. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MASK 0x00000200
  183. /* Description AMPDU_FLAG
  184. Consumer: REO/SW/FW
  185. Producer: RXDMA
  186. When set, the MPDU was received as part of an A-MPDU.
  187. <legal all>
  188. */
  189. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_OFFSET 0x00000008
  190. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_LSB 10
  191. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MSB 10
  192. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MASK 0x00000400
  193. /* Description BAR_FRAME
  194. Consumer: REO/SW/FW
  195. Producer: RXDMA
  196. When set, the received frame is a BAR frame. After processing,
  197. this frame shall be pushed to SW or deleted.
  198. <legal all>
  199. */
  200. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_OFFSET 0x00000008
  201. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_LSB 11
  202. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MSB 11
  203. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MASK 0x00000800
  204. /* Description PN_FIELDS_CONTAIN_VALID_INFO
  205. Consumer: REO/SW/FW
  206. Producer: RXDMA
  207. Copied here by RXDMA from RX_MPDU_END
  208. When not set, REO will Not perform a PN sequence number
  209. check
  210. */
  211. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET 0x00000008
  212. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_LSB 12
  213. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MSB 12
  214. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MASK 0x00001000
  215. /* Description RAW_MPDU
  216. Field only valid when first_msdu_in_mpdu_flag is set.
  217. When set, the contents in the MSDU buffer contains a 'RAW'
  218. MPDU. This 'RAW' MPDU might be spread out over multiple
  219. MSDU buffers.
  220. <legal all>
  221. */
  222. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_OFFSET 0x00000008
  223. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_LSB 13
  224. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MSB 13
  225. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MASK 0x00002000
  226. /* Description MORE_FRAGMENT_FLAG
  227. The More Fragment bit setting from the MPDU header of the
  228. received frame
  229. <legal all>
  230. */
  231. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_OFFSET 0x00000008
  232. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_LSB 14
  233. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MSB 14
  234. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MASK 0x00004000
  235. /* Description SRC_INFO
  236. Source (virtual) device/interface info. associated with
  237. this peer
  238. This field gets passed on by REO to PPE in the EDMA descriptor
  239. ('REO_TO_PPE_RING').
  240. <legal all>
  241. */
  242. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_OFFSET 0x00000008
  243. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_LSB 15
  244. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_MSB 26
  245. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_MASK 0x07ff8000
  246. /* Description MPDU_QOS_CONTROL_VALID
  247. When set, the MPDU has a QoS control field.
  248. In case of ndp or phy_err, this field will never be set.
  249. <legal all>
  250. */
  251. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_OFFSET 0x00000008
  252. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_LSB 27
  253. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_MSB 27
  254. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_MASK 0x08000000
  255. /* Description TID
  256. Field only valid when mpdu_qos_control_valid is set
  257. The TID field in the QoS control field
  258. <legal all>
  259. */
  260. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_TID_OFFSET 0x00000008
  261. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_TID_LSB 28
  262. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_TID_MSB 31
  263. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_TID_MASK 0xf0000000
  264. /* Description PEER_META_DATA
  265. Meta data that SW has programmed in the Peer table entry
  266. of the transmitting STA.
  267. <legal all>
  268. */
  269. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_OFFSET 0x0000000c
  270. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_LSB 0
  271. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_MSB 31
  272. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_MASK 0xffffffff
  273. #endif // RX_MPDU_DETAILS