sw_monitor_ring.h 32 KB

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