htt_stats.h 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665
  1. /*
  2. * Copyright (c) 2017 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file htt_stats.h
  20. *
  21. * @details the public header file of HTT STATS
  22. */
  23. #ifndef __HTT_STATS_H__
  24. #define __HTT_STATS_H__
  25. #include <htt.h>
  26. /*
  27. * htt_dbg_ext_stats_type -
  28. * The base structure for each of the stats_type is only for reference
  29. * Host should use this information to know the type of TLVs to expect
  30. * for a particular stats type.
  31. *
  32. * Max supported stats :- 256.
  33. */
  34. enum htt_dbg_ext_stats_type {
  35. /* HTT_DBG_EXT_STATS_RESET
  36. * PARAM:
  37. * - config_param0 : start_offset (stats type)
  38. * - config_param1 : stats bmask from start offset
  39. * - config_param2 : stats bmask from start offset + 32
  40. * - config_param3 : stats bmask from start offset + 64
  41. * RESP MSG:
  42. * - No response sent.
  43. */
  44. HTT_DBG_EXT_STATS_RESET = 0,
  45. /* HTT_DBG_EXT_STATS_PDEV_TX
  46. * PARAMS:
  47. * - No Params
  48. * RESP MSG:
  49. * - htt_tx_pdev_stats_t
  50. */
  51. HTT_DBG_EXT_STATS_PDEV_TX = 1,
  52. /* HTT_DBG_EXT_STATS_PDEV_RX
  53. * PARAMS:
  54. * - No Params
  55. * RESP MSG:
  56. * - htt_rx_pdev_stats_t
  57. */
  58. HTT_DBG_EXT_STATS_PDEV_RX = 2,
  59. /* HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  60. * PARAMS:
  61. * - config_param0: [Bit31: Bit0] HWQ mask
  62. * RESP MSG:
  63. * - htt_tx_hwq_stats_t
  64. */
  65. HTT_DBG_EXT_STATS_PDEV_TX_HWQ = 3,
  66. /* HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  67. * PARAMS:
  68. * - config_param0: [Bit31: Bit0] TXQ mask
  69. * RESP MSG:
  70. * - htt_stats_tx_sched_t
  71. */
  72. HTT_DBG_EXT_STATS_PDEV_TX_SCHED = 4,
  73. /* HTT_DBG_EXT_STATS_PDEV_ERROR
  74. * PARAMS:
  75. * - No Params
  76. * RESP MSG:
  77. * - htt_hw_err_stats_t
  78. */
  79. HTT_DBG_EXT_STATS_PDEV_ERROR = 5,
  80. /* HTT_DBG_EXT_STATS_PDEV_TQM
  81. * PARAMS:
  82. * - No Params
  83. * RESP MSG:
  84. * - htt_tx_tqm_pdev_stats_t
  85. */
  86. HTT_DBG_EXT_STATS_PDEV_TQM = 6,
  87. /* HTT_DBG_EXT_STATS_TQM_CMDQ
  88. * PARAMS:
  89. * - No Params
  90. * RESP MSG:
  91. * - htt_tx_tqm_cmdq_stats_t
  92. */
  93. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  94. /* HTT_DBG_EXT_STATS_TX_DE_INFO
  95. * PARAMS:
  96. * - No Params
  97. * RESP MSG:
  98. * - htt_tx_de_stats_t
  99. */
  100. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  101. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE
  102. * PARAMS:
  103. * - No Params
  104. * RESP MSG:
  105. * - htt_tx_pdev_rate_stats_t
  106. */
  107. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  108. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE
  109. * PARAMS:
  110. * - No Params
  111. * RESP MSG:
  112. * - htt_rx_pdev_rate_stats_t
  113. */
  114. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  115. /* HTT_DBG_EXT_STATS_PEER_INFO
  116. * PARAMS:
  117. * - config_param0:
  118. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  119. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  120. * [Bit31 : Bit16] sw_peer_id
  121. * config_param1:
  122. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  123. * 0 bit htt_peer_stats_cmn_tlv
  124. * 1 bit htt_peer_details_tlv
  125. * 2 bit htt_tx_peer_rate_stats_tlv
  126. * 3 bit htt_rx_peer_rate_stats_tlv
  127. * 4 bit htt_tx_tid_stats_tlv
  128. * 5 bit htt_rx_tid_stats_tlv
  129. * 6 bit htt_msdu_flow_stats_tlv
  130. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  131. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  132. * [Bit31 : Bit16] reserved
  133. * RESP MSG:
  134. * - htt_peer_stats_t
  135. */
  136. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  137. /* HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  138. * PARAMS:
  139. * - No Params
  140. * RESP MSG:
  141. * - htt_tx_pdev_selfgen_stats_t
  142. */
  143. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  144. /* HTT_DBG_EXT_STATS_TX_MU_HWQ
  145. * PARAMS:
  146. * - config_param0: [Bit31: Bit0] HWQ mask
  147. * RESP MSG:
  148. * - htt_tx_hwq_mu_mimo_stats_t
  149. */
  150. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  151. /* HTT_DBG_EXT_STATS_RING_IF_INFO
  152. * PARAMS:
  153. * - No Params
  154. * RESP MSG:
  155. * - htt_ring_if_stats_t
  156. */
  157. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  158. /* HTT_DBG_EXT_STATS_SRNG_INFO
  159. * PARAMS:
  160. * - No Params
  161. * RESP MSG:
  162. * - htt_sring_stats_t
  163. */
  164. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  165. /* HTT_DBG_EXT_STATS_SFM_INFO
  166. * PARAMS:
  167. * - No Params
  168. * RESP MSG:
  169. * - htt_sfm_stats_t
  170. */
  171. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  172. /* HTT_DBG_EXT_STATS_PDEV_TX_MU
  173. * PARAMS:
  174. * - No Params
  175. * RESP MSG:
  176. * - htt_tx_pdev_mu_mimo_stats_t
  177. */
  178. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  179. /* HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  180. * PARAMS:
  181. * - config_param0:
  182. * [Bit7 : Bit0] vdev_id:8
  183. * note:0xFF to get all active peers based on pdev_mask.
  184. * [Bit31 : Bit8] rsvd:24
  185. * RESP MSG:
  186. * - htt_active_peer_details_list_t
  187. */
  188. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  189. /* keep this last */
  190. HTT_DBG_NUM_EXT_STATS = 256,
  191. };
  192. typedef enum {
  193. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  194. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  195. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  196. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  197. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  198. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  199. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  200. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  201. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  202. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  203. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  204. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  205. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  206. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  207. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  208. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  209. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  210. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  211. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  212. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  213. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  214. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  215. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  216. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  217. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  218. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  219. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  220. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  221. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  222. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  223. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  224. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  225. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  226. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  227. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  228. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  229. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  230. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  231. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  232. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  233. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  234. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  235. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  236. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  237. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  238. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  239. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  240. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  241. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  242. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  243. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  244. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  245. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  246. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  247. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  248. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  249. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  250. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  251. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  252. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  253. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  254. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  255. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  256. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  257. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  258. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  259. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  260. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  261. HTT_STATS_MAX_TAG,
  262. } htt_tlv_tag_t;
  263. #define HTT_STATS_TLV_TAG_M 0x00000fff
  264. #define HTT_STATS_TLV_TAG_S 0
  265. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  266. #define HTT_STATS_TLV_LENGTH_S 12
  267. #define HTT_STATS_TLV_TAG_GET(_var) \
  268. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  269. HTT_STATS_TLV_TAG_S)
  270. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  271. do { \
  272. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  273. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  274. } while (0)
  275. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  276. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  277. HTT_STATS_TLV_LENGTH_S)
  278. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  279. do { \
  280. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  281. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  282. } while (0)
  283. typedef struct {
  284. /* BIT [11 : 0] :- tag
  285. * BIT [23 : 12] :- length
  286. * BIT [31 : 24] :- reserved
  287. */
  288. A_UINT32 tag__length;
  289. } htt_tlv_hdr_t;
  290. #define HTT_STATS_MAX_STRING_SZ32 4
  291. #define HTT_STATS_MACID_INVALID 0xff
  292. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  293. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  294. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  295. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  296. typedef enum {
  297. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  298. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  299. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  300. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  301. } htt_tx_pdev_underrun_enum;
  302. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 71
  303. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  304. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  305. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  306. #define HTT_RX_STATS_REFILL_MAX_RING 4
  307. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  308. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  309. /* Bytes stored in little endian order */
  310. /* Length should be multiple of DWORD */
  311. typedef struct {
  312. htt_tlv_hdr_t tlv_hdr;
  313. A_UINT32 data[1]; /* Can be variable length */
  314. } htt_stats_string_tlv;
  315. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  316. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  317. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  318. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  319. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  320. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  321. do { \
  322. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  323. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  324. } while (0)
  325. /* == TX PDEV STATS == */
  326. typedef struct {
  327. htt_tlv_hdr_t tlv_hdr;
  328. /* BIT [ 7 : 0] :- mac_id
  329. * BIT [31 : 8] :- reserved
  330. */
  331. A_UINT32 mac_id__word;
  332. /* Num queued to HW */
  333. A_UINT32 hw_queued;
  334. /* Num PPDU reaped from HW */
  335. A_UINT32 hw_reaped;
  336. /* Num underruns */
  337. A_UINT32 underrun;
  338. /* Num HW Paused counter. */
  339. A_UINT32 hw_paused;
  340. /* Num HW flush counter. */
  341. A_UINT32 hw_flush;
  342. /* Num HW filtered counter. */
  343. A_UINT32 hw_filt;
  344. /* Num PPDUs cleaned up in TX abort */
  345. A_UINT32 tx_abort;
  346. /* Num MPDUs requed by SW */
  347. A_UINT32 mpdu_requed;
  348. /* excessive retries */
  349. A_UINT32 tx_xretry;
  350. /* Last used data hw rate code */
  351. A_UINT32 data_rc;
  352. /* frames dropped due to excessive sw retries */
  353. A_UINT32 mpdu_dropped_xretry;
  354. /* illegal rate phy errors */
  355. A_UINT32 illgl_rate_phy_err;
  356. /* wal pdev continous xretry */
  357. A_UINT32 cont_xretry;
  358. /* wal pdev continous xretry */
  359. A_UINT32 tx_timeout;
  360. /* wal pdev resets */
  361. A_UINT32 pdev_resets;
  362. /* PhY/BB underrun */
  363. A_UINT32 phy_underrun;
  364. /* MPDU is more than txop limit */
  365. A_UINT32 txop_ovf;
  366. /* Number of Sequences posted */
  367. A_UINT32 seq_posted;
  368. /* Number of Sequences failed queueing */
  369. A_UINT32 seq_failed_queueing;
  370. /* Number of Sequences completed */
  371. A_UINT32 seq_completed;
  372. /* Number of Sequences restarted */
  373. A_UINT32 seq_restarted;
  374. /* Number of MU Sequences posted */
  375. A_UINT32 mu_seq_posted;
  376. /* Number of time HW ring is paused between seq switch within ISR */
  377. A_UINT32 seq_switch_hw_paused;
  378. /* Number of times seq continuation in DSR */
  379. A_UINT32 next_seq_posted_dsr;
  380. /* Number of times seq continuation in ISR */
  381. A_UINT32 seq_posted_isr;
  382. /* Number of seq_ctrl cached. */
  383. A_UINT32 seq_ctrl_cached;
  384. /* Number of MPDUs successfully transmitted */
  385. A_UINT32 mpdu_count_tqm;
  386. /* Number of MSDUs successfully transmitted */
  387. A_UINT32 msdu_count_tqm;
  388. /* Number of MPDUs dropped */
  389. A_UINT32 mpdu_removed_tqm;
  390. /* Number of MSDUs dropped */
  391. A_UINT32 msdu_removed_tqm;
  392. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  393. A_UINT32 mpdus_sw_flush;
  394. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  395. A_UINT32 mpdus_hw_filter;
  396. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  397. A_UINT32 mpdus_truncated;
  398. /* Num MPDUs that was tried but didn't receive ACK or BA */
  399. A_UINT32 mpdus_ack_failed;
  400. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  401. A_UINT32 mpdus_expired;
  402. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  403. A_UINT32 mpdus_seq_hw_retry;
  404. /* Num of TQM acked cmds processed */
  405. A_UINT32 ack_tlv_proc;
  406. /* coex_abort_mpdu_cnt valid. */
  407. A_UINT32 coex_abort_mpdu_cnt_valid;
  408. /* coex_abort_mpdu_cnt from TX FES stats. */
  409. A_UINT32 coex_abort_mpdu_cnt;
  410. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  411. A_UINT32 num_total_ppdus_tried_ota;
  412. /* Number of data PPDUs tried over the air (OTA) */
  413. A_UINT32 num_data_ppdus_tried_ota;
  414. } htt_tx_pdev_stats_cmn_tlv;
  415. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  416. /* NOTE: Variable length TLV, use length spec to infer array size */
  417. typedef struct {
  418. htt_tlv_hdr_t tlv_hdr;
  419. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  420. } htt_tx_pdev_stats_urrn_tlv_v;
  421. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  422. /* NOTE: Variable length TLV, use length spec to infer array size */
  423. typedef struct {
  424. htt_tlv_hdr_t tlv_hdr;
  425. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  426. } htt_tx_pdev_stats_flush_tlv_v;
  427. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  428. /* NOTE: Variable length TLV, use length spec to infer array size */
  429. typedef struct {
  430. htt_tlv_hdr_t tlv_hdr;
  431. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  432. } htt_tx_pdev_stats_sifs_tlv_v;
  433. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  434. /* NOTE: Variable length TLV, use length spec to infer array size */
  435. typedef struct {
  436. htt_tlv_hdr_t tlv_hdr;
  437. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  438. } htt_tx_pdev_stats_phy_err_tlv_v;
  439. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  440. /* NOTE: Variable length TLV, use length spec to infer array size */
  441. typedef struct {
  442. htt_tlv_hdr_t tlv_hdr;
  443. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  444. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  445. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  446. * TLV_TAGS:
  447. * - HTT_STATS_TX_PDEV_CMN_TAG
  448. * - HTT_STATS_TX_PDEV_URRN_TAG
  449. * - HTT_STATS_TX_PDEV_SIFS_TAG
  450. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  451. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  452. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  453. */
  454. /* NOTE:
  455. * This structure is for documentation, and cannot be safely used directly.
  456. * Instead, use the constituent TLV structures to fill/parse.
  457. */
  458. typedef struct _htt_tx_pdev_stats {
  459. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  460. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  461. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  462. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  463. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  464. } htt_tx_pdev_stats_t;
  465. /* == SOC ERROR STATS == */
  466. /* =============== PDEV ERROR STATS ============== */
  467. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  468. typedef struct {
  469. htt_tlv_hdr_t tlv_hdr;
  470. /* Stored as little endian */
  471. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  472. A_UINT32 mask;
  473. A_UINT32 count;
  474. } htt_hw_stats_intr_misc_tlv;
  475. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  476. typedef struct {
  477. htt_tlv_hdr_t tlv_hdr;
  478. /* Stored as little endian */
  479. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  480. A_UINT32 count;
  481. } htt_hw_stats_wd_timeout_tlv;
  482. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  483. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  484. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  485. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  486. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  487. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  488. do { \
  489. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  490. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  491. } while (0)
  492. typedef struct {
  493. htt_tlv_hdr_t tlv_hdr;
  494. /* BIT [ 7 : 0] :- mac_id
  495. * BIT [31 : 8] :- reserved
  496. */
  497. A_UINT32 mac_id__word;
  498. A_UINT32 tx_abort;
  499. A_UINT32 tx_abort_fail_count;
  500. A_UINT32 rx_abort;
  501. A_UINT32 rx_abort_fail_count;
  502. A_UINT32 warm_reset;
  503. A_UINT32 cold_reset;
  504. A_UINT32 tx_flush;
  505. A_UINT32 tx_glb_reset;
  506. A_UINT32 tx_txq_reset;
  507. A_UINT32 rx_timeout_reset;
  508. } htt_hw_stats_pdev_errs_tlv;
  509. typedef struct {
  510. htt_tlv_hdr_t tlv_hdr;
  511. /* BIT [ 7 : 0] :- mac_id
  512. * BIT [31 : 8] :- reserved
  513. */
  514. A_UINT32 mac_id__word;
  515. A_UINT32 last_unpause_ppdu_id;
  516. A_UINT32 hwsch_unpause_wait_tqm_write;
  517. A_UINT32 hwsch_dummy_tlv_skipped;
  518. A_UINT32 hwsch_misaligned_offset_received;
  519. A_UINT32 hwsch_reset_count;
  520. A_UINT32 hwsch_dev_reset_war;
  521. A_UINT32 hwsch_delayed_pause;
  522. A_UINT32 hwsch_long_delayed_pause;
  523. A_UINT32 sch_rx_ppdu_no_response;
  524. A_UINT32 sch_selfgen_response;
  525. A_UINT32 sch_rx_sifs_resp_trigger;
  526. } htt_hw_stats_whal_tx_tlv;
  527. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  528. * TLV_TAGS:
  529. * - HTT_STATS_HW_PDEV_ERRS_TAG
  530. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  531. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  532. * - HTT_STATS_WHAL_TX_TAG
  533. */
  534. /* NOTE:
  535. * This structure is for documentation, and cannot be safely used directly.
  536. * Instead, use the constituent TLV structures to fill/parse.
  537. */
  538. typedef struct _htt_pdev_err_stats {
  539. htt_hw_stats_pdev_errs_tlv pdev_errs;
  540. htt_hw_stats_intr_misc_tlv misc_stats[1];
  541. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  542. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  543. } htt_hw_err_stats_t;
  544. /* ============ PEER STATS ============ */
  545. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  546. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  547. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  548. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  549. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  550. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  551. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  552. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  553. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  554. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  555. do { \
  556. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  557. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  558. } while (0)
  559. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  560. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  561. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  562. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  563. do { \
  564. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  565. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  566. } while (0)
  567. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  568. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  569. HTT_MSDU_FLOW_STATS_DROP_S)
  570. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  571. do { \
  572. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  573. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  574. } while (0)
  575. typedef struct _htt_msdu_flow_stats_tlv {
  576. htt_tlv_hdr_t tlv_hdr;
  577. A_UINT32 last_update_timestamp;
  578. A_UINT32 last_add_timestamp;
  579. A_UINT32 last_remove_timestamp;
  580. A_UINT32 total_processed_msdu_count;
  581. A_UINT32 cur_msdu_count_in_flowq;
  582. A_UINT32 sw_peer_id; /* This will help to find which peer_id is stuck state */
  583. /* BIT [15 : 0] :- tx_flow_number
  584. * BIT [19 : 16] :- tid_num
  585. * BIT [20 : 20] :- drop_rule
  586. * BIT [31 : 21] :- reserved
  587. */
  588. A_UINT32 tx_flow_no__tid_num__drop_rule;
  589. } htt_msdu_flow_stats_tlv;
  590. #define MAX_HTT_TID_NAME 8
  591. /* DWORD sw_peer_id__tid_num */
  592. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  593. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  594. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  595. #define HTT_TX_TID_STATS_TID_NUM_S 16
  596. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  597. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  598. HTT_TX_TID_STATS_SW_PEER_ID_S)
  599. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  600. do { \
  601. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  602. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  603. } while (0)
  604. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  605. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  606. HTT_TX_TID_STATS_TID_NUM_S)
  607. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  608. do { \
  609. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  610. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  611. } while (0)
  612. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  613. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  614. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  615. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  616. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  617. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  618. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  619. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  620. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  621. do { \
  622. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  623. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  624. } while (0)
  625. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  626. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  627. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  628. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  629. do { \
  630. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  631. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  632. } while (0)
  633. /* Tidq stats */
  634. typedef struct _htt_tx_tid_stats_tlv {
  635. htt_tlv_hdr_t tlv_hdr;
  636. /* Stored as little endian */
  637. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  638. /* BIT [15 : 0] :- sw_peer_id
  639. * BIT [31 : 16] :- tid_num
  640. */
  641. A_UINT32 sw_peer_id__tid_num;
  642. /* BIT [ 7 : 0] :- num_sched_pending
  643. * BIT [15 : 8] :- num_ppdu_in_hwq
  644. * BIT [31 : 16] :- reserved
  645. */
  646. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  647. A_UINT32 tid_flags;
  648. /* per tid # of hw_queued ppdu.*/
  649. A_UINT32 hw_queued;
  650. /* number of per tid successful PPDU. */
  651. A_UINT32 hw_reaped;
  652. /* per tid Num MPDUs filtered by HW */
  653. A_UINT32 mpdus_hw_filter;
  654. A_UINT32 qdepth_bytes;
  655. A_UINT32 qdepth_num_msdu;
  656. A_UINT32 qdepth_num_mpdu;
  657. A_UINT32 last_scheduled_tsmp;
  658. A_UINT32 pause_module_id;
  659. A_UINT32 block_module_id;
  660. /* tid tx airtime in sec */
  661. A_UINT32 tid_tx_airtime;
  662. } htt_tx_tid_stats_tlv;
  663. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  664. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  665. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  666. #define HTT_RX_TID_STATS_TID_NUM_S 16
  667. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  668. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  669. HTT_RX_TID_STATS_SW_PEER_ID_S)
  670. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  671. do { \
  672. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  673. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  674. } while (0)
  675. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  676. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  677. HTT_RX_TID_STATS_TID_NUM_S)
  678. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  679. do { \
  680. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  681. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  682. } while (0)
  683. typedef struct _htt_rx_tid_stats_tlv {
  684. htt_tlv_hdr_t tlv_hdr;
  685. /* BIT [15 : 0] : sw_peer_id
  686. * BIT [31 : 16] : tid_num
  687. */
  688. A_UINT32 sw_peer_id__tid_num;
  689. /* Stored as little endian */
  690. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  691. /* dup_in_reorder not collected per tid for now,
  692. as there is no wal_peer back ptr in data rx peer. */
  693. A_UINT32 dup_in_reorder;
  694. A_UINT32 dup_past_outside_window;
  695. A_UINT32 dup_past_within_window;
  696. /* Number of per tid MSDUs with flag of decrypt_err */
  697. A_UINT32 rxdesc_err_decrypt;
  698. /* tid rx airtime in sec */
  699. A_UINT32 tid_rx_airtime;
  700. } htt_rx_tid_stats_tlv;
  701. #define HTT_MAX_COUNTER_NAME 8
  702. typedef struct {
  703. htt_tlv_hdr_t tlv_hdr;
  704. /* Stored as little endian */
  705. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  706. A_UINT32 count;
  707. } htt_counter_tlv;
  708. typedef struct {
  709. htt_tlv_hdr_t tlv_hdr;
  710. /* Number of rx ppdu. */
  711. A_UINT32 ppdu_cnt;
  712. /* Number of rx mpdu. */
  713. A_UINT32 mpdu_cnt;
  714. /* Number of rx msdu */
  715. A_UINT32 msdu_cnt;
  716. /* Pause bitmap */
  717. A_UINT32 pause_bitmap;
  718. /* Block bitmap */
  719. A_UINT32 block_bitmap;
  720. /* Current timestamp */
  721. A_UINT32 current_timestamp;
  722. /* Peer cumulative tx airtime in sec */
  723. A_UINT32 peer_tx_airtime;
  724. /* Peer cumulative rx airtime in sec */
  725. A_UINT32 peer_rx_airtime;
  726. /* Peer current rssi in dBm */
  727. A_INT32 rssi;
  728. } htt_peer_stats_cmn_tlv;
  729. typedef struct {
  730. htt_tlv_hdr_t tlv_hdr;
  731. /* This enum type of HTT_PEER_TYPE */
  732. A_UINT32 peer_type;
  733. A_UINT32 sw_peer_id;
  734. /* BIT [7 : 0] :- vdev_id
  735. * BIT [15 : 8] :- pdev_id
  736. * BIT [31 : 16] :- ast_indx
  737. */
  738. A_UINT32 vdev_pdev_ast_idx;
  739. htt_mac_addr mac_addr;
  740. A_UINT32 peer_flags;
  741. A_UINT32 qpeer_flags;
  742. } htt_peer_details_tlv;
  743. typedef enum {
  744. HTT_STATS_PREAM_OFDM,
  745. HTT_STATS_PREAM_CCK,
  746. HTT_STATS_PREAM_HT,
  747. HTT_STATS_PREAM_VHT,
  748. HTT_STATS_PREAM_HE,
  749. HTT_STATS_PREAM_RSVD,
  750. HTT_STATS_PREAM_RSVD1,
  751. HTT_STATS_PREAM_COUNT,
  752. } HTT_STATS_PREAM_TYPE;
  753. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12
  754. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  755. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  756. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  757. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  758. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  759. typedef struct _htt_tx_peer_rate_stats_tlv {
  760. htt_tlv_hdr_t tlv_hdr;
  761. /* Number of tx ldpc packets */
  762. A_UINT32 tx_ldpc;
  763. /* Number of tx rts packets */
  764. A_UINT32 rts_cnt;
  765. /* RSSI value of last ack packet (units = dB above noise floor) */
  766. A_UINT32 ack_rssi;
  767. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  768. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  769. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  770. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  771. A_UINT32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  772. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  773. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  774. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  775. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  776. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  777. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  778. } htt_tx_peer_rate_stats_tlv;
  779. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12
  780. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  781. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  782. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  783. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  784. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  785. typedef struct _htt_rx_peer_rate_stats_tlv {
  786. htt_tlv_hdr_t tlv_hdr;
  787. A_UINT32 nsts;
  788. /* Number of rx ldpc packets */
  789. A_UINT32 rx_ldpc;
  790. /* Number of rx rts packets */
  791. A_UINT32 rts_cnt;
  792. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  793. A_UINT32 rssi_data; /* units = dB above noise floor */
  794. A_UINT32 rssi_comb; /* units = dB above noise floor */
  795. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  796. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  797. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  798. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  799. A_UINT32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  800. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  801. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  802. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  803. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  804. } htt_rx_peer_rate_stats_tlv;
  805. typedef enum {
  806. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  807. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  808. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  809. } htt_peer_stats_req_mode_t;
  810. typedef enum {
  811. HTT_PEER_STATS_CMN_TLV = 0,
  812. HTT_PEER_DETAILS_TLV = 1,
  813. HTT_TX_PEER_RATE_STATS_TLV = 2,
  814. HTT_RX_PEER_RATE_STATS_TLV = 3,
  815. HTT_TX_TID_STATS_TLV = 4,
  816. HTT_RX_TID_STATS_TLV = 5,
  817. HTT_MSDU_FLOW_STATS_TLV = 6,
  818. HTT_PEER_STATS_MAX_TLV = 31,
  819. } htt_peer_stats_tlv_enum;
  820. /* config_param0 */
  821. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  822. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  823. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  824. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  825. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  826. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  827. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET( _var, _val)\
  828. do { \
  829. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  830. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  831. } while (0)
  832. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  833. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  834. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  835. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  836. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  837. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  838. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  839. do { \
  840. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_M)); \
  841. } while (0)
  842. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  843. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  844. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  845. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  846. do { \
  847. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  848. } while (0)
  849. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  850. * TLV_TAGS:
  851. * - HTT_STATS_PEER_STATS_CMN_TAG
  852. * - HTT_STATS_PEER_DETAILS_TAG
  853. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  854. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  855. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple)
  856. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  857. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  858. */
  859. /* NOTE:
  860. * This structure is for documentation, and cannot be safely used directly.
  861. * Instead, use the constituent TLV structures to fill/parse.
  862. */
  863. typedef struct _htt_peer_stats {
  864. htt_peer_stats_cmn_tlv cmn_tlv;
  865. htt_peer_details_tlv peer_details;
  866. /* from g_rate_info_stats */
  867. htt_tx_peer_rate_stats_tlv tx_rate;
  868. htt_rx_peer_rate_stats_tlv rx_rate;
  869. htt_tx_tid_stats_tlv tx_tid_stats[1];
  870. htt_rx_tid_stats_tlv rx_tid_stats[1];
  871. htt_msdu_flow_stats_tlv msdu_flowq[1];
  872. } htt_peer_stats_t;
  873. /* =========== ACTIVE PEER LIST ========== */
  874. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  875. * TLV_TAGS:
  876. * - HTT_STATS_PEER_DETAILS_TAG
  877. */
  878. /* NOTE:
  879. * This structure is for documentation, and cannot be safely used directly.
  880. * Instead, use the constituent TLV structures to fill/parse.
  881. */
  882. typedef struct {
  883. htt_peer_details_tlv peer_details[1];
  884. } htt_active_peer_details_list_t;
  885. /* =========== MUMIMO HWQ stats =========== */
  886. /* MU MIMO stats per hwQ */
  887. typedef struct {
  888. htt_tlv_hdr_t tlv_hdr;
  889. A_UINT32 mu_mimo_sch_posted;
  890. A_UINT32 mu_mimo_sch_failed;
  891. A_UINT32 mu_mimo_ppdu_posted;
  892. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  893. typedef struct {
  894. htt_tlv_hdr_t tlv_hdr;
  895. A_UINT32 mu_mimo_mpdus_queued_usr; /* Number of mpdus queued per user */
  896. A_UINT32 mu_mimo_mpdus_tried_usr; /* Number of mpdus actually transmitted by TxPCU per user */
  897. A_UINT32 mu_mimo_mpdus_failed_usr; /* Number of mpdus failed per user */
  898. A_UINT32 mu_mimo_mpdus_requeued_usr; /* Number of mpdus requeued per user */
  899. A_UINT32 mu_mimo_err_no_ba_usr; /* Number of times BA is not received for a user in MU PPDU */
  900. A_UINT32 mu_mimo_mpdu_underrun_usr;
  901. A_UINT32 mu_mimo_ampdu_underrun_usr;
  902. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  903. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  904. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  905. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  906. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  907. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  908. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  909. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  910. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  911. do { \
  912. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  913. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  914. } while (0)
  915. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  916. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  917. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  918. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  919. do { \
  920. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  921. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  922. } while (0)
  923. typedef struct {
  924. htt_tlv_hdr_t tlv_hdr;
  925. /* BIT [ 7 : 0] :- mac_id
  926. * BIT [15 : 8] :- hwq_id
  927. * BIT [31 : 16] :- reserved
  928. */
  929. A_UINT32 mac_id__hwq_id__word;
  930. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  931. /* NOTE:
  932. * This structure is for documentation, and cannot be safely used directly.
  933. * Instead, use the constituent TLV structures to fill/parse.
  934. */
  935. typedef struct {
  936. struct _hwq_mu_mimo_stats {
  937. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  938. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  939. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_TX_MAX_NUM_USERS */
  940. } hwq[1];
  941. } htt_tx_hwq_mu_mimo_stats_t;
  942. /* == TX HWQ STATS == */
  943. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  944. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  945. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  946. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  947. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  948. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  949. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  950. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  951. do { \
  952. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  953. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  954. } while (0)
  955. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  956. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  957. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  958. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  959. do { \
  960. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  961. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  962. } while (0)
  963. typedef struct {
  964. htt_tlv_hdr_t tlv_hdr;
  965. /* BIT [ 7 : 0] :- mac_id
  966. * BIT [15 : 8] :- hwq_id
  967. * BIT [31 : 16] :- reserved
  968. */
  969. A_UINT32 mac_id__hwq_id__word;
  970. /* PPDU level stats */
  971. A_UINT32 xretry; /* Number of times ack is failed for the PPDU scheduled on this txQ */
  972. A_UINT32 underrun_cnt; /* Number of times sched cmd status reported mpdu underrun */
  973. A_UINT32 flush_cnt; /* Number of times sched cmd is flushed */
  974. A_UINT32 filt_cnt; /* Number of times sched cmd is filtered */
  975. A_UINT32 null_mpdu_bmap; /* Number of times HWSCH uploaded null mpdu bitmap */
  976. A_UINT32 user_ack_failure; /* Number of time user ack or ba tlv is not seen on FES ring where it is expected to be */
  977. A_UINT32 ack_tlv_proc; /* Number of times TQM processed ack tlv received from HWSCH */
  978. A_UINT32 sched_id_proc; /* Cache latest processed scheduler ID received from ack ba tlv */
  979. A_UINT32 null_mpdu_tx_count; /* Number of times TxPCU reported mpdus transmitted for a user is zero */
  980. A_UINT32 mpdu_bmap_not_recvd; /* Number of times SW did not see any mpdu info bitmap tlv on FES status ring */
  981. /* Selfgen stats per hwQ */
  982. A_UINT32 num_bar; /* Number of SU/MU BAR frames posted to hwQ */
  983. A_UINT32 rts; /* Number of RTS frames posted to hwQ */
  984. A_UINT32 cts2self; /* Number of cts2self frames posted to hwQ */
  985. A_UINT32 qos_null; /* Number of qos null frames posted to hwQ */
  986. /* MPDU level stats */
  987. A_UINT32 mpdu_tried_cnt; /* mpdus tried Tx by HWSCH/TQM */
  988. A_UINT32 mpdu_queued_cnt; /* mpdus queued to HWSCH */
  989. A_UINT32 mpdu_ack_fail_cnt; /* mpdus tried but ack was not received */
  990. A_UINT32 mpdu_filt_cnt; /* This will include sched cmd flush and time based discard */
  991. A_UINT32 false_mpdu_ack_count; /* Number of MPDUs for which ACK was sucessful but no Tx happened */
  992. } htt_tx_hwq_stats_cmn_tlv;
  993. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) ( sizeof(A_UINT32) + /* hist_intvl */ \
  994. (sizeof(A_UINT32) * (_num_elems)))
  995. /* NOTE: Variable length TLV, use length spec to infer array size */
  996. typedef struct {
  997. htt_tlv_hdr_t tlv_hdr;
  998. A_UINT32 hist_intvl;
  999. /* histogram of ppdu post to hwsch - > cmd status received */
  1000. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1001. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1002. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1003. /* NOTE: Variable length TLV, use length spec to infer array size */
  1004. typedef struct {
  1005. htt_tlv_hdr_t tlv_hdr;
  1006. /* Histogram of sched cmd result */
  1007. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1008. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1009. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1010. /* NOTE: Variable length TLV, use length spec to infer array size */
  1011. typedef struct {
  1012. htt_tlv_hdr_t tlv_hdr;
  1013. /* Histogram of various pause conitions */
  1014. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1015. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1016. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1017. /* NOTE: Variable length TLV, use length spec to infer array size */
  1018. typedef struct {
  1019. htt_tlv_hdr_t tlv_hdr;
  1020. /* Histogram of number of user fes result */
  1021. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1022. } htt_tx_hwq_fes_result_stats_tlv_v;
  1023. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1024. * TLV_TAGS:
  1025. * - HTT_STATS_STRING_TAG
  1026. * - HTT_STATS_TX_HWQ_CMN_TAG
  1027. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1028. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1029. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1030. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1031. */
  1032. /* NOTE:
  1033. * This structure is for documentation, and cannot be safely used directly.
  1034. * Instead, use the constituent TLV structures to fill/parse.
  1035. */
  1036. typedef struct _htt_tx_hwq_stats {
  1037. htt_stats_string_tlv hwq_str_tlv;
  1038. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1039. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1040. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1041. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1042. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1043. } htt_tx_hwq_stats_t;
  1044. /* == TX SELFGEN STATS == */
  1045. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1046. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1047. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1048. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1049. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1050. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1051. do { \
  1052. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1053. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1054. } while (0)
  1055. typedef struct {
  1056. htt_tlv_hdr_t tlv_hdr;
  1057. /* BIT [ 7 : 0] :- mac_id
  1058. * BIT [31 : 8] :- reserved
  1059. */
  1060. A_UINT32 mac_id__word;
  1061. A_UINT32 su_bar;
  1062. A_UINT32 rts;
  1063. A_UINT32 cts2self;
  1064. A_UINT32 qos_null;
  1065. A_UINT32 delayed_bar_1; /* MU user 1 */
  1066. A_UINT32 delayed_bar_2; /* MU user 2 */
  1067. A_UINT32 delayed_bar_3; /* MU user 3 */
  1068. A_UINT32 delayed_bar_4; /* MU user 4 */
  1069. A_UINT32 delayed_bar_5; /* MU user 5 */
  1070. A_UINT32 delayed_bar_6; /* MU user 6 */
  1071. A_UINT32 delayed_bar_7; /* MU user 7 */
  1072. } htt_tx_selfgen_cmn_stats_tlv;
  1073. typedef struct {
  1074. htt_tlv_hdr_t tlv_hdr;
  1075. /* 11AC */
  1076. A_UINT32 ac_su_ndpa;
  1077. A_UINT32 ac_su_ndp;
  1078. A_UINT32 ac_mu_mimo_ndpa;
  1079. A_UINT32 ac_mu_mimo_ndp;
  1080. A_UINT32 ac_mu_mimo_brpoll_1; /* MU user 1 */
  1081. A_UINT32 ac_mu_mimo_brpoll_2; /* MU user 2 */
  1082. A_UINT32 ac_mu_mimo_brpoll_3; /* MU user 3 */
  1083. } htt_tx_selfgen_ac_stats_tlv;
  1084. typedef struct {
  1085. htt_tlv_hdr_t tlv_hdr;
  1086. /* 11AX */
  1087. A_UINT32 ax_su_ndpa;
  1088. A_UINT32 ax_su_ndp;
  1089. A_UINT32 ax_mu_mimo_ndpa;
  1090. A_UINT32 ax_mu_mimo_ndp;
  1091. A_UINT32 ax_mu_mimo_brpoll_1; /* MU user 1 */
  1092. A_UINT32 ax_mu_mimo_brpoll_2; /* MU user 2 */
  1093. A_UINT32 ax_mu_mimo_brpoll_3; /* MU user 3 */
  1094. A_UINT32 ax_mu_mimo_brpoll_4; /* MU user 4 */
  1095. A_UINT32 ax_mu_mimo_brpoll_5; /* MU user 5 */
  1096. A_UINT32 ax_mu_mimo_brpoll_6; /* MU user 6 */
  1097. A_UINT32 ax_mu_mimo_brpoll_7; /* MU user 7 */
  1098. A_UINT32 ax_basic_trigger;
  1099. A_UINT32 ax_bsr_trigger;
  1100. A_UINT32 ax_mu_bar_trigger;
  1101. A_UINT32 ax_mu_rts_trigger;
  1102. } htt_tx_selfgen_ax_stats_tlv;
  1103. typedef struct {
  1104. htt_tlv_hdr_t tlv_hdr;
  1105. /* 11AC error stats */
  1106. A_UINT32 ac_su_ndp_err;
  1107. A_UINT32 ac_su_ndpa_err;
  1108. A_UINT32 ac_mu_mimo_ndpa_err;
  1109. A_UINT32 ac_mu_mimo_ndp_err;
  1110. A_UINT32 ac_mu_mimo_brp1_err;
  1111. A_UINT32 ac_mu_mimo_brp2_err;
  1112. A_UINT32 ac_mu_mimo_brp3_err;
  1113. } htt_tx_selfgen_ac_err_stats_tlv;
  1114. typedef struct {
  1115. htt_tlv_hdr_t tlv_hdr;
  1116. /* 11AX error stats */
  1117. A_UINT32 ax_su_ndp_err;
  1118. A_UINT32 ax_su_ndpa_err;
  1119. A_UINT32 ax_mu_mimo_ndpa_err;
  1120. A_UINT32 ax_mu_mimo_ndp_err;
  1121. A_UINT32 ax_mu_mimo_brp1_err;
  1122. A_UINT32 ax_mu_mimo_brp2_err;
  1123. A_UINT32 ax_mu_mimo_brp3_err;
  1124. A_UINT32 ax_mu_mimo_brp4_err;
  1125. A_UINT32 ax_mu_mimo_brp5_err;
  1126. A_UINT32 ax_mu_mimo_brp6_err;
  1127. A_UINT32 ax_mu_mimo_brp7_err;
  1128. A_UINT32 ax_basic_trigger_err;
  1129. A_UINT32 ax_bsr_trigger_err;
  1130. A_UINT32 ax_mu_bar_trigger_err;
  1131. A_UINT32 ax_mu_rts_trigger_err;
  1132. } htt_tx_selfgen_ax_err_stats_tlv;
  1133. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  1134. * TLV_TAGS:
  1135. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  1136. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  1137. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  1138. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  1139. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  1140. */
  1141. /* NOTE:
  1142. * This structure is for documentation, and cannot be safely used directly.
  1143. * Instead, use the constituent TLV structures to fill/parse.
  1144. */
  1145. typedef struct {
  1146. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  1147. /* 11AC */
  1148. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  1149. /* 11AX */
  1150. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  1151. /* 11AC error stats */
  1152. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  1153. /* 11AX error stats */
  1154. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  1155. } htt_tx_pdev_selfgen_stats_t;
  1156. /* == TX MU STATS == */
  1157. typedef struct {
  1158. htt_tlv_hdr_t tlv_hdr;
  1159. /* mu-mimo sw sched cmd stats */
  1160. A_UINT32 mu_mimo_sch_posted;
  1161. A_UINT32 mu_mimo_sch_failed;
  1162. /* MU PPDU stats per hwQ */
  1163. A_UINT32 mu_mimo_ppdu_posted;
  1164. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  1165. typedef struct {
  1166. htt_tlv_hdr_t tlv_hdr;
  1167. /* mu-mimo mpdu level stats */
  1168. A_UINT32 mu_mimo_mpdus_queued_usr;
  1169. A_UINT32 mu_mimo_mpdus_tried_usr;
  1170. A_UINT32 mu_mimo_mpdus_failed_usr;
  1171. A_UINT32 mu_mimo_mpdus_requeued_usr;
  1172. A_UINT32 mu_mimo_err_no_ba_usr;
  1173. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1174. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1175. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  1176. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  1177. * TLV_TAGS:
  1178. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  1179. * - HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG (multiple)
  1180. */
  1181. /* NOTE:
  1182. * This structure is for documentation, and cannot be safely used directly.
  1183. * Instead, use the constituent TLV structures to fill/parse.
  1184. */
  1185. typedef struct {
  1186. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1187. htt_tx_pdev_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  1188. } htt_tx_pdev_mu_mimo_stats_t;
  1189. /* == TX SCHED STATS == */
  1190. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1191. /* NOTE: Variable length TLV, use length spec to infer array size */
  1192. typedef struct {
  1193. htt_tlv_hdr_t tlv_hdr;
  1194. /* Scheduler command posted per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1195. A_UINT32 sched_cmd_posted[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1196. } htt_sched_txq_cmd_posted_tlv_v;
  1197. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1198. /* NOTE: Variable length TLV, use length spec to infer array size */
  1199. typedef struct {
  1200. htt_tlv_hdr_t tlv_hdr;
  1201. /* Scheduler command reaped per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1202. A_UINT32 sched_cmd_reaped[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1203. } htt_sched_txq_cmd_reaped_tlv_v;
  1204. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  1205. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  1206. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  1207. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  1208. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  1209. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  1210. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  1211. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  1212. do { \
  1213. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  1214. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  1215. } while (0)
  1216. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  1217. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  1218. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  1219. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  1220. do { \
  1221. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  1222. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  1223. } while (0)
  1224. typedef struct {
  1225. htt_tlv_hdr_t tlv_hdr;
  1226. /* BIT [ 7 : 0] :- mac_id
  1227. * BIT [15 : 8] :- txq_id
  1228. * BIT [31 : 16] :- reserved
  1229. */
  1230. A_UINT32 mac_id__txq_id__word;
  1231. /* Scheduler policy ised for this TxQ */
  1232. A_UINT32 sched_policy;
  1233. /* Timestamp of last scheduler command posted */
  1234. A_UINT32 last_sched_cmd_posted_timestamp;
  1235. /* Timestamp of last scheduler command completed */
  1236. A_UINT32 last_sched_cmd_compl_timestamp;
  1237. /* Num of Sched2TAC ring hit Low Water Mark condition */
  1238. A_UINT32 sched_2_tac_lwm_count;
  1239. /* Num of Sched2TAC ring full condition */
  1240. A_UINT32 sched_2_tac_ring_full;
  1241. /* Num of scheduler command post failures that includes su/mu mimo/mu ofdma sequence type */
  1242. A_UINT32 sched_cmd_post_failure;
  1243. /* Num of active tids for this TxQ at current instance */
  1244. A_UINT32 num_active_tids;
  1245. /* Num of powersave schedules */
  1246. A_UINT32 num_ps_schedules;
  1247. /* Num of scheduler commands pending for this TxQ */
  1248. A_UINT32 sched_cmds_pending;
  1249. /* Num of tidq registration for this TxQ */
  1250. A_UINT32 num_tid_register;
  1251. /* Num of tidq de-registration for this TxQ */
  1252. A_UINT32 num_tid_unregister;
  1253. /* Num of iterations msduq stats was updated */
  1254. A_UINT32 num_qstats_queried;
  1255. /* qstats query update status */
  1256. A_UINT32 qstats_update_pending;
  1257. /* Timestamp of Last query stats made */
  1258. A_UINT32 last_qstats_query_timestamp;
  1259. /* Num of sched2tqm command queue full condition */
  1260. A_UINT32 num_tqm_cmdq_full;
  1261. /* Num of scheduler trigger from DE Module */
  1262. A_UINT32 num_de_sched_algo_trigger;
  1263. /* Num of scheduler trigger from RT Module */
  1264. A_UINT32 num_rt_sched_algo_trigger;
  1265. /* Num of scheduler trigger from TQM Module */
  1266. A_UINT32 num_tqm_sched_algo_trigger;
  1267. /* Num of schedules for notify frame */
  1268. A_UINT32 notify_sched;
  1269. } htt_tx_pdev_stats_sched_per_txq_tlv;
  1270. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  1271. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  1272. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  1273. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  1274. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  1275. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  1278. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  1279. } while (0)
  1280. typedef struct {
  1281. htt_tlv_hdr_t tlv_hdr;
  1282. /* BIT [ 7 : 0] :- mac_id
  1283. * BIT [31 : 8] :- reserved
  1284. */
  1285. A_UINT32 mac_id__word;
  1286. /* Current timestamp */
  1287. A_UINT32 current_timestamp;
  1288. } htt_stats_tx_sched_cmn_tlv;
  1289. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  1290. * TLV_TAGS:
  1291. * - HTT_STATS_TX_SCHED_CMN_TAG
  1292. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  1293. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  1294. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  1295. */
  1296. /* NOTE:
  1297. * This structure is for documentation, and cannot be safely used directly.
  1298. * Instead, use the constituent TLV structures to fill/parse.
  1299. */
  1300. typedef struct {
  1301. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  1302. struct _txq_tx_sched_stats {
  1303. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  1304. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  1305. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  1306. } txq[1];
  1307. } htt_stats_tx_sched_t;
  1308. /* == TQM STATS == */
  1309. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
  1310. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  1311. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  1312. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1313. /* NOTE: Variable length TLV, use length spec to infer array size */
  1314. typedef struct {
  1315. htt_tlv_hdr_t tlv_hdr;
  1316. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  1317. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  1318. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1319. /* NOTE: Variable length TLV, use length spec to infer array size */
  1320. typedef struct {
  1321. htt_tlv_hdr_t tlv_hdr;
  1322. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  1323. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  1324. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1325. /* NOTE: Variable length TLV, use length spec to infer array size */
  1326. typedef struct {
  1327. htt_tlv_hdr_t tlv_hdr;
  1328. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  1329. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  1330. typedef struct {
  1331. htt_tlv_hdr_t tlv_hdr;
  1332. A_UINT32 msdu_count;
  1333. A_UINT32 mpdu_count;
  1334. A_UINT32 remove_msdu;
  1335. A_UINT32 remove_mpdu;
  1336. A_UINT32 remove_msdu_ttl;
  1337. A_UINT32 send_bar;
  1338. A_UINT32 bar_sync;
  1339. A_UINT32 notify_mpdu;
  1340. A_UINT32 sync_cmd;
  1341. A_UINT32 write_cmd;
  1342. A_UINT32 hwsch_trigger;
  1343. A_UINT32 ack_tlv_proc;
  1344. A_UINT32 gen_mpdu_cmd;
  1345. A_UINT32 gen_list_cmd;
  1346. A_UINT32 remove_mpdu_cmd;
  1347. A_UINT32 remove_mpdu_tried_cmd;
  1348. A_UINT32 mpdu_queue_stats_cmd;
  1349. A_UINT32 mpdu_head_info_cmd;
  1350. A_UINT32 msdu_flow_stats_cmd;
  1351. A_UINT32 remove_msdu_cmd;
  1352. A_UINT32 remove_msdu_ttl_cmd;
  1353. A_UINT32 flush_cache_cmd;
  1354. A_UINT32 update_mpduq_cmd;
  1355. A_UINT32 enqueue;
  1356. A_UINT32 enqueue_notify;
  1357. A_UINT32 notify_mpdu_at_head;
  1358. A_UINT32 notify_mpdu_state_valid;
  1359. } htt_tx_tqm_pdev_stats_tlv_v;
  1360. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  1361. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  1362. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  1363. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  1364. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  1365. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  1368. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  1369. } while (0)
  1370. typedef struct {
  1371. htt_tlv_hdr_t tlv_hdr;
  1372. /* BIT [ 7 : 0] :- mac_id
  1373. * BIT [31 : 8] :- reserved
  1374. */
  1375. A_UINT32 mac_id__word;
  1376. A_UINT32 max_cmdq_id;
  1377. A_UINT32 list_mpdu_cnt_hist_intvl;
  1378. /* Global stats */
  1379. A_UINT32 add_msdu;
  1380. A_UINT32 q_empty;
  1381. A_UINT32 q_not_empty;
  1382. A_UINT32 drop_notification;
  1383. A_UINT32 desc_threshold;
  1384. } htt_tx_tqm_cmn_stats_tlv;
  1385. typedef struct {
  1386. htt_tlv_hdr_t tlv_hdr;
  1387. /* Error stats */
  1388. A_UINT32 q_empty_failure;
  1389. A_UINT32 q_not_empty_failure;
  1390. A_UINT32 add_msdu_failure;
  1391. } htt_tx_tqm_error_stats_tlv;
  1392. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  1393. * TLV_TAGS:
  1394. * - HTT_STATS_TX_TQM_CMN_TAG
  1395. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  1396. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  1397. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  1398. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  1399. * - HTT_STATS_TX_TQM_PDEV_TAG
  1400. */
  1401. /* NOTE:
  1402. * This structure is for documentation, and cannot be safely used directly.
  1403. * Instead, use the constituent TLV structures to fill/parse.
  1404. */
  1405. typedef struct {
  1406. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  1407. htt_tx_tqm_error_stats_tlv err_tlv;
  1408. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  1409. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  1410. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  1411. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  1412. } htt_tx_tqm_pdev_stats_t;
  1413. /* == TQM CMDQ stats == */
  1414. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  1415. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  1416. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  1417. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  1418. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  1419. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  1420. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  1421. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  1422. do { \
  1423. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  1424. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  1425. } while (0)
  1426. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  1427. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  1428. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  1429. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  1430. do { \
  1431. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  1432. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  1433. } while (0)
  1434. typedef struct {
  1435. htt_tlv_hdr_t tlv_hdr;
  1436. /* BIT [ 7 : 0] :- mac_id
  1437. * BIT [15 : 8] :- cmdq_id
  1438. * BIT [31 : 16] :- reserved
  1439. */
  1440. A_UINT32 mac_id__cmdq_id__word;
  1441. A_UINT32 sync_cmd;
  1442. A_UINT32 write_cmd;
  1443. A_UINT32 gen_mpdu_cmd;
  1444. A_UINT32 mpdu_queue_stats_cmd;
  1445. A_UINT32 mpdu_head_info_cmd;
  1446. A_UINT32 msdu_flow_stats_cmd;
  1447. A_UINT32 remove_mpdu_cmd;
  1448. A_UINT32 remove_msdu_cmd;
  1449. A_UINT32 flush_cache_cmd;
  1450. A_UINT32 update_mpduq_cmd;
  1451. A_UINT32 update_msduq_cmd;
  1452. } htt_tx_tqm_cmdq_status_tlv;
  1453. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  1454. * TLV_TAGS:
  1455. * - HTT_STATS_STRING_TAG
  1456. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  1457. */
  1458. /* NOTE:
  1459. * This structure is for documentation, and cannot be safely used directly.
  1460. * Instead, use the constituent TLV structures to fill/parse.
  1461. */
  1462. typedef struct {
  1463. struct _cmdq_stats {
  1464. htt_stats_string_tlv cmdq_str_tlv;
  1465. htt_tx_tqm_cmdq_status_tlv status_tlv;
  1466. } q[1];
  1467. } htt_tx_tqm_cmdq_stats_t;
  1468. /* == TX-DE STATS == */
  1469. /* Structures for tx de stats */
  1470. typedef struct {
  1471. htt_tlv_hdr_t tlv_hdr;
  1472. A_UINT32 m1_packets;
  1473. A_UINT32 m2_packets;
  1474. A_UINT32 m3_packets;
  1475. A_UINT32 m4_packets;
  1476. A_UINT32 g1_packets;
  1477. A_UINT32 g2_packets;
  1478. } htt_tx_de_eapol_packets_stats_tlv;
  1479. typedef struct {
  1480. htt_tlv_hdr_t tlv_hdr;
  1481. A_UINT32 ap_bss_peer_not_found;
  1482. A_UINT32 ap_bcast_mcast_no_peer;
  1483. A_UINT32 sta_delete_in_progress;
  1484. A_UINT32 ibss_no_bss_peer;
  1485. A_UINT32 invaild_vdev_type;
  1486. A_UINT32 invalid_ast_peer_entry;
  1487. A_UINT32 peer_entry_invalid;
  1488. A_UINT32 ethertype_not_ip;
  1489. A_UINT32 eapol_lookup_failed;
  1490. A_UINT32 qpeer_not_allow_data;
  1491. A_UINT32 fse_tid_override;
  1492. } htt_tx_de_classify_failed_stats_tlv;
  1493. typedef struct {
  1494. htt_tlv_hdr_t tlv_hdr;
  1495. A_UINT32 arp_packets;
  1496. A_UINT32 igmp_packets;
  1497. A_UINT32 dhcp_packets;
  1498. A_UINT32 host_inspected;
  1499. A_UINT32 htt_included;
  1500. A_UINT32 htt_valid_mcs;
  1501. A_UINT32 htt_valid_nss;
  1502. A_UINT32 htt_valid_preamble_type;
  1503. A_UINT32 htt_valid_chainmask;
  1504. A_UINT32 htt_valid_guard_interval;
  1505. A_UINT32 htt_valid_retries;
  1506. A_UINT32 htt_valid_bw_info;
  1507. A_UINT32 htt_valid_power;
  1508. A_UINT32 htt_valid_key_flags;
  1509. A_UINT32 htt_valid_no_encryption;
  1510. A_UINT32 fse_entry_count;
  1511. A_UINT32 fse_priority_be;
  1512. A_UINT32 fse_priority_high;
  1513. A_UINT32 fse_priority_low;
  1514. A_UINT32 fse_traffic_ptrn_be;
  1515. A_UINT32 fse_traffic_ptrn_over_sub;
  1516. A_UINT32 fse_traffic_ptrn_bursty;
  1517. A_UINT32 fse_traffic_ptrn_interactive;
  1518. A_UINT32 fse_traffic_ptrn_periodic;
  1519. A_UINT32 fse_hwqueue_alloc;
  1520. A_UINT32 fse_hwqueue_created;
  1521. A_UINT32 fse_hwqueue_send_to_host;
  1522. A_UINT32 mcast_entry;
  1523. A_UINT32 bcast_entry;
  1524. } htt_tx_de_classify_stats_tlv;
  1525. typedef struct {
  1526. htt_tlv_hdr_t tlv_hdr;
  1527. A_UINT32 eok;
  1528. A_UINT32 classify_done;
  1529. A_UINT32 lookup_failed;
  1530. A_UINT32 send_host_dhcp;
  1531. A_UINT32 send_host_mcast;
  1532. A_UINT32 send_host_unknown_dest;
  1533. A_UINT32 send_host;
  1534. A_UINT32 status_invalid;
  1535. } htt_tx_de_classify_status_stats_tlv;
  1536. typedef struct {
  1537. htt_tlv_hdr_t tlv_hdr;
  1538. A_UINT32 enqueued_pkts;
  1539. A_UINT32 to_tqm;
  1540. A_UINT32 to_tqm_bypass;
  1541. } htt_tx_de_enqueue_packets_stats_tlv;
  1542. typedef struct {
  1543. htt_tlv_hdr_t tlv_hdr;
  1544. A_UINT32 discarded_pkts;
  1545. A_UINT32 local_frames;
  1546. A_UINT32 is_ext_msdu;
  1547. } htt_tx_de_enqueue_discard_stats_tlv;
  1548. typedef struct {
  1549. htt_tlv_hdr_t tlv_hdr;
  1550. A_UINT32 tcl_dummy_frame;
  1551. A_UINT32 tqm_dummy_frame;
  1552. A_UINT32 tqm_notify_frame;
  1553. A_UINT32 fw2wbm_enq;
  1554. A_UINT32 tqm_bypass_frame;
  1555. } htt_tx_de_compl_stats_tlv;
  1556. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  1557. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  1558. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  1559. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  1560. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  1561. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  1562. do { \
  1563. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  1564. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  1565. } while (0)
  1566. typedef struct {
  1567. htt_tlv_hdr_t tlv_hdr;
  1568. /* BIT [ 7 : 0] :- mac_id
  1569. * BIT [31 : 8] :- reserved
  1570. */
  1571. A_UINT32 mac_id__word;
  1572. /* Global Stats */
  1573. A_UINT32 tcl2fw_entry_count;
  1574. A_UINT32 not_to_fw;
  1575. A_UINT32 invalid_pdev_vdev_peer;
  1576. A_UINT32 tcl_res_invalid_addrx;
  1577. A_UINT32 wbm2fw_entry_count;
  1578. A_UINT32 invalid_pdev;
  1579. } htt_tx_de_cmn_stats_tlv;
  1580. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  1581. * TLV_TAGS:
  1582. * - HTT_STATS_TX_DE_CMN_TAG
  1583. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  1584. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  1585. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  1586. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  1587. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  1588. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  1589. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  1590. */
  1591. /* NOTE:
  1592. * This structure is for documentation, and cannot be safely used directly.
  1593. * Instead, use the constituent TLV structures to fill/parse.
  1594. */
  1595. typedef struct {
  1596. htt_tx_de_cmn_stats_tlv cmn_tlv;
  1597. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  1598. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  1599. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  1600. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  1601. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  1602. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  1603. htt_tx_de_compl_stats_tlv comp_status_tlv;
  1604. } htt_tx_de_stats_t;
  1605. /* == RING-IF STATS == */
  1606. /* DWORD num_elems__prefetch_tail_idx */
  1607. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  1608. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  1609. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  1610. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  1611. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  1612. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  1613. HTT_RING_IF_STATS_NUM_ELEMS_S)
  1614. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  1617. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  1618. } while (0)
  1619. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  1620. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  1621. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  1622. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  1625. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  1626. } while (0)
  1627. /* DWORD head_idx__tail_idx */
  1628. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  1629. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  1630. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  1631. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  1632. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  1633. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  1634. HTT_RING_IF_STATS_HEAD_IDX_S)
  1635. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  1636. do { \
  1637. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  1638. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  1639. } while (0)
  1640. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  1641. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  1642. HTT_RING_IF_STATS_TAIL_IDX_S)
  1643. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  1644. do { \
  1645. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  1646. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  1647. } while (0)
  1648. /* DWORD shadow_head_idx__shadow_tail_idx */
  1649. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  1650. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  1651. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  1652. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  1653. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  1654. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  1655. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  1656. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  1659. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  1660. } while (0)
  1661. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  1662. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  1663. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  1664. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  1667. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  1668. } while (0)
  1669. /* DWORD lwm_thresh__hwm_thresh */
  1670. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  1671. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  1672. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  1673. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  1674. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  1675. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  1676. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  1677. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  1680. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  1681. } while (0)
  1682. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  1683. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  1684. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  1685. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  1688. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  1689. } while (0)
  1690. #define HTT_STATS_LOW_WM_BINS 5
  1691. #define HTT_STATS_HIGH_WM_BINS 5
  1692. typedef struct {
  1693. A_UINT32 base_addr; /* DWORD aligned base memory address of the ring */
  1694. A_UINT32 elem_size; /* size of each ring element */
  1695. /* BIT [15 : 0] :- num_elems
  1696. * BIT [31 : 16] :- prefetch_tail_idx
  1697. */
  1698. A_UINT32 num_elems__prefetch_tail_idx;
  1699. /* BIT [15 : 0] :- head_idx
  1700. * BIT [31 : 16] :- tail_idx
  1701. */
  1702. A_UINT32 head_idx__tail_idx;
  1703. /* BIT [15 : 0] :- shadow_head_idx
  1704. * BIT [31 : 16] :- shadow_tail_idx
  1705. */
  1706. A_UINT32 shadow_head_idx__shadow_tail_idx;
  1707. A_UINT32 num_tail_incr;
  1708. /* BIT [15 : 0] :- lwm_thresh
  1709. * BIT [31 : 16] :- hwm_thresh
  1710. */
  1711. A_UINT32 lwm_thresh__hwm_thresh;
  1712. A_UINT32 overrun_hit_count;
  1713. A_UINT32 underrun_hit_count;
  1714. A_UINT32 prod_blockwait_count;
  1715. A_UINT32 cons_blockwait_count;
  1716. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS]; /* FIX THIS: explain what each array element is for */
  1717. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS]; /* FIX THIS: explain what each array element is for */
  1718. } htt_ring_if_stats_tlv;
  1719. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  1720. #define HTT_RING_IF_CMN_MAC_ID_S 0
  1721. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  1722. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  1723. HTT_RING_IF_CMN_MAC_ID_S)
  1724. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  1725. do { \
  1726. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  1727. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  1728. } while (0)
  1729. typedef struct {
  1730. htt_tlv_hdr_t tlv_hdr;
  1731. /* BIT [ 7 : 0] :- mac_id
  1732. * BIT [31 : 8] :- reserved
  1733. */
  1734. A_UINT32 mac_id__word;
  1735. A_UINT32 num_records;
  1736. } htt_ring_if_cmn_tlv;
  1737. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  1738. * TLV_TAGS:
  1739. * - HTT_STATS_RING_IF_CMN_TAG
  1740. * - HTT_STATS_STRING_TAG
  1741. * - HTT_STATS_RING_IF_TAG
  1742. */
  1743. /* NOTE:
  1744. * This structure is for documentation, and cannot be safely used directly.
  1745. * Instead, use the constituent TLV structures to fill/parse.
  1746. */
  1747. typedef struct {
  1748. htt_ring_if_cmn_tlv cmn_tlv;
  1749. /* Variable based on the Number of records. */
  1750. struct _ring_if {
  1751. htt_stats_string_tlv ring_str_tlv;
  1752. htt_ring_if_stats_tlv ring_tlv;
  1753. } r[1];
  1754. } htt_ring_if_stats_t;
  1755. /* == SFM STATS == */
  1756. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1757. /* NOTE: Variable length TLV, use length spec to infer array size */
  1758. typedef struct {
  1759. htt_tlv_hdr_t tlv_hdr;
  1760. /* Number of DWORDS used per user and per client */
  1761. A_UINT32 dwords_used_by_user_n[1];
  1762. } htt_sfm_client_user_tlv_v;
  1763. typedef struct {
  1764. htt_tlv_hdr_t tlv_hdr;
  1765. /* Client ID */
  1766. A_UINT32 client_id;
  1767. /* Minimum number of buffers */
  1768. A_UINT32 buf_min;
  1769. /* Maximum number of buffers */
  1770. A_UINT32 buf_max;
  1771. /* Number of Busy buffers */
  1772. A_UINT32 buf_busy;
  1773. /* Number of Allocated buffers */
  1774. A_UINT32 buf_alloc;
  1775. /* Number of Available/Usable buffers */
  1776. A_UINT32 buf_avail;
  1777. /* Number of users */
  1778. A_UINT32 num_users;
  1779. } htt_sfm_client_tlv;
  1780. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  1781. #define HTT_SFM_CMN_MAC_ID_S 0
  1782. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  1783. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  1784. HTT_SFM_CMN_MAC_ID_S)
  1785. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  1786. do { \
  1787. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  1788. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  1789. } while (0)
  1790. typedef struct {
  1791. htt_tlv_hdr_t tlv_hdr;
  1792. /* BIT [ 7 : 0] :- mac_id
  1793. * BIT [31 : 8] :- reserved
  1794. */
  1795. A_UINT32 mac_id__word;
  1796. /* Indicates the total number of 128 byte buffers in the CMEM that are available for buffer sharing */
  1797. A_UINT32 buf_total;
  1798. /* Indicates for certain client or all the clients there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY */
  1799. A_UINT32 mem_empty;
  1800. /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  1801. A_UINT32 deallocate_bufs;
  1802. /* Number of Records */
  1803. A_UINT32 num_records;
  1804. } htt_sfm_cmn_tlv;
  1805. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  1806. * TLV_TAGS:
  1807. * - HTT_STATS_SFM_CMN_TAG
  1808. * - HTT_STATS_STRING_TAG
  1809. * - HTT_STATS_SFM_CLIENT_TAG
  1810. * - HTT_STATS_SFM_CLIENT_USER_TAG
  1811. */
  1812. /* NOTE:
  1813. * This structure is for documentation, and cannot be safely used directly.
  1814. * Instead, use the constituent TLV structures to fill/parse.
  1815. */
  1816. typedef struct {
  1817. htt_sfm_cmn_tlv cmn_tlv;
  1818. /* Variable based on the Number of records. */
  1819. struct _sfm_client {
  1820. htt_stats_string_tlv client_str_tlv;
  1821. htt_sfm_client_tlv client_tlv;
  1822. htt_sfm_client_user_tlv_v user_tlv;
  1823. } r[1];
  1824. } htt_sfm_stats_t;
  1825. /* == SRNG STATS == */
  1826. /* DWORD mac_id__ring_id__arena__ep */
  1827. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  1828. #define HTT_SRING_STATS_MAC_ID_S 0
  1829. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  1830. #define HTT_SRING_STATS_RING_ID_S 8
  1831. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  1832. #define HTT_SRING_STATS_ARENA_S 16
  1833. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  1834. #define HTT_SRING_STATS_EP_TYPE_S 24
  1835. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  1836. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  1837. HTT_SRING_STATS_MAC_ID_S)
  1838. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  1839. do { \
  1840. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  1841. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  1842. } while (0)
  1843. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  1844. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  1845. HTT_SRING_STATS_RING_ID_S)
  1846. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  1847. do { \
  1848. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  1849. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  1850. } while (0)
  1851. #define HTT_SRING_STATS_ARENA_GET(_var) \
  1852. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  1853. HTT_SRING_STATS_ARENA_S)
  1854. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  1857. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  1858. } while (0)
  1859. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  1860. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  1861. HTT_SRING_STATS_EP_TYPE_S)
  1862. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  1865. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  1866. } while (0)
  1867. /* DWORD num_avail_words__num_valid_words */
  1868. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  1869. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  1870. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  1871. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  1872. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  1873. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  1874. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  1875. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  1878. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  1879. } while (0)
  1880. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  1881. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  1882. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  1883. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  1884. do { \
  1885. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  1886. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  1887. } while (0)
  1888. /* DWORD head_ptr__tail_ptr */
  1889. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  1890. #define HTT_SRING_STATS_HEAD_PTR_S 0
  1891. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  1892. #define HTT_SRING_STATS_TAIL_PTR_S 16
  1893. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  1894. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  1895. HTT_SRING_STATS_HEAD_PTR_S)
  1896. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  1899. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  1900. } while (0)
  1901. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  1902. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  1903. HTT_SRING_STATS_TAIL_PTR_S)
  1904. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  1907. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  1908. } while (0)
  1909. /* DWORD consumer_empty__producer_full */
  1910. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  1911. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  1912. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  1913. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  1914. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  1915. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  1916. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  1917. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  1920. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  1921. } while (0)
  1922. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  1923. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  1924. HTT_SRING_STATS_PRODUCER_FULL_S)
  1925. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  1928. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  1929. } while (0)
  1930. /* DWORD prefetch_count__internal_tail_ptr */
  1931. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  1932. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  1933. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  1934. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  1935. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  1936. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  1937. HTT_SRING_STATS_PREFETCH_COUNT_S)
  1938. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  1941. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  1942. } while (0)
  1943. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  1944. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  1945. HTT_SRING_STATS_INTERNAL_TP_S)
  1946. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  1949. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  1950. } while (0)
  1951. typedef struct {
  1952. htt_tlv_hdr_t tlv_hdr;
  1953. /* BIT [ 7 : 0] :- mac_id
  1954. * BIT [15 : 8] :- ring_id
  1955. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  1956. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  1957. * BIT [31 : 25] :- reserved
  1958. */
  1959. A_UINT32 mac_id__ring_id__arena__ep;
  1960. A_UINT32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
  1961. A_UINT32 base_addr_msb;
  1962. A_UINT32 ring_size; /* size of ring */
  1963. A_UINT32 elem_size; /* size of each ring element */
  1964. /* Ring status */
  1965. /* BIT [15 : 0] :- num_avail_words
  1966. * BIT [31 : 16] :- num_valid_words
  1967. */
  1968. A_UINT32 num_avail_words__num_valid_words;
  1969. /* Index of head and tail */
  1970. /* BIT [15 : 0] :- head_ptr
  1971. * BIT [31 : 16] :- tail_ptr
  1972. */
  1973. A_UINT32 head_ptr__tail_ptr;
  1974. /* Empty or full counter of rings */
  1975. /* BIT [15 : 0] :- consumer_empty
  1976. * BIT [31 : 16] :- producer_full
  1977. */
  1978. A_UINT32 consumer_empty__producer_full;
  1979. /* Prefetch status of consumer ring */
  1980. /* BIT [15 : 0] :- prefetch_count
  1981. * BIT [31 : 16] :- internal_tail_ptr
  1982. */
  1983. A_UINT32 prefetch_count__internal_tail_ptr;
  1984. } htt_sring_stats_tlv;
  1985. typedef struct {
  1986. htt_tlv_hdr_t tlv_hdr;
  1987. A_UINT32 num_records;
  1988. } htt_sring_cmn_tlv;
  1989. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  1990. * TLV_TAGS:
  1991. * - HTT_STATS_SRING_CMN_TAG
  1992. * - HTT_STATS_STRING_TAG
  1993. * - HTT_STATS_SRING_STATS_TAG
  1994. */
  1995. /* NOTE:
  1996. * This structure is for documentation, and cannot be safely used directly.
  1997. * Instead, use the constituent TLV structures to fill/parse.
  1998. */
  1999. typedef struct {
  2000. htt_sring_cmn_tlv cmn_tlv;
  2001. /* Variable based on the Number of records. */
  2002. struct _sring_stats {
  2003. htt_stats_string_tlv sring_str_tlv;
  2004. htt_sring_stats_tlv sring_stats_tlv;
  2005. } r[1];
  2006. } htt_sring_stats_t;
  2007. /* == PDEV TX RATE CTRL STATS == */
  2008. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2009. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  2010. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2011. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  2012. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2013. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2014. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2015. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  2016. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2017. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2018. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  2019. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  2023. } while (0)
  2024. typedef struct {
  2025. htt_tlv_hdr_t tlv_hdr;
  2026. /* BIT [ 7 : 0] :- mac_id
  2027. * BIT [31 : 8] :- reserved
  2028. */
  2029. A_UINT32 mac_id__word;
  2030. /* Number of tx ldpc packets */
  2031. A_UINT32 tx_ldpc;
  2032. /* Number of tx rts packets */
  2033. A_UINT32 rts_cnt;
  2034. /* RSSI value of last ack packet (units = dB above noise floor) */
  2035. A_UINT32 ack_rssi;
  2036. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2037. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2038. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2039. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2040. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  2041. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2042. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2043. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  2044. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2045. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  2046. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  2047. /* Number of CTS-acknowledged RTS packets */
  2048. A_UINT32 rts_success;
  2049. } htt_tx_pdev_rate_stats_tlv;
  2050. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  2051. * TLV_TAGS:
  2052. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  2053. */
  2054. /* NOTE:
  2055. * This structure is for documentation, and cannot be safely used directly.
  2056. * Instead, use the constituent TLV structures to fill/parse.
  2057. */
  2058. typedef struct {
  2059. htt_tx_pdev_rate_stats_tlv rate_tlv;
  2060. } htt_tx_pdev_rate_stats_t;
  2061. /* == PDEV RX RATE CTRL STATS == */
  2062. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2063. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  2064. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2065. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  2066. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2067. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2068. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2069. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  2070. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2071. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2072. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  2073. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  2076. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  2077. } while (0)
  2078. typedef struct {
  2079. htt_tlv_hdr_t tlv_hdr;
  2080. /* BIT [ 7 : 0] :- mac_id
  2081. * BIT [31 : 8] :- reserved
  2082. */
  2083. A_UINT32 mac_id__word;
  2084. A_UINT32 nsts;
  2085. /* Number of rx ldpc packets */
  2086. A_UINT32 rx_ldpc;
  2087. /* Number of rx rts packets */
  2088. A_UINT32 rts_cnt;
  2089. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  2090. A_UINT32 rssi_data; /* units = dB above noise floor */
  2091. A_UINT32 rssi_comb; /* units = dB above noise floor */
  2092. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2093. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2094. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  2095. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2096. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  2097. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2098. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  2099. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  2100. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2101. } htt_rx_pdev_rate_stats_tlv;
  2102. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  2103. * TLV_TAGS:
  2104. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  2105. */
  2106. /* NOTE:
  2107. * This structure is for documentation, and cannot be safely used directly.
  2108. * Instead, use the constituent TLV structures to fill/parse.
  2109. */
  2110. typedef struct {
  2111. htt_rx_pdev_rate_stats_tlv rate_tlv;
  2112. } htt_rx_pdev_rate_stats_t;
  2113. /* == RX PDEV/SOC STATS == */
  2114. typedef struct {
  2115. htt_tlv_hdr_t tlv_hdr;
  2116. /* Num Packets received on REO FW ring */
  2117. A_UINT32 fw_reo_ring_data_msdu;
  2118. /* Num bc/mc packets indicated from fw to host */
  2119. A_UINT32 fw_to_host_data_msdu_bcmc;
  2120. /* Num unicast packets indicated from fw to host */
  2121. A_UINT32 fw_to_host_data_msdu_uc;
  2122. /* Num remote buf recycle from offload */
  2123. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  2124. /* Num remote free buf given to offload */
  2125. A_UINT32 ofld_remote_free_buf_indication_cnt;
  2126. } htt_rx_soc_fw_stats_tlv;
  2127. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2128. /* NOTE: Variable length TLV, use length spec to infer array size */
  2129. typedef struct {
  2130. htt_tlv_hdr_t tlv_hdr;
  2131. /* Num ring empty encountered */
  2132. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2133. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  2134. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2135. /* NOTE: Variable length TLV, use length spec to infer array size */
  2136. typedef struct {
  2137. htt_tlv_hdr_t tlv_hdr;
  2138. /* Num total buf refilled from refill ring */
  2139. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2140. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  2141. /* NOTE:
  2142. * This structure is for documentation, and cannot be safely used directly.
  2143. * Instead, use the constituent TLV structures to fill/parse.
  2144. */
  2145. typedef struct {
  2146. htt_rx_soc_fw_stats_tlv fw_tlv;
  2147. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  2148. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  2149. } htt_rx_soc_stats_t;
  2150. /* == RX PDEV STATS == */
  2151. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  2152. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  2153. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  2154. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  2155. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  2156. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  2157. do { \
  2158. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  2159. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  2160. } while (0)
  2161. #define HTT_STATS_SUBTYPE_MAX 16
  2162. typedef struct {
  2163. htt_tlv_hdr_t tlv_hdr;
  2164. /* BIT [ 7 : 0] :- mac_id
  2165. * BIT [31 : 8] :- reserved
  2166. */
  2167. A_UINT32 mac_id__word;
  2168. /* Num PPDU status processed from HW */
  2169. A_UINT32 ppdu_recvd;
  2170. /* Num MPDU across PPDUs with FCS ok */
  2171. A_UINT32 mpdu_cnt_fcs_ok;
  2172. /* Num MPDU across PPDUs with FCS err */
  2173. A_UINT32 mpdu_cnt_fcs_err;
  2174. /* Num MSDU across PPDUs */
  2175. A_UINT32 tcp_msdu_cnt;
  2176. /* Num MSDU across PPDUs */
  2177. A_UINT32 tcp_ack_msdu_cnt;
  2178. /* Num MSDU across PPDUs */
  2179. A_UINT32 udp_msdu_cnt;
  2180. /* Num MSDU across PPDUs */
  2181. A_UINT32 other_msdu_cnt;
  2182. /* Num MPDU on FW ring indicated */
  2183. A_UINT32 fw_ring_mpdu_ind;
  2184. /* Num MGMT MPDU given to protocol */
  2185. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  2186. /* Num ctrl MPDU given to protocol */
  2187. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  2188. /* Num mcast data packet received */
  2189. A_UINT32 fw_ring_mcast_data_msdu;
  2190. /* Num broadcast data packet received */
  2191. A_UINT32 fw_ring_bcast_data_msdu;
  2192. /* Num unicat data packet received */
  2193. A_UINT32 fw_ring_ucast_data_msdu;
  2194. /* Num null data packet received */
  2195. A_UINT32 fw_ring_null_data_msdu;
  2196. /* Num MPDU on FW ring dropped */
  2197. A_UINT32 fw_ring_mpdu_drop;
  2198. /* Num buf indication to offload */
  2199. A_UINT32 ofld_local_data_ind_cnt;
  2200. /* Num buf recycle from offload */
  2201. A_UINT32 ofld_local_data_buf_recycle_cnt;
  2202. /* Num buf indication to data_rx */
  2203. A_UINT32 drx_local_data_ind_cnt;
  2204. /* Num buf recycle from data_rx */
  2205. A_UINT32 drx_local_data_buf_recycle_cnt;
  2206. /* Num buf indication to protocol */
  2207. A_UINT32 local_nondata_ind_cnt;
  2208. /* Num buf recycle from protocol */
  2209. A_UINT32 local_nondata_buf_recycle_cnt;
  2210. /* Num buf fed */
  2211. A_UINT32 fw_status_buf_ring_refill_cnt;
  2212. /* Num ring empty encountered */
  2213. A_UINT32 fw_status_buf_ring_empty_cnt;
  2214. /* Num buf fed */
  2215. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  2216. /* Num ring empty encountered */
  2217. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  2218. /* Num buf fed */
  2219. A_UINT32 fw_link_buf_ring_refill_cnt;
  2220. /* Num ring empty encountered */
  2221. A_UINT32 fw_link_buf_ring_empty_cnt;
  2222. /* Num buf fed */
  2223. A_UINT32 host_pkt_buf_ring_refill_cnt;
  2224. /* Num ring empty encountered */
  2225. A_UINT32 host_pkt_buf_ring_empty_cnt;
  2226. /* Num buf fed */
  2227. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  2228. /* Num ring empty encountered */
  2229. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  2230. /* Num buf fed */
  2231. A_UINT32 mon_status_buf_ring_refill_cnt;
  2232. /* Num ring empty encountered */
  2233. A_UINT32 mon_status_buf_ring_empty_cnt;
  2234. /* Num buf fed */
  2235. A_UINT32 mon_desc_buf_ring_refill_cnt;
  2236. /* Num ring empty encountered */
  2237. A_UINT32 mon_desc_buf_ring_empty_cnt;
  2238. /* Num buf fed */
  2239. A_UINT32 mon_dest_ring_update_cnt;
  2240. /* Num ring full encountered */
  2241. A_UINT32 mon_dest_ring_full_cnt;
  2242. /* Num rx suspend is attempted */
  2243. A_UINT32 rx_suspend_cnt;
  2244. /* Num rx suspend failed */
  2245. A_UINT32 rx_suspend_fail_cnt;
  2246. /* Num rx resume attempted */
  2247. A_UINT32 rx_resume_cnt;
  2248. /* Num rx resume failed */
  2249. A_UINT32 rx_resume_fail_cnt;
  2250. /* Num rx ring switch */
  2251. A_UINT32 rx_ring_switch_cnt;
  2252. /* Num rx ring restore */
  2253. A_UINT32 rx_ring_restore_cnt;
  2254. /* Num rx flush issued */
  2255. A_UINT32 rx_flush_cnt;
  2256. } htt_rx_pdev_fw_stats_tlv;
  2257. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2258. /* NOTE: Variable length TLV, use length spec to infer array size */
  2259. typedef struct {
  2260. htt_tlv_hdr_t tlv_hdr;
  2261. /* Num error MPDU for each RxDMA error type */
  2262. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  2263. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  2264. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2265. /* NOTE: Variable length TLV, use length spec to infer array size */
  2266. typedef struct {
  2267. htt_tlv_hdr_t tlv_hdr;
  2268. /* Num MPDU dropped */
  2269. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  2270. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  2271. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  2272. * TLV_TAGS:
  2273. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  2274. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  2275. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  2276. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  2277. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  2278. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  2279. */
  2280. /* NOTE:
  2281. * This structure is for documentation, and cannot be safely used directly.
  2282. * Instead, use the constituent TLV structures to fill/parse.
  2283. */
  2284. typedef struct {
  2285. htt_rx_soc_stats_t soc_stats;
  2286. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  2287. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  2288. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  2289. } htt_rx_pdev_stats_t;
  2290. #endif /* __HTT_STATS_H__ */