htt_stats.h 223 KB

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