htt_stats.h 187 KB

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