htt_stats.h 231 KB

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