sw_monitor_ring.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  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 _SW_MONITOR_RING_H_
  17. #define _SW_MONITOR_RING_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "buffer_addr_info.h"
  21. #include "rx_mpdu_details.h"
  22. #define NUM_OF_DWORDS_SW_MONITOR_RING 8
  23. struct sw_monitor_ring {
  24. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  25. struct rx_mpdu_details reo_level_mpdu_frame_info;
  26. struct buffer_addr_info status_buff_addr_info;
  27. uint32_t rxdma_push_reason : 2, // [1:0]
  28. rxdma_error_code : 5, // [6:2]
  29. mpdu_fragment_number : 4, // [10:7]
  30. frameless_bar : 1, // [11:11]
  31. status_buf_count : 4, // [15:12]
  32. end_of_ppdu : 1, // [16:16]
  33. reserved_6a : 15; // [31:17]
  34. uint32_t phy_ppdu_id : 16, // [15:0]
  35. reserved_7a : 4, // [19:16]
  36. ring_id : 8, // [27:20]
  37. looping_count : 4; // [31:28]
  38. #else
  39. struct rx_mpdu_details reo_level_mpdu_frame_info;
  40. struct buffer_addr_info status_buff_addr_info;
  41. uint32_t reserved_6a : 15, // [31:17]
  42. end_of_ppdu : 1, // [16:16]
  43. status_buf_count : 4, // [15:12]
  44. frameless_bar : 1, // [11:11]
  45. mpdu_fragment_number : 4, // [10:7]
  46. rxdma_error_code : 5, // [6:2]
  47. rxdma_push_reason : 2; // [1:0]
  48. uint32_t looping_count : 4, // [31:28]
  49. ring_id : 8, // [27:20]
  50. reserved_7a : 4, // [19:16]
  51. phy_ppdu_id : 16; // [15:0]
  52. #endif
  53. };
  54. /* Description REO_LEVEL_MPDU_FRAME_INFO
  55. Consumer: SW
  56. Producer: RXDMA
  57. Details related to the MPDU being pushed to SW, valid only
  58. if end_of_ppdu is set to 0
  59. */
  60. /* Description MSDU_LINK_DESC_ADDR_INFO
  61. Consumer: REO/SW/FW
  62. Producer: RXDMA
  63. Details of the physical address of the MSDU link descriptor
  64. that contains pointers to MSDUs related to this MPDU
  65. */
  66. /* Description BUFFER_ADDR_31_0
  67. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  68. descriptor OR Link Descriptor
  69. In case of 'NULL' pointer, this field is set to 0
  70. <legal all>
  71. */
  72. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000000
  73. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  74. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  75. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  76. /* Description BUFFER_ADDR_39_32
  77. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  78. descriptor OR Link Descriptor
  79. In case of 'NULL' pointer, this field is set to 0
  80. <legal all>
  81. */
  82. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000004
  83. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  84. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  85. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  86. /* Description RETURN_BUFFER_MANAGER
  87. Consumer: WBM
  88. Producer: SW/FW
  89. In case of 'NULL' pointer, this field is set to 0
  90. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  91. descriptor OR link descriptor that is being pointed to
  92. shall be returned after the frame has been processed. It
  93. is used by WBM for routing purposes.
  94. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  95. to the WMB buffer idle list
  96. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  97. to the WBM idle link descriptor idle list, where the chip
  98. 0 WBM is chosen in case of a multi-chip config
  99. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  100. to the chip 1 WBM idle link descriptor idle list
  101. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  102. to the chip 2 WBM idle link descriptor idle list
  103. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  104. returned to chip 3 WBM idle link descriptor idle list
  105. <enum 4 FW_BM> This buffer shall be returned to the FW
  106. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  107. ring 0
  108. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  109. ring 1
  110. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  111. ring 2
  112. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  113. ring 3
  114. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  115. ring 4
  116. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  117. ring 5
  118. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  119. ring 6
  120. <legal 0-12>
  121. */
  122. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000004
  123. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  124. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  125. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  126. /* Description SW_BUFFER_COOKIE
  127. Cookie field exclusively used by SW.
  128. In case of 'NULL' pointer, this field is set to 0
  129. HW ignores the contents, accept that it passes the programmed
  130. value on to other descriptors together with the physical
  131. address
  132. Field can be used by SW to for example associate the buffers
  133. physical address with the virtual address
  134. The bit definitions as used by SW are within SW HLD specification
  135. NOTE1:
  136. The three most significant bits can have a special meaning
  137. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  138. and field transmit_bw_restriction is set
  139. In case of NON punctured transmission:
  140. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  141. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  142. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  143. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  144. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  145. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  146. Sw_buffer_cookie[19:18] = 2'b11: reserved
  147. In case of punctured transmission:
  148. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  149. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  150. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  151. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  152. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  153. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  154. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  155. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  156. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  157. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  158. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  159. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  160. Sw_buffer_cookie[19:18] = 2'b11: reserved
  161. Note: a punctured transmission is indicated by the presence
  162. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  163. <legal all>
  164. */
  165. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000004
  166. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  167. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  168. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_MSDU_LINK_DESC_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  169. /* Description RX_MPDU_DESC_INFO_DETAILS
  170. Consumer: REO/SW/FW
  171. Producer: RXDMA
  172. General information related to the MPDU that should be passed
  173. on from REO entrance ring to the REO destination ring
  174. */
  175. /* Description MSDU_COUNT
  176. Consumer: REO/SW/FW
  177. Producer: RXDMA
  178. The number of MSDUs within the MPDU
  179. <legal all>
  180. */
  181. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET 0x00000008
  182. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_LSB 0
  183. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MSB 7
  184. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_MASK 0x000000ff
  185. /* Description FRAGMENT_FLAG
  186. Consumer: REO/SW/FW
  187. Producer: RXDMA
  188. When set, this MPDU is a fragment and REO should forward
  189. this fragment MPDU to the REO destination ring without
  190. any reorder checks, pn checks or bitmap update. This implies
  191. that REO is forwarding the pointer to the MSDU link descriptor.
  192. The destination ring is coming from a programmable register
  193. setting in REO
  194. <legal all>
  195. */
  196. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_OFFSET 0x00000008
  197. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_LSB 8
  198. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MSB 8
  199. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_FRAGMENT_FLAG_MASK 0x00000100
  200. /* Description MPDU_RETRY_BIT
  201. Consumer: REO/SW/FW
  202. Producer: RXDMA
  203. The retry bit setting from the MPDU header of the received
  204. frame
  205. <legal all>
  206. */
  207. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_OFFSET 0x00000008
  208. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_LSB 9
  209. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MSB 9
  210. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_RETRY_BIT_MASK 0x00000200
  211. /* Description AMPDU_FLAG
  212. Consumer: REO/SW/FW
  213. Producer: RXDMA
  214. When set, the MPDU was received as part of an A-MPDU.
  215. <legal all>
  216. */
  217. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_OFFSET 0x00000008
  218. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_LSB 10
  219. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MSB 10
  220. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_AMPDU_FLAG_MASK 0x00000400
  221. /* Description BAR_FRAME
  222. Consumer: REO/SW/FW
  223. Producer: RXDMA
  224. When set, the received frame is a BAR frame. After processing,
  225. this frame shall be pushed to SW or deleted.
  226. <legal all>
  227. */
  228. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_OFFSET 0x00000008
  229. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_LSB 11
  230. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MSB 11
  231. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_BAR_FRAME_MASK 0x00000800
  232. /* Description PN_FIELDS_CONTAIN_VALID_INFO
  233. Consumer: REO/SW/FW
  234. Producer: RXDMA
  235. Copied here by RXDMA from RX_MPDU_END
  236. When not set, REO will Not perform a PN sequence number
  237. check
  238. */
  239. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_OFFSET 0x00000008
  240. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_LSB 12
  241. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MSB 12
  242. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PN_FIELDS_CONTAIN_VALID_INFO_MASK 0x00001000
  243. /* Description RAW_MPDU
  244. Field only valid when first_msdu_in_mpdu_flag is set.
  245. When set, the contents in the MSDU buffer contains a 'RAW'
  246. MPDU. This 'RAW' MPDU might be spread out over multiple
  247. MSDU buffers.
  248. <legal all>
  249. */
  250. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_OFFSET 0x00000008
  251. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_LSB 13
  252. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MSB 13
  253. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_RAW_MPDU_MASK 0x00002000
  254. /* Description MORE_FRAGMENT_FLAG
  255. The More Fragment bit setting from the MPDU header of the
  256. received frame
  257. <legal all>
  258. */
  259. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_OFFSET 0x00000008
  260. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_LSB 14
  261. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MSB 14
  262. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MORE_FRAGMENT_FLAG_MASK 0x00004000
  263. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_OFFSET 0x00000008
  264. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_LSB 15
  265. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_MSB 26
  266. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_SRC_INFO_MASK 0x07ff8000
  267. /* Description MPDU_QOS_CONTROL_VALID
  268. When set, the MPDU has a QoS control field.
  269. In case of ndp or phy_err, this field will never be set.
  270. <legal all>
  271. */
  272. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_OFFSET 0x00000008
  273. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_LSB 27
  274. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_MSB 27
  275. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_MPDU_QOS_CONTROL_VALID_MASK 0x08000000
  276. /* Description TID
  277. Field only valid when mpdu_qos_control_valid is set
  278. The TID field in the QoS control field
  279. <legal all>
  280. */
  281. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_TID_OFFSET 0x00000008
  282. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_TID_LSB 28
  283. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_TID_MSB 31
  284. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_TID_MASK 0xf0000000
  285. /* Description PEER_META_DATA
  286. Meta data that SW has programmed in the Peer table entry
  287. of the transmitting STA.
  288. <legal all>
  289. */
  290. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_OFFSET 0x0000000c
  291. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_LSB 0
  292. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_MSB 31
  293. #define SW_MONITOR_RING_REO_LEVEL_MPDU_FRAME_INFO_RX_MPDU_DESC_INFO_DETAILS_PEER_META_DATA_MASK 0xffffffff
  294. /* Description STATUS_BUFF_ADDR_INFO
  295. Consumer: SW
  296. Producer: RXDMA
  297. Details of the physical address of the first status buffer
  298. used for the PPDU (either the PPDU that included the MPDU
  299. being pushed to SW if end_of_ppdu = 0, or the PPDU whose
  300. end is indicated through end_of_ppdu = 1)
  301. */
  302. /* Description BUFFER_ADDR_31_0
  303. Address (lower 32 bits) of the MSDU buffer OR MSDU_EXTENSION
  304. descriptor OR Link Descriptor
  305. In case of 'NULL' pointer, this field is set to 0
  306. <legal all>
  307. */
  308. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_31_0_OFFSET 0x00000010
  309. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_31_0_LSB 0
  310. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_31_0_MSB 31
  311. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_31_0_MASK 0xffffffff
  312. /* Description BUFFER_ADDR_39_32
  313. Address (upper 8 bits) of the MSDU buffer OR MSDU_EXTENSION
  314. descriptor OR Link Descriptor
  315. In case of 'NULL' pointer, this field is set to 0
  316. <legal all>
  317. */
  318. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_39_32_OFFSET 0x00000014
  319. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_39_32_LSB 0
  320. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_39_32_MSB 7
  321. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_BUFFER_ADDR_39_32_MASK 0x000000ff
  322. /* Description RETURN_BUFFER_MANAGER
  323. Consumer: WBM
  324. Producer: SW/FW
  325. In case of 'NULL' pointer, this field is set to 0
  326. Indicates to which buffer manager the buffer OR MSDU_EXTENSION
  327. descriptor OR link descriptor that is being pointed to
  328. shall be returned after the frame has been processed. It
  329. is used by WBM for routing purposes.
  330. <enum 0 WBM_IDLE_BUF_LIST> This buffer shall be returned
  331. to the WMB buffer idle list
  332. <enum 1 WBM_CHIP0_IDLE_DESC_LIST> This buffer shall be returned
  333. to the WBM idle link descriptor idle list, where the chip
  334. 0 WBM is chosen in case of a multi-chip config
  335. <enum 2 WBM_CHIP1_IDLE_DESC_LIST> This buffer shall be returned
  336. to the chip 1 WBM idle link descriptor idle list
  337. <enum 3 WBM_CHIP2_IDLE_DESC_LIST> This buffer shall be returned
  338. to the chip 2 WBM idle link descriptor idle list
  339. <enum 12 WBM_CHIP3_IDLE_DESC_LIST> This buffer shall be
  340. returned to chip 3 WBM idle link descriptor idle list
  341. <enum 4 FW_BM> This buffer shall be returned to the FW
  342. <enum 5 SW0_BM> This buffer shall be returned to the SW,
  343. ring 0
  344. <enum 6 SW1_BM> This buffer shall be returned to the SW,
  345. ring 1
  346. <enum 7 SW2_BM> This buffer shall be returned to the SW,
  347. ring 2
  348. <enum 8 SW3_BM> This buffer shall be returned to the SW,
  349. ring 3
  350. <enum 9 SW4_BM> This buffer shall be returned to the SW,
  351. ring 4
  352. <enum 10 SW5_BM> This buffer shall be returned to the SW,
  353. ring 5
  354. <enum 11 SW6_BM> This buffer shall be returned to the SW,
  355. ring 6
  356. <legal 0-12>
  357. */
  358. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_RETURN_BUFFER_MANAGER_OFFSET 0x00000014
  359. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_RETURN_BUFFER_MANAGER_LSB 8
  360. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_RETURN_BUFFER_MANAGER_MSB 11
  361. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_RETURN_BUFFER_MANAGER_MASK 0x00000f00
  362. /* Description SW_BUFFER_COOKIE
  363. Cookie field exclusively used by SW.
  364. In case of 'NULL' pointer, this field is set to 0
  365. HW ignores the contents, accept that it passes the programmed
  366. value on to other descriptors together with the physical
  367. address
  368. Field can be used by SW to for example associate the buffers
  369. physical address with the virtual address
  370. The bit definitions as used by SW are within SW HLD specification
  371. NOTE1:
  372. The three most significant bits can have a special meaning
  373. in case this struct is embedded in a TX_MPDU_DETAILS STRUCT,
  374. and field transmit_bw_restriction is set
  375. In case of NON punctured transmission:
  376. Sw_buffer_cookie[19:17] = 3'b000: 20 MHz TX only
  377. Sw_buffer_cookie[19:17] = 3'b001: 40 MHz TX only
  378. Sw_buffer_cookie[19:17] = 3'b010: 80 MHz TX only
  379. Sw_buffer_cookie[19:17] = 3'b011: 160 MHz TX only
  380. Sw_buffer_cookie[19:17] = 3'b101: 240 MHz TX only
  381. Sw_buffer_cookie[19:17] = 3'b100: 320 MHz TX only
  382. Sw_buffer_cookie[19:18] = 2'b11: reserved
  383. In case of punctured transmission:
  384. Sw_buffer_cookie[19:16] = 4'b0000: pattern 0 only
  385. Sw_buffer_cookie[19:16] = 4'b0001: pattern 1 only
  386. Sw_buffer_cookie[19:16] = 4'b0010: pattern 2 only
  387. Sw_buffer_cookie[19:16] = 4'b0011: pattern 3 only
  388. Sw_buffer_cookie[19:16] = 4'b0100: pattern 4 only
  389. Sw_buffer_cookie[19:16] = 4'b0101: pattern 5 only
  390. Sw_buffer_cookie[19:16] = 4'b0110: pattern 6 only
  391. Sw_buffer_cookie[19:16] = 4'b0111: pattern 7 only
  392. Sw_buffer_cookie[19:16] = 4'b1000: pattern 8 only
  393. Sw_buffer_cookie[19:16] = 4'b1001: pattern 9 only
  394. Sw_buffer_cookie[19:16] = 4'b1010: pattern 10 only
  395. Sw_buffer_cookie[19:16] = 4'b1011: pattern 11 only
  396. Sw_buffer_cookie[19:18] = 2'b11: reserved
  397. Note: a punctured transmission is indicated by the presence
  398. of TLV TX_PUNCTURE_SETUP embedded in the scheduler TLV
  399. <legal all>
  400. */
  401. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_SW_BUFFER_COOKIE_OFFSET 0x00000014
  402. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_SW_BUFFER_COOKIE_LSB 12
  403. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_SW_BUFFER_COOKIE_MSB 31
  404. #define SW_MONITOR_RING_STATUS_BUFF_ADDR_INFO_SW_BUFFER_COOKIE_MASK 0xfffff000
  405. /* Description RXDMA_PUSH_REASON
  406. Indicates why RXDMA pushed the frame to this ring
  407. <enum 0 rxdma_error_detected> RXDMA detected an error an
  408. pushed this frame to this queue
  409. <enum 1 rxdma_routing_instruction> RXDMA pushed the frame
  410. to this queue per received routing instructions. No error
  411. within RXDMA was detected
  412. <enum 2 rxdma_rx_flush> RXDMA received an RX_FLUSH. As a
  413. result the MSDU link descriptor might not have the "last_msdu_in_mpdu_flag"
  414. set, but instead WBM might just see a NULL pointer in the
  415. MSDU link descriptor. This is to be considered a normal
  416. condition for this scenario.
  417. <legal 0 - 2>
  418. */
  419. #define SW_MONITOR_RING_RXDMA_PUSH_REASON_OFFSET 0x00000018
  420. #define SW_MONITOR_RING_RXDMA_PUSH_REASON_LSB 0
  421. #define SW_MONITOR_RING_RXDMA_PUSH_REASON_MSB 1
  422. #define SW_MONITOR_RING_RXDMA_PUSH_REASON_MASK 0x00000003
  423. #define SW_MONITOR_RING_RXDMA_ERROR_CODE_LSB 2
  424. #define SW_MONITOR_RING_RXDMA_ERROR_CODE_MSB 6
  425. #define SW_MONITOR_RING_RXDMA_ERROR_CODE_MASK 0x0000007c
  426. /* Description MPDU_FRAGMENT_NUMBER
  427. Field only valid when Reo_level_mpdu_frame_info. Rx_mpdu_desc_info_details.Fragment_flag
  428. is set and end_of_ppdu is set to 0.
  429. The fragment number from the 802.11 header.
  430. Note that the sequence number is embedded in the field:
  431. Reo_level_mpdu_frame_info. Rx_mpdu_desc_info_details. Mpdu_sequence_number
  432. <legal all>
  433. */
  434. #define SW_MONITOR_RING_MPDU_FRAGMENT_NUMBER_OFFSET 0x00000018
  435. #define SW_MONITOR_RING_MPDU_FRAGMENT_NUMBER_LSB 7
  436. #define SW_MONITOR_RING_MPDU_FRAGMENT_NUMBER_MSB 10
  437. #define SW_MONITOR_RING_MPDU_FRAGMENT_NUMBER_MASK 0x00000780
  438. /* Description FRAMELESS_BAR
  439. When set, this SW monitor ring struct contains BAR info
  440. from a multi TID BAR frame. The original multi TID BAR frame
  441. itself contained all the REO info for the first TID, but
  442. all the subsequent TID info and their linkage to the REO
  443. descriptors is passed down as 'frameless' BAR info.
  444. The only fields valid in this descriptor when this bit is
  445. within the
  446. Reo_level_mpdu_frame_info:
  447. Within Rx_mpdu_desc_info_details:
  448. Mpdu_Sequence_number
  449. BAR_frame
  450. Peer_meta_data
  451. All other fields shall be set to 0.
  452. <legal all>
  453. */
  454. #define SW_MONITOR_RING_FRAMELESS_BAR_OFFSET 0x00000018
  455. #define SW_MONITOR_RING_FRAMELESS_BAR_LSB 11
  456. #define SW_MONITOR_RING_FRAMELESS_BAR_MSB 11
  457. #define SW_MONITOR_RING_FRAMELESS_BAR_MASK 0x00000800
  458. /* Description STATUS_BUF_COUNT
  459. A count of status buffers used so far for the PPDU (either
  460. the PPDU that included the MPDU being pushed to SW if end_of_ppdu
  461. = 0, or the PPDU whose end is indicated through end_of_ppdu
  462. = 1)
  463. */
  464. #define SW_MONITOR_RING_STATUS_BUF_COUNT_OFFSET 0x00000018
  465. #define SW_MONITOR_RING_STATUS_BUF_COUNT_LSB 12
  466. #define SW_MONITOR_RING_STATUS_BUF_COUNT_MSB 15
  467. #define SW_MONITOR_RING_STATUS_BUF_COUNT_MASK 0x0000f000
  468. /* Description END_OF_PPDU
  469. RXDMA can be configured to generate a separate 'SW_MONITOR_RING'
  470. descriptor at the end of a PPDU (either through an 'RX_PPDU_END'
  471. TLV or through an 'RX_FLUSH') to demarcate PPDUs.
  472. For such a descriptor, this bit is set to 1 and fields Reo_level_mpdu_frame_info,
  473. mpdu_fragment_number and Frameless_bar are all set to 0.
  474. Otherwise this bit is set to 0.
  475. */
  476. #define SW_MONITOR_RING_END_OF_PPDU_OFFSET 0x00000018
  477. #define SW_MONITOR_RING_END_OF_PPDU_LSB 16
  478. #define SW_MONITOR_RING_END_OF_PPDU_MSB 16
  479. #define SW_MONITOR_RING_END_OF_PPDU_MASK 0x00010000
  480. /* Description RESERVED_6A
  481. <legal 0>
  482. */
  483. #define SW_MONITOR_RING_RESERVED_6A_OFFSET 0x00000018
  484. #define SW_MONITOR_RING_RESERVED_6A_LSB 17
  485. #define SW_MONITOR_RING_RESERVED_6A_MSB 31
  486. #define SW_MONITOR_RING_RESERVED_6A_MASK 0xfffe0000
  487. /* Description PHY_PPDU_ID
  488. A PPDU counter value that PHY increments for every PPDU
  489. received
  490. The counter value wraps around. RXDMA can be configured
  491. to copy this from the RX_PPDU_START TLV for every output
  492. descriptor.
  493. <legal all>
  494. */
  495. #define SW_MONITOR_RING_PHY_PPDU_ID_OFFSET 0x0000001c
  496. #define SW_MONITOR_RING_PHY_PPDU_ID_LSB 0
  497. #define SW_MONITOR_RING_PHY_PPDU_ID_MSB 15
  498. #define SW_MONITOR_RING_PHY_PPDU_ID_MASK 0x0000ffff
  499. /* Description RESERVED_7A
  500. <legal 0>
  501. */
  502. #define SW_MONITOR_RING_RESERVED_7A_OFFSET 0x0000001c
  503. #define SW_MONITOR_RING_RESERVED_7A_LSB 16
  504. #define SW_MONITOR_RING_RESERVED_7A_MSB 19
  505. #define SW_MONITOR_RING_RESERVED_7A_MASK 0x000f0000
  506. /* Description RING_ID
  507. Consumer: SW/REO/DEBUG
  508. Producer: SRNG (of RXDMA)
  509. For debugging.
  510. This field is filled in by the SRNG module.
  511. It help to identify the ring that is being looked <legal
  512. all>
  513. */
  514. #define SW_MONITOR_RING_RING_ID_OFFSET 0x0000001c
  515. #define SW_MONITOR_RING_RING_ID_LSB 20
  516. #define SW_MONITOR_RING_RING_ID_MSB 27
  517. #define SW_MONITOR_RING_RING_ID_MASK 0x0ff00000
  518. /* Description LOOPING_COUNT
  519. Consumer: SW/REO/DEBUG
  520. Producer: SRNG (of RXDMA)
  521. For debugging.
  522. This field is filled in by the SRNG module.
  523. A count value that indicates the number of times the producer
  524. of entries into this Ring has looped around the ring.
  525. At initialization time, this value is set to 0. On the first
  526. loop, this value is set to 1. After the max value is reached
  527. allowed by the number of bits for this field, the count
  528. value continues with 0 again.
  529. In case SW is the consumer of the ring entries, it can use
  530. this field to figure out up to where the producer of entries
  531. has created new entries. This eliminates the need to check
  532. where the "head pointer' of the ring is located once the
  533. SW starts processing an interrupt indicating that new entries
  534. have been put into this ring...
  535. Also note that SW if it wants only needs to look at the
  536. LSB bit of this count value.
  537. <legal all>
  538. */
  539. #define SW_MONITOR_RING_LOOPING_COUNT_OFFSET 0x0000001c
  540. #define SW_MONITOR_RING_LOOPING_COUNT_LSB 28
  541. #define SW_MONITOR_RING_LOOPING_COUNT_MSB 31
  542. #define SW_MONITOR_RING_LOOPING_COUNT_MASK 0xf0000000
  543. #endif // SW_MONITOR_RING