wbm2sw_completion_ring_tx.h 33 KB

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