rx_mpdu_details.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  10. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  12. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  13. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  14. */
  15. #ifndef _RX_MPDU_DETAILS_H_
  16. #define _RX_MPDU_DETAILS_H_
  17. #if !defined(__ASSEMBLER__)
  18. #endif
  19. #include "rx_mpdu_desc_info.h"
  20. #include "buffer_addr_info.h"
  21. #define NUM_OF_DWORDS_RX_MPDU_DETAILS 4
  22. struct rx_mpdu_details {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. struct buffer_addr_info msdu_link_desc_addr_info;
  25. struct rx_mpdu_desc_info rx_mpdu_desc_info_details;
  26. #else
  27. struct buffer_addr_info msdu_link_desc_addr_info;
  28. struct rx_mpdu_desc_info rx_mpdu_desc_info_details;
  29. #endif
  30. };
  31. /* Description MSDU_LINK_DESC_ADDR_INFO
  32. Consumer: REO/SW/FW
  33. Producer: RXDMA
  34. Details of the physical address of the MSDU link descriptor
  35. that contains pointers to MSDUs related to this MPDU
  36. */
  37. /* Description BUFFER_ADDR_31_0
  38. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  39. descriptor OR Link Descriptor
  40. In case of 'NULL' pointer, this field is set to 0
  41. <legal all>
  42. */
  43. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  44. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  45. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  46. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  47. /* Description BUFFER_ADDR_39_32
  48. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  49. descriptor OR Link Descriptor
  50. In case of 'NULL' pointer, this field is set to 0
  51. <legal all>
  52. */
  53. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  54. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  55. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  56. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  57. /* Description RETURN_BUFFER_MANAGER
  58. Consumer: WBM
  59. Producer: SW/FW
  60. In case of 'NULL' pointer, this field is set to 0
  61. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  62. descriptor OR link descriptor that is being pointed to
  63. shall be returned after the frame has been processed. It
  64. is used by WBM for routing purposes.
  65. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  66. to the WMB buffer idle list
  67. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  68. to the WBM idle link descriptor idle list, where the chip
  69. 0 WBM is chosen in case of a multi-chip config
  70. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  71. to the chip 1 WBM idle link descriptor idle list
  72. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  73. to the chip 2 WBM idle link descriptor idle list
  74. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  75. returned to chip 3 WBM idle link descriptor idle list
  76. <enum 4 FW_BM> This buffer shall be returned to the FW
  77. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  78. ring 0
  79. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  80. ring 1
  81. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  82. ring 2
  83. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  84. ring 3
  85. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  86. ring 4
  87. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  88. ring 5
  89. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  90. ring 6
  91. <legal 0-12>
  92. */
  93. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  94. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  95. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  96. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  97. /* Description SW_BUFFER_COOKIE
  98. Cookie field exclusively used by SW.
  99. In case of 'NULL' pointer, this field is set to 0
  100. HW ignores the contents, accept that it passes the programmed
  101. value on to other descriptors together with the physical
  102. address
  103. Field can be used by SW to for example associate the buffers
  104. physical address with the virtual address
  105. The bit definitions as used by SW are within SW HLD specification
  106. NOTE1:
  107. The three most significant bits can have a special meaning
  108. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  109. and field transmit_bw_restriction is set
  110. In case of NON punctured transmission:
  111. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  112. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  113. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  114. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  115. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  116. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  117. Sw_buffer_cookie[19:18] = 2'b11: reserved
  118. In case of punctured transmission:
  119. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  120. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  121. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  122. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  123. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  124. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  125. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  126. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  127. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  128. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  129. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  130. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  131. Sw_buffer_cookie[19:18] = 2'b11: reserved
  132. Note: a punctured transmission is indicated by the presence
  133. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  134. <legal all>
  135. */
  136. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  137. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  138. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  139. #define RX_MPDU_DETAILS_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  140. /* Description RX_MPDU_DESC_INFO_DETAILS
  141. Consumer: REO/SW/FW
  142. Producer: RXDMA
  143. General information related to the MPDU that should be passed
  144. on from REO entrance ring to the REO destination ring
  145. */
  146. /* Description MSDU_COUNT
  147. Consumer: REO/SW/FW
  148. Producer: RXDMA
  149. The number of MSDUs within the MPDU
  150. <legal all>
  151. */
  152. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET 0x00000008
  153. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_LSB 0
  154. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MSB 7
  155. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MASK 0x000000ff
  156. /* Description FRAGMENT_FLAG
  157. Consumer: REO/SW/FW
  158. Producer: RXDMA
  159. When set, this MPDU is a fragment and REO should forward
  160. this fragment MPDU to the REO destination ring without
  161. any reorder checks, pn checks or bitmap update. This implies
  162. that REO is forwarding the pointer to the MSDU link descriptor.
  163. The destination ring is coming from a programmable register
  164. setting in REO
  165. <legal all>
  166. */
  167. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_OFFSET 0x00000008
  168. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_LSB 8
  169. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MSB 8
  170. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MASK 0x00000100
  171. /* Description MPDU_RETRY_BIT
  172. Consumer: REO/SW/FW
  173. Producer: RXDMA
  174. The retry bit setting from the MPDU header of the received
  175. frame
  176. <legal all>
  177. */
  178. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_OFFSET 0x00000008
  179. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_LSB 9
  180. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MSB 9
  181. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MASK 0x00000200
  182. /* Description AMPDU_FLAG
  183. Consumer: REO/SW/FW
  184. Producer: RXDMA
  185. When set, the MPDU was received as part of an A-MPDU.
  186. <legal all>
  187. */
  188. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_OFFSET 0x00000008
  189. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_LSB 10
  190. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MSB 10
  191. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MASK 0x00000400
  192. /* Description BAR_FRAME
  193. Consumer: REO/SW/FW
  194. Producer: RXDMA
  195. When set, the received frame is a BAR frame. After processing,
  196. this frame shall be pushed to SW or deleted.
  197. <legal all>
  198. */
  199. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_OFFSET 0x00000008
  200. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_LSB 11
  201. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MSB 11
  202. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MASK 0x00000800
  203. /* Description PN_FIELDS_CONTAIN_VALID_INFO
  204. Consumer: REO/SW/FW
  205. Producer: RXDMA
  206. Copied here by RXDMA from RX_MPDU_END
  207. When not set, REO will Not perform a PN sequence number
  208. check
  209. */
  210. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET 0x00000008
  211. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_LSB 12
  212. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MSB 12
  213. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MASK 0x00001000
  214. /* Description RAW_MPDU
  215. Field only valid when first_msdu_in_mpdu_flag is set.
  216. When set, the contents in the MSDU buffer contains a 'RAW'
  217. MPDU. This 'RAW' MPDU might be spread out over multiple
  218. MSDU buffers.
  219. <legal all>
  220. */
  221. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_OFFSET 0x00000008
  222. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_LSB 13
  223. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MSB 13
  224. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MASK 0x00002000
  225. /* Description MORE_FRAGMENT_FLAG
  226. The More Fragment bit setting from the MPDU header of the
  227. received frame
  228. <legal all>
  229. */
  230. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_OFFSET 0x00000008
  231. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_LSB 14
  232. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MSB 14
  233. #define RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MASK 0x00004000
  234. /* Description SRC_INFO
  235. Source (virtual) device/interface info. associated with
  236. this peer
  237. This field gets passed on by REO to PPE in the EDMA descriptor
  238. ('REO_TO_PPE_RING').
  239. Hamilton v1 used this for 'vdev_id' instead.
  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