htt_stats.h 157 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294
  1. /*
  2. * Copyright (c) 2017-2019 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. * [Bit 16] If this bit is set, reset per peer stats
  135. * of corresponding tlv indicated by config
  136. * param 1.
  137. * HTT_DBG_EXT_PEER_STATS_RESET_GET will be
  138. * used to get this bit position.
  139. * WMI_SERVICE_PER_PEER_HTT_STATS_RESET
  140. * indicates that FW supports per peer HTT
  141. * stats reset.
  142. * [Bit31 : Bit17] reserved
  143. * RESP MSG:
  144. * - htt_peer_stats_t
  145. */
  146. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  147. /* HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  148. * PARAMS:
  149. * - No Params
  150. * RESP MSG:
  151. * - htt_tx_pdev_selfgen_stats_t
  152. */
  153. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  154. /* HTT_DBG_EXT_STATS_TX_MU_HWQ
  155. * PARAMS:
  156. * - config_param0: [Bit31: Bit0] HWQ mask
  157. * RESP MSG:
  158. * - htt_tx_hwq_mu_mimo_stats_t
  159. */
  160. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  161. /* HTT_DBG_EXT_STATS_RING_IF_INFO
  162. * PARAMS:
  163. * - config_param0:
  164. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  165. * [Bit31: Bit16] reserved
  166. * RESP MSG:
  167. * - htt_ring_if_stats_t
  168. */
  169. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  170. /* HTT_DBG_EXT_STATS_SRNG_INFO
  171. * PARAMS:
  172. * - config_param0:
  173. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  174. * [Bit31: Bit16] reserved
  175. * - No Params
  176. * RESP MSG:
  177. * - htt_sring_stats_t
  178. */
  179. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  180. /* HTT_DBG_EXT_STATS_SFM_INFO
  181. * PARAMS:
  182. * - No Params
  183. * RESP MSG:
  184. * - htt_sfm_stats_t
  185. */
  186. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  187. /* HTT_DBG_EXT_STATS_PDEV_TX_MU
  188. * PARAMS:
  189. * - No Params
  190. * RESP MSG:
  191. * - htt_tx_pdev_mu_mimo_stats_t
  192. */
  193. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  194. /* HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  195. * PARAMS:
  196. * - config_param0:
  197. * [Bit7 : Bit0] vdev_id:8
  198. * note:0xFF to get all active peers based on pdev_mask.
  199. * [Bit31 : Bit8] rsvd:24
  200. * RESP MSG:
  201. * - htt_active_peer_details_list_t
  202. */
  203. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  204. /* HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  205. * PARAMS:
  206. * - config_param0:
  207. * [Bit0] - Clear bit0 to read 1sec,100ms & cumulative CCA stats.
  208. * Set bit0 to 1 to read 1sec interval histogram.
  209. * [Bit1] - 100ms interval histogram
  210. * [Bit3] - Cumulative CCA stats
  211. * RESP MSG:
  212. * - htt_pdev_cca_stats_t
  213. */
  214. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  215. /* HTT_DBG_EXT_STATS_TWT_SESSIONS
  216. * PARAMS:
  217. * - config_param0:
  218. * No params
  219. * RESP MSG:
  220. * - htt_pdev_twt_sessions_stats_t
  221. */
  222. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  223. /* HTT_DBG_EXT_STATS_REO_CNTS
  224. * PARAMS:
  225. * - config_param0:
  226. * No params
  227. * RESP MSG:
  228. * - htt_soc_reo_resource_stats_t
  229. */
  230. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  231. /* HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  232. * PARAMS:
  233. * - config_param0:
  234. * [Bit0] vdev_id_set:1
  235. * set to 1 if vdev_id is set and vdev stats are requested.
  236. * set to 0 if pdev_stats sounding stats are requested.
  237. * [Bit8 : Bit1] vdev_id:8
  238. * note:0xFF to get all active vdevs based on pdev_mask.
  239. * [Bit31 : Bit9] rsvd:22
  240. *
  241. * RESP MSG:
  242. * - htt_tx_sounding_stats_t
  243. */
  244. HTT_DBG_EXT_STATS_TX_SOUNDING_INFO = 22,
  245. /* HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS
  246. * PARAMS:
  247. * - config_param0:
  248. * No params
  249. * RESP MSG:
  250. * - htt_pdev_obss_pd_stats_t
  251. */
  252. HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
  253. /* HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS
  254. * PARAMS:
  255. * - config_param0:
  256. * No params
  257. * RESP MSG:
  258. * - htt_stats_ring_backpressure_stats_t
  259. */
  260. HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
  261. /* HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  262. * PARAMS:
  263. *
  264. * RESP MSG:
  265. * - htt_soc_latency_prof_t
  266. */
  267. HTT_DBG_EXT_STATS_LATENCY_PROF_STATS = 25,
  268. /* HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  269. * PARAMS:
  270. * - No Params
  271. * RESP MSG:
  272. * - htt_rx_pdev_ul_trig_stats_t
  273. */
  274. HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS = 26,
  275. /* HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27
  276. * PARAMS:
  277. * - No Params
  278. * RESP MSG:
  279. * - htt_rx_pdev_ul_mumimo_trig_stats_t
  280. */
  281. HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27,
  282. /* HTT_DBG_EXT_STATS_FSE_RX
  283. * PARAMS:
  284. * - No Params
  285. * RESP MSG:
  286. * - htt_rx_fse_stats_t
  287. */
  288. HTT_DBG_EXT_STATS_FSE_RX = 28,
  289. /* keep this last */
  290. HTT_DBG_NUM_EXT_STATS = 256,
  291. };
  292. /*
  293. * Macros to get/set the bit field in config param[3] that indicates to
  294. * clear corresponding per peer stats specified by config param 1
  295. */
  296. #define HTT_DBG_EXT_PEER_STATS_RESET_M 0x00010000
  297. #define HTT_DBG_EXT_PEER_STATS_RESET_S 16
  298. #define HTT_DBG_EXT_PEER_STATS_RESET_GET(_var) \
  299. (((_var) & HTT_DBG_EXT_PEER_STATS_RESET_M) >> \
  300. HTT_DBG_EXT_PEER_STATS_RESET_S)
  301. #define HTT_DBG_EXT_PEER_STATS_RESET_SET(_var, _val) \
  302. do { \
  303. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_STATS_RESET, _val); \
  304. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_STATS_RESET_S)); \
  305. } while (0)
  306. typedef enum {
  307. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  308. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  309. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  310. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  311. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  312. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  313. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  314. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  315. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  316. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  317. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  318. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  319. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  320. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  321. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  322. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  323. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  324. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  325. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  326. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  327. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  328. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  329. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  330. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  331. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  332. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  333. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  334. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  335. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  336. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  337. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  338. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  339. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  340. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  341. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  342. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  343. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  344. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  345. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  346. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  347. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  348. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  349. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  350. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  351. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  352. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  353. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  354. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  355. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  356. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  357. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  358. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  359. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  360. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  361. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  362. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  363. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  364. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  365. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  366. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  367. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  368. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  369. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  370. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  371. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  372. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  373. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  374. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  375. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  376. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  377. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  378. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  379. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  380. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  381. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  382. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  383. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  384. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  385. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  386. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  387. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  388. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  389. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  390. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  391. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  392. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  393. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  394. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  395. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  396. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  397. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  398. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  399. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  400. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  401. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  402. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  403. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  404. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  405. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  406. HTT_STATS_MAX_TAG,
  407. } htt_tlv_tag_t;
  408. #define HTT_STATS_TLV_TAG_M 0x00000fff
  409. #define HTT_STATS_TLV_TAG_S 0
  410. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  411. #define HTT_STATS_TLV_LENGTH_S 12
  412. #define HTT_STATS_TLV_TAG_GET(_var) \
  413. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  414. HTT_STATS_TLV_TAG_S)
  415. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  416. do { \
  417. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  418. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  419. } while (0)
  420. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  421. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  422. HTT_STATS_TLV_LENGTH_S)
  423. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  424. do { \
  425. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  426. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  427. } while (0)
  428. typedef struct {
  429. union {
  430. /* BIT [11 : 0] :- tag
  431. * BIT [23 : 12] :- length
  432. * BIT [31 : 24] :- reserved
  433. */
  434. A_UINT32 tag__length;
  435. /*
  436. * The following struct is not endian-portable.
  437. * It is suitable for use within the target, which is known to be
  438. * little-endian.
  439. * The host should use the above endian-portable macros to access
  440. * the tag and length bitfields in an endian-neutral manner.
  441. */
  442. struct {
  443. A_UINT32 tag : 12, /* BIT [11 : 0] */
  444. length : 12, /* BIT [23 : 12] */
  445. reserved : 8; /* BIT [31 : 24] */
  446. };
  447. };
  448. } htt_tlv_hdr_t;
  449. #define HTT_STATS_MAX_STRING_SZ32 4
  450. #define HTT_STATS_MACID_INVALID 0xff
  451. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  452. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  453. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  454. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  455. typedef enum {
  456. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  457. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  458. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  459. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  460. } htt_tx_pdev_underrun_enum;
  461. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 71
  462. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  463. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  464. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  465. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  466. #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  467. #define HTT_RX_STATS_REFILL_MAX_RING 4
  468. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  469. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  470. /* Bytes stored in little endian order */
  471. /* Length should be multiple of DWORD */
  472. typedef struct {
  473. htt_tlv_hdr_t tlv_hdr;
  474. A_UINT32 data[1]; /* Can be variable length */
  475. } htt_stats_string_tlv;
  476. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  477. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  478. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  479. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  480. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  481. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  482. do { \
  483. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  484. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  485. } while (0)
  486. /* == TX PDEV STATS == */
  487. typedef struct {
  488. htt_tlv_hdr_t tlv_hdr;
  489. /* BIT [ 7 : 0] :- mac_id
  490. * BIT [31 : 8] :- reserved
  491. */
  492. A_UINT32 mac_id__word;
  493. /* Num queued to HW */
  494. A_UINT32 hw_queued;
  495. /* Num PPDU reaped from HW */
  496. A_UINT32 hw_reaped;
  497. /* Num underruns */
  498. A_UINT32 underrun;
  499. /* Num HW Paused counter. */
  500. A_UINT32 hw_paused;
  501. /* Num HW flush counter. */
  502. A_UINT32 hw_flush;
  503. /* Num HW filtered counter. */
  504. A_UINT32 hw_filt;
  505. /* Num PPDUs cleaned up in TX abort */
  506. A_UINT32 tx_abort;
  507. /* Num MPDUs requed by SW */
  508. A_UINT32 mpdu_requed;
  509. /* excessive retries */
  510. A_UINT32 tx_xretry;
  511. /* Last used data hw rate code */
  512. A_UINT32 data_rc;
  513. /* frames dropped due to excessive sw retries */
  514. A_UINT32 mpdu_dropped_xretry;
  515. /* illegal rate phy errors */
  516. A_UINT32 illgl_rate_phy_err;
  517. /* wal pdev continous xretry */
  518. A_UINT32 cont_xretry;
  519. /* wal pdev tx timeout */
  520. A_UINT32 tx_timeout;
  521. /* wal pdev resets */
  522. A_UINT32 pdev_resets;
  523. /* PhY/BB underrun */
  524. A_UINT32 phy_underrun;
  525. /* MPDU is more than txop limit */
  526. A_UINT32 txop_ovf;
  527. /* Number of Sequences posted */
  528. A_UINT32 seq_posted;
  529. /* Number of Sequences failed queueing */
  530. A_UINT32 seq_failed_queueing;
  531. /* Number of Sequences completed */
  532. A_UINT32 seq_completed;
  533. /* Number of Sequences restarted */
  534. A_UINT32 seq_restarted;
  535. /* Number of MU Sequences posted */
  536. A_UINT32 mu_seq_posted;
  537. /* Number of time HW ring is paused between seq switch within ISR */
  538. A_UINT32 seq_switch_hw_paused;
  539. /* Number of times seq continuation in DSR */
  540. A_UINT32 next_seq_posted_dsr;
  541. /* Number of times seq continuation in ISR */
  542. A_UINT32 seq_posted_isr;
  543. /* Number of seq_ctrl cached. */
  544. A_UINT32 seq_ctrl_cached;
  545. /* Number of MPDUs successfully transmitted */
  546. A_UINT32 mpdu_count_tqm;
  547. /* Number of MSDUs successfully transmitted */
  548. A_UINT32 msdu_count_tqm;
  549. /* Number of MPDUs dropped */
  550. A_UINT32 mpdu_removed_tqm;
  551. /* Number of MSDUs dropped */
  552. A_UINT32 msdu_removed_tqm;
  553. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  554. A_UINT32 mpdus_sw_flush;
  555. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  556. A_UINT32 mpdus_hw_filter;
  557. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  558. A_UINT32 mpdus_truncated;
  559. /* Num MPDUs that was tried but didn't receive ACK or BA */
  560. A_UINT32 mpdus_ack_failed;
  561. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  562. A_UINT32 mpdus_expired;
  563. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  564. A_UINT32 mpdus_seq_hw_retry;
  565. /* Num of TQM acked cmds processed */
  566. A_UINT32 ack_tlv_proc;
  567. /* coex_abort_mpdu_cnt valid. */
  568. A_UINT32 coex_abort_mpdu_cnt_valid;
  569. /* coex_abort_mpdu_cnt from TX FES stats. */
  570. A_UINT32 coex_abort_mpdu_cnt;
  571. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  572. A_UINT32 num_total_ppdus_tried_ota;
  573. /* Number of data PPDUs tried over the air (OTA) */
  574. A_UINT32 num_data_ppdus_tried_ota;
  575. /* Num Local control/mgmt frames (MSDUs) queued */
  576. A_UINT32 local_ctrl_mgmt_enqued;
  577. /* local_ctrl_mgmt_freed:
  578. * Num Local control/mgmt frames (MSDUs) done
  579. * It includes all local ctrl/mgmt completions
  580. * (acked, no ack, flush, TTL, etc)
  581. */
  582. A_UINT32 local_ctrl_mgmt_freed;
  583. /* Num Local data frames (MSDUs) queued */
  584. A_UINT32 local_data_enqued;
  585. /* local_data_freed:
  586. * Num Local data frames (MSDUs) done
  587. * It includes all local data completions
  588. * (acked, no ack, flush, TTL, etc)
  589. */
  590. A_UINT32 local_data_freed;
  591. /* Num MPDUs tried by SW */
  592. A_UINT32 mpdu_tried;
  593. /* Num of waiting seq posted in isr completion handler */
  594. A_UINT32 isr_wait_seq_posted;
  595. A_UINT32 tx_active_dur_us_low;
  596. A_UINT32 tx_active_dur_us_high;
  597. /* Number of MPDUs dropped after max retries */
  598. A_UINT32 remove_mpdus_max_retries;
  599. /* Num HTT cookies dispatched */
  600. A_UINT32 comp_delivered;
  601. /* successful ppdu transmissions */
  602. A_UINT32 ppdu_ok;
  603. /* Scheduler self triggers */
  604. A_UINT32 self_triggers;
  605. /* FES duration of last tx data PPDU in us (sch_eval_end - ppdu_start) */
  606. A_UINT32 tx_time_dur_data;
  607. /* Num of times sequence terminated due to ppdu duration < burst limit */
  608. A_UINT32 seq_qdepth_repost_stop;
  609. /* Num of times MU sequence terminated due to MSDUs reaching threshold */
  610. A_UINT32 mu_seq_min_msdu_repost_stop;
  611. /* Num of times SU sequence terminated due to MSDUs reaching threshold */
  612. A_UINT32 seq_min_msdu_repost_stop;
  613. /* Num of times sequence terminated due to no TXOP available */
  614. A_UINT32 seq_txop_repost_stop;
  615. /* Num of times the next sequence got cancelled */
  616. A_UINT32 next_seq_cancel;
  617. /* Num of times fes offset was misaligned */
  618. A_UINT32 fes_offsets_err_cnt;
  619. } htt_tx_pdev_stats_cmn_tlv;
  620. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  621. /* NOTE: Variable length TLV, use length spec to infer array size */
  622. typedef struct {
  623. htt_tlv_hdr_t tlv_hdr;
  624. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  625. } htt_tx_pdev_stats_urrn_tlv_v;
  626. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  627. /* NOTE: Variable length TLV, use length spec to infer array size */
  628. typedef struct {
  629. htt_tlv_hdr_t tlv_hdr;
  630. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  631. } htt_tx_pdev_stats_flush_tlv_v;
  632. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  633. /* NOTE: Variable length TLV, use length spec to infer array size */
  634. typedef struct {
  635. htt_tlv_hdr_t tlv_hdr;
  636. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  637. } htt_tx_pdev_stats_sifs_tlv_v;
  638. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  639. /* NOTE: Variable length TLV, use length spec to infer array size */
  640. typedef struct {
  641. htt_tlv_hdr_t tlv_hdr;
  642. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  643. } htt_tx_pdev_stats_phy_err_tlv_v;
  644. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  645. /* NOTE: Variable length TLV, use length spec to infer array size */
  646. typedef struct {
  647. htt_tlv_hdr_t tlv_hdr;
  648. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  649. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  650. typedef struct {
  651. htt_tlv_hdr_t tlv_hdr;
  652. A_UINT32 num_data_ppdus_legacy_su;
  653. A_UINT32 num_data_ppdus_ac_su;
  654. A_UINT32 num_data_ppdus_ax_su;
  655. A_UINT32 num_data_ppdus_ac_su_txbf;
  656. A_UINT32 num_data_ppdus_ax_su_txbf;
  657. } htt_tx_pdev_stats_tx_ppdu_stats_tlv_v;
  658. #define HTT_TX_PDEV_STATS_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  659. /* NOTE: Variable length TLV, use length spec to infer array size .
  660. *
  661. * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
  662. * The tries here is the count of the MPDUS within a PPDU that the
  663. * HW had attempted to transmit on air, for the HWSCH Schedule
  664. * command submitted by FW.It is not the retry attempts.
  665. * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
  666. * 10 bins in this histogram. They are defined in FW using the
  667. * following macros
  668. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  669. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  670. *
  671. */
  672. typedef struct {
  673. htt_tlv_hdr_t tlv_hdr;
  674. A_UINT32 hist_bin_size;
  675. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
  676. } htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v;
  677. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  678. * TLV_TAGS:
  679. * - HTT_STATS_TX_PDEV_CMN_TAG
  680. * - HTT_STATS_TX_PDEV_URRN_TAG
  681. * - HTT_STATS_TX_PDEV_SIFS_TAG
  682. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  683. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  684. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  685. * - HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG
  686. * - HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG
  687. */
  688. /* NOTE:
  689. * This structure is for documentation, and cannot be safely used directly.
  690. * Instead, use the constituent TLV structures to fill/parse.
  691. */
  692. typedef struct _htt_tx_pdev_stats {
  693. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  694. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  695. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  696. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  697. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  698. htt_tx_pdev_stats_sifs_hist_tlv_v sifs_hist_tlv;
  699. htt_tx_pdev_stats_tx_ppdu_stats_tlv_v tx_su_tlv;
  700. htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v tried_mpdu_cnt_hist_tlv;
  701. } htt_tx_pdev_stats_t;
  702. /* == SOC ERROR STATS == */
  703. /* =============== PDEV ERROR STATS ============== */
  704. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  705. typedef struct {
  706. htt_tlv_hdr_t tlv_hdr;
  707. /* Stored as little endian */
  708. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  709. A_UINT32 mask;
  710. A_UINT32 count;
  711. } htt_hw_stats_intr_misc_tlv;
  712. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  713. typedef struct {
  714. htt_tlv_hdr_t tlv_hdr;
  715. /* Stored as little endian */
  716. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  717. A_UINT32 count;
  718. } htt_hw_stats_wd_timeout_tlv;
  719. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  720. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  721. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  722. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  723. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  724. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  725. do { \
  726. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  727. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  728. } while (0)
  729. typedef struct {
  730. htt_tlv_hdr_t tlv_hdr;
  731. /* BIT [ 7 : 0] :- mac_id
  732. * BIT [31 : 8] :- reserved
  733. */
  734. A_UINT32 mac_id__word;
  735. A_UINT32 tx_abort;
  736. A_UINT32 tx_abort_fail_count;
  737. A_UINT32 rx_abort;
  738. A_UINT32 rx_abort_fail_count;
  739. A_UINT32 warm_reset;
  740. A_UINT32 cold_reset;
  741. A_UINT32 tx_flush;
  742. A_UINT32 tx_glb_reset;
  743. A_UINT32 tx_txq_reset;
  744. A_UINT32 rx_timeout_reset;
  745. A_UINT32 mac_cold_reset_restore_cal;
  746. A_UINT32 mac_cold_reset;
  747. A_UINT32 mac_warm_reset;
  748. A_UINT32 mac_only_reset;
  749. A_UINT32 phy_warm_reset;
  750. A_UINT32 phy_warm_reset_ucode_trig;
  751. A_UINT32 mac_warm_reset_restore_cal;
  752. A_UINT32 mac_sfm_reset;
  753. A_UINT32 phy_warm_reset_m3_ssr;
  754. A_UINT32 phy_warm_reset_reason_phy_m3;
  755. A_UINT32 phy_warm_reset_reason_tx_hw_stuck;
  756. A_UINT32 phy_warm_reset_reason_num_cca_rx_frame_stuck;
  757. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_rx_busy;
  758. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_mac_hang;
  759. A_UINT32 phy_warm_reset_reason_mac_reset_converted_phy_reset;
  760. A_UINT32 wal_rx_recovery_rst_mac_hang_count;
  761. A_UINT32 wal_rx_recovery_rst_known_sig_count;
  762. A_UINT32 wal_rx_recovery_rst_no_rx_count;
  763. A_UINT32 wal_rx_recovery_rst_no_rx_consecutive_count;
  764. A_UINT32 wal_rx_recovery_rst_rx_busy_count;
  765. A_UINT32 wal_rx_recovery_rst_phy_mac_hang_count;
  766. A_UINT32 rx_flush_cnt; /* Num rx flush issued */
  767. A_UINT32 phy_warm_reset_reason_tx_lifetime_expiry_cca_stuck;
  768. A_UINT32 phy_warm_reset_reason_tx_consecutive_flush9_war;
  769. A_UINT32 phy_warm_reset_reason_tx_hwsch_reset_war;
  770. A_UINT32 phy_warm_reset_reason_hwsch_wdog_or_cca_wdog_war;
  771. A_UINT32 fw_rx_rings_reset;
  772. } htt_hw_stats_pdev_errs_tlv;
  773. typedef struct {
  774. htt_tlv_hdr_t tlv_hdr;
  775. /* BIT [ 7 : 0] :- mac_id
  776. * BIT [31 : 8] :- reserved
  777. */
  778. A_UINT32 mac_id__word;
  779. A_UINT32 last_unpause_ppdu_id;
  780. A_UINT32 hwsch_unpause_wait_tqm_write;
  781. A_UINT32 hwsch_dummy_tlv_skipped;
  782. A_UINT32 hwsch_misaligned_offset_received;
  783. A_UINT32 hwsch_reset_count;
  784. A_UINT32 hwsch_dev_reset_war;
  785. A_UINT32 hwsch_delayed_pause;
  786. A_UINT32 hwsch_long_delayed_pause;
  787. A_UINT32 sch_rx_ppdu_no_response;
  788. A_UINT32 sch_selfgen_response;
  789. A_UINT32 sch_rx_sifs_resp_trigger;
  790. } htt_hw_stats_whal_tx_tlv;
  791. typedef struct {
  792. htt_tlv_hdr_t tlv_hdr;
  793. /* BIT [ 7 : 0] :- mac_id
  794. * BIT [31 : 8] :- reserved
  795. */
  796. union {
  797. struct {
  798. A_UINT32 mac_id: 8,
  799. reserved: 24;
  800. };
  801. A_UINT32 mac_id__word;
  802. };
  803. /*
  804. * hw_wars is a variable-length array, with each element counting
  805. * the number of occurrences of the corresponding type of HW WAR.
  806. * That is, hw_wars[0] indicates how many times HW WAR 0 occurred,
  807. * hw_wars[1] indicates how many times HW WAR 1 occurred, etc.
  808. * The target has an internal HW WAR mapping that it uses to keep
  809. * track of which HW WAR is WAR 0, which HW WAR is WAR 1, etc.
  810. */
  811. A_UINT32 hw_wars[1/*or more*/];
  812. } htt_hw_war_stats_tlv;
  813. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  814. * TLV_TAGS:
  815. * - HTT_STATS_HW_PDEV_ERRS_TAG
  816. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  817. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  818. * - HTT_STATS_WHAL_TX_TAG
  819. * - HTT_STATS_HW_WAR_TAG
  820. */
  821. /* NOTE:
  822. * This structure is for documentation, and cannot be safely used directly.
  823. * Instead, use the constituent TLV structures to fill/parse.
  824. */
  825. typedef struct _htt_pdev_err_stats {
  826. htt_hw_stats_pdev_errs_tlv pdev_errs;
  827. htt_hw_stats_intr_misc_tlv misc_stats[1];
  828. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  829. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  830. htt_hw_war_stats_tlv hw_war;
  831. } htt_hw_err_stats_t;
  832. /* ============ PEER STATS ============ */
  833. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  834. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  835. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  836. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  837. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  838. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  839. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  840. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  841. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  842. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  843. do { \
  844. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  845. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  846. } while (0)
  847. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  848. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  849. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  850. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  851. do { \
  852. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  853. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  854. } while (0)
  855. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  856. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  857. HTT_MSDU_FLOW_STATS_DROP_S)
  858. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  859. do { \
  860. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  861. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  862. } while (0)
  863. typedef struct _htt_msdu_flow_stats_tlv {
  864. htt_tlv_hdr_t tlv_hdr;
  865. A_UINT32 last_update_timestamp;
  866. A_UINT32 last_add_timestamp;
  867. A_UINT32 last_remove_timestamp;
  868. A_UINT32 total_processed_msdu_count;
  869. A_UINT32 cur_msdu_count_in_flowq;
  870. A_UINT32 sw_peer_id; /* This will help to find which peer_id is stuck state */
  871. /* BIT [15 : 0] :- tx_flow_number
  872. * BIT [19 : 16] :- tid_num
  873. * BIT [20 : 20] :- drop_rule
  874. * BIT [31 : 21] :- reserved
  875. */
  876. A_UINT32 tx_flow_no__tid_num__drop_rule;
  877. A_UINT32 last_cycle_enqueue_count;
  878. A_UINT32 last_cycle_dequeue_count;
  879. A_UINT32 last_cycle_drop_count;
  880. /* BIT [15 : 0] :- current_drop_th
  881. * BIT [31 : 16] :- reserved
  882. */
  883. A_UINT32 current_drop_th;
  884. } htt_msdu_flow_stats_tlv;
  885. #define MAX_HTT_TID_NAME 8
  886. /* DWORD sw_peer_id__tid_num */
  887. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  888. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  889. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  890. #define HTT_TX_TID_STATS_TID_NUM_S 16
  891. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  892. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  893. HTT_TX_TID_STATS_SW_PEER_ID_S)
  894. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  895. do { \
  896. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  897. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  898. } while (0)
  899. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  900. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  901. HTT_TX_TID_STATS_TID_NUM_S)
  902. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  903. do { \
  904. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  905. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  906. } while (0)
  907. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  908. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  909. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  910. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  911. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  912. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  913. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  914. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  915. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  916. do { \
  917. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  918. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  919. } while (0)
  920. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  921. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  922. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  923. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  924. do { \
  925. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  926. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  927. } while (0)
  928. /* Tidq stats */
  929. typedef struct _htt_tx_tid_stats_tlv {
  930. htt_tlv_hdr_t tlv_hdr;
  931. /* Stored as little endian */
  932. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  933. /* BIT [15 : 0] :- sw_peer_id
  934. * BIT [31 : 16] :- tid_num
  935. */
  936. A_UINT32 sw_peer_id__tid_num;
  937. /* BIT [ 7 : 0] :- num_sched_pending
  938. * BIT [15 : 8] :- num_ppdu_in_hwq
  939. * BIT [31 : 16] :- reserved
  940. */
  941. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  942. A_UINT32 tid_flags;
  943. /* per tid # of hw_queued ppdu.*/
  944. A_UINT32 hw_queued;
  945. /* number of per tid successful PPDU. */
  946. A_UINT32 hw_reaped;
  947. /* per tid Num MPDUs filtered by HW */
  948. A_UINT32 mpdus_hw_filter;
  949. A_UINT32 qdepth_bytes;
  950. A_UINT32 qdepth_num_msdu;
  951. A_UINT32 qdepth_num_mpdu;
  952. A_UINT32 last_scheduled_tsmp;
  953. A_UINT32 pause_module_id;
  954. A_UINT32 block_module_id;
  955. /* tid tx airtime in sec */
  956. A_UINT32 tid_tx_airtime;
  957. } htt_tx_tid_stats_tlv;
  958. /* Tidq stats */
  959. typedef struct _htt_tx_tid_stats_v1_tlv {
  960. htt_tlv_hdr_t tlv_hdr;
  961. /* Stored as little endian */
  962. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  963. /* BIT [15 : 0] :- sw_peer_id
  964. * BIT [31 : 16] :- tid_num
  965. */
  966. A_UINT32 sw_peer_id__tid_num;
  967. /* BIT [ 7 : 0] :- num_sched_pending
  968. * BIT [15 : 8] :- num_ppdu_in_hwq
  969. * BIT [31 : 16] :- reserved
  970. */
  971. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  972. A_UINT32 tid_flags;
  973. /* Max qdepth in bytes reached by this tid*/
  974. A_UINT32 max_qdepth_bytes;
  975. /* number of msdus qdepth reached max */
  976. A_UINT32 max_qdepth_n_msdus;
  977. /* Made reserved this field */
  978. A_UINT32 rsvd;
  979. A_UINT32 qdepth_bytes;
  980. A_UINT32 qdepth_num_msdu;
  981. A_UINT32 qdepth_num_mpdu;
  982. A_UINT32 last_scheduled_tsmp;
  983. A_UINT32 pause_module_id;
  984. A_UINT32 block_module_id;
  985. /* tid tx airtime in sec */
  986. A_UINT32 tid_tx_airtime;
  987. A_UINT32 allow_n_flags;
  988. /* BIT [15 : 0] :- sendn_frms_allowed
  989. * BIT [31 : 16] :- reserved
  990. */
  991. A_UINT32 sendn_frms_allowed;
  992. } htt_tx_tid_stats_v1_tlv;
  993. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  994. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  995. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  996. #define HTT_RX_TID_STATS_TID_NUM_S 16
  997. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  998. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  999. HTT_RX_TID_STATS_SW_PEER_ID_S)
  1000. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1001. do { \
  1002. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  1003. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  1004. } while (0)
  1005. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  1006. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  1007. HTT_RX_TID_STATS_TID_NUM_S)
  1008. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  1009. do { \
  1010. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  1011. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  1012. } while (0)
  1013. typedef struct _htt_rx_tid_stats_tlv {
  1014. htt_tlv_hdr_t tlv_hdr;
  1015. /* BIT [15 : 0] : sw_peer_id
  1016. * BIT [31 : 16] : tid_num
  1017. */
  1018. A_UINT32 sw_peer_id__tid_num;
  1019. /* Stored as little endian */
  1020. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1021. /* dup_in_reorder not collected per tid for now,
  1022. as there is no wal_peer back ptr in data rx peer. */
  1023. A_UINT32 dup_in_reorder;
  1024. A_UINT32 dup_past_outside_window;
  1025. A_UINT32 dup_past_within_window;
  1026. /* Number of per tid MSDUs with flag of decrypt_err */
  1027. A_UINT32 rxdesc_err_decrypt;
  1028. /* tid rx airtime in sec */
  1029. A_UINT32 tid_rx_airtime;
  1030. } htt_rx_tid_stats_tlv;
  1031. #define HTT_MAX_COUNTER_NAME 8
  1032. typedef struct {
  1033. htt_tlv_hdr_t tlv_hdr;
  1034. /* Stored as little endian */
  1035. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  1036. A_UINT32 count;
  1037. } htt_counter_tlv;
  1038. typedef struct {
  1039. htt_tlv_hdr_t tlv_hdr;
  1040. /* Number of rx ppdu. */
  1041. A_UINT32 ppdu_cnt;
  1042. /* Number of rx mpdu. */
  1043. A_UINT32 mpdu_cnt;
  1044. /* Number of rx msdu */
  1045. A_UINT32 msdu_cnt;
  1046. /* Pause bitmap */
  1047. A_UINT32 pause_bitmap;
  1048. /* Block bitmap */
  1049. A_UINT32 block_bitmap;
  1050. /* Current timestamp */
  1051. A_UINT32 current_timestamp;
  1052. /* Peer cumulative tx airtime in sec */
  1053. A_UINT32 peer_tx_airtime;
  1054. /* Peer cumulative rx airtime in sec */
  1055. A_UINT32 peer_rx_airtime;
  1056. /* Peer current rssi in dBm */
  1057. A_INT32 rssi;
  1058. /* Total enqueued, dequeued and dropped msdu's for peer */
  1059. A_UINT32 peer_enqueued_count_low;
  1060. A_UINT32 peer_enqueued_count_high;
  1061. A_UINT32 peer_dequeued_count_low;
  1062. A_UINT32 peer_dequeued_count_high;
  1063. A_UINT32 peer_dropped_count_low;
  1064. A_UINT32 peer_dropped_count_high;
  1065. /* Total ppdu transmitted bytes for peer: includes MAC header overhead */
  1066. A_UINT32 ppdu_transmitted_bytes_low;
  1067. A_UINT32 ppdu_transmitted_bytes_high;
  1068. A_UINT32 peer_ttl_removed_count;
  1069. /* inactive_time
  1070. * Running duration of the time since last tx/rx activity by this peer,
  1071. * units = seconds.
  1072. * If the peer is currently active, this inactive_time will be 0x0.
  1073. */
  1074. A_UINT32 inactive_time;
  1075. /* Number of MPDUs dropped after max retries */
  1076. A_UINT32 remove_mpdus_max_retries;
  1077. } htt_peer_stats_cmn_tlv;
  1078. typedef struct {
  1079. htt_tlv_hdr_t tlv_hdr;
  1080. /* This enum type of HTT_PEER_TYPE */
  1081. A_UINT32 peer_type;
  1082. A_UINT32 sw_peer_id;
  1083. /* BIT [7 : 0] :- vdev_id
  1084. * BIT [15 : 8] :- pdev_id
  1085. * BIT [31 : 16] :- ast_indx
  1086. */
  1087. A_UINT32 vdev_pdev_ast_idx;
  1088. htt_mac_addr mac_addr;
  1089. A_UINT32 peer_flags;
  1090. A_UINT32 qpeer_flags;
  1091. } htt_peer_details_tlv;
  1092. typedef enum {
  1093. HTT_STATS_PREAM_OFDM,
  1094. HTT_STATS_PREAM_CCK,
  1095. HTT_STATS_PREAM_HT,
  1096. HTT_STATS_PREAM_VHT,
  1097. HTT_STATS_PREAM_HE,
  1098. HTT_STATS_PREAM_RSVD,
  1099. HTT_STATS_PREAM_RSVD1,
  1100. HTT_STATS_PREAM_COUNT,
  1101. } HTT_STATS_PREAM_TYPE;
  1102. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12
  1103. /* HTT_TX_PEER_STATS_NUM_GI_COUNTERS:
  1104. * GI Index 0: WHAL_GI_800
  1105. * GI Index 1: WHAL_GI_400
  1106. * GI Index 2: WHAL_GI_1600
  1107. * GI Index 3: WHAL_GI_3200
  1108. */
  1109. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  1110. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  1111. /* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
  1112. * bw index 0: rssi_pri20_chain0
  1113. * bw index 1: rssi_ext20_chain0
  1114. * bw index 2: rssi_ext40_low20_chain0
  1115. * bw index 3: rssi_ext40_high20_chain0
  1116. */
  1117. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  1118. /* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
  1119. * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
  1120. * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
  1121. * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
  1122. * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
  1123. */
  1124. #define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
  1125. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1126. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1127. typedef struct _htt_tx_peer_rate_stats_tlv {
  1128. htt_tlv_hdr_t tlv_hdr;
  1129. /* Number of tx ldpc packets */
  1130. A_UINT32 tx_ldpc;
  1131. /* Number of tx rts packets */
  1132. A_UINT32 rts_cnt;
  1133. /* RSSI value of last ack packet (units = dB above noise floor) */
  1134. A_UINT32 ack_rssi;
  1135. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1136. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1137. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1138. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1139. 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 */
  1140. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1141. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1142. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  1143. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1144. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  1145. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  1146. } htt_tx_peer_rate_stats_tlv;
  1147. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12
  1148. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  1149. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  1150. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  1151. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1152. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1153. typedef struct _htt_rx_peer_rate_stats_tlv {
  1154. htt_tlv_hdr_t tlv_hdr;
  1155. A_UINT32 nsts;
  1156. /* Number of rx ldpc packets */
  1157. A_UINT32 rx_ldpc;
  1158. /* Number of rx rts packets */
  1159. A_UINT32 rts_cnt;
  1160. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  1161. A_UINT32 rssi_data; /* units = dB above noise floor */
  1162. A_UINT32 rssi_comb; /* units = dB above noise floor */
  1163. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1164. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1165. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  1166. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1167. 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 */
  1168. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1169. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  1170. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  1171. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1172. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  1173. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  1174. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  1175. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  1176. A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* dBm unit */
  1177. /* per_chain_rssi_pkt_type:
  1178. * This field shows what type of rx frame the per-chain RSSI was computed
  1179. * on, by recording the frame type and sub-type as bit-fields within this
  1180. * field:
  1181. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  1182. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  1183. * BIT [31 : 8] :- Reserved
  1184. */
  1185. A_UINT32 per_chain_rssi_pkt_type;
  1186. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1187. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  1188. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  1189. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  1190. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  1191. A_UINT8 rssi_chain_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS]; /* units = dB above noise floor */
  1192. } htt_rx_peer_rate_stats_tlv;
  1193. typedef enum {
  1194. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  1195. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  1196. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  1197. } htt_peer_stats_req_mode_t;
  1198. typedef enum {
  1199. HTT_PEER_STATS_CMN_TLV = 0,
  1200. HTT_PEER_DETAILS_TLV = 1,
  1201. HTT_TX_PEER_RATE_STATS_TLV = 2,
  1202. HTT_RX_PEER_RATE_STATS_TLV = 3,
  1203. HTT_TX_TID_STATS_TLV = 4,
  1204. HTT_RX_TID_STATS_TLV = 5,
  1205. HTT_MSDU_FLOW_STATS_TLV = 6,
  1206. HTT_PEER_STATS_MAX_TLV = 31,
  1207. } htt_peer_stats_tlv_enum;
  1208. /* config_param0 */
  1209. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  1210. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  1211. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  1212. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  1213. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  1214. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  1215. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  1218. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  1219. } while (0)
  1220. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  1221. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  1222. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  1223. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  1224. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  1225. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  1226. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  1227. do { \
  1228. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  1229. } while (0)
  1230. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  1231. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  1232. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  1233. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  1234. do { \
  1235. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  1236. } while (0)
  1237. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  1238. * TLV_TAGS:
  1239. * - HTT_STATS_PEER_STATS_CMN_TAG
  1240. * - HTT_STATS_PEER_DETAILS_TAG
  1241. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  1242. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  1243. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  1244. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  1245. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  1246. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  1247. */
  1248. /* NOTE:
  1249. * This structure is for documentation, and cannot be safely used directly.
  1250. * Instead, use the constituent TLV structures to fill/parse.
  1251. */
  1252. typedef struct _htt_peer_stats {
  1253. htt_peer_stats_cmn_tlv cmn_tlv;
  1254. htt_peer_details_tlv peer_details;
  1255. /* from g_rate_info_stats */
  1256. htt_tx_peer_rate_stats_tlv tx_rate;
  1257. htt_rx_peer_rate_stats_tlv rx_rate;
  1258. htt_tx_tid_stats_tlv tx_tid_stats[1];
  1259. htt_rx_tid_stats_tlv rx_tid_stats[1];
  1260. htt_msdu_flow_stats_tlv msdu_flowq[1];
  1261. htt_tx_tid_stats_v1_tlv tx_tid_stats_v1[1];
  1262. } htt_peer_stats_t;
  1263. /* =========== ACTIVE PEER LIST ========== */
  1264. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  1265. * TLV_TAGS:
  1266. * - HTT_STATS_PEER_DETAILS_TAG
  1267. */
  1268. /* NOTE:
  1269. * This structure is for documentation, and cannot be safely used directly.
  1270. * Instead, use the constituent TLV structures to fill/parse.
  1271. */
  1272. typedef struct {
  1273. htt_peer_details_tlv peer_details[1];
  1274. } htt_active_peer_details_list_t;
  1275. /* =========== MUMIMO HWQ stats =========== */
  1276. /* MU MIMO stats per hwQ */
  1277. typedef struct {
  1278. htt_tlv_hdr_t tlv_hdr;
  1279. A_UINT32 mu_mimo_sch_posted;
  1280. A_UINT32 mu_mimo_sch_failed;
  1281. A_UINT32 mu_mimo_ppdu_posted;
  1282. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  1283. typedef struct {
  1284. htt_tlv_hdr_t tlv_hdr;
  1285. A_UINT32 mu_mimo_mpdus_queued_usr; /* Number of mpdus queued per user */
  1286. A_UINT32 mu_mimo_mpdus_tried_usr; /* Number of mpdus actually transmitted by TxPCU per user */
  1287. A_UINT32 mu_mimo_mpdus_failed_usr; /* Number of mpdus failed per user */
  1288. A_UINT32 mu_mimo_mpdus_requeued_usr; /* Number of mpdus requeued per user */
  1289. A_UINT32 mu_mimo_err_no_ba_usr; /* Number of times BA is not received for a user in MU PPDU */
  1290. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1291. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1292. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  1293. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  1294. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  1295. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  1296. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  1297. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  1298. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  1299. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  1300. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  1304. } while (0)
  1305. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  1306. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  1307. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  1308. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  1309. do { \
  1310. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  1311. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  1312. } while (0)
  1313. typedef struct {
  1314. htt_tlv_hdr_t tlv_hdr;
  1315. /* BIT [ 7 : 0] :- mac_id
  1316. * BIT [15 : 8] :- hwq_id
  1317. * BIT [31 : 16] :- reserved
  1318. */
  1319. A_UINT32 mac_id__hwq_id__word;
  1320. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  1321. /* NOTE:
  1322. * This structure is for documentation, and cannot be safely used directly.
  1323. * Instead, use the constituent TLV structures to fill/parse.
  1324. */
  1325. typedef struct {
  1326. struct _hwq_mu_mimo_stats {
  1327. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  1328. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1329. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_TX_MAX_NUM_USERS */
  1330. } hwq[1];
  1331. } htt_tx_hwq_mu_mimo_stats_t;
  1332. /* == TX HWQ STATS == */
  1333. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  1334. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  1335. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  1336. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  1337. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  1338. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  1339. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  1340. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  1343. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  1344. } while (0)
  1345. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  1346. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  1347. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  1348. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  1352. } while (0)
  1353. typedef struct {
  1354. htt_tlv_hdr_t tlv_hdr;
  1355. /* BIT [ 7 : 0] :- mac_id
  1356. * BIT [15 : 8] :- hwq_id
  1357. * BIT [31 : 16] :- reserved
  1358. */
  1359. A_UINT32 mac_id__hwq_id__word;
  1360. /* PPDU level stats */
  1361. A_UINT32 xretry; /* Number of times ack is failed for the PPDU scheduled on this txQ */
  1362. A_UINT32 underrun_cnt; /* Number of times sched cmd status reported mpdu underrun */
  1363. A_UINT32 flush_cnt; /* Number of times sched cmd is flushed */
  1364. A_UINT32 filt_cnt; /* Number of times sched cmd is filtered */
  1365. A_UINT32 null_mpdu_bmap; /* Number of times HWSCH uploaded null mpdu bitmap */
  1366. 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 */
  1367. A_UINT32 ack_tlv_proc; /* Number of times TQM processed ack tlv received from HWSCH */
  1368. A_UINT32 sched_id_proc; /* Cache latest processed scheduler ID received from ack ba tlv */
  1369. A_UINT32 null_mpdu_tx_count; /* Number of times TxPCU reported mpdus transmitted for a user is zero */
  1370. A_UINT32 mpdu_bmap_not_recvd; /* Number of times SW did not see any mpdu info bitmap tlv on FES status ring */
  1371. /* Selfgen stats per hwQ */
  1372. A_UINT32 num_bar; /* Number of SU/MU BAR frames posted to hwQ */
  1373. A_UINT32 rts; /* Number of RTS frames posted to hwQ */
  1374. A_UINT32 cts2self; /* Number of cts2self frames posted to hwQ */
  1375. A_UINT32 qos_null; /* Number of qos null frames posted to hwQ */
  1376. /* MPDU level stats */
  1377. A_UINT32 mpdu_tried_cnt; /* mpdus tried Tx by HWSCH/TQM */
  1378. A_UINT32 mpdu_queued_cnt; /* mpdus queued to HWSCH */
  1379. A_UINT32 mpdu_ack_fail_cnt; /* mpdus tried but ack was not received */
  1380. A_UINT32 mpdu_filt_cnt; /* This will include sched cmd flush and time based discard */
  1381. A_UINT32 false_mpdu_ack_count; /* Number of MPDUs for which ACK was sucessful but no Tx happened */
  1382. A_UINT32 txq_timeout; /* Number of times txq timeout happened */
  1383. } htt_tx_hwq_stats_cmn_tlv;
  1384. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) + /* hist_intvl */ \
  1385. (sizeof(A_UINT32) * (_num_elems)))
  1386. /* NOTE: Variable length TLV, use length spec to infer array size */
  1387. typedef struct {
  1388. htt_tlv_hdr_t tlv_hdr;
  1389. A_UINT32 hist_intvl;
  1390. /* histogram of ppdu post to hwsch - > cmd status received */
  1391. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1392. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1393. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1394. /* NOTE: Variable length TLV, use length spec to infer array size */
  1395. typedef struct {
  1396. htt_tlv_hdr_t tlv_hdr;
  1397. /* Histogram of sched cmd result */
  1398. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1399. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1400. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1401. /* NOTE: Variable length TLV, use length spec to infer array size */
  1402. typedef struct {
  1403. htt_tlv_hdr_t tlv_hdr;
  1404. /* Histogram of various pause conitions */
  1405. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1406. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1407. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1408. /* NOTE: Variable length TLV, use length spec to infer array size */
  1409. typedef struct {
  1410. htt_tlv_hdr_t tlv_hdr;
  1411. /* Histogram of number of user fes result */
  1412. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1413. } htt_tx_hwq_fes_result_stats_tlv_v;
  1414. #define HTT_TX_HWQ_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1415. /* NOTE: Variable length TLV, use length spec to infer array size
  1416. *
  1417. * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
  1418. * The tries here is the count of the MPDUS within a PPDU that the HW
  1419. * had attempted to transmit on air, for the HWSCH Schedule command
  1420. * submitted by FW in this HWQ .It is not the retry attempts. The
  1421. * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
  1422. * in this histogram.
  1423. * they are defined in FW using the following macros
  1424. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  1425. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  1426. *
  1427. * */
  1428. typedef struct {
  1429. htt_tlv_hdr_t tlv_hdr;
  1430. A_UINT32 hist_bin_size;
  1431. /* Histogram of number of mpdus on tried mpdu */
  1432. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_HWQ_TRIED_MPDU_CNT_HIST */
  1433. } htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v;
  1434. #define HTT_TX_HWQ_TXOP_USED_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1435. /* NOTE: Variable length TLV, use length spec to infer array size
  1436. *
  1437. * The txop_used_cnt_hist is the histogram of txop per burst. After
  1438. * completing the burst, we identify the txop used in the burst and
  1439. * incr the corresponding bin.
  1440. * Each bin represents 1ms & we have 10 bins in this histogram.
  1441. * they are deined in FW using the following macros
  1442. * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
  1443. * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
  1444. *
  1445. * */
  1446. typedef struct {
  1447. htt_tlv_hdr_t tlv_hdr;
  1448. /* Histogram of txop used cnt */
  1449. A_UINT32 txop_used_cnt_hist[1]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
  1450. } htt_tx_hwq_txop_used_cnt_hist_tlv_v;
  1451. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1452. * TLV_TAGS:
  1453. * - HTT_STATS_STRING_TAG
  1454. * - HTT_STATS_TX_HWQ_CMN_TAG
  1455. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1456. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1457. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1458. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1459. * - HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG
  1460. * - HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG
  1461. */
  1462. /* NOTE:
  1463. * This structure is for documentation, and cannot be safely used directly.
  1464. * Instead, use the constituent TLV structures to fill/parse.
  1465. * General HWQ stats Mechanism:
  1466. * Once the host request for the stats, FW fill all the HWQ TAGS in a buffer
  1467. * for all the HWQ requested. & the FW send the buffer to host. In the
  1468. * buffer the HWQ ID is filled in mac_id__hwq_id, thus identifying each
  1469. * HWQ distinctly.
  1470. */
  1471. typedef struct _htt_tx_hwq_stats {
  1472. htt_stats_string_tlv hwq_str_tlv;
  1473. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1474. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1475. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1476. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1477. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1478. htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v tried_mpdu_tlv;
  1479. htt_tx_hwq_txop_used_cnt_hist_tlv_v txop_used_tlv;
  1480. } htt_tx_hwq_stats_t;
  1481. /* == TX SELFGEN STATS == */
  1482. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1483. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1484. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1485. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1486. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1487. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1488. do { \
  1489. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1490. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1491. } while (0)
  1492. typedef struct {
  1493. htt_tlv_hdr_t tlv_hdr;
  1494. /* BIT [ 7 : 0] :- mac_id
  1495. * BIT [31 : 8] :- reserved
  1496. */
  1497. A_UINT32 mac_id__word;
  1498. A_UINT32 su_bar;
  1499. A_UINT32 rts;
  1500. A_UINT32 cts2self;
  1501. A_UINT32 qos_null;
  1502. A_UINT32 delayed_bar_1; /* MU user 1 */
  1503. A_UINT32 delayed_bar_2; /* MU user 2 */
  1504. A_UINT32 delayed_bar_3; /* MU user 3 */
  1505. A_UINT32 delayed_bar_4; /* MU user 4 */
  1506. A_UINT32 delayed_bar_5; /* MU user 5 */
  1507. A_UINT32 delayed_bar_6; /* MU user 6 */
  1508. A_UINT32 delayed_bar_7; /* MU user 7 */
  1509. } htt_tx_selfgen_cmn_stats_tlv;
  1510. typedef struct {
  1511. htt_tlv_hdr_t tlv_hdr;
  1512. /* 11AC */
  1513. A_UINT32 ac_su_ndpa;
  1514. A_UINT32 ac_su_ndp;
  1515. A_UINT32 ac_mu_mimo_ndpa;
  1516. A_UINT32 ac_mu_mimo_ndp;
  1517. A_UINT32 ac_mu_mimo_brpoll_1; /* MU user 1 */
  1518. A_UINT32 ac_mu_mimo_brpoll_2; /* MU user 2 */
  1519. A_UINT32 ac_mu_mimo_brpoll_3; /* MU user 3 */
  1520. } htt_tx_selfgen_ac_stats_tlv;
  1521. typedef struct {
  1522. htt_tlv_hdr_t tlv_hdr;
  1523. /* 11AX */
  1524. A_UINT32 ax_su_ndpa;
  1525. A_UINT32 ax_su_ndp;
  1526. A_UINT32 ax_mu_mimo_ndpa;
  1527. A_UINT32 ax_mu_mimo_ndp;
  1528. A_UINT32 ax_mu_mimo_brpoll_1; /* MU user 1 */
  1529. A_UINT32 ax_mu_mimo_brpoll_2; /* MU user 2 */
  1530. A_UINT32 ax_mu_mimo_brpoll_3; /* MU user 3 */
  1531. A_UINT32 ax_mu_mimo_brpoll_4; /* MU user 4 */
  1532. A_UINT32 ax_mu_mimo_brpoll_5; /* MU user 5 */
  1533. A_UINT32 ax_mu_mimo_brpoll_6; /* MU user 6 */
  1534. A_UINT32 ax_mu_mimo_brpoll_7; /* MU user 7 */
  1535. A_UINT32 ax_basic_trigger;
  1536. A_UINT32 ax_bsr_trigger;
  1537. A_UINT32 ax_mu_bar_trigger;
  1538. A_UINT32 ax_mu_rts_trigger;
  1539. A_UINT32 ax_ulmumimo_trigger;
  1540. } htt_tx_selfgen_ax_stats_tlv;
  1541. typedef struct {
  1542. htt_tlv_hdr_t tlv_hdr;
  1543. /* 11AC error stats */
  1544. A_UINT32 ac_su_ndp_err;
  1545. A_UINT32 ac_su_ndpa_err;
  1546. A_UINT32 ac_mu_mimo_ndpa_err;
  1547. A_UINT32 ac_mu_mimo_ndp_err;
  1548. A_UINT32 ac_mu_mimo_brp1_err;
  1549. A_UINT32 ac_mu_mimo_brp2_err;
  1550. A_UINT32 ac_mu_mimo_brp3_err;
  1551. } htt_tx_selfgen_ac_err_stats_tlv;
  1552. typedef struct {
  1553. htt_tlv_hdr_t tlv_hdr;
  1554. /* 11AX error stats */
  1555. A_UINT32 ax_su_ndp_err;
  1556. A_UINT32 ax_su_ndpa_err;
  1557. A_UINT32 ax_mu_mimo_ndpa_err;
  1558. A_UINT32 ax_mu_mimo_ndp_err;
  1559. A_UINT32 ax_mu_mimo_brp1_err;
  1560. A_UINT32 ax_mu_mimo_brp2_err;
  1561. A_UINT32 ax_mu_mimo_brp3_err;
  1562. A_UINT32 ax_mu_mimo_brp4_err;
  1563. A_UINT32 ax_mu_mimo_brp5_err;
  1564. A_UINT32 ax_mu_mimo_brp6_err;
  1565. A_UINT32 ax_mu_mimo_brp7_err;
  1566. A_UINT32 ax_basic_trigger_err;
  1567. A_UINT32 ax_bsr_trigger_err;
  1568. A_UINT32 ax_mu_bar_trigger_err;
  1569. A_UINT32 ax_mu_rts_trigger_err;
  1570. A_UINT32 ax_ulmumimo_trigger_err;
  1571. } htt_tx_selfgen_ax_err_stats_tlv;
  1572. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  1573. * TLV_TAGS:
  1574. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  1575. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  1576. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  1577. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  1578. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  1579. */
  1580. /* NOTE:
  1581. * This structure is for documentation, and cannot be safely used directly.
  1582. * Instead, use the constituent TLV structures to fill/parse.
  1583. */
  1584. typedef struct {
  1585. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  1586. /* 11AC */
  1587. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  1588. /* 11AX */
  1589. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  1590. /* 11AC error stats */
  1591. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  1592. /* 11AX error stats */
  1593. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  1594. } htt_tx_pdev_selfgen_stats_t;
  1595. /* == TX MU STATS == */
  1596. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  1597. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  1598. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  1599. #define HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS 8
  1600. typedef struct {
  1601. htt_tlv_hdr_t tlv_hdr;
  1602. /* mu-mimo sw sched cmd stats */
  1603. A_UINT32 mu_mimo_sch_posted;
  1604. A_UINT32 mu_mimo_sch_failed;
  1605. /* MU PPDU stats per hwQ */
  1606. A_UINT32 mu_mimo_ppdu_posted;
  1607. /*
  1608. * Counts the number of users in each transmission of
  1609. * the given TX mode.
  1610. *
  1611. * Index is the number of users - 1.
  1612. */
  1613. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  1614. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1615. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1616. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1617. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1618. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1619. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1620. /* UL MUMIMO */
  1621. /*
  1622. * ax_ul_mumimo_basic_sch_nusers[i] is the number of basic triggers sent
  1623. * for (i+1) users
  1624. */
  1625. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  1626. /*
  1627. * ax_ul_mumimo_brp_sch_nusers[i] is the number of brp triggers sent
  1628. * for (i+1) users
  1629. */
  1630. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  1631. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  1632. typedef struct {
  1633. htt_tlv_hdr_t tlv_hdr;
  1634. /* mu-mimo mpdu level stats */
  1635. /*
  1636. * This first block of stats is limited to 11ac
  1637. * MU-MIMO transmission.
  1638. */
  1639. A_UINT32 mu_mimo_mpdus_queued_usr;
  1640. A_UINT32 mu_mimo_mpdus_tried_usr;
  1641. A_UINT32 mu_mimo_mpdus_failed_usr;
  1642. A_UINT32 mu_mimo_mpdus_requeued_usr;
  1643. A_UINT32 mu_mimo_err_no_ba_usr;
  1644. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1645. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1646. A_UINT32 ax_mu_mimo_mpdus_queued_usr;
  1647. A_UINT32 ax_mu_mimo_mpdus_tried_usr;
  1648. A_UINT32 ax_mu_mimo_mpdus_failed_usr;
  1649. A_UINT32 ax_mu_mimo_mpdus_requeued_usr;
  1650. A_UINT32 ax_mu_mimo_err_no_ba_usr;
  1651. A_UINT32 ax_mu_mimo_mpdu_underrun_usr;
  1652. A_UINT32 ax_mu_mimo_ampdu_underrun_usr;
  1653. A_UINT32 ax_ofdma_mpdus_queued_usr;
  1654. A_UINT32 ax_ofdma_mpdus_tried_usr;
  1655. A_UINT32 ax_ofdma_mpdus_failed_usr;
  1656. A_UINT32 ax_ofdma_mpdus_requeued_usr;
  1657. A_UINT32 ax_ofdma_err_no_ba_usr;
  1658. A_UINT32 ax_ofdma_mpdu_underrun_usr;
  1659. A_UINT32 ax_ofdma_ampdu_underrun_usr;
  1660. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  1661. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  1662. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  1663. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  1664. typedef struct {
  1665. htt_tlv_hdr_t tlv_hdr;
  1666. /* mpdu level stats */
  1667. A_UINT32 mpdus_queued_usr;
  1668. A_UINT32 mpdus_tried_usr;
  1669. A_UINT32 mpdus_failed_usr;
  1670. A_UINT32 mpdus_requeued_usr;
  1671. A_UINT32 err_no_ba_usr;
  1672. A_UINT32 mpdu_underrun_usr;
  1673. A_UINT32 ampdu_underrun_usr;
  1674. A_UINT32 user_index;
  1675. A_UINT32 tx_sched_mode; /* HTT_STATS_TX_SCHED_MODE_xxx */
  1676. } htt_tx_pdev_mpdu_stats_tlv;
  1677. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  1678. * TLV_TAGS:
  1679. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  1680. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  1681. */
  1682. /* NOTE:
  1683. * This structure is for documentation, and cannot be safely used directly.
  1684. * Instead, use the constituent TLV structures to fill/parse.
  1685. */
  1686. typedef struct {
  1687. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1688. /*
  1689. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  1690. * it can also hold MU-OFDMA stats.
  1691. */
  1692. htt_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  1693. } htt_tx_pdev_mu_mimo_stats_t;
  1694. /* == TX SCHED STATS == */
  1695. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1696. /* NOTE: Variable length TLV, use length spec to infer array size */
  1697. typedef struct {
  1698. htt_tlv_hdr_t tlv_hdr;
  1699. /* Scheduler command posted per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1700. A_UINT32 sched_cmd_posted[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1701. } htt_sched_txq_cmd_posted_tlv_v;
  1702. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1703. /* NOTE: Variable length TLV, use length spec to infer array size */
  1704. typedef struct {
  1705. htt_tlv_hdr_t tlv_hdr;
  1706. /* Scheduler command reaped per tx_mode su / mu mimo 11ac / mu mimo 11ax / mu ofdma */
  1707. A_UINT32 sched_cmd_reaped[1]; /* HTT_TX_PDEV_SCHED_TX_MODE_MAX */
  1708. } htt_sched_txq_cmd_reaped_tlv_v;
  1709. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1710. /* NOTE: Variable length TLV, use length spec to infer array size */
  1711. typedef struct {
  1712. htt_tlv_hdr_t tlv_hdr;
  1713. /*
  1714. * sched_order_su contains the peer IDs of peers chosen in the last
  1715. * NUM_SCHED_ORDER_LOG scheduler instances.
  1716. * The array is circular; it's unspecified which array element corresponds
  1717. * to the most recent scheduler invocation, and which corresponds to
  1718. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  1719. */
  1720. A_UINT32 sched_order_su[1]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
  1721. } htt_sched_txq_sched_order_su_tlv_v;
  1722. typedef enum {
  1723. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  1724. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  1725. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  1726. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  1727. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  1728. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  1729. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  1730. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  1731. HTT_SCHED_TID_SKIP_NO_ENQ, /* Skip the tid when num_frames is zero with g_disable_remove_tid as true */
  1732. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  1733. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  1734. HTT_SCHED_TID_SKIP_UL, /* UL tid skip */
  1735. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  1736. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  1737. HTT_SCHED_TID_REMOVE_UL, /* UL tid remove */
  1738. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  1739. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  1740. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  1741. HTT_SCHED_INELIGIBILITY_MAX,
  1742. } htt_sched_txq_sched_ineligibility_tlv_enum;
  1743. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1744. /* NOTE: Variable length TLV, use length spec to infer array size */
  1745. typedef struct {
  1746. htt_tlv_hdr_t tlv_hdr;
  1747. /* sched_ineligibility counts the number of occurrences of different reasons for tid ineligibility during eligibility checks per txq in scheduling */
  1748. A_UINT32 sched_ineligibility[1]; /* indexed by htt_sched_txq_sched_ineligibility_tlv_enum */
  1749. } htt_sched_txq_sched_ineligibility_tlv_v;
  1750. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  1751. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  1752. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  1753. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  1754. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  1755. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  1756. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  1757. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  1758. do { \
  1759. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  1760. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  1761. } while (0)
  1762. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  1763. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  1764. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  1765. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  1766. do { \
  1767. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  1768. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  1769. } while (0)
  1770. typedef struct {
  1771. htt_tlv_hdr_t tlv_hdr;
  1772. /* BIT [ 7 : 0] :- mac_id
  1773. * BIT [15 : 8] :- txq_id
  1774. * BIT [31 : 16] :- reserved
  1775. */
  1776. A_UINT32 mac_id__txq_id__word;
  1777. /* Scheduler policy ised for this TxQ */
  1778. A_UINT32 sched_policy;
  1779. /* Timestamp of last scheduler command posted */
  1780. A_UINT32 last_sched_cmd_posted_timestamp;
  1781. /* Timestamp of last scheduler command completed */
  1782. A_UINT32 last_sched_cmd_compl_timestamp;
  1783. /* Num of Sched2TAC ring hit Low Water Mark condition */
  1784. A_UINT32 sched_2_tac_lwm_count;
  1785. /* Num of Sched2TAC ring full condition */
  1786. A_UINT32 sched_2_tac_ring_full;
  1787. /* Num of scheduler command post failures that includes su/mu mimo/mu ofdma sequence type */
  1788. A_UINT32 sched_cmd_post_failure;
  1789. /* Num of active tids for this TxQ at current instance */
  1790. A_UINT32 num_active_tids;
  1791. /* Num of powersave schedules */
  1792. A_UINT32 num_ps_schedules;
  1793. /* Num of scheduler commands pending for this TxQ */
  1794. A_UINT32 sched_cmds_pending;
  1795. /* Num of tidq registration for this TxQ */
  1796. A_UINT32 num_tid_register;
  1797. /* Num of tidq de-registration for this TxQ */
  1798. A_UINT32 num_tid_unregister;
  1799. /* Num of iterations msduq stats was updated */
  1800. A_UINT32 num_qstats_queried;
  1801. /* qstats query update status */
  1802. A_UINT32 qstats_update_pending;
  1803. /* Timestamp of Last query stats made */
  1804. A_UINT32 last_qstats_query_timestamp;
  1805. /* Num of sched2tqm command queue full condition */
  1806. A_UINT32 num_tqm_cmdq_full;
  1807. /* Num of scheduler trigger from DE Module */
  1808. A_UINT32 num_de_sched_algo_trigger;
  1809. /* Num of scheduler trigger from RT Module */
  1810. A_UINT32 num_rt_sched_algo_trigger;
  1811. /* Num of scheduler trigger from TQM Module */
  1812. A_UINT32 num_tqm_sched_algo_trigger;
  1813. /* Num of schedules for notify frame */
  1814. A_UINT32 notify_sched;
  1815. /* Duration based sendn termination */
  1816. A_UINT32 dur_based_sendn_term;
  1817. /* scheduled via NOTIFY2 */
  1818. A_UINT32 su_notify2_sched;
  1819. /* schedule if queued packets are greater than avg MSDUs in PPDU */
  1820. A_UINT32 su_optimal_queued_msdus_sched;
  1821. /* schedule due to timeout */
  1822. A_UINT32 su_delay_timeout_sched;
  1823. /* delay if txtime is less than 500us */
  1824. A_UINT32 su_min_txtime_sched_delay;
  1825. /* scheduled via no delay */
  1826. A_UINT32 su_no_delay;
  1827. } htt_tx_pdev_stats_sched_per_txq_tlv;
  1828. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  1829. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  1830. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  1831. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  1832. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  1833. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  1836. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  1837. } while (0)
  1838. typedef struct {
  1839. htt_tlv_hdr_t tlv_hdr;
  1840. /* BIT [ 7 : 0] :- mac_id
  1841. * BIT [31 : 8] :- reserved
  1842. */
  1843. A_UINT32 mac_id__word;
  1844. /* Current timestamp */
  1845. A_UINT32 current_timestamp;
  1846. } htt_stats_tx_sched_cmn_tlv;
  1847. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  1848. * TLV_TAGS:
  1849. * - HTT_STATS_TX_SCHED_CMN_TAG
  1850. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  1851. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  1852. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  1853. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  1854. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  1855. */
  1856. /* NOTE:
  1857. * This structure is for documentation, and cannot be safely used directly.
  1858. * Instead, use the constituent TLV structures to fill/parse.
  1859. */
  1860. typedef struct {
  1861. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  1862. struct _txq_tx_sched_stats {
  1863. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  1864. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  1865. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  1866. htt_sched_txq_sched_order_su_tlv_v sched_order_su_tlv;
  1867. htt_sched_txq_sched_ineligibility_tlv_v sched_ineligibility_tlv;
  1868. } txq[1];
  1869. } htt_stats_tx_sched_t;
  1870. /* == TQM STATS == */
  1871. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
  1872. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  1873. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  1874. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1875. /* NOTE: Variable length TLV, use length spec to infer array size */
  1876. typedef struct {
  1877. htt_tlv_hdr_t tlv_hdr;
  1878. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  1879. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  1880. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1881. /* NOTE: Variable length TLV, use length spec to infer array size */
  1882. typedef struct {
  1883. htt_tlv_hdr_t tlv_hdr;
  1884. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  1885. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  1886. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1887. /* NOTE: Variable length TLV, use length spec to infer array size */
  1888. typedef struct {
  1889. htt_tlv_hdr_t tlv_hdr;
  1890. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  1891. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  1892. typedef struct {
  1893. htt_tlv_hdr_t tlv_hdr;
  1894. A_UINT32 msdu_count;
  1895. A_UINT32 mpdu_count;
  1896. A_UINT32 remove_msdu;
  1897. A_UINT32 remove_mpdu;
  1898. A_UINT32 remove_msdu_ttl;
  1899. A_UINT32 send_bar;
  1900. A_UINT32 bar_sync;
  1901. A_UINT32 notify_mpdu;
  1902. A_UINT32 sync_cmd;
  1903. A_UINT32 write_cmd;
  1904. A_UINT32 hwsch_trigger;
  1905. A_UINT32 ack_tlv_proc;
  1906. A_UINT32 gen_mpdu_cmd;
  1907. A_UINT32 gen_list_cmd;
  1908. A_UINT32 remove_mpdu_cmd;
  1909. A_UINT32 remove_mpdu_tried_cmd;
  1910. A_UINT32 mpdu_queue_stats_cmd;
  1911. A_UINT32 mpdu_head_info_cmd;
  1912. A_UINT32 msdu_flow_stats_cmd;
  1913. A_UINT32 remove_msdu_cmd;
  1914. A_UINT32 remove_msdu_ttl_cmd;
  1915. A_UINT32 flush_cache_cmd;
  1916. A_UINT32 update_mpduq_cmd;
  1917. A_UINT32 enqueue;
  1918. A_UINT32 enqueue_notify;
  1919. A_UINT32 notify_mpdu_at_head;
  1920. A_UINT32 notify_mpdu_state_valid;
  1921. /*
  1922. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  1923. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  1924. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  1925. * for non-UDP MSDUs.
  1926. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  1927. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  1928. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  1929. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  1930. *
  1931. * Notify signifies that we trigger the scheduler.
  1932. */
  1933. A_UINT32 sched_udp_notify1;
  1934. A_UINT32 sched_udp_notify2;
  1935. A_UINT32 sched_nonudp_notify1;
  1936. A_UINT32 sched_nonudp_notify2;
  1937. } htt_tx_tqm_pdev_stats_tlv_v;
  1938. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  1939. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  1940. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  1941. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  1942. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  1943. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  1946. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  1947. } while (0)
  1948. typedef struct {
  1949. htt_tlv_hdr_t tlv_hdr;
  1950. /* BIT [ 7 : 0] :- mac_id
  1951. * BIT [31 : 8] :- reserved
  1952. */
  1953. A_UINT32 mac_id__word;
  1954. A_UINT32 max_cmdq_id;
  1955. A_UINT32 list_mpdu_cnt_hist_intvl;
  1956. /* Global stats */
  1957. A_UINT32 add_msdu;
  1958. A_UINT32 q_empty;
  1959. A_UINT32 q_not_empty;
  1960. A_UINT32 drop_notification;
  1961. A_UINT32 desc_threshold;
  1962. A_UINT32 hwsch_tqm_invalid_status;
  1963. A_UINT32 missed_tqm_gen_mpdus;
  1964. } htt_tx_tqm_cmn_stats_tlv;
  1965. typedef struct {
  1966. htt_tlv_hdr_t tlv_hdr;
  1967. /* Error stats */
  1968. A_UINT32 q_empty_failure;
  1969. A_UINT32 q_not_empty_failure;
  1970. A_UINT32 add_msdu_failure;
  1971. } htt_tx_tqm_error_stats_tlv;
  1972. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  1973. * TLV_TAGS:
  1974. * - HTT_STATS_TX_TQM_CMN_TAG
  1975. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  1976. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  1977. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  1978. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  1979. * - HTT_STATS_TX_TQM_PDEV_TAG
  1980. */
  1981. /* NOTE:
  1982. * This structure is for documentation, and cannot be safely used directly.
  1983. * Instead, use the constituent TLV structures to fill/parse.
  1984. */
  1985. typedef struct {
  1986. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  1987. htt_tx_tqm_error_stats_tlv err_tlv;
  1988. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  1989. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  1990. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  1991. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  1992. } htt_tx_tqm_pdev_stats_t;
  1993. /* == TQM CMDQ stats == */
  1994. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  1995. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  1996. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  1997. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  1998. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  1999. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  2000. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  2001. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  2005. } while (0)
  2006. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  2007. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  2008. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  2009. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  2013. } while (0)
  2014. typedef struct {
  2015. htt_tlv_hdr_t tlv_hdr;
  2016. /* BIT [ 7 : 0] :- mac_id
  2017. * BIT [15 : 8] :- cmdq_id
  2018. * BIT [31 : 16] :- reserved
  2019. */
  2020. A_UINT32 mac_id__cmdq_id__word;
  2021. A_UINT32 sync_cmd;
  2022. A_UINT32 write_cmd;
  2023. A_UINT32 gen_mpdu_cmd;
  2024. A_UINT32 mpdu_queue_stats_cmd;
  2025. A_UINT32 mpdu_head_info_cmd;
  2026. A_UINT32 msdu_flow_stats_cmd;
  2027. A_UINT32 remove_mpdu_cmd;
  2028. A_UINT32 remove_msdu_cmd;
  2029. A_UINT32 flush_cache_cmd;
  2030. A_UINT32 update_mpduq_cmd;
  2031. A_UINT32 update_msduq_cmd;
  2032. } htt_tx_tqm_cmdq_status_tlv;
  2033. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  2034. * TLV_TAGS:
  2035. * - HTT_STATS_STRING_TAG
  2036. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  2037. */
  2038. /* NOTE:
  2039. * This structure is for documentation, and cannot be safely used directly.
  2040. * Instead, use the constituent TLV structures to fill/parse.
  2041. */
  2042. typedef struct {
  2043. struct _cmdq_stats {
  2044. htt_stats_string_tlv cmdq_str_tlv;
  2045. htt_tx_tqm_cmdq_status_tlv status_tlv;
  2046. } q[1];
  2047. } htt_tx_tqm_cmdq_stats_t;
  2048. /* == TX-DE STATS == */
  2049. /* Structures for tx de stats */
  2050. typedef struct {
  2051. htt_tlv_hdr_t tlv_hdr;
  2052. A_UINT32 m1_packets;
  2053. A_UINT32 m2_packets;
  2054. A_UINT32 m3_packets;
  2055. A_UINT32 m4_packets;
  2056. A_UINT32 g1_packets;
  2057. A_UINT32 g2_packets;
  2058. A_UINT32 rc4_packets;
  2059. A_UINT32 eap_packets;
  2060. A_UINT32 eapol_start_packets;
  2061. A_UINT32 eapol_logoff_packets;
  2062. A_UINT32 eapol_encap_asf_packets;
  2063. } htt_tx_de_eapol_packets_stats_tlv;
  2064. typedef struct {
  2065. htt_tlv_hdr_t tlv_hdr;
  2066. A_UINT32 ap_bss_peer_not_found;
  2067. A_UINT32 ap_bcast_mcast_no_peer;
  2068. A_UINT32 sta_delete_in_progress;
  2069. A_UINT32 ibss_no_bss_peer;
  2070. A_UINT32 invaild_vdev_type;
  2071. A_UINT32 invalid_ast_peer_entry;
  2072. A_UINT32 peer_entry_invalid;
  2073. A_UINT32 ethertype_not_ip;
  2074. A_UINT32 eapol_lookup_failed;
  2075. A_UINT32 qpeer_not_allow_data;
  2076. A_UINT32 fse_tid_override;
  2077. A_UINT32 ipv6_jumbogram_zero_length;
  2078. A_UINT32 qos_to_non_qos_in_prog;
  2079. A_UINT32 ap_bcast_mcast_eapol;
  2080. A_UINT32 unicast_on_ap_bss_peer;
  2081. A_UINT32 ap_vdev_invalid;
  2082. A_UINT32 incomplete_llc;
  2083. A_UINT32 eapol_duplicate_m3;
  2084. A_UINT32 eapol_duplicate_m4;
  2085. } htt_tx_de_classify_failed_stats_tlv;
  2086. typedef struct {
  2087. htt_tlv_hdr_t tlv_hdr;
  2088. A_UINT32 arp_packets;
  2089. A_UINT32 igmp_packets;
  2090. A_UINT32 dhcp_packets;
  2091. A_UINT32 host_inspected;
  2092. A_UINT32 htt_included;
  2093. A_UINT32 htt_valid_mcs;
  2094. A_UINT32 htt_valid_nss;
  2095. A_UINT32 htt_valid_preamble_type;
  2096. A_UINT32 htt_valid_chainmask;
  2097. A_UINT32 htt_valid_guard_interval;
  2098. A_UINT32 htt_valid_retries;
  2099. A_UINT32 htt_valid_bw_info;
  2100. A_UINT32 htt_valid_power;
  2101. A_UINT32 htt_valid_key_flags;
  2102. A_UINT32 htt_valid_no_encryption;
  2103. A_UINT32 fse_entry_count;
  2104. A_UINT32 fse_priority_be;
  2105. A_UINT32 fse_priority_high;
  2106. A_UINT32 fse_priority_low;
  2107. A_UINT32 fse_traffic_ptrn_be;
  2108. A_UINT32 fse_traffic_ptrn_over_sub;
  2109. A_UINT32 fse_traffic_ptrn_bursty;
  2110. A_UINT32 fse_traffic_ptrn_interactive;
  2111. A_UINT32 fse_traffic_ptrn_periodic;
  2112. A_UINT32 fse_hwqueue_alloc;
  2113. A_UINT32 fse_hwqueue_created;
  2114. A_UINT32 fse_hwqueue_send_to_host;
  2115. A_UINT32 mcast_entry;
  2116. A_UINT32 bcast_entry;
  2117. A_UINT32 htt_update_peer_cache;
  2118. A_UINT32 htt_learning_frame;
  2119. A_UINT32 fse_invalid_peer;
  2120. /*
  2121. * mec_notify is HTT TX WBM multicast echo check notification
  2122. * from firmware to host. FW sends SA addresses to host for all
  2123. * multicast/broadcast packets received on STA side.
  2124. */
  2125. A_UINT32 mec_notify;
  2126. } htt_tx_de_classify_stats_tlv;
  2127. typedef struct {
  2128. htt_tlv_hdr_t tlv_hdr;
  2129. A_UINT32 eok;
  2130. A_UINT32 classify_done;
  2131. A_UINT32 lookup_failed;
  2132. A_UINT32 send_host_dhcp;
  2133. A_UINT32 send_host_mcast;
  2134. A_UINT32 send_host_unknown_dest;
  2135. A_UINT32 send_host;
  2136. A_UINT32 status_invalid;
  2137. } htt_tx_de_classify_status_stats_tlv;
  2138. typedef struct {
  2139. htt_tlv_hdr_t tlv_hdr;
  2140. A_UINT32 enqueued_pkts;
  2141. A_UINT32 to_tqm;
  2142. A_UINT32 to_tqm_bypass;
  2143. } htt_tx_de_enqueue_packets_stats_tlv;
  2144. typedef struct {
  2145. htt_tlv_hdr_t tlv_hdr;
  2146. A_UINT32 discarded_pkts;
  2147. A_UINT32 local_frames;
  2148. A_UINT32 is_ext_msdu;
  2149. } htt_tx_de_enqueue_discard_stats_tlv;
  2150. typedef struct {
  2151. htt_tlv_hdr_t tlv_hdr;
  2152. A_UINT32 tcl_dummy_frame;
  2153. A_UINT32 tqm_dummy_frame;
  2154. A_UINT32 tqm_notify_frame;
  2155. A_UINT32 fw2wbm_enq;
  2156. A_UINT32 tqm_bypass_frame;
  2157. } htt_tx_de_compl_stats_tlv;
  2158. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  2159. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  2160. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  2161. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  2162. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  2163. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  2167. } while (0)
  2168. /*
  2169. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  2170. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  2171. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  2172. * 200us & again request for it. This is a histogram of time we wait, with
  2173. * bin of 200ms & there are 10 bin (2 seconds max)
  2174. * They are defined by the following macros in FW
  2175. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  2176. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  2177. * ENTRIES_PER_BIN_COUNT)
  2178. */
  2179. typedef struct {
  2180. htt_tlv_hdr_t tlv_hdr;
  2181. A_UINT32 fw2wbm_ring_full_hist[1];
  2182. } htt_tx_de_fw2wbm_ring_full_hist_tlv;
  2183. typedef struct {
  2184. htt_tlv_hdr_t tlv_hdr;
  2185. /* BIT [ 7 : 0] :- mac_id
  2186. * BIT [31 : 8] :- reserved
  2187. */
  2188. A_UINT32 mac_id__word;
  2189. /* Global Stats */
  2190. A_UINT32 tcl2fw_entry_count;
  2191. A_UINT32 not_to_fw;
  2192. A_UINT32 invalid_pdev_vdev_peer;
  2193. A_UINT32 tcl_res_invalid_addrx;
  2194. A_UINT32 wbm2fw_entry_count;
  2195. A_UINT32 invalid_pdev;
  2196. A_UINT32 tcl_res_addrx_timeout;
  2197. A_UINT32 invalid_vdev;
  2198. A_UINT32 invalid_tcl_exp_frame_desc;
  2199. } htt_tx_de_cmn_stats_tlv;
  2200. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  2201. * TLV_TAGS:
  2202. * - HTT_STATS_TX_DE_CMN_TAG
  2203. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  2204. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  2205. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  2206. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  2207. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  2208. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  2209. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  2210. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  2211. */
  2212. /* NOTE:
  2213. * This structure is for documentation, and cannot be safely used directly.
  2214. * Instead, use the constituent TLV structures to fill/parse.
  2215. */
  2216. typedef struct {
  2217. htt_tx_de_cmn_stats_tlv cmn_tlv;
  2218. htt_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  2219. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  2220. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  2221. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  2222. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  2223. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  2224. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  2225. htt_tx_de_compl_stats_tlv comp_status_tlv;
  2226. } htt_tx_de_stats_t;
  2227. /* == RING-IF STATS == */
  2228. /* DWORD num_elems__prefetch_tail_idx */
  2229. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  2230. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  2231. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  2232. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  2233. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  2234. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  2235. HTT_RING_IF_STATS_NUM_ELEMS_S)
  2236. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  2237. do { \
  2238. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  2239. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  2240. } while (0)
  2241. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  2242. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  2243. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  2244. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  2245. do { \
  2246. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  2247. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  2248. } while (0)
  2249. /* DWORD head_idx__tail_idx */
  2250. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  2251. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  2252. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  2253. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  2254. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  2255. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  2256. HTT_RING_IF_STATS_HEAD_IDX_S)
  2257. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  2260. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  2261. } while (0)
  2262. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  2263. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  2264. HTT_RING_IF_STATS_TAIL_IDX_S)
  2265. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  2268. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  2269. } while (0)
  2270. /* DWORD shadow_head_idx__shadow_tail_idx */
  2271. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  2272. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  2273. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  2274. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  2275. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  2276. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  2277. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  2278. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  2279. do { \
  2280. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  2281. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  2282. } while (0)
  2283. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  2284. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  2285. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  2286. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  2287. do { \
  2288. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  2289. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  2290. } while (0)
  2291. /* DWORD lwm_thresh__hwm_thresh */
  2292. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  2293. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  2294. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  2295. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  2296. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  2297. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  2298. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  2299. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  2300. do { \
  2301. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  2302. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  2303. } while (0)
  2304. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  2305. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  2306. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  2307. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  2308. do { \
  2309. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  2310. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  2311. } while (0)
  2312. #define HTT_STATS_LOW_WM_BINS 5
  2313. #define HTT_STATS_HIGH_WM_BINS 5
  2314. typedef struct {
  2315. A_UINT32 base_addr; /* DWORD aligned base memory address of the ring */
  2316. A_UINT32 elem_size; /* size of each ring element */
  2317. /* BIT [15 : 0] :- num_elems
  2318. * BIT [31 : 16] :- prefetch_tail_idx
  2319. */
  2320. A_UINT32 num_elems__prefetch_tail_idx;
  2321. /* BIT [15 : 0] :- head_idx
  2322. * BIT [31 : 16] :- tail_idx
  2323. */
  2324. A_UINT32 head_idx__tail_idx;
  2325. /* BIT [15 : 0] :- shadow_head_idx
  2326. * BIT [31 : 16] :- shadow_tail_idx
  2327. */
  2328. A_UINT32 shadow_head_idx__shadow_tail_idx;
  2329. A_UINT32 num_tail_incr;
  2330. /* BIT [15 : 0] :- lwm_thresh
  2331. * BIT [31 : 16] :- hwm_thresh
  2332. */
  2333. A_UINT32 lwm_thresh__hwm_thresh;
  2334. A_UINT32 overrun_hit_count;
  2335. A_UINT32 underrun_hit_count;
  2336. A_UINT32 prod_blockwait_count;
  2337. A_UINT32 cons_blockwait_count;
  2338. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2339. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2340. } htt_ring_if_stats_tlv;
  2341. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  2342. #define HTT_RING_IF_CMN_MAC_ID_S 0
  2343. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  2344. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  2345. HTT_RING_IF_CMN_MAC_ID_S)
  2346. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  2349. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  2350. } while (0)
  2351. typedef struct {
  2352. htt_tlv_hdr_t tlv_hdr;
  2353. /* BIT [ 7 : 0] :- mac_id
  2354. * BIT [31 : 8] :- reserved
  2355. */
  2356. A_UINT32 mac_id__word;
  2357. A_UINT32 num_records;
  2358. } htt_ring_if_cmn_tlv;
  2359. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  2360. * TLV_TAGS:
  2361. * - HTT_STATS_RING_IF_CMN_TAG
  2362. * - HTT_STATS_STRING_TAG
  2363. * - HTT_STATS_RING_IF_TAG
  2364. */
  2365. /* NOTE:
  2366. * This structure is for documentation, and cannot be safely used directly.
  2367. * Instead, use the constituent TLV structures to fill/parse.
  2368. */
  2369. typedef struct {
  2370. htt_ring_if_cmn_tlv cmn_tlv;
  2371. /* Variable based on the Number of records. */
  2372. struct _ring_if {
  2373. htt_stats_string_tlv ring_str_tlv;
  2374. htt_ring_if_stats_tlv ring_tlv;
  2375. } r[1];
  2376. } htt_ring_if_stats_t;
  2377. /* == SFM STATS == */
  2378. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2379. /* NOTE: Variable length TLV, use length spec to infer array size */
  2380. typedef struct {
  2381. htt_tlv_hdr_t tlv_hdr;
  2382. /* Number of DWORDS used per user and per client */
  2383. A_UINT32 dwords_used_by_user_n[1];
  2384. } htt_sfm_client_user_tlv_v;
  2385. typedef struct {
  2386. htt_tlv_hdr_t tlv_hdr;
  2387. /* Client ID */
  2388. A_UINT32 client_id;
  2389. /* Minimum number of buffers */
  2390. A_UINT32 buf_min;
  2391. /* Maximum number of buffers */
  2392. A_UINT32 buf_max;
  2393. /* Number of Busy buffers */
  2394. A_UINT32 buf_busy;
  2395. /* Number of Allocated buffers */
  2396. A_UINT32 buf_alloc;
  2397. /* Number of Available/Usable buffers */
  2398. A_UINT32 buf_avail;
  2399. /* Number of users */
  2400. A_UINT32 num_users;
  2401. } htt_sfm_client_tlv;
  2402. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  2403. #define HTT_SFM_CMN_MAC_ID_S 0
  2404. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  2405. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  2406. HTT_SFM_CMN_MAC_ID_S)
  2407. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  2410. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  2411. } while (0)
  2412. typedef struct {
  2413. htt_tlv_hdr_t tlv_hdr;
  2414. /* BIT [ 7 : 0] :- mac_id
  2415. * BIT [31 : 8] :- reserved
  2416. */
  2417. A_UINT32 mac_id__word;
  2418. /* Indicates the total number of 128 byte buffers in the CMEM that are available for buffer sharing */
  2419. A_UINT32 buf_total;
  2420. /* Indicates for certain client or all the clients there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY */
  2421. A_UINT32 mem_empty;
  2422. /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  2423. A_UINT32 deallocate_bufs;
  2424. /* Number of Records */
  2425. A_UINT32 num_records;
  2426. } htt_sfm_cmn_tlv;
  2427. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  2428. * TLV_TAGS:
  2429. * - HTT_STATS_SFM_CMN_TAG
  2430. * - HTT_STATS_STRING_TAG
  2431. * - HTT_STATS_SFM_CLIENT_TAG
  2432. * - HTT_STATS_SFM_CLIENT_USER_TAG
  2433. */
  2434. /* NOTE:
  2435. * This structure is for documentation, and cannot be safely used directly.
  2436. * Instead, use the constituent TLV structures to fill/parse.
  2437. */
  2438. typedef struct {
  2439. htt_sfm_cmn_tlv cmn_tlv;
  2440. /* Variable based on the Number of records. */
  2441. struct _sfm_client {
  2442. htt_stats_string_tlv client_str_tlv;
  2443. htt_sfm_client_tlv client_tlv;
  2444. htt_sfm_client_user_tlv_v user_tlv;
  2445. } r[1];
  2446. } htt_sfm_stats_t;
  2447. /* == SRNG STATS == */
  2448. /* DWORD mac_id__ring_id__arena__ep */
  2449. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  2450. #define HTT_SRING_STATS_MAC_ID_S 0
  2451. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  2452. #define HTT_SRING_STATS_RING_ID_S 8
  2453. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  2454. #define HTT_SRING_STATS_ARENA_S 16
  2455. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  2456. #define HTT_SRING_STATS_EP_TYPE_S 24
  2457. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  2458. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  2459. HTT_SRING_STATS_MAC_ID_S)
  2460. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  2463. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  2464. } while (0)
  2465. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  2466. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  2467. HTT_SRING_STATS_RING_ID_S)
  2468. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  2471. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  2472. } while (0)
  2473. #define HTT_SRING_STATS_ARENA_GET(_var) \
  2474. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  2475. HTT_SRING_STATS_ARENA_S)
  2476. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  2477. do { \
  2478. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  2479. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  2480. } while (0)
  2481. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  2482. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  2483. HTT_SRING_STATS_EP_TYPE_S)
  2484. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  2485. do { \
  2486. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  2487. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  2488. } while (0)
  2489. /* DWORD num_avail_words__num_valid_words */
  2490. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  2491. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  2492. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  2493. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  2494. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  2495. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  2496. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  2497. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  2498. do { \
  2499. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  2500. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  2501. } while (0)
  2502. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  2503. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  2504. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  2505. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  2506. do { \
  2507. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  2508. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  2509. } while (0)
  2510. /* DWORD head_ptr__tail_ptr */
  2511. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  2512. #define HTT_SRING_STATS_HEAD_PTR_S 0
  2513. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  2514. #define HTT_SRING_STATS_TAIL_PTR_S 16
  2515. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  2516. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  2517. HTT_SRING_STATS_HEAD_PTR_S)
  2518. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  2519. do { \
  2520. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  2521. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  2522. } while (0)
  2523. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  2524. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  2525. HTT_SRING_STATS_TAIL_PTR_S)
  2526. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  2529. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  2530. } while (0)
  2531. /* DWORD consumer_empty__producer_full */
  2532. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  2533. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  2534. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  2535. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  2536. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  2537. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  2538. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  2539. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  2540. do { \
  2541. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  2542. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  2543. } while (0)
  2544. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  2545. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  2546. HTT_SRING_STATS_PRODUCER_FULL_S)
  2547. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  2548. do { \
  2549. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  2550. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  2551. } while (0)
  2552. /* DWORD prefetch_count__internal_tail_ptr */
  2553. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  2554. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  2555. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  2556. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  2557. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  2558. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  2559. HTT_SRING_STATS_PREFETCH_COUNT_S)
  2560. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  2561. do { \
  2562. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  2563. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  2564. } while (0)
  2565. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  2566. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  2567. HTT_SRING_STATS_INTERNAL_TP_S)
  2568. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  2569. do { \
  2570. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  2571. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  2572. } while (0)
  2573. typedef struct {
  2574. htt_tlv_hdr_t tlv_hdr;
  2575. /* BIT [ 7 : 0] :- mac_id
  2576. * BIT [15 : 8] :- ring_id
  2577. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  2578. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  2579. * BIT [31 : 25] :- reserved
  2580. */
  2581. A_UINT32 mac_id__ring_id__arena__ep;
  2582. A_UINT32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
  2583. A_UINT32 base_addr_msb;
  2584. A_UINT32 ring_size; /* size of ring */
  2585. A_UINT32 elem_size; /* size of each ring element */
  2586. /* Ring status */
  2587. /* BIT [15 : 0] :- num_avail_words
  2588. * BIT [31 : 16] :- num_valid_words
  2589. */
  2590. A_UINT32 num_avail_words__num_valid_words;
  2591. /* Index of head and tail */
  2592. /* BIT [15 : 0] :- head_ptr
  2593. * BIT [31 : 16] :- tail_ptr
  2594. */
  2595. A_UINT32 head_ptr__tail_ptr;
  2596. /* Empty or full counter of rings */
  2597. /* BIT [15 : 0] :- consumer_empty
  2598. * BIT [31 : 16] :- producer_full
  2599. */
  2600. A_UINT32 consumer_empty__producer_full;
  2601. /* Prefetch status of consumer ring */
  2602. /* BIT [15 : 0] :- prefetch_count
  2603. * BIT [31 : 16] :- internal_tail_ptr
  2604. */
  2605. A_UINT32 prefetch_count__internal_tail_ptr;
  2606. } htt_sring_stats_tlv;
  2607. typedef struct {
  2608. htt_tlv_hdr_t tlv_hdr;
  2609. A_UINT32 num_records;
  2610. } htt_sring_cmn_tlv;
  2611. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  2612. * TLV_TAGS:
  2613. * - HTT_STATS_SRING_CMN_TAG
  2614. * - HTT_STATS_STRING_TAG
  2615. * - HTT_STATS_SRING_STATS_TAG
  2616. */
  2617. /* NOTE:
  2618. * This structure is for documentation, and cannot be safely used directly.
  2619. * Instead, use the constituent TLV structures to fill/parse.
  2620. */
  2621. typedef struct {
  2622. htt_sring_cmn_tlv cmn_tlv;
  2623. /* Variable based on the Number of records. */
  2624. struct _sring_stats {
  2625. htt_stats_string_tlv sring_str_tlv;
  2626. htt_sring_stats_tlv sring_stats_tlv;
  2627. } r[1];
  2628. } htt_sring_stats_t;
  2629. /* == PDEV TX RATE CTRL STATS == */
  2630. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2631. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  2632. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2633. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  2634. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2635. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2636. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  2637. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  2638. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  2639. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  2640. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  2641. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  2642. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  2643. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2644. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  2645. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2646. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2647. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  2648. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  2652. } while (0)
  2653. typedef struct {
  2654. htt_tlv_hdr_t tlv_hdr;
  2655. /* BIT [ 7 : 0] :- mac_id
  2656. * BIT [31 : 8] :- reserved
  2657. */
  2658. A_UINT32 mac_id__word;
  2659. /* Number of tx ldpc packets */
  2660. A_UINT32 tx_ldpc;
  2661. /* Number of tx rts packets */
  2662. A_UINT32 rts_cnt;
  2663. /* RSSI value of last ack packet (units = dB above noise floor) */
  2664. A_UINT32 ack_rssi;
  2665. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2666. /* tx_xx_mcs: currently unused */
  2667. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2668. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2669. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2670. 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 */
  2671. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2672. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2673. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  2674. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2675. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  2676. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  2677. /* Number of CTS-acknowledged RTS packets */
  2678. A_UINT32 rts_success;
  2679. /*
  2680. * Counters for legacy 11a and 11b transmissions.
  2681. *
  2682. * The index corresponds to:
  2683. *
  2684. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  2685. *
  2686. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  2687. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  2688. */
  2689. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  2690. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  2691. A_UINT32 ac_mu_mimo_tx_ldpc;
  2692. A_UINT32 ax_mu_mimo_tx_ldpc;
  2693. A_UINT32 ofdma_tx_ldpc;
  2694. /*
  2695. * Counters for 11ax HE LTF selection during TX.
  2696. *
  2697. * The index corresponds to:
  2698. *
  2699. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  2700. */
  2701. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  2702. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2703. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2704. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2705. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2706. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2707. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2708. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2709. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2710. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2711. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2712. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2713. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  2714. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  2715. A_UINT32 tx_11ax_su_ext;
  2716. } htt_tx_pdev_rate_stats_tlv;
  2717. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  2718. * TLV_TAGS:
  2719. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  2720. */
  2721. /* NOTE:
  2722. * This structure is for documentation, and cannot be safely used directly.
  2723. * Instead, use the constituent TLV structures to fill/parse.
  2724. */
  2725. typedef struct {
  2726. htt_tx_pdev_rate_stats_tlv rate_tlv;
  2727. } htt_tx_pdev_rate_stats_t;
  2728. /* == PDEV RX RATE CTRL STATS == */
  2729. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  2730. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  2731. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12
  2732. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  2733. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  2734. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  2735. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  2736. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  2737. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  2738. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  2739. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  2740. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  2741. /*HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  2742. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  2743. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  2744. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  2745. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  2746. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  2747. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  2748. */
  2749. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  2750. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  2751. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  2752. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  2753. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  2754. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  2755. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  2756. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  2757. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  2758. */
  2759. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  2760. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  2761. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  2762. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  2763. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  2764. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  2765. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  2768. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  2769. } while (0)
  2770. typedef struct {
  2771. htt_tlv_hdr_t tlv_hdr;
  2772. /* BIT [ 7 : 0] :- mac_id
  2773. * BIT [31 : 8] :- reserved
  2774. */
  2775. A_UINT32 mac_id__word;
  2776. A_UINT32 nsts;
  2777. /* Number of rx ldpc packets */
  2778. A_UINT32 rx_ldpc;
  2779. /* Number of rx rts packets */
  2780. A_UINT32 rts_cnt;
  2781. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  2782. A_UINT32 rssi_data; /* units = dB above noise floor */
  2783. A_UINT32 rssi_comb; /* units = dB above noise floor */
  2784. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2785. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  2786. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  2787. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2788. 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 */
  2789. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  2790. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  2791. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  2792. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2793. A_INT32 rssi_in_dbm; /* rx Signal Strength value in dBm unit */
  2794. A_UINT32 rx_11ax_su_ext;
  2795. A_UINT32 rx_11ac_mumimo;
  2796. A_UINT32 rx_11ax_mumimo;
  2797. A_UINT32 rx_11ax_ofdma;
  2798. A_UINT32 txbf;
  2799. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  2800. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  2801. A_UINT32 rx_active_dur_us_low;
  2802. A_UINT32 rx_active_dur_us_high;
  2803. A_UINT32 rx_11ax_ul_ofdma;
  2804. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2805. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2806. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2807. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  2808. A_UINT32 ul_ofdma_rx_stbc;
  2809. A_UINT32 ul_ofdma_rx_ldpc;
  2810. /* record the stats for each user index */
  2811. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* ppdu level */
  2812. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* ppdu level */
  2813. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* mpdu level */
  2814. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* mpdu level */
  2815. A_UINT32 nss_count;
  2816. A_UINT32 pilot_count;
  2817. /* RxEVM stats in dB */
  2818. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  2819. /* rx_pilot_evm_dB_mean:
  2820. * EVM mean across pilots, computed as
  2821. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  2822. */
  2823. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2824. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */
  2825. /* per_chain_rssi_pkt_type:
  2826. * This field shows what type of rx frame the per-chain RSSI was computed
  2827. * on, by recording the frame type and sub-type as bit-fields within this
  2828. * field:
  2829. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  2830. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  2831. * BIT [31 : 8] :- Reserved
  2832. */
  2833. A_UINT32 per_chain_rssi_pkt_type;
  2834. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  2835. A_UINT32 rx_su_ndpa;
  2836. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2837. A_UINT32 rx_mu_ndpa;
  2838. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2839. A_UINT32 rx_br_poll;
  2840. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2841. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  2842. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER]; /* ppdu level */
  2843. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER]; /* ppdu level */
  2844. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER]; /* mpdu level */
  2845. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER]; /* mpdu level */
  2846. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  2847. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  2848. } htt_rx_pdev_rate_stats_tlv;
  2849. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  2850. * TLV_TAGS:
  2851. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  2852. */
  2853. /* NOTE:
  2854. * This structure is for documentation, and cannot be safely used directly.
  2855. * Instead, use the constituent TLV structures to fill/parse.
  2856. */
  2857. typedef struct {
  2858. htt_rx_pdev_rate_stats_tlv rate_tlv;
  2859. } htt_rx_pdev_rate_stats_t;
  2860. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  2861. #define HTT_STATS_CMN_MAC_ID_S 0
  2862. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  2863. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  2864. HTT_STATS_CMN_MAC_ID_S)
  2865. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  2866. do { \
  2867. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  2868. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  2869. } while (0)
  2870. typedef struct {
  2871. htt_tlv_hdr_t tlv_hdr;
  2872. /* BIT [ 7 : 0] :- mac_id
  2873. * BIT [31 : 8] :- reserved
  2874. */
  2875. A_UINT32 mac_id__word;
  2876. A_UINT32 rx_11ax_ul_ofdma;
  2877. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2878. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2879. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  2880. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  2881. A_UINT32 ul_ofdma_rx_stbc;
  2882. A_UINT32 ul_ofdma_rx_ldpc;
  2883. /*
  2884. * These are arrays to hold the number of PPDUs that we received per RU.
  2885. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  2886. * array offset 0 and similarly RU52 will be incremented in array offset 1
  2887. */
  2888. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  2889. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  2890. } htt_rx_pdev_ul_trigger_stats_tlv;
  2891. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  2892. * TLV_TAGS:
  2893. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  2894. * NOTE:
  2895. * This structure is for documentation, and cannot be safely used directly.
  2896. * Instead, use the constituent TLV structures to fill/parse.
  2897. */
  2898. typedef struct {
  2899. htt_rx_pdev_ul_trigger_stats_tlv ul_trigger_tlv;
  2900. } htt_rx_pdev_ul_trigger_stats_t;
  2901. typedef struct {
  2902. htt_tlv_hdr_t tlv_hdr;
  2903. A_UINT32 user_index;
  2904. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  2905. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  2906. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  2907. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  2908. A_UINT32 rx_ulofdma_non_data_nusers;
  2909. A_UINT32 rx_ulofdma_data_nusers;
  2910. } htt_rx_pdev_ul_ofdma_user_stats_tlv;
  2911. typedef struct {
  2912. htt_tlv_hdr_t tlv_hdr;
  2913. A_UINT32 user_index;
  2914. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  2915. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  2916. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  2917. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  2918. } htt_rx_pdev_ul_mimo_user_stats_tlv;
  2919. /* == RX PDEV/SOC STATS == */
  2920. typedef struct {
  2921. htt_tlv_hdr_t tlv_hdr;
  2922. /*
  2923. * BIT [7:0] :- mac_id
  2924. * BIT [31:8] :- reserved
  2925. *
  2926. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  2927. */
  2928. A_UINT32 mac_id__word;
  2929. A_UINT32 rx_11ax_ul_mumimo;
  2930. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2931. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  2932. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  2933. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  2934. A_UINT32 ul_mumimo_rx_stbc;
  2935. A_UINT32 ul_mumimo_rx_ldpc;
  2936. } htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  2937. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  2938. * TLV_TAGS:
  2939. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  2940. */
  2941. typedef struct {
  2942. htt_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  2943. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  2944. typedef struct {
  2945. htt_tlv_hdr_t tlv_hdr;
  2946. /* Num Packets received on REO FW ring */
  2947. A_UINT32 fw_reo_ring_data_msdu;
  2948. /* Num bc/mc packets indicated from fw to host */
  2949. A_UINT32 fw_to_host_data_msdu_bcmc;
  2950. /* Num unicast packets indicated from fw to host */
  2951. A_UINT32 fw_to_host_data_msdu_uc;
  2952. /* Num remote buf recycle from offload */
  2953. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  2954. /* Num remote free buf given to offload */
  2955. A_UINT32 ofld_remote_free_buf_indication_cnt;
  2956. /* Num unicast packets from local path indicated to host */
  2957. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  2958. /* Num unicast packets from REO indicated to host */
  2959. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  2960. /* Num Packets received from WBM SW1 ring */
  2961. A_UINT32 wbm_sw_ring_reap;
  2962. /* Num packets from WBM forwarded from fw to host via WBM */
  2963. A_UINT32 wbm_forward_to_host_cnt;
  2964. /* Num packets from WBM recycled to target refill ring */
  2965. A_UINT32 wbm_target_recycle_cnt;
  2966. /* Total Num of recycled to refill ring, including packets from WBM and REO */
  2967. A_UINT32 target_refill_ring_recycle_cnt;
  2968. } htt_rx_soc_fw_stats_tlv;
  2969. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2970. /* NOTE: Variable length TLV, use length spec to infer array size */
  2971. typedef struct {
  2972. htt_tlv_hdr_t tlv_hdr;
  2973. /* Num ring empty encountered */
  2974. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2975. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  2976. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2977. /* NOTE: Variable length TLV, use length spec to infer array size */
  2978. typedef struct {
  2979. htt_tlv_hdr_t tlv_hdr;
  2980. /* Num total buf refilled from refill ring */
  2981. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2982. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  2983. /* RXDMA error code from WBM released packets */
  2984. typedef enum {
  2985. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  2986. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  2987. HTT_RX_RXDMA_FCS_ERR = 2,
  2988. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  2989. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  2990. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  2991. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  2992. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  2993. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  2994. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  2995. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  2996. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  2997. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  2998. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  2999. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  3000. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  3001. /*
  3002. * This MAX_ERR_CODE should not be used in any host/target messages,
  3003. * so that even though it is defined within a host/target interface
  3004. * definition header file, it isn't actually part of the host/target
  3005. * interface, and thus can be modified.
  3006. */
  3007. HTT_RX_RXDMA_MAX_ERR_CODE
  3008. } htt_rx_rxdma_error_code_enum;
  3009. /* NOTE: Variable length TLV, use length spec to infer array size */
  3010. typedef struct {
  3011. htt_tlv_hdr_t tlv_hdr;
  3012. /* NOTE:
  3013. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  3014. * It is expected but not required that the target will provide a rxdma_err element
  3015. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  3016. * MAX_ERR_CODE. The host should ignore any array elements whose
  3017. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3018. */
  3019. A_UINT32 rxdma_err[1]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
  3020. } htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  3021. /* REO error code from WBM released packets */
  3022. typedef enum {
  3023. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  3024. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  3025. HTT_RX_AMPDU_IN_NON_BA = 2,
  3026. HTT_RX_NON_BA_DUPLICATE = 3,
  3027. HTT_RX_BA_DUPLICATE = 4,
  3028. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  3029. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  3030. HTT_RX_REGULAR_FRAME_OOR = 7,
  3031. HTT_RX_BAR_FRAME_OOR = 8,
  3032. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  3033. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  3034. HTT_RX_PN_CHECK_FAILED = 11,
  3035. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  3036. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  3037. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  3038. HTT_RX_REO_ERR_CODE_RVSD = 15,
  3039. /*
  3040. * This MAX_ERR_CODE should not be used in any host/target messages,
  3041. * so that even though it is defined within a host/target interface
  3042. * definition header file, it isn't actually part of the host/target
  3043. * interface, and thus can be modified.
  3044. */
  3045. HTT_RX_REO_MAX_ERR_CODE
  3046. } htt_rx_reo_error_code_enum;
  3047. /* NOTE: Variable length TLV, use length spec to infer array size */
  3048. typedef struct {
  3049. htt_tlv_hdr_t tlv_hdr;
  3050. /* NOTE:
  3051. * The mapping of REO error types to reo_err array elements is HW dependent.
  3052. * It is expected but not required that the target will provide a rxdma_err element
  3053. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  3054. * MAX_ERR_CODE. The host should ignore any array elements whose
  3055. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3056. */
  3057. A_UINT32 reo_err[1]; /* HTT_RX_REO_MAX_ERR_CODE */
  3058. } htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  3059. /* NOTE:
  3060. * This structure is for documentation, and cannot be safely used directly.
  3061. * Instead, use the constituent TLV structures to fill/parse.
  3062. */
  3063. typedef struct {
  3064. htt_rx_soc_fw_stats_tlv fw_tlv;
  3065. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  3066. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  3067. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v fw_refill_ring_num_rxdma_err_tlv;
  3068. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v fw_refill_ring_num_reo_err_tlv;
  3069. } htt_rx_soc_stats_t;
  3070. /* == RX PDEV STATS == */
  3071. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  3072. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  3073. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  3074. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  3075. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  3076. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  3077. do { \
  3078. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  3079. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  3080. } while (0)
  3081. #define HTT_STATS_SUBTYPE_MAX 16
  3082. typedef struct {
  3083. htt_tlv_hdr_t tlv_hdr;
  3084. /* BIT [ 7 : 0] :- mac_id
  3085. * BIT [31 : 8] :- reserved
  3086. */
  3087. A_UINT32 mac_id__word;
  3088. /* Num PPDU status processed from HW */
  3089. A_UINT32 ppdu_recvd;
  3090. /* Num MPDU across PPDUs with FCS ok */
  3091. A_UINT32 mpdu_cnt_fcs_ok;
  3092. /* Num MPDU across PPDUs with FCS err */
  3093. A_UINT32 mpdu_cnt_fcs_err;
  3094. /* Num MSDU across PPDUs */
  3095. A_UINT32 tcp_msdu_cnt;
  3096. /* Num MSDU across PPDUs */
  3097. A_UINT32 tcp_ack_msdu_cnt;
  3098. /* Num MSDU across PPDUs */
  3099. A_UINT32 udp_msdu_cnt;
  3100. /* Num MSDU across PPDUs */
  3101. A_UINT32 other_msdu_cnt;
  3102. /* Num MPDU on FW ring indicated */
  3103. A_UINT32 fw_ring_mpdu_ind;
  3104. /* Num MGMT MPDU given to protocol */
  3105. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  3106. /* Num ctrl MPDU given to protocol */
  3107. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  3108. /* Num mcast data packet received */
  3109. A_UINT32 fw_ring_mcast_data_msdu;
  3110. /* Num broadcast data packet received */
  3111. A_UINT32 fw_ring_bcast_data_msdu;
  3112. /* Num unicat data packet received */
  3113. A_UINT32 fw_ring_ucast_data_msdu;
  3114. /* Num null data packet received */
  3115. A_UINT32 fw_ring_null_data_msdu;
  3116. /* Num MPDU on FW ring dropped */
  3117. A_UINT32 fw_ring_mpdu_drop;
  3118. /* Num buf indication to offload */
  3119. A_UINT32 ofld_local_data_ind_cnt;
  3120. /* Num buf recycle from offload */
  3121. A_UINT32 ofld_local_data_buf_recycle_cnt;
  3122. /* Num buf indication to data_rx */
  3123. A_UINT32 drx_local_data_ind_cnt;
  3124. /* Num buf recycle from data_rx */
  3125. A_UINT32 drx_local_data_buf_recycle_cnt;
  3126. /* Num buf indication to protocol */
  3127. A_UINT32 local_nondata_ind_cnt;
  3128. /* Num buf recycle from protocol */
  3129. A_UINT32 local_nondata_buf_recycle_cnt;
  3130. /* Num buf fed */
  3131. A_UINT32 fw_status_buf_ring_refill_cnt;
  3132. /* Num ring empty encountered */
  3133. A_UINT32 fw_status_buf_ring_empty_cnt;
  3134. /* Num buf fed */
  3135. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  3136. /* Num ring empty encountered */
  3137. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  3138. /* Num buf fed */
  3139. A_UINT32 fw_link_buf_ring_refill_cnt;
  3140. /* Num ring empty encountered */
  3141. A_UINT32 fw_link_buf_ring_empty_cnt;
  3142. /* Num buf fed */
  3143. A_UINT32 host_pkt_buf_ring_refill_cnt;
  3144. /* Num ring empty encountered */
  3145. A_UINT32 host_pkt_buf_ring_empty_cnt;
  3146. /* Num buf fed */
  3147. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  3148. /* Num ring empty encountered */
  3149. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  3150. /* Num buf fed */
  3151. A_UINT32 mon_status_buf_ring_refill_cnt;
  3152. /* Num ring empty encountered */
  3153. A_UINT32 mon_status_buf_ring_empty_cnt;
  3154. /* Num buf fed */
  3155. A_UINT32 mon_desc_buf_ring_refill_cnt;
  3156. /* Num ring empty encountered */
  3157. A_UINT32 mon_desc_buf_ring_empty_cnt;
  3158. /* Num buf fed */
  3159. A_UINT32 mon_dest_ring_update_cnt;
  3160. /* Num ring full encountered */
  3161. A_UINT32 mon_dest_ring_full_cnt;
  3162. /* Num rx suspend is attempted */
  3163. A_UINT32 rx_suspend_cnt;
  3164. /* Num rx suspend failed */
  3165. A_UINT32 rx_suspend_fail_cnt;
  3166. /* Num rx resume attempted */
  3167. A_UINT32 rx_resume_cnt;
  3168. /* Num rx resume failed */
  3169. A_UINT32 rx_resume_fail_cnt;
  3170. /* Num rx ring switch */
  3171. A_UINT32 rx_ring_switch_cnt;
  3172. /* Num rx ring restore */
  3173. A_UINT32 rx_ring_restore_cnt;
  3174. /* Num rx flush issued */
  3175. A_UINT32 rx_flush_cnt;
  3176. /* Num rx recovery */
  3177. A_UINT32 rx_recovery_reset_cnt;
  3178. } htt_rx_pdev_fw_stats_tlv;
  3179. #define HTT_STATS_PHY_ERR_MAX 43
  3180. typedef struct {
  3181. htt_tlv_hdr_t tlv_hdr;
  3182. /* BIT [ 7 : 0] :- mac_id
  3183. * BIT [31 : 8] :- reserved
  3184. */
  3185. A_UINT32 mac_id__word;
  3186. /* Num of phy err */
  3187. A_UINT32 total_phy_err_cnt;
  3188. /* Counts of different types of phy errs
  3189. * The mapping of PHY error types to phy_err array elements is HW dependent.
  3190. * The only currently-supported mapping is shown below:
  3191. *
  3192. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  3193. * 1 phyrx_err_synth_off
  3194. * 2 phyrx_err_ofdma_timing
  3195. * 3 phyrx_err_ofdma_signal_parity
  3196. * 4 phyrx_err_ofdma_rate_illegal
  3197. * 5 phyrx_err_ofdma_length_illegal
  3198. * 6 phyrx_err_ofdma_restart
  3199. * 7 phyrx_err_ofdma_service
  3200. * 8 phyrx_err_ppdu_ofdma_power_drop
  3201. * 9 phyrx_err_cck_blokker
  3202. * 10 phyrx_err_cck_timing
  3203. * 11 phyrx_err_cck_header_crc
  3204. * 12 phyrx_err_cck_rate_illegal
  3205. * 13 phyrx_err_cck_length_illegal
  3206. * 14 phyrx_err_cck_restart
  3207. * 15 phyrx_err_cck_service
  3208. * 16 phyrx_err_cck_power_drop
  3209. * 17 phyrx_err_ht_crc_err
  3210. * 18 phyrx_err_ht_length_illegal
  3211. * 19 phyrx_err_ht_rate_illegal
  3212. * 20 phyrx_err_ht_zlf
  3213. * 21 phyrx_err_false_radar_ext
  3214. * 22 phyrx_err_green_field
  3215. * 23 phyrx_err_bw_gt_dyn_bw
  3216. * 24 phyrx_err_leg_ht_mismatch
  3217. * 25 phyrx_err_vht_crc_error
  3218. * 26 phyrx_err_vht_siga_unsupported
  3219. * 27 phyrx_err_vht_lsig_len_invalid
  3220. * 28 phyrx_err_vht_ndp_or_zlf
  3221. * 29 phyrx_err_vht_nsym_lt_zero
  3222. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  3223. * 31 phyrx_err_vht_rx_skip_group_id0
  3224. * 32 phyrx_err_vht_rx_skip_group_id1to62
  3225. * 33 phyrx_err_vht_rx_skip_group_id63
  3226. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  3227. * 35 phyrx_err_defer_nap
  3228. * 36 phyrx_err_fdomain_timeout
  3229. * 37 phyrx_err_lsig_rel_check
  3230. * 38 phyrx_err_bt_collision
  3231. * 39 phyrx_err_unsupported_mu_feedback
  3232. * 40 phyrx_err_ppdu_tx_interrupt_rx
  3233. * 41 phyrx_err_unsupported_cbf
  3234. * 42 phyrx_err_other
  3235. */
  3236. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  3237. } htt_rx_pdev_fw_stats_phy_err_tlv;
  3238. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3239. /* NOTE: Variable length TLV, use length spec to infer array size */
  3240. typedef struct {
  3241. htt_tlv_hdr_t tlv_hdr;
  3242. /* Num error MPDU for each RxDMA error type */
  3243. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  3244. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  3245. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3246. /* NOTE: Variable length TLV, use length spec to infer array size */
  3247. typedef struct {
  3248. htt_tlv_hdr_t tlv_hdr;
  3249. /* Num MPDU dropped */
  3250. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  3251. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  3252. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  3253. * TLV_TAGS:
  3254. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  3255. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  3256. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  3257. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  3258. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  3259. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  3260. */
  3261. /* NOTE:
  3262. * This structure is for documentation, and cannot be safely used directly.
  3263. * Instead, use the constituent TLV structures to fill/parse.
  3264. */
  3265. typedef struct {
  3266. htt_rx_soc_stats_t soc_stats;
  3267. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  3268. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  3269. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  3270. htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  3271. } htt_rx_pdev_stats_t;
  3272. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  3273. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  3274. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  3275. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  3276. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  3277. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  3278. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  3279. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  3280. typedef struct {
  3281. htt_tlv_hdr_t tlv_hdr;
  3282. /* Below values are obtained from the HW Cycles counter registers */
  3283. A_UINT32 tx_frame_usec;
  3284. A_UINT32 rx_frame_usec;
  3285. A_UINT32 rx_clear_usec;
  3286. A_UINT32 my_rx_frame_usec;
  3287. A_UINT32 usec_cnt;
  3288. A_UINT32 med_rx_idle_usec;
  3289. A_UINT32 med_tx_idle_global_usec;
  3290. A_UINT32 cca_obss_usec;
  3291. } htt_pdev_stats_cca_counters_tlv;
  3292. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  3293. * due to lack of support in some host stats infrastructures for
  3294. * TLVs nested within TLVs.
  3295. */
  3296. typedef struct {
  3297. htt_tlv_hdr_t tlv_hdr;
  3298. /* The channel number on which these stats were collected */
  3299. A_UINT32 chan_num;
  3300. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  3301. A_UINT32 num_records;
  3302. /*
  3303. * Bit map of valid CCA counters
  3304. * Bit0 - tx_frame_usec
  3305. * Bit1 - rx_frame_usec
  3306. * Bit2 - rx_clear_usec
  3307. * Bit3 - my_rx_frame_usec
  3308. * bit4 - usec_cnt
  3309. * Bit5 - med_rx_idle_usec
  3310. * Bit6 - med_tx_idle_global_usec
  3311. * Bit7 - cca_obss_usec
  3312. *
  3313. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  3314. */
  3315. A_UINT32 valid_cca_counters_bitmap;
  3316. /* Indicates the stats collection interval
  3317. * Valid Values:
  3318. * 100 - For the 100ms interval CCA stats histogram
  3319. * 1000 - For 1sec interval CCA histogram
  3320. * 0xFFFFFFFF - For Cumulative CCA Stats
  3321. */
  3322. A_UINT32 collection_interval;
  3323. /**
  3324. * This will be followed by an array which contains the CCA stats
  3325. * collected in the last N intervals,
  3326. * if the indication is for last N intervals CCA stats.
  3327. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  3328. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  3329. */
  3330. htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  3331. } htt_pdev_cca_stats_hist_tlv;
  3332. typedef struct {
  3333. htt_tlv_hdr_t tlv_hdr;
  3334. /* The channel number on which these stats were collected */
  3335. A_UINT32 chan_num;
  3336. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  3337. A_UINT32 num_records;
  3338. /*
  3339. * Bit map of valid CCA counters
  3340. * Bit0 - tx_frame_usec
  3341. * Bit1 - rx_frame_usec
  3342. * Bit2 - rx_clear_usec
  3343. * Bit3 - my_rx_frame_usec
  3344. * bit4 - usec_cnt
  3345. * Bit5 - med_rx_idle_usec
  3346. * Bit6 - med_tx_idle_global_usec
  3347. * Bit7 - cca_obss_usec
  3348. *
  3349. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  3350. */
  3351. A_UINT32 valid_cca_counters_bitmap;
  3352. /* Indicates the stats collection interval
  3353. * Valid Values:
  3354. * 100 - For the 100ms interval CCA stats histogram
  3355. * 1000 - For 1sec interval CCA histogram
  3356. * 0xFFFFFFFF - For Cumulative CCA Stats
  3357. */
  3358. A_UINT32 collection_interval;
  3359. /**
  3360. * This will be followed by an array which contains the CCA stats
  3361. * collected in the last N intervals,
  3362. * if the indication is for last N intervals CCA stats.
  3363. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  3364. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  3365. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  3366. */
  3367. } htt_pdev_cca_stats_hist_v1_tlv;
  3368. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000ffff
  3369. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  3370. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  3371. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  3372. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  3373. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  3374. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  3375. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  3376. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  3377. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  3378. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  3379. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  3382. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  3383. } while (0)
  3384. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  3385. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  3386. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  3387. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  3388. do { \
  3389. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  3390. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  3391. } while (0)
  3392. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  3393. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  3394. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  3395. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  3396. do { \
  3397. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  3398. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  3399. } while (0)
  3400. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  3401. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  3402. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  3403. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  3404. do { \
  3405. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  3406. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  3407. } while (0)
  3408. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  3409. typedef struct {
  3410. htt_tlv_hdr_t tlv_hdr;
  3411. A_UINT32 vdev_id;
  3412. htt_mac_addr peer_mac;
  3413. A_UINT32 flow_id_flags;
  3414. A_UINT32 dialog_id; /* TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is not initiated by host */
  3415. A_UINT32 wake_dura_us;
  3416. A_UINT32 wake_intvl_us;
  3417. A_UINT32 sp_offset_us;
  3418. } htt_pdev_stats_twt_session_tlv;
  3419. typedef struct {
  3420. htt_tlv_hdr_t tlv_hdr;
  3421. A_UINT32 pdev_id;
  3422. A_UINT32 num_sessions;
  3423. htt_pdev_stats_twt_session_tlv twt_session[1];
  3424. } htt_pdev_stats_twt_sessions_tlv;
  3425. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  3426. * TLV_TAGS:
  3427. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  3428. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  3429. */
  3430. /* NOTE:
  3431. * This structure is for documentation, and cannot be safely used directly.
  3432. * Instead, use the constituent TLV structures to fill/parse.
  3433. */
  3434. typedef struct {
  3435. htt_pdev_stats_twt_sessions_tlv twt_sessions[1];
  3436. } htt_pdev_twt_sessions_stats_t;
  3437. typedef enum {
  3438. /* Global link descriptor queued in REO */
  3439. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  3440. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  3441. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  3442. /*Number of queue descriptors of this aging group */
  3443. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  3444. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  3445. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  3446. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  3447. /* Total number of MSDUs buffered in AC */
  3448. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  3449. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  3450. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  3451. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  3452. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  3453. } htt_rx_reo_resource_sample_id_enum;
  3454. typedef struct {
  3455. htt_tlv_hdr_t tlv_hdr;
  3456. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  3457. /* htt_rx_reo_debug_sample_id_enum */
  3458. A_UINT32 sample_id;
  3459. /* Max value of all samples */
  3460. A_UINT32 total_max;
  3461. /* Average value of total samples */
  3462. A_UINT32 total_avg;
  3463. /* Num of samples including both zeros and non zeros ones*/
  3464. A_UINT32 total_sample;
  3465. /* Average value of all non zeros samples */
  3466. A_UINT32 non_zeros_avg;
  3467. /* Num of non zeros samples */
  3468. A_UINT32 non_zeros_sample;
  3469. /* Max value of last N non zero samples (N = last_non_zeros_sample) */
  3470. A_UINT32 last_non_zeros_max;
  3471. /* Min value of last N non zero samples (N = last_non_zeros_sample) */
  3472. A_UINT32 last_non_zeros_min;
  3473. /* Average value of last N non zero samples (N = last_non_zeros_sample) */
  3474. A_UINT32 last_non_zeros_avg;
  3475. /* Num of last non zero samples */
  3476. A_UINT32 last_non_zeros_sample;
  3477. } htt_rx_reo_resource_stats_tlv_v;
  3478. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  3479. * TLV_TAGS:
  3480. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  3481. */
  3482. /* NOTE:
  3483. * This structure is for documentation, and cannot be safely used directly.
  3484. * Instead, use the constituent TLV structures to fill/parse.
  3485. */
  3486. typedef struct {
  3487. htt_rx_reo_resource_stats_tlv_v reo_resource_stats;
  3488. } htt_soc_reo_resource_stats_t;
  3489. /* == TX SOUNDING STATS == */
  3490. /* config_param0 */
  3491. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  3492. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  3493. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  3494. typedef enum {
  3495. /* Implicit beamforming stats */
  3496. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  3497. /* Single user short inter frame sequence steer stats */
  3498. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  3499. /* Single user random back off steer stats */
  3500. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  3501. /* Multi user short inter frame sequence steer stats */
  3502. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  3503. /* Multi user random back off steer stats */
  3504. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  3505. /* For backward compatability new modes cannot be added */
  3506. HTT_TXBF_MAX_NUM_OF_MODES = 5
  3507. } htt_txbf_sound_steer_modes;
  3508. typedef enum {
  3509. HTT_TX_AC_SOUNDING_MODE = 0,
  3510. HTT_TX_AX_SOUNDING_MODE = 1,
  3511. } htt_stats_sounding_tx_mode;
  3512. typedef struct {
  3513. htt_tlv_hdr_t tlv_hdr;
  3514. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  3515. /* Counts number of soundings for all steering modes in each bw */
  3516. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  3517. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  3518. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  3519. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  3520. /*
  3521. * The sounding array is a 2-D array stored as an 1-D array of
  3522. * A_UINT32. The stats for a particular user/bw combination is
  3523. * referenced with the following:
  3524. *
  3525. * sounding[(user* max_bw) + bw]
  3526. *
  3527. * ... where max_bw == 4 for 160mhz
  3528. */
  3529. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  3530. } htt_tx_sounding_stats_tlv;
  3531. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  3532. * TLV_TAGS:
  3533. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  3534. */
  3535. /* NOTE:
  3536. * This structure is for documentation, and cannot be safely used directly.
  3537. * Instead, use the constituent TLV structures to fill/parse.
  3538. */
  3539. typedef struct {
  3540. htt_tx_sounding_stats_tlv sounding_tlv;
  3541. } htt_tx_sounding_stats_t;
  3542. typedef struct {
  3543. htt_tlv_hdr_t tlv_hdr;
  3544. A_UINT32 num_obss_tx_ppdu_success;
  3545. A_UINT32 num_obss_tx_ppdu_failure;
  3546. /* num_sr_tx_transmissions:
  3547. * Counter of TX done by aborting other BSS RX with spatial reuse
  3548. * (for cases where rx RSSI from other BSS is below the packet-detection
  3549. * threshold for doing spatial reuse)
  3550. */
  3551. union {
  3552. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  3553. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  3554. };
  3555. /* num_sr_rx_ge_pd_rssi_thr
  3556. * counter of rx from other BSS for which RSSI was above the
  3557. * packet-detection threshold specified for enabling spatial reuse
  3558. */
  3559. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  3560. } htt_pdev_obss_pd_stats_tlv;
  3561. /* NOTE:
  3562. * This structure is for documentation, and cannot be safely used directly.
  3563. * Instead, use the constituent TLV structures to fill/parse.
  3564. */
  3565. typedef struct {
  3566. htt_pdev_obss_pd_stats_tlv obss_pd_stat;
  3567. } htt_pdev_obss_pd_stats_t;
  3568. typedef struct {
  3569. htt_tlv_hdr_t tlv_hdr;
  3570. A_UINT32 pdev_id;
  3571. A_UINT32 current_head_idx;
  3572. A_UINT32 current_tail_idx;
  3573. A_UINT32 num_htt_msgs_sent;
  3574. /*
  3575. * Time in milliseconds for which the ring has been in
  3576. * its current backpressure condition
  3577. */
  3578. A_UINT32 backpressure_time_ms;
  3579. /* backpressure_hist - histogram showing how many times different degrees
  3580. * of backpressure duration occurred:
  3581. * Index 0 indicates the number of times ring was
  3582. * continously in backpressure state for 100 - 200ms.
  3583. * Index 1 indicates the number of times ring was
  3584. * continously in backpressure state for 200 - 300ms.
  3585. * Index 2 indicates the number of times ring was
  3586. * continously in backpressure state for 300 - 400ms.
  3587. * Index 3 indicates the number of times ring was
  3588. * continously in backpressure state for 400 - 500ms.
  3589. * Index 4 indicates the number of times ring was
  3590. * continously in backpressure state beyond 500ms.
  3591. */
  3592. A_UINT32 backpressure_hist[5];
  3593. } htt_ring_backpressure_stats_tlv;
  3594. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  3595. * TLV_TAGS:
  3596. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  3597. */
  3598. /* NOTE:
  3599. * This structure is for documentation, and cannot be safely used directly.
  3600. * Instead, use the constituent TLV structures to fill/parse.
  3601. */
  3602. typedef struct {
  3603. htt_sring_cmn_tlv cmn_tlv;
  3604. struct {
  3605. htt_stats_string_tlv sring_str_tlv;
  3606. htt_ring_backpressure_stats_tlv backpressure_stats_tlv;
  3607. } r[1]; /* variable-length array */
  3608. } htt_ring_backpressure_stats_t;
  3609. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  3610. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  3611. typedef struct {
  3612. htt_tlv_hdr_t tlv_hdr;
  3613. /* print_header:
  3614. * This field suggests whether the host should print a header when
  3615. * displaying the TLV (because this is the first latency_prof_stats
  3616. * TLV within a series), or if only the TLV contents should be displayed
  3617. * without a header (because this is not the first TLV within the series).
  3618. */
  3619. A_UINT32 print_header;
  3620. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  3621. A_UINT32 cnt; /* number of data values included in the tot sum */
  3622. A_UINT32 min; /* time in us */
  3623. A_UINT32 max; /* time in us */
  3624. A_UINT32 last;
  3625. A_UINT32 tot; /* time in us */
  3626. A_UINT32 avg; /* time in us */
  3627. /* hist_intvl:
  3628. * Histogram interval, i.e. the latency range covered by each
  3629. * bin of the histogram, in microsecond units.
  3630. * hist[0] counts how many latencies were between 0 to hist_intvl
  3631. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  3632. * hist[2] counts how many latencies were more than 2*hist_intvl
  3633. */
  3634. A_UINT32 hist_intvl;
  3635. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  3636. } htt_latency_prof_stats_tlv;
  3637. typedef struct {
  3638. htt_tlv_hdr_t tlv_hdr;
  3639. /* duration:
  3640. * Time period over which counts were gathered, units = microseconds.
  3641. */
  3642. A_UINT32 duration;
  3643. A_UINT32 tx_msdu_cnt;
  3644. A_UINT32 tx_mpdu_cnt;
  3645. A_UINT32 tx_ppdu_cnt;
  3646. A_UINT32 rx_msdu_cnt;
  3647. A_UINT32 rx_mpdu_cnt;
  3648. } htt_latency_prof_ctx_tlv;
  3649. typedef struct {
  3650. htt_tlv_hdr_t tlv_hdr;
  3651. A_UINT32 prof_enable_cnt; /* count of enabled profiles */
  3652. } htt_latency_prof_cnt_tlv;
  3653. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  3654. * TLV_TAGS:
  3655. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  3656. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  3657. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  3658. */
  3659. /* NOTE:
  3660. * This structure is for documentation, and cannot be safely used directly.
  3661. * Instead, use the constituent TLV structures to fill/parse.
  3662. */
  3663. typedef struct {
  3664. htt_latency_prof_stats_tlv latency_prof_stat;
  3665. htt_latency_prof_ctx_tlv latency_ctx_stat;
  3666. htt_latency_prof_cnt_tlv latency_cnt_stat;
  3667. } htt_soc_latency_stats_t;
  3668. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  3669. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  3670. #define HTT_RX_SQUARE_INDEX 6
  3671. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  3672. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  3673. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  3674. * TLV_TAGS:
  3675. * - HTT_STATS_RX_FSE_STATS_TAG
  3676. */
  3677. typedef struct {
  3678. htt_tlv_hdr_t tlv_hdr;
  3679. /*
  3680. * Number of times host requested for fse enable/disable
  3681. */
  3682. A_UINT32 fse_enable_cnt;
  3683. A_UINT32 fse_disable_cnt;
  3684. /*
  3685. * Number of times host requested for fse cache invalidation
  3686. * individual entries or full cache
  3687. */
  3688. A_UINT32 fse_cache_invalidate_entry_cnt;
  3689. A_UINT32 fse_full_cache_invalidate_cnt;
  3690. /*
  3691. * Cache hits count will increase if there is a matching flow in the cache
  3692. * There is no register for cache miss but the number of cache misses can
  3693. * be calculated as
  3694. * cache miss = (num_searches - cache_hits)
  3695. * Thus, there is no need to have a separate variable for cache misses.
  3696. * Num searches is flow search times done in the cache.
  3697. */
  3698. A_UINT32 fse_num_cache_hits_cnt;
  3699. A_UINT32 fse_num_searches_cnt;
  3700. /**
  3701. * Cache Occupancy holds 2 types of values: Peak and Current.
  3702. * 10 bins are used to keep track of peak occupancy.
  3703. * 8 of these bins represent ranges of values, while the first and last
  3704. * bins represent the extreme cases of the cache being completely empty
  3705. * or completely full.
  3706. * For the non-extreme bins, the number of cache occupancy values per
  3707. * bin is the maximum cache occupancy (128), divided by the number of
  3708. * non-extreme bins (8), so 128/8 = 16 values per bin.
  3709. * The range of values for each histogram bins is specified below:
  3710. * Bin0 = Counter increments when cache occupancy is empty
  3711. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  3712. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  3713. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  3714. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  3715. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  3716. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  3717. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  3718. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  3719. * Bin9 = Counter increments when cache occupancy is equal to 128
  3720. * The above histogram bin definitions apply to both the peak-occupancy
  3721. * histogram and the current-occupancy histogram.
  3722. *
  3723. * @fse_cache_occupancy_peak_cnt:
  3724. * Array records periodically PEAK cache occupancy values.
  3725. * Peak Occupancy will increment only if it is greater than current
  3726. * occupancy value.
  3727. *
  3728. * @fse_cache_occupancy_curr_cnt:
  3729. * Array records periodically current cache occupancy value.
  3730. * Current Cache occupancy always holds instant snapshot of
  3731. * current number of cache entries.
  3732. **/
  3733. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  3734. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  3735. /*
  3736. * Square stat is sum of squares of cache occupancy to better understand
  3737. * any variation/deviation within each cache set, over a given time-window.
  3738. *
  3739. * Square stat is calculated this way:
  3740. * Square = SUM(Squares of all Occupancy in a Set) / 8
  3741. * The cache has 16-way set associativity, so the occupancy of a
  3742. * set can vary from 0 to 16. There are 8 sets within the cache.
  3743. * Therefore, the minimum possible square value is 0, and the maximum
  3744. * possible square value is (8*16^2) / 8 = 256.
  3745. *
  3746. * 6 bins are used to keep track of square stats:
  3747. * Bin0 = increments when square of current cache occupancy is zero
  3748. * Bin1 = increments when square of current cache occupancy is within
  3749. * [1 to 50]
  3750. * Bin2 = increments when square of current cache occupancy is within
  3751. * [51 to 100]
  3752. * Bin3 = increments when square of current cache occupancy is within
  3753. * [101 to 200]
  3754. * Bin4 = increments when square of current cache occupancy is within
  3755. * [201 to 255]
  3756. * Bin5 = increments when square of current cache occupancy is 256
  3757. */
  3758. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  3759. /**
  3760. * Search stats has 2 types of values: Peak Pending and Number of
  3761. * Search Pending.
  3762. * GSE command ring for FSE can hold maximum of 5 Pending searches
  3763. * at any given time.
  3764. *
  3765. * 4 bins are used to keep track of search stats:
  3766. * Bin0 = Counter increments when there are NO pending searches
  3767. * (For peak, it will be number of pending searches greater
  3768. * than GSE command ring FIFO outstanding requests.
  3769. * For Search Pending, it will be number of pending search
  3770. * inside GSE command ring FIFO.)
  3771. * Bin1 = Counter increments when number of pending searches are within
  3772. * [1 to 2]
  3773. * Bin2 = Counter increments when number of pending searches are within
  3774. * [3 to 4]
  3775. * Bin3 = Counter increments when number of pending searches are
  3776. * greater/equal to [ >= 5]
  3777. */
  3778. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  3779. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  3780. } htt_rx_fse_stats_tlv;
  3781. /* NOTE:
  3782. * This structure is for documentation, and cannot be safely used directly.
  3783. * Instead, use the constituent TLV structures to fill/parse.
  3784. */
  3785. typedef struct {
  3786. htt_rx_fse_stats_tlv rx_fse_stats;
  3787. } htt_rx_fse_stats_t;
  3788. #endif /* __HTT_STATS_H__ */