wbm2sw_completion_ring_tx.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  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 _WBM2SW_COMPLETION_RING_TX_H_
  17. #define _WBM2SW_COMPLETION_RING_TX_H_
  18. #if !defined(__ASSEMBLER__)
  19. #endif
  20. #include "tx_rate_stats_info.h"
  21. #define NUM_OF_DWORDS_WBM2SW_COMPLETION_RING_TX 8
  22. struct wbm2sw_completion_ring_tx {
  23. #ifndef WIFI_BIT_ORDER_BIG_ENDIAN
  24. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  25. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  26. uint32_t release_source_module : 3, // [2:0]
  27. cache_id : 1, // [3:3]
  28. reserved_2a : 2, // [5:4]
  29. buffer_or_desc_type : 3, // [8:6]
  30. return_buffer_manager : 4, // [12:9]
  31. tqm_release_reason : 4, // [16:13]
  32. rbm_override_valid : 1, // [17:17]
  33. sw_buffer_cookie_11_0 : 12, // [29:18]
  34. cookie_conversion_status : 1, // [30:30]
  35. wbm_internal_error : 1; // [31:31]
  36. uint32_t tqm_status_number : 24, // [23:0]
  37. transmit_count : 7, // [30:24]
  38. sw_release_details_valid : 1; // [31:31]
  39. uint32_t ack_frame_rssi : 8, // [7:0]
  40. first_msdu : 1, // [8:8]
  41. last_msdu : 1, // [9:9]
  42. fw_tx_notify_frame : 3, // [12:10]
  43. buffer_timestamp : 19; // [31:13]
  44. struct tx_rate_stats_info tx_rate_stats;
  45. uint32_t sw_peer_id : 16, // [15:0]
  46. tid : 4, // [19:16]
  47. sw_buffer_cookie_19_12 : 8, // [27:20]
  48. looping_count : 4; // [31:28]
  49. #else
  50. uint32_t buffer_virt_addr_31_0 : 32; // [31:0]
  51. uint32_t buffer_virt_addr_63_32 : 32; // [31:0]
  52. uint32_t wbm_internal_error : 1, // [31:31]
  53. cookie_conversion_status : 1, // [30:30]
  54. sw_buffer_cookie_11_0 : 12, // [29:18]
  55. rbm_override_valid : 1, // [17:17]
  56. tqm_release_reason : 4, // [16:13]
  57. return_buffer_manager : 4, // [12:9]
  58. buffer_or_desc_type : 3, // [8:6]
  59. reserved_2a : 2, // [5:4]
  60. cache_id : 1, // [3:3]
  61. release_source_module : 3; // [2:0]
  62. uint32_t sw_release_details_valid : 1, // [31:31]
  63. transmit_count : 7, // [30:24]
  64. tqm_status_number : 24; // [23:0]
  65. uint32_t buffer_timestamp : 19, // [31:13]
  66. fw_tx_notify_frame : 3, // [12:10]
  67. last_msdu : 1, // [9:9]
  68. first_msdu : 1, // [8:8]
  69. ack_frame_rssi : 8; // [7:0]
  70. struct tx_rate_stats_info tx_rate_stats;
  71. uint32_t looping_count : 4, // [31:28]
  72. sw_buffer_cookie_19_12 : 8, // [27:20]
  73. tid : 4, // [19:16]
  74. sw_peer_id : 16; // [15:0]
  75. #endif
  76. };
  77. /* Description BUFFER_VIRT_ADDR_31_0
  78. Lower 32 bits of the 64-bit virtual address corresponding
  79. to the MSDU being released
  80. <legal all>
  81. */
  82. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_31_0_OFFSET 0x00000000
  83. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_31_0_LSB 0
  84. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_31_0_MSB 31
  85. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_31_0_MASK 0xffffffff
  86. /* Description BUFFER_VIRT_ADDR_63_32
  87. Upper 32 bits of the 64-bit virtual address corresponding
  88. to the MSDU being released
  89. <legal all>
  90. */
  91. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_63_32_OFFSET 0x00000004
  92. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_63_32_LSB 0
  93. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_63_32_MSB 31
  94. #define WBM2SW_COMPLETION_RING_TX_BUFFER_VIRT_ADDR_63_32_MASK 0xffffffff
  95. /* Description RELEASE_SOURCE_MODULE
  96. Indicates which module initiated the release of this buffer
  97. or descriptor
  98. <enum 1 release_source_RXDMA> DO NOT USE
  99. <enum 2 release_source_REO> DO NOT USE
  100. <enum 5 release_source_FW_RX> DO NOT USE
  101. <enum 4 release_source_SW_RX> DO NOT USE
  102. <enum 0 release_source_TQM> TQM released this buffer or
  103. descriptor
  104. <enum 3 release_source_FW_TX> FW released this buffer or
  105. descriptor
  106. <enum 6 release_source_SW_TX> SW released this buffer or
  107. descriptor
  108. <legal 0-6>
  109. */
  110. #define WBM2SW_COMPLETION_RING_TX_RELEASE_SOURCE_MODULE_OFFSET 0x00000008
  111. #define WBM2SW_COMPLETION_RING_TX_RELEASE_SOURCE_MODULE_LSB 0
  112. #define WBM2SW_COMPLETION_RING_TX_RELEASE_SOURCE_MODULE_MSB 2
  113. #define WBM2SW_COMPLETION_RING_TX_RELEASE_SOURCE_MODULE_MASK 0x00000007
  114. /* Description CACHE_ID
  115. To improve WBM performance, out-of-order completions may
  116. be allowed to process multiple MPDUs in parallel.
  117. The MSDUs released from each cache would be in order so 'First_msdu'
  118. and this field together can be used by SW to reorder the
  119. completions back to the original order by keeping all MSDUs
  120. of an MPDU from one cache together before switching to
  121. the next MPDU (from either cache).
  122. <legal all>
  123. */
  124. #define WBM2SW_COMPLETION_RING_TX_CACHE_ID_OFFSET 0x00000008
  125. #define WBM2SW_COMPLETION_RING_TX_CACHE_ID_LSB 3
  126. #define WBM2SW_COMPLETION_RING_TX_CACHE_ID_MSB 3
  127. #define WBM2SW_COMPLETION_RING_TX_CACHE_ID_MASK 0x00000008
  128. /* Description RESERVED_2A
  129. <legal 0>
  130. */
  131. #define WBM2SW_COMPLETION_RING_TX_RESERVED_2A_OFFSET 0x00000008
  132. #define WBM2SW_COMPLETION_RING_TX_RESERVED_2A_LSB 4
  133. #define WBM2SW_COMPLETION_RING_TX_RESERVED_2A_MSB 5
  134. #define WBM2SW_COMPLETION_RING_TX_RESERVED_2A_MASK 0x00000030
  135. /* Description BUFFER_OR_DESC_TYPE
  136. Consumer: WBM/SW/FW
  137. Producer: SW/TQM/RXDMA/REO/SWITCH
  138. Field only valid when WBM is marked as the return_buffer_manager
  139. in the Released_Buffer_address_info
  140. Indicates that type of buffer or descriptor is being released
  141. <enum 0 MSDU_rel_buffer> The address points to an MSDU buffer
  142. <enum 1 msdu_link_descriptor> The address points to an TX
  143. MSDU link descriptor
  144. <enum 2 mpdu_link_descriptor> The address points to an MPDU
  145. link descriptor
  146. <enum 3 msdu_ext_descriptor > The address points to an MSDU
  147. extension descriptor.
  148. In case BM finds this one in a release ring, it passes it
  149. on to FW...
  150. <enum 4 queue_ext_descriptor> The address points to an TQM
  151. queue extension descriptor. WBM should treat this is the
  152. same way as a link descriptor. That is, put the 128 byte
  153. buffer back in the link buffer idle list.
  154. <legal 0-4>
  155. */
  156. #define WBM2SW_COMPLETION_RING_TX_BUFFER_OR_DESC_TYPE_OFFSET 0x00000008
  157. #define WBM2SW_COMPLETION_RING_TX_BUFFER_OR_DESC_TYPE_LSB 6
  158. #define WBM2SW_COMPLETION_RING_TX_BUFFER_OR_DESC_TYPE_MSB 8
  159. #define WBM2SW_COMPLETION_RING_TX_BUFFER_OR_DESC_TYPE_MASK 0x000001c0
  160. /* Description RETURN_BUFFER_MANAGER
  161. 'Return_buffer_manager' field of the MSDU's buffer address
  162. info, for debug
  163. */
  164. #define WBM2SW_COMPLETION_RING_TX_RETURN_BUFFER_MANAGER_OFFSET 0x00000008
  165. #define WBM2SW_COMPLETION_RING_TX_RETURN_BUFFER_MANAGER_LSB 9
  166. #define WBM2SW_COMPLETION_RING_TX_RETURN_BUFFER_MANAGER_MSB 12
  167. #define WBM2SW_COMPLETION_RING_TX_RETURN_BUFFER_MANAGER_MASK 0x00001e00
  168. /* Description TQM_RELEASE_REASON
  169. Consumer: WBM/SW/FW
  170. Producer: TQM
  171. Field only valid when Release_source_module is set to release_source_TQM
  172. (rr = Release Reason)
  173. <enum 0 tqm_rr_frame_acked> frame is removed because an
  174. ACK of BA for it was received
  175. <enum 1 tqm_rr_rem_cmd_rem> frame is removed because a remove
  176. command of type "Remove_mpdus" initiated by SW
  177. <enum 2 tqm_rr_rem_cmd_tx> frame is removed because a remove
  178. command of type "Remove_transmitted_mpdus" initiated by
  179. SW
  180. <enum 3 tqm_rr_rem_cmd_notx> frame is removed because a
  181. remove command of type "Remove_untransmitted_mpdus" initiated
  182. by SW
  183. <enum 4 tqm_rr_rem_cmd_aged> frame is removed because a
  184. remove command of type "Remove_aged_mpdus" or "Remove_aged_msdus"
  185. initiated by SW
  186. <enum 5 tqm_fw_reason1> frame is removed because a remove
  187. command where fw indicated that remove reason is fw_reason1
  188. <enum 6 tqm_fw_reason2> frame is removed because a remove
  189. command where fw indicated that remove reason is fw_reason1
  190. <enum 7 tqm_fw_reason3> frame is removed because a remove
  191. command where fw indicated that remove reason is fw_reason1
  192. <enum 8 tqm_rr_rem_cmd_disable_queue> frame is removed because
  193. a remove command of type "remove_mpdus_and_disable_queue"
  194. or "remove_msdus_and_disable_flow" initiated by SW
  195. <enum 9 tqm_rr_rem_cmd_till_nonmatching> frame is removed
  196. because remove command of type "remove_till_nonmatching_mpdu"
  197. initiated by SW
  198. <enum 10 tqm_rr_drop_threshold> frame is dropped at TQM
  199. entrance due to one of slow/medium/hard drop threshold criteria
  200. <enum 11 tqm_rr_link_desc_unavailable> frame is dropped
  201. at TQM entrance due to the WBM2TQM_LINK_RING having fewer
  202. descriptors than a threshold programmed in TQM
  203. <enum 12 tqm_rr_drop_or_invalid_msdu> frame is dropped at
  204. TQM entrance due to 'TQM_Drop_frame' being set or "null"
  205. MSDU flow pointer or MSDU flow pointer 'Flow_valid' being
  206. zero or MSDU_length being zero
  207. <enum 13 tqm_rr_multicast_drop> frame is dropped at TQM
  208. entrance due to 'TQM_Drop_frame' being set with 'TCL_drop_reason'
  209. set to TCL_multicast_drop_for_vdev.
  210. <enum 14 tqm_rr_vdev_mismatch_drop> frame is dropped at
  211. TQM entrance due to 'TQM_Drop_frame' being set with 'TCL_drop_reason'
  212. set to TCL_vdev_id_mismatch_drop.
  213. <legal 0-14>
  214. */
  215. #define WBM2SW_COMPLETION_RING_TX_TQM_RELEASE_REASON_OFFSET 0x00000008
  216. #define WBM2SW_COMPLETION_RING_TX_TQM_RELEASE_REASON_LSB 13
  217. #define WBM2SW_COMPLETION_RING_TX_TQM_RELEASE_REASON_MSB 16
  218. #define WBM2SW_COMPLETION_RING_TX_TQM_RELEASE_REASON_MASK 0x0001e000
  219. /* Description RBM_OVERRIDE_VALID
  220. This is set to 0 for Tx cases not involving reinjection,
  221. and set to 1 for TQM release cases requiring FW reinjection
  222. When set to 1, WBM releases the MSDU buffers to FW and overrides
  223. the tx_rate_stats field with words 2 and 3 of the 'TX_MSDU_DETAILS'
  224. structure, for FW reinjection of these MSDUs
  225. When releasing to host SW, this will be 0 if there is no
  226. misprogramming.
  227. <legal 0>
  228. */
  229. #define WBM2SW_COMPLETION_RING_TX_RBM_OVERRIDE_VALID_OFFSET 0x00000008
  230. #define WBM2SW_COMPLETION_RING_TX_RBM_OVERRIDE_VALID_LSB 17
  231. #define WBM2SW_COMPLETION_RING_TX_RBM_OVERRIDE_VALID_MSB 17
  232. #define WBM2SW_COMPLETION_RING_TX_RBM_OVERRIDE_VALID_MASK 0x00020000
  233. /* Description SW_BUFFER_COOKIE_11_0
  234. LSB 12 bits of the 'Sw_buffer_cookie' field of the MSDU's
  235. buffer address info used to fill 'Buffer_virt_addr_*,'
  236. for debug
  237. */
  238. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_11_0_OFFSET 0x00000008
  239. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_11_0_LSB 18
  240. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_11_0_MSB 29
  241. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_11_0_MASK 0x3ffc0000
  242. /* Description COOKIE_CONVERSION_STATUS
  243. 0: 'Sw_buffer_cookie' not converted to 'Buffer_virt_addr'
  244. 1: 'Sw_buffer_cookie' coverted to 'Buffer_virt_addr'
  245. <legal 1>
  246. */
  247. #define WBM2SW_COMPLETION_RING_TX_COOKIE_CONVERSION_STATUS_OFFSET 0x00000008
  248. #define WBM2SW_COMPLETION_RING_TX_COOKIE_CONVERSION_STATUS_LSB 30
  249. #define WBM2SW_COMPLETION_RING_TX_COOKIE_CONVERSION_STATUS_MSB 30
  250. #define WBM2SW_COMPLETION_RING_TX_COOKIE_CONVERSION_STATUS_MASK 0x40000000
  251. /* Description WBM_INTERNAL_ERROR
  252. Can only be set by WBM.
  253. Is set when WBM got a buffer pointer but the action was
  254. to push it to the idle link descriptor ring or do link related
  255. activity
  256. OR
  257. Is set when WBM got a link buffer pointer but the action
  258. was to push it to the buffer descriptor ring
  259. <legal all>
  260. */
  261. #define WBM2SW_COMPLETION_RING_TX_WBM_INTERNAL_ERROR_OFFSET 0x00000008
  262. #define WBM2SW_COMPLETION_RING_TX_WBM_INTERNAL_ERROR_LSB 31
  263. #define WBM2SW_COMPLETION_RING_TX_WBM_INTERNAL_ERROR_MSB 31
  264. #define WBM2SW_COMPLETION_RING_TX_WBM_INTERNAL_ERROR_MASK 0x80000000
  265. /* Description TQM_STATUS_NUMBER
  266. Field only valid when Release_source_module is set to release_source_TQM
  267. The value in this field is equal to value of the 'TQM_CMD_Number'
  268. field from the TQM command or the 'TQM_add_cmd_Number' field
  269. from the TQM entrance ring descriptor LSB 24-bits.
  270. This field helps to correlate the statuses with the TQM
  271. commands.
  272. NOTE that SW could program this number to be equal to the
  273. PPDU_ID number in case direct correlation with the PPDU
  274. ID is desired
  275. <legal all>
  276. */
  277. #define WBM2SW_COMPLETION_RING_TX_TQM_STATUS_NUMBER_OFFSET 0x0000000c
  278. #define WBM2SW_COMPLETION_RING_TX_TQM_STATUS_NUMBER_LSB 0
  279. #define WBM2SW_COMPLETION_RING_TX_TQM_STATUS_NUMBER_MSB 23
  280. #define WBM2SW_COMPLETION_RING_TX_TQM_STATUS_NUMBER_MASK 0x00ffffff
  281. /* Description TRANSMIT_COUNT
  282. Field only valid when Release_source_module is set to release_source_TQM
  283. The number of times this frame has been transmitted
  284. */
  285. #define WBM2SW_COMPLETION_RING_TX_TRANSMIT_COUNT_OFFSET 0x0000000c
  286. #define WBM2SW_COMPLETION_RING_TX_TRANSMIT_COUNT_LSB 24
  287. #define WBM2SW_COMPLETION_RING_TX_TRANSMIT_COUNT_MSB 30
  288. #define WBM2SW_COMPLETION_RING_TX_TRANSMIT_COUNT_MASK 0x7f000000
  289. /* Description SW_RELEASE_DETAILS_VALID
  290. Consumer: SW
  291. Producer: WBM
  292. When set, some WBM specific release info for SW is valid.
  293. This is set when WMB got a 'release_msdu_list' command from
  294. TQM and the return buffer manager is not WMB. WBM will
  295. then de-aggregate all the MSDUs and pass them one at a time
  296. on to the 'buffer owner'
  297. <legal all>
  298. */
  299. #define WBM2SW_COMPLETION_RING_TX_SW_RELEASE_DETAILS_VALID_OFFSET 0x0000000c
  300. #define WBM2SW_COMPLETION_RING_TX_SW_RELEASE_DETAILS_VALID_LSB 31
  301. #define WBM2SW_COMPLETION_RING_TX_SW_RELEASE_DETAILS_VALID_MSB 31
  302. #define WBM2SW_COMPLETION_RING_TX_SW_RELEASE_DETAILS_VALID_MASK 0x80000000
  303. /* Description ACK_FRAME_RSSI
  304. This field is only valid when the source is TQM.
  305. If this frame is removed as the result of the reception
  306. of an ACK or BA, this field indicates the RSSI of the received
  307. ACK or BA frame.
  308. When the frame is removed as result of a direct remove command
  309. from the SW, this field is set to 0x0 (which is never
  310. a valid value when real RSSI is available)
  311. <legal all>
  312. */
  313. #define WBM2SW_COMPLETION_RING_TX_ACK_FRAME_RSSI_OFFSET 0x00000010
  314. #define WBM2SW_COMPLETION_RING_TX_ACK_FRAME_RSSI_LSB 0
  315. #define WBM2SW_COMPLETION_RING_TX_ACK_FRAME_RSSI_MSB 7
  316. #define WBM2SW_COMPLETION_RING_TX_ACK_FRAME_RSSI_MASK 0x000000ff
  317. /* Description FIRST_MSDU
  318. Field only valid when SW_release_details_valid is set.
  319. Consumer: SW
  320. Producer: WBM
  321. When set, this MSDU is the first MSDU pointed to in the 'release_msdu_list'
  322. command.
  323. <legal all>
  324. */
  325. #define WBM2SW_COMPLETION_RING_TX_FIRST_MSDU_OFFSET 0x00000010
  326. #define WBM2SW_COMPLETION_RING_TX_FIRST_MSDU_LSB 8
  327. #define WBM2SW_COMPLETION_RING_TX_FIRST_MSDU_MSB 8
  328. #define WBM2SW_COMPLETION_RING_TX_FIRST_MSDU_MASK 0x00000100
  329. /* Description LAST_MSDU
  330. Field only valid when SW_release_details_valid is set.
  331. Consumer: SW
  332. Producer: WBM
  333. When set, this MSDU is the last MSDU pointed to in the 'release_msdu_list'
  334. command.
  335. <legal all>
  336. */
  337. #define WBM2SW_COMPLETION_RING_TX_LAST_MSDU_OFFSET 0x00000010
  338. #define WBM2SW_COMPLETION_RING_TX_LAST_MSDU_LSB 9
  339. #define WBM2SW_COMPLETION_RING_TX_LAST_MSDU_MSB 9
  340. #define WBM2SW_COMPLETION_RING_TX_LAST_MSDU_MASK 0x00000200
  341. /* Description FW_TX_NOTIFY_FRAME
  342. Field only valid when SW_release_details_valid is set.
  343. Consumer: SW
  344. Producer: WBM
  345. This is the FW_tx_notify_frame field from the TX_MSDU_DETAILS
  346. for this frame from the MSDU link descriptor
  347. <legal all>
  348. */
  349. #define WBM2SW_COMPLETION_RING_TX_FW_TX_NOTIFY_FRAME_OFFSET 0x00000010
  350. #define WBM2SW_COMPLETION_RING_TX_FW_TX_NOTIFY_FRAME_LSB 10
  351. #define WBM2SW_COMPLETION_RING_TX_FW_TX_NOTIFY_FRAME_MSB 12
  352. #define WBM2SW_COMPLETION_RING_TX_FW_TX_NOTIFY_FRAME_MASK 0x00001c00
  353. /* Description BUFFER_TIMESTAMP
  354. Field only valid when SW_release_details_valid is set.
  355. Consumer: SW
  356. Producer: WBM
  357. This is the Buffer_timestamp field from the TX_MSDU_DETAILS
  358. for this frame from the MSDU link descriptor.
  359. Timestamp in units determined by the UMCMN 'TX_TIMESTAMP_RESOLUTION_SELECT'
  360. register
  361. <legal all>
  362. */
  363. #define WBM2SW_COMPLETION_RING_TX_BUFFER_TIMESTAMP_OFFSET 0x00000010
  364. #define WBM2SW_COMPLETION_RING_TX_BUFFER_TIMESTAMP_LSB 13
  365. #define WBM2SW_COMPLETION_RING_TX_BUFFER_TIMESTAMP_MSB 31
  366. #define WBM2SW_COMPLETION_RING_TX_BUFFER_TIMESTAMP_MASK 0xffffe000
  367. /* Description TX_RATE_STATS
  368. Consumer: TQM/SW
  369. Producer: SW/SCH(from TXPCU, PDG) /WBM (from RXDMA)
  370. Details for command execution tracking purposes.
  371. */
  372. /* Description TX_RATE_STATS_INFO_VALID
  373. When set all other fields in this STRUCT contain valid info.
  374. When clear, none of the other fields contain valid info.
  375. <legal all>
  376. */
  377. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TX_RATE_STATS_INFO_VALID_OFFSET 0x00000014
  378. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TX_RATE_STATS_INFO_VALID_LSB 0
  379. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TX_RATE_STATS_INFO_VALID_MSB 0
  380. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TX_RATE_STATS_INFO_VALID_MASK 0x00000001
  381. /* Description TRANSMIT_BW
  382. Field only valid when Tx_rate_stats_info_valid is set
  383. Indicates the BW of the upcoming transmission that shall
  384. likely start in about 3 -4 us on the medium
  385. <enum_type BW_ENUM>
  386. */
  387. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_BW_OFFSET 0x00000014
  388. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_BW_LSB 1
  389. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_BW_MSB 3
  390. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_BW_MASK 0x0000000e
  391. /* Description TRANSMIT_PKT_TYPE
  392. Field only valid when Tx_rate_stats_info_valid is set
  393. Field filled in by PDG.
  394. Not valid when in SW transmit mode
  395. The packet type
  396. <enum_type PKT_TYPE_ENUM>
  397. */
  398. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_PKT_TYPE_OFFSET 0x00000014
  399. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_PKT_TYPE_LSB 4
  400. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_PKT_TYPE_MSB 7
  401. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_PKT_TYPE_MASK 0x000000f0
  402. /* Description TRANSMIT_STBC
  403. Field only valid when Tx_rate_stats_info_valid is set
  404. Field filled in by PDG.
  405. Not valid when in SW transmit mode
  406. When set, STBC transmission rate was used.
  407. */
  408. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_STBC_OFFSET 0x00000014
  409. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_STBC_LSB 8
  410. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_STBC_MSB 8
  411. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_STBC_MASK 0x00000100
  412. /* Description TRANSMIT_LDPC
  413. Field only valid when Tx_rate_stats_info_valid is set
  414. Field filled in by PDG.
  415. Not valid when in SW transmit mode
  416. When set, use LDPC transmission rates
  417. */
  418. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_LDPC_OFFSET 0x00000014
  419. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_LDPC_LSB 9
  420. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_LDPC_MSB 9
  421. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_LDPC_MASK 0x00000200
  422. /* Description TRANSMIT_SGI
  423. Field only valid when Tx_rate_stats_info_valid is set
  424. Field filled in by PDG.
  425. Not valid when in SW transmit mode
  426. Specify the right GI for HE-Ranging NDPs (11az)/Short NDP.
  427. <enum 0 0_8_us_sgi > Legacy normal GI. Can also be used
  428. for HE
  429. <enum 1 0_4_us_sgi > Legacy short GI. Can also be used
  430. for HE
  431. <enum 2 1_6_us_sgi > HE related GI
  432. <enum 3 3_2_us_sgi > HE related GI
  433. <legal 0 - 3>
  434. */
  435. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_SGI_OFFSET 0x00000014
  436. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_SGI_LSB 10
  437. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_SGI_MSB 11
  438. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_SGI_MASK 0x00000c00
  439. /* Description TRANSMIT_MCS
  440. Field only valid when Tx_rate_stats_info_valid is set
  441. Field filled in by PDG.
  442. Not valid when in SW transmit mode
  443. For details, refer to MCS_TYPE description
  444. <legal all>
  445. */
  446. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_MCS_OFFSET 0x00000014
  447. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_MCS_LSB 12
  448. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_MCS_MSB 15
  449. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_MCS_MASK 0x0000f000
  450. /* Description OFDMA_TRANSMISSION
  451. Field only valid when Tx_rate_stats_info_valid is set
  452. Field filled in by PDG.
  453. Set when the transmission was an OFDMA transmission (DL
  454. or UL).
  455. <legal all>
  456. */
  457. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_OFDMA_TRANSMISSION_OFFSET 0x00000014
  458. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_OFDMA_TRANSMISSION_LSB 16
  459. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_OFDMA_TRANSMISSION_MSB 16
  460. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_OFDMA_TRANSMISSION_MASK 0x00010000
  461. /* Description TONES_IN_RU
  462. Field only valid when Tx_rate_stats_info_valid is set
  463. Field filled in by PDG.
  464. Not valid when in SW transmit mode
  465. The number of tones in the RU used.
  466. <legal all>
  467. */
  468. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TONES_IN_RU_OFFSET 0x00000014
  469. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TONES_IN_RU_LSB 17
  470. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TONES_IN_RU_MSB 28
  471. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TONES_IN_RU_MASK 0x1ffe0000
  472. /* Description TRANSMIT_NSS
  473. Field only valid when Tx_rate_stats_info_valid is set
  474. Field filled in by PDG
  475. Not valid when in SW transmit mode
  476. The number of spatial streams used in the transmission
  477. <enum_type SS_COUNT_ENUM>
  478. */
  479. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_NSS_OFFSET 0x00000014
  480. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_NSS_LSB 29
  481. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_NSS_MSB 31
  482. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_TRANSMIT_NSS_MASK 0xe0000000
  483. /* Description PPDU_TRANSMISSION_TSF
  484. Field only valid when Tx_rate_stats_info_valid is set
  485. Based on a HWSCH configuration register setting, this field
  486. either contains:
  487. Lower 32 bits of the TSF, snapshot of this value when transmission
  488. of the PPDU containing the frame finished.
  489. OR
  490. Lower 32 bits of the TSF, snapshot of this value when transmission
  491. of the PPDU containing the frame started
  492. <legal all>
  493. */
  494. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_OFFSET 0x00000018
  495. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_LSB 0
  496. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_MSB 31
  497. #define WBM2SW_COMPLETION_RING_TX_TX_RATE_STATS_PPDU_TRANSMISSION_TSF_MASK 0xffffffff
  498. /* Description SW_PEER_ID
  499. Field only valid when Release_source_module is set to release_source_TQM
  500. 1) Release of msdu buffer due to drop_frame = 1. Flow is
  501. not fetched and hence sw_peer_id and tid = 0
  502. buffer_or_desc_type = e_num 0 MSDU_rel_buffertqm_release_reason
  503. = e_num 1 tqm_rr_rem_cmd_rem
  504. 2) Release of msdu buffer due to Flow is not fetched and
  505. hence sw_peer_id and tid = 0
  506. buffer_or_desc_type = e_num 0 MSDU_rel_buffertqm_release_reason
  507. = e_num 1 tqm_rr_rem_cmd_rem
  508. 3) Release of msdu link due to remove_mpdu or acked_mpdu
  509. command.
  510. buffer_or_desc_type = e_num1 msdu_link_descriptortqm_release_reason
  511. can be:e_num 1 tqm_rr_rem_cmd_reme_num 2 tqm_rr_rem_cmd_tx
  512. e_num 3 tqm_rr_rem_cmd_notxe_num 4 tqm_rr_rem_cmd_aged (this
  513. e_num is used for REMOVE_MPDU as well as REMOVE_MSDU).
  514. Sw_peer_id from the TX_MSDU_FLOW descriptor or TX_MPDU_QUEUE
  515. descriptor
  516. <legal all>
  517. */
  518. #define WBM2SW_COMPLETION_RING_TX_SW_PEER_ID_OFFSET 0x0000001c
  519. #define WBM2SW_COMPLETION_RING_TX_SW_PEER_ID_LSB 0
  520. #define WBM2SW_COMPLETION_RING_TX_SW_PEER_ID_MSB 15
  521. #define WBM2SW_COMPLETION_RING_TX_SW_PEER_ID_MASK 0x0000ffff
  522. /* Description TID
  523. Field only valid when Release_source_module is set to release_source_TQM
  524. 1) Release of msdu buffer due to drop_frame = 1. Flow is
  525. not fetched and hence sw_peer_id and tid = 0
  526. buffer_or_desc_type = e_num 0 MSDU_rel_buffertqm_release_reason
  527. = e_num 1 tqm_rr_rem_cmd_rem
  528. 2) Release of msdu buffer due to Flow is not fetched and
  529. hence sw_peer_id and tid = 0
  530. buffer_or_desc_type = e_num 0 MSDU_rel_buffertqm_release_reason
  531. = e_num 1 tqm_rr_rem_cmd_rem
  532. 3) Release of msdu link due to remove_mpdu or acked_mpdu
  533. command.
  534. buffer_or_desc_type = e_num1 msdu_link_descriptortqm_release_reason
  535. can be:e_num 1 tqm_rr_rem_cmd_reme_num 2 tqm_rr_rem_cmd_tx
  536. e_num 3 tqm_rr_rem_cmd_notxe_num 4 tqm_rr_rem_cmd_aged (this
  537. e_num is used for REMOVE_MPDU as well as REMOVE_MSDU).
  538. This field represents the TID from the TX_MSDU_FLOW descriptor
  539. or TX_MPDU_QUEUE descriptor
  540. <legal all>
  541. */
  542. #define WBM2SW_COMPLETION_RING_TX_TID_OFFSET 0x0000001c
  543. #define WBM2SW_COMPLETION_RING_TX_TID_LSB 16
  544. #define WBM2SW_COMPLETION_RING_TX_TID_MSB 19
  545. #define WBM2SW_COMPLETION_RING_TX_TID_MASK 0x000f0000
  546. /* Description SW_BUFFER_COOKIE_19_12
  547. MSB 8 bits of the 'Sw_buffer_cookie' field of the MSDU's
  548. buffer address info used to fill 'Buffer_virt_addr_*,'
  549. for debug.
  550. WBM shall have configuration to copy 'TQM_Status_Number_31_24'
  551. from the WBM input descriptor here instead.
  552. */
  553. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_19_12_OFFSET 0x0000001c
  554. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_19_12_LSB 20
  555. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_19_12_MSB 27
  556. #define WBM2SW_COMPLETION_RING_TX_SW_BUFFER_COOKIE_19_12_MASK 0x0ff00000
  557. /* Description LOOPING_COUNT
  558. Consumer: WBM/SW/FW
  559. Producer: SW/TQM/RXDMA/REO/SWITCH
  560. If WBM_internal_error is set, this descriptor is sent to
  561. the dedicated 'WBM_ERROR_RELEASE' ring and Looping_count
  562. is used to indicate an error code.
  563. The values reported are documented further in the WBM MLD
  564. doc.
  565. If WBM_internal_error is not set, the following holds.
  566. A count value that indicates the number of times the producer
  567. of entries into the Buffer Manager Ring has looped around
  568. the ring.
  569. At initialization time, this value is set to 0. On the first
  570. loop, this value is set to 1. After the max value is reached
  571. allowed by the number of bits for this field, the count
  572. value continues with 0 again.
  573. In case SW is the consumer of the ring entries, it can use
  574. this field to figure out up to where the producer of entries
  575. has created new entries. This eliminates the need to check
  576. where the "head pointer' of the ring is located once the
  577. SW starts processing an interrupt indicating that new entries
  578. have been put into this ring...
  579. Also note that SW if it wants only needs to look at the
  580. LSB bit of this count value.
  581. <legal all>
  582. */
  583. #define WBM2SW_COMPLETION_RING_TX_LOOPING_COUNT_OFFSET 0x0000001c
  584. #define WBM2SW_COMPLETION_RING_TX_LOOPING_COUNT_LSB 28
  585. #define WBM2SW_COMPLETION_RING_TX_LOOPING_COUNT_MSB 31
  586. #define WBM2SW_COMPLETION_RING_TX_LOOPING_COUNT_MASK 0xf0000000
  587. #endif // WBM2SW_COMPLETION_RING_TX