htt_stats.h 118 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310
  1. /*
  2. * Copyright (c) 2017-2018 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. * - config_param0:
  90. * [Bit15: Bit0 ] cmdq id :if 0xFFFF print all cmdq's
  91. * [Bit31: Bit16] reserved
  92. * RESP MSG:
  93. * - htt_tx_tqm_cmdq_stats_t
  94. */
  95. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  96. /* HTT_DBG_EXT_STATS_TX_DE_INFO
  97. * PARAMS:
  98. * - No Params
  99. * RESP MSG:
  100. * - htt_tx_de_stats_t
  101. */
  102. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  103. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE
  104. * PARAMS:
  105. * - No Params
  106. * RESP MSG:
  107. * - htt_tx_pdev_rate_stats_t
  108. */
  109. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  110. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE
  111. * PARAMS:
  112. * - No Params
  113. * RESP MSG:
  114. * - htt_rx_pdev_rate_stats_t
  115. */
  116. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  117. /* HTT_DBG_EXT_STATS_PEER_INFO
  118. * PARAMS:
  119. * - config_param0:
  120. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  121. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  122. * [Bit31 : Bit16] sw_peer_id
  123. * config_param1:
  124. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  125. * 0 bit htt_peer_stats_cmn_tlv
  126. * 1 bit htt_peer_details_tlv
  127. * 2 bit htt_tx_peer_rate_stats_tlv
  128. * 3 bit htt_rx_peer_rate_stats_tlv
  129. * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv
  130. * 5 bit htt_rx_tid_stats_tlv
  131. * 6 bit htt_msdu_flow_stats_tlv
  132. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  133. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  134. * [Bit31 : Bit16] reserved
  135. * RESP MSG:
  136. * - htt_peer_stats_t
  137. */
  138. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  139. /* HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  140. * PARAMS:
  141. * - No Params
  142. * RESP MSG:
  143. * - htt_tx_pdev_selfgen_stats_t
  144. */
  145. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  146. /* HTT_DBG_EXT_STATS_TX_MU_HWQ
  147. * PARAMS:
  148. * - config_param0: [Bit31: Bit0] HWQ mask
  149. * RESP MSG:
  150. * - htt_tx_hwq_mu_mimo_stats_t
  151. */
  152. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  153. /* HTT_DBG_EXT_STATS_RING_IF_INFO
  154. * PARAMS:
  155. * - config_param0:
  156. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  157. * [Bit31: Bit16] reserved
  158. * RESP MSG:
  159. * - htt_ring_if_stats_t
  160. */
  161. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  162. /* HTT_DBG_EXT_STATS_SRNG_INFO
  163. * PARAMS:
  164. * - config_param0:
  165. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  166. * [Bit31: Bit16] reserved
  167. * - No Params
  168. * RESP MSG:
  169. * - htt_sring_stats_t
  170. */
  171. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  172. /* HTT_DBG_EXT_STATS_SFM_INFO
  173. * PARAMS:
  174. * - No Params
  175. * RESP MSG:
  176. * - htt_sfm_stats_t
  177. */
  178. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  179. /* HTT_DBG_EXT_STATS_PDEV_TX_MU
  180. * PARAMS:
  181. * - No Params
  182. * RESP MSG:
  183. * - htt_tx_pdev_mu_mimo_stats_t
  184. */
  185. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  186. /* HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  187. * PARAMS:
  188. * - config_param0:
  189. * [Bit7 : Bit0] vdev_id:8
  190. * note:0xFF to get all active peers based on pdev_mask.
  191. * [Bit31 : Bit8] rsvd:24
  192. * RESP MSG:
  193. * - htt_active_peer_details_list_t
  194. */
  195. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  196. /* HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  197. * PARAMS:
  198. * - config_param0:
  199. * [Bit0] - 1 sec interval histogram
  200. * [Bit1] - 100ms interval histogram
  201. * [Bit3] - Cumulative CCA stats
  202. * RESP MSG:
  203. * - htt_pdev_cca_stats_t
  204. */
  205. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  206. /* HTT_DBG_EXT_STATS_TWT_SESSIONS
  207. * PARAMS:
  208. * - config_param0:
  209. * No params
  210. * RESP MSG:
  211. * - htt_pdev_twt_sessions_stats_t
  212. */
  213. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  214. /* HTT_DBG_EXT_STATS_REO_CNTS
  215. * PARAMS:
  216. * - config_param0:
  217. * No params
  218. * RESP MSG:
  219. * - htt_soc_reo_resource_stats_t
  220. */
  221. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  222. /* keep this last */
  223. HTT_DBG_NUM_EXT_STATS = 256,
  224. };
  225. typedef enum {
  226. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  227. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  228. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  229. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  230. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  231. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  232. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  233. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  234. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  235. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  236. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  237. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  238. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  239. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  240. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  241. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  242. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  243. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  244. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  245. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  246. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  247. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  248. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  249. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  250. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  251. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  252. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  253. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  254. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  255. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  256. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  257. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  258. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  259. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  260. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  261. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  262. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  263. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  264. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  265. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  266. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  267. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  268. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  269. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  270. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  271. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  272. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  273. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  274. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  275. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  276. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  277. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  278. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  279. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  280. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  281. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  282. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  283. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  284. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  285. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  286. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  287. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  288. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  289. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  290. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  291. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  292. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  293. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  294. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  295. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  296. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  297. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  298. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  299. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  300. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  301. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  302. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  303. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  304. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  305. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  306. HTT_STATS_MAX_TAG,
  307. } htt_tlv_tag_t;
  308. #define HTT_STATS_TLV_TAG_M 0x00000fff
  309. #define HTT_STATS_TLV_TAG_S 0
  310. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  311. #define HTT_STATS_TLV_LENGTH_S 12
  312. #define HTT_STATS_TLV_TAG_GET(_var) \
  313. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  314. HTT_STATS_TLV_TAG_S)
  315. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  316. do { \
  317. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  318. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  319. } while (0)
  320. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  321. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  322. HTT_STATS_TLV_LENGTH_S)
  323. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  326. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  327. } while (0)
  328. typedef struct {
  329. /* BIT [11 : 0] :- tag
  330. * BIT [23 : 12] :- length
  331. * BIT [31 : 24] :- reserved
  332. */
  333. A_UINT32 tag__length;
  334. } htt_tlv_hdr_t;
  335. #define HTT_STATS_MAX_STRING_SZ32 4
  336. #define HTT_STATS_MACID_INVALID 0xff
  337. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  338. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  339. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  340. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  341. typedef enum {
  342. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  343. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  344. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  345. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  346. } htt_tx_pdev_underrun_enum;
  347. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 71
  348. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  349. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  350. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  351. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  352. #define HTT_RX_STATS_REFILL_MAX_RING 4
  353. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  354. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  355. /* Bytes stored in little endian order */
  356. /* Length should be multiple of DWORD */
  357. typedef struct {
  358. htt_tlv_hdr_t tlv_hdr;
  359. A_UINT32 data[1]; /* Can be variable length */
  360. } htt_stats_string_tlv;
  361. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  362. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  363. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  364. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  365. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  366. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  367. do { \
  368. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  369. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  370. } while (0)
  371. /* == TX PDEV STATS == */
  372. typedef struct {
  373. htt_tlv_hdr_t tlv_hdr;
  374. /* BIT [ 7 : 0] :- mac_id
  375. * BIT [31 : 8] :- reserved
  376. */
  377. A_UINT32 mac_id__word;
  378. /* Num queued to HW */
  379. A_UINT32 hw_queued;
  380. /* Num PPDU reaped from HW */
  381. A_UINT32 hw_reaped;
  382. /* Num underruns */
  383. A_UINT32 underrun;
  384. /* Num HW Paused counter. */
  385. A_UINT32 hw_paused;
  386. /* Num HW flush counter. */
  387. A_UINT32 hw_flush;
  388. /* Num HW filtered counter. */
  389. A_UINT32 hw_filt;
  390. /* Num PPDUs cleaned up in TX abort */
  391. A_UINT32 tx_abort;
  392. /* Num MPDUs requed by SW */
  393. A_UINT32 mpdu_requed;
  394. /* excessive retries */
  395. A_UINT32 tx_xretry;
  396. /* Last used data hw rate code */
  397. A_UINT32 data_rc;
  398. /* frames dropped due to excessive sw retries */
  399. A_UINT32 mpdu_dropped_xretry;
  400. /* illegal rate phy errors */
  401. A_UINT32 illgl_rate_phy_err;
  402. /* wal pdev continous xretry */
  403. A_UINT32 cont_xretry;
  404. /* wal pdev continous xretry */
  405. A_UINT32 tx_timeout;
  406. /* wal pdev resets */
  407. A_UINT32 pdev_resets;
  408. /* PhY/BB underrun */
  409. A_UINT32 phy_underrun;
  410. /* MPDU is more than txop limit */
  411. A_UINT32 txop_ovf;
  412. /* Number of Sequences posted */
  413. A_UINT32 seq_posted;
  414. /* Number of Sequences failed queueing */
  415. A_UINT32 seq_failed_queueing;
  416. /* Number of Sequences completed */
  417. A_UINT32 seq_completed;
  418. /* Number of Sequences restarted */
  419. A_UINT32 seq_restarted;
  420. /* Number of MU Sequences posted */
  421. A_UINT32 mu_seq_posted;
  422. /* Number of time HW ring is paused between seq switch within ISR */
  423. A_UINT32 seq_switch_hw_paused;
  424. /* Number of times seq continuation in DSR */
  425. A_UINT32 next_seq_posted_dsr;
  426. /* Number of times seq continuation in ISR */
  427. A_UINT32 seq_posted_isr;
  428. /* Number of seq_ctrl cached. */
  429. A_UINT32 seq_ctrl_cached;
  430. /* Number of MPDUs successfully transmitted */
  431. A_UINT32 mpdu_count_tqm;
  432. /* Number of MSDUs successfully transmitted */
  433. A_UINT32 msdu_count_tqm;
  434. /* Number of MPDUs dropped */
  435. A_UINT32 mpdu_removed_tqm;
  436. /* Number of MSDUs dropped */
  437. A_UINT32 msdu_removed_tqm;
  438. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  439. A_UINT32 mpdus_sw_flush;
  440. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  441. A_UINT32 mpdus_hw_filter;
  442. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  443. A_UINT32 mpdus_truncated;
  444. /* Num MPDUs that was tried but didn't receive ACK or BA */
  445. A_UINT32 mpdus_ack_failed;
  446. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  447. A_UINT32 mpdus_expired;
  448. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  449. A_UINT32 mpdus_seq_hw_retry;
  450. /* Num of TQM acked cmds processed */
  451. A_UINT32 ack_tlv_proc;
  452. /* coex_abort_mpdu_cnt valid. */
  453. A_UINT32 coex_abort_mpdu_cnt_valid;
  454. /* coex_abort_mpdu_cnt from TX FES stats. */
  455. A_UINT32 coex_abort_mpdu_cnt;
  456. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  457. A_UINT32 num_total_ppdus_tried_ota;
  458. /* Number of data PPDUs tried over the air (OTA) */
  459. A_UINT32 num_data_ppdus_tried_ota;
  460. /* Num Local control/mgmt frames (MSDUs) queued */
  461. A_UINT32 local_ctrl_mgmt_enqued;
  462. /* local_ctrl_mgmt_freed:
  463. * Num Local control/mgmt frames (MSDUs) done
  464. * It includes all local ctrl/mgmt completions
  465. * (acked, no ack, flush, TTL, etc)
  466. */
  467. A_UINT32 local_ctrl_mgmt_freed;
  468. /* Num Local data frames (MSDUs) queued */
  469. A_UINT32 local_data_enqued;
  470. /* local_data_freed:
  471. * Num Local data frames (MSDUs) done
  472. * It includes all local data completions
  473. * (acked, no ack, flush, TTL, etc)
  474. */
  475. A_UINT32 local_data_freed;
  476. } htt_tx_pdev_stats_cmn_tlv;
  477. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  478. /* NOTE: Variable length TLV, use length spec to infer array size */
  479. typedef struct {
  480. htt_tlv_hdr_t tlv_hdr;
  481. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  482. } htt_tx_pdev_stats_urrn_tlv_v;
  483. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  484. /* NOTE: Variable length TLV, use length spec to infer array size */
  485. typedef struct {
  486. htt_tlv_hdr_t tlv_hdr;
  487. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  488. } htt_tx_pdev_stats_flush_tlv_v;
  489. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  490. /* NOTE: Variable length TLV, use length spec to infer array size */
  491. typedef struct {
  492. htt_tlv_hdr_t tlv_hdr;
  493. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  494. } htt_tx_pdev_stats_sifs_tlv_v;
  495. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  496. /* NOTE: Variable length TLV, use length spec to infer array size */
  497. typedef struct {
  498. htt_tlv_hdr_t tlv_hdr;
  499. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  500. } htt_tx_pdev_stats_phy_err_tlv_v;
  501. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  502. /* NOTE: Variable length TLV, use length spec to infer array size */
  503. typedef struct {
  504. htt_tlv_hdr_t tlv_hdr;
  505. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  506. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  507. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  508. * TLV_TAGS:
  509. * - HTT_STATS_TX_PDEV_CMN_TAG
  510. * - HTT_STATS_TX_PDEV_URRN_TAG
  511. * - HTT_STATS_TX_PDEV_SIFS_TAG
  512. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  513. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  514. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  515. */
  516. /* NOTE:
  517. * This structure is for documentation, and cannot be safely used directly.
  518. * Instead, use the constituent TLV structures to fill/parse.
  519. */
  520. typedef struct _htt_tx_pdev_stats {
  521. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  522. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  523. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  524. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  525. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  526. htt_tx_pdev_stats_sifs_hist_tlv_v sifs_hist_tlv;
  527. } htt_tx_pdev_stats_t;
  528. /* == SOC ERROR STATS == */
  529. /* =============== PDEV ERROR STATS ============== */
  530. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  531. typedef struct {
  532. htt_tlv_hdr_t tlv_hdr;
  533. /* Stored as little endian */
  534. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  535. A_UINT32 mask;
  536. A_UINT32 count;
  537. } htt_hw_stats_intr_misc_tlv;
  538. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  539. typedef struct {
  540. htt_tlv_hdr_t tlv_hdr;
  541. /* Stored as little endian */
  542. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  543. A_UINT32 count;
  544. } htt_hw_stats_wd_timeout_tlv;
  545. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  546. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  547. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  548. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  549. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  550. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  551. do { \
  552. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  553. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  554. } while (0)
  555. typedef struct {
  556. htt_tlv_hdr_t tlv_hdr;
  557. /* BIT [ 7 : 0] :- mac_id
  558. * BIT [31 : 8] :- reserved
  559. */
  560. A_UINT32 mac_id__word;
  561. A_UINT32 tx_abort;
  562. A_UINT32 tx_abort_fail_count;
  563. A_UINT32 rx_abort;
  564. A_UINT32 rx_abort_fail_count;
  565. A_UINT32 warm_reset;
  566. A_UINT32 cold_reset;
  567. A_UINT32 tx_flush;
  568. A_UINT32 tx_glb_reset;
  569. A_UINT32 tx_txq_reset;
  570. A_UINT32 rx_timeout_reset;
  571. } htt_hw_stats_pdev_errs_tlv;
  572. typedef struct {
  573. htt_tlv_hdr_t tlv_hdr;
  574. /* BIT [ 7 : 0] :- mac_id
  575. * BIT [31 : 8] :- reserved
  576. */
  577. A_UINT32 mac_id__word;
  578. A_UINT32 last_unpause_ppdu_id;
  579. A_UINT32 hwsch_unpause_wait_tqm_write;
  580. A_UINT32 hwsch_dummy_tlv_skipped;
  581. A_UINT32 hwsch_misaligned_offset_received;
  582. A_UINT32 hwsch_reset_count;
  583. A_UINT32 hwsch_dev_reset_war;
  584. A_UINT32 hwsch_delayed_pause;
  585. A_UINT32 hwsch_long_delayed_pause;
  586. A_UINT32 sch_rx_ppdu_no_response;
  587. A_UINT32 sch_selfgen_response;
  588. A_UINT32 sch_rx_sifs_resp_trigger;
  589. } htt_hw_stats_whal_tx_tlv;
  590. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  591. * TLV_TAGS:
  592. * - HTT_STATS_HW_PDEV_ERRS_TAG
  593. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  594. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  595. * - HTT_STATS_WHAL_TX_TAG
  596. */
  597. /* NOTE:
  598. * This structure is for documentation, and cannot be safely used directly.
  599. * Instead, use the constituent TLV structures to fill/parse.
  600. */
  601. typedef struct _htt_pdev_err_stats {
  602. htt_hw_stats_pdev_errs_tlv pdev_errs;
  603. htt_hw_stats_intr_misc_tlv misc_stats[1];
  604. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  605. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  606. } htt_hw_err_stats_t;
  607. /* ============ PEER STATS ============ */
  608. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  609. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  610. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  611. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  612. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  613. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  614. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  615. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  616. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  617. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  618. do { \
  619. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  620. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  621. } while (0)
  622. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  623. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  624. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  625. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  626. do { \
  627. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  628. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  629. } while (0)
  630. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  631. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  632. HTT_MSDU_FLOW_STATS_DROP_S)
  633. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  634. do { \
  635. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  636. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  637. } while (0)
  638. typedef struct _htt_msdu_flow_stats_tlv {
  639. htt_tlv_hdr_t tlv_hdr;
  640. A_UINT32 last_update_timestamp;
  641. A_UINT32 last_add_timestamp;
  642. A_UINT32 last_remove_timestamp;
  643. A_UINT32 total_processed_msdu_count;
  644. A_UINT32 cur_msdu_count_in_flowq;
  645. A_UINT32 sw_peer_id; /* This will help to find which peer_id is stuck state */
  646. /* BIT [15 : 0] :- tx_flow_number
  647. * BIT [19 : 16] :- tid_num
  648. * BIT [20 : 20] :- drop_rule
  649. * BIT [31 : 21] :- reserved
  650. */
  651. A_UINT32 tx_flow_no__tid_num__drop_rule;
  652. A_UINT32 last_cycle_enqueue_count;
  653. A_UINT32 last_cycle_dequeue_count;
  654. A_UINT32 last_cycle_drop_count;
  655. /* BIT [15 : 0] :- current_drop_th
  656. * BIT [31 : 16] :- reserved
  657. */
  658. A_UINT32 current_drop_th;
  659. } htt_msdu_flow_stats_tlv;
  660. #define MAX_HTT_TID_NAME 8
  661. /* DWORD sw_peer_id__tid_num */
  662. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  663. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  664. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  665. #define HTT_TX_TID_STATS_TID_NUM_S 16
  666. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  667. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  668. HTT_TX_TID_STATS_SW_PEER_ID_S)
  669. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  670. do { \
  671. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  672. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  673. } while (0)
  674. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  675. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  676. HTT_TX_TID_STATS_TID_NUM_S)
  677. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  678. do { \
  679. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  680. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  681. } while (0)
  682. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  683. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  684. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  685. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  686. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  687. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  688. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  689. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  690. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  691. do { \
  692. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  693. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  694. } while (0)
  695. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  696. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  697. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  698. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  699. do { \
  700. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  701. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  702. } while (0)
  703. /* Tidq stats */
  704. typedef struct _htt_tx_tid_stats_tlv {
  705. htt_tlv_hdr_t tlv_hdr;
  706. /* Stored as little endian */
  707. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  708. /* BIT [15 : 0] :- sw_peer_id
  709. * BIT [31 : 16] :- tid_num
  710. */
  711. A_UINT32 sw_peer_id__tid_num;
  712. /* BIT [ 7 : 0] :- num_sched_pending
  713. * BIT [15 : 8] :- num_ppdu_in_hwq
  714. * BIT [31 : 16] :- reserved
  715. */
  716. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  717. A_UINT32 tid_flags;
  718. /* per tid # of hw_queued ppdu.*/
  719. A_UINT32 hw_queued;
  720. /* number of per tid successful PPDU. */
  721. A_UINT32 hw_reaped;
  722. /* per tid Num MPDUs filtered by HW */
  723. A_UINT32 mpdus_hw_filter;
  724. A_UINT32 qdepth_bytes;
  725. A_UINT32 qdepth_num_msdu;
  726. A_UINT32 qdepth_num_mpdu;
  727. A_UINT32 last_scheduled_tsmp;
  728. A_UINT32 pause_module_id;
  729. A_UINT32 block_module_id;
  730. /* tid tx airtime in sec */
  731. A_UINT32 tid_tx_airtime;
  732. } htt_tx_tid_stats_tlv;
  733. /* Tidq stats */
  734. typedef struct _htt_tx_tid_stats_v1_tlv {
  735. htt_tlv_hdr_t tlv_hdr;
  736. /* Stored as little endian */
  737. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  738. /* BIT [15 : 0] :- sw_peer_id
  739. * BIT [31 : 16] :- tid_num
  740. */
  741. A_UINT32 sw_peer_id__tid_num;
  742. /* BIT [ 7 : 0] :- num_sched_pending
  743. * BIT [15 : 8] :- num_ppdu_in_hwq
  744. * BIT [31 : 16] :- reserved
  745. */
  746. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  747. A_UINT32 tid_flags;
  748. /* Max qdepth in bytes reached by this tid*/
  749. A_UINT32 max_qdepth_bytes;
  750. /* number of msdus qdepth reached max */
  751. A_UINT32 max_qdepth_n_msdus;
  752. /* Made reserved this field */
  753. A_UINT32 rsvd;
  754. A_UINT32 qdepth_bytes;
  755. A_UINT32 qdepth_num_msdu;
  756. A_UINT32 qdepth_num_mpdu;
  757. A_UINT32 last_scheduled_tsmp;
  758. A_UINT32 pause_module_id;
  759. A_UINT32 block_module_id;
  760. /* tid tx airtime in sec */
  761. A_UINT32 tid_tx_airtime;
  762. A_UINT32 allow_n_flags;
  763. /* BIT [15 : 0] :- sendn_frms_allowed
  764. * BIT [31 : 16] :- reserved
  765. */
  766. A_UINT32 sendn_frms_allowed;
  767. } htt_tx_tid_stats_v1_tlv;
  768. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  769. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  770. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  771. #define HTT_RX_TID_STATS_TID_NUM_S 16
  772. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  773. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  774. HTT_RX_TID_STATS_SW_PEER_ID_S)
  775. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  776. do { \
  777. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  778. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  779. } while (0)
  780. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  781. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  782. HTT_RX_TID_STATS_TID_NUM_S)
  783. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  784. do { \
  785. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  786. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  787. } while (0)
  788. typedef struct _htt_rx_tid_stats_tlv {
  789. htt_tlv_hdr_t tlv_hdr;
  790. /* BIT [15 : 0] : sw_peer_id
  791. * BIT [31 : 16] : tid_num
  792. */
  793. A_UINT32 sw_peer_id__tid_num;
  794. /* Stored as little endian */
  795. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  796. /* dup_in_reorder not collected per tid for now,
  797. as there is no wal_peer back ptr in data rx peer. */
  798. A_UINT32 dup_in_reorder;
  799. A_UINT32 dup_past_outside_window;
  800. A_UINT32 dup_past_within_window;
  801. /* Number of per tid MSDUs with flag of decrypt_err */
  802. A_UINT32 rxdesc_err_decrypt;
  803. /* tid rx airtime in sec */
  804. A_UINT32 tid_rx_airtime;
  805. } htt_rx_tid_stats_tlv;
  806. #define HTT_MAX_COUNTER_NAME 8
  807. typedef struct {
  808. htt_tlv_hdr_t tlv_hdr;
  809. /* Stored as little endian */
  810. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  811. A_UINT32 count;
  812. } htt_counter_tlv;
  813. typedef struct {
  814. htt_tlv_hdr_t tlv_hdr;
  815. /* Number of rx ppdu. */
  816. A_UINT32 ppdu_cnt;
  817. /* Number of rx mpdu. */
  818. A_UINT32 mpdu_cnt;
  819. /* Number of rx msdu */
  820. A_UINT32 msdu_cnt;
  821. /* Pause bitmap */
  822. A_UINT32 pause_bitmap;
  823. /* Block bitmap */
  824. A_UINT32 block_bitmap;
  825. /* Current timestamp */
  826. A_UINT32 current_timestamp;
  827. /* Peer cumulative tx airtime in sec */
  828. A_UINT32 peer_tx_airtime;
  829. /* Peer cumulative rx airtime in sec */
  830. A_UINT32 peer_rx_airtime;
  831. /* Peer current rssi in dBm */
  832. A_INT32 rssi;
  833. /* Total enqueued, dequeued and dropped msdu's for peer */
  834. A_UINT32 peer_enqueued_count_low;
  835. A_UINT32 peer_enqueued_count_high;
  836. A_UINT32 peer_dequeued_count_low;
  837. A_UINT32 peer_dequeued_count_high;
  838. A_UINT32 peer_dropped_count_low;
  839. A_UINT32 peer_dropped_count_high;
  840. /* Total ppdu transmitted bytes for peer: includes MAC header overhead */
  841. A_UINT32 ppdu_transmitted_bytes_low;
  842. A_UINT32 ppdu_transmitted_bytes_high;
  843. } htt_peer_stats_cmn_tlv;
  844. typedef struct {
  845. htt_tlv_hdr_t tlv_hdr;
  846. /* This enum type of HTT_PEER_TYPE */
  847. A_UINT32 peer_type;
  848. A_UINT32 sw_peer_id;
  849. /* BIT [7 : 0] :- vdev_id
  850. * BIT [15 : 8] :- pdev_id
  851. * BIT [31 : 16] :- ast_indx
  852. */
  853. A_UINT32 vdev_pdev_ast_idx;
  854. htt_mac_addr mac_addr;
  855. A_UINT32 peer_flags;
  856. A_UINT32 qpeer_flags;
  857. } htt_peer_details_tlv;
  858. typedef enum {
  859. HTT_STATS_PREAM_OFDM,
  860. HTT_STATS_PREAM_CCK,
  861. HTT_STATS_PREAM_HT,
  862. HTT_STATS_PREAM_VHT,
  863. HTT_STATS_PREAM_HE,
  864. HTT_STATS_PREAM_RSVD,
  865. HTT_STATS_PREAM_RSVD1,
  866. HTT_STATS_PREAM_COUNT,
  867. } HTT_STATS_PREAM_TYPE;
  868. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12
  869. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  870. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  871. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  872. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  873. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  874. typedef struct _htt_tx_peer_rate_stats_tlv {
  875. htt_tlv_hdr_t tlv_hdr;
  876. /* Number of tx ldpc packets */
  877. A_UINT32 tx_ldpc;
  878. /* Number of tx rts packets */
  879. A_UINT32 rts_cnt;
  880. /* RSSI value of last ack packet (units = dB above noise floor) */
  881. A_UINT32 ack_rssi;
  882. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  883. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  884. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  885. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  886. 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 */
  887. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  888. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  889. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  890. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  891. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  892. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  893. } htt_tx_peer_rate_stats_tlv;
  894. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12
  895. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  896. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  897. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  898. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  899. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  900. typedef struct _htt_rx_peer_rate_stats_tlv {
  901. htt_tlv_hdr_t tlv_hdr;
  902. A_UINT32 nsts;
  903. /* Number of rx ldpc packets */
  904. A_UINT32 rx_ldpc;
  905. /* Number of rx rts packets */
  906. A_UINT32 rts_cnt;
  907. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  908. A_UINT32 rssi_data; /* units = dB above noise floor */
  909. A_UINT32 rssi_comb; /* units = dB above noise floor */
  910. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  911. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  912. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  913. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  914. 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 */
  915. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  916. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  917. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  918. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  919. } htt_rx_peer_rate_stats_tlv;
  920. typedef enum {
  921. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  922. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  923. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  924. } htt_peer_stats_req_mode_t;
  925. typedef enum {
  926. HTT_PEER_STATS_CMN_TLV = 0,
  927. HTT_PEER_DETAILS_TLV = 1,
  928. HTT_TX_PEER_RATE_STATS_TLV = 2,
  929. HTT_RX_PEER_RATE_STATS_TLV = 3,
  930. HTT_TX_TID_STATS_TLV = 4,
  931. HTT_RX_TID_STATS_TLV = 5,
  932. HTT_MSDU_FLOW_STATS_TLV = 6,
  933. HTT_PEER_STATS_MAX_TLV = 31,
  934. } htt_peer_stats_tlv_enum;
  935. /* config_param0 */
  936. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  937. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  938. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  939. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  940. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  941. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  942. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET( _var, _val)\
  943. do { \
  944. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  945. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  946. } while (0)
  947. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  948. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  949. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  950. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  951. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  952. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  953. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  954. do { \
  955. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  956. } while (0)
  957. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  958. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  959. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  960. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  961. do { \
  962. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  963. } while (0)
  964. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  965. * TLV_TAGS:
  966. * - HTT_STATS_PEER_STATS_CMN_TAG
  967. * - HTT_STATS_PEER_DETAILS_TAG
  968. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  969. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  970. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  971. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  972. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  973. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  974. */
  975. /* NOTE:
  976. * This structure is for documentation, and cannot be safely used directly.
  977. * Instead, use the constituent TLV structures to fill/parse.
  978. */
  979. typedef struct _htt_peer_stats {
  980. htt_peer_stats_cmn_tlv cmn_tlv;
  981. htt_peer_details_tlv peer_details;
  982. /* from g_rate_info_stats */
  983. htt_tx_peer_rate_stats_tlv tx_rate;
  984. htt_rx_peer_rate_stats_tlv rx_rate;
  985. htt_tx_tid_stats_tlv tx_tid_stats[1];
  986. htt_rx_tid_stats_tlv rx_tid_stats[1];
  987. htt_msdu_flow_stats_tlv msdu_flowq[1];
  988. htt_tx_tid_stats_v1_tlv tx_tid_stats_v1[1];
  989. } htt_peer_stats_t;
  990. /* =========== ACTIVE PEER LIST ========== */
  991. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  992. * TLV_TAGS:
  993. * - HTT_STATS_PEER_DETAILS_TAG
  994. */
  995. /* NOTE:
  996. * This structure is for documentation, and cannot be safely used directly.
  997. * Instead, use the constituent TLV structures to fill/parse.
  998. */
  999. typedef struct {
  1000. htt_peer_details_tlv peer_details[1];
  1001. } htt_active_peer_details_list_t;
  1002. /* =========== MUMIMO HWQ stats =========== */
  1003. /* MU MIMO stats per hwQ */
  1004. typedef struct {
  1005. htt_tlv_hdr_t tlv_hdr;
  1006. A_UINT32 mu_mimo_sch_posted;
  1007. A_UINT32 mu_mimo_sch_failed;
  1008. A_UINT32 mu_mimo_ppdu_posted;
  1009. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  1010. typedef struct {
  1011. htt_tlv_hdr_t tlv_hdr;
  1012. A_UINT32 mu_mimo_mpdus_queued_usr; /* Number of mpdus queued per user */
  1013. A_UINT32 mu_mimo_mpdus_tried_usr; /* Number of mpdus actually transmitted by TxPCU per user */
  1014. A_UINT32 mu_mimo_mpdus_failed_usr; /* Number of mpdus failed per user */
  1015. A_UINT32 mu_mimo_mpdus_requeued_usr; /* Number of mpdus requeued per user */
  1016. A_UINT32 mu_mimo_err_no_ba_usr; /* Number of times BA is not received for a user in MU PPDU */
  1017. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1018. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1019. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  1020. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  1021. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  1022. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  1023. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  1024. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  1025. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  1026. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  1027. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  1028. do { \
  1029. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  1030. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  1031. } while (0)
  1032. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  1033. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  1034. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  1035. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  1036. do { \
  1037. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  1038. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  1039. } while (0)
  1040. typedef struct {
  1041. htt_tlv_hdr_t tlv_hdr;
  1042. /* BIT [ 7 : 0] :- mac_id
  1043. * BIT [15 : 8] :- hwq_id
  1044. * BIT [31 : 16] :- reserved
  1045. */
  1046. A_UINT32 mac_id__hwq_id__word;
  1047. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  1048. /* NOTE:
  1049. * This structure is for documentation, and cannot be safely used directly.
  1050. * Instead, use the constituent TLV structures to fill/parse.
  1051. */
  1052. typedef struct {
  1053. struct _hwq_mu_mimo_stats {
  1054. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  1055. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1056. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_TX_MAX_NUM_USERS */
  1057. } hwq[1];
  1058. } htt_tx_hwq_mu_mimo_stats_t;
  1059. /* == TX HWQ STATS == */
  1060. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  1061. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  1062. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  1063. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  1064. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  1065. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  1066. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  1067. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  1068. do { \
  1069. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  1070. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  1071. } while (0)
  1072. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  1073. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  1074. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  1075. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  1076. do { \
  1077. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  1078. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  1079. } while (0)
  1080. typedef struct {
  1081. htt_tlv_hdr_t tlv_hdr;
  1082. /* BIT [ 7 : 0] :- mac_id
  1083. * BIT [15 : 8] :- hwq_id
  1084. * BIT [31 : 16] :- reserved
  1085. */
  1086. A_UINT32 mac_id__hwq_id__word;
  1087. /* PPDU level stats */
  1088. A_UINT32 xretry; /* Number of times ack is failed for the PPDU scheduled on this txQ */
  1089. A_UINT32 underrun_cnt; /* Number of times sched cmd status reported mpdu underrun */
  1090. A_UINT32 flush_cnt; /* Number of times sched cmd is flushed */
  1091. A_UINT32 filt_cnt; /* Number of times sched cmd is filtered */
  1092. A_UINT32 null_mpdu_bmap; /* Number of times HWSCH uploaded null mpdu bitmap */
  1093. 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 */
  1094. A_UINT32 ack_tlv_proc; /* Number of times TQM processed ack tlv received from HWSCH */
  1095. A_UINT32 sched_id_proc; /* Cache latest processed scheduler ID received from ack ba tlv */
  1096. A_UINT32 null_mpdu_tx_count; /* Number of times TxPCU reported mpdus transmitted for a user is zero */
  1097. A_UINT32 mpdu_bmap_not_recvd; /* Number of times SW did not see any mpdu info bitmap tlv on FES status ring */
  1098. /* Selfgen stats per hwQ */
  1099. A_UINT32 num_bar; /* Number of SU/MU BAR frames posted to hwQ */
  1100. A_UINT32 rts; /* Number of RTS frames posted to hwQ */
  1101. A_UINT32 cts2self; /* Number of cts2self frames posted to hwQ */
  1102. A_UINT32 qos_null; /* Number of qos null frames posted to hwQ */
  1103. /* MPDU level stats */
  1104. A_UINT32 mpdu_tried_cnt; /* mpdus tried Tx by HWSCH/TQM */
  1105. A_UINT32 mpdu_queued_cnt; /* mpdus queued to HWSCH */
  1106. A_UINT32 mpdu_ack_fail_cnt; /* mpdus tried but ack was not received */
  1107. A_UINT32 mpdu_filt_cnt; /* This will include sched cmd flush and time based discard */
  1108. A_UINT32 false_mpdu_ack_count; /* Number of MPDUs for which ACK was sucessful but no Tx happened */
  1109. } htt_tx_hwq_stats_cmn_tlv;
  1110. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) ( sizeof(A_UINT32) + /* hist_intvl */ \
  1111. (sizeof(A_UINT32) * (_num_elems)))
  1112. /* NOTE: Variable length TLV, use length spec to infer array size */
  1113. typedef struct {
  1114. htt_tlv_hdr_t tlv_hdr;
  1115. A_UINT32 hist_intvl;
  1116. /* histogram of ppdu post to hwsch - > cmd status received */
  1117. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1118. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1119. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1120. /* NOTE: Variable length TLV, use length spec to infer array size */
  1121. typedef struct {
  1122. htt_tlv_hdr_t tlv_hdr;
  1123. /* Histogram of sched cmd result */
  1124. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1125. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1126. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1127. /* NOTE: Variable length TLV, use length spec to infer array size */
  1128. typedef struct {
  1129. htt_tlv_hdr_t tlv_hdr;
  1130. /* Histogram of various pause conitions */
  1131. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1132. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1133. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1134. /* NOTE: Variable length TLV, use length spec to infer array size */
  1135. typedef struct {
  1136. htt_tlv_hdr_t tlv_hdr;
  1137. /* Histogram of number of user fes result */
  1138. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1139. } htt_tx_hwq_fes_result_stats_tlv_v;
  1140. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1141. * TLV_TAGS:
  1142. * - HTT_STATS_STRING_TAG
  1143. * - HTT_STATS_TX_HWQ_CMN_TAG
  1144. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1145. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1146. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1147. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1148. */
  1149. /* NOTE:
  1150. * This structure is for documentation, and cannot be safely used directly.
  1151. * Instead, use the constituent TLV structures to fill/parse.
  1152. */
  1153. typedef struct _htt_tx_hwq_stats {
  1154. htt_stats_string_tlv hwq_str_tlv;
  1155. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1156. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1157. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1158. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1159. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1160. } htt_tx_hwq_stats_t;
  1161. /* == TX SELFGEN STATS == */
  1162. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1163. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1164. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1165. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1166. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1167. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1168. do { \
  1169. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1170. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1171. } while (0)
  1172. typedef struct {
  1173. htt_tlv_hdr_t tlv_hdr;
  1174. /* BIT [ 7 : 0] :- mac_id
  1175. * BIT [31 : 8] :- reserved
  1176. */
  1177. A_UINT32 mac_id__word;
  1178. A_UINT32 su_bar;
  1179. A_UINT32 rts;
  1180. A_UINT32 cts2self;
  1181. A_UINT32 qos_null;
  1182. A_UINT32 delayed_bar_1; /* MU user 1 */
  1183. A_UINT32 delayed_bar_2; /* MU user 2 */
  1184. A_UINT32 delayed_bar_3; /* MU user 3 */
  1185. A_UINT32 delayed_bar_4; /* MU user 4 */
  1186. A_UINT32 delayed_bar_5; /* MU user 5 */
  1187. A_UINT32 delayed_bar_6; /* MU user 6 */
  1188. A_UINT32 delayed_bar_7; /* MU user 7 */
  1189. } htt_tx_selfgen_cmn_stats_tlv;
  1190. typedef struct {
  1191. htt_tlv_hdr_t tlv_hdr;
  1192. /* 11AC */
  1193. A_UINT32 ac_su_ndpa;
  1194. A_UINT32 ac_su_ndp;
  1195. A_UINT32 ac_mu_mimo_ndpa;
  1196. A_UINT32 ac_mu_mimo_ndp;
  1197. A_UINT32 ac_mu_mimo_brpoll_1; /* MU user 1 */
  1198. A_UINT32 ac_mu_mimo_brpoll_2; /* MU user 2 */
  1199. A_UINT32 ac_mu_mimo_brpoll_3; /* MU user 3 */
  1200. } htt_tx_selfgen_ac_stats_tlv;
  1201. typedef struct {
  1202. htt_tlv_hdr_t tlv_hdr;
  1203. /* 11AX */
  1204. A_UINT32 ax_su_ndpa;
  1205. A_UINT32 ax_su_ndp;
  1206. A_UINT32 ax_mu_mimo_ndpa;
  1207. A_UINT32 ax_mu_mimo_ndp;
  1208. A_UINT32 ax_mu_mimo_brpoll_1; /* MU user 1 */
  1209. A_UINT32 ax_mu_mimo_brpoll_2; /* MU user 2 */
  1210. A_UINT32 ax_mu_mimo_brpoll_3; /* MU user 3 */
  1211. A_UINT32 ax_mu_mimo_brpoll_4; /* MU user 4 */
  1212. A_UINT32 ax_mu_mimo_brpoll_5; /* MU user 5 */
  1213. A_UINT32 ax_mu_mimo_brpoll_6; /* MU user 6 */
  1214. A_UINT32 ax_mu_mimo_brpoll_7; /* MU user 7 */
  1215. A_UINT32 ax_basic_trigger;
  1216. A_UINT32 ax_bsr_trigger;
  1217. A_UINT32 ax_mu_bar_trigger;
  1218. A_UINT32 ax_mu_rts_trigger;
  1219. } htt_tx_selfgen_ax_stats_tlv;
  1220. typedef struct {
  1221. htt_tlv_hdr_t tlv_hdr;
  1222. /* 11AC error stats */
  1223. A_UINT32 ac_su_ndp_err;
  1224. A_UINT32 ac_su_ndpa_err;
  1225. A_UINT32 ac_mu_mimo_ndpa_err;
  1226. A_UINT32 ac_mu_mimo_ndp_err;
  1227. A_UINT32 ac_mu_mimo_brp1_err;
  1228. A_UINT32 ac_mu_mimo_brp2_err;
  1229. A_UINT32 ac_mu_mimo_brp3_err;
  1230. } htt_tx_selfgen_ac_err_stats_tlv;
  1231. typedef struct {
  1232. htt_tlv_hdr_t tlv_hdr;
  1233. /* 11AX error stats */
  1234. A_UINT32 ax_su_ndp_err;
  1235. A_UINT32 ax_su_ndpa_err;
  1236. A_UINT32 ax_mu_mimo_ndpa_err;
  1237. A_UINT32 ax_mu_mimo_ndp_err;
  1238. A_UINT32 ax_mu_mimo_brp1_err;
  1239. A_UINT32 ax_mu_mimo_brp2_err;
  1240. A_UINT32 ax_mu_mimo_brp3_err;
  1241. A_UINT32 ax_mu_mimo_brp4_err;
  1242. A_UINT32 ax_mu_mimo_brp5_err;
  1243. A_UINT32 ax_mu_mimo_brp6_err;
  1244. A_UINT32 ax_mu_mimo_brp7_err;
  1245. A_UINT32 ax_basic_trigger_err;
  1246. A_UINT32 ax_bsr_trigger_err;
  1247. A_UINT32 ax_mu_bar_trigger_err;
  1248. A_UINT32 ax_mu_rts_trigger_err;
  1249. } htt_tx_selfgen_ax_err_stats_tlv;
  1250. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  1251. * TLV_TAGS:
  1252. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  1253. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  1254. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  1255. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  1256. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  1257. */
  1258. /* NOTE:
  1259. * This structure is for documentation, and cannot be safely used directly.
  1260. * Instead, use the constituent TLV structures to fill/parse.
  1261. */
  1262. typedef struct {
  1263. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  1264. /* 11AC */
  1265. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  1266. /* 11AX */
  1267. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  1268. /* 11AC error stats */
  1269. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  1270. /* 11AX error stats */
  1271. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  1272. } htt_tx_pdev_selfgen_stats_t;
  1273. /* == TX MU STATS == */
  1274. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  1275. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  1276. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  1277. typedef struct {
  1278. htt_tlv_hdr_t tlv_hdr;
  1279. /* mu-mimo sw sched cmd stats */
  1280. A_UINT32 mu_mimo_sch_posted;
  1281. A_UINT32 mu_mimo_sch_failed;
  1282. /* MU PPDU stats per hwQ */
  1283. A_UINT32 mu_mimo_ppdu_posted;
  1284. /*
  1285. * Counts the number of users in each transmission of
  1286. * the given TX mode.
  1287. *
  1288. * Index is the number of users - 1.
  1289. */
  1290. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  1291. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1292. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1293. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  1294. typedef struct {
  1295. htt_tlv_hdr_t tlv_hdr;
  1296. /* mu-mimo mpdu level stats */
  1297. /*
  1298. * This first block of stats is limited to 11ac
  1299. * MU-MIMO transmission.
  1300. */
  1301. A_UINT32 mu_mimo_mpdus_queued_usr;
  1302. A_UINT32 mu_mimo_mpdus_tried_usr;
  1303. A_UINT32 mu_mimo_mpdus_failed_usr;
  1304. A_UINT32 mu_mimo_mpdus_requeued_usr;
  1305. A_UINT32 mu_mimo_err_no_ba_usr;
  1306. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1307. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1308. A_UINT32 ax_mu_mimo_mpdus_queued_usr;
  1309. A_UINT32 ax_mu_mimo_mpdus_tried_usr;
  1310. A_UINT32 ax_mu_mimo_mpdus_failed_usr;
  1311. A_UINT32 ax_mu_mimo_mpdus_requeued_usr;
  1312. A_UINT32 ax_mu_mimo_err_no_ba_usr;
  1313. A_UINT32 ax_mu_mimo_mpdu_underrun_usr;
  1314. A_UINT32 ax_mu_mimo_ampdu_underrun_usr;
  1315. A_UINT32 ax_ofdma_mpdus_queued_usr;
  1316. A_UINT32 ax_ofdma_mpdus_tried_usr;
  1317. A_UINT32 ax_ofdma_mpdus_failed_usr;
  1318. A_UINT32 ax_ofdma_mpdus_requeued_usr;
  1319. A_UINT32 ax_ofdma_err_no_ba_usr;
  1320. A_UINT32 ax_ofdma_mpdu_underrun_usr;
  1321. A_UINT32 ax_ofdma_ampdu_underrun_usr;
  1322. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  1323. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  1324. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  1325. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  1326. typedef struct {
  1327. htt_tlv_hdr_t tlv_hdr;
  1328. /* mpdu level stats */
  1329. A_UINT32 mpdus_queued_usr;
  1330. A_UINT32 mpdus_tried_usr;
  1331. A_UINT32 mpdus_failed_usr;
  1332. A_UINT32 mpdus_requeued_usr;
  1333. A_UINT32 err_no_ba_usr;
  1334. A_UINT32 mpdu_underrun_usr;
  1335. A_UINT32 ampdu_underrun_usr;
  1336. A_UINT32 user_index;
  1337. A_UINT32 tx_sched_mode; /* HTT_STATS_TX_SCHED_MODE_xxx */
  1338. } htt_tx_pdev_mpdu_stats_tlv;
  1339. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  1340. * TLV_TAGS:
  1341. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  1342. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  1343. */
  1344. /* NOTE:
  1345. * This structure is for documentation, and cannot be safely used directly.
  1346. * Instead, use the constituent TLV structures to fill/parse.
  1347. */
  1348. typedef struct {
  1349. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1350. /*
  1351. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  1352. * it can also hold MU-OFDMA stats.
  1353. */
  1354. htt_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  1355. } htt_tx_pdev_mu_mimo_stats_t;
  1356. /* == TX SCHED STATS == */
  1357. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1358. /* NOTE: Variable length TLV, use length spec to infer array size */
  1359. typedef struct {
  1360. htt_tlv_hdr_t tlv_hdr;
  1361. /* Scheduler command posted per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1362. A_UINT32 sched_cmd_posted[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1363. } htt_sched_txq_cmd_posted_tlv_v;
  1364. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1365. /* NOTE: Variable length TLV, use length spec to infer array size */
  1366. typedef struct {
  1367. htt_tlv_hdr_t tlv_hdr;
  1368. /* Scheduler command reaped per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1369. A_UINT32 sched_cmd_reaped[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1370. } htt_sched_txq_cmd_reaped_tlv_v;
  1371. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  1372. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  1373. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  1374. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  1375. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  1376. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  1377. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  1378. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  1381. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  1382. } while (0)
  1383. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  1384. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  1385. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  1386. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  1387. do { \
  1388. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  1389. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  1390. } while (0)
  1391. typedef struct {
  1392. htt_tlv_hdr_t tlv_hdr;
  1393. /* BIT [ 7 : 0] :- mac_id
  1394. * BIT [15 : 8] :- txq_id
  1395. * BIT [31 : 16] :- reserved
  1396. */
  1397. A_UINT32 mac_id__txq_id__word;
  1398. /* Scheduler policy ised for this TxQ */
  1399. A_UINT32 sched_policy;
  1400. /* Timestamp of last scheduler command posted */
  1401. A_UINT32 last_sched_cmd_posted_timestamp;
  1402. /* Timestamp of last scheduler command completed */
  1403. A_UINT32 last_sched_cmd_compl_timestamp;
  1404. /* Num of Sched2TAC ring hit Low Water Mark condition */
  1405. A_UINT32 sched_2_tac_lwm_count;
  1406. /* Num of Sched2TAC ring full condition */
  1407. A_UINT32 sched_2_tac_ring_full;
  1408. /* Num of scheduler command post failures that includes su/mu mimo/mu ofdma sequence type */
  1409. A_UINT32 sched_cmd_post_failure;
  1410. /* Num of active tids for this TxQ at current instance */
  1411. A_UINT32 num_active_tids;
  1412. /* Num of powersave schedules */
  1413. A_UINT32 num_ps_schedules;
  1414. /* Num of scheduler commands pending for this TxQ */
  1415. A_UINT32 sched_cmds_pending;
  1416. /* Num of tidq registration for this TxQ */
  1417. A_UINT32 num_tid_register;
  1418. /* Num of tidq de-registration for this TxQ */
  1419. A_UINT32 num_tid_unregister;
  1420. /* Num of iterations msduq stats was updated */
  1421. A_UINT32 num_qstats_queried;
  1422. /* qstats query update status */
  1423. A_UINT32 qstats_update_pending;
  1424. /* Timestamp of Last query stats made */
  1425. A_UINT32 last_qstats_query_timestamp;
  1426. /* Num of sched2tqm command queue full condition */
  1427. A_UINT32 num_tqm_cmdq_full;
  1428. /* Num of scheduler trigger from DE Module */
  1429. A_UINT32 num_de_sched_algo_trigger;
  1430. /* Num of scheduler trigger from RT Module */
  1431. A_UINT32 num_rt_sched_algo_trigger;
  1432. /* Num of scheduler trigger from TQM Module */
  1433. A_UINT32 num_tqm_sched_algo_trigger;
  1434. /* Num of schedules for notify frame */
  1435. A_UINT32 notify_sched;
  1436. } htt_tx_pdev_stats_sched_per_txq_tlv;
  1437. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  1438. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  1439. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  1440. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  1441. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  1442. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  1443. do { \
  1444. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  1445. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  1446. } while (0)
  1447. typedef struct {
  1448. htt_tlv_hdr_t tlv_hdr;
  1449. /* BIT [ 7 : 0] :- mac_id
  1450. * BIT [31 : 8] :- reserved
  1451. */
  1452. A_UINT32 mac_id__word;
  1453. /* Current timestamp */
  1454. A_UINT32 current_timestamp;
  1455. } htt_stats_tx_sched_cmn_tlv;
  1456. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  1457. * TLV_TAGS:
  1458. * - HTT_STATS_TX_SCHED_CMN_TAG
  1459. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  1460. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  1461. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  1462. */
  1463. /* NOTE:
  1464. * This structure is for documentation, and cannot be safely used directly.
  1465. * Instead, use the constituent TLV structures to fill/parse.
  1466. */
  1467. typedef struct {
  1468. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  1469. struct _txq_tx_sched_stats {
  1470. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  1471. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  1472. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  1473. } txq[1];
  1474. } htt_stats_tx_sched_t;
  1475. /* == TQM STATS == */
  1476. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
  1477. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  1478. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  1479. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1480. /* NOTE: Variable length TLV, use length spec to infer array size */
  1481. typedef struct {
  1482. htt_tlv_hdr_t tlv_hdr;
  1483. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  1484. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  1485. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1486. /* NOTE: Variable length TLV, use length spec to infer array size */
  1487. typedef struct {
  1488. htt_tlv_hdr_t tlv_hdr;
  1489. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  1490. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  1491. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1492. /* NOTE: Variable length TLV, use length spec to infer array size */
  1493. typedef struct {
  1494. htt_tlv_hdr_t tlv_hdr;
  1495. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  1496. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  1497. typedef struct {
  1498. htt_tlv_hdr_t tlv_hdr;
  1499. A_UINT32 msdu_count;
  1500. A_UINT32 mpdu_count;
  1501. A_UINT32 remove_msdu;
  1502. A_UINT32 remove_mpdu;
  1503. A_UINT32 remove_msdu_ttl;
  1504. A_UINT32 send_bar;
  1505. A_UINT32 bar_sync;
  1506. A_UINT32 notify_mpdu;
  1507. A_UINT32 sync_cmd;
  1508. A_UINT32 write_cmd;
  1509. A_UINT32 hwsch_trigger;
  1510. A_UINT32 ack_tlv_proc;
  1511. A_UINT32 gen_mpdu_cmd;
  1512. A_UINT32 gen_list_cmd;
  1513. A_UINT32 remove_mpdu_cmd;
  1514. A_UINT32 remove_mpdu_tried_cmd;
  1515. A_UINT32 mpdu_queue_stats_cmd;
  1516. A_UINT32 mpdu_head_info_cmd;
  1517. A_UINT32 msdu_flow_stats_cmd;
  1518. A_UINT32 remove_msdu_cmd;
  1519. A_UINT32 remove_msdu_ttl_cmd;
  1520. A_UINT32 flush_cache_cmd;
  1521. A_UINT32 update_mpduq_cmd;
  1522. A_UINT32 enqueue;
  1523. A_UINT32 enqueue_notify;
  1524. A_UINT32 notify_mpdu_at_head;
  1525. A_UINT32 notify_mpdu_state_valid;
  1526. } htt_tx_tqm_pdev_stats_tlv_v;
  1527. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  1528. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  1529. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  1530. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  1531. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  1532. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  1533. do { \
  1534. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  1535. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  1536. } while (0)
  1537. typedef struct {
  1538. htt_tlv_hdr_t tlv_hdr;
  1539. /* BIT [ 7 : 0] :- mac_id
  1540. * BIT [31 : 8] :- reserved
  1541. */
  1542. A_UINT32 mac_id__word;
  1543. A_UINT32 max_cmdq_id;
  1544. A_UINT32 list_mpdu_cnt_hist_intvl;
  1545. /* Global stats */
  1546. A_UINT32 add_msdu;
  1547. A_UINT32 q_empty;
  1548. A_UINT32 q_not_empty;
  1549. A_UINT32 drop_notification;
  1550. A_UINT32 desc_threshold;
  1551. } htt_tx_tqm_cmn_stats_tlv;
  1552. typedef struct {
  1553. htt_tlv_hdr_t tlv_hdr;
  1554. /* Error stats */
  1555. A_UINT32 q_empty_failure;
  1556. A_UINT32 q_not_empty_failure;
  1557. A_UINT32 add_msdu_failure;
  1558. } htt_tx_tqm_error_stats_tlv;
  1559. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  1560. * TLV_TAGS:
  1561. * - HTT_STATS_TX_TQM_CMN_TAG
  1562. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  1563. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  1564. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  1565. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  1566. * - HTT_STATS_TX_TQM_PDEV_TAG
  1567. */
  1568. /* NOTE:
  1569. * This structure is for documentation, and cannot be safely used directly.
  1570. * Instead, use the constituent TLV structures to fill/parse.
  1571. */
  1572. typedef struct {
  1573. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  1574. htt_tx_tqm_error_stats_tlv err_tlv;
  1575. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  1576. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  1577. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  1578. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  1579. } htt_tx_tqm_pdev_stats_t;
  1580. /* == TQM CMDQ stats == */
  1581. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  1582. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  1583. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  1584. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  1585. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  1586. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  1587. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  1588. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  1592. } while (0)
  1593. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  1594. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  1595. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  1596. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  1599. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  1600. } while (0)
  1601. typedef struct {
  1602. htt_tlv_hdr_t tlv_hdr;
  1603. /* BIT [ 7 : 0] :- mac_id
  1604. * BIT [15 : 8] :- cmdq_id
  1605. * BIT [31 : 16] :- reserved
  1606. */
  1607. A_UINT32 mac_id__cmdq_id__word;
  1608. A_UINT32 sync_cmd;
  1609. A_UINT32 write_cmd;
  1610. A_UINT32 gen_mpdu_cmd;
  1611. A_UINT32 mpdu_queue_stats_cmd;
  1612. A_UINT32 mpdu_head_info_cmd;
  1613. A_UINT32 msdu_flow_stats_cmd;
  1614. A_UINT32 remove_mpdu_cmd;
  1615. A_UINT32 remove_msdu_cmd;
  1616. A_UINT32 flush_cache_cmd;
  1617. A_UINT32 update_mpduq_cmd;
  1618. A_UINT32 update_msduq_cmd;
  1619. } htt_tx_tqm_cmdq_status_tlv;
  1620. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  1621. * TLV_TAGS:
  1622. * - HTT_STATS_STRING_TAG
  1623. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  1624. */
  1625. /* NOTE:
  1626. * This structure is for documentation, and cannot be safely used directly.
  1627. * Instead, use the constituent TLV structures to fill/parse.
  1628. */
  1629. typedef struct {
  1630. struct _cmdq_stats {
  1631. htt_stats_string_tlv cmdq_str_tlv;
  1632. htt_tx_tqm_cmdq_status_tlv status_tlv;
  1633. } q[1];
  1634. } htt_tx_tqm_cmdq_stats_t;
  1635. /* == TX-DE STATS == */
  1636. /* Structures for tx de stats */
  1637. typedef struct {
  1638. htt_tlv_hdr_t tlv_hdr;
  1639. A_UINT32 m1_packets;
  1640. A_UINT32 m2_packets;
  1641. A_UINT32 m3_packets;
  1642. A_UINT32 m4_packets;
  1643. A_UINT32 g1_packets;
  1644. A_UINT32 g2_packets;
  1645. } htt_tx_de_eapol_packets_stats_tlv;
  1646. typedef struct {
  1647. htt_tlv_hdr_t tlv_hdr;
  1648. A_UINT32 ap_bss_peer_not_found;
  1649. A_UINT32 ap_bcast_mcast_no_peer;
  1650. A_UINT32 sta_delete_in_progress;
  1651. A_UINT32 ibss_no_bss_peer;
  1652. A_UINT32 invaild_vdev_type;
  1653. A_UINT32 invalid_ast_peer_entry;
  1654. A_UINT32 peer_entry_invalid;
  1655. A_UINT32 ethertype_not_ip;
  1656. A_UINT32 eapol_lookup_failed;
  1657. A_UINT32 qpeer_not_allow_data;
  1658. A_UINT32 fse_tid_override;
  1659. } htt_tx_de_classify_failed_stats_tlv;
  1660. typedef struct {
  1661. htt_tlv_hdr_t tlv_hdr;
  1662. A_UINT32 arp_packets;
  1663. A_UINT32 igmp_packets;
  1664. A_UINT32 dhcp_packets;
  1665. A_UINT32 host_inspected;
  1666. A_UINT32 htt_included;
  1667. A_UINT32 htt_valid_mcs;
  1668. A_UINT32 htt_valid_nss;
  1669. A_UINT32 htt_valid_preamble_type;
  1670. A_UINT32 htt_valid_chainmask;
  1671. A_UINT32 htt_valid_guard_interval;
  1672. A_UINT32 htt_valid_retries;
  1673. A_UINT32 htt_valid_bw_info;
  1674. A_UINT32 htt_valid_power;
  1675. A_UINT32 htt_valid_key_flags;
  1676. A_UINT32 htt_valid_no_encryption;
  1677. A_UINT32 fse_entry_count;
  1678. A_UINT32 fse_priority_be;
  1679. A_UINT32 fse_priority_high;
  1680. A_UINT32 fse_priority_low;
  1681. A_UINT32 fse_traffic_ptrn_be;
  1682. A_UINT32 fse_traffic_ptrn_over_sub;
  1683. A_UINT32 fse_traffic_ptrn_bursty;
  1684. A_UINT32 fse_traffic_ptrn_interactive;
  1685. A_UINT32 fse_traffic_ptrn_periodic;
  1686. A_UINT32 fse_hwqueue_alloc;
  1687. A_UINT32 fse_hwqueue_created;
  1688. A_UINT32 fse_hwqueue_send_to_host;
  1689. A_UINT32 mcast_entry;
  1690. A_UINT32 bcast_entry;
  1691. } htt_tx_de_classify_stats_tlv;
  1692. typedef struct {
  1693. htt_tlv_hdr_t tlv_hdr;
  1694. A_UINT32 eok;
  1695. A_UINT32 classify_done;
  1696. A_UINT32 lookup_failed;
  1697. A_UINT32 send_host_dhcp;
  1698. A_UINT32 send_host_mcast;
  1699. A_UINT32 send_host_unknown_dest;
  1700. A_UINT32 send_host;
  1701. A_UINT32 status_invalid;
  1702. } htt_tx_de_classify_status_stats_tlv;
  1703. typedef struct {
  1704. htt_tlv_hdr_t tlv_hdr;
  1705. A_UINT32 enqueued_pkts;
  1706. A_UINT32 to_tqm;
  1707. A_UINT32 to_tqm_bypass;
  1708. } htt_tx_de_enqueue_packets_stats_tlv;
  1709. typedef struct {
  1710. htt_tlv_hdr_t tlv_hdr;
  1711. A_UINT32 discarded_pkts;
  1712. A_UINT32 local_frames;
  1713. A_UINT32 is_ext_msdu;
  1714. } htt_tx_de_enqueue_discard_stats_tlv;
  1715. typedef struct {
  1716. htt_tlv_hdr_t tlv_hdr;
  1717. A_UINT32 tcl_dummy_frame;
  1718. A_UINT32 tqm_dummy_frame;
  1719. A_UINT32 tqm_notify_frame;
  1720. A_UINT32 fw2wbm_enq;
  1721. A_UINT32 tqm_bypass_frame;
  1722. } htt_tx_de_compl_stats_tlv;
  1723. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  1724. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  1725. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  1726. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  1727. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  1728. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  1729. do { \
  1730. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  1731. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  1732. } while (0)
  1733. typedef struct {
  1734. htt_tlv_hdr_t tlv_hdr;
  1735. /* BIT [ 7 : 0] :- mac_id
  1736. * BIT [31 : 8] :- reserved
  1737. */
  1738. A_UINT32 mac_id__word;
  1739. /* Global Stats */
  1740. A_UINT32 tcl2fw_entry_count;
  1741. A_UINT32 not_to_fw;
  1742. A_UINT32 invalid_pdev_vdev_peer;
  1743. A_UINT32 tcl_res_invalid_addrx;
  1744. A_UINT32 wbm2fw_entry_count;
  1745. A_UINT32 invalid_pdev;
  1746. } htt_tx_de_cmn_stats_tlv;
  1747. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  1748. * TLV_TAGS:
  1749. * - HTT_STATS_TX_DE_CMN_TAG
  1750. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  1751. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  1752. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  1753. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  1754. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  1755. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  1756. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  1757. */
  1758. /* NOTE:
  1759. * This structure is for documentation, and cannot be safely used directly.
  1760. * Instead, use the constituent TLV structures to fill/parse.
  1761. */
  1762. typedef struct {
  1763. htt_tx_de_cmn_stats_tlv cmn_tlv;
  1764. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  1765. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  1766. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  1767. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  1768. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  1769. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  1770. htt_tx_de_compl_stats_tlv comp_status_tlv;
  1771. } htt_tx_de_stats_t;
  1772. /* == RING-IF STATS == */
  1773. /* DWORD num_elems__prefetch_tail_idx */
  1774. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  1775. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  1776. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  1777. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  1778. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  1779. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  1780. HTT_RING_IF_STATS_NUM_ELEMS_S)
  1781. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  1782. do { \
  1783. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  1784. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  1785. } while (0)
  1786. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  1787. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  1788. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  1789. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  1790. do { \
  1791. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  1792. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  1793. } while (0)
  1794. /* DWORD head_idx__tail_idx */
  1795. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  1796. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  1797. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  1798. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  1799. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  1800. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  1801. HTT_RING_IF_STATS_HEAD_IDX_S)
  1802. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  1803. do { \
  1804. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  1805. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  1806. } while (0)
  1807. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  1808. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  1809. HTT_RING_IF_STATS_TAIL_IDX_S)
  1810. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  1811. do { \
  1812. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  1813. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  1814. } while (0)
  1815. /* DWORD shadow_head_idx__shadow_tail_idx */
  1816. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  1817. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  1818. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  1819. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  1820. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  1821. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  1822. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  1823. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  1824. do { \
  1825. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  1826. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  1827. } while (0)
  1828. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  1829. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  1830. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  1831. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  1832. do { \
  1833. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  1834. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  1835. } while (0)
  1836. /* DWORD lwm_thresh__hwm_thresh */
  1837. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  1838. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  1839. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  1840. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  1841. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  1842. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  1843. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  1844. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  1847. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  1848. } while (0)
  1849. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  1850. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  1851. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  1852. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  1855. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  1856. } while (0)
  1857. #define HTT_STATS_LOW_WM_BINS 5
  1858. #define HTT_STATS_HIGH_WM_BINS 5
  1859. typedef struct {
  1860. A_UINT32 base_addr; /* DWORD aligned base memory address of the ring */
  1861. A_UINT32 elem_size; /* size of each ring element */
  1862. /* BIT [15 : 0] :- num_elems
  1863. * BIT [31 : 16] :- prefetch_tail_idx
  1864. */
  1865. A_UINT32 num_elems__prefetch_tail_idx;
  1866. /* BIT [15 : 0] :- head_idx
  1867. * BIT [31 : 16] :- tail_idx
  1868. */
  1869. A_UINT32 head_idx__tail_idx;
  1870. /* BIT [15 : 0] :- shadow_head_idx
  1871. * BIT [31 : 16] :- shadow_tail_idx
  1872. */
  1873. A_UINT32 shadow_head_idx__shadow_tail_idx;
  1874. A_UINT32 num_tail_incr;
  1875. /* BIT [15 : 0] :- lwm_thresh
  1876. * BIT [31 : 16] :- hwm_thresh
  1877. */
  1878. A_UINT32 lwm_thresh__hwm_thresh;
  1879. A_UINT32 overrun_hit_count;
  1880. A_UINT32 underrun_hit_count;
  1881. A_UINT32 prod_blockwait_count;
  1882. A_UINT32 cons_blockwait_count;
  1883. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS]; /* FIX THIS: explain what each array element is for */
  1884. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS]; /* FIX THIS: explain what each array element is for */
  1885. } htt_ring_if_stats_tlv;
  1886. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  1887. #define HTT_RING_IF_CMN_MAC_ID_S 0
  1888. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  1889. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  1890. HTT_RING_IF_CMN_MAC_ID_S)
  1891. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  1894. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  1895. } while (0)
  1896. typedef struct {
  1897. htt_tlv_hdr_t tlv_hdr;
  1898. /* BIT [ 7 : 0] :- mac_id
  1899. * BIT [31 : 8] :- reserved
  1900. */
  1901. A_UINT32 mac_id__word;
  1902. A_UINT32 num_records;
  1903. } htt_ring_if_cmn_tlv;
  1904. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  1905. * TLV_TAGS:
  1906. * - HTT_STATS_RING_IF_CMN_TAG
  1907. * - HTT_STATS_STRING_TAG
  1908. * - HTT_STATS_RING_IF_TAG
  1909. */
  1910. /* NOTE:
  1911. * This structure is for documentation, and cannot be safely used directly.
  1912. * Instead, use the constituent TLV structures to fill/parse.
  1913. */
  1914. typedef struct {
  1915. htt_ring_if_cmn_tlv cmn_tlv;
  1916. /* Variable based on the Number of records. */
  1917. struct _ring_if {
  1918. htt_stats_string_tlv ring_str_tlv;
  1919. htt_ring_if_stats_tlv ring_tlv;
  1920. } r[1];
  1921. } htt_ring_if_stats_t;
  1922. /* == SFM STATS == */
  1923. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1924. /* NOTE: Variable length TLV, use length spec to infer array size */
  1925. typedef struct {
  1926. htt_tlv_hdr_t tlv_hdr;
  1927. /* Number of DWORDS used per user and per client */
  1928. A_UINT32 dwords_used_by_user_n[1];
  1929. } htt_sfm_client_user_tlv_v;
  1930. typedef struct {
  1931. htt_tlv_hdr_t tlv_hdr;
  1932. /* Client ID */
  1933. A_UINT32 client_id;
  1934. /* Minimum number of buffers */
  1935. A_UINT32 buf_min;
  1936. /* Maximum number of buffers */
  1937. A_UINT32 buf_max;
  1938. /* Number of Busy buffers */
  1939. A_UINT32 buf_busy;
  1940. /* Number of Allocated buffers */
  1941. A_UINT32 buf_alloc;
  1942. /* Number of Available/Usable buffers */
  1943. A_UINT32 buf_avail;
  1944. /* Number of users */
  1945. A_UINT32 num_users;
  1946. } htt_sfm_client_tlv;
  1947. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  1948. #define HTT_SFM_CMN_MAC_ID_S 0
  1949. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  1950. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  1951. HTT_SFM_CMN_MAC_ID_S)
  1952. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  1955. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  1956. } while (0)
  1957. typedef struct {
  1958. htt_tlv_hdr_t tlv_hdr;
  1959. /* BIT [ 7 : 0] :- mac_id
  1960. * BIT [31 : 8] :- reserved
  1961. */
  1962. A_UINT32 mac_id__word;
  1963. /* Indicates the total number of 128 byte buffers in the CMEM that are available for buffer sharing */
  1964. A_UINT32 buf_total;
  1965. /* Indicates for certain client or all the clients there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY */
  1966. A_UINT32 mem_empty;
  1967. /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  1968. A_UINT32 deallocate_bufs;
  1969. /* Number of Records */
  1970. A_UINT32 num_records;
  1971. } htt_sfm_cmn_tlv;
  1972. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  1973. * TLV_TAGS:
  1974. * - HTT_STATS_SFM_CMN_TAG
  1975. * - HTT_STATS_STRING_TAG
  1976. * - HTT_STATS_SFM_CLIENT_TAG
  1977. * - HTT_STATS_SFM_CLIENT_USER_TAG
  1978. */
  1979. /* NOTE:
  1980. * This structure is for documentation, and cannot be safely used directly.
  1981. * Instead, use the constituent TLV structures to fill/parse.
  1982. */
  1983. typedef struct {
  1984. htt_sfm_cmn_tlv cmn_tlv;
  1985. /* Variable based on the Number of records. */
  1986. struct _sfm_client {
  1987. htt_stats_string_tlv client_str_tlv;
  1988. htt_sfm_client_tlv client_tlv;
  1989. htt_sfm_client_user_tlv_v user_tlv;
  1990. } r[1];
  1991. } htt_sfm_stats_t;
  1992. /* == SRNG STATS == */
  1993. /* DWORD mac_id__ring_id__arena__ep */
  1994. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  1995. #define HTT_SRING_STATS_MAC_ID_S 0
  1996. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  1997. #define HTT_SRING_STATS_RING_ID_S 8
  1998. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  1999. #define HTT_SRING_STATS_ARENA_S 16
  2000. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  2001. #define HTT_SRING_STATS_EP_TYPE_S 24
  2002. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  2003. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  2004. HTT_SRING_STATS_MAC_ID_S)
  2005. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  2008. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  2009. } while (0)
  2010. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  2011. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  2012. HTT_SRING_STATS_RING_ID_S)
  2013. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  2016. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  2017. } while (0)
  2018. #define HTT_SRING_STATS_ARENA_GET(_var) \
  2019. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  2020. HTT_SRING_STATS_ARENA_S)
  2021. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  2024. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  2025. } while (0)
  2026. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  2027. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  2028. HTT_SRING_STATS_EP_TYPE_S)
  2029. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  2032. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  2033. } while (0)
  2034. /* DWORD num_avail_words__num_valid_words */
  2035. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  2036. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  2037. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  2038. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  2039. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  2040. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  2041. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  2042. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  2045. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  2046. } while (0)
  2047. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  2048. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  2049. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  2050. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  2051. do { \
  2052. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  2053. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  2054. } while (0)
  2055. /* DWORD head_ptr__tail_ptr */
  2056. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  2057. #define HTT_SRING_STATS_HEAD_PTR_S 0
  2058. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  2059. #define HTT_SRING_STATS_TAIL_PTR_S 16
  2060. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  2061. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  2062. HTT_SRING_STATS_HEAD_PTR_S)
  2063. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  2066. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  2067. } while (0)
  2068. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  2069. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  2070. HTT_SRING_STATS_TAIL_PTR_S)
  2071. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  2074. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  2075. } while (0)
  2076. /* DWORD consumer_empty__producer_full */
  2077. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  2078. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  2079. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  2080. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  2081. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  2082. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  2083. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  2084. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  2087. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  2088. } while (0)
  2089. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  2090. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  2091. HTT_SRING_STATS_PRODUCER_FULL_S)
  2092. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  2095. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  2096. } while (0)
  2097. /* DWORD prefetch_count__internal_tail_ptr */
  2098. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  2099. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  2100. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  2101. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  2102. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  2103. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  2104. HTT_SRING_STATS_PREFETCH_COUNT_S)
  2105. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  2108. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  2109. } while (0)
  2110. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  2111. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  2112. HTT_SRING_STATS_INTERNAL_TP_S)
  2113. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  2116. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  2117. } while (0)
  2118. typedef struct {
  2119. htt_tlv_hdr_t tlv_hdr;
  2120. /* BIT [ 7 : 0] :- mac_id
  2121. * BIT [15 : 8] :- ring_id
  2122. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  2123. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  2124. * BIT [31 : 25] :- reserved
  2125. */
  2126. A_UINT32 mac_id__ring_id__arena__ep;
  2127. A_UINT32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
  2128. A_UINT32 base_addr_msb;
  2129. A_UINT32 ring_size; /* size of ring */
  2130. A_UINT32 elem_size; /* size of each ring element */
  2131. /* Ring status */
  2132. /* BIT [15 : 0] :- num_avail_words
  2133. * BIT [31 : 16] :- num_valid_words
  2134. */
  2135. A_UINT32 num_avail_words__num_valid_words;
  2136. /* Index of head and tail */
  2137. /* BIT [15 : 0] :- head_ptr
  2138. * BIT [31 : 16] :- tail_ptr
  2139. */
  2140. A_UINT32 head_ptr__tail_ptr;
  2141. /* Empty or full counter of rings */
  2142. /* BIT [15 : 0] :- consumer_empty
  2143. * BIT [31 : 16] :- producer_full
  2144. */
  2145. A_UINT32 consumer_empty__producer_full;
  2146. /* Prefetch status of consumer ring */
  2147. /* BIT [15 : 0] :- prefetch_count
  2148. * BIT [31 : 16] :- internal_tail_ptr
  2149. */
  2150. A_UINT32 prefetch_count__internal_tail_ptr;
  2151. } htt_sring_stats_tlv;
  2152. typedef struct {
  2153. htt_tlv_hdr_t tlv_hdr;
  2154. A_UINT32 num_records;
  2155. } htt_sring_cmn_tlv;
  2156. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  2157. * TLV_TAGS:
  2158. * - HTT_STATS_SRING_CMN_TAG
  2159. * - HTT_STATS_STRING_TAG
  2160. * - HTT_STATS_SRING_STATS_TAG
  2161. */
  2162. /* NOTE:
  2163. * This structure is for documentation, and cannot be safely used directly.
  2164. * Instead, use the constituent TLV structures to fill/parse.
  2165. */
  2166. typedef struct {
  2167. htt_sring_cmn_tlv cmn_tlv;
  2168. /* Variable based on the Number of records. */
  2169. struct _sring_stats {
  2170. htt_stats_string_tlv sring_str_tlv;
  2171. htt_sring_stats_tlv sring_stats_tlv;
  2172. } r[1];
  2173. } htt_sring_stats_t;
  2174. /* == PDEV TX RATE CTRL STATS == */
  2175. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2176. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  2177. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2178. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  2179. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2180. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2181. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  2182. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  2183. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  2184. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2185. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  2186. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2187. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2188. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  2189. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2190. do { \
  2191. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  2192. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  2193. } while (0)
  2194. typedef struct {
  2195. htt_tlv_hdr_t tlv_hdr;
  2196. /* BIT [ 7 : 0] :- mac_id
  2197. * BIT [31 : 8] :- reserved
  2198. */
  2199. A_UINT32 mac_id__word;
  2200. /* Number of tx ldpc packets */
  2201. A_UINT32 tx_ldpc;
  2202. /* Number of tx rts packets */
  2203. A_UINT32 rts_cnt;
  2204. /* RSSI value of last ack packet (units = dB above noise floor) */
  2205. A_UINT32 ack_rssi;
  2206. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2207. /* tx_xx_mcs: currently unused */
  2208. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2209. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2210. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2211. 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 */
  2212. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2213. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2214. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  2215. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2216. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  2217. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  2218. /* Number of CTS-acknowledged RTS packets */
  2219. A_UINT32 rts_success;
  2220. /*
  2221. * Counters for legacy 11a and 11b transmissions.
  2222. *
  2223. * The index corresponds to:
  2224. *
  2225. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  2226. *
  2227. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  2228. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  2229. */
  2230. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  2231. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  2232. A_UINT32 ac_mu_mimo_tx_ldpc;
  2233. A_UINT32 ax_mu_mimo_tx_ldpc;
  2234. A_UINT32 ofdma_tx_ldpc;
  2235. /*
  2236. * Counters for 11ax HE LTF selection during TX.
  2237. *
  2238. * The index corresponds to:
  2239. *
  2240. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  2241. */
  2242. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  2243. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2244. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2245. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2246. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2247. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2248. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2249. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2250. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2251. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2252. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2253. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2254. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2255. } htt_tx_pdev_rate_stats_tlv;
  2256. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  2257. * TLV_TAGS:
  2258. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  2259. */
  2260. /* NOTE:
  2261. * This structure is for documentation, and cannot be safely used directly.
  2262. * Instead, use the constituent TLV structures to fill/parse.
  2263. */
  2264. typedef struct {
  2265. htt_tx_pdev_rate_stats_tlv rate_tlv;
  2266. } htt_tx_pdev_rate_stats_t;
  2267. /* == PDEV RX RATE CTRL STATS == */
  2268. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2269. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  2270. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2271. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  2272. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2273. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2274. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2275. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  2276. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2277. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2278. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  2279. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2280. do { \
  2281. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  2282. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  2283. } while (0)
  2284. typedef struct {
  2285. htt_tlv_hdr_t tlv_hdr;
  2286. /* BIT [ 7 : 0] :- mac_id
  2287. * BIT [31 : 8] :- reserved
  2288. */
  2289. A_UINT32 mac_id__word;
  2290. A_UINT32 nsts;
  2291. /* Number of rx ldpc packets */
  2292. A_UINT32 rx_ldpc;
  2293. /* Number of rx rts packets */
  2294. A_UINT32 rts_cnt;
  2295. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  2296. A_UINT32 rssi_data; /* units = dB above noise floor */
  2297. A_UINT32 rssi_comb; /* units = dB above noise floor */
  2298. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2299. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2300. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  2301. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2302. 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 */
  2303. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2304. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  2305. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  2306. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2307. A_INT32 rssi_in_dbm; /* rx Signal Strength value in dBm unit */
  2308. } htt_rx_pdev_rate_stats_tlv;
  2309. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  2310. * TLV_TAGS:
  2311. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  2312. */
  2313. /* NOTE:
  2314. * This structure is for documentation, and cannot be safely used directly.
  2315. * Instead, use the constituent TLV structures to fill/parse.
  2316. */
  2317. typedef struct {
  2318. htt_rx_pdev_rate_stats_tlv rate_tlv;
  2319. } htt_rx_pdev_rate_stats_t;
  2320. /* == RX PDEV/SOC STATS == */
  2321. typedef struct {
  2322. htt_tlv_hdr_t tlv_hdr;
  2323. /* Num Packets received on REO FW ring */
  2324. A_UINT32 fw_reo_ring_data_msdu;
  2325. /* Num bc/mc packets indicated from fw to host */
  2326. A_UINT32 fw_to_host_data_msdu_bcmc;
  2327. /* Num unicast packets indicated from fw to host */
  2328. A_UINT32 fw_to_host_data_msdu_uc;
  2329. /* Num remote buf recycle from offload */
  2330. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  2331. /* Num remote free buf given to offload */
  2332. A_UINT32 ofld_remote_free_buf_indication_cnt;
  2333. /* Num unicast packets from local path indicated to host */
  2334. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  2335. /* Num unicast packets from REO indicated to host */
  2336. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  2337. /* Num Packets received from WBM SW1 ring */
  2338. A_UINT32 wbm_sw_ring_reap;
  2339. /* Num packets from WBM forwarded from fw to host via WBM */
  2340. A_UINT32 wbm_forward_to_host_cnt;
  2341. /* Num packets from WBM recycled to target refill ring */
  2342. A_UINT32 wbm_target_recycle_cnt;
  2343. /* Total Num of recycled to refill ring, including packets from WBM and REO */
  2344. A_UINT32 target_refill_ring_recycle_cnt;
  2345. } htt_rx_soc_fw_stats_tlv;
  2346. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2347. /* NOTE: Variable length TLV, use length spec to infer array size */
  2348. typedef struct {
  2349. htt_tlv_hdr_t tlv_hdr;
  2350. /* Num ring empty encountered */
  2351. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2352. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  2353. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2354. /* NOTE: Variable length TLV, use length spec to infer array size */
  2355. typedef struct {
  2356. htt_tlv_hdr_t tlv_hdr;
  2357. /* Num total buf refilled from refill ring */
  2358. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2359. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  2360. /* RXDMA error code from WBM released packets */
  2361. typedef enum {
  2362. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  2363. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  2364. HTT_RX_RXDMA_FCS_ERR = 2,
  2365. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  2366. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  2367. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  2368. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  2369. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  2370. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  2371. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  2372. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  2373. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  2374. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  2375. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  2376. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  2377. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  2378. /*
  2379. * This MAX_ERR_CODE should not be used in any host/target messages,
  2380. * so that even though it is defined within a host/target interface
  2381. * definition header file, it isn't actually part of the host/target
  2382. * interface, and thus can be modified.
  2383. */
  2384. HTT_RX_RXDMA_MAX_ERR_CODE
  2385. } htt_rx_rxdma_error_code_enum;
  2386. /* NOTE: Variable length TLV, use length spec to infer array size */
  2387. typedef struct {
  2388. htt_tlv_hdr_t tlv_hdr;
  2389. /* NOTE:
  2390. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  2391. * It is expected but not required that the target will provide a rxdma_err element
  2392. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  2393. * MAX_ERR_CODE. The host should ignore any array elements whose
  2394. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  2395. */
  2396. A_UINT32 rxdma_err[1]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
  2397. } htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  2398. /* REO error code from WBM released packets */
  2399. typedef enum {
  2400. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  2401. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  2402. HTT_RX_AMPDU_IN_NON_BA = 2,
  2403. HTT_RX_NON_BA_DUPLICATE = 3,
  2404. HTT_RX_BA_DUPLICATE = 4,
  2405. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  2406. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  2407. HTT_RX_REGULAR_FRAME_OOR = 7,
  2408. HTT_RX_BAR_FRAME_OOR = 8,
  2409. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  2410. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  2411. HTT_RX_PN_CHECK_FAILED = 11,
  2412. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  2413. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  2414. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  2415. HTT_RX_REO_ERR_CODE_RVSD = 15,
  2416. /*
  2417. * This MAX_ERR_CODE should not be used in any host/target messages,
  2418. * so that even though it is defined within a host/target interface
  2419. * definition header file, it isn't actually part of the host/target
  2420. * interface, and thus can be modified.
  2421. */
  2422. HTT_RX_REO_MAX_ERR_CODE
  2423. } htt_rx_reo_error_code_enum;
  2424. /* NOTE: Variable length TLV, use length spec to infer array size */
  2425. typedef struct {
  2426. htt_tlv_hdr_t tlv_hdr;
  2427. /* NOTE:
  2428. * The mapping of REO error types to reo_err array elements is HW dependent.
  2429. * It is expected but not required that the target will provide a rxdma_err element
  2430. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  2431. * MAX_ERR_CODE. The host should ignore any array elements whose
  2432. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  2433. */
  2434. A_UINT32 reo_err[1]; /* HTT_RX_REO_MAX_ERR_CODE */
  2435. } htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  2436. /* NOTE:
  2437. * This structure is for documentation, and cannot be safely used directly.
  2438. * Instead, use the constituent TLV structures to fill/parse.
  2439. */
  2440. typedef struct {
  2441. htt_rx_soc_fw_stats_tlv fw_tlv;
  2442. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  2443. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  2444. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v fw_refill_ring_num_rxdma_err_tlv;
  2445. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v fw_refill_ring_num_reo_err_tlv;
  2446. } htt_rx_soc_stats_t;
  2447. /* == RX PDEV STATS == */
  2448. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  2449. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  2450. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  2451. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  2452. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  2453. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  2456. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  2457. } while (0)
  2458. #define HTT_STATS_SUBTYPE_MAX 16
  2459. typedef struct {
  2460. htt_tlv_hdr_t tlv_hdr;
  2461. /* BIT [ 7 : 0] :- mac_id
  2462. * BIT [31 : 8] :- reserved
  2463. */
  2464. A_UINT32 mac_id__word;
  2465. /* Num PPDU status processed from HW */
  2466. A_UINT32 ppdu_recvd;
  2467. /* Num MPDU across PPDUs with FCS ok */
  2468. A_UINT32 mpdu_cnt_fcs_ok;
  2469. /* Num MPDU across PPDUs with FCS err */
  2470. A_UINT32 mpdu_cnt_fcs_err;
  2471. /* Num MSDU across PPDUs */
  2472. A_UINT32 tcp_msdu_cnt;
  2473. /* Num MSDU across PPDUs */
  2474. A_UINT32 tcp_ack_msdu_cnt;
  2475. /* Num MSDU across PPDUs */
  2476. A_UINT32 udp_msdu_cnt;
  2477. /* Num MSDU across PPDUs */
  2478. A_UINT32 other_msdu_cnt;
  2479. /* Num MPDU on FW ring indicated */
  2480. A_UINT32 fw_ring_mpdu_ind;
  2481. /* Num MGMT MPDU given to protocol */
  2482. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  2483. /* Num ctrl MPDU given to protocol */
  2484. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  2485. /* Num mcast data packet received */
  2486. A_UINT32 fw_ring_mcast_data_msdu;
  2487. /* Num broadcast data packet received */
  2488. A_UINT32 fw_ring_bcast_data_msdu;
  2489. /* Num unicat data packet received */
  2490. A_UINT32 fw_ring_ucast_data_msdu;
  2491. /* Num null data packet received */
  2492. A_UINT32 fw_ring_null_data_msdu;
  2493. /* Num MPDU on FW ring dropped */
  2494. A_UINT32 fw_ring_mpdu_drop;
  2495. /* Num buf indication to offload */
  2496. A_UINT32 ofld_local_data_ind_cnt;
  2497. /* Num buf recycle from offload */
  2498. A_UINT32 ofld_local_data_buf_recycle_cnt;
  2499. /* Num buf indication to data_rx */
  2500. A_UINT32 drx_local_data_ind_cnt;
  2501. /* Num buf recycle from data_rx */
  2502. A_UINT32 drx_local_data_buf_recycle_cnt;
  2503. /* Num buf indication to protocol */
  2504. A_UINT32 local_nondata_ind_cnt;
  2505. /* Num buf recycle from protocol */
  2506. A_UINT32 local_nondata_buf_recycle_cnt;
  2507. /* Num buf fed */
  2508. A_UINT32 fw_status_buf_ring_refill_cnt;
  2509. /* Num ring empty encountered */
  2510. A_UINT32 fw_status_buf_ring_empty_cnt;
  2511. /* Num buf fed */
  2512. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  2513. /* Num ring empty encountered */
  2514. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  2515. /* Num buf fed */
  2516. A_UINT32 fw_link_buf_ring_refill_cnt;
  2517. /* Num ring empty encountered */
  2518. A_UINT32 fw_link_buf_ring_empty_cnt;
  2519. /* Num buf fed */
  2520. A_UINT32 host_pkt_buf_ring_refill_cnt;
  2521. /* Num ring empty encountered */
  2522. A_UINT32 host_pkt_buf_ring_empty_cnt;
  2523. /* Num buf fed */
  2524. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  2525. /* Num ring empty encountered */
  2526. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  2527. /* Num buf fed */
  2528. A_UINT32 mon_status_buf_ring_refill_cnt;
  2529. /* Num ring empty encountered */
  2530. A_UINT32 mon_status_buf_ring_empty_cnt;
  2531. /* Num buf fed */
  2532. A_UINT32 mon_desc_buf_ring_refill_cnt;
  2533. /* Num ring empty encountered */
  2534. A_UINT32 mon_desc_buf_ring_empty_cnt;
  2535. /* Num buf fed */
  2536. A_UINT32 mon_dest_ring_update_cnt;
  2537. /* Num ring full encountered */
  2538. A_UINT32 mon_dest_ring_full_cnt;
  2539. /* Num rx suspend is attempted */
  2540. A_UINT32 rx_suspend_cnt;
  2541. /* Num rx suspend failed */
  2542. A_UINT32 rx_suspend_fail_cnt;
  2543. /* Num rx resume attempted */
  2544. A_UINT32 rx_resume_cnt;
  2545. /* Num rx resume failed */
  2546. A_UINT32 rx_resume_fail_cnt;
  2547. /* Num rx ring switch */
  2548. A_UINT32 rx_ring_switch_cnt;
  2549. /* Num rx ring restore */
  2550. A_UINT32 rx_ring_restore_cnt;
  2551. /* Num rx flush issued */
  2552. A_UINT32 rx_flush_cnt;
  2553. /* Num rx recovery */
  2554. A_UINT32 rx_recovery_reset_cnt;
  2555. } htt_rx_pdev_fw_stats_tlv;
  2556. #define HTT_STATS_PHY_ERR_MAX 43
  2557. typedef struct {
  2558. htt_tlv_hdr_t tlv_hdr;
  2559. /* BIT [ 7 : 0] :- mac_id
  2560. * BIT [31 : 8] :- reserved
  2561. */
  2562. A_UINT32 mac_id__word;
  2563. /* Num of phy err */
  2564. A_UINT32 total_phy_err_cnt;
  2565. /* Counts of different types of phy errs
  2566. * The mapping of PHY error types to phy_err array elements is HW dependent.
  2567. * The only currently-supported mapping is shown below:
  2568. *
  2569. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  2570. * 1 phyrx_err_synth_off
  2571. * 2 phyrx_err_ofdma_timing
  2572. * 3 phyrx_err_ofdma_signal_parity
  2573. * 4 phyrx_err_ofdma_rate_illegal
  2574. * 5 phyrx_err_ofdma_length_illegal
  2575. * 6 phyrx_err_ofdma_restart
  2576. * 7 phyrx_err_ofdma_service
  2577. * 8 phyrx_err_ppdu_ofdma_power_drop
  2578. * 9 phyrx_err_cck_blokker
  2579. * 10 phyrx_err_cck_timing
  2580. * 11 phyrx_err_cck_header_crc
  2581. * 12 phyrx_err_cck_rate_illegal
  2582. * 13 phyrx_err_cck_length_illegal
  2583. * 14 phyrx_err_cck_restart
  2584. * 15 phyrx_err_cck_service
  2585. * 16 phyrx_err_cck_power_drop
  2586. * 17 phyrx_err_ht_crc_err
  2587. * 18 phyrx_err_ht_length_illegal
  2588. * 19 phyrx_err_ht_rate_illegal
  2589. * 20 phyrx_err_ht_zlf
  2590. * 21 phyrx_err_false_radar_ext
  2591. * 22 phyrx_err_green_field
  2592. * 23 phyrx_err_bw_gt_dyn_bw
  2593. * 24 phyrx_err_leg_ht_mismatch
  2594. * 25 phyrx_err_vht_crc_error
  2595. * 26 phyrx_err_vht_siga_unsupported
  2596. * 27 phyrx_err_vht_lsig_len_invalid
  2597. * 28 phyrx_err_vht_ndp_or_zlf
  2598. * 29 phyrx_err_vht_nsym_lt_zero
  2599. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  2600. * 31 phyrx_err_vht_rx_skip_group_id0
  2601. * 32 phyrx_err_vht_rx_skip_group_id1to62
  2602. * 33 phyrx_err_vht_rx_skip_group_id63
  2603. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  2604. * 35 phyrx_err_defer_nap
  2605. * 36 phyrx_err_fdomain_timeout
  2606. * 37 phyrx_err_lsig_rel_check
  2607. * 38 phyrx_err_bt_collision
  2608. * 39 phyrx_err_unsupported_mu_feedback
  2609. * 40 phyrx_err_ppdu_tx_interrupt_rx
  2610. * 41 phyrx_err_unsupported_cbf
  2611. * 42 phyrx_err_other
  2612. */
  2613. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  2614. } htt_rx_pdev_fw_stats_phy_err_tlv;
  2615. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2616. /* NOTE: Variable length TLV, use length spec to infer array size */
  2617. typedef struct {
  2618. htt_tlv_hdr_t tlv_hdr;
  2619. /* Num error MPDU for each RxDMA error type */
  2620. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  2621. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  2622. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2623. /* NOTE: Variable length TLV, use length spec to infer array size */
  2624. typedef struct {
  2625. htt_tlv_hdr_t tlv_hdr;
  2626. /* Num MPDU dropped */
  2627. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  2628. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  2629. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  2630. * TLV_TAGS:
  2631. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  2632. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  2633. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  2634. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  2635. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  2636. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  2637. */
  2638. /* NOTE:
  2639. * This structure is for documentation, and cannot be safely used directly.
  2640. * Instead, use the constituent TLV structures to fill/parse.
  2641. */
  2642. typedef struct {
  2643. htt_rx_soc_stats_t soc_stats;
  2644. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  2645. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  2646. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  2647. htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  2648. } htt_rx_pdev_stats_t;
  2649. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  2650. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  2651. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  2652. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  2653. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  2654. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  2655. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  2656. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  2657. typedef struct {
  2658. htt_tlv_hdr_t tlv_hdr;
  2659. /* Below values are obtained from the HW Cycles counter registers */
  2660. A_UINT32 tx_frame_usec;
  2661. A_UINT32 rx_frame_usec;
  2662. A_UINT32 rx_clear_usec;
  2663. A_UINT32 my_rx_frame_usec;
  2664. A_UINT32 usec_cnt;
  2665. A_UINT32 med_rx_idle_usec;
  2666. A_UINT32 med_tx_idle_global_usec;
  2667. A_UINT32 cca_obss_usec;
  2668. } htt_pdev_stats_cca_counters_tlv;
  2669. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  2670. * due to lack of support in some host stats infrastructures for
  2671. * TLVs nested within TLVs.
  2672. */
  2673. typedef struct {
  2674. htt_tlv_hdr_t tlv_hdr;
  2675. /* The channel number on which these stats were collected */
  2676. A_UINT32 chan_num;
  2677. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  2678. A_UINT32 num_records;
  2679. /*
  2680. * Bit map of valid CCA counters
  2681. * Bit0 - tx_frame_usec
  2682. * Bit1 - rx_frame_usec
  2683. * Bit2 - rx_clear_usec
  2684. * Bit3 - my_rx_frame_usec
  2685. * bit4 - usec_cnt
  2686. * Bit5 - med_rx_idle_usec
  2687. * Bit6 - med_tx_idle_global_usec
  2688. * Bit7 - cca_obss_usec
  2689. *
  2690. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  2691. */
  2692. A_UINT32 valid_cca_counters_bitmap;
  2693. /* Indicates the stats collection interval
  2694. * Valid Values:
  2695. * 100 - For the 100ms interval CCA stats histogram
  2696. * 1000 - For 1sec interval CCA histogram
  2697. * 0xFFFFFFFF - For Cumulative CCA Stats
  2698. */
  2699. A_UINT32 collection_interval;
  2700. /**
  2701. * This will be followed by an array which contains the CCA stats
  2702. * collected in the last N intervals,
  2703. * if the indication is for last N intervals CCA stats.
  2704. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  2705. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  2706. */
  2707. htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  2708. } htt_pdev_cca_stats_hist_tlv;
  2709. typedef struct {
  2710. htt_tlv_hdr_t tlv_hdr;
  2711. /* The channel number on which these stats were collected */
  2712. A_UINT32 chan_num;
  2713. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  2714. A_UINT32 num_records;
  2715. /*
  2716. * Bit map of valid CCA counters
  2717. * Bit0 - tx_frame_usec
  2718. * Bit1 - rx_frame_usec
  2719. * Bit2 - rx_clear_usec
  2720. * Bit3 - my_rx_frame_usec
  2721. * bit4 - usec_cnt
  2722. * Bit5 - med_rx_idle_usec
  2723. * Bit6 - med_tx_idle_global_usec
  2724. * Bit7 - cca_obss_usec
  2725. *
  2726. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  2727. */
  2728. A_UINT32 valid_cca_counters_bitmap;
  2729. /* Indicates the stats collection interval
  2730. * Valid Values:
  2731. * 100 - For the 100ms interval CCA stats histogram
  2732. * 1000 - For 1sec interval CCA histogram
  2733. * 0xFFFFFFFF - For Cumulative CCA Stats
  2734. */
  2735. A_UINT32 collection_interval;
  2736. /**
  2737. * This will be followed by an array which contains the CCA stats
  2738. * collected in the last N intervals,
  2739. * if the indication is for last N intervals CCA stats.
  2740. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  2741. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  2742. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  2743. */
  2744. } htt_pdev_cca_stats_hist_v1_tlv;
  2745. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000ffff
  2746. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  2747. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  2748. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  2749. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  2750. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  2751. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  2752. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  2753. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  2754. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  2755. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  2756. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  2757. do { \
  2758. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  2759. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  2760. } while (0)
  2761. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  2762. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  2763. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  2764. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  2767. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  2768. } while (0)
  2769. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  2770. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  2771. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  2772. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  2775. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  2776. } while (0)
  2777. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  2778. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  2779. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  2780. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  2783. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  2784. } while (0)
  2785. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  2786. typedef struct {
  2787. htt_tlv_hdr_t tlv_hdr;
  2788. A_UINT32 vdev_id;
  2789. htt_mac_addr peer_mac;
  2790. A_UINT32 flow_id_flags;
  2791. A_UINT32 dialog_id; /* TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is not initiated by host */
  2792. A_UINT32 wake_dura_us;
  2793. A_UINT32 wake_intvl_us;
  2794. A_UINT32 sp_offset_us;
  2795. } htt_pdev_stats_twt_session_tlv;
  2796. typedef struct {
  2797. htt_tlv_hdr_t tlv_hdr;
  2798. A_UINT32 pdev_id;
  2799. A_UINT32 num_sessions;
  2800. htt_pdev_stats_twt_session_tlv twt_session[1];
  2801. } htt_pdev_stats_twt_sessions_tlv;
  2802. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  2803. * TLV_TAGS:
  2804. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  2805. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  2806. */
  2807. /* NOTE:
  2808. * This structure is for documentation, and cannot be safely used directly.
  2809. * Instead, use the constituent TLV structures to fill/parse.
  2810. */
  2811. typedef struct {
  2812. htt_pdev_stats_twt_sessions_tlv twt_sessions[1];
  2813. } htt_pdev_twt_sessions_stats_t;
  2814. typedef enum {
  2815. /* Global link descriptor queued in REO */
  2816. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  2817. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  2818. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  2819. /*Number of queue descriptors of this aging group */
  2820. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  2821. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  2822. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  2823. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  2824. /* Total number of MSDUs buffered in AC */
  2825. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  2826. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  2827. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  2828. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  2829. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  2830. } htt_rx_reo_resource_sample_id_enum;
  2831. typedef struct {
  2832. htt_tlv_hdr_t tlv_hdr;
  2833. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  2834. /* htt_rx_reo_debug_sample_id_enum */
  2835. A_UINT32 sample_id;
  2836. /* Max value of all samples */
  2837. A_UINT32 total_max;
  2838. /* Average value of total samples */
  2839. A_UINT32 total_avg;
  2840. /* Num of samples including both zeros and non zeros ones*/
  2841. A_UINT32 total_sample;
  2842. /* Average value of all non zeros samples */
  2843. A_UINT32 non_zeros_avg;
  2844. /* Num of non zeros samples */
  2845. A_UINT32 non_zeros_sample;
  2846. /* Max value of last N non zero samples (N = last_non_zeros_sample) */
  2847. A_UINT32 last_non_zeros_max;
  2848. /* Min value of last N non zero samples (N = last_non_zeros_sample) */
  2849. A_UINT32 last_non_zeros_min;
  2850. /* Average value of last N non zero samples (N = last_non_zeros_sample) */
  2851. A_UINT32 last_non_zeros_avg;
  2852. /* Num of last non zero samples */
  2853. A_UINT32 last_non_zeros_sample;
  2854. } htt_rx_reo_resource_stats_tlv_v;
  2855. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  2856. * TLV_TAGS:
  2857. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  2858. */
  2859. /* NOTE:
  2860. * This structure is for documentation, and cannot be safely used directly.
  2861. * Instead, use the constituent TLV structures to fill/parse.
  2862. */
  2863. typedef struct {
  2864. htt_rx_reo_resource_stats_tlv_v reo_resource_stats;
  2865. } htt_soc_reo_resource_stats_t;
  2866. #endif /* __HTT_STATS_H__ */