htt_stats.h 448 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * @file htt_stats.h
  21. *
  22. * @details the public header file of HTT STATS
  23. */
  24. #ifndef __HTT_STATS_H__
  25. #define __HTT_STATS_H__
  26. #include <htt_deps.h> /* A_UINT32 */
  27. #include <htt_common.h>
  28. #include <htt.h> /* HTT stats TLV struct def and tag defs */
  29. /* HTT_STATS_VAR_LEN_ARRAY1:
  30. * This macro is for converting the definition of existing variable-length
  31. * arrays within TLV structs of the form "type name[1];" to use the form
  32. * "type name[];" while ensuring that the length of the TLV struct is
  33. * unmodified by the conversion.
  34. * In general, any new variable-length structs should simply use
  35. * "type name[];" directly, rather than using HTT_STATS_VAR_LEN_ARRAY1.
  36. * However, if there's a legitimate reason to make the new variable-length
  37. * struct appear to not have a variable length, HTT_STATS_VAR_LEN_ARRAY1
  38. * can be used for this purpose.
  39. */
  40. #if defined(ATH_TARGET) || defined(__WINDOWS__)
  41. #define HTT_STATS_VAR_LEN_ARRAY1(type, name) type name[1]
  42. #else
  43. /*
  44. * Certain build settings of the Linux kernel don't allow zero-element
  45. * arrays, and C++ doesn't allow zero-length empty structs.
  46. * Confirm that there's no build that combines kernel with C++.
  47. */
  48. #ifdef __cplusplus
  49. #error unsupported combination of kernel and C plus plus
  50. #endif
  51. #define HTT_STATS_DUMMY_ZERO_LEN_FIELD struct {} dummy_zero_len_field
  52. #define HTT_STATS_VAR_LEN_ARRAY1(type, name) \
  53. union { \
  54. type name ## __first_elem; \
  55. struct { \
  56. HTT_STATS_DUMMY_ZERO_LEN_FIELD; \
  57. type name[]; \
  58. }; \
  59. }
  60. #endif
  61. /**
  62. * htt_dbg_ext_stats_type -
  63. * The base structure for each of the stats_type is only for reference
  64. * Host should use this information to know the type of TLVs to expect
  65. * for a particular stats type.
  66. *
  67. * Max supported stats :- 256.
  68. */
  69. enum htt_dbg_ext_stats_type {
  70. /** HTT_DBG_EXT_STATS_RESET
  71. * PARAM:
  72. * - config_param0 : start_offset (stats type)
  73. * - config_param1 : stats bmask from start offset
  74. * - config_param2 : stats bmask from start offset + 32
  75. * - config_param3 : stats bmask from start offset + 64
  76. * RESP MSG:
  77. * - No response sent.
  78. */
  79. HTT_DBG_EXT_STATS_RESET = 0,
  80. /** HTT_DBG_EXT_STATS_PDEV_TX
  81. * PARAMS:
  82. * - No Params
  83. * RESP MSG:
  84. * - htt_tx_pdev_stats_t
  85. */
  86. HTT_DBG_EXT_STATS_PDEV_TX = 1,
  87. /** HTT_DBG_EXT_STATS_PDEV_RX
  88. * PARAMS:
  89. * - No Params
  90. * RESP MSG:
  91. * - htt_rx_pdev_stats_t
  92. */
  93. HTT_DBG_EXT_STATS_PDEV_RX = 2,
  94. /** HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  95. * PARAMS:
  96. * - config_param0: [Bit31: Bit0] HWQ mask
  97. * RESP MSG:
  98. * - htt_tx_hwq_stats_t
  99. */
  100. HTT_DBG_EXT_STATS_PDEV_TX_HWQ = 3,
  101. /** HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  102. * PARAMS:
  103. * - config_param0: [Bit31: Bit0] TXQ mask
  104. * RESP MSG:
  105. * - htt_stats_tx_sched_t
  106. */
  107. HTT_DBG_EXT_STATS_PDEV_TX_SCHED = 4,
  108. /** HTT_DBG_EXT_STATS_PDEV_ERROR
  109. * PARAMS:
  110. * - No Params
  111. * RESP MSG:
  112. * - htt_hw_err_stats_t
  113. */
  114. HTT_DBG_EXT_STATS_PDEV_ERROR = 5,
  115. /** HTT_DBG_EXT_STATS_PDEV_TQM
  116. * PARAMS:
  117. * - No Params
  118. * RESP MSG:
  119. * - htt_tx_tqm_pdev_stats_t
  120. */
  121. HTT_DBG_EXT_STATS_PDEV_TQM = 6,
  122. /** HTT_DBG_EXT_STATS_TQM_CMDQ
  123. * PARAMS:
  124. * - config_param0:
  125. * [Bit15: Bit0 ] cmdq id :if 0xFFFF print all cmdq's
  126. * [Bit31: Bit16] reserved
  127. * RESP MSG:
  128. * - htt_tx_tqm_cmdq_stats_t
  129. */
  130. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  131. /** HTT_DBG_EXT_STATS_TX_DE_INFO
  132. * PARAMS:
  133. * - No Params
  134. * RESP MSG:
  135. * - htt_tx_de_stats_t
  136. */
  137. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  138. /** HTT_DBG_EXT_STATS_PDEV_TX_RATE
  139. * PARAMS:
  140. * - No Params
  141. * RESP MSG:
  142. * - htt_tx_pdev_rate_stats_t
  143. */
  144. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  145. /** HTT_DBG_EXT_STATS_PDEV_RX_RATE
  146. * PARAMS:
  147. * - No Params
  148. * RESP MSG:
  149. * - htt_rx_pdev_rate_stats_t
  150. */
  151. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  152. /** HTT_DBG_EXT_STATS_PEER_INFO
  153. * PARAMS:
  154. * - config_param0:
  155. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  156. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  157. * [Bit31 : Bit16] sw_peer_id
  158. * config_param1:
  159. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  160. * 0 bit htt_peer_stats_cmn_tlv
  161. * 1 bit htt_peer_details_tlv
  162. * 2 bit htt_tx_peer_rate_stats_tlv
  163. * 3 bit htt_rx_peer_rate_stats_tlv
  164. * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv
  165. * 5 bit htt_rx_tid_stats_tlv
  166. * 6 bit htt_msdu_flow_stats_tlv
  167. * 7 bit htt_peer_sched_stats_tlv
  168. * 8 bit htt_peer_ax_ofdma_stats_tlv
  169. * 9 bit htt_peer_be_ofdma_stats_tlv
  170. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  171. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  172. * [Bit 16] If this bit is set, reset per peer stats
  173. * of corresponding tlv indicated by config
  174. * param 1.
  175. * HTT_DBG_EXT_PEER_STATS_RESET_GET will be
  176. * used to get this bit position.
  177. * WMI_SERVICE_PER_PEER_HTT_STATS_RESET
  178. * indicates that FW supports per peer HTT
  179. * stats reset.
  180. * [Bit31 : Bit17] reserved
  181. * RESP MSG:
  182. * - htt_peer_stats_t
  183. */
  184. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  185. /** HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  186. * PARAMS:
  187. * - No Params
  188. * RESP MSG:
  189. * - htt_tx_pdev_selfgen_stats_t
  190. */
  191. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  192. /** HTT_DBG_EXT_STATS_TX_MU_HWQ
  193. * PARAMS:
  194. * - config_param0: [Bit31: Bit0] HWQ mask
  195. * RESP MSG:
  196. * - htt_tx_hwq_mu_mimo_stats_t
  197. */
  198. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  199. /** HTT_DBG_EXT_STATS_RING_IF_INFO
  200. * PARAMS:
  201. * - config_param0:
  202. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  203. * [Bit31: Bit16] reserved
  204. * RESP MSG:
  205. * - htt_ring_if_stats_t
  206. */
  207. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  208. /** HTT_DBG_EXT_STATS_SRNG_INFO
  209. * PARAMS:
  210. * - config_param0:
  211. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  212. * [Bit31: Bit16] reserved
  213. * - No Params
  214. * RESP MSG:
  215. * - htt_sring_stats_t
  216. */
  217. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  218. /** HTT_DBG_EXT_STATS_SFM_INFO
  219. * PARAMS:
  220. * - No Params
  221. * RESP MSG:
  222. * - htt_sfm_stats_t
  223. */
  224. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  225. /** HTT_DBG_EXT_STATS_PDEV_TX_MU
  226. * PARAMS:
  227. * - No Params
  228. * RESP MSG:
  229. * - htt_tx_pdev_mu_mimo_stats_t
  230. */
  231. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  232. /** HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  233. * PARAMS:
  234. * - config_param0:
  235. * [Bit7 : Bit0] vdev_id:8
  236. * note:0xFF to get all active peers based on pdev_mask.
  237. * [Bit31 : Bit8] rsvd:24
  238. * RESP MSG:
  239. * - htt_active_peer_details_list_t
  240. */
  241. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  242. /** HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  243. * PARAMS:
  244. * - config_param0:
  245. * [Bit0] - Clear bit0 to read 1sec,100ms & cumulative CCA stats.
  246. * Set bit0 to 1 to read 1sec interval histogram.
  247. * [Bit1] - 100ms interval histogram
  248. * [Bit3] - Cumulative CCA stats
  249. * RESP MSG:
  250. * - htt_pdev_cca_stats_t
  251. */
  252. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  253. /** HTT_DBG_EXT_STATS_TWT_SESSIONS
  254. * PARAMS:
  255. * - config_param0:
  256. * No params
  257. * RESP MSG:
  258. * - htt_pdev_twt_sessions_stats_t
  259. */
  260. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  261. /** HTT_DBG_EXT_STATS_REO_CNTS
  262. * PARAMS:
  263. * - config_param0:
  264. * No params
  265. * RESP MSG:
  266. * - htt_soc_reo_resource_stats_t
  267. */
  268. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  269. /** HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  270. * PARAMS:
  271. * - config_param0:
  272. * [Bit0] vdev_id_set:1
  273. * set to 1 if vdev_id is set and vdev stats are requested.
  274. * set to 0 if pdev_stats sounding stats are requested.
  275. * [Bit8 : Bit1] vdev_id:8
  276. * note:0xFF to get all active vdevs based on pdev_mask.
  277. * [Bit31 : Bit9] rsvd:22
  278. *
  279. * RESP MSG:
  280. * - htt_tx_sounding_stats_t
  281. */
  282. HTT_DBG_EXT_STATS_TX_SOUNDING_INFO = 22,
  283. /** HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS
  284. * PARAMS:
  285. * - config_param0:
  286. * No params
  287. * RESP MSG:
  288. * - htt_pdev_obss_pd_stats_t
  289. */
  290. HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
  291. /** HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS
  292. * PARAMS:
  293. * - config_param0:
  294. * No params
  295. * RESP MSG:
  296. * - htt_stats_ring_backpressure_stats_t
  297. */
  298. HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
  299. /** HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  300. * PARAMS:
  301. *
  302. * RESP MSG:
  303. * - htt_soc_latency_prof_t
  304. */
  305. HTT_DBG_EXT_STATS_LATENCY_PROF_STATS = 25,
  306. /** HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  307. * PARAMS:
  308. * - No Params
  309. * RESP MSG:
  310. * - htt_rx_pdev_ul_trig_stats_t
  311. */
  312. HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS = 26,
  313. /** HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27
  314. * PARAMS:
  315. * - No Params
  316. * RESP MSG:
  317. * - htt_rx_pdev_ul_mumimo_trig_stats_t
  318. */
  319. HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27,
  320. /** HTT_DBG_EXT_STATS_FSE_RX
  321. * PARAMS:
  322. * - No Params
  323. * RESP MSG:
  324. * - htt_rx_fse_stats_t
  325. */
  326. HTT_DBG_EXT_STATS_FSE_RX = 28,
  327. /** HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  328. * PARAMS:
  329. * - config_param0: [Bit0] : [1] for mac_addr based request
  330. * - config_param1: [Bit31 : Bit0] mac_addr31to0
  331. * - config_param2: [Bit15 : Bit0] mac_addr47to32
  332. * RESP MSG:
  333. * - htt_ctrl_path_txrx_stats_t
  334. */
  335. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS = 29,
  336. /** HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  337. * PARAMS:
  338. * - No Params
  339. * RESP MSG:
  340. * - htt_rx_pdev_rate_ext_stats_t
  341. */
  342. HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT = 30,
  343. /** HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF
  344. * PARAMS:
  345. * - No Params
  346. * RESP MSG:
  347. * - htt_tx_pdev_txbf_rate_stats_t
  348. */
  349. HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF = 31,
  350. /** HTT_DBG_EXT_STATS_TXBF_OFDMA
  351. */
  352. HTT_DBG_EXT_STATS_TXBF_OFDMA = 32,
  353. /** HTT_DBG_EXT_STA_11AX_UL_STATS
  354. * PARAMS:
  355. * - No Params
  356. * RESP MSG:
  357. * - htt_sta_11ax_ul_stats
  358. */
  359. HTT_DBG_EXT_STA_11AX_UL_STATS = 33,
  360. /** HTT_DBG_EXT_VDEV_RTT_RESP_STATS
  361. * PARAMS:
  362. * - config_param0:
  363. * [Bit7 : Bit0] vdev_id:8
  364. * [Bit31 : Bit8] rsvd:24
  365. * RESP MSG:
  366. * -
  367. */
  368. HTT_DBG_EXT_VDEV_RTT_RESP_STATS = 34,
  369. /** HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  370. * PARAMS:
  371. * - No Params
  372. * RESP MSG:
  373. * - htt_pktlog_and_htt_ring_stats_t
  374. */
  375. HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS = 35,
  376. /** HTT_DBG_EXT_STATS_DLPAGER_STATS
  377. * PARAMS:
  378. *
  379. * RESP MSG:
  380. * - htt_dlpager_stats_t
  381. */
  382. HTT_DBG_EXT_STATS_DLPAGER_STATS = 36,
  383. /** HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  384. * PARAMS:
  385. * - No Params
  386. * RESP MSG:
  387. * - htt_phy_counters_and_phy_stats_t
  388. */
  389. HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
  390. /** HTT_DBG_EXT_VDEVS_TXRX_STATS
  391. * PARAMS:
  392. * - No Params
  393. * RESP MSG:
  394. * - htt_vdevs_txrx_stats_t
  395. */
  396. HTT_DBG_EXT_VDEVS_TXRX_STATS = 38,
  397. HTT_DBG_EXT_VDEV_RTT_INITIATOR_STATS = 39,
  398. /** HTT_DBG_EXT_PDEV_PER_STATS
  399. * PARAMS:
  400. * - No Params
  401. * RESP MSG:
  402. * - htt_tx_pdev_per_stats_t
  403. */
  404. HTT_DBG_EXT_PDEV_PER_STATS = 40,
  405. HTT_DBG_EXT_AST_ENTRIES = 41,
  406. /** HTT_DBG_EXT_RX_RING_STATS
  407. * PARAMS:
  408. * - No Params
  409. * RESP MSG:
  410. * - htt_rx_fw_ring_stats_tlv_v
  411. */
  412. HTT_DBG_EXT_RX_RING_STATS = 42,
  413. /** HTT_STRM_GEN_MPDUS_STATS, HTT_STRM_GEN_MPDUS_DETAILS_STATS
  414. * PARAMS:
  415. * - No params
  416. * RESP MSG: HTT_T2H STREAMING_STATS_IND (not EXT_STATS_CONF)
  417. * - HTT_STRM_GEN_MPDUS_STATS:
  418. * htt_stats_strm_gen_mpdus_tlv_t
  419. * - HTT_STRM_GEN_MPDUS_DETAILS_STATS:
  420. * htt_stats_strm_gen_mpdus_details_tlv_t
  421. */
  422. HTT_STRM_GEN_MPDUS_STATS = 43,
  423. HTT_STRM_GEN_MPDUS_DETAILS_STATS = 44,
  424. /** HTT_DBG_SOC_ERROR_STATS
  425. * PARAMS:
  426. * - No Params
  427. * RESP MSG:
  428. * - htt_dmac_reset_stats_tlv
  429. */
  430. HTT_DBG_SOC_ERROR_STATS = 45,
  431. /** HTT_DBG_PDEV_PUNCTURE_STATS
  432. * PARAMS:
  433. * - param 0: enum from htt_tx_pdev_puncture_stats_upload_t, indicating
  434. * the stats to upload
  435. * RESP MSG:
  436. * - one or more htt_pdev_puncture_stats_tlv, depending on param 0
  437. */
  438. HTT_DBG_PDEV_PUNCTURE_STATS = 46,
  439. /** HTT_DBG_EXT_STATS_ML_PEERS_INFO
  440. * PARAMS:
  441. * - param 0:
  442. * Bit 0 -> HTT_ML_PEER_DETAILS_TLV always enabled by default
  443. * Bit 1 -> HTT_ML_PEER_EXT_DETAILS_TLV will be uploaded when
  444. * this bit is set
  445. * Bit 2 -> HTT_ML_LINK_INFO_TLV will be uploaded when this bit is set
  446. * RESP MSG:
  447. * - htt_ml_peer_stats_t
  448. */
  449. HTT_DBG_EXT_STATS_ML_PEERS_INFO = 47,
  450. /** HTT_DBG_ODD_MANDATORY_STATS
  451. * params:
  452. * None
  453. * Response MSG:
  454. * htt_odd_mandatory_pdev_stats_tlv
  455. */
  456. HTT_DBG_ODD_MANDATORY_STATS = 48,
  457. /** HTT_DBG_PDEV_SCHED_ALGO_STATS
  458. * PARAMS:
  459. * - No Params
  460. * RESP MSG:
  461. * - htt_pdev_sched_algo_ofdma_stats_tlv
  462. */
  463. HTT_DBG_PDEV_SCHED_ALGO_STATS = 49,
  464. /** HTT_DBG_ODD_MANDATORY_MUMIMO_STATS
  465. * params:
  466. * None
  467. * Response MSG:
  468. * htt_odd_mandatory_mumimo_pdev_stats_tlv
  469. */
  470. HTT_DBG_ODD_MANDATORY_MUMIMO_STATS = 50,
  471. /** HTT_DBG_ODD_MANDATORY_MUOFDMA_STATS
  472. * params:
  473. * None
  474. * Response MSG:
  475. * htt_odd_mandatory_muofdma_pdev_stats_tlv
  476. */
  477. HTT_DBG_ODD_MANDATORY_MUOFDMA_STATS = 51,
  478. /** HTT_DBG_EXT_PHY_PROF_CAL_STATS
  479. * params:
  480. * None
  481. * Response MSG:
  482. * htt_stats_latency_prof_cal_data_tlv
  483. */
  484. HTT_DBG_EXT_PHY_PROF_CAL_STATS = 52,
  485. /** HTT_DBG_EXT_STATS_PDEV_BW_MGR
  486. * PARAMS:
  487. * - No Params
  488. * RESP MSG:
  489. * - htt_pdev_bw_mgr_stats_t
  490. */
  491. HTT_DBG_EXT_STATS_PDEV_BW_MGR = 53,
  492. /** HTT_DBG_PDEV_MBSSID_CTRL_FRAME_STATS
  493. * PARAMS:
  494. * - No Params
  495. * RESP MSG:
  496. * - htt_pdev_mbssid_ctrl_frame_stats
  497. */
  498. HTT_DBG_PDEV_MBSSID_CTRL_FRAME_STATS = 54,
  499. /** HTT_DBG_SOC_SSR_STATS
  500. * Used for non-MLO UMAC recovery stats.
  501. * PARAMS:
  502. * - No Params
  503. * RESP MSG:
  504. * - htt_umac_ssr_stats_tlv
  505. */
  506. HTT_DBG_SOC_SSR_STATS = 55,
  507. /** HTT_DBG_MLO_UMAC_SSR_STATS
  508. * Used for MLO UMAC recovery stats.
  509. * PARAMS:
  510. * - No Params
  511. * RESP MSG:
  512. * - htt_mlo_umac_ssr_stats_tlv
  513. */
  514. HTT_DBG_MLO_UMAC_SSR_STATS = 56,
  515. /** HTT_DBG_PDEV_TDMA_STATS
  516. * PARAMS:
  517. * - No Params
  518. * RESP MSG:
  519. * - htt_pdev_tdma_stats_tlv
  520. */
  521. HTT_DBG_PDEV_TDMA_STATS = 57,
  522. /** HTT_DBG_CODEL_STATS
  523. * PARAMS:
  524. * - No Params
  525. * RESP MSG:
  526. * - htt_codel_svc_class_stats_tlv
  527. * - htt_codel_msduq_stats_tlv
  528. */
  529. HTT_DBG_CODEL_STATS = 58,
  530. /** HTT_DBG_ODD_PDEV_BE_TX_MU_OFDMA_STATS
  531. * PARAMS:
  532. * - No Params
  533. * RESP MSG:
  534. * - htt_tx_pdev_mpdu_stats_tlv
  535. */
  536. HTT_DBG_ODD_PDEV_BE_TX_MU_OFDMA_STATS = 59,
  537. /** HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  538. * PARAMS:
  539. * - No Params
  540. * RESP MSG:
  541. * - htt_rx_pdev_be_ul_ofdma_user_stats_tlv
  542. */
  543. HTT_DBG_ODD_UL_BE_OFDMA_STATS = 60,
  544. /** HTT_DBG_ODD_BE_TXBF_OFDMA_STATS
  545. */
  546. HTT_DBG_ODD_BE_TXBF_OFDMA_STATS = 61,
  547. /** HTT_DBG_ODD_STATS_PDEV_BE_UL_MUMIMO_TRIG_STATS
  548. * PARAMS:
  549. * - No Params
  550. * RESP MSG:
  551. * - htt_rx_pdev_be_ul_ofdma_user_stats_tlv
  552. */
  553. HTT_DBG_ODD_STATS_PDEV_BE_UL_MUMIMO_TRIG_STATS = 62,
  554. /** HTT_DBG_MLO_SCHED_STATS
  555. * PARAMS:
  556. * - No Params
  557. * RESP MSG:
  558. * - htt_pdev_mlo_sched_stats_tlv
  559. */
  560. HTT_DBG_MLO_SCHED_STATS = 63,
  561. /** HTT_DBG_PDEV_MLO_IPC_STATS
  562. * PARAMS:
  563. * - No Params
  564. * RESP MSG:
  565. * - htt_pdev_mlo_ipc_stats_tlv
  566. */
  567. HTT_DBG_PDEV_MLO_IPC_STATS = 64,
  568. /** HTT_DBG_EXT_PDEV_RTT_RESP_STATS
  569. * PARAMS:
  570. * - No Params
  571. * RESP MSG:
  572. * - htt_stats_pdev_rtt_resp_stats_tlv
  573. * - htt_stats_pdev_rtt_hw_stats_tlv
  574. * - htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv
  575. * - htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv
  576. */
  577. HTT_DBG_EXT_PDEV_RTT_RESP_STATS = 65,
  578. /** HTT_DBG_EXT_PDEV_RTT_INITIATOR_STATS
  579. * PARAMS:
  580. * - No Params
  581. * RESP MSG:
  582. * - htt_stats_pdev_rtt_init_stats_tlv
  583. * - htt_stats_pdev_rtt_hw_stats_tlv
  584. */
  585. HTT_DBG_EXT_PDEV_RTT_INITIATOR_STATS = 66,
  586. /* keep this last */
  587. HTT_DBG_NUM_EXT_STATS = 256,
  588. };
  589. /*
  590. * Macros to get/set the bit field in config param[3] that indicates to
  591. * clear corresponding per peer stats specified by config param 1
  592. */
  593. #define HTT_DBG_EXT_PEER_STATS_RESET_M 0x00010000
  594. #define HTT_DBG_EXT_PEER_STATS_RESET_S 16
  595. #define HTT_DBG_EXT_PEER_STATS_RESET_GET(_var) \
  596. (((_var) & HTT_DBG_EXT_PEER_STATS_RESET_M) >> \
  597. HTT_DBG_EXT_PEER_STATS_RESET_S)
  598. #define HTT_DBG_EXT_PEER_STATS_RESET_SET(_var, _val) \
  599. do { \
  600. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_STATS_RESET, _val); \
  601. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_STATS_RESET_S)); \
  602. } while (0)
  603. #define HTT_STATS_SUBTYPE_MAX 16
  604. /* htt_mu_stats_upload_t
  605. * Enumerations for specifying whether to upload all MU stats in response to
  606. * HTT_DBG_EXT_STATS_PDEV_TX_MU, or if not all, then which subset.
  607. */
  608. typedef enum {
  609. /* HTT_UPLOAD_MU_STATS: upload all MU stats:
  610. * UL MU-MIMO + DL MU-MIMO + UL MU-OFDMA + DL MU-OFDMA
  611. * (note: included OFDMA stats are limited to 11ax)
  612. */
  613. HTT_UPLOAD_MU_STATS,
  614. /* HTT_UPLOAD_MU_MIMO_STATS: upload UL MU-MIMO + DL MU-MIMO stats */
  615. HTT_UPLOAD_MU_MIMO_STATS,
  616. /* HTT_UPLOAD_MU_OFDMA_STATS:
  617. * upload UL MU-OFDMA + DL MU-OFDMA stats (note: 11ax only stats)
  618. */
  619. HTT_UPLOAD_MU_OFDMA_STATS,
  620. HTT_UPLOAD_DL_MU_MIMO_STATS,
  621. HTT_UPLOAD_UL_MU_MIMO_STATS,
  622. /* HTT_UPLOAD_DL_MU_OFDMA_STATS:
  623. * upload DL MU-OFDMA stats (note: 11ax only stats)
  624. */
  625. HTT_UPLOAD_DL_MU_OFDMA_STATS,
  626. /* HTT_UPLOAD_UL_MU_OFDMA_STATS:
  627. * upload UL MU-OFDMA stats (note: 11ax only stats)
  628. */
  629. HTT_UPLOAD_UL_MU_OFDMA_STATS,
  630. /*
  631. * Upload BE UL MU-OFDMA + BE DL MU-OFDMA stats,
  632. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv and
  633. * htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  634. */
  635. HTT_UPLOAD_BE_MU_OFDMA_STATS,
  636. /*
  637. * Upload BE DL MU-OFDMA
  638. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv
  639. */
  640. HTT_UPLOAD_BE_DL_MU_OFDMA_STATS,
  641. /*
  642. * Upload BE UL MU-OFDMA
  643. * TLV: htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  644. */
  645. HTT_UPLOAD_BE_UL_MU_OFDMA_STATS,
  646. } htt_mu_stats_upload_t;
  647. /* htt_tx_rate_stats_upload_t
  648. * Enumerations for specifying which stats to upload in response to
  649. * HTT_DBG_EXT_STATS_PDEV_TX_RATE.
  650. */
  651. typedef enum {
  652. /* 11abgn, 11ac, and 11ax TX stats, and a few 11be SU stats
  653. *
  654. * TLV: htt_tx_pdev_rate_stats_tlv
  655. */
  656. HTT_TX_RATE_STATS_DEFAULT,
  657. /*
  658. * Upload 11be OFDMA TX stats
  659. *
  660. * TLV: htt_tx_pdev_rate_stats_be_ofdma_tlv
  661. */
  662. HTT_TX_RATE_STATS_UPLOAD_11BE_OFDMA,
  663. } htt_tx_rate_stats_upload_t;
  664. /* htt_rx_ul_trigger_stats_upload_t
  665. * Enumerations for specifying which stats to upload in response to
  666. * HTT_DBG_EXT_STATS_PDEV_TX_RATE.
  667. */
  668. typedef enum {
  669. /* Upload 11ax UL OFDMA RX Trigger stats
  670. *
  671. * TLV: htt_rx_pdev_ul_trigger_stats_tlv
  672. */
  673. HTT_RX_UL_TRIGGER_STATS_UPLOAD_11AX_OFDMA,
  674. /*
  675. * Upload 11be UL OFDMA RX Trigger stats
  676. *
  677. * TLV: htt_rx_pdev_be_ul_trigger_stats_tlv
  678. */
  679. HTT_RX_UL_TRIGGER_STATS_UPLOAD_11BE_OFDMA,
  680. } htt_rx_ul_trigger_stats_upload_t;
  681. /*
  682. * The htt_rx_ul_mumimo_trigger_stats_upload_t enum values are
  683. * provided by the host as one of the config param elements in
  684. * the HTT_H2T EXT_STATS_REQ message, for stats type ==
  685. * HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS.
  686. */
  687. typedef enum {
  688. /*
  689. * Upload 11ax UL MUMIMO RX Trigger stats
  690. * TLV: htt_rx_pdev_ul_mumimo_trig_stats_tlv
  691. */
  692. HTT_RX_UL_MUMIMO_TRIGGER_STATS_UPLOAD_11AX,
  693. /*
  694. * Upload 11be UL MUMIMO RX Trigger stats
  695. * TLV: htt_rx_pdev_ul_mumimo_trig_be_stats_tlv
  696. */
  697. HTT_RX_UL_MUMIMO_TRIGGER_STATS_UPLOAD_11BE,
  698. } htt_rx_ul_mumimo_trigger_stats_upload_t;
  699. /* htt_tx_pdev_txbf_ofdma_stats_upload_t
  700. * Enumerations for specifying which stats to upload in response to
  701. * HTT_DBG_EXT_STATS_TXBF_OFDMA.
  702. */
  703. typedef enum {
  704. /* upload 11ax TXBF OFDMA stats
  705. *
  706. * TLV: htt_tx_pdev_ax_txbf_ofdma_stats_t
  707. */
  708. HTT_UPLOAD_AX_TXBF_OFDMA_STATS,
  709. /*
  710. * Upload 11be TXBF OFDMA stats
  711. *
  712. * TLV: htt_tx_pdev_be_txbf_ofdma_stats_t
  713. */
  714. HTT_UPLOAD_BE_TXBF_OFDMA_STATS,
  715. } htt_tx_pdev_txbf_ofdma_stats_upload_t;
  716. /* htt_tx_pdev_puncture_stats_upload_t
  717. * Enumerations for specifying which stats to upload in response to
  718. * HTT_DBG_PDEV_PUNCTURE_STATS.
  719. */
  720. typedef enum {
  721. /* upload puncture stats for all supported modes, both TX and RX */
  722. HTT_UPLOAD_PUNCTURE_STATS_ALL,
  723. /* upload puncture stats for all supported TX modes */
  724. HTT_UPLOAD_PUNCTURE_STATS_TX,
  725. /* upload puncture stats for all supported RX modes */
  726. HTT_UPLOAD_PUNCTURE_STATS_RX,
  727. } htt_tx_pdev_puncture_stats_upload_t;
  728. #define HTT_STATS_MAX_STRING_SZ32 4
  729. #define HTT_STATS_MACID_INVALID 0xff
  730. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  731. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  732. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  733. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  734. #define HTT_PDEV_STATS_PPDU_DUR_HIST_BINS 16
  735. #define HTT_PDEV_STATS_PPDU_DUR_HIST_INTERVAL_US 250
  736. typedef enum {
  737. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  738. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  739. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  740. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  741. } htt_tx_pdev_underrun_enum;
  742. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 150
  743. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  744. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  745. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  746. /* HTT_TX_PDEV_SCHED_TX_MODE_MAX:
  747. * DEPRECATED - num sched tx mode max is 8
  748. */
  749. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  750. #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  751. #define HTT_RX_STATS_REFILL_MAX_RING 4
  752. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  753. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  754. /* Bytes stored in little endian order */
  755. /* Length should be multiple of DWORD */
  756. typedef struct {
  757. htt_tlv_hdr_t tlv_hdr;
  758. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, data); /* Can be variable length */
  759. } htt_stats_string_tlv;
  760. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  761. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  762. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  763. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  764. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  765. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  766. do { \
  767. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  768. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  769. } while (0)
  770. /* == TX PDEV STATS == */
  771. typedef struct {
  772. htt_tlv_hdr_t tlv_hdr;
  773. /**
  774. * BIT [ 7 : 0] :- mac_id
  775. * BIT [31 : 8] :- reserved
  776. */
  777. A_UINT32 mac_id__word;
  778. /** Num PPDUs queued to HW */
  779. A_UINT32 hw_queued;
  780. /** Num PPDUs reaped from HW */
  781. A_UINT32 hw_reaped;
  782. /** Num underruns */
  783. A_UINT32 underrun;
  784. /** Num HW Paused counter */
  785. A_UINT32 hw_paused;
  786. /** Num HW flush counter */
  787. A_UINT32 hw_flush;
  788. /** Num HW filtered counter */
  789. A_UINT32 hw_filt;
  790. /** Num PPDUs cleaned up in TX abort */
  791. A_UINT32 tx_abort;
  792. /** Num MPDUs requeued by SW */
  793. A_UINT32 mpdu_requed;
  794. /** excessive retries */
  795. A_UINT32 tx_xretry;
  796. /** Last used data hw rate code */
  797. A_UINT32 data_rc;
  798. /** frames dropped due to excessive SW retries */
  799. A_UINT32 mpdu_dropped_xretry;
  800. /** illegal rate phy errors */
  801. A_UINT32 illgl_rate_phy_err;
  802. /** wal pdev continuous xretry */
  803. A_UINT32 cont_xretry;
  804. /** wal pdev tx timeout */
  805. A_UINT32 tx_timeout;
  806. /** wal pdev resets */
  807. A_UINT32 pdev_resets;
  808. /** PHY/BB underrun */
  809. A_UINT32 phy_underrun;
  810. /** MPDU is more than txop limit */
  811. A_UINT32 txop_ovf;
  812. /** Number of Sequences posted */
  813. A_UINT32 seq_posted;
  814. /** Number of Sequences failed queueing */
  815. A_UINT32 seq_failed_queueing;
  816. /** Number of Sequences completed */
  817. A_UINT32 seq_completed;
  818. /** Number of Sequences restarted */
  819. A_UINT32 seq_restarted;
  820. /** Number of MU Sequences posted */
  821. A_UINT32 mu_seq_posted;
  822. /** Number of time HW ring is paused between seq switch within ISR */
  823. A_UINT32 seq_switch_hw_paused;
  824. /** Number of times seq continuation in DSR */
  825. A_UINT32 next_seq_posted_dsr;
  826. /** Number of times seq continuation in ISR */
  827. A_UINT32 seq_posted_isr;
  828. /** Number of seq_ctrl cached. */
  829. A_UINT32 seq_ctrl_cached;
  830. /** Number of MPDUs successfully transmitted */
  831. A_UINT32 mpdu_count_tqm;
  832. /** Number of MSDUs successfully transmitted */
  833. A_UINT32 msdu_count_tqm;
  834. /** Number of MPDUs dropped */
  835. A_UINT32 mpdu_removed_tqm;
  836. /** Number of MSDUs dropped */
  837. A_UINT32 msdu_removed_tqm;
  838. /** Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  839. A_UINT32 mpdus_sw_flush;
  840. /** Num MPDUs filtered by HW, all filter condition (TTL expired) */
  841. A_UINT32 mpdus_hw_filter;
  842. /**
  843. * Num MPDUs truncated by PDG
  844. * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
  845. */
  846. A_UINT32 mpdus_truncated;
  847. /** Num MPDUs that was tried but didn't receive ACK or BA */
  848. A_UINT32 mpdus_ack_failed;
  849. /** Num MPDUs that was dropped due to expiry (MSDU TTL) */
  850. A_UINT32 mpdus_expired;
  851. /** Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  852. A_UINT32 mpdus_seq_hw_retry;
  853. /** Num of TQM acked cmds processed */
  854. A_UINT32 ack_tlv_proc;
  855. /** coex_abort_mpdu_cnt valid */
  856. A_UINT32 coex_abort_mpdu_cnt_valid;
  857. /** coex_abort_mpdu_cnt from TX FES stats */
  858. A_UINT32 coex_abort_mpdu_cnt;
  859. /**
  860. * Number of total PPDUs
  861. * (DATA, MGMT, excludes selfgen) tried over the air (OTA)
  862. */
  863. A_UINT32 num_total_ppdus_tried_ota;
  864. /** Number of data PPDUs tried over the air (OTA) */
  865. A_UINT32 num_data_ppdus_tried_ota;
  866. /** Num Local control/mgmt frames (MSDUs) queued */
  867. A_UINT32 local_ctrl_mgmt_enqued;
  868. /**
  869. * Num Local control/mgmt frames (MSDUs) done
  870. * It includes all local ctrl/mgmt completions
  871. * (acked, no ack, flush, TTL, etc)
  872. */
  873. A_UINT32 local_ctrl_mgmt_freed;
  874. /** Num Local data frames (MSDUs) queued */
  875. A_UINT32 local_data_enqued;
  876. /**
  877. * Num Local data frames (MSDUs) done
  878. * It includes all local data completions
  879. * (acked, no ack, flush, TTL, etc)
  880. */
  881. A_UINT32 local_data_freed;
  882. /** Num MPDUs tried by SW */
  883. A_UINT32 mpdu_tried;
  884. /** Num of waiting seq posted in ISR completion handler */
  885. A_UINT32 isr_wait_seq_posted;
  886. A_UINT32 tx_active_dur_us_low;
  887. A_UINT32 tx_active_dur_us_high;
  888. /** Number of MPDUs dropped after max retries */
  889. A_UINT32 remove_mpdus_max_retries;
  890. /** Num HTT cookies dispatched */
  891. A_UINT32 comp_delivered;
  892. /** successful ppdu transmissions */
  893. A_UINT32 ppdu_ok;
  894. /** Scheduler self triggers */
  895. A_UINT32 self_triggers;
  896. /** FES duration of last tx data PPDU in us (sch_eval_end - ppdu_start) */
  897. A_UINT32 tx_time_dur_data;
  898. /** Num of times sequence terminated due to ppdu duration < burst limit */
  899. A_UINT32 seq_qdepth_repost_stop;
  900. /** Num of times MU sequence terminated due to MSDUs reaching threshold */
  901. A_UINT32 mu_seq_min_msdu_repost_stop;
  902. /** Num of times SU sequence terminated due to MSDUs reaching threshold */
  903. A_UINT32 seq_min_msdu_repost_stop;
  904. /** Num of times sequence terminated due to no TXOP available */
  905. A_UINT32 seq_txop_repost_stop;
  906. /** Num of times the next sequence got cancelled */
  907. A_UINT32 next_seq_cancel;
  908. /** Num of times fes offset was misaligned */
  909. A_UINT32 fes_offsets_err_cnt;
  910. /** Num of times peer denylisted for MU-MIMO transmission */
  911. A_UINT32 num_mu_peer_blacklisted;
  912. /** Num of times mu_ofdma seq posted */
  913. A_UINT32 mu_ofdma_seq_posted;
  914. /** Num of times UL MU MIMO seq posted */
  915. A_UINT32 ul_mumimo_seq_posted;
  916. /** Num of times UL OFDMA seq posted */
  917. A_UINT32 ul_ofdma_seq_posted;
  918. /** Num of times Thermal module suspended scheduler */
  919. A_UINT32 thermal_suspend_cnt;
  920. /** Num of times DFS module suspended scheduler */
  921. A_UINT32 dfs_suspend_cnt;
  922. /** Num of times TX abort module suspended scheduler */
  923. A_UINT32 tx_abort_suspend_cnt;
  924. /**
  925. * This field is a target-specific bit mask of suspended PPDU tx queues.
  926. * Since the bit mask definition is different for different targets,
  927. * this field is not meant for general use, but rather for debugging use.
  928. */
  929. A_UINT32 tgt_specific_opaque_txq_suspend_info;
  930. /**
  931. * Last SCHEDULER suspend reason
  932. * 1 -> Thermal Module
  933. * 2 -> DFS Module
  934. * 3 -> Tx Abort Module
  935. */
  936. A_UINT32 last_suspend_reason;
  937. /** Num of dynamic mimo ps dlmumimo sequences posted */
  938. A_UINT32 num_dyn_mimo_ps_dlmumimo_sequences;
  939. /** Num of times su bf sequences are denylisted */
  940. A_UINT32 num_su_txbf_denylisted;
  941. /** pdev uptime in microseconds **/
  942. A_UINT32 pdev_up_time_us_low;
  943. A_UINT32 pdev_up_time_us_high;
  944. /** count of ofdma sequences flushed */
  945. A_UINT32 ofdma_seq_flush;
  946. } htt_stats_tx_pdev_cmn_tlv;
  947. /* preserve old name alias for new name consistent with the tag name */
  948. typedef htt_stats_tx_pdev_cmn_tlv htt_tx_pdev_stats_cmn_tlv;
  949. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  950. /* NOTE: Variable length TLV, use length spec to infer array size */
  951. typedef struct {
  952. htt_tlv_hdr_t tlv_hdr;
  953. /* HTT_TX_PDEV_MAX_URRN_STATS */
  954. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, urrn_stats);
  955. } htt_stats_tx_pdev_underrun_tlv;
  956. /* preserve old name alias for new name consistent with the tag name */
  957. typedef htt_stats_tx_pdev_underrun_tlv htt_tx_pdev_stats_urrn_tlv_v;
  958. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  959. /* NOTE: Variable length TLV, use length spec to infer array size */
  960. typedef struct {
  961. htt_tlv_hdr_t tlv_hdr;
  962. /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  963. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, flush_errs);
  964. } htt_stats_tx_pdev_flush_tlv;
  965. /* preserve old name alias for new name consistent with the tag name */
  966. typedef htt_stats_tx_pdev_flush_tlv htt_tx_pdev_stats_flush_tlv_v;
  967. #define HTT_TX_PDEV_STATS_MLO_ABORT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  968. /* NOTE: Variable length TLV, use length spec to infer array size */
  969. typedef struct {
  970. htt_tlv_hdr_t tlv_hdr;
  971. /* HTT_TX_PDEV_MAX_MLO_ABORT_REASON_STATS */
  972. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, mlo_abort_cnt);
  973. } htt_stats_tx_pdev_mlo_abort_tlv;
  974. /* preserve old name alias for new name consistent with the tag name */
  975. typedef htt_stats_tx_pdev_mlo_abort_tlv htt_tx_pdev_stats_mlo_abort_tlv_v;
  976. #define HTT_TX_PDEV_STATS_MLO_TXOP_ABORT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  977. /* NOTE: Variable length TLV, use length spec to infer array size */
  978. typedef struct {
  979. htt_tlv_hdr_t tlv_hdr;
  980. /* HTT_TX_PDEV_MAX_MLO_ABORT_REASON_STATS */
  981. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, mlo_txop_abort_cnt);
  982. } htt_stats_tx_pdev_mlo_txop_abort_tlv;
  983. /* preserve old name alias for new name consistent with the tag name */
  984. typedef htt_stats_tx_pdev_mlo_txop_abort_tlv
  985. htt_tx_pdev_stats_mlo_txop_abort_tlv_v;
  986. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  987. /* NOTE: Variable length TLV, use length spec to infer array size */
  988. typedef struct {
  989. htt_tlv_hdr_t tlv_hdr;
  990. /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  991. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sifs_status);
  992. } htt_stats_tx_pdev_sifs_tlv;
  993. /* preserve old name alias for new name consistent with the tag name */
  994. typedef htt_stats_tx_pdev_sifs_tlv htt_tx_pdev_stats_sifs_tlv_v;
  995. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  996. /* NOTE: Variable length TLV, use length spec to infer array size */
  997. typedef struct {
  998. htt_tlv_hdr_t tlv_hdr;
  999. /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  1000. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, phy_errs);
  1001. } htt_stats_tx_pdev_phy_err_tlv;
  1002. /* preserve old name alias for new name consistent with the tag name */
  1003. typedef htt_stats_tx_pdev_phy_err_tlv htt_tx_pdev_stats_phy_err_tlv_v;
  1004. /*
  1005. * Each array in the below struct has 16 elements, to cover the 16 possible
  1006. * values for the CW and AIFS parameters. Each element within the array
  1007. * stores the counter indicating how many transmissions have occurred with
  1008. * that particular value for the MU EDCA parameter in question.
  1009. */
  1010. #define HTT_STATS_MUEDCA_VALUE_MAX 16
  1011. typedef struct { /* DEPRECATED */
  1012. htt_tlv_hdr_t tlv_hdr;
  1013. A_UINT32 aifs[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  1014. A_UINT32 cw_min[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  1015. A_UINT32 cw_max[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  1016. } htt_stats_tx_pdev_muedca_params_stats_tlv;
  1017. /* preserve old name alias for new name consistent with the tag name */
  1018. typedef htt_stats_tx_pdev_muedca_params_stats_tlv
  1019. htt_tx_pdev_muedca_params_stats_tlv_v;
  1020. typedef struct {
  1021. htt_tlv_hdr_t tlv_hdr;
  1022. A_UINT32 relaxed_mu_edca[HTT_NUM_AC_WMM];
  1023. A_UINT32 mumimo_aggressive_mu_edca[HTT_NUM_AC_WMM];
  1024. A_UINT32 mumimo_relaxed_mu_edca[HTT_NUM_AC_WMM];
  1025. A_UINT32 muofdma_aggressive_mu_edca[HTT_NUM_AC_WMM];
  1026. A_UINT32 muofdma_relaxed_mu_edca[HTT_NUM_AC_WMM];
  1027. A_UINT32 latency_mu_edca[HTT_NUM_AC_WMM];
  1028. A_UINT32 psd_boost_mu_edca[HTT_NUM_AC_WMM];
  1029. } htt_stats_tx_pdev_mu_edca_params_stats_tlv;
  1030. /* preserve old name alias for new name consistent with the tag name */
  1031. typedef htt_stats_tx_pdev_mu_edca_params_stats_tlv
  1032. htt_tx_pdev_mu_edca_params_stats_tlv_v;
  1033. typedef struct {
  1034. htt_tlv_hdr_t tlv_hdr;
  1035. A_UINT32 ul_mumimo_less_aggressive[HTT_NUM_AC_WMM];
  1036. A_UINT32 ul_mumimo_medium_aggressive[HTT_NUM_AC_WMM];
  1037. A_UINT32 ul_mumimo_highly_aggressive[HTT_NUM_AC_WMM];
  1038. A_UINT32 ul_mumimo_default_relaxed[HTT_NUM_AC_WMM];
  1039. A_UINT32 ul_muofdma_less_aggressive[HTT_NUM_AC_WMM];
  1040. A_UINT32 ul_muofdma_medium_aggressive[HTT_NUM_AC_WMM];
  1041. A_UINT32 ul_muofdma_highly_aggressive[HTT_NUM_AC_WMM];
  1042. A_UINT32 ul_muofdma_default_relaxed[HTT_NUM_AC_WMM];
  1043. } htt_stats_tx_pdev_ap_edca_params_stats_tlv;
  1044. /* preserve old name alias for new name consistent with the tag name */
  1045. typedef htt_stats_tx_pdev_ap_edca_params_stats_tlv
  1046. htt_tx_pdev_ap_edca_params_stats_tlv_v;
  1047. #define HTT_TX_PDEV_SIFS_BURST_HIST_STATS 10
  1048. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1049. /* NOTE: Variable length TLV, use length spec to infer array size */
  1050. typedef struct {
  1051. htt_tlv_hdr_t tlv_hdr;
  1052. /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  1053. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sifs_hist_status);
  1054. } htt_stats_tx_pdev_sifs_hist_tlv;
  1055. /* preserve old name alias for new name consistent with the tag name */
  1056. typedef htt_stats_tx_pdev_sifs_hist_tlv htt_tx_pdev_stats_sifs_hist_tlv_v;
  1057. typedef struct {
  1058. htt_tlv_hdr_t tlv_hdr;
  1059. A_UINT32 num_data_ppdus_legacy_su;
  1060. A_UINT32 num_data_ppdus_ac_su;
  1061. A_UINT32 num_data_ppdus_ax_su;
  1062. A_UINT32 num_data_ppdus_ac_su_txbf;
  1063. A_UINT32 num_data_ppdus_ax_su_txbf;
  1064. } htt_stats_tx_pdev_tx_ppdu_stats_tlv;
  1065. /* preserve old name alias for new name consistent with the tag name */
  1066. typedef htt_stats_tx_pdev_tx_ppdu_stats_tlv
  1067. htt_tx_pdev_stats_tx_ppdu_stats_tlv_v;
  1068. typedef enum {
  1069. HTT_TX_WAL_ISR_SCHED_SUCCESS,
  1070. HTT_TX_WAL_ISR_SCHED_FILTER,
  1071. HTT_TX_WAL_ISR_SCHED_RESP_TIMEOUT,
  1072. HTT_TX_WAL_ISR_SCHED_RATES_EXHAUSTED,
  1073. HTT_TX_WAL_ISR_SCHED_DATA_EXHAUSTED,
  1074. HTT_TX_WAL_ISR_SCHED_SEQ_ABORT,
  1075. HTT_TX_WAL_ISR_SCHED_NOTIFY_FRAME_ENCOUNTERED,
  1076. HTT_TX_WAL_ISR_SCHED_COMPLETION,
  1077. HTT_TX_WAL_ISR_SCHED_IN_PROGRESS,
  1078. } htt_tx_wal_tx_isr_sched_status;
  1079. /* [0]- nr4 , [1]- nr8 */
  1080. #define HTT_STATS_NUM_NR_BINS 2
  1081. /* Termination status stated in htt_tx_wal_tx_isr_sched_status */
  1082. #define HTT_STATS_MAX_NUM_SCHED_STATUS 9
  1083. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST 10
  1084. #define HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS \
  1085. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_SCHED_STATUS)
  1086. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS \
  1087. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST)
  1088. typedef enum {
  1089. HTT_STATS_HWMODE_AC = 0,
  1090. HTT_STATS_HWMODE_AX = 1,
  1091. HTT_STATS_HWMODE_BE = 2,
  1092. } htt_stats_hw_mode;
  1093. typedef struct {
  1094. htt_tlv_hdr_t tlv_hdr;
  1095. A_UINT32 hw_mode; /* HTT_STATS_HWMODE_xx */
  1096. A_UINT32 mu_mimo_num_seq_term_status[HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS];
  1097. A_UINT32 mu_mimo_num_ppdu_completed_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  1098. A_UINT32 mu_mimo_num_seq_posted[HTT_STATS_NUM_NR_BINS];
  1099. A_UINT32 mu_mimo_num_ppdu_posted_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  1100. } htt_stats_mu_ppdu_dist_tlv;
  1101. /* preserve old name alias for new name consistent with the tag name */
  1102. typedef htt_stats_mu_ppdu_dist_tlv htt_pdev_mu_ppdu_dist_tlv_v;
  1103. #define HTT_TX_PDEV_STATS_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1104. /* NOTE: Variable length TLV, use length spec to infer array size .
  1105. *
  1106. * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
  1107. * The tries here is the count of the MPDUS within a PPDU that the
  1108. * HW had attempted to transmit on air, for the HWSCH Schedule
  1109. * command submitted by FW.It is not the retry attempts.
  1110. * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
  1111. * 10 bins in this histogram. They are defined in FW using the
  1112. * following macros
  1113. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  1114. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  1115. *
  1116. */
  1117. typedef struct {
  1118. htt_tlv_hdr_t tlv_hdr;
  1119. A_UINT32 hist_bin_size;
  1120. /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
  1121. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, tried_mpdu_cnt_hist);
  1122. } htt_stats_tx_pdev_tried_mpdu_cnt_hist_tlv;
  1123. /* preserve old name alias for new name consistent with the tag name */
  1124. typedef htt_stats_tx_pdev_tried_mpdu_cnt_hist_tlv
  1125. htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v;
  1126. typedef struct {
  1127. htt_tlv_hdr_t tlv_hdr;
  1128. /* Num MGMT MPDU transmitted by the target */
  1129. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  1130. } htt_stats_pdev_ctrl_path_tx_stats_tlv;
  1131. /* preserve old name alias for new name consistent with the tag name */
  1132. typedef htt_stats_pdev_ctrl_path_tx_stats_tlv htt_pdev_ctrl_path_tx_stats_tlv_v;
  1133. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  1134. * TLV_TAGS:
  1135. * - HTT_STATS_TX_PDEV_CMN_TAG
  1136. * - HTT_STATS_TX_PDEV_URRN_TAG
  1137. * - HTT_STATS_TX_PDEV_SIFS_TAG
  1138. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  1139. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  1140. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  1141. * - HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG
  1142. * - HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG
  1143. * - HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG
  1144. * - HTT_STATS_MU_PPDU_DIST_TAG
  1145. */
  1146. /* NOTE:
  1147. * This structure is for documentation, and cannot be safely used directly.
  1148. * Instead, use the constituent TLV structures to fill/parse.
  1149. */
  1150. #ifdef ATH_TARGET
  1151. typedef struct _htt_tx_pdev_stats {
  1152. htt_stats_tx_pdev_cmn_tlv cmn_tlv;
  1153. htt_stats_tx_pdev_underrun_tlv underrun_tlv;
  1154. htt_stats_tx_pdev_sifs_tlv sifs_tlv;
  1155. htt_stats_tx_pdev_flush_tlv flush_tlv;
  1156. htt_stats_tx_pdev_phy_err_tlv phy_err_tlv;
  1157. htt_stats_tx_pdev_sifs_hist_tlv sifs_hist_tlv;
  1158. htt_stats_tx_pdev_tx_ppdu_stats_tlv tx_su_tlv;
  1159. htt_stats_tx_pdev_tried_mpdu_cnt_hist_tlv tried_mpdu_cnt_hist_tlv;
  1160. htt_stats_pdev_ctrl_path_tx_stats_tlv ctrl_path_tx_tlv;
  1161. htt_stats_mu_ppdu_dist_tlv mu_ppdu_dist_tlv;
  1162. } htt_tx_pdev_stats_t;
  1163. #endif /* ATH_TARGET */
  1164. /* == SOC ERROR STATS == */
  1165. /* =============== PDEV ERROR STATS ============== */
  1166. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  1167. typedef struct {
  1168. htt_tlv_hdr_t tlv_hdr;
  1169. /* Stored as little endian */
  1170. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  1171. A_UINT32 mask;
  1172. A_UINT32 count;
  1173. } htt_stats_hw_intr_misc_tlv;
  1174. /* preserve old name alias for new name consistent with the tag name */
  1175. typedef htt_stats_hw_intr_misc_tlv htt_hw_stats_intr_misc_tlv;
  1176. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  1177. typedef struct {
  1178. htt_tlv_hdr_t tlv_hdr;
  1179. /* Stored as little endian */
  1180. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  1181. A_UINT32 count;
  1182. } htt_stats_hw_wd_timeout_tlv;
  1183. /* preserve old name alias for new name consistent with the tag name */
  1184. typedef htt_stats_hw_wd_timeout_tlv htt_hw_stats_wd_timeout_tlv;
  1185. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  1186. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  1187. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  1188. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  1189. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  1190. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  1191. do { \
  1192. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  1193. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  1194. } while (0)
  1195. typedef struct {
  1196. htt_tlv_hdr_t tlv_hdr;
  1197. /* BIT [ 7 : 0] :- mac_id
  1198. * BIT [31 : 8] :- reserved
  1199. */
  1200. A_UINT32 mac_id__word;
  1201. A_UINT32 tx_abort;
  1202. A_UINT32 tx_abort_fail_count;
  1203. A_UINT32 rx_abort;
  1204. A_UINT32 rx_abort_fail_count;
  1205. A_UINT32 warm_reset;
  1206. A_UINT32 cold_reset;
  1207. A_UINT32 tx_flush;
  1208. A_UINT32 tx_glb_reset;
  1209. A_UINT32 tx_txq_reset;
  1210. A_UINT32 rx_timeout_reset;
  1211. A_UINT32 mac_cold_reset_restore_cal;
  1212. A_UINT32 mac_cold_reset;
  1213. A_UINT32 mac_warm_reset;
  1214. A_UINT32 mac_only_reset;
  1215. A_UINT32 phy_warm_reset;
  1216. A_UINT32 phy_warm_reset_ucode_trig;
  1217. A_UINT32 mac_warm_reset_restore_cal;
  1218. A_UINT32 mac_sfm_reset;
  1219. A_UINT32 phy_warm_reset_m3_ssr;
  1220. A_UINT32 phy_warm_reset_reason_phy_m3;
  1221. A_UINT32 phy_warm_reset_reason_tx_hw_stuck;
  1222. A_UINT32 phy_warm_reset_reason_num_cca_rx_frame_stuck;
  1223. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_rx_busy;
  1224. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_mac_hang;
  1225. A_UINT32 phy_warm_reset_reason_mac_reset_converted_phy_reset;
  1226. A_UINT32 wal_rx_recovery_rst_mac_hang_count;
  1227. A_UINT32 wal_rx_recovery_rst_known_sig_count;
  1228. A_UINT32 wal_rx_recovery_rst_no_rx_count;
  1229. A_UINT32 wal_rx_recovery_rst_no_rx_consecutive_count;
  1230. A_UINT32 wal_rx_recovery_rst_rx_busy_count;
  1231. A_UINT32 wal_rx_recovery_rst_phy_mac_hang_count;
  1232. A_UINT32 rx_flush_cnt; /* Num rx flush issued */
  1233. A_UINT32 phy_warm_reset_reason_tx_lifetime_expiry_cca_stuck;
  1234. A_UINT32 phy_warm_reset_reason_tx_consecutive_flush9_war;
  1235. A_UINT32 phy_warm_reset_reason_tx_hwsch_reset_war;
  1236. A_UINT32 phy_warm_reset_reason_hwsch_wdog_or_cca_wdog_war;
  1237. A_UINT32 fw_rx_rings_reset;
  1238. /**
  1239. * Num of iterations rx leak prevention successfully done.
  1240. */
  1241. A_UINT32 rx_dest_drain_rx_descs_leak_prevention_done;
  1242. /**
  1243. * Num of rx descs successfully saved by rx leak prevention.
  1244. */
  1245. A_UINT32 rx_dest_drain_rx_descs_saved_cnt;
  1246. /*
  1247. * Stats to debug reason Rx leak prevention
  1248. * was not required to be kicked in.
  1249. */
  1250. A_UINT32 rx_dest_drain_rxdma2reo_leak_detected;
  1251. A_UINT32 rx_dest_drain_rxdma2fw_leak_detected;
  1252. A_UINT32 rx_dest_drain_rxdma2wbm_leak_detected;
  1253. A_UINT32 rx_dest_drain_rxdma1_2sw_leak_detected;
  1254. A_UINT32 rx_dest_drain_rx_drain_ok_mac_idle;
  1255. A_UINT32 rx_dest_drain_ok_mac_not_idle;
  1256. A_UINT32 rx_dest_drain_prerequisite_invld;
  1257. A_UINT32 rx_dest_drain_skip_for_non_lmac_reset;
  1258. A_UINT32 rx_dest_drain_hw_fifo_not_empty_post_drain_wait;
  1259. } htt_stats_hw_pdev_errs_tlv;
  1260. /* preserve old name alias for new name consistent with the tag name */
  1261. typedef htt_stats_hw_pdev_errs_tlv htt_hw_stats_pdev_errs_tlv;
  1262. typedef struct {
  1263. htt_tlv_hdr_t tlv_hdr;
  1264. /* BIT [ 7 : 0] :- mac_id
  1265. * BIT [31 : 8] :- reserved
  1266. */
  1267. A_UINT32 mac_id__word;
  1268. A_UINT32 last_unpause_ppdu_id;
  1269. A_UINT32 hwsch_unpause_wait_tqm_write;
  1270. A_UINT32 hwsch_dummy_tlv_skipped;
  1271. A_UINT32 hwsch_misaligned_offset_received;
  1272. A_UINT32 hwsch_reset_count;
  1273. A_UINT32 hwsch_dev_reset_war;
  1274. A_UINT32 hwsch_delayed_pause;
  1275. A_UINT32 hwsch_long_delayed_pause;
  1276. A_UINT32 sch_rx_ppdu_no_response;
  1277. A_UINT32 sch_selfgen_response;
  1278. A_UINT32 sch_rx_sifs_resp_trigger;
  1279. } htt_stats_whal_tx_tlv;
  1280. /* preserve old name alias for new name consistent with the tag name */
  1281. typedef htt_stats_whal_tx_tlv htt_hw_stats_whal_tx_tlv;
  1282. typedef struct {
  1283. htt_tlv_hdr_t tlv_hdr;
  1284. A_UINT32 wsib_event_watchdog_timeout;
  1285. A_UINT32 wsib_event_slave_tlv_length_error;
  1286. A_UINT32 wsib_event_slave_parity_error;
  1287. A_UINT32 wsib_event_slave_direct_message;
  1288. A_UINT32 wsib_event_slave_backpressure_error;
  1289. A_UINT32 wsib_event_master_tlv_length_error;
  1290. } htt_stats_whal_wsi_tlv;
  1291. typedef struct {
  1292. htt_tlv_hdr_t tlv_hdr;
  1293. /**
  1294. * BIT [ 7 : 0] :- mac_id
  1295. * BIT [31 : 8] :- reserved
  1296. */
  1297. union {
  1298. struct {
  1299. A_UINT32 mac_id: 8,
  1300. reserved: 24;
  1301. };
  1302. A_UINT32 mac_id__word;
  1303. };
  1304. /**
  1305. * hw_wars is a variable-length array, with each element counting
  1306. * the number of occurrences of the corresponding type of HW WAR.
  1307. * That is, hw_wars[0] indicates how many times HW WAR 0 occurred,
  1308. * hw_wars[1] indicates how many times HW WAR 1 occurred, etc.
  1309. * The target has an internal HW WAR mapping that it uses to keep
  1310. * track of which HW WAR is WAR 0, which HW WAR is WAR 1, etc.
  1311. */
  1312. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, hw_wars);
  1313. } htt_stats_hw_war_tlv;
  1314. /* preserve old name alias for new name consistent with the tag name */
  1315. typedef htt_stats_hw_war_tlv htt_hw_war_stats_tlv;
  1316. /* provide properly-named macro */
  1317. #define HTT_STATS_HW_WAR_MAC_ID_GET(word) (word & 0xff)
  1318. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  1319. * TLV_TAGS:
  1320. * - HTT_STATS_HW_PDEV_ERRS_TAG
  1321. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  1322. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  1323. * - HTT_STATS_WHAL_TX_TAG
  1324. * - HTT_STATS_HW_WAR_TAG
  1325. */
  1326. /* NOTE:
  1327. * This structure is for documentation, and cannot be safely used directly.
  1328. * Instead, use the constituent TLV structures to fill/parse.
  1329. */
  1330. #ifdef ATH_TARGET
  1331. typedef struct _htt_pdev_err_stats {
  1332. htt_stats_hw_pdev_errs_tlv pdev_errs;
  1333. htt_stats_hw_intr_misc_tlv misc_stats[1];
  1334. htt_stats_hw_wd_timeout_tlv wd_timeout[1];
  1335. htt_stats_whal_tx_tlv whal_tx_stats;
  1336. htt_stats_hw_war_tlv hw_war;
  1337. } htt_hw_err_stats_t;
  1338. #endif /* ATH_TARGET */
  1339. /* ============ PEER STATS ============ */
  1340. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  1341. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  1342. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  1343. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  1344. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  1345. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  1346. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  1347. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  1348. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  1349. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  1350. do { \
  1351. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  1352. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  1353. } while (0)
  1354. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  1355. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  1356. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  1357. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  1360. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  1361. } while (0)
  1362. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  1363. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  1364. HTT_MSDU_FLOW_STATS_DROP_S)
  1365. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  1366. do { \
  1367. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  1368. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  1369. } while (0)
  1370. typedef struct _htt_msdu_flow_stats_tlv {
  1371. htt_tlv_hdr_t tlv_hdr;
  1372. A_UINT32 last_update_timestamp;
  1373. A_UINT32 last_add_timestamp;
  1374. A_UINT32 last_remove_timestamp;
  1375. A_UINT32 total_processed_msdu_count;
  1376. A_UINT32 cur_msdu_count_in_flowq;
  1377. /** This will help to find which peer_id is stuck state */
  1378. A_UINT32 sw_peer_id;
  1379. /**
  1380. * BIT [15 : 0] :- tx_flow_number
  1381. * BIT [19 : 16] :- tid_num
  1382. * BIT [20 : 20] :- drop_rule
  1383. * BIT [31 : 21] :- reserved
  1384. */
  1385. A_UINT32 tx_flow_no__tid_num__drop_rule;
  1386. A_UINT32 last_cycle_enqueue_count;
  1387. A_UINT32 last_cycle_dequeue_count;
  1388. A_UINT32 last_cycle_drop_count;
  1389. /**
  1390. * BIT [15 : 0] :- current_drop_th
  1391. * BIT [31 : 16] :- reserved
  1392. */
  1393. A_UINT32 current_drop_th;
  1394. } htt_stats_peer_msdu_flowq_tlv;
  1395. /* preserve old name alias for new name consistent with the tag name */
  1396. typedef htt_stats_peer_msdu_flowq_tlv htt_msdu_flow_stats_tlv;
  1397. #define MAX_HTT_TID_NAME 8
  1398. /* DWORD sw_peer_id__tid_num */
  1399. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1400. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  1401. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  1402. #define HTT_TX_TID_STATS_TID_NUM_S 16
  1403. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  1404. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  1405. HTT_TX_TID_STATS_SW_PEER_ID_S)
  1406. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1407. do { \
  1408. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  1409. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  1410. } while (0)
  1411. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  1412. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  1413. HTT_TX_TID_STATS_TID_NUM_S)
  1414. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  1415. do { \
  1416. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  1417. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  1418. } while (0)
  1419. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  1420. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  1421. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  1422. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  1423. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  1424. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  1425. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  1426. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  1427. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  1428. do { \
  1429. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  1430. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  1431. } while (0)
  1432. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  1433. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  1434. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  1435. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  1436. do { \
  1437. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  1438. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  1439. } while (0)
  1440. /* Tidq stats */
  1441. typedef struct _htt_tx_tid_stats_tlv {
  1442. htt_tlv_hdr_t tlv_hdr;
  1443. /** Stored as little endian */
  1444. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1445. /**
  1446. * BIT [15 : 0] :- sw_peer_id
  1447. * BIT [31 : 16] :- tid_num
  1448. */
  1449. A_UINT32 sw_peer_id__tid_num;
  1450. /**
  1451. * BIT [ 7 : 0] :- num_sched_pending
  1452. * BIT [15 : 8] :- num_ppdu_in_hwq
  1453. * BIT [31 : 16] :- reserved
  1454. */
  1455. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1456. A_UINT32 tid_flags;
  1457. /** per tid # of hw_queued ppdu */
  1458. A_UINT32 hw_queued;
  1459. /** number of per tid successful PPDU */
  1460. A_UINT32 hw_reaped;
  1461. /** per tid Num MPDUs filtered by HW */
  1462. A_UINT32 mpdus_hw_filter;
  1463. A_UINT32 qdepth_bytes;
  1464. A_UINT32 qdepth_num_msdu;
  1465. A_UINT32 qdepth_num_mpdu;
  1466. A_UINT32 last_scheduled_tsmp;
  1467. A_UINT32 pause_module_id;
  1468. A_UINT32 block_module_id;
  1469. /** tid tx airtime in sec */
  1470. A_UINT32 tid_tx_airtime;
  1471. } htt_stats_tx_tid_details_tlv;
  1472. /* preserve old name alias for new name consistent with the tag name */
  1473. typedef htt_stats_tx_tid_details_tlv htt_tx_tid_stats_tlv;
  1474. /* Tidq stats */
  1475. typedef struct _htt_tx_tid_stats_v1_tlv {
  1476. htt_tlv_hdr_t tlv_hdr;
  1477. /** Stored as little endian */
  1478. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1479. /**
  1480. * BIT [15 : 0] :- sw_peer_id
  1481. * BIT [31 : 16] :- tid_num
  1482. */
  1483. A_UINT32 sw_peer_id__tid_num;
  1484. /**
  1485. * BIT [ 7 : 0] :- num_sched_pending
  1486. * BIT [15 : 8] :- num_ppdu_in_hwq
  1487. * BIT [31 : 16] :- reserved
  1488. */
  1489. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1490. A_UINT32 tid_flags;
  1491. /** Max qdepth in bytes reached by this tid */
  1492. A_UINT32 max_qdepth_bytes;
  1493. /** number of msdus qdepth reached max */
  1494. A_UINT32 max_qdepth_n_msdus;
  1495. A_UINT32 rsvd;
  1496. A_UINT32 qdepth_bytes;
  1497. A_UINT32 qdepth_num_msdu;
  1498. A_UINT32 qdepth_num_mpdu;
  1499. A_UINT32 last_scheduled_tsmp;
  1500. A_UINT32 pause_module_id;
  1501. A_UINT32 block_module_id;
  1502. /** tid tx airtime in sec */
  1503. A_UINT32 tid_tx_airtime;
  1504. A_UINT32 allow_n_flags;
  1505. /**
  1506. * BIT [15 : 0] :- sendn_frms_allowed
  1507. * BIT [31 : 16] :- reserved
  1508. */
  1509. A_UINT32 sendn_frms_allowed;
  1510. /*
  1511. * tid_ext_flags, tid_ext2_flags, and tid_flush_reason are opaque fields
  1512. * that cannot be interpreted by the host.
  1513. * They are only for off-line debug.
  1514. */
  1515. A_UINT32 tid_ext_flags;
  1516. A_UINT32 tid_ext2_flags;
  1517. A_UINT32 tid_flush_reason;
  1518. A_UINT32 mlo_flush_tqm_status_pending_low;
  1519. A_UINT32 mlo_flush_tqm_status_pending_high;
  1520. A_UINT32 mlo_flush_partner_info_low;
  1521. A_UINT32 mlo_flush_partner_info_high;
  1522. A_UINT32 mlo_flush_initator_info_low;
  1523. A_UINT32 mlo_flush_initator_info_high;
  1524. /*
  1525. * head_msdu_tqm_timestamp_us:
  1526. * MSDU enqueue timestamp (TQM reference timestamp) for the MSDU
  1527. * at the head of the MPDU queue
  1528. * head_msdu_tqm_latency_us:
  1529. * The age of the MSDU that is at the head of the MPDU queue,
  1530. * i.e. the delta between the current TQM time and the MSDU's
  1531. * enqueue timestamp.
  1532. */
  1533. A_UINT32 head_msdu_tqm_timestamp_us;
  1534. A_UINT32 head_msdu_tqm_latency_us;
  1535. } htt_stats_tx_tid_details_v1_tlv;
  1536. /* preserve old name alias for new name consistent with the tag name */
  1537. typedef htt_stats_tx_tid_details_v1_tlv htt_tx_tid_stats_v1_tlv;
  1538. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1539. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  1540. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  1541. #define HTT_RX_TID_STATS_TID_NUM_S 16
  1542. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  1543. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  1544. HTT_RX_TID_STATS_SW_PEER_ID_S)
  1545. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1546. do { \
  1547. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  1548. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  1549. } while (0)
  1550. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  1551. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  1552. HTT_RX_TID_STATS_TID_NUM_S)
  1553. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  1554. do { \
  1555. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  1556. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  1557. } while (0)
  1558. typedef struct _htt_rx_tid_stats_tlv {
  1559. htt_tlv_hdr_t tlv_hdr;
  1560. /**
  1561. * BIT [15 : 0] : sw_peer_id
  1562. * BIT [31 : 16] : tid_num
  1563. */
  1564. A_UINT32 sw_peer_id__tid_num;
  1565. /** Stored as little endian */
  1566. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1567. /**
  1568. * dup_in_reorder not collected per tid for now,
  1569. * as there is no wal_peer back ptr in data rx peer.
  1570. */
  1571. A_UINT32 dup_in_reorder;
  1572. A_UINT32 dup_past_outside_window;
  1573. A_UINT32 dup_past_within_window;
  1574. /** Number of per tid MSDUs with flag of decrypt_err */
  1575. A_UINT32 rxdesc_err_decrypt;
  1576. /** tid rx airtime in sec */
  1577. A_UINT32 tid_rx_airtime;
  1578. } htt_stats_rx_tid_details_tlv;
  1579. /* preserve old name alias for new name consistent with the tag name */
  1580. typedef htt_stats_rx_tid_details_tlv htt_rx_tid_stats_tlv;
  1581. #define HTT_MAX_COUNTER_NAME 8
  1582. typedef struct {
  1583. htt_tlv_hdr_t tlv_hdr;
  1584. /** Stored as little endian */
  1585. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  1586. A_UINT32 count;
  1587. } htt_stats_counter_name_tlv;
  1588. /* preserve old name alias for new name consistent with the tag name */
  1589. typedef htt_stats_counter_name_tlv htt_counter_tlv;
  1590. typedef struct {
  1591. htt_tlv_hdr_t tlv_hdr;
  1592. /** Number of rx PPDU */
  1593. A_UINT32 ppdu_cnt;
  1594. /** Number of rx MPDU */
  1595. A_UINT32 mpdu_cnt;
  1596. /** Number of rx MSDU */
  1597. A_UINT32 msdu_cnt;
  1598. /** pause bitmap */
  1599. A_UINT32 pause_bitmap;
  1600. /** block bitmap */
  1601. A_UINT32 block_bitmap;
  1602. /** current timestamp */
  1603. A_UINT32 current_timestamp;
  1604. /** Peer cumulative tx airtime in sec */
  1605. A_UINT32 peer_tx_airtime;
  1606. /** Peer cumulative rx airtime in sec */
  1607. A_UINT32 peer_rx_airtime;
  1608. /** Peer current rssi in dBm */
  1609. A_INT32 rssi;
  1610. /** Total enqueued, dequeued and dropped MSDU's for peer */
  1611. A_UINT32 peer_enqueued_count_low;
  1612. A_UINT32 peer_enqueued_count_high;
  1613. A_UINT32 peer_dequeued_count_low;
  1614. A_UINT32 peer_dequeued_count_high;
  1615. A_UINT32 peer_dropped_count_low;
  1616. A_UINT32 peer_dropped_count_high;
  1617. /** Total ppdu transmitted bytes for peer: includes MAC header overhead */
  1618. A_UINT32 ppdu_transmitted_bytes_low;
  1619. A_UINT32 ppdu_transmitted_bytes_high;
  1620. A_UINT32 peer_ttl_removed_count;
  1621. /**
  1622. * inactive_time
  1623. * Running duration of the time since last tx/rx activity by this peer,
  1624. * units = seconds.
  1625. * If the peer is currently active, this inactive_time will be 0x0.
  1626. */
  1627. A_UINT32 inactive_time;
  1628. /** Number of MPDUs dropped after max retries */
  1629. A_UINT32 remove_mpdus_max_retries;
  1630. } htt_stats_peer_stats_cmn_tlv;
  1631. /* preserve old name alias for new name consistent with the tag name */
  1632. typedef htt_stats_peer_stats_cmn_tlv htt_peer_stats_cmn_tlv;
  1633. #define HTT_PEER_DETAILS_ML_PEER_OFFSET_BYTES 32
  1634. #define HTT_PEER_DETAILS_ML_PEER_OFFSET_DWORD 8
  1635. #define HTT_PEER_DETAILS_ML_PEER_ID_VALID_M 0x00000001
  1636. #define HTT_PEER_DETAILS_ML_PEER_ID_VALID_S 0
  1637. #define HTT_PEER_DETAILS_ML_PEER_ID_M 0x00001ffe
  1638. #define HTT_PEER_DETAILS_ML_PEER_ID_S 1
  1639. #define HTT_PEER_DETAILS_LINK_IDX_M 0x001fe000
  1640. #define HTT_PEER_DETAILS_LINK_IDX_S 13
  1641. #define HTT_PEER_DETAILS_USE_PPE_M 0x00200000
  1642. #define HTT_PEER_DETAILS_USE_PPE_S 21
  1643. #define HTT_PEER_DETAILS_SRC_INFO_M 0x00000fff
  1644. #define HTT_PEER_DETAILS_SRC_INFO_S 0
  1645. #define HTT_PEER_DETAILS_SET(word, httsym, val) \
  1646. do { \
  1647. HTT_CHECK_SET_VAL(HTT_PEER_DETAILS_ ## httsym, val); \
  1648. (word) |= ((val) << HTT_PEER_DETAILS_ ## httsym ## _S); \
  1649. } while(0)
  1650. #define HTT_PEER_DETAILS_GET(word, httsym) \
  1651. (((word) & HTT_PEER_DETAILS_ ## httsym ## _M) >> HTT_PEER_DETAILS_ ## httsym ## _S)
  1652. typedef struct {
  1653. htt_tlv_hdr_t tlv_hdr;
  1654. /** This enum type of HTT_PEER_TYPE */
  1655. A_UINT32 peer_type;
  1656. A_UINT32 sw_peer_id;
  1657. /**
  1658. * BIT [7 : 0] :- vdev_id
  1659. * BIT [15 : 8] :- pdev_id
  1660. * BIT [31 : 16] :- ast_indx
  1661. */
  1662. A_UINT32 vdev_pdev_ast_idx;
  1663. htt_mac_addr mac_addr;
  1664. A_UINT32 peer_flags;
  1665. A_UINT32 qpeer_flags;
  1666. /* Dword 8 */
  1667. union {
  1668. A_UINT32 word__ml_peer_id_valid__ml_peer_id__link_idx__use_ppe;
  1669. struct {
  1670. A_UINT32 ml_peer_id_valid : 1, /* [0:0] */
  1671. ml_peer_id : 12, /* [12:1] */
  1672. link_idx : 8, /* [20:13] */
  1673. use_ppe : 1, /* [21:21] */
  1674. rsvd0 : 10; /* [31:22] */
  1675. };
  1676. };
  1677. /* Dword 9 */
  1678. union {
  1679. A_UINT32 word__src_info;
  1680. struct {
  1681. A_UINT32 src_info : 12, /* [11:0] */
  1682. rsvd1 : 20; /* [31:12] */
  1683. };
  1684. };
  1685. } htt_stats_peer_details_tlv;
  1686. /* preserve old name alias for new name consistent with the tag name */
  1687. typedef htt_stats_peer_details_tlv htt_peer_details_tlv;
  1688. #define HTT_STATS_PEER_DETAILS_ML_PEER_ID_VALID_GET(word) ((word >> 0) & 0x1)
  1689. #define HTT_STATS_PEER_DETAILS_ML_PEER_ID_GET(word) ((word >> 1) & 0xfff)
  1690. #define HTT_STATS_PEER_DETAILS_LINK_IDX_GET(word) ((word >> 13) & 0xff)
  1691. #define HTT_STATS_PEER_DETAILS_USE_PPE_GET(word) ((word >> 21) & 0x1)
  1692. #define HTT_STATS_PEER_DETAILS_SRC_INFO_GET(word) ((word >> 0) & 0xfff)
  1693. typedef struct {
  1694. htt_tlv_hdr_t tlv_hdr;
  1695. A_UINT32 sw_peer_id;
  1696. A_UINT32 ast_index;
  1697. htt_mac_addr mac_addr;
  1698. A_UINT32
  1699. pdev_id : 2,
  1700. vdev_id : 8,
  1701. next_hop : 1,
  1702. mcast : 1,
  1703. monitor_direct : 1,
  1704. mesh_sta : 1,
  1705. mec : 1,
  1706. intra_bss : 1,
  1707. chip_id : 2,
  1708. ml_peer_id : 13,
  1709. on_chip : 1;
  1710. A_UINT32
  1711. tx_monitor_override_sta : 1,
  1712. rx_monitor_override_sta : 1,
  1713. reserved1 : 30;
  1714. } htt_stats_ast_entry_tlv;
  1715. /* preserve old name alias for new name consistent with the tag name */
  1716. typedef htt_stats_ast_entry_tlv htt_ast_entry_tlv;
  1717. typedef enum {
  1718. HTT_STATS_DIRECTION_TX,
  1719. HTT_STATS_DIRECTION_RX,
  1720. } HTT_STATS_DIRECTION;
  1721. typedef enum {
  1722. HTT_STATS_PPDU_TYPE_MODE_SU,
  1723. HTT_STATS_PPDU_TYPE_DL_MU_MIMO,
  1724. HTT_STATS_PPDU_TYPE_UL_MU_MIMO,
  1725. HTT_STATS_PPDU_TYPE_DL_MU_OFDMA,
  1726. HTT_STATS_PPDU_TYPE_UL_MU_OFDMA,
  1727. } HTT_STATS_PPDU_TYPE;
  1728. typedef enum {
  1729. HTT_STATS_PREAM_OFDM,
  1730. HTT_STATS_PREAM_CCK,
  1731. HTT_STATS_PREAM_HT,
  1732. HTT_STATS_PREAM_VHT,
  1733. HTT_STATS_PREAM_HE,
  1734. HTT_STATS_PREAM_EHT,
  1735. HTT_STATS_PREAM_RSVD1,
  1736. HTT_STATS_PREAM_COUNT,
  1737. } HTT_STATS_PREAM_TYPE;
  1738. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1739. #define HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1740. /* HTT_TX_PEER_STATS_NUM_GI_COUNTERS:
  1741. * GI Index 0: WHAL_GI_800
  1742. * GI Index 1: WHAL_GI_400
  1743. * GI Index 2: WHAL_GI_1600
  1744. * GI Index 3: WHAL_GI_3200
  1745. */
  1746. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  1747. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  1748. /* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
  1749. * bw index 0: rssi_pri20_chain0
  1750. * bw index 1: rssi_ext20_chain0
  1751. * bw index 2: rssi_ext40_low20_chain0
  1752. * bw index 3: rssi_ext40_high20_chain0
  1753. */
  1754. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  1755. /* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
  1756. * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
  1757. * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
  1758. * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
  1759. * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
  1760. */
  1761. #define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
  1762. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS 4
  1763. /* HTT_RX STATS_NUM_BW_EXT_2_COUNTERS:
  1764. * bw index 8 (bw ext_2 index 0): rssi_ext160_0_chainX
  1765. * bw index 9 (bw ext_2 index 1): rssi_ext160_1_chainX
  1766. * bw index 10 (bw ext_2 index 2): rssi_ext160_2_chainX
  1767. * bw index 11 (bw ext_2 index 3): rssi_ext160_3_chainX
  1768. * bw index 12 (bw ext_2 index 4): rssi_ext160_4_chainX
  1769. * bw index 13 (bw ext_2 index 5): rssi_ext160_5_chainX
  1770. * bw index 14 (bw ext_2 index 6): rssi_ext160_6_chainX
  1771. * bw index 15 (bw ext_2 index 7): rssi_ext160_7_chainX
  1772. */
  1773. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_2_COUNTERS 8
  1774. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1775. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1776. #define HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1777. typedef struct _htt_tx_peer_rate_stats_tlv {
  1778. htt_tlv_hdr_t tlv_hdr;
  1779. /** Number of tx LDPC packets */
  1780. A_UINT32 tx_ldpc;
  1781. /** Number of tx RTS packets */
  1782. A_UINT32 rts_cnt;
  1783. /** RSSI value of last ack packet (units = dB above noise floor) */
  1784. A_UINT32 ack_rssi;
  1785. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1786. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1787. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1788. /**
  1789. * element 0,1, ...7 -> NSS 1,2, ...8
  1790. */
  1791. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS];
  1792. /**
  1793. * element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz
  1794. */
  1795. A_UINT32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
  1796. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1797. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1798. /**
  1799. * Counters to track number of tx packets in each GI
  1800. * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
  1801. */
  1802. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1803. /** Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  1804. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  1805. /** Stats for MCS 12/13 */
  1806. A_UINT32 tx_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1807. A_UINT32 tx_su_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1808. A_UINT32 tx_mu_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1809. A_UINT32 tx_stbc_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1810. A_UINT32 tx_gi_ext[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1811. A_UINT32 reduced_tx_bw[HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
  1812. A_UINT32 tx_bw_320mhz;
  1813. } htt_stats_peer_tx_rate_stats_tlv;
  1814. /* preserve old name alias for new name consistent with the tag name */
  1815. typedef htt_stats_peer_tx_rate_stats_tlv htt_tx_peer_rate_stats_tlv;
  1816. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1817. #define HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1818. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  1819. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  1820. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  1821. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1822. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1823. #define HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1824. typedef struct _htt_rx_peer_rate_stats_tlv {
  1825. htt_tlv_hdr_t tlv_hdr;
  1826. A_UINT32 nsts;
  1827. /** Number of rx LDPC packets */
  1828. A_UINT32 rx_ldpc;
  1829. /** Number of rx RTS packets */
  1830. A_UINT32 rts_cnt;
  1831. /** units = dB above noise floor */
  1832. A_UINT32 rssi_mgmt;
  1833. /** units = dB above noise floor */
  1834. A_UINT32 rssi_data;
  1835. /** units = dB above noise floor */
  1836. A_UINT32 rssi_comb;
  1837. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1838. /**
  1839. * element 0,1, ...7 -> NSS 1,2, ...8
  1840. */
  1841. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS];
  1842. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  1843. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1844. /**
  1845. * element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz
  1846. */
  1847. A_UINT32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1848. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1849. /** units = dB above noise floor */
  1850. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1851. /** Counters to track number of rx packets in each GI in each mcs (0-11) */
  1852. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1853. A_UINT32 rx_ulofdma_non_data_ppdu; /** PPDU level */
  1854. A_UINT32 rx_ulofdma_data_ppdu; /** PPDU level */
  1855. A_UINT32 rx_ulofdma_mpdu_ok; /** MPDU level */
  1856. A_UINT32 rx_ulofdma_mpdu_fail; /** MPDU level */
  1857. A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* dBm unit */
  1858. /* per_chain_rssi_pkt_type:
  1859. * This field shows what type of rx frame the per-chain RSSI was computed
  1860. * on, by recording the frame type and sub-type as bit-fields within this
  1861. * field:
  1862. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  1863. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  1864. * BIT [31 : 8] :- Reserved
  1865. */
  1866. A_UINT32 per_chain_rssi_pkt_type;
  1867. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1868. /** PPDU level */
  1869. A_UINT32 rx_ulmumimo_non_data_ppdu;
  1870. /** PPDU level */
  1871. A_UINT32 rx_ulmumimo_data_ppdu;
  1872. /** MPDU level */
  1873. A_UINT32 rx_ulmumimo_mpdu_ok;
  1874. /** mpdu level */
  1875. A_UINT32 rx_ulmumimo_mpdu_fail;
  1876. /** units = dB above noise floor */
  1877. A_UINT8 rssi_chain_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS];
  1878. /** Stats for MCS 12/13 */
  1879. A_UINT32 rx_mcs_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1880. A_UINT32 rx_stbc_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1881. A_UINT32 rx_gi_ext[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1882. A_UINT32 reduced_rx_bw[HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1883. A_INT8 rx_per_chain_rssi_in_dbm_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS];
  1884. } htt_stats_peer_rx_rate_stats_tlv;
  1885. /* preserve old name alias for new name consistent with the tag name */
  1886. typedef htt_stats_peer_rx_rate_stats_tlv htt_rx_peer_rate_stats_tlv;
  1887. typedef enum {
  1888. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  1889. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  1890. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  1891. } htt_peer_stats_req_mode_t;
  1892. typedef enum {
  1893. HTT_PEER_STATS_CMN_TLV = 0,
  1894. HTT_PEER_DETAILS_TLV = 1,
  1895. HTT_TX_PEER_RATE_STATS_TLV = 2,
  1896. HTT_RX_PEER_RATE_STATS_TLV = 3,
  1897. HTT_TX_TID_STATS_TLV = 4,
  1898. HTT_RX_TID_STATS_TLV = 5,
  1899. HTT_MSDU_FLOW_STATS_TLV = 6,
  1900. HTT_PEER_SCHED_STATS_TLV = 7,
  1901. HTT_PEER_AX_OFDMA_STATS_TLV = 8,
  1902. HTT_PEER_BE_OFDMA_STATS_TLV = 9,
  1903. HTT_PEER_STATS_MAX_TLV = 31,
  1904. } htt_peer_stats_tlv_enum;
  1905. typedef struct {
  1906. htt_tlv_hdr_t tlv_hdr;
  1907. A_UINT32 peer_id;
  1908. /** Num of DL schedules for peer */
  1909. A_UINT32 num_sched_dl;
  1910. /** Num od UL schedules for peer */
  1911. A_UINT32 num_sched_ul;
  1912. /** Peer TX time */
  1913. A_UINT32 peer_tx_active_dur_us_low;
  1914. A_UINT32 peer_tx_active_dur_us_high;
  1915. /** Peer RX time */
  1916. A_UINT32 peer_rx_active_dur_us_low;
  1917. A_UINT32 peer_rx_active_dur_us_high;
  1918. A_UINT32 peer_curr_rate_kbps;
  1919. } htt_stats_peer_sched_stats_tlv;
  1920. /* preserve old name alias for new name consistent with the tag name */
  1921. typedef htt_stats_peer_sched_stats_tlv htt_peer_sched_stats_tlv;
  1922. typedef struct {
  1923. htt_tlv_hdr_t tlv_hdr;
  1924. A_UINT32 peer_id;
  1925. A_UINT32 ax_basic_trig_count;
  1926. A_UINT32 ax_basic_trig_err;
  1927. A_UINT32 ax_bsr_trig_count;
  1928. A_UINT32 ax_bsr_trig_err;
  1929. A_UINT32 ax_mu_bar_trig_count;
  1930. A_UINT32 ax_mu_bar_trig_err;
  1931. A_UINT32 ax_basic_trig_with_per;
  1932. A_UINT32 ax_bsr_trig_with_per;
  1933. A_UINT32 ax_mu_bar_trig_with_per;
  1934. /* is_airtime_large_for_dl_ofdma, is_airtime_large_for_ul_ofdma
  1935. * These fields contain 2 counters each. The first element in each
  1936. * array counts how many times the airtime is short enough to use
  1937. * OFDMA, and the second element in each array counts how many times the
  1938. * airtime is too large to select OFDMA for the PPDUs involving the peer.
  1939. */
  1940. A_UINT32 is_airtime_large_for_dl_ofdma[2];
  1941. A_UINT32 is_airtime_large_for_ul_ofdma[2];
  1942. /* Last updated value of DL and UL queue depths for each peer per AC */
  1943. A_UINT32 last_updated_dl_qdepth[HTT_NUM_AC_WMM];
  1944. A_UINT32 last_updated_ul_qdepth[HTT_NUM_AC_WMM];
  1945. /* Per peer Manual 11ax UL OFDMA trigger and trigger error counts */
  1946. A_UINT32 ax_manual_ulofdma_trig_count;
  1947. A_UINT32 ax_manual_ulofdma_trig_err_count;
  1948. } htt_stats_peer_ax_ofdma_stats_tlv;
  1949. /* preserve old name alias for new name consistent with the tag name */
  1950. typedef htt_stats_peer_ax_ofdma_stats_tlv htt_peer_ax_ofdma_stats_tlv;
  1951. typedef struct {
  1952. htt_tlv_hdr_t tlv_hdr;
  1953. A_UINT32 peer_id;
  1954. /* Per peer Manual 11be UL OFDMA trigger and trigger error counts */
  1955. A_UINT32 be_manual_ulofdma_trig_count;
  1956. A_UINT32 be_manual_ulofdma_trig_err_count;
  1957. } htt_stats_peer_be_ofdma_stats_tlv;
  1958. /* preserve old name alias for new name consistent with the tag name */
  1959. typedef htt_stats_peer_be_ofdma_stats_tlv htt_peer_be_ofdma_stats_tlv;
  1960. /* config_param0 */
  1961. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M 0x00000001
  1962. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S 0
  1963. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_GET(_var) \
  1964. (((_var) & HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M) >> \
  1965. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)
  1966. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_SET(_var, _val) \
  1967. do { \
  1968. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR, _val); \
  1969. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)); \
  1970. } while (0)
  1971. /* DEPRECATED
  1972. * The old IS_peer_MAC_ADDR_SET macro name is being retained for now,
  1973. * as an alias for the corrected macro name.
  1974. * If/when all references to the old name are removed, the definition of
  1975. * the old name will also be removed.
  1976. */
  1977. #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
  1978. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  1979. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  1980. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  1981. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  1982. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  1983. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  1984. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  1987. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  1988. } while (0)
  1989. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  1990. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  1991. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  1992. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  1993. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  1994. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  1995. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  1996. do { \
  1997. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  1998. } while (0)
  1999. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  2000. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  2001. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  2002. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  2003. do { \
  2004. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  2005. } while (0)
  2006. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  2007. * TLV_TAGS:
  2008. * - HTT_STATS_PEER_STATS_CMN_TAG
  2009. * - HTT_STATS_PEER_DETAILS_TAG
  2010. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  2011. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  2012. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  2013. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  2014. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  2015. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  2016. * - HTT_STATS_PEER_SCHED_STATS_TAG
  2017. * - HTT_STATS_PEER_AX_OFDMA_STATS_TAG
  2018. */
  2019. /* NOTE:
  2020. * This structure is for documentation, and cannot be safely used directly.
  2021. * Instead, use the constituent TLV structures to fill/parse.
  2022. */
  2023. #ifdef ATH_TARGET
  2024. typedef struct _htt_peer_stats {
  2025. htt_stats_peer_stats_cmn_tlv cmn_tlv;
  2026. htt_stats_peer_details_tlv peer_details;
  2027. /* from g_rate_info_stats */
  2028. htt_stats_peer_tx_rate_stats_tlv tx_rate;
  2029. htt_stats_peer_rx_rate_stats_tlv rx_rate;
  2030. htt_stats_tx_tid_details_tlv tx_tid_stats[1];
  2031. htt_stats_rx_tid_details_tlv rx_tid_stats[1];
  2032. htt_stats_peer_msdu_flowq_tlv msdu_flowq[1];
  2033. htt_stats_tx_tid_details_v1_tlv tx_tid_stats_v1[1];
  2034. htt_stats_peer_sched_stats_tlv peer_sched_stats;
  2035. htt_stats_peer_ax_ofdma_stats_tlv ax_ofdma_stats;
  2036. htt_stats_peer_be_ofdma_stats_tlv be_ofdma_stats;
  2037. } htt_peer_stats_t;
  2038. #endif /* ATH_TARGET */
  2039. /* =========== ACTIVE PEER LIST ========== */
  2040. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  2041. * TLV_TAGS:
  2042. * - HTT_STATS_PEER_DETAILS_TAG
  2043. */
  2044. /* NOTE:
  2045. * This structure is for documentation, and cannot be safely used directly.
  2046. * Instead, use the constituent TLV structures to fill/parse.
  2047. */
  2048. #ifdef ATH_TARGET
  2049. typedef struct {
  2050. htt_stats_peer_details_tlv peer_details[1];
  2051. } htt_active_peer_details_list_t;
  2052. #endif /* ATH_TARGET */
  2053. /* =========== MUMIMO HWQ stats =========== */
  2054. /* MU MIMO stats per hwQ */
  2055. typedef struct {
  2056. htt_tlv_hdr_t tlv_hdr;
  2057. /** number of MU MIMO schedules posted to HW */
  2058. A_UINT32 mu_mimo_sch_posted;
  2059. /** number of MU MIMO schedules failed to post */
  2060. A_UINT32 mu_mimo_sch_failed;
  2061. /** number of MU MIMO PPDUs posted to HW */
  2062. A_UINT32 mu_mimo_ppdu_posted;
  2063. } htt_stats_tx_hwq_mumimo_sch_stats_tlv;
  2064. /* preserve old name alias for new name consistent with the tag name */
  2065. typedef htt_stats_tx_hwq_mumimo_sch_stats_tlv htt_tx_hwq_mu_mimo_sch_stats_tlv;
  2066. typedef struct {
  2067. htt_tlv_hdr_t tlv_hdr;
  2068. /** 11AC DL MU MIMO number of mpdus queued to HW, per user */
  2069. A_UINT32 mu_mimo_mpdus_queued_usr;
  2070. /** 11AC DL MU MIMO number of mpdus tried over the air, per user */
  2071. A_UINT32 mu_mimo_mpdus_tried_usr;
  2072. /** 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  2073. A_UINT32 mu_mimo_mpdus_failed_usr;
  2074. /** 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  2075. A_UINT32 mu_mimo_mpdus_requeued_usr;
  2076. /** 11AC DL MU MIMO BA not received, per user */
  2077. A_UINT32 mu_mimo_err_no_ba_usr;
  2078. /** 11AC DL MU MIMO mpdu underrun encountered, per user */
  2079. A_UINT32 mu_mimo_mpdu_underrun_usr;
  2080. /** 11AC DL MU MIMO ampdu underrun encountered, per user */
  2081. A_UINT32 mu_mimo_ampdu_underrun_usr;
  2082. } htt_stats_tx_hwq_mumimo_mpdu_stats_tlv;
  2083. /* preserve old name alias for new name consistent with the tag name */
  2084. typedef htt_stats_tx_hwq_mumimo_mpdu_stats_tlv
  2085. htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  2086. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  2087. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  2088. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  2089. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  2090. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  2091. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  2092. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  2093. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  2097. } while (0)
  2098. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  2099. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  2100. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  2101. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  2105. } while (0)
  2106. typedef struct {
  2107. htt_tlv_hdr_t tlv_hdr;
  2108. /**
  2109. * BIT [ 7 : 0] :- mac_id
  2110. * BIT [15 : 8] :- hwq_id
  2111. * BIT [31 : 16] :- reserved
  2112. */
  2113. A_UINT32 mac_id__hwq_id__word;
  2114. } htt_stats_tx_hwq_mumimo_cmn_stats_tlv;
  2115. /* preserve old name alias for new name consistent with the tag name */
  2116. typedef htt_stats_tx_hwq_mumimo_cmn_stats_tlv htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  2117. /* NOTE:
  2118. * This structure is for documentation, and cannot be safely used directly.
  2119. * Instead, use the constituent TLV structures to fill/parse.
  2120. */
  2121. #ifdef ATH_TARGET
  2122. typedef struct {
  2123. struct {
  2124. htt_stats_tx_hwq_mumimo_cmn_stats_tlv cmn_tlv;
  2125. /** WAL_TX_STATS_MAX_GROUP_SIZE */
  2126. htt_stats_tx_hwq_mumimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1];
  2127. /** WAL_TX_STATS_TX_MAX_NUM_USERS */
  2128. htt_stats_tx_hwq_mumimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1];
  2129. } hwq[1];
  2130. } htt_tx_hwq_mu_mimo_stats_t;
  2131. #endif /* ATH_TARGET */
  2132. /* == TX HWQ STATS == */
  2133. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  2134. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  2135. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  2136. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  2137. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  2138. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  2139. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  2140. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  2141. do { \
  2142. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  2143. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  2144. } while (0)
  2145. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  2146. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  2147. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  2148. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  2152. } while (0)
  2153. typedef struct {
  2154. htt_tlv_hdr_t tlv_hdr;
  2155. /**
  2156. * BIT [ 7 : 0] :- mac_id
  2157. * BIT [15 : 8] :- hwq_id
  2158. * BIT [31 : 16] :- reserved
  2159. */
  2160. A_UINT32 mac_id__hwq_id__word;
  2161. /*--- PPDU level stats */
  2162. /** Number of times ack is failed for the PPDU scheduled on this txQ */
  2163. A_UINT32 xretry;
  2164. /** Number of times sched cmd status reported mpdu underrun */
  2165. A_UINT32 underrun_cnt;
  2166. /** Number of times sched cmd is flushed */
  2167. A_UINT32 flush_cnt;
  2168. /** Number of times sched cmd is filtered */
  2169. A_UINT32 filt_cnt;
  2170. /** Number of times HWSCH uploaded null mpdu bitmap */
  2171. A_UINT32 null_mpdu_bmap;
  2172. /**
  2173. * Number of times user ack or BA TLV is not seen on FES ring
  2174. * where it is expected to be
  2175. */
  2176. A_UINT32 user_ack_failure;
  2177. /** Number of times TQM processed ack TLV received from HWSCH */
  2178. A_UINT32 ack_tlv_proc;
  2179. /** Cache latest processed scheduler ID received from ack BA TLV */
  2180. A_UINT32 sched_id_proc;
  2181. /** Number of times TxPCU reported MPDUs transmitted for a user is zero */
  2182. A_UINT32 null_mpdu_tx_count;
  2183. /**
  2184. * Number of times SW did not see any MPDU info bitmap TLV
  2185. * on FES status ring
  2186. */
  2187. A_UINT32 mpdu_bmap_not_recvd;
  2188. /*--- Selfgen stats per hwQ */
  2189. /** Number of SU/MU BAR frames posted to hwQ */
  2190. A_UINT32 num_bar;
  2191. /** Number of RTS frames posted to hwQ */
  2192. A_UINT32 rts;
  2193. /** Number of cts2self frames posted to hwQ */
  2194. A_UINT32 cts2self;
  2195. /** Number of qos null frames posted to hwQ */
  2196. A_UINT32 qos_null;
  2197. /*--- MPDU level stats */
  2198. /** mpdus tried Tx by HWSCH/TQM */
  2199. A_UINT32 mpdu_tried_cnt;
  2200. /** mpdus queued to HWSCH */
  2201. A_UINT32 mpdu_queued_cnt;
  2202. /** mpdus tried but ack was not received */
  2203. A_UINT32 mpdu_ack_fail_cnt;
  2204. /** This will include sched cmd flush and time based discard */
  2205. A_UINT32 mpdu_filt_cnt;
  2206. /** Number of MPDUs for which ACK was successful but no Tx happened */
  2207. A_UINT32 false_mpdu_ack_count;
  2208. /** Number of times txq timeout happened */
  2209. A_UINT32 txq_timeout;
  2210. } htt_stats_tx_hwq_cmn_tlv;
  2211. /* preserve old name alias for new name consistent with the tag name */
  2212. typedef htt_stats_tx_hwq_cmn_tlv htt_tx_hwq_stats_cmn_tlv;
  2213. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) + /* hist_intvl */ \
  2214. (sizeof(A_UINT32) * (_num_elems)))
  2215. /* NOTE: Variable length TLV, use length spec to infer array size */
  2216. typedef struct {
  2217. htt_tlv_hdr_t tlv_hdr;
  2218. A_UINT32 hist_intvl;
  2219. /** difs_latency_hist:
  2220. * histogram of ppdu post to hwsch - > cmd status receive,
  2221. * HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS
  2222. */
  2223. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, difs_latency_hist);
  2224. } htt_stats_tx_hwq_difs_latency_tlv;
  2225. /* preserve old name alias for new name consistent with the tag name */
  2226. typedef htt_stats_tx_hwq_difs_latency_tlv htt_tx_hwq_difs_latency_stats_tlv_v;
  2227. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2228. /* NOTE: Variable length TLV, use length spec to infer array size */
  2229. typedef struct {
  2230. htt_tlv_hdr_t tlv_hdr;
  2231. /** cmd_result:
  2232. * Histogram of sched cmd result,
  2233. * HTT_TX_HWQ_MAX_CMD_RESULT_STATS
  2234. */
  2235. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, cmd_result);
  2236. } htt_stats_tx_hwq_cmd_result_tlv;
  2237. /* preserve old name alias for new name consistent with the tag name */
  2238. typedef htt_stats_tx_hwq_cmd_result_tlv htt_tx_hwq_cmd_result_stats_tlv_v;
  2239. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2240. /* NOTE: Variable length TLV, use length spec to infer array size */
  2241. typedef struct {
  2242. htt_tlv_hdr_t tlv_hdr;
  2243. /** cmd_stall_status:
  2244. * Histogram of various pause conitions
  2245. * HTT_TX_HWQ_MAX_CMD_STALL_STATS
  2246. */
  2247. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, cmd_stall_status);
  2248. } htt_stats_tx_hwq_cmd_stall_tlv;
  2249. /* preserve old name alias for new name consistent with the tag name */
  2250. typedef htt_stats_tx_hwq_cmd_stall_tlv htt_tx_hwq_cmd_stall_stats_tlv_v;
  2251. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2252. /* NOTE: Variable length TLV, use length spec to infer array size */
  2253. typedef struct {
  2254. htt_tlv_hdr_t tlv_hdr;
  2255. /** fes_result:
  2256. * Histogram of number of user fes result,
  2257. * HTT_TX_HWQ_MAX_FES_RESULT_STATS
  2258. */
  2259. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fes_result);
  2260. } htt_stats_tx_hwq_fes_status_tlv;
  2261. /* preserve old name alias for new name consistent with the tag name */
  2262. typedef htt_stats_tx_hwq_fes_status_tlv htt_tx_hwq_fes_result_stats_tlv_v;
  2263. #define HTT_TX_HWQ_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2264. /* NOTE: Variable length TLV, use length spec to infer array size
  2265. *
  2266. * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
  2267. * The tries here is the count of the MPDUS within a PPDU that the HW
  2268. * had attempted to transmit on air, for the HWSCH Schedule command
  2269. * submitted by FW in this HWQ .It is not the retry attempts. The
  2270. * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
  2271. * in this histogram.
  2272. * they are defined in FW using the following macros
  2273. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  2274. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  2275. *
  2276. * */
  2277. typedef struct {
  2278. htt_tlv_hdr_t tlv_hdr;
  2279. A_UINT32 hist_bin_size;
  2280. /** tried_mpdu_cnt_hist:
  2281. * Histogram of number of mpdus on tried mpdu,
  2282. * HTT_TX_HWQ_TRIED_MPDU_CNT_HIST
  2283. */
  2284. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, tried_mpdu_cnt_hist);
  2285. } htt_stats_tx_hwq_tried_mpdu_cnt_hist_tlv;
  2286. /* preserve old name alias for new name consistent with the tag name */
  2287. typedef htt_stats_tx_hwq_tried_mpdu_cnt_hist_tlv
  2288. htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v;
  2289. #define HTT_TX_HWQ_TXOP_USED_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2290. /* NOTE: Variable length TLV, use length spec to infer array size
  2291. *
  2292. * The txop_used_cnt_hist is the histogram of txop per burst. After
  2293. * completing the burst, we identify the txop used in the burst and
  2294. * incr the corresponding bin.
  2295. * Each bin represents 1ms & we have 10 bins in this histogram.
  2296. * they are defined in FW using the following macros
  2297. * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
  2298. * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
  2299. *
  2300. * */
  2301. typedef struct {
  2302. htt_tlv_hdr_t tlv_hdr;
  2303. /** txop_used_cnt_hist:
  2304. * Histogram of txop used cnt,
  2305. * HTT_TX_HWQ_TXOP_USED_CNT_HIST
  2306. */
  2307. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, txop_used_cnt_hist);
  2308. } htt_stats_tx_hwq_txop_used_cnt_hist_tlv;
  2309. /* preserve old name alias for new name consistent with the tag name */
  2310. typedef htt_stats_tx_hwq_txop_used_cnt_hist_tlv
  2311. htt_tx_hwq_txop_used_cnt_hist_tlv_v;
  2312. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  2313. * TLV_TAGS:
  2314. * - HTT_STATS_STRING_TAG
  2315. * - HTT_STATS_TX_HWQ_CMN_TAG
  2316. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  2317. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  2318. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  2319. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  2320. * - HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG
  2321. * - HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG
  2322. */
  2323. /* NOTE:
  2324. * This structure is for documentation, and cannot be safely used directly.
  2325. * Instead, use the constituent TLV structures to fill/parse.
  2326. * General HWQ stats Mechanism:
  2327. * Once the host request for the stats, FW fill all the HWQ TAGS in a buffer
  2328. * for all the HWQ requested. & the FW send the buffer to host. In the
  2329. * buffer the HWQ ID is filled in mac_id__hwq_id, thus identifying each
  2330. * HWQ distinctly.
  2331. */
  2332. #ifdef ATH_TARGET
  2333. typedef struct _htt_tx_hwq_stats {
  2334. htt_stats_string_tlv hwq_str_tlv;
  2335. htt_stats_tx_hwq_cmn_tlv cmn_tlv;
  2336. htt_stats_tx_hwq_difs_latency_tlv difs_tlv;
  2337. htt_stats_tx_hwq_cmd_result_tlv cmd_result_tlv;
  2338. htt_stats_tx_hwq_cmd_stall_tlv cmd_stall_tlv;
  2339. htt_stats_tx_hwq_fes_status_tlv fes_stats_tlv;
  2340. htt_stats_tx_hwq_tried_mpdu_cnt_hist_tlv tried_mpdu_tlv;
  2341. htt_stats_tx_hwq_txop_used_cnt_hist_tlv txop_used_tlv;
  2342. } htt_tx_hwq_stats_t;
  2343. #endif /* ATH_TARGET */
  2344. /* == TX SELFGEN STATS == */
  2345. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  2346. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  2347. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  2348. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  2349. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  2350. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  2354. } while (0)
  2355. typedef enum {
  2356. HTT_TXERR_NONE,
  2357. HTT_TXERR_RESP, /* response timeout, mismatch,
  2358. * BW mismatch, mimo ctrl mismatch,
  2359. * CRC error.. */
  2360. HTT_TXERR_FILT, /* blocked by tx filtering */
  2361. HTT_TXERR_FIFO, /* fifo, misc errors in HW */
  2362. HTT_TXERR_SWABORT, /* software initialted abort (TX_ABORT) */
  2363. HTT_TXERR_RESERVED1,
  2364. HTT_TXERR_RESERVED2,
  2365. HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS = 7,
  2366. HTT_TXERR_INVALID = 0xff,
  2367. } htt_tx_err_status_t;
  2368. /* Matching enum for htt_tx_selfgen_sch_tsflag_error_stats */
  2369. typedef enum {
  2370. HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR,
  2371. HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR,
  2372. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR,
  2373. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR,
  2374. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR,
  2375. HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR,
  2376. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR,
  2377. HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR,
  2378. HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS = 8,
  2379. HTT_TX_SELFGEN_SCH_TSFLAG_ERROR_STATS_VALID = 8
  2380. } htt_tx_selfgen_sch_tsflag_error_stats;
  2381. typedef enum {
  2382. HTT_TX_MUMIMO_GRP_VALID,
  2383. HTT_TX_MUMIMO_GRP_INVALID_NUM_MU_USERS_EXCEEDED_MU_MAX_USERS,
  2384. HTT_TX_MUMIMO_GRP_INVALID_SCHED_ALGO_NOT_MU_COMPATIBLE_GID,
  2385. HTT_TX_MUMIMO_GRP_INVALID_NON_PRIMARY_GRP,
  2386. HTT_TX_MUMIMO_GRP_INVALID_ZERO_CANDIDATES,
  2387. HTT_TX_MUMIMO_GRP_INVALID_MORE_CANDIDATES,
  2388. HTT_TX_MUMIMO_GRP_INVALID_GROUP_SIZE_EXCEED_NSS,
  2389. HTT_TX_MUMIMO_GRP_INVALID_GROUP_INELIGIBLE,
  2390. HTT_TX_MUMIMO_GRP_INVALID,
  2391. HTT_TX_MUMIMO_GRP_INVALID_GROUP_EFF_MU_TPUT_OMBPS,
  2392. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE,
  2393. } htt_tx_mumimo_grp_invalid_reason_code_stats;
  2394. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  2395. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  2396. #define HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS 8
  2397. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  2398. #define HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS 8
  2399. #define HTT_STATS_MAX_MUMIMO_GRP_SZ 8
  2400. /*
  2401. * Each bin represents a 300 mbps throughput
  2402. * [0] - 0-300mbps; [1] - 300-600mbps [2] - 600-900mbps; [3] - 900-1200mbps; [4] - 1200-1500mbps
  2403. * [5] - 1500-1800mbps; [6] - 1800-2100mbps; [7] - 2100-2400mbps; [8] - 2400-2700mbps; [9] - >=2700mbps
  2404. */
  2405. #define HTT_STATS_MUMIMO_TPUT_NUM_BINS 10
  2406. #define HTT_STATS_MAX_INVALID_REASON_CODE \
  2407. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE
  2408. /* Reasons stated in htt_tx_mumimo_grp_invalid_reason_code_stats */
  2409. #define HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS \
  2410. (HTT_STATS_MAX_MUMIMO_GRP_SZ * HTT_STATS_MAX_INVALID_REASON_CODE)
  2411. #define HTT_MAX_NUM_SBT_INTR 4
  2412. typedef struct {
  2413. htt_tlv_hdr_t tlv_hdr;
  2414. /*
  2415. * BIT [ 7 : 0] :- mac_id
  2416. * BIT [31 : 8] :- reserved
  2417. */
  2418. A_UINT32 mac_id__word;
  2419. /** BAR sent out for SU transmission */
  2420. A_UINT32 su_bar;
  2421. /** SW generated RTS frame sent */
  2422. A_UINT32 rts;
  2423. /** SW generated CTS-to-self frame sent */
  2424. A_UINT32 cts2self;
  2425. /** SW generated QOS NULL frame sent */
  2426. A_UINT32 qos_null;
  2427. /** BAR sent for MU user 1 */
  2428. A_UINT32 delayed_bar_1;
  2429. /** BAR sent for MU user 2 */
  2430. A_UINT32 delayed_bar_2;
  2431. /** BAR sent for MU user 3 */
  2432. A_UINT32 delayed_bar_3;
  2433. /** BAR sent for MU user 4 */
  2434. A_UINT32 delayed_bar_4;
  2435. /** BAR sent for MU user 5 */
  2436. A_UINT32 delayed_bar_5;
  2437. /** BAR sent for MU user 6 */
  2438. A_UINT32 delayed_bar_6;
  2439. /** BAR sent for MU user 7 */
  2440. A_UINT32 delayed_bar_7;
  2441. A_UINT32 bar_with_tqm_head_seq_num;
  2442. A_UINT32 bar_with_tid_seq_num;
  2443. /** SW generated RTS frame queued to the HW */
  2444. A_UINT32 su_sw_rts_queued;
  2445. /** SW generated RTS frame sent over the air */
  2446. A_UINT32 su_sw_rts_tried;
  2447. /** SW generated RTS frame completed with error */
  2448. A_UINT32 su_sw_rts_err;
  2449. /** SW generated RTS frame flushed */
  2450. A_UINT32 su_sw_rts_flushed;
  2451. /** CTS (RTS response) received in different BW */
  2452. A_UINT32 su_sw_rts_rcvd_cts_diff_bw;
  2453. /* START DEPRECATED FIELDS */
  2454. /** 11AX HE MU Combined Freq. BSRP Trigger frame sent over the air */
  2455. A_UINT32 combined_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2456. /** 11AX HE MU Combined Freq. BSRP Trigger completed with error(s) */
  2457. A_UINT32 combined_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2458. /** 11AX HE MU Standalone Freq. BSRP Trigger frame sent over the air */
  2459. A_UINT32 standalone_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2460. /** 11AX HE MU Standalone Freq. BSRP Trigger completed with error(s) */
  2461. A_UINT32 standalone_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2462. /* END DEPRECATED FIELDS */
  2463. /** smart_basic_trig_sch_histogram:
  2464. * Count how many times the interval between predictive basic triggers
  2465. * sent to a given STA based on analysis of that STA's traffic patterns
  2466. * is within a given range:
  2467. *
  2468. * smart_basic_trig_sch_histogram[0]: SBT interval <= 10 ms
  2469. * smart_basic_trig_sch_histogram[1]: 10 ms < SBT interval <= 20 ms
  2470. * smart_basic_trig_sch_histogram[2]: 20 ms < SBT interval <= 30 ms
  2471. * smart_basic_trig_sch_histogram[3]: 30 ms < SBT interval <= 40 ms
  2472. *
  2473. * (Smart basic triggers are only used with intervals <= 40 ms.)
  2474. */
  2475. A_UINT32 smart_basic_trig_sch_histogram[HTT_MAX_NUM_SBT_INTR];
  2476. } htt_stats_tx_selfgen_cmn_stats_tlv;
  2477. /* preserve old name alias for new name consistent with the tag name */
  2478. typedef htt_stats_tx_selfgen_cmn_stats_tlv htt_tx_selfgen_cmn_stats_tlv;
  2479. typedef struct {
  2480. htt_tlv_hdr_t tlv_hdr;
  2481. /** 11AC VHT SU NDPA frame sent over the air */
  2482. A_UINT32 ac_su_ndpa;
  2483. /** 11AC VHT SU NDP frame sent over the air */
  2484. A_UINT32 ac_su_ndp;
  2485. /** 11AC VHT MU MIMO NDPA frame sent over the air */
  2486. A_UINT32 ac_mu_mimo_ndpa;
  2487. /** 11AC VHT MU MIMO NDP frame sent over the air */
  2488. A_UINT32 ac_mu_mimo_ndp;
  2489. /** 11AC VHT MU MIMO BR-POLL for user 1 sent over the air */
  2490. A_UINT32 ac_mu_mimo_brpoll_1;
  2491. /** 11AC VHT MU MIMO BR-POLL for user 2 sent over the air */
  2492. A_UINT32 ac_mu_mimo_brpoll_2;
  2493. /** 11AC VHT MU MIMO BR-POLL for user 3 sent over the air */
  2494. A_UINT32 ac_mu_mimo_brpoll_3;
  2495. /** 11AC VHT SU NDPA frame queued to the HW */
  2496. A_UINT32 ac_su_ndpa_queued;
  2497. /** 11AC VHT SU NDP frame queued to the HW */
  2498. A_UINT32 ac_su_ndp_queued;
  2499. /** 11AC VHT MU MIMO NDPA frame queued to the HW */
  2500. A_UINT32 ac_mu_mimo_ndpa_queued;
  2501. /** 11AC VHT MU MIMO NDP frame queued to the HW */
  2502. A_UINT32 ac_mu_mimo_ndp_queued;
  2503. /** 11AC VHT MU MIMO BR-POLL for user 1 frame queued to the HW */
  2504. A_UINT32 ac_mu_mimo_brpoll_1_queued;
  2505. /** 11AC VHT MU MIMO BR-POLL for user 2 frame queued to the HW */
  2506. A_UINT32 ac_mu_mimo_brpoll_2_queued;
  2507. /** 11AC VHT MU MIMO BR-POLL for user 3 frame queued to the HW */
  2508. A_UINT32 ac_mu_mimo_brpoll_3_queued;
  2509. } htt_stats_tx_selfgen_ac_stats_tlv;
  2510. /* preserve old name alias for new name consistent with the tag name */
  2511. typedef htt_stats_tx_selfgen_ac_stats_tlv htt_tx_selfgen_ac_stats_tlv;
  2512. typedef struct {
  2513. htt_tlv_hdr_t tlv_hdr;
  2514. /** 11AX HE SU NDPA frame sent over the air */
  2515. A_UINT32 ax_su_ndpa;
  2516. /** 11AX HE NDP frame sent over the air */
  2517. A_UINT32 ax_su_ndp;
  2518. /** 11AX HE MU MIMO NDPA frame sent over the air */
  2519. A_UINT32 ax_mu_mimo_ndpa;
  2520. /** 11AX HE MU MIMO NDP frame sent over the air */
  2521. A_UINT32 ax_mu_mimo_ndp;
  2522. union {
  2523. struct {
  2524. /* deprecated old names */
  2525. A_UINT32 ax_mu_mimo_brpoll_1;
  2526. A_UINT32 ax_mu_mimo_brpoll_2;
  2527. A_UINT32 ax_mu_mimo_brpoll_3;
  2528. A_UINT32 ax_mu_mimo_brpoll_4;
  2529. A_UINT32 ax_mu_mimo_brpoll_5;
  2530. A_UINT32 ax_mu_mimo_brpoll_6;
  2531. A_UINT32 ax_mu_mimo_brpoll_7;
  2532. };
  2533. /** 11AX HE MU BR-POLL frame for users 1 - 7 sent over the air */
  2534. A_UINT32 ax_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2535. };
  2536. /** 11AX HE MU Basic Trigger frame sent over the air */
  2537. A_UINT32 ax_basic_trigger;
  2538. /** 11AX HE MU BSRP Trigger frame sent over the air */
  2539. A_UINT32 ax_bsr_trigger;
  2540. /** 11AX HE MU BAR Trigger frame sent over the air */
  2541. A_UINT32 ax_mu_bar_trigger;
  2542. /** 11AX HE MU RTS Trigger frame sent over the air */
  2543. A_UINT32 ax_mu_rts_trigger;
  2544. /** 11AX HE MU UL-MUMIMO Trigger frame sent over the air */
  2545. A_UINT32 ax_ulmumimo_trigger;
  2546. /** 11AX HE SU NDPA frame queued to the HW */
  2547. A_UINT32 ax_su_ndpa_queued;
  2548. /** 11AX HE SU NDP frame queued to the HW */
  2549. A_UINT32 ax_su_ndp_queued;
  2550. /** 11AX HE MU MIMO NDPA frame queued to the HW */
  2551. A_UINT32 ax_mu_mimo_ndpa_queued;
  2552. /** 11AX HE MU MIMO NDP frame queued to the HW */
  2553. A_UINT32 ax_mu_mimo_ndp_queued;
  2554. /** 11AX HE MU BR-POLL frame for users 1 - 7 queued to the HW */
  2555. A_UINT32 ax_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2556. /**
  2557. * 11AX HE UL-MUMIMO Trigger frame for users 0 - 7
  2558. * successfully sent over the air
  2559. */
  2560. A_UINT32 ax_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2561. /** 11AX HE MU Combined Freq. BSRP Trigger frame sent over the air */
  2562. A_UINT32 combined_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2563. /** 11AX HE MU Combined Freq. BSRP Trigger completed with error(s) */
  2564. A_UINT32 combined_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2565. /** 11AX HE MU Standalone Freq. BSRP Trigger frame sent over the air */
  2566. A_UINT32 standalone_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2567. /** 11AX HE MU Standalone Freq. BSRP Trigger completed with error(s) */
  2568. A_UINT32 standalone_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2569. /** 11AX HE Manual Single-User UL OFDMA Trigger frame sent over the air */
  2570. A_UINT32 manual_ax_su_ulofdma_basic_trigger[HTT_NUM_AC_WMM];
  2571. /** 11AX HE Manual Single-User UL OFDMA Trigger completed with error(s) */
  2572. A_UINT32 manual_ax_su_ulofdma_basic_trigger_err[HTT_NUM_AC_WMM];
  2573. /** 11AX HE Manual Multi-User UL OFDMA Trigger frame sent over the air */
  2574. A_UINT32 manual_ax_mu_ulofdma_basic_trigger[HTT_NUM_AC_WMM];
  2575. /** 11AX HE Manual Multi-User UL OFDMA Trigger completed with error(s) */
  2576. A_UINT32 manual_ax_mu_ulofdma_basic_trigger_err[HTT_NUM_AC_WMM];
  2577. /** 11AX HE UL OFDMA Basic Trigger frames per AC */
  2578. A_UINT32 ax_basic_trigger_per_ac[HTT_NUM_AC_WMM];
  2579. /** 11AX HE UL OFDMA Basic Trigger frames per AC completed with error(s) */
  2580. A_UINT32 ax_basic_trigger_errors_per_ac[HTT_NUM_AC_WMM];
  2581. /** 11AX HE MU-BAR Trigger frames per AC */
  2582. A_UINT32 ax_mu_bar_trigger_per_ac[HTT_NUM_AC_WMM];
  2583. /** 11AX HE MU-BAR Trigger frames per AC completed with error(s) */
  2584. A_UINT32 ax_mu_bar_trigger_errors_per_ac[HTT_NUM_AC_WMM];
  2585. } htt_stats_tx_selfgen_ax_stats_tlv;
  2586. /* preserve old name alias for new name consistent with the tag name */
  2587. typedef htt_stats_tx_selfgen_ax_stats_tlv htt_tx_selfgen_ax_stats_tlv;
  2588. typedef struct {
  2589. htt_tlv_hdr_t tlv_hdr;
  2590. /** 11be EHT SU NDPA frame sent over the air */
  2591. A_UINT32 be_su_ndpa;
  2592. /** 11be EHT NDP frame sent over the air */
  2593. A_UINT32 be_su_ndp;
  2594. /** 11be EHT MU MIMO NDPA frame sent over the air */
  2595. A_UINT32 be_mu_mimo_ndpa;
  2596. /** 11be EHT MU MIMO NDP frame sent over theT air */
  2597. A_UINT32 be_mu_mimo_ndp;
  2598. /** 11be EHT MU BR-POLL frame for users 1 - 7 sent over the air */
  2599. A_UINT32 be_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2600. /** 11be EHT MU Basic Trigger frame sent over the air */
  2601. A_UINT32 be_basic_trigger;
  2602. /** 11be EHT MU BSRP Trigger frame sent over the air */
  2603. A_UINT32 be_bsr_trigger;
  2604. /** 11be EHT MU BAR Trigger frame sent over the air */
  2605. A_UINT32 be_mu_bar_trigger;
  2606. /** 11be EHT MU RTS Trigger frame sent over the air */
  2607. A_UINT32 be_mu_rts_trigger;
  2608. /** 11be EHT MU UL-MUMIMO Trigger frame sent over the air */
  2609. A_UINT32 be_ulmumimo_trigger;
  2610. /** 11be EHT SU NDPA frame queued to the HW */
  2611. A_UINT32 be_su_ndpa_queued;
  2612. /** 11be EHT SU NDP frame queued to the HW */
  2613. A_UINT32 be_su_ndp_queued;
  2614. /** 11be EHT MU MIMO NDPA frame queued to the HW */
  2615. A_UINT32 be_mu_mimo_ndpa_queued;
  2616. /** 11be EHT MU MIMO NDP frame queued to the HW */
  2617. A_UINT32 be_mu_mimo_ndp_queued;
  2618. /** 11be EHT MU BR-POLL frame for users 1 - 7 queued to the HW */
  2619. A_UINT32 be_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2620. /**
  2621. * 11be EHT UL-MUMIMO Trigger frame for users 0 - 7
  2622. * successfully sent over the air
  2623. */
  2624. A_UINT32 be_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2625. /** 11BE EHT MU Combined Freq. BSRP Trigger frame sent over the air */
  2626. A_UINT32 combined_be_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2627. /** 11BE EHT MU Combined Freq. BSRP Trigger completed with error(s) */
  2628. A_UINT32 combined_be_bsr_trigger_err[HTT_NUM_AC_WMM];
  2629. /** 11BE EHT MU Standalone Freq. BSRP Trigger frame sent over the air */
  2630. A_UINT32 standalone_be_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2631. /** 11BE EHT MU Standalone Freq. BSRP Trigger completed with error(s) */
  2632. A_UINT32 standalone_be_bsr_trigger_err[HTT_NUM_AC_WMM];
  2633. /** 11BE EHT Manual Single-User UL OFDMA Trigger frame sent over the air */
  2634. A_UINT32 manual_be_su_ulofdma_basic_trigger[HTT_NUM_AC_WMM];
  2635. /** 11BE EHT Manual Single-User UL OFDMA Trigger completed with error(s) */
  2636. A_UINT32 manual_be_su_ulofdma_basic_trigger_err[HTT_NUM_AC_WMM];
  2637. /** 11BE EHT Manual Multi-User UL OFDMA Trigger frame sent over the air */
  2638. A_UINT32 manual_be_mu_ulofdma_basic_trigger[HTT_NUM_AC_WMM];
  2639. /** 11BE EHT Manual Multi-User UL OFDMA Trigger completed with error(s) */
  2640. A_UINT32 manual_be_mu_ulofdma_basic_trigger_err[HTT_NUM_AC_WMM];
  2641. /** 11BE EHT UL OFDMA Basic Trigger frames per AC */
  2642. A_UINT32 be_basic_trigger_per_ac[HTT_NUM_AC_WMM];
  2643. /** 11BE EHT UL OFDMA Basic Trigger frames per AC completed with error(s) */
  2644. A_UINT32 be_basic_trigger_errors_per_ac[HTT_NUM_AC_WMM];
  2645. /** 11BE EHT MU-BAR Trigger frames per AC */
  2646. A_UINT32 be_mu_bar_trigger_per_ac[HTT_NUM_AC_WMM];
  2647. /** 11BE EHT MU-BAR Trigger frames per AC completed with error(s) */
  2648. A_UINT32 be_mu_bar_trigger_errors_per_ac[HTT_NUM_AC_WMM];
  2649. } htt_stats_tx_selfgen_be_stats_tlv;
  2650. /* preserve old name alias for new name consistent with the tag name */
  2651. typedef htt_stats_tx_selfgen_be_stats_tlv htt_tx_selfgen_be_stats_tlv;
  2652. typedef struct { /* DEPRECATED */
  2653. htt_tlv_hdr_t tlv_hdr;
  2654. /** 11AX HE OFDMA NDPA frame queued to the HW */
  2655. A_UINT32 ax_ofdma_ndpa_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2656. /** 11AX HE OFDMA NDPA frame sent over the air */
  2657. A_UINT32 ax_ofdma_ndpa_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2658. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2659. A_UINT32 ax_ofdma_ndpa_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2660. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2661. A_UINT32 ax_ofdma_ndpa_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2662. } htt_stats_txbf_ofdma_ndpa_stats_tlv;
  2663. /* preserve old name alias for new name consistent with the tag name */
  2664. typedef htt_stats_txbf_ofdma_ndpa_stats_tlv htt_txbf_ofdma_ndpa_stats_tlv;
  2665. typedef struct { /* DEPRECATED */
  2666. htt_tlv_hdr_t tlv_hdr;
  2667. /** 11AX HE OFDMA NDP frame queued to the HW */
  2668. A_UINT32 ax_ofdma_ndp_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2669. /** 11AX HE OFDMA NDPA frame sent over the air */
  2670. A_UINT32 ax_ofdma_ndp_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2671. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2672. A_UINT32 ax_ofdma_ndp_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2673. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2674. A_UINT32 ax_ofdma_ndp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2675. } htt_stats_txbf_ofdma_ndp_stats_tlv;
  2676. /* preserve old name alias for new name consistent with the tag name */
  2677. typedef htt_stats_txbf_ofdma_ndp_stats_tlv htt_txbf_ofdma_ndp_stats_tlv;
  2678. typedef struct { /* DEPRECATED */
  2679. htt_tlv_hdr_t tlv_hdr;
  2680. /** 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  2681. A_UINT32 ax_ofdma_brpoll_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2682. /** 11AX HE OFDMA MU BRPOLL frame sent over the air */
  2683. A_UINT32 ax_ofdma_brpoll_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2684. /** 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  2685. A_UINT32 ax_ofdma_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2686. /** 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  2687. A_UINT32 ax_ofdma_brp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2688. /**
  2689. * Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame
  2690. * completed with error(s)
  2691. */
  2692. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS+1];
  2693. } htt_stats_txbf_ofdma_brp_stats_tlv;
  2694. /* preserve old name alias for new name consistent with the tag name */
  2695. typedef htt_stats_txbf_ofdma_brp_stats_tlv htt_txbf_ofdma_brp_stats_tlv;
  2696. typedef struct { /* DEPRECATED */
  2697. htt_tlv_hdr_t tlv_hdr;
  2698. /**
  2699. * 11AX HE OFDMA PPDUs that were sent over the air with steering
  2700. * (TXBF + OFDMA)
  2701. */
  2702. A_UINT32 ax_ofdma_num_ppdu_steer[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2703. /** 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  2704. A_UINT32 ax_ofdma_num_ppdu_ol[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2705. /**
  2706. * 11AX HE OFDMA number of users for which CBF prefetch was initiated
  2707. * to PHY HW during TX
  2708. */
  2709. A_UINT32 ax_ofdma_num_usrs_prefetch[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2710. /**
  2711. * 11AX HE OFDMA number of users for which sounding was initiated
  2712. * during TX
  2713. */
  2714. A_UINT32 ax_ofdma_num_usrs_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2715. /** 11AX HE OFDMA number of users for which sounding was forced during TX */
  2716. A_UINT32 ax_ofdma_num_usrs_force_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2717. } htt_stats_txbf_ofdma_steer_stats_tlv;
  2718. /* preserve old name alias for new name consistent with the tag name */
  2719. typedef htt_stats_txbf_ofdma_steer_stats_tlv htt_txbf_ofdma_steer_stats_tlv;
  2720. /* Note:
  2721. * This struct htt_tx_pdev_txbf_ofdma_stats_t and all its constituent
  2722. * struct TLVs are deprecated, due to the need for restructuring these
  2723. * stats into a variable length array
  2724. */
  2725. #ifdef ATH_TARGET
  2726. typedef struct { /* DEPRECATED */
  2727. htt_stats_txbf_ofdma_ndpa_stats_tlv ofdma_ndpa_tlv;
  2728. htt_stats_txbf_ofdma_ndp_stats_tlv ofdma_ndp_tlv;
  2729. htt_stats_txbf_ofdma_brp_stats_tlv ofdma_brp_tlv;
  2730. htt_stats_txbf_ofdma_steer_stats_tlv ofdma_steer_tlv;
  2731. } htt_tx_pdev_txbf_ofdma_stats_t;
  2732. #endif /* ATH_TARGET */
  2733. typedef struct {
  2734. /** 11AX HE OFDMA NDPA frame queued to the HW */
  2735. A_UINT32 ax_ofdma_ndpa_queued;
  2736. /** 11AX HE OFDMA NDPA frame sent over the air */
  2737. A_UINT32 ax_ofdma_ndpa_tried;
  2738. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2739. A_UINT32 ax_ofdma_ndpa_flushed;
  2740. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2741. A_UINT32 ax_ofdma_ndpa_err;
  2742. } htt_txbf_ofdma_ax_ndpa_stats_elem_t;
  2743. typedef struct {
  2744. htt_tlv_hdr_t tlv_hdr;
  2745. /**
  2746. * This field is populated with the num of elems in the ax_ndpa[]
  2747. * variable length array.
  2748. */
  2749. A_UINT32 num_elems_ax_ndpa_arr;
  2750. /**
  2751. * This field will be filled by target with value of
  2752. * sizeof(htt_txbf_ofdma_ax_ndpa_stats_elem_t).
  2753. * This is for allowing host to infer how much data target has provided,
  2754. * even if it using different version of the struct def than what target
  2755. * had used.
  2756. */
  2757. A_UINT32 arr_elem_size_ax_ndpa;
  2758. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_ax_ndpa_stats_elem_t, ax_ndpa);
  2759. } htt_stats_txbf_ofdma_ax_ndpa_stats_tlv;
  2760. /* preserve old name alias for new name consistent with the tag name */
  2761. typedef htt_stats_txbf_ofdma_ax_ndpa_stats_tlv htt_txbf_ofdma_ax_ndpa_stats_tlv;
  2762. typedef struct {
  2763. /** 11AX HE OFDMA NDP frame queued to the HW */
  2764. A_UINT32 ax_ofdma_ndp_queued;
  2765. /** 11AX HE OFDMA NDPA frame sent over the air */
  2766. A_UINT32 ax_ofdma_ndp_tried;
  2767. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2768. A_UINT32 ax_ofdma_ndp_flushed;
  2769. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2770. A_UINT32 ax_ofdma_ndp_err;
  2771. } htt_txbf_ofdma_ax_ndp_stats_elem_t;
  2772. typedef struct {
  2773. htt_tlv_hdr_t tlv_hdr;
  2774. /**
  2775. * This field is populated with the num of elems in the the ax_ndp[]
  2776. * variable length array.
  2777. */
  2778. A_UINT32 num_elems_ax_ndp_arr;
  2779. /**
  2780. * This field will be filled by target with value of
  2781. * sizeof(htt_txbf_ofdma_ax_ndp_stats_elem_t).
  2782. * This is for allowing host to infer how much data target has provided,
  2783. * even if it using different version of the struct def than what target
  2784. * had used.
  2785. */
  2786. A_UINT32 arr_elem_size_ax_ndp;
  2787. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_ax_ndp_stats_elem_t, ax_ndp);
  2788. } htt_stats_txbf_ofdma_ax_ndp_stats_tlv;
  2789. /* preserve old name alias for new name consistent with the tag name */
  2790. typedef htt_stats_txbf_ofdma_ax_ndp_stats_tlv htt_txbf_ofdma_ax_ndp_stats_tlv;
  2791. typedef struct {
  2792. /** 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  2793. A_UINT32 ax_ofdma_brpoll_queued;
  2794. /** 11AX HE OFDMA MU BRPOLL frame sent over the air */
  2795. A_UINT32 ax_ofdma_brpoll_tried;
  2796. /** 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  2797. A_UINT32 ax_ofdma_brpoll_flushed;
  2798. /** 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  2799. A_UINT32 ax_ofdma_brp_err;
  2800. /**
  2801. * Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame
  2802. * completed with error(s)
  2803. */
  2804. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd;
  2805. } htt_txbf_ofdma_ax_brp_stats_elem_t;
  2806. typedef struct {
  2807. htt_tlv_hdr_t tlv_hdr;
  2808. /**
  2809. * This field is populated with the num of elems in the the ax_brp[]
  2810. * variable length array.
  2811. */
  2812. A_UINT32 num_elems_ax_brp_arr;
  2813. /**
  2814. * This field will be filled by target with value of
  2815. * sizeof(htt_txbf_ofdma_ax_brp_stats_elem_t).
  2816. * This is for allowing host to infer how much data target has provided,
  2817. * even if it using different version of the struct than what target
  2818. * had used.
  2819. */
  2820. A_UINT32 arr_elem_size_ax_brp;
  2821. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_ax_brp_stats_elem_t, ax_brp);
  2822. } htt_stats_txbf_ofdma_ax_brp_stats_tlv;
  2823. /* preserve old name alias for new name consistent with the tag name */
  2824. typedef htt_stats_txbf_ofdma_ax_brp_stats_tlv htt_txbf_ofdma_ax_brp_stats_tlv;
  2825. typedef struct {
  2826. /**
  2827. * 11AX HE OFDMA PPDUs that were sent over the air with steering
  2828. * (TXBF + OFDMA)
  2829. */
  2830. A_UINT32 ax_ofdma_num_ppdu_steer;
  2831. /** 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  2832. A_UINT32 ax_ofdma_num_ppdu_ol;
  2833. /**
  2834. * 11AX HE OFDMA number of users for which CBF prefetch was initiated
  2835. * to PHY HW during TX
  2836. */
  2837. A_UINT32 ax_ofdma_num_usrs_prefetch;
  2838. /**
  2839. * 11AX HE OFDMA number of users for which sounding was initiated
  2840. * during TX
  2841. */
  2842. A_UINT32 ax_ofdma_num_usrs_sound;
  2843. /** 11AX HE OFDMA number of users for which sounding was forced during TX */
  2844. A_UINT32 ax_ofdma_num_usrs_force_sound;
  2845. } htt_txbf_ofdma_ax_steer_stats_elem_t;
  2846. typedef struct {
  2847. htt_tlv_hdr_t tlv_hdr;
  2848. /**
  2849. * This field is populated with the num of elems in the ax_steer[]
  2850. * variable length array.
  2851. */
  2852. A_UINT32 num_elems_ax_steer_arr;
  2853. /**
  2854. * This field will be filled by target with value of
  2855. * sizeof(htt_txbf_ofdma_ax_steer_stats_elem_t).
  2856. * This is for allowing host to infer how much data target has provided,
  2857. * even if it using different version of the struct than what target
  2858. * had used.
  2859. */
  2860. A_UINT32 arr_elem_size_ax_steer;
  2861. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_ax_steer_stats_elem_t, ax_steer);
  2862. } htt_stats_txbf_ofdma_ax_steer_stats_tlv;
  2863. /* preserve old name alias for new name consistent with the tag name */
  2864. typedef htt_stats_txbf_ofdma_ax_steer_stats_tlv
  2865. htt_txbf_ofdma_ax_steer_stats_tlv;
  2866. typedef struct {
  2867. htt_tlv_hdr_t tlv_hdr;
  2868. /* 11AX HE OFDMA MPDUs tried in rbo steering */
  2869. A_UINT32 ax_ofdma_rbo_steer_mpdus_tried;
  2870. /* 11AX HE OFDMA MPDUs failed in rbo steering */
  2871. A_UINT32 ax_ofdma_rbo_steer_mpdus_failed;
  2872. /* 11AX HE OFDMA MPDUs tried in sifs steering */
  2873. A_UINT32 ax_ofdma_sifs_steer_mpdus_tried;
  2874. /* 11AX HE OFDMA MPDUs failed in sifs steering */
  2875. A_UINT32 ax_ofdma_sifs_steer_mpdus_failed;
  2876. } htt_stats_txbf_ofdma_ax_steer_mpdu_stats_tlv;
  2877. /* preserve old name alias for new name consistent with the tag name */
  2878. typedef htt_stats_txbf_ofdma_ax_steer_mpdu_stats_tlv
  2879. htt_txbf_ofdma_ax_steer_mpdu_stats_tlv;
  2880. typedef struct {
  2881. /** 11BE EHT OFDMA NDPA frame queued to the HW */
  2882. A_UINT32 be_ofdma_ndpa_queued;
  2883. /** 11BE EHT OFDMA NDPA frame sent over the air */
  2884. A_UINT32 be_ofdma_ndpa_tried;
  2885. /** 11BE EHT OFDMA NDPA frame flushed by HW */
  2886. A_UINT32 be_ofdma_ndpa_flushed;
  2887. /** 11BE EHT OFDMA NDPA frame completed with error(s) */
  2888. A_UINT32 be_ofdma_ndpa_err;
  2889. } htt_txbf_ofdma_be_ndpa_stats_elem_t;
  2890. typedef struct {
  2891. htt_tlv_hdr_t tlv_hdr;
  2892. /**
  2893. * This field is populated with the num of elems in the be_ndpa[]
  2894. * variable length array.
  2895. */
  2896. A_UINT32 num_elems_be_ndpa_arr;
  2897. /**
  2898. * This field will be filled by target with value of
  2899. * sizeof(htt_txbf_ofdma_be_ndpa_stats_elem_t).
  2900. * This is for allowing host to infer how much data target has provided,
  2901. * even if it using different version of the struct than what target
  2902. * had used.
  2903. */
  2904. A_UINT32 arr_elem_size_be_ndpa;
  2905. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_be_ndpa_stats_elem_t, be_ndpa);
  2906. } htt_stats_txbf_ofdma_be_ndpa_stats_tlv;
  2907. /* preserve old name alias for new name consistent with the tag name */
  2908. typedef htt_stats_txbf_ofdma_be_ndpa_stats_tlv htt_txbf_ofdma_be_ndpa_stats_tlv;
  2909. typedef struct {
  2910. /** 11BE EHT OFDMA NDP frame queued to the HW */
  2911. A_UINT32 be_ofdma_ndp_queued;
  2912. /** 11BE EHT OFDMA NDPA frame sent over the air */
  2913. A_UINT32 be_ofdma_ndp_tried;
  2914. /** 11BE EHT OFDMA NDPA frame flushed by HW */
  2915. A_UINT32 be_ofdma_ndp_flushed;
  2916. /** 11BE EHT OFDMA NDPA frame completed with error(s) */
  2917. A_UINT32 be_ofdma_ndp_err;
  2918. } htt_txbf_ofdma_be_ndp_stats_elem_t;
  2919. typedef struct {
  2920. htt_tlv_hdr_t tlv_hdr;
  2921. /**
  2922. * This field is populated with the num of elems in the be_ndp[]
  2923. * variable length array.
  2924. */
  2925. A_UINT32 num_elems_be_ndp_arr;
  2926. /**
  2927. * This field will be filled by target with value of
  2928. * sizeof(htt_txbf_ofdma_be_ndp_stats_elem_t).
  2929. * This is for allowing host to infer how much data target has provided,
  2930. * even if it using different version of the struct than what target
  2931. * had used.
  2932. */
  2933. A_UINT32 arr_elem_size_be_ndp;
  2934. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_be_ndp_stats_elem_t, be_ndp);
  2935. } htt_stats_txbf_ofdma_be_ndp_stats_tlv;
  2936. /* preserve old name alias for new name consistent with the tag name */
  2937. typedef htt_stats_txbf_ofdma_be_ndp_stats_tlv htt_txbf_ofdma_be_ndp_stats_tlv;
  2938. typedef struct {
  2939. /** 11BE EHT OFDMA MU BRPOLL frame queued to the HW */
  2940. A_UINT32 be_ofdma_brpoll_queued;
  2941. /** 11BE EHT OFDMA MU BRPOLL frame sent over the air */
  2942. A_UINT32 be_ofdma_brpoll_tried;
  2943. /** 11BE EHT OFDMA MU BRPOLL frame flushed by HW */
  2944. A_UINT32 be_ofdma_brpoll_flushed;
  2945. /** 11BE EHT OFDMA MU BRPOLL frame completed with error(s) */
  2946. A_UINT32 be_ofdma_brp_err;
  2947. /**
  2948. * Number of CBF(s) received when 11BE EHT OFDMA MU BRPOLL frame
  2949. * completed with error(s)
  2950. */
  2951. A_UINT32 be_ofdma_brp_err_num_cbf_rcvd;
  2952. } htt_txbf_ofdma_be_brp_stats_elem_t;
  2953. typedef struct {
  2954. htt_tlv_hdr_t tlv_hdr;
  2955. /**
  2956. * This field is populated with the num of elems in the be_brp[]
  2957. * variable length array.
  2958. */
  2959. A_UINT32 num_elems_be_brp_arr;
  2960. /**
  2961. * This field will be filled by target with value of
  2962. * sizeof(htt_txbf_ofdma_be_brp_stats_elem_t).
  2963. * This is for allowing host to infer how much data target has provided,
  2964. * even if it using different version of the struct than what target
  2965. * had used
  2966. */
  2967. A_UINT32 arr_elem_size_be_brp;
  2968. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_be_brp_stats_elem_t, be_brp);
  2969. } htt_stats_txbf_ofdma_be_brp_stats_tlv;
  2970. /* preserve old name alias for new name consistent with the tag name */
  2971. typedef htt_stats_txbf_ofdma_be_brp_stats_tlv htt_txbf_ofdma_be_brp_stats_tlv;
  2972. typedef struct {
  2973. /**
  2974. * 11BE EHT OFDMA PPDUs that were sent over the air with steering
  2975. * (TXBF + OFDMA)
  2976. */
  2977. A_UINT32 be_ofdma_num_ppdu_steer;
  2978. /** 11BE EHT OFDMA PPDUs that were sent over the air in open loop */
  2979. A_UINT32 be_ofdma_num_ppdu_ol;
  2980. /**
  2981. * 11BE EHT OFDMA number of users for which CBF prefetch was initiated
  2982. * to PHY HW during TX
  2983. */
  2984. A_UINT32 be_ofdma_num_usrs_prefetch;
  2985. /**
  2986. * 11BE EHT OFDMA number of users for which sounding was initiated
  2987. * during TX
  2988. */
  2989. A_UINT32 be_ofdma_num_usrs_sound;
  2990. /**
  2991. * 11BE EHT OFDMA number of users for which sounding was forced during TX
  2992. */
  2993. A_UINT32 be_ofdma_num_usrs_force_sound;
  2994. } htt_txbf_ofdma_be_steer_stats_elem_t;
  2995. typedef struct {
  2996. htt_tlv_hdr_t tlv_hdr;
  2997. /**
  2998. * This field is populated with the num of elems in the be_steer[]
  2999. * variable length array.
  3000. */
  3001. A_UINT32 num_elems_be_steer_arr;
  3002. /**
  3003. * This field will be filled by target with value of
  3004. * sizeof(htt_txbf_ofdma_be_steer_stats_elem_t).
  3005. * This is for allowing host to infer how much data target has provided,
  3006. * even if it using different version of the struct than what target
  3007. * had used.
  3008. */
  3009. A_UINT32 arr_elem_size_be_steer;
  3010. HTT_STATS_VAR_LEN_ARRAY1(htt_txbf_ofdma_be_steer_stats_elem_t, be_steer);
  3011. } htt_stats_txbf_ofdma_be_steer_stats_tlv;
  3012. /* preserve old name alias for new name consistent with the tag name */
  3013. typedef htt_stats_txbf_ofdma_be_steer_stats_tlv
  3014. htt_txbf_ofdma_be_steer_stats_tlv;
  3015. typedef struct {
  3016. htt_tlv_hdr_t tlv_hdr;
  3017. /* 11BE EHT OFDMA MPDUs tried in rbo steering */
  3018. A_UINT32 be_ofdma_rbo_steer_mpdus_tried;
  3019. /* 11BE EHT OFDMA MPDUs failed in rbo steering */
  3020. A_UINT32 be_ofdma_rbo_steer_mpdus_failed;
  3021. /* 11BE EHT OFDMA MPDUs tried in sifs steering */
  3022. A_UINT32 be_ofdma_sifs_steer_mpdus_tried;
  3023. /* 11BE EHT OFDMA MPDUs failed in sifs steering */
  3024. A_UINT32 be_ofdma_sifs_steer_mpdus_failed;
  3025. } htt_stats_txbf_ofdma_be_steer_mpdu_stats_tlv;
  3026. /* preserve old name alias for new name consistent with the tag name */
  3027. typedef htt_stats_txbf_ofdma_be_steer_mpdu_stats_tlv
  3028. htt_txbf_ofdma_be_steer_mpdu_stats_tlv;
  3029. /* STATS_TYPE : HTT_DBG_EXT_STATS_TXBF_OFDMA
  3030. * TLV_TAGS:
  3031. * - HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG
  3032. * - HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG
  3033. * - HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG
  3034. * - HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG
  3035. * - HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG
  3036. * - HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG
  3037. * - HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG
  3038. * - HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG
  3039. * - HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG
  3040. * - HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG
  3041. */
  3042. typedef struct {
  3043. htt_tlv_hdr_t tlv_hdr;
  3044. /** 11AC VHT SU NDP frame completed with error(s) */
  3045. A_UINT32 ac_su_ndp_err;
  3046. /** 11AC VHT SU NDPA frame completed with error(s) */
  3047. A_UINT32 ac_su_ndpa_err;
  3048. /** 11AC VHT MU MIMO NDPA frame completed with error(s) */
  3049. A_UINT32 ac_mu_mimo_ndpa_err;
  3050. /** 11AC VHT MU MIMO NDP frame completed with error(s) */
  3051. A_UINT32 ac_mu_mimo_ndp_err;
  3052. /** 11AC VHT MU MIMO BRPOLL for user 1 frame completed with error(s) */
  3053. A_UINT32 ac_mu_mimo_brp1_err;
  3054. /** 11AC VHT MU MIMO BRPOLL for user 2 frame completed with error(s) */
  3055. A_UINT32 ac_mu_mimo_brp2_err;
  3056. /** 11AC VHT MU MIMO BRPOLL for user 3 frame completed with error(s) */
  3057. A_UINT32 ac_mu_mimo_brp3_err;
  3058. /** 11AC VHT SU NDPA frame flushed by HW */
  3059. A_UINT32 ac_su_ndpa_flushed;
  3060. /** 11AC VHT SU NDP frame flushed by HW */
  3061. A_UINT32 ac_su_ndp_flushed;
  3062. /** 11AC VHT MU MIMO NDPA frame flushed by HW */
  3063. A_UINT32 ac_mu_mimo_ndpa_flushed;
  3064. /** 11AC VHT MU MIMO NDP frame flushed by HW */
  3065. A_UINT32 ac_mu_mimo_ndp_flushed;
  3066. /** 11AC VHT MU MIMO BRPOLL for user 1 frame flushed by HW */
  3067. A_UINT32 ac_mu_mimo_brpoll1_flushed;
  3068. /** 11AC VHT MU MIMO BRPOLL for user 2 frame flushed by HW */
  3069. A_UINT32 ac_mu_mimo_brpoll2_flushed;
  3070. /** 11AC VHT MU MIMO BRPOLL for user 3 frame flushed by HW */
  3071. A_UINT32 ac_mu_mimo_brpoll3_flushed;
  3072. } htt_stats_tx_selfgen_ac_err_stats_tlv;
  3073. /* preserve old name alias for new name consistent with the tag name */
  3074. typedef htt_stats_tx_selfgen_ac_err_stats_tlv htt_tx_selfgen_ac_err_stats_tlv;
  3075. typedef struct {
  3076. htt_tlv_hdr_t tlv_hdr;
  3077. /** 11AX HE SU NDP frame completed with error(s) */
  3078. A_UINT32 ax_su_ndp_err;
  3079. /** 11AX HE SU NDPA frame completed with error(s) */
  3080. A_UINT32 ax_su_ndpa_err;
  3081. /** 11AX HE MU MIMO NDPA frame completed with error(s) */
  3082. A_UINT32 ax_mu_mimo_ndpa_err;
  3083. /** 11AX HE MU MIMO NDP frame completed with error(s) */
  3084. A_UINT32 ax_mu_mimo_ndp_err;
  3085. union {
  3086. struct {
  3087. /* deprecated old names */
  3088. A_UINT32 ax_mu_mimo_brp1_err;
  3089. A_UINT32 ax_mu_mimo_brp2_err;
  3090. A_UINT32 ax_mu_mimo_brp3_err;
  3091. A_UINT32 ax_mu_mimo_brp4_err;
  3092. A_UINT32 ax_mu_mimo_brp5_err;
  3093. A_UINT32 ax_mu_mimo_brp6_err;
  3094. A_UINT32 ax_mu_mimo_brp7_err;
  3095. };
  3096. /** 11AX HE MU BR-POLL frame for 1 - 7 users completed with error(s) */
  3097. A_UINT32 ax_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  3098. };
  3099. /** 11AX HE MU Basic Trigger frame completed with error(s) */
  3100. A_UINT32 ax_basic_trigger_err;
  3101. /** 11AX HE MU BSRP Trigger frame completed with error(s) */
  3102. A_UINT32 ax_bsr_trigger_err;
  3103. /** 11AX HE MU BAR Trigger frame completed with error(s) */
  3104. A_UINT32 ax_mu_bar_trigger_err;
  3105. /** 11AX HE MU RTS Trigger frame completed with error(s) */
  3106. A_UINT32 ax_mu_rts_trigger_err;
  3107. /** 11AX HE MU ULMUMIMO Trigger frame completed with error(s) */
  3108. A_UINT32 ax_ulmumimo_trigger_err;
  3109. /**
  3110. * Number of CBF(s) received when 11AX HE MU MIMO BRPOLL
  3111. * frame completed with error(s)
  3112. */
  3113. A_UINT32 ax_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3114. /** 11AX HE SU NDPA frame flushed by HW */
  3115. A_UINT32 ax_su_ndpa_flushed;
  3116. /** 11AX HE SU NDP frame flushed by HW */
  3117. A_UINT32 ax_su_ndp_flushed;
  3118. /** 11AX HE MU MIMO NDPA frame flushed by HW */
  3119. A_UINT32 ax_mu_mimo_ndpa_flushed;
  3120. /** 11AX HE MU MIMO NDP frame flushed by HW */
  3121. A_UINT32 ax_mu_mimo_ndp_flushed;
  3122. /** 11AX HE MU BR-POLL frame for users 1 - 7 flushed by HW */
  3123. A_UINT32 ax_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  3124. /**
  3125. * 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  3126. */
  3127. A_UINT32 ax_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3128. /** 11AX HE MU OFDMA Basic Trigger frame completed with partial user response */
  3129. A_UINT32 ax_basic_trigger_partial_resp;
  3130. /** 11AX HE MU BSRP Trigger frame completed with partial user response */
  3131. A_UINT32 ax_bsr_trigger_partial_resp;
  3132. /** 11AX HE MU BAR Trigger frame completed with partial user response */
  3133. A_UINT32 ax_mu_bar_trigger_partial_resp;
  3134. } htt_stats_tx_selfgen_ax_err_stats_tlv;
  3135. /* preserve old name alias for new name consistent with the tag name */
  3136. typedef htt_stats_tx_selfgen_ax_err_stats_tlv htt_tx_selfgen_ax_err_stats_tlv;
  3137. typedef struct {
  3138. htt_tlv_hdr_t tlv_hdr;
  3139. /** 11BE EHT SU NDP frame completed with error(s) */
  3140. A_UINT32 be_su_ndp_err;
  3141. /** 11BE EHT SU NDPA frame completed with error(s) */
  3142. A_UINT32 be_su_ndpa_err;
  3143. /** 11BE EHT MU MIMO NDPA frame completed with error(s) */
  3144. A_UINT32 be_mu_mimo_ndpa_err;
  3145. /** 11BE EHT MU MIMO NDP frame completed with error(s) */
  3146. A_UINT32 be_mu_mimo_ndp_err;
  3147. /** 11BE EHT MU BR-POLL frame for 1 - 7 users completed with error(s) */
  3148. A_UINT32 be_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  3149. /** 11BE EHT MU Basic Trigger frame completed with error(s) */
  3150. A_UINT32 be_basic_trigger_err;
  3151. /** 11BE EHT MU BSRP Trigger frame completed with error(s) */
  3152. A_UINT32 be_bsr_trigger_err;
  3153. /** 11BE EHT MU BAR Trigger frame completed with error(s) */
  3154. A_UINT32 be_mu_bar_trigger_err;
  3155. /** 11BE EHT MU RTS Trigger frame completed with error(s) */
  3156. A_UINT32 be_mu_rts_trigger_err;
  3157. /** 11BE EHT MU ULMUMIMO Trigger frame completed with error(s) */
  3158. A_UINT32 be_ulmumimo_trigger_err;
  3159. /**
  3160. * Number of CBF(s) received when 11BE EHT MU MIMO BRPOLL frame
  3161. * completed with error(s)
  3162. */
  3163. A_UINT32 be_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3164. /** 11BE EHT SU NDPA frame flushed by HW */
  3165. A_UINT32 be_su_ndpa_flushed;
  3166. /** 11BE EHT SU NDP frame flushed by HW */
  3167. A_UINT32 be_su_ndp_flushed;
  3168. /** 11BE EHT MU MIMO NDPA frame flushed by HW */
  3169. A_UINT32 be_mu_mimo_ndpa_flushed;
  3170. /** 11BE HT MU MIMO NDP frame flushed by HW */
  3171. A_UINT32 be_mu_mimo_ndp_flushed;
  3172. /** 11BE EHT MU BR-POLL frame for users 1 - 7 flushed by HW */
  3173. A_UINT32 be_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  3174. /**
  3175. * 11BE EHT UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  3176. */
  3177. A_UINT32 be_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3178. /** 11BE EHT MU OFDMA Basic Trigger frame completed with partial user response */
  3179. A_UINT32 be_basic_trigger_partial_resp;
  3180. /** 11BE EHT MU BSRP Trigger frame completed with partial user response */
  3181. A_UINT32 be_bsr_trigger_partial_resp;
  3182. /** 11BE EHT MU BAR Trigger frame completed with partial user response */
  3183. A_UINT32 be_mu_bar_trigger_partial_resp;
  3184. /** 11BE EHT MU RTS Trigger frame blocked due to partner link TX/RX(eMLSR) */
  3185. A_UINT32 be_mu_rts_trigger_blocked;
  3186. /** 11BE EHT MU BSR Trigger frame blocked due to partner link TX/RX(eMLSR) */
  3187. A_UINT32 be_bsr_trigger_blocked;
  3188. } htt_stats_tx_selfgen_be_err_stats_tlv;
  3189. /* preserve old name alias for new name consistent with the tag name */
  3190. typedef htt_stats_tx_selfgen_be_err_stats_tlv htt_tx_selfgen_be_err_stats_tlv;
  3191. /*
  3192. * Scheduler completion status reason code.
  3193. * (0) HTT_TXERR_NONE - No error (Success).
  3194. * (1) HTT_TXERR_RESP - Response timeout, response mismatch, BW mismatch,
  3195. * MIMO control mismatch, CRC error etc.
  3196. * (2) HTT_TXERR_FILT - Blocked by HW tx filtering.
  3197. * (3) HTT_TXERR_FIFO - FIFO, misc. errors in HW.
  3198. * (4) HTT_TXERR_SWABORT - Software initialted abort (TX_ABORT).
  3199. * (5) HTT_TXERR_RESERVED1 - Currently reserved.
  3200. * (6) HTT_TXERR_RESERVED2 - Currently reserved.
  3201. */
  3202. /* Scheduler error code.
  3203. * (0) HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR - Flush received from HW.
  3204. * (1) HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR - Scheduler command was
  3205. * filtered by HW.
  3206. * (2) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR - Response frame mismatch
  3207. * error.
  3208. * (3) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR - CBF
  3209. * received with MIMO control mismatch.
  3210. * (4) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR - CBF received with
  3211. * BW mismatch.
  3212. * (5) HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR - Error in transmitting
  3213. * frame even after maximum retries.
  3214. * (6) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR - Response frame
  3215. * received outside RX window.
  3216. * (7) HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR - No frame
  3217. * received by HW for queuing within SIFS interval.
  3218. */
  3219. typedef struct {
  3220. htt_tlv_hdr_t tlv_hdr;
  3221. /** 11AC VHT SU NDPA scheduler completion status reason code */
  3222. A_UINT32 ac_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3223. /** 11AC VHT SU NDP scheduler completion status reason code */
  3224. A_UINT32 ac_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3225. /** 11AC VHT SU NDP scheduler error code */
  3226. A_UINT32 ac_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3227. /** 11AC VHT MU MIMO NDPA scheduler completion status reason code */
  3228. A_UINT32 ac_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3229. /** 11AC VHT MU MIMO NDP scheduler completion status reason code */
  3230. A_UINT32 ac_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3231. /** 11AC VHT MU MIMO NDP scheduler error code */
  3232. A_UINT32 ac_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3233. /** 11AC VHT MU MIMO BRPOLL scheduler completion status reason code */
  3234. A_UINT32 ac_mu_mimo_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3235. /** 11AC VHT MU MIMO BRPOLL scheduler error code */
  3236. A_UINT32 ac_mu_mimo_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3237. } htt_stats_tx_selfgen_ac_sched_status_stats_tlv;
  3238. /* preserve old name alias for new name consistent with the tag name */
  3239. typedef htt_stats_tx_selfgen_ac_sched_status_stats_tlv
  3240. htt_tx_selfgen_ac_sched_status_stats_tlv;
  3241. typedef struct {
  3242. htt_tlv_hdr_t tlv_hdr;
  3243. /** 11AX HE SU NDPA scheduler completion status reason code */
  3244. A_UINT32 ax_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3245. /** 11AX SU NDP scheduler completion status reason code */
  3246. A_UINT32 ax_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3247. /** 11AX HE SU NDP scheduler error code */
  3248. A_UINT32 ax_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3249. /** 11AX HE MU MIMO NDPA scheduler completion status reason code */
  3250. A_UINT32 ax_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3251. /** 11AX HE MU MIMO NDP scheduler completion status reason code */
  3252. A_UINT32 ax_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3253. /** 11AX HE MU MIMO NDP scheduler error code */
  3254. A_UINT32 ax_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3255. /** 11AX HE MU MIMO MU BRPOLL scheduler completion status reason code */
  3256. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3257. /** 11AX HE MU MIMO MU BRPOLL scheduler error code */
  3258. A_UINT32 ax_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3259. /** 11AX HE MU BAR scheduler completion status reason code */
  3260. A_UINT32 ax_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3261. /** 11AX HE MU BAR scheduler error code */
  3262. A_UINT32 ax_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3263. /**
  3264. * 11AX HE UL OFDMA Basic Trigger scheduler completion status reason code
  3265. */
  3266. A_UINT32 ax_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3267. /** 11AX HE UL OFDMA Basic Trigger scheduler error code */
  3268. A_UINT32 ax_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3269. /**
  3270. * 11AX HE UL MUMIMO Basic Trigger scheduler completion status reason code
  3271. */
  3272. A_UINT32 ax_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3273. /** 11AX HE UL MUMIMO Basic Trigger scheduler error code */
  3274. A_UINT32 ax_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3275. } htt_stats_tx_selfgen_ax_sched_status_stats_tlv;
  3276. /* preserve old name alias for new name consistent with the tag name */
  3277. typedef htt_stats_tx_selfgen_ax_sched_status_stats_tlv
  3278. htt_tx_selfgen_ax_sched_status_stats_tlv;
  3279. typedef struct {
  3280. htt_tlv_hdr_t tlv_hdr;
  3281. /** 11BE EHT SU NDPA scheduler completion status reason code */
  3282. A_UINT32 be_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3283. /** 11BE SU NDP scheduler completion status reason code */
  3284. A_UINT32 be_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3285. /** 11BE EHT SU NDP scheduler error code */
  3286. A_UINT32 be_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3287. /** 11BE EHT MU MIMO NDPA scheduler completion status reason code */
  3288. A_UINT32 be_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3289. /** 11BE EHT MU MIMO NDP scheduler completion status reason code */
  3290. A_UINT32 be_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3291. /** 11BE EHT MU MIMO NDP scheduler error code */
  3292. A_UINT32 be_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3293. /** 11BE EHT MU MIMO MU BRPOLL scheduler completion status reason code */
  3294. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3295. /** 11BE EHT MU MIMO MU BRPOLL scheduler error code */
  3296. A_UINT32 be_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3297. /** 11BE EHT MU BAR scheduler completion status reason code */
  3298. A_UINT32 be_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3299. /** 11BE EHT MU BAR scheduler error code */
  3300. A_UINT32 be_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3301. /**
  3302. * 11BE EHT UL OFDMA Basic Trigger scheduler completion status reason code
  3303. */
  3304. A_UINT32 be_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3305. /** 11BE EHT UL OFDMA Basic Trigger scheduler error code */
  3306. A_UINT32 be_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3307. /**
  3308. * 11BE EHT UL MUMIMO Basic Trigger scheduler completion status reason code
  3309. */
  3310. A_UINT32 be_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3311. /** 11BE EHT UL MUMIMO Basic Trigger scheduler error code */
  3312. A_UINT32 be_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3313. } htt_stats_tx_selfgen_be_sched_status_stats_tlv;
  3314. /* preserve old name alias for new name consistent with the tag name */
  3315. typedef htt_stats_tx_selfgen_be_sched_status_stats_tlv
  3316. htt_tx_selfgen_be_sched_status_stats_tlv;
  3317. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  3318. * TLV_TAGS:
  3319. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  3320. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  3321. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  3322. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  3323. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  3324. * - HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG
  3325. * - HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG
  3326. * - HTT_STATS_TX_SELFGEN_BE_STATS_TAG
  3327. * - HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG
  3328. * - HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG
  3329. */
  3330. /* NOTE:
  3331. * This structure is for documentation, and cannot be safely used directly.
  3332. * Instead, use the constituent TLV structures to fill/parse.
  3333. */
  3334. #ifdef ATH_TARGET
  3335. typedef struct {
  3336. htt_stats_tx_selfgen_cmn_stats_tlv cmn_tlv;
  3337. htt_stats_tx_selfgen_ac_stats_tlv ac_tlv;
  3338. htt_stats_tx_selfgen_ax_stats_tlv ax_tlv;
  3339. htt_stats_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  3340. htt_stats_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  3341. htt_stats_tx_selfgen_ac_sched_status_stats_tlv ac_sched_status_tlv;
  3342. htt_stats_tx_selfgen_ax_sched_status_stats_tlv ax_sched_status_tlv;
  3343. htt_stats_tx_selfgen_be_stats_tlv be_tlv;
  3344. htt_stats_tx_selfgen_be_err_stats_tlv be_err_tlv;
  3345. htt_stats_tx_selfgen_be_sched_status_stats_tlv be_sched_status_tlv;
  3346. } htt_tx_pdev_selfgen_stats_t;
  3347. #endif /* ATH_TARGET */
  3348. /* == TX MU STATS == */
  3349. typedef struct {
  3350. htt_tlv_hdr_t tlv_hdr;
  3351. /** Number of MU MIMO schedules posted to HW */
  3352. A_UINT32 mu_mimo_sch_posted;
  3353. /** Number of MU MIMO schedules failed to post */
  3354. A_UINT32 mu_mimo_sch_failed;
  3355. /** Number of MU MIMO PPDUs posted to HW */
  3356. A_UINT32 mu_mimo_ppdu_posted;
  3357. /*
  3358. * This is the common description for the below sch stats.
  3359. * Counts the number of transmissions of each number of MU users
  3360. * in each TX mode.
  3361. * The array index is the "number of users - 1".
  3362. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  3363. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  3364. * TX PPDUs and so on.
  3365. * The same is applicable for the other TX mode stats.
  3366. */
  3367. /** Represents the count for 11AC DL MU MIMO sequences */
  3368. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3369. /** Represents the count for 11AX DL MU MIMO sequences */
  3370. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3371. /** Represents the count for 11AX DL MU OFDMA sequences */
  3372. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3373. /**
  3374. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  3375. */
  3376. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3377. /** Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  3378. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3379. /** Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  3380. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3381. /** Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  3382. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3383. /**
  3384. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  3385. */
  3386. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3387. /** Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  3388. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3389. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  3390. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3391. /** Number of 11AX DL MU MIMO schedules posted per group size */
  3392. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3393. /** Represents the count for 11BE DL MU MIMO sequences */
  3394. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3395. /** Number of 11BE DL MU MIMO schedules posted per group size */
  3396. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3397. /** Number of 11AC DL MU MIMO schedules posted per group size (4-7) */
  3398. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3399. } htt_stats_tx_pdev_mu_mimo_stats_tlv;
  3400. /* preserve old name alias for new name consistent with the tag name */
  3401. typedef htt_stats_tx_pdev_mu_mimo_stats_tlv htt_tx_pdev_mu_mimo_sch_stats_tlv;
  3402. typedef struct {
  3403. htt_tlv_hdr_t tlv_hdr;
  3404. A_UINT32 dl_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3405. A_UINT32 dl_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3406. A_UINT32 dl_mumimo_grp_eligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3407. A_UINT32 dl_mumimo_grp_ineligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3408. A_UINT32 dl_mumimo_grp_invalid[HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS];
  3409. A_UINT32 dl_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  3410. A_UINT32 ul_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3411. A_UINT32 ul_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3412. A_UINT32 ul_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  3413. } htt_stats_tx_pdev_mumimo_grp_stats_tlv;
  3414. /* preserve old name alias for new name consistent with the tag name */
  3415. typedef htt_stats_tx_pdev_mumimo_grp_stats_tlv htt_tx_pdev_mumimo_grp_stats_tlv;
  3416. typedef struct {
  3417. htt_tlv_hdr_t tlv_hdr;
  3418. /** Number of MU MIMO schedules posted to HW */
  3419. A_UINT32 mu_mimo_sch_posted;
  3420. /** Number of MU MIMO schedules failed to post */
  3421. A_UINT32 mu_mimo_sch_failed;
  3422. /** Number of MU MIMO PPDUs posted to HW */
  3423. A_UINT32 mu_mimo_ppdu_posted;
  3424. /*
  3425. * This is the common description for the below sch stats.
  3426. * Counts the number of transmissions of each number of MU users
  3427. * in each TX mode.
  3428. * The array index is the "number of users - 1".
  3429. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  3430. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  3431. * TX PPDUs and so on.
  3432. * The same is applicable for the other TX mode stats.
  3433. */
  3434. /** Represents the count for 11AC DL MU MIMO sequences */
  3435. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3436. /** Represents the count for 11AX DL MU MIMO sequences */
  3437. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3438. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  3439. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3440. /** Number of 11AX DL MU MIMO schedules posted per group size */
  3441. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3442. /** Represents the count for 11BE DL MU MIMO sequences */
  3443. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3444. /** Number of 11BE DL MU MIMO schedules posted per group size */
  3445. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3446. /** Number of 11AC DL MU MIMO schedules posted per group size (4 - 7)*/
  3447. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3448. } htt_stats_tx_pdev_dl_mu_mimo_stats_tlv;
  3449. /* preserve old name alias for new name consistent with the tag name */
  3450. typedef htt_stats_tx_pdev_dl_mu_mimo_stats_tlv
  3451. htt_tx_pdev_dl_mu_mimo_sch_stats_tlv;
  3452. typedef struct {
  3453. htt_tlv_hdr_t tlv_hdr;
  3454. /** Represents the count for 11AX DL MU OFDMA sequences */
  3455. A_UINT32 ax_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3456. } htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv;
  3457. /* preserve old name alias for new name consistent with the tag name */
  3458. typedef htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv
  3459. htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv;
  3460. typedef struct {
  3461. htt_tlv_hdr_t tlv_hdr;
  3462. /** Represents the count for 11BE DL MU OFDMA sequences */
  3463. A_UINT32 be_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3464. } htt_stats_tx_pdev_be_dl_mu_ofdma_stats_tlv;
  3465. /* preserve old name alias for new name consistent with the tag name */
  3466. typedef htt_stats_tx_pdev_be_dl_mu_ofdma_stats_tlv
  3467. htt_tx_pdev_be_dl_mu_ofdma_sch_stats_tlv;
  3468. typedef struct {
  3469. htt_tlv_hdr_t tlv_hdr;
  3470. /**
  3471. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  3472. */
  3473. A_UINT32 ax_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3474. /**
  3475. * Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers
  3476. */
  3477. A_UINT32 ax_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3478. /**
  3479. * Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers
  3480. */
  3481. A_UINT32 ax_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3482. /**
  3483. * Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers
  3484. */
  3485. A_UINT32 ax_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3486. } htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv;
  3487. /* preserve old name alias for new name consistent with the tag name */
  3488. typedef htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv
  3489. htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv;
  3490. typedef struct {
  3491. htt_tlv_hdr_t tlv_hdr;
  3492. /**
  3493. * Represents the count for 11BE UL MU OFDMA sequences with Basic Triggers
  3494. */
  3495. A_UINT32 be_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3496. /**
  3497. * Represents the count for 11BE UL MU OFDMA sequences with BSRP Triggers
  3498. */
  3499. A_UINT32 be_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3500. /**
  3501. * Represents the count for 11BE UL MU OFDMA sequences with BAR Triggers
  3502. */
  3503. A_UINT32 be_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3504. /**
  3505. * Represents the count for 11BE UL MU OFDMA sequences with BRP Triggers
  3506. */
  3507. A_UINT32 be_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3508. } htt_stats_tx_pdev_be_ul_mu_ofdma_stats_tlv;
  3509. /* preserve old name alias for new name consistent with the tag name */
  3510. typedef htt_stats_tx_pdev_be_ul_mu_ofdma_stats_tlv
  3511. htt_tx_pdev_be_ul_mu_ofdma_sch_stats_tlv;
  3512. typedef struct {
  3513. htt_tlv_hdr_t tlv_hdr;
  3514. /**
  3515. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  3516. */
  3517. A_UINT32 ax_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3518. /**
  3519. * Represents the count for 11AX UL MU MIMO sequences with BRP Triggers
  3520. */
  3521. A_UINT32 ax_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3522. } htt_stats_tx_pdev_ul_mu_mimo_stats_tlv;
  3523. /* preserve old name alias for new name consistent with the tag name */
  3524. typedef htt_stats_tx_pdev_ul_mu_mimo_stats_tlv
  3525. htt_tx_pdev_ul_mu_mimo_sch_stats_tlv;
  3526. typedef struct {
  3527. htt_tlv_hdr_t tlv_hdr;
  3528. /**
  3529. * Represents the count for 11BE UL MU MIMO sequences with Basic Triggers
  3530. */
  3531. A_UINT32 be_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3532. /**
  3533. * Represents the count for 11BE UL MU MIMO sequences with BRP Triggers
  3534. */
  3535. A_UINT32 be_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3536. } htt_stats_tx_pdev_be_ul_mu_mimo_stats_tlv;
  3537. /* preserve old name alias for new name consistent with the tag name */
  3538. typedef htt_stats_tx_pdev_be_ul_mu_mimo_stats_tlv
  3539. htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv;
  3540. typedef struct {
  3541. htt_tlv_hdr_t tlv_hdr;
  3542. /** 11AC DL MU MIMO number of mpdus queued to HW, per user */
  3543. A_UINT32 mu_mimo_mpdus_queued_usr;
  3544. /** 11AC DL MU MIMO number of mpdus tried over the air, per user */
  3545. A_UINT32 mu_mimo_mpdus_tried_usr;
  3546. /** 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  3547. A_UINT32 mu_mimo_mpdus_failed_usr;
  3548. /** 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  3549. A_UINT32 mu_mimo_mpdus_requeued_usr;
  3550. /** 11AC DL MU MIMO BA not received, per user */
  3551. A_UINT32 mu_mimo_err_no_ba_usr;
  3552. /** 11AC DL MU MIMO mpdu underrun encountered, per user */
  3553. A_UINT32 mu_mimo_mpdu_underrun_usr;
  3554. /** 11AC DL MU MIMO ampdu underrun encountered, per user */
  3555. A_UINT32 mu_mimo_ampdu_underrun_usr;
  3556. /** 11AX MU MIMO number of mpdus queued to HW, per user */
  3557. A_UINT32 ax_mu_mimo_mpdus_queued_usr;
  3558. /** 11AX MU MIMO number of mpdus tried over the air, per user */
  3559. A_UINT32 ax_mu_mimo_mpdus_tried_usr;
  3560. /** 11AX DL MU MIMO number of mpdus failed acknowledgement, per user */
  3561. A_UINT32 ax_mu_mimo_mpdus_failed_usr;
  3562. /** 11AX DL MU MIMO number of mpdus re-queued to HW, per user */
  3563. A_UINT32 ax_mu_mimo_mpdus_requeued_usr;
  3564. /** 11AX DL MU MIMO BA not received, per user */
  3565. A_UINT32 ax_mu_mimo_err_no_ba_usr;
  3566. /** 11AX DL MU MIMO mpdu underrun encountered, per user */
  3567. A_UINT32 ax_mu_mimo_mpdu_underrun_usr;
  3568. /** 11AX DL MU MIMO ampdu underrun encountered, per user */
  3569. A_UINT32 ax_mu_mimo_ampdu_underrun_usr;
  3570. /** 11AX MU OFDMA number of mpdus queued to HW, per user */
  3571. A_UINT32 ax_ofdma_mpdus_queued_usr;
  3572. /** 11AX MU OFDMA number of mpdus tried over the air, per user */
  3573. A_UINT32 ax_ofdma_mpdus_tried_usr;
  3574. /** 11AX MU OFDMA number of mpdus failed acknowledgement, per user */
  3575. A_UINT32 ax_ofdma_mpdus_failed_usr;
  3576. /** 11AX MU OFDMA number of mpdus re-queued to HW, per user */
  3577. A_UINT32 ax_ofdma_mpdus_requeued_usr;
  3578. /** 11AX MU OFDMA BA not received, per user */
  3579. A_UINT32 ax_ofdma_err_no_ba_usr;
  3580. /** 11AX MU OFDMA mpdu underrun encountered, per user */
  3581. A_UINT32 ax_ofdma_mpdu_underrun_usr;
  3582. /** 11AX MU OFDMA ampdu underrun encountered, per user */
  3583. A_UINT32 ax_ofdma_ampdu_underrun_usr;
  3584. } htt_stats_tx_pdev_mumimo_mpdu_stats_tlv;
  3585. /* preserve old name alias for new name consistent with the tag name */
  3586. typedef htt_stats_tx_pdev_mumimo_mpdu_stats_tlv
  3587. htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  3588. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  3589. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  3590. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  3591. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_BE 4 /* SCHED_TX_MODE_MU_OFDMA_BE */
  3592. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_BE 5 /* SCHED_TX_MODE_MU_MIMO_BE */
  3593. typedef struct {
  3594. htt_tlv_hdr_t tlv_hdr;
  3595. /* mpdu level stats */
  3596. A_UINT32 mpdus_queued_usr;
  3597. A_UINT32 mpdus_tried_usr;
  3598. A_UINT32 mpdus_failed_usr;
  3599. A_UINT32 mpdus_requeued_usr;
  3600. A_UINT32 err_no_ba_usr;
  3601. A_UINT32 mpdu_underrun_usr;
  3602. A_UINT32 ampdu_underrun_usr;
  3603. A_UINT32 user_index;
  3604. /** HTT_STATS_TX_SCHED_MODE_xxx */
  3605. A_UINT32 tx_sched_mode;
  3606. } htt_stats_tx_pdev_mpdu_stats_tlv;
  3607. /* preserve old name alias for new name consistent with the tag name */
  3608. typedef htt_stats_tx_pdev_mpdu_stats_tlv htt_tx_pdev_mpdu_stats_tlv;
  3609. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  3610. * TLV_TAGS:
  3611. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  3612. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  3613. */
  3614. /* NOTE:
  3615. * This structure is for documentation, and cannot be safely used directly.
  3616. * Instead, use the constituent TLV structures to fill/parse.
  3617. */
  3618. #ifdef ATH_TARGET
  3619. typedef struct {
  3620. htt_stats_tx_pdev_mu_mimo_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  3621. htt_stats_tx_pdev_dl_mu_mimo_stats_tlv dl_mu_mimo_sch_stats_tlv[1];
  3622. htt_stats_tx_pdev_ul_mu_mimo_stats_tlv ul_mu_mimo_sch_stats_tlv[1];
  3623. htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv dl_mu_ofdma_sch_stats_tlv[1];
  3624. htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv ul_mu_ofdma_sch_stats_tlv[1];
  3625. /*
  3626. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  3627. * it can also hold MU-OFDMA stats.
  3628. */
  3629. htt_stats_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  3630. htt_stats_tx_pdev_mumimo_grp_stats_tlv mumimo_grp_stats_tlv;
  3631. } htt_tx_pdev_mu_mimo_stats_t;
  3632. #endif /* ATH_TARGET */
  3633. /* == TX SCHED STATS == */
  3634. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3635. /* NOTE: Variable length TLV, use length spec to infer array size */
  3636. typedef struct {
  3637. htt_tlv_hdr_t tlv_hdr;
  3638. /** Scheduler command posted per tx_mode */
  3639. A_UINT32 sched_cmd_posted[1/* length = num tx modes */];
  3640. } htt_stats_sched_txq_cmd_posted_tlv;
  3641. /* preserve old name alias for new name consistent with the tag name */
  3642. typedef htt_stats_sched_txq_cmd_posted_tlv htt_sched_txq_cmd_posted_tlv_v;
  3643. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3644. /* NOTE: Variable length TLV, use length spec to infer array size */
  3645. typedef struct {
  3646. htt_tlv_hdr_t tlv_hdr;
  3647. /** Scheduler command reaped per tx_mode */
  3648. A_UINT32 sched_cmd_reaped[1/* length = num tx modes */];
  3649. } htt_stats_sched_txq_cmd_reaped_tlv;
  3650. /* preserve old name alias for new name consistent with the tag name */
  3651. typedef htt_stats_sched_txq_cmd_reaped_tlv htt_sched_txq_cmd_reaped_tlv_v;
  3652. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3653. /* NOTE: Variable length TLV, use length spec to infer array size */
  3654. typedef struct {
  3655. htt_tlv_hdr_t tlv_hdr;
  3656. /**
  3657. * sched_order_su contains the peer IDs of peers chosen in the last
  3658. * NUM_SCHED_ORDER_LOG scheduler instances.
  3659. * The array is circular; it's unspecified which array element corresponds
  3660. * to the most recent scheduler invocation, and which corresponds to
  3661. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  3662. *
  3663. * HTT_TX_PDEV_NUM_SCHED_ORDER_LOG
  3664. */
  3665. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sched_order_su);
  3666. } htt_stats_sched_txq_sched_order_su_tlv;
  3667. /* preserve old name alias for new name consistent with the tag name */
  3668. typedef htt_stats_sched_txq_sched_order_su_tlv htt_sched_txq_sched_order_su_tlv_v;
  3669. typedef struct {
  3670. htt_tlv_hdr_t tlv_hdr;
  3671. A_UINT32 htt_stats_type;
  3672. } htt_stats_error_tlv_v;
  3673. typedef enum {
  3674. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  3675. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  3676. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  3677. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  3678. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  3679. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  3680. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  3681. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  3682. HTT_SCHED_TID_SKIP_NO_DATA, /* Skip tid without data */
  3683. HTT_SCHED_TID_SKIP_NO_ENQ = HTT_SCHED_TID_SKIP_NO_DATA, /* deprecated old name */
  3684. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  3685. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  3686. HTT_SCHED_TID_SKIP_UL_RESP, /* skip UL response tid */
  3687. HTT_SCHED_TID_SKIP_UL = HTT_SCHED_TID_SKIP_UL_RESP, /* deprecated old name */
  3688. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  3689. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  3690. HTT_SCHED_TID_REMOVE_UL_RESP, /* Remove tid UL response */
  3691. HTT_SCHED_TID_REMOVE_UL = HTT_SCHED_TID_REMOVE_UL_RESP, /* deprecated old name */
  3692. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  3693. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  3694. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  3695. HTT_SCHED_TID_SKIP_EXCEPT_EAPOL, /* skip tid except eapol */
  3696. HTT_SCHED_TID_SU_LOW_PRI_ONLY, /* su low priority tid only */
  3697. HTT_SCHED_TID_SKIP_SOUND_IN_PROGRESS, /* skip tid sound in progress */
  3698. HTT_SCHED_TID_SKIP_NO_UL_DATA, /* skip ul tid when no ul data */
  3699. HTT_SCHED_TID_REMOVE_UL_NOT_CAPABLE, /* Remove tid that are not UL capable */
  3700. HTT_SCHED_TID_UL_ELIGIBLE, /* Tid is eligible for UL scheduling */
  3701. HTT_SCHED_TID_FALLBACK_TO_PREV_DECISION, /* Fall back to previous decision */
  3702. HTT_SCHED_TID_SKIP_PEER_ALREADY_IN_TXQ, /* skip tid, peer is already available in the txq */
  3703. HTT_SCHED_TID_SKIP_DELAY_UL_SCHED, /* skip tid delay UL schedule */
  3704. HTT_SCHED_TID_SKIP_PWR_SAVE_STATE_OFF, /* Limit UL scheduling to primary link if not in power save state */
  3705. HTT_SCHED_TID_SKIP_TWT_SUSPEND, /* Skip UL trigger for certain cases ex TWT suspend */
  3706. HTT_SCHED_TID_SKIP_DISABLE_160MHZ_OFDMA, /* Skip ul tid if peer supports 160MHZ */
  3707. HTT_SCHED_TID_SKIP_ULMU_DISABLE_FROM_OMI, /* Skip ul tid if sta send omi to indicate to disable UL mu data */
  3708. HTT_SCHED_TID_SKIP_UL_MAX_SCHED_CMD_EXCEEDED,/* skip ul tid if max sched cmd is exceeded */
  3709. HTT_SCHED_TID_SKIP_UL_SMALL_QDEPTH, /* Skip ul tid for small qdepth */
  3710. HTT_SCHED_TID_SKIP_UL_TWT_PAUSED, /* Skip ul tid if twt txq is paused */
  3711. HTT_SCHED_TID_SKIP_PEER_UL_RX_NOT_ACTIVE, /* Skip ul tid if peer ul rx is not active */
  3712. HTT_SCHED_TID_SKIP_NO_FORCE_TRIGGER, /* Skip ul tid if there is no force triggers */
  3713. HTT_SCHED_TID_SKIP_SMART_BASIC_TRIGGER, /* Skip ul tid if smart basic trigger doesn't have enough data */
  3714. HTT_SCHED_INELIGIBILITY_MAX,
  3715. } htt_sched_txq_sched_ineligibility_tlv_enum;
  3716. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3717. /* NOTE: Variable length TLV, use length spec to infer array size */
  3718. typedef struct {
  3719. htt_tlv_hdr_t tlv_hdr;
  3720. /**
  3721. * sched_ineligibility counts the number of occurrences of different
  3722. * reasons for tid ineligibility during eligibility checks per txq
  3723. * in scheduling
  3724. *
  3725. * Indexed by htt_sched_txq_sched_ineligibility_tlv_enum.
  3726. */
  3727. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sched_ineligibility);
  3728. } htt_stats_sched_txq_sched_ineligibility_tlv;
  3729. /* preserve old name alias for new name consistent with the tag name */
  3730. typedef htt_stats_sched_txq_sched_ineligibility_tlv
  3731. htt_sched_txq_sched_ineligibility_tlv_v;
  3732. typedef enum {
  3733. HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0, /* Supercycle not triggered */
  3734. HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED, /* forced supercycle trigger */
  3735. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES, /* Num tidq entries is less than max_client threshold */
  3736. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS, /* Num active tids is less than max_client threshold */
  3737. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED, /* max sched iteration reached */
  3738. HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED, /* duration threshold reached */
  3739. HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER, /* TWT supercycle trigger */
  3740. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  3741. } htt_sched_txq_supercycle_triggers_tlv_enum;
  3742. #define HTT_SCHED_TXQ_SUPERCYCLE_TRIGGERS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3743. /* NOTE: Variable length TLV, use length spec to infer array size */
  3744. typedef struct {
  3745. htt_tlv_hdr_t tlv_hdr;
  3746. /**
  3747. * supercycle_triggers[] is a histogram that counts the number of
  3748. * occurrences of each different reason for a transmit scheduler
  3749. * supercycle to be triggered.
  3750. * The htt_sched_txq_supercycle_triggers_tlv_enum is used to index
  3751. * supercycle_triggers[], e.g. supercycle_triggers[1] holds the number
  3752. * of times a supercycle has been forced.
  3753. * These supercycle trigger counts are not automatically reset, but
  3754. * are reset upon request.
  3755. */
  3756. A_UINT32 supercycle_triggers[1/*HTT_SCHED_SUPERCYCLE_TRIGGER_MAX*/];
  3757. } htt_stats_sched_txq_supercycle_trigger_tlv;
  3758. /* preserve old name alias for new name consistent with the tag name */
  3759. typedef htt_stats_sched_txq_supercycle_trigger_tlv
  3760. htt_sched_txq_supercycle_triggers_tlv_v;
  3761. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  3762. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  3763. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  3764. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  3765. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  3766. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  3767. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  3768. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  3769. do { \
  3770. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  3771. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  3772. } while (0)
  3773. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  3774. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  3775. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  3776. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  3777. do { \
  3778. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  3779. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  3780. } while (0)
  3781. typedef struct {
  3782. htt_tlv_hdr_t tlv_hdr;
  3783. /**
  3784. * BIT [ 7 : 0] :- mac_id
  3785. * BIT [15 : 8] :- txq_id
  3786. * BIT [31 : 16] :- reserved
  3787. */
  3788. A_UINT32 mac_id__txq_id__word;
  3789. /** Scheduler policy ised for this TxQ */
  3790. A_UINT32 sched_policy;
  3791. /** Timestamp of last scheduler command posted */
  3792. A_UINT32 last_sched_cmd_posted_timestamp;
  3793. /** Timestamp of last scheduler command completed */
  3794. A_UINT32 last_sched_cmd_compl_timestamp;
  3795. /** Num of Sched2TAC ring hit Low Water Mark condition */
  3796. A_UINT32 sched_2_tac_lwm_count;
  3797. /** Num of Sched2TAC ring full condition */
  3798. A_UINT32 sched_2_tac_ring_full;
  3799. /**
  3800. * Num of scheduler command post failures that includes SU/MU-MIMO/MU-OFDMA
  3801. * sequence type
  3802. */
  3803. A_UINT32 sched_cmd_post_failure;
  3804. /** Num of active tids for this TxQ at current instance */
  3805. A_UINT32 num_active_tids;
  3806. /** Num of powersave schedules */
  3807. A_UINT32 num_ps_schedules;
  3808. /** Num of scheduler commands pending for this TxQ */
  3809. A_UINT32 sched_cmds_pending;
  3810. /** Num of tidq registration for this TxQ */
  3811. A_UINT32 num_tid_register;
  3812. /** Num of tidq de-registration for this TxQ */
  3813. A_UINT32 num_tid_unregister;
  3814. /** Num of iterations msduq stats was updated */
  3815. A_UINT32 num_qstats_queried;
  3816. /** qstats query update status */
  3817. A_UINT32 qstats_update_pending;
  3818. /** Timestamp of Last query stats made */
  3819. A_UINT32 last_qstats_query_timestamp;
  3820. /** Num of sched2tqm command queue full condition */
  3821. A_UINT32 num_tqm_cmdq_full;
  3822. /** Num of scheduler trigger from DE Module */
  3823. A_UINT32 num_de_sched_algo_trigger;
  3824. /** Num of scheduler trigger from RT Module */
  3825. A_UINT32 num_rt_sched_algo_trigger;
  3826. /** Num of scheduler trigger from TQM Module */
  3827. A_UINT32 num_tqm_sched_algo_trigger;
  3828. /** Num of schedules for notify frame */
  3829. A_UINT32 notify_sched;
  3830. /** Duration based sendn termination */
  3831. A_UINT32 dur_based_sendn_term;
  3832. /** scheduled via NOTIFY2 */
  3833. A_UINT32 su_notify2_sched;
  3834. /** schedule if queued packets are greater than avg MSDUs in PPDU */
  3835. A_UINT32 su_optimal_queued_msdus_sched;
  3836. /** schedule due to timeout */
  3837. A_UINT32 su_delay_timeout_sched;
  3838. /** delay if txtime is less than 500us */
  3839. A_UINT32 su_min_txtime_sched_delay;
  3840. /** scheduled via no delay */
  3841. A_UINT32 su_no_delay;
  3842. /** Num of supercycles for this TxQ */
  3843. A_UINT32 num_supercycles;
  3844. /** Num of subcycles with sort for this TxQ */
  3845. A_UINT32 num_subcycles_with_sort;
  3846. /** Num of subcycles without sort for this Txq */
  3847. A_UINT32 num_subcycles_no_sort;
  3848. } htt_stats_tx_pdev_scheduler_txq_stats_tlv;
  3849. /* preserve old name alias for new name consistent with the tag name */
  3850. typedef htt_stats_tx_pdev_scheduler_txq_stats_tlv
  3851. htt_tx_pdev_stats_sched_per_txq_tlv;
  3852. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  3853. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  3854. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  3855. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  3856. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  3857. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  3858. do { \
  3859. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  3860. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  3861. } while (0)
  3862. typedef struct {
  3863. htt_tlv_hdr_t tlv_hdr;
  3864. /**
  3865. * BIT [ 7 : 0] :- mac_id
  3866. * BIT [31 : 8] :- reserved
  3867. */
  3868. A_UINT32 mac_id__word;
  3869. /** Current timestamp */
  3870. A_UINT32 current_timestamp;
  3871. } htt_stats_tx_sched_cmn_tlv;
  3872. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  3873. * TLV_TAGS:
  3874. * - HTT_STATS_TX_SCHED_CMN_TAG
  3875. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  3876. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  3877. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  3878. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  3879. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  3880. * - HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG
  3881. */
  3882. /* NOTE:
  3883. * This structure is for documentation, and cannot be safely used directly.
  3884. * Instead, use the constituent TLV structures to fill/parse.
  3885. */
  3886. typedef struct {
  3887. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  3888. struct {
  3889. htt_stats_tx_pdev_scheduler_txq_stats_tlv txq_tlv;
  3890. htt_stats_sched_txq_cmd_posted_tlv cmd_posted_tlv;
  3891. htt_stats_sched_txq_cmd_reaped_tlv cmd_reaped_tlv;
  3892. htt_stats_sched_txq_sched_order_su_tlv sched_order_su_tlv;
  3893. htt_stats_sched_txq_sched_ineligibility_tlv sched_ineligibility_tlv;
  3894. htt_stats_sched_txq_supercycle_trigger_tlv htt_sched_txq_sched_ineligibility_tlv_esched_supercycle_trigger_tlv;
  3895. } txq[1];
  3896. } htt_stats_tx_sched_t;
  3897. /* == TQM STATS == */
  3898. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 17
  3899. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  3900. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  3901. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3902. /* NOTE: Variable length TLV, use length spec to infer array size */
  3903. typedef struct {
  3904. htt_tlv_hdr_t tlv_hdr;
  3905. /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  3906. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, gen_mpdu_end_reason);
  3907. } htt_stats_tx_tqm_gen_mpdu_tlv;
  3908. /* preserve old name alias for new name consistent with the tag name */
  3909. typedef htt_stats_tx_tqm_gen_mpdu_tlv htt_tx_tqm_gen_mpdu_stats_tlv_v;
  3910. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3911. /* NOTE: Variable length TLV, use length spec to infer array size */
  3912. typedef struct {
  3913. htt_tlv_hdr_t tlv_hdr;
  3914. /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  3915. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, list_mpdu_end_reason);
  3916. } htt_stats_tx_tqm_list_mpdu_tlv;
  3917. /* preserve old name alias for new name consistent with the tag name */
  3918. typedef htt_stats_tx_tqm_list_mpdu_tlv htt_tx_tqm_list_mpdu_stats_tlv_v;
  3919. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3920. /* NOTE: Variable length TLV, use length spec to infer array size */
  3921. typedef struct {
  3922. htt_tlv_hdr_t tlv_hdr;
  3923. /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  3924. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, list_mpdu_cnt_hist);
  3925. } htt_stats_tx_tqm_list_mpdu_cnt_tlv;
  3926. /* preserve old name alias for new name consistent with the tag name */
  3927. typedef htt_stats_tx_tqm_list_mpdu_cnt_tlv htt_tx_tqm_list_mpdu_cnt_tlv_v;
  3928. typedef struct {
  3929. htt_tlv_hdr_t tlv_hdr;
  3930. A_UINT32 msdu_count;
  3931. A_UINT32 mpdu_count;
  3932. A_UINT32 remove_msdu;
  3933. A_UINT32 remove_mpdu;
  3934. A_UINT32 remove_msdu_ttl;
  3935. A_UINT32 send_bar;
  3936. A_UINT32 bar_sync;
  3937. A_UINT32 notify_mpdu;
  3938. A_UINT32 sync_cmd;
  3939. A_UINT32 write_cmd;
  3940. A_UINT32 hwsch_trigger;
  3941. A_UINT32 ack_tlv_proc;
  3942. A_UINT32 gen_mpdu_cmd;
  3943. A_UINT32 gen_list_cmd;
  3944. A_UINT32 remove_mpdu_cmd;
  3945. A_UINT32 remove_mpdu_tried_cmd;
  3946. A_UINT32 mpdu_queue_stats_cmd;
  3947. A_UINT32 mpdu_head_info_cmd;
  3948. A_UINT32 msdu_flow_stats_cmd;
  3949. A_UINT32 remove_msdu_cmd;
  3950. A_UINT32 remove_msdu_ttl_cmd;
  3951. A_UINT32 flush_cache_cmd;
  3952. A_UINT32 update_mpduq_cmd;
  3953. A_UINT32 enqueue;
  3954. A_UINT32 enqueue_notify;
  3955. A_UINT32 notify_mpdu_at_head;
  3956. A_UINT32 notify_mpdu_state_valid;
  3957. /*
  3958. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  3959. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  3960. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  3961. * for non-UDP MSDUs.
  3962. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  3963. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  3964. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  3965. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  3966. *
  3967. * Notify signifies that we trigger the scheduler.
  3968. */
  3969. A_UINT32 sched_udp_notify1;
  3970. A_UINT32 sched_udp_notify2;
  3971. A_UINT32 sched_nonudp_notify1;
  3972. A_UINT32 sched_nonudp_notify2;
  3973. } htt_stats_tx_tqm_pdev_tlv;
  3974. /* preserve old name alias for new name consistent with the tag name */
  3975. typedef htt_stats_tx_tqm_pdev_tlv htt_tx_tqm_pdev_stats_tlv_v;
  3976. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  3977. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  3978. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  3979. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  3980. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  3981. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  3982. do { \
  3983. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  3984. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  3985. } while (0)
  3986. typedef struct {
  3987. htt_tlv_hdr_t tlv_hdr;
  3988. /**
  3989. * BIT [ 7 : 0] :- mac_id
  3990. * BIT [31 : 8] :- reserved
  3991. */
  3992. A_UINT32 mac_id__word;
  3993. A_UINT32 max_cmdq_id;
  3994. A_UINT32 list_mpdu_cnt_hist_intvl;
  3995. /* Global stats */
  3996. A_UINT32 add_msdu;
  3997. A_UINT32 q_empty;
  3998. A_UINT32 q_not_empty;
  3999. A_UINT32 drop_notification;
  4000. A_UINT32 desc_threshold;
  4001. A_UINT32 hwsch_tqm_invalid_status;
  4002. A_UINT32 missed_tqm_gen_mpdus;
  4003. A_UINT32 tqm_active_tids;
  4004. A_UINT32 tqm_inactive_tids;
  4005. A_UINT32 tqm_active_msduq_flows;
  4006. /* SAWF system delay reference timestamp updation related stats */
  4007. A_UINT32 total_msduq_timestamp_updates;
  4008. A_UINT32 total_msduq_timestamp_updates_by_get_mpdu_head_info_cmd;
  4009. A_UINT32 total_msduq_timestamp_updates_by_empty_to_nonempty_status;
  4010. A_UINT32 total_get_mpdu_head_info_cmds_by_sched_algo_la_query;
  4011. A_UINT32 total_get_mpdu_head_info_cmds_by_tac;
  4012. A_UINT32 total_gen_mpdu_cmds_by_sched_algo_la_query;
  4013. A_UINT32 high_prio_q_not_empty;
  4014. } htt_stats_tx_tqm_cmn_tlv;
  4015. /* preserve old name alias for new name consistent with the tag name */
  4016. typedef htt_stats_tx_tqm_cmn_tlv htt_tx_tqm_cmn_stats_tlv;
  4017. typedef struct {
  4018. htt_tlv_hdr_t tlv_hdr;
  4019. /* Error stats */
  4020. A_UINT32 q_empty_failure;
  4021. A_UINT32 q_not_empty_failure;
  4022. A_UINT32 add_msdu_failure;
  4023. /* TQM reset debug stats */
  4024. A_UINT32 tqm_cache_ctl_err;
  4025. A_UINT32 tqm_soft_reset;
  4026. A_UINT32 tqm_reset_total_num_in_use_link_descs;
  4027. A_UINT32 tqm_reset_worst_case_num_lost_link_descs;
  4028. A_UINT32 tqm_reset_worst_case_num_lost_host_tx_bufs_count;
  4029. A_UINT32 tqm_reset_num_in_use_link_descs_internal_tqm;
  4030. A_UINT32 tqm_reset_num_in_use_link_descs_wbm_idle_link_ring;
  4031. A_UINT32 tqm_reset_time_to_tqm_hang_delta_ms;
  4032. A_UINT32 tqm_reset_recovery_time_ms;
  4033. A_UINT32 tqm_reset_num_peers_hdl;
  4034. A_UINT32 tqm_reset_cumm_dirty_hw_mpduq_proc_cnt;
  4035. A_UINT32 tqm_reset_cumm_dirty_hw_msduq_proc;
  4036. A_UINT32 tqm_reset_flush_cache_cmd_su_cnt;
  4037. A_UINT32 tqm_reset_flush_cache_cmd_other_cnt;
  4038. A_UINT32 tqm_reset_flush_cache_cmd_trig_type;
  4039. A_UINT32 tqm_reset_flush_cache_cmd_trig_cfg;
  4040. A_UINT32 tqm_reset_flush_cache_cmd_skip_cmd_status_null;
  4041. } htt_stats_tx_tqm_error_stats_tlv;
  4042. /* preserve old name alias for new name consistent with the tag name */
  4043. typedef htt_stats_tx_tqm_error_stats_tlv htt_tx_tqm_error_stats_tlv;
  4044. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  4045. * TLV_TAGS:
  4046. * - HTT_STATS_TX_TQM_CMN_TAG
  4047. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  4048. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  4049. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  4050. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  4051. * - HTT_STATS_TX_TQM_PDEV_TAG
  4052. */
  4053. /* NOTE:
  4054. * This structure is for documentation, and cannot be safely used directly.
  4055. * Instead, use the constituent TLV structures to fill/parse.
  4056. */
  4057. #ifdef ATH_TARGET
  4058. typedef struct {
  4059. htt_stats_tx_tqm_cmn_tlv cmn_tlv;
  4060. htt_stats_tx_tqm_error_stats_tlv err_tlv;
  4061. htt_stats_tx_tqm_gen_mpdu_tlv gen_mpdu_stats_tlv;
  4062. htt_stats_tx_tqm_list_mpdu_tlv list_mpdu_stats_tlv;
  4063. htt_stats_tx_tqm_list_mpdu_cnt_tlv list_mpdu_cnt_tlv;
  4064. htt_stats_tx_tqm_pdev_tlv tqm_pdev_stats_tlv;
  4065. } htt_tx_tqm_pdev_stats_t;
  4066. #endif /* ATH_TARGET */
  4067. /* == TQM CMDQ stats == */
  4068. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  4069. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  4070. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  4071. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  4072. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  4073. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  4074. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  4075. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  4078. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  4079. } while (0)
  4080. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  4081. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  4082. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  4083. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  4086. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  4087. } while (0)
  4088. typedef struct {
  4089. htt_tlv_hdr_t tlv_hdr;
  4090. /*
  4091. * BIT [ 7 : 0] :- mac_id
  4092. * BIT [15 : 8] :- cmdq_id
  4093. * BIT [31 : 16] :- reserved
  4094. */
  4095. A_UINT32 mac_id__cmdq_id__word;
  4096. A_UINT32 sync_cmd;
  4097. A_UINT32 write_cmd;
  4098. A_UINT32 gen_mpdu_cmd;
  4099. A_UINT32 mpdu_queue_stats_cmd;
  4100. A_UINT32 mpdu_head_info_cmd;
  4101. A_UINT32 msdu_flow_stats_cmd;
  4102. A_UINT32 remove_mpdu_cmd;
  4103. A_UINT32 remove_msdu_cmd;
  4104. A_UINT32 flush_cache_cmd;
  4105. A_UINT32 update_mpduq_cmd;
  4106. A_UINT32 update_msduq_cmd;
  4107. } htt_stats_tx_tqm_cmdq_status_tlv;
  4108. /* preserve old name alias for new name consistent with the tag name */
  4109. typedef htt_stats_tx_tqm_cmdq_status_tlv htt_tx_tqm_cmdq_status_tlv;
  4110. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  4111. * TLV_TAGS:
  4112. * - HTT_STATS_STRING_TAG
  4113. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  4114. */
  4115. /* NOTE:
  4116. * This structure is for documentation, and cannot be safely used directly.
  4117. * Instead, use the constituent TLV structures to fill/parse.
  4118. */
  4119. #ifdef ATH_TARGET
  4120. typedef struct {
  4121. struct {
  4122. htt_stats_string_tlv cmdq_str_tlv;
  4123. htt_stats_tx_tqm_cmdq_status_tlv status_tlv;
  4124. } q[1];
  4125. } htt_tx_tqm_cmdq_stats_t;
  4126. #endif /* ATH_TARGET */
  4127. /* == TX-DE STATS == */
  4128. /* Structures for tx de stats */
  4129. typedef struct {
  4130. htt_tlv_hdr_t tlv_hdr;
  4131. A_UINT32 m1_packets;
  4132. A_UINT32 m2_packets;
  4133. A_UINT32 m3_packets;
  4134. A_UINT32 m4_packets;
  4135. A_UINT32 g1_packets;
  4136. A_UINT32 g2_packets;
  4137. A_UINT32 rc4_packets;
  4138. A_UINT32 eap_packets;
  4139. A_UINT32 eapol_start_packets;
  4140. A_UINT32 eapol_logoff_packets;
  4141. A_UINT32 eapol_encap_asf_packets;
  4142. } htt_stats_tx_de_eapol_packets_tlv;
  4143. /* preserve old name alias for new name consistent with the tag name */
  4144. typedef htt_stats_tx_de_eapol_packets_tlv htt_tx_de_eapol_packets_stats_tlv;
  4145. typedef struct {
  4146. htt_tlv_hdr_t tlv_hdr;
  4147. A_UINT32 ap_bss_peer_not_found;
  4148. A_UINT32 ap_bcast_mcast_no_peer;
  4149. A_UINT32 sta_delete_in_progress;
  4150. A_UINT32 ibss_no_bss_peer;
  4151. A_UINT32 invaild_vdev_type;
  4152. A_UINT32 invalid_ast_peer_entry;
  4153. A_UINT32 peer_entry_invalid;
  4154. A_UINT32 ethertype_not_ip;
  4155. A_UINT32 eapol_lookup_failed;
  4156. A_UINT32 qpeer_not_allow_data;
  4157. A_UINT32 fse_tid_override;
  4158. A_UINT32 ipv6_jumbogram_zero_length;
  4159. A_UINT32 qos_to_non_qos_in_prog;
  4160. A_UINT32 ap_bcast_mcast_eapol;
  4161. A_UINT32 unicast_on_ap_bss_peer;
  4162. A_UINT32 ap_vdev_invalid;
  4163. A_UINT32 incomplete_llc;
  4164. A_UINT32 eapol_duplicate_m3;
  4165. A_UINT32 eapol_duplicate_m4;
  4166. } htt_stats_tx_de_classify_failed_tlv;
  4167. /* preserve old name alias for new name consistent with the tag name */
  4168. typedef htt_stats_tx_de_classify_failed_tlv htt_tx_de_classify_failed_stats_tlv;
  4169. typedef struct {
  4170. htt_tlv_hdr_t tlv_hdr;
  4171. A_UINT32 arp_packets;
  4172. A_UINT32 igmp_packets;
  4173. A_UINT32 dhcp_packets;
  4174. A_UINT32 host_inspected;
  4175. A_UINT32 htt_included;
  4176. A_UINT32 htt_valid_mcs;
  4177. A_UINT32 htt_valid_nss;
  4178. A_UINT32 htt_valid_preamble_type;
  4179. A_UINT32 htt_valid_chainmask;
  4180. A_UINT32 htt_valid_guard_interval;
  4181. A_UINT32 htt_valid_retries;
  4182. A_UINT32 htt_valid_bw_info;
  4183. A_UINT32 htt_valid_power;
  4184. A_UINT32 htt_valid_key_flags;
  4185. A_UINT32 htt_valid_no_encryption;
  4186. A_UINT32 fse_entry_count;
  4187. A_UINT32 fse_priority_be;
  4188. A_UINT32 fse_priority_high;
  4189. A_UINT32 fse_priority_low;
  4190. A_UINT32 fse_traffic_ptrn_be;
  4191. A_UINT32 fse_traffic_ptrn_over_sub;
  4192. A_UINT32 fse_traffic_ptrn_bursty;
  4193. A_UINT32 fse_traffic_ptrn_interactive;
  4194. A_UINT32 fse_traffic_ptrn_periodic;
  4195. A_UINT32 fse_hwqueue_alloc;
  4196. A_UINT32 fse_hwqueue_created;
  4197. A_UINT32 fse_hwqueue_send_to_host;
  4198. A_UINT32 mcast_entry;
  4199. A_UINT32 bcast_entry;
  4200. A_UINT32 htt_update_peer_cache;
  4201. A_UINT32 htt_learning_frame;
  4202. A_UINT32 fse_invalid_peer;
  4203. /**
  4204. * mec_notify is HTT TX WBM multicast echo check notification
  4205. * from firmware to host. FW sends SA addresses to host for all
  4206. * multicast/broadcast packets received on STA side.
  4207. */
  4208. A_UINT32 mec_notify;
  4209. A_UINT32 arp_response;
  4210. A_UINT32 arp_request;
  4211. } htt_stats_tx_de_classify_stats_tlv;
  4212. /* preserve old name alias for new name consistent with the tag name */
  4213. typedef htt_stats_tx_de_classify_stats_tlv htt_tx_de_classify_stats_tlv;
  4214. typedef struct {
  4215. htt_tlv_hdr_t tlv_hdr;
  4216. A_UINT32 eok;
  4217. A_UINT32 classify_done;
  4218. A_UINT32 lookup_failed;
  4219. A_UINT32 send_host_dhcp;
  4220. A_UINT32 send_host_mcast;
  4221. A_UINT32 send_host_unknown_dest;
  4222. A_UINT32 send_host;
  4223. A_UINT32 status_invalid;
  4224. } htt_stats_tx_de_classify_status_tlv;
  4225. /* preserve old name alias for new name consistent with the tag name */
  4226. typedef htt_stats_tx_de_classify_status_tlv htt_tx_de_classify_status_stats_tlv;
  4227. typedef struct {
  4228. htt_tlv_hdr_t tlv_hdr;
  4229. A_UINT32 enqueued_pkts;
  4230. A_UINT32 to_tqm;
  4231. A_UINT32 to_tqm_bypass;
  4232. } htt_stats_tx_de_enqueue_packets_tlv;
  4233. /* preserve old name alias for new name consistent with the tag name */
  4234. typedef htt_stats_tx_de_enqueue_packets_tlv htt_tx_de_enqueue_packets_stats_tlv;
  4235. typedef struct {
  4236. htt_tlv_hdr_t tlv_hdr;
  4237. A_UINT32 discarded_pkts;
  4238. A_UINT32 local_frames;
  4239. A_UINT32 is_ext_msdu;
  4240. } htt_stats_tx_de_enqueue_discard_tlv;
  4241. /* preserve old name alias for new name consistent with the tag name */
  4242. typedef htt_stats_tx_de_enqueue_discard_tlv htt_tx_de_enqueue_discard_stats_tlv;
  4243. typedef struct {
  4244. htt_tlv_hdr_t tlv_hdr;
  4245. A_UINT32 tcl_dummy_frame;
  4246. A_UINT32 tqm_dummy_frame;
  4247. A_UINT32 tqm_notify_frame;
  4248. A_UINT32 fw2wbm_enq;
  4249. A_UINT32 tqm_bypass_frame;
  4250. } htt_stats_tx_de_compl_stats_tlv;
  4251. /* preserve old name alias for new name consistent with the tag name */
  4252. typedef htt_stats_tx_de_compl_stats_tlv htt_tx_de_compl_stats_tlv;
  4253. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  4254. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  4255. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  4256. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  4257. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  4258. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  4259. do { \
  4260. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  4261. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  4262. } while (0)
  4263. /*
  4264. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  4265. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  4266. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  4267. * 200us & again request for it. This is a histogram of time we wait, with
  4268. * bin of 200ms & there are 10 bin (2 seconds max)
  4269. * They are defined by the following macros in FW
  4270. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  4271. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  4272. * ENTRIES_PER_BIN_COUNT)
  4273. */
  4274. typedef struct {
  4275. htt_tlv_hdr_t tlv_hdr;
  4276. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw2wbm_ring_full_hist);
  4277. } htt_stats_tx_de_fw2wbm_ring_full_hist_tlv;
  4278. /* preserve old name alias for new name consistent with the tag name */
  4279. typedef htt_stats_tx_de_fw2wbm_ring_full_hist_tlv
  4280. htt_tx_de_fw2wbm_ring_full_hist_tlv;
  4281. typedef struct {
  4282. htt_tlv_hdr_t tlv_hdr;
  4283. /**
  4284. * BIT [ 7 : 0] :- mac_id
  4285. * BIT [31 : 8] :- reserved
  4286. */
  4287. A_UINT32 mac_id__word;
  4288. /* Global Stats */
  4289. A_UINT32 tcl2fw_entry_count;
  4290. A_UINT32 not_to_fw;
  4291. A_UINT32 invalid_pdev_vdev_peer;
  4292. A_UINT32 tcl_res_invalid_addrx;
  4293. A_UINT32 wbm2fw_entry_count;
  4294. A_UINT32 invalid_pdev;
  4295. A_UINT32 tcl_res_addrx_timeout;
  4296. A_UINT32 invalid_vdev;
  4297. A_UINT32 invalid_tcl_exp_frame_desc;
  4298. A_UINT32 vdev_id_mismatch_cnt;
  4299. } htt_stats_tx_de_cmn_tlv;
  4300. /* preserve old name alias for new name consistent with the tag name */
  4301. typedef htt_stats_tx_de_cmn_tlv htt_tx_de_cmn_stats_tlv;
  4302. #define HTT_STATS_RX_FW_RING_SIZE_NUM_ENTRIES(dword) ((dword >> 0) & 0xffff)
  4303. #define HTT_STATS_RX_FW_RING_CURR_NUM_ENTRIES(dword) ((dword >> 16) & 0xffff)
  4304. /* Rx debug info for status rings */
  4305. typedef struct {
  4306. htt_tlv_hdr_t tlv_hdr;
  4307. /**
  4308. * BIT [15 : 0] :- max possible number of entries in respective ring
  4309. * (size of the ring in terms of entries)
  4310. * BIT [16 : 31] :- current number of entries occupied in respective ring
  4311. */
  4312. A_UINT32 entry_status_sw2rxdma;
  4313. A_UINT32 entry_status_rxdma2reo;
  4314. A_UINT32 entry_status_reo2sw1;
  4315. A_UINT32 entry_status_reo2sw4;
  4316. A_UINT32 entry_status_refillringipa;
  4317. A_UINT32 entry_status_refillringhost;
  4318. /** datarate - Moving Average of Number of Entries */
  4319. A_UINT32 datarate_refillringipa;
  4320. A_UINT32 datarate_refillringhost;
  4321. /**
  4322. * refillringhost_backpress_hist and refillringipa_backpress_hist are
  4323. * deprecated, and will be filled with 0x0 by the target.
  4324. */
  4325. A_UINT32 refillringhost_backpress_hist[3];
  4326. A_UINT32 refillringipa_backpress_hist[3];
  4327. /**
  4328. * Number of times reo2sw4(IPA_DEST_RING) ring is back-pressured
  4329. * in recent time periods
  4330. * element 0: in last 0 to 250ms
  4331. * element 1: 250ms to 500ms
  4332. * element 2: above 500ms
  4333. */
  4334. A_UINT32 reo2sw4ringipa_backpress_hist[3];
  4335. } htt_stats_rx_ring_stats_tlv;
  4336. /* preserve old name alias for new name consistent with the tag name */
  4337. typedef htt_stats_rx_ring_stats_tlv htt_rx_fw_ring_stats_tlv_v;
  4338. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  4339. * TLV_TAGS:
  4340. * - HTT_STATS_TX_DE_CMN_TAG
  4341. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  4342. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  4343. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  4344. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  4345. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  4346. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  4347. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  4348. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  4349. */
  4350. /* NOTE:
  4351. * This structure is for documentation, and cannot be safely used directly.
  4352. * Instead, use the constituent TLV structures to fill/parse.
  4353. */
  4354. #ifdef ATH_TARGET
  4355. typedef struct {
  4356. htt_stats_tx_de_cmn_tlv cmn_tlv;
  4357. htt_stats_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  4358. htt_stats_tx_de_eapol_packets_tlv eapol_stats_tlv;
  4359. htt_stats_tx_de_classify_stats_tlv classify_stats_tlv;
  4360. htt_stats_tx_de_classify_failed_tlv classify_failed_tlv;
  4361. htt_stats_tx_de_classify_status_tlv classify_status_rlv;
  4362. htt_stats_tx_de_enqueue_packets_tlv enqueue_packets_tlv;
  4363. htt_stats_tx_de_enqueue_discard_tlv enqueue_discard_tlv;
  4364. htt_stats_tx_de_compl_stats_tlv comp_status_tlv;
  4365. } htt_tx_de_stats_t;
  4366. #endif /* ATH_TARGET */
  4367. /* == RING-IF STATS == */
  4368. /* DWORD num_elems__prefetch_tail_idx */
  4369. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  4370. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  4371. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  4372. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  4373. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  4374. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  4375. HTT_RING_IF_STATS_NUM_ELEMS_S)
  4376. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  4377. do { \
  4378. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  4379. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  4380. } while (0)
  4381. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  4382. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  4383. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  4384. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  4385. do { \
  4386. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  4387. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  4388. } while (0)
  4389. /* DWORD head_idx__tail_idx */
  4390. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  4391. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  4392. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  4393. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  4394. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  4395. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  4396. HTT_RING_IF_STATS_HEAD_IDX_S)
  4397. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  4398. do { \
  4399. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  4400. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  4401. } while (0)
  4402. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  4403. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  4404. HTT_RING_IF_STATS_TAIL_IDX_S)
  4405. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  4408. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  4409. } while (0)
  4410. /* DWORD shadow_head_idx__shadow_tail_idx */
  4411. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  4412. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  4413. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  4414. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  4415. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  4416. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  4417. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  4418. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  4419. do { \
  4420. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  4421. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  4422. } while (0)
  4423. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  4424. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  4425. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  4426. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  4427. do { \
  4428. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  4429. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  4430. } while (0)
  4431. /* DWORD lwm_thresh__hwm_thresh */
  4432. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  4433. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  4434. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  4435. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  4436. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  4437. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  4438. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  4439. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  4440. do { \
  4441. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  4442. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  4443. } while (0)
  4444. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  4445. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  4446. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  4447. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  4448. do { \
  4449. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  4450. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  4451. } while (0)
  4452. #define HTT_STATS_LOW_WM_BINS 5
  4453. #define HTT_STATS_HIGH_WM_BINS 5
  4454. typedef struct {
  4455. /** DWORD aligned base memory address of the ring */
  4456. A_UINT32 base_addr;
  4457. /** size of each ring element */
  4458. A_UINT32 elem_size;
  4459. /**
  4460. * BIT [15 : 0] :- num_elems
  4461. * BIT [31 : 16] :- prefetch_tail_idx
  4462. */
  4463. A_UINT32 num_elems__prefetch_tail_idx;
  4464. /**
  4465. * BIT [15 : 0] :- head_idx
  4466. * BIT [31 : 16] :- tail_idx
  4467. */
  4468. A_UINT32 head_idx__tail_idx;
  4469. /**
  4470. * BIT [15 : 0] :- shadow_head_idx
  4471. * BIT [31 : 16] :- shadow_tail_idx
  4472. */
  4473. A_UINT32 shadow_head_idx__shadow_tail_idx;
  4474. A_UINT32 num_tail_incr;
  4475. /**
  4476. * BIT [15 : 0] :- lwm_thresh
  4477. * BIT [31 : 16] :- hwm_thresh
  4478. */
  4479. A_UINT32 lwm_thresh__hwm_thresh;
  4480. A_UINT32 overrun_hit_count;
  4481. A_UINT32 underrun_hit_count;
  4482. A_UINT32 prod_blockwait_count;
  4483. A_UINT32 cons_blockwait_count;
  4484. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS];
  4485. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS];
  4486. } htt_stats_ring_if_tlv;
  4487. /* preserve old name alias for new name consistent with the tag name */
  4488. typedef htt_stats_ring_if_tlv htt_ring_if_stats_tlv;
  4489. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  4490. #define HTT_RING_IF_CMN_MAC_ID_S 0
  4491. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  4492. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  4493. HTT_RING_IF_CMN_MAC_ID_S)
  4494. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  4495. do { \
  4496. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  4497. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  4498. } while (0)
  4499. typedef struct {
  4500. htt_tlv_hdr_t tlv_hdr;
  4501. /**
  4502. * BIT [ 7 : 0] :- mac_id
  4503. * BIT [31 : 8] :- reserved
  4504. */
  4505. A_UINT32 mac_id__word;
  4506. A_UINT32 num_records;
  4507. } htt_stats_ring_if_cmn_tlv;
  4508. /* preserve old name alias for new name consistent with the tag name */
  4509. typedef htt_stats_ring_if_cmn_tlv htt_ring_if_cmn_tlv;
  4510. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  4511. * TLV_TAGS:
  4512. * - HTT_STATS_RING_IF_CMN_TAG
  4513. * - HTT_STATS_STRING_TAG
  4514. * - HTT_STATS_RING_IF_TAG
  4515. */
  4516. /* NOTE:
  4517. * This structure is for documentation, and cannot be safely used directly.
  4518. * Instead, use the constituent TLV structures to fill/parse.
  4519. */
  4520. #ifdef ATH_TARGET
  4521. typedef struct {
  4522. htt_stats_ring_if_cmn_tlv cmn_tlv;
  4523. /** Variable based on the Number of records. */
  4524. struct {
  4525. htt_stats_string_tlv ring_str_tlv;
  4526. htt_stats_ring_if_tlv ring_tlv;
  4527. } r[1];
  4528. } htt_ring_if_stats_t;
  4529. #endif /* ATH_TARGET */
  4530. /* == SFM STATS == */
  4531. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  4532. /* NOTE: Variable length TLV, use length spec to infer array size */
  4533. typedef struct {
  4534. htt_tlv_hdr_t tlv_hdr;
  4535. /** Number of DWORDS used per user and per client */
  4536. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, dwords_used_by_user_n);
  4537. } htt_stats_sfm_client_user_tlv;
  4538. /* preserve old name alias for new name consistent with the tag name */
  4539. typedef htt_stats_sfm_client_user_tlv htt_sfm_client_user_tlv_v;
  4540. typedef struct {
  4541. htt_tlv_hdr_t tlv_hdr;
  4542. /** Client ID */
  4543. A_UINT32 client_id;
  4544. /** Minimum number of buffers */
  4545. A_UINT32 buf_min;
  4546. /** Maximum number of buffers */
  4547. A_UINT32 buf_max;
  4548. /** Number of Busy buffers */
  4549. A_UINT32 buf_busy;
  4550. /** Number of Allocated buffers */
  4551. A_UINT32 buf_alloc;
  4552. /** Number of Available/Usable buffers */
  4553. A_UINT32 buf_avail;
  4554. /** Number of users */
  4555. A_UINT32 num_users;
  4556. } htt_stats_sfm_client_tlv;
  4557. /* preserve old name alias for new name consistent with the tag name */
  4558. typedef htt_stats_sfm_client_tlv htt_sfm_client_tlv;
  4559. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  4560. #define HTT_SFM_CMN_MAC_ID_S 0
  4561. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  4562. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  4563. HTT_SFM_CMN_MAC_ID_S)
  4564. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  4567. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  4568. } while (0)
  4569. typedef struct {
  4570. htt_tlv_hdr_t tlv_hdr;
  4571. /**
  4572. * BIT [ 7 : 0] :- mac_id
  4573. * BIT [31 : 8] :- reserved
  4574. */
  4575. A_UINT32 mac_id__word;
  4576. /**
  4577. * Indicates the total number of 128 byte buffers in the CMEM
  4578. * that are available for buffer sharing
  4579. */
  4580. A_UINT32 buf_total;
  4581. /**
  4582. * Indicates for certain client or all the clients there is no
  4583. * dword saved in SFM, refer to SFM_R1_MEM_EMPTY
  4584. */
  4585. A_UINT32 mem_empty;
  4586. /** DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  4587. A_UINT32 deallocate_bufs;
  4588. /** Number of Records */
  4589. A_UINT32 num_records;
  4590. } htt_stats_sfm_cmn_tlv;
  4591. /* preserve old name alias for new name consistent with the tag name */
  4592. typedef htt_stats_sfm_cmn_tlv htt_sfm_cmn_tlv;
  4593. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  4594. * TLV_TAGS:
  4595. * - HTT_STATS_SFM_CMN_TAG
  4596. * - HTT_STATS_STRING_TAG
  4597. * - HTT_STATS_SFM_CLIENT_TAG
  4598. * - HTT_STATS_SFM_CLIENT_USER_TAG
  4599. */
  4600. /* NOTE:
  4601. * This structure is for documentation, and cannot be safely used directly.
  4602. * Instead, use the constituent TLV structures to fill/parse.
  4603. */
  4604. #ifdef ATH_TARGET
  4605. typedef struct {
  4606. htt_stats_sfm_cmn_tlv cmn_tlv;
  4607. /** Variable based on the Number of records. */
  4608. struct {
  4609. htt_stats_string_tlv client_str_tlv;
  4610. htt_stats_sfm_client_tlv client_tlv;
  4611. htt_stats_sfm_client_user_tlv user_tlv;
  4612. } r[1];
  4613. } htt_sfm_stats_t;
  4614. #endif /* ATH_TARGET */
  4615. /* == SRNG STATS == */
  4616. /* DWORD mac_id__ring_id__arena__ep */
  4617. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  4618. #define HTT_SRING_STATS_MAC_ID_S 0
  4619. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  4620. #define HTT_SRING_STATS_RING_ID_S 8
  4621. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  4622. #define HTT_SRING_STATS_ARENA_S 16
  4623. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  4624. #define HTT_SRING_STATS_EP_TYPE_S 24
  4625. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  4626. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  4627. HTT_SRING_STATS_MAC_ID_S)
  4628. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  4629. do { \
  4630. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  4631. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  4632. } while (0)
  4633. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  4634. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  4635. HTT_SRING_STATS_RING_ID_S)
  4636. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  4637. do { \
  4638. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  4639. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  4640. } while (0)
  4641. #define HTT_SRING_STATS_ARENA_GET(_var) \
  4642. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  4643. HTT_SRING_STATS_ARENA_S)
  4644. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  4645. do { \
  4646. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  4647. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  4648. } while (0)
  4649. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  4650. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  4651. HTT_SRING_STATS_EP_TYPE_S)
  4652. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  4653. do { \
  4654. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  4655. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  4656. } while (0)
  4657. /* DWORD num_avail_words__num_valid_words */
  4658. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  4659. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  4660. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  4661. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  4662. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  4663. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  4664. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  4665. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  4666. do { \
  4667. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  4668. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  4669. } while (0)
  4670. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  4671. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  4672. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  4673. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  4674. do { \
  4675. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  4676. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  4677. } while (0)
  4678. /* DWORD head_ptr__tail_ptr */
  4679. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  4680. #define HTT_SRING_STATS_HEAD_PTR_S 0
  4681. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  4682. #define HTT_SRING_STATS_TAIL_PTR_S 16
  4683. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  4684. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  4685. HTT_SRING_STATS_HEAD_PTR_S)
  4686. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  4687. do { \
  4688. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  4689. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  4690. } while (0)
  4691. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  4692. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  4693. HTT_SRING_STATS_TAIL_PTR_S)
  4694. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  4695. do { \
  4696. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  4697. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  4698. } while (0)
  4699. /* DWORD consumer_empty__producer_full */
  4700. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  4701. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  4702. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  4703. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  4704. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  4705. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  4706. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  4707. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  4710. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  4711. } while (0)
  4712. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  4713. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  4714. HTT_SRING_STATS_PRODUCER_FULL_S)
  4715. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  4716. do { \
  4717. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  4718. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  4719. } while (0)
  4720. /* DWORD prefetch_count__internal_tail_ptr */
  4721. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  4722. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  4723. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  4724. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  4725. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  4726. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  4727. HTT_SRING_STATS_PREFETCH_COUNT_S)
  4728. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  4731. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  4732. } while (0)
  4733. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  4734. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  4735. HTT_SRING_STATS_INTERNAL_TP_S)
  4736. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  4739. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  4740. } while (0)
  4741. typedef struct {
  4742. htt_tlv_hdr_t tlv_hdr;
  4743. /**
  4744. * BIT [ 7 : 0] :- mac_id
  4745. * BIT [15 : 8] :- ring_id
  4746. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  4747. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  4748. * BIT [31 : 25] :- reserved
  4749. */
  4750. A_UINT32 mac_id__ring_id__arena__ep;
  4751. /** DWORD aligned base memory address of the ring */
  4752. A_UINT32 base_addr_lsb;
  4753. A_UINT32 base_addr_msb;
  4754. /** size of ring */
  4755. A_UINT32 ring_size;
  4756. /** size of each ring element */
  4757. A_UINT32 elem_size;
  4758. /** Ring status
  4759. *
  4760. * BIT [15 : 0] :- num_avail_words
  4761. * BIT [31 : 16] :- num_valid_words
  4762. */
  4763. A_UINT32 num_avail_words__num_valid_words;
  4764. /** Index of head and tail
  4765. * BIT [15 : 0] :- head_ptr
  4766. * BIT [31 : 16] :- tail_ptr
  4767. */
  4768. A_UINT32 head_ptr__tail_ptr;
  4769. /** Empty or full counter of rings
  4770. * BIT [15 : 0] :- consumer_empty
  4771. * BIT [31 : 16] :- producer_full
  4772. */
  4773. A_UINT32 consumer_empty__producer_full;
  4774. /** Prefetch status of consumer ring
  4775. * BIT [15 : 0] :- prefetch_count
  4776. * BIT [31 : 16] :- internal_tail_ptr
  4777. */
  4778. A_UINT32 prefetch_count__internal_tail_ptr;
  4779. } htt_stats_sring_stats_tlv;
  4780. /* preserve old name alias for new name consistent with the tag name */
  4781. typedef htt_stats_sring_stats_tlv htt_sring_stats_tlv;
  4782. typedef struct {
  4783. htt_tlv_hdr_t tlv_hdr;
  4784. A_UINT32 num_records;
  4785. } htt_stats_sring_cmn_tlv;
  4786. /* preserve old name alias for new name consistent with the tag name */
  4787. typedef htt_stats_sring_cmn_tlv htt_sring_cmn_tlv;
  4788. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  4789. * TLV_TAGS:
  4790. * - HTT_STATS_SRING_CMN_TAG
  4791. * - HTT_STATS_STRING_TAG
  4792. * - HTT_STATS_SRING_STATS_TAG
  4793. */
  4794. /* NOTE:
  4795. * This structure is for documentation, and cannot be safely used directly.
  4796. * Instead, use the constituent TLV structures to fill/parse.
  4797. */
  4798. #ifdef ATH_TARGET
  4799. typedef struct {
  4800. htt_stats_sring_cmn_tlv cmn_tlv;
  4801. /** Variable based on the Number of records */
  4802. struct {
  4803. htt_stats_string_tlv sring_str_tlv;
  4804. htt_stats_sring_stats_tlv sring_stats_tlv;
  4805. } r[1];
  4806. } htt_sring_stats_t;
  4807. #endif /* ATH_TARGET */
  4808. /* == PDEV TX RATE CTRL STATS == */
  4809. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  4810. #define HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  4811. #define HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  4812. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  4813. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  4814. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  4815. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  4816. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  4817. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  4818. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  4819. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  4820. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  4821. #define HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES 6
  4822. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  4823. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  4824. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  4825. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  4826. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  4827. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  4828. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  4829. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  4830. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  4831. do { \
  4832. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  4833. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  4834. } while (0)
  4835. #define HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS \
  4836. (HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + \
  4837. HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + \
  4838. HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS)
  4839. #define HTT_TX_PDEV_STATS_NUM_PER_COUNTERS 101
  4840. /*
  4841. * Introduce new TX counters to support 320MHz support and punctured modes
  4842. */
  4843. typedef enum {
  4844. HTT_TX_PDEV_STATS_PUNCTURED_NONE = 0,
  4845. HTT_TX_PDEV_STATS_PUNCTURED_20 = 1,
  4846. HTT_TX_PDEV_STATS_PUNCTURED_40 = 2,
  4847. HTT_TX_PDEV_STATS_PUNCTURED_80 = 3,
  4848. HTT_TX_PDEV_STATS_PUNCTURED_120 = 4,
  4849. HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  4850. } HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  4851. #define HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  4852. /* 11be related updates */
  4853. #define HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0...13,-2,-1 */
  4854. #define HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  4855. #define HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS 6
  4856. #define HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS 4
  4857. typedef enum {
  4858. HTT_TX_PDEV_STATS_AX_RU_SIZE_26,
  4859. HTT_TX_PDEV_STATS_AX_RU_SIZE_52,
  4860. HTT_TX_PDEV_STATS_AX_RU_SIZE_106,
  4861. HTT_TX_PDEV_STATS_AX_RU_SIZE_242,
  4862. HTT_TX_PDEV_STATS_AX_RU_SIZE_484,
  4863. HTT_TX_PDEV_STATS_AX_RU_SIZE_996,
  4864. HTT_TX_PDEV_STATS_AX_RU_SIZE_996x2,
  4865. HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS,
  4866. } HTT_TX_PDEV_STATS_AX_RU_SIZE;
  4867. typedef enum {
  4868. HTT_TX_PDEV_STATS_BE_RU_SIZE_26,
  4869. HTT_TX_PDEV_STATS_BE_RU_SIZE_52,
  4870. HTT_TX_PDEV_STATS_BE_RU_SIZE_52_26,
  4871. HTT_TX_PDEV_STATS_BE_RU_SIZE_106,
  4872. HTT_TX_PDEV_STATS_BE_RU_SIZE_106_26,
  4873. HTT_TX_PDEV_STATS_BE_RU_SIZE_242,
  4874. HTT_TX_PDEV_STATS_BE_RU_SIZE_484,
  4875. HTT_TX_PDEV_STATS_BE_RU_SIZE_484_242,
  4876. HTT_TX_PDEV_STATS_BE_RU_SIZE_996,
  4877. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484,
  4878. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  4879. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2,
  4880. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  4881. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3,
  4882. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  4883. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x4,
  4884. HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  4885. } HTT_TX_PDEV_STATS_BE_RU_SIZE;
  4886. typedef struct {
  4887. htt_tlv_hdr_t tlv_hdr;
  4888. /**
  4889. * BIT [ 7 : 0] :- mac_id
  4890. * BIT [31 : 8] :- reserved
  4891. */
  4892. A_UINT32 mac_id__word;
  4893. /** Number of tx ldpc packets */
  4894. A_UINT32 tx_ldpc;
  4895. /** Number of tx rts packets */
  4896. A_UINT32 rts_cnt;
  4897. /** RSSI value of last ack packet (units = dB above noise floor) */
  4898. A_UINT32 ack_rssi;
  4899. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4900. /** tx_xx_mcs: currently unused */
  4901. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4902. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4903. /* element 0,1, ...7 -> NSS 1,2, ...8 */
  4904. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4905. /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  4906. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4907. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4908. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  4909. /**
  4910. * Counters to track number of tx packets in each GI
  4911. * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
  4912. */
  4913. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4914. /** Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  4915. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  4916. /** Number of CTS-acknowledged RTS packets */
  4917. A_UINT32 rts_success;
  4918. /**
  4919. * Counters for legacy 11a and 11b transmissions.
  4920. *
  4921. * The index corresponds to:
  4922. *
  4923. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  4924. *
  4925. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  4926. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  4927. */
  4928. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  4929. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4930. /** 11AC VHT DL MU MIMO LDPC count */
  4931. A_UINT32 ac_mu_mimo_tx_ldpc;
  4932. /** 11AX HE DL MU MIMO LDPC count */
  4933. A_UINT32 ax_mu_mimo_tx_ldpc;
  4934. /** 11AX HE DL MU OFDMA LDPC count */
  4935. A_UINT32 ofdma_tx_ldpc;
  4936. /**
  4937. * Counters for 11ax HE LTF selection during TX.
  4938. *
  4939. * The index corresponds to:
  4940. *
  4941. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  4942. */
  4943. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  4944. /** 11AC VHT DL MU MIMO TX MCS stats */
  4945. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4946. /** 11AX HE DL MU MIMO TX MCS stats */
  4947. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4948. /** 11AX HE DL MU OFDMA TX MCS stats */
  4949. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4950. /** 11AC VHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4951. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4952. /** 11AX HE DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4953. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4954. /** 11AX HE DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  4955. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4956. /** 11AC VHT DL MU MIMO TX BW stats */
  4957. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4958. /** 11AX HE DL MU MIMO TX BW stats */
  4959. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4960. /** 11AX HE DL MU OFDMA TX BW stats */
  4961. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4962. /** 11AC VHT DL MU MIMO TX guard interval stats */
  4963. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4964. /** 11AX HE DL MU MIMO TX guard interval stats */
  4965. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4966. /** 11AX HE DL MU OFDMA TX guard interval stats */
  4967. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4968. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  4969. A_UINT32 tx_11ax_su_ext;
  4970. /* Stats for MCS 12/13 */
  4971. A_UINT32 tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4972. A_UINT32 tx_stbc_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4973. A_UINT32 tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4974. /** 11AX VHT DL MU MIMO extended TX MCS stats for MCS 12/13 */
  4975. A_UINT32 ax_mu_mimo_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4976. /** 11AX VHT DL MU OFDMA extended TX MCS stats for MCS 12/13 */
  4977. A_UINT32 ofdma_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4978. /** 11AX VHT DL MU MIMO extended TX guard interval stats for MCS 12/13 */
  4979. A_UINT32 ax_mu_mimo_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4980. /** 11AX VHT DL MU OFDMA extended TX guard interval stats for MCS 12/13 */
  4981. A_UINT32 ofdma_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4982. /* Stats for MCS 14/15 */
  4983. A_UINT32 tx_mcs_ext_2[HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4984. A_UINT32 tx_bw_320mhz;
  4985. A_UINT32 tx_gi_ext_2[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4986. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  4987. A_UINT32 reduced_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4988. /** 11AC VHT DL MU MIMO TX BW stats at reduced channel config */
  4989. A_UINT32 reduced_ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4990. /** 11AX HE DL MU MIMO TX BW stats at reduced channel config */
  4991. A_UINT32 reduced_ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4992. /** 11AX HE DL MU OFDMA TX BW stats at reduced channel config */
  4993. A_UINT32 reduced_ax_mu_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4994. /** 11AX HE DL MU OFDMA TX RU Size stats */
  4995. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  4996. /** 11AX HE DL MU OFDMA HE-SIG-B MCS stats */
  4997. A_UINT32 ofdma_he_sig_b_mcs[HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS];
  4998. /** 11AX HE SU data + embedded trigger PPDU success stats (stats for HETP ack success PPDU cnt) */
  4999. A_UINT32 ax_su_embedded_trigger_data_ppdu;
  5000. /** 11AX HE SU data + embedded trigger PPDU failure stats (stats for HETP ack failure PPDU cnt) */
  5001. A_UINT32 ax_su_embedded_trigger_data_ppdu_err;
  5002. /** sta side trigger stats */
  5003. A_UINT32 trigger_type_11be[HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES];
  5004. /** Stats for Extra EHT LTF */
  5005. A_UINT32 extra_eht_ltf;
  5006. /** Counter for Extra EHT LTFs in OFDMA sequences */
  5007. A_UINT32 extra_eht_ltf_ofdma;
  5008. } htt_stats_tx_pdev_rate_stats_tlv;
  5009. /* preserve old name alias for new name consistent with the tag name */
  5010. typedef htt_stats_tx_pdev_rate_stats_tlv htt_tx_pdev_rate_stats_tlv;
  5011. typedef struct {
  5012. /* 11be mode pdev rate stats; placed in a separate TLV to adhere to size restrictions */
  5013. htt_tlv_hdr_t tlv_hdr;
  5014. /** 11BE EHT DL MU MIMO TX MCS stats */
  5015. A_UINT32 be_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5016. /** 11BE EHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  5017. A_UINT32 be_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5018. /** 11BE EHT DL MU MIMO TX BW stats */
  5019. A_UINT32 be_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5020. /** 11BE EHT DL MU MIMO TX guard interval stats */
  5021. A_UINT32 be_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5022. /** 11BE DL MU MIMO LDPC count */
  5023. A_UINT32 be_mu_mimo_tx_ldpc;
  5024. } htt_stats_tx_pdev_be_rate_stats_tlv;
  5025. /* preserve old name alias for new name consistent with the tag name */
  5026. typedef htt_stats_tx_pdev_be_rate_stats_tlv htt_tx_pdev_rate_stats_be_tlv;
  5027. typedef struct {
  5028. /*
  5029. * SAWF pdev rate stats;
  5030. * placed in a separate TLV to adhere to size restrictions
  5031. */
  5032. htt_tlv_hdr_t tlv_hdr;
  5033. /**
  5034. * Counter incremented when MCS is dropped due to the successive retries
  5035. * to a peer reaching the configured limit.
  5036. */
  5037. A_UINT32 rate_retry_mcs_drop_cnt;
  5038. /**
  5039. * histogram of MCS rate drop down, indexed by pre-drop MCS
  5040. */
  5041. A_UINT32 mcs_drop_rate[HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS];
  5042. /**
  5043. * PPDU PER histogram - each PPDU has its PER computed,
  5044. * and the bin corresponding to that PER percentage is incremented.
  5045. */
  5046. A_UINT32 per_histogram_cnt[HTT_TX_PDEV_STATS_NUM_PER_COUNTERS];
  5047. /**
  5048. * When the service class contains delay bound rate parameters which
  5049. * indicate low latency and we enable latency-based RA params then
  5050. * the low_latency_rate_count will be incremented.
  5051. * This counts the number of peer-TIDs that have been categorized as
  5052. * low-latency.
  5053. */
  5054. A_UINT32 low_latency_rate_cnt;
  5055. /** Indicate how many times rate drop happened within SIFS burst */
  5056. A_UINT32 su_burst_rate_drop_cnt;
  5057. /** Indicates how many within SIFS burst failed to deliver any pkt */
  5058. A_UINT32 su_burst_rate_drop_fail_cnt;
  5059. } htt_stats_tx_pdev_sawf_rate_stats_tlv;
  5060. /* preserve old name alias for new name consistent with the tag name */
  5061. typedef htt_stats_tx_pdev_sawf_rate_stats_tlv htt_tx_pdev_rate_stats_sawf_tlv;
  5062. typedef struct {
  5063. htt_tlv_hdr_t tlv_hdr;
  5064. /**
  5065. * BIT [ 7 : 0] :- mac_id
  5066. * BIT [31 : 8] :- reserved
  5067. */
  5068. A_UINT32 mac_id__word;
  5069. /** 11BE EHT DL MU OFDMA LDPC count */
  5070. A_UINT32 be_ofdma_tx_ldpc;
  5071. /** 11BE EHT DL MU OFDMA TX MCS stats */
  5072. A_UINT32 be_ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5073. /**
  5074. * 11BE EHT DL MU OFDMA TX NSS stats (Indicates NSS for individual users)
  5075. */
  5076. A_UINT32 be_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5077. /** 11BE EHT DL MU OFDMA TX BW stats */
  5078. A_UINT32 be_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5079. /** 11BE EHT DL MU OFDMA TX guard interval stats */
  5080. A_UINT32 be_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5081. /** 11BE EHT DL MU OFDMA TX RU Size stats */
  5082. A_UINT32 be_ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5083. /** 11BE EHT DL MU OFDMA EHT-SIG MCS stats */
  5084. A_UINT32 be_ofdma_eht_sig_mcs[HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS];
  5085. } htt_stats_tx_pdev_rate_stats_be_ofdma_tlv;
  5086. /* preserve old name alias for new name consistent with the tag name */
  5087. typedef htt_stats_tx_pdev_rate_stats_be_ofdma_tlv
  5088. htt_tx_pdev_rate_stats_be_ofdma_tlv;
  5089. typedef struct {
  5090. htt_tlv_hdr_t tlv_hdr;
  5091. /** tx_ppdu_dur_hist:
  5092. * Tx PPDU duration histogram, which holds the tx duration of PPDUs
  5093. * under histogram bins of interval 250us
  5094. */
  5095. A_UINT32 tx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5096. A_UINT32 tx_success_time_us_low;
  5097. A_UINT32 tx_success_time_us_high;
  5098. A_UINT32 tx_fail_time_us_low;
  5099. A_UINT32 tx_fail_time_us_high;
  5100. A_UINT32 pdev_up_time_us_low;
  5101. A_UINT32 pdev_up_time_us_high;
  5102. /** tx_ofdma_ppdu_dur_hist:
  5103. * Tx OFDMA PPDU duration histogram, which holds the tx duration of
  5104. * OFDMA PPDUs under histogram bins of interval 250us
  5105. */
  5106. A_UINT32 tx_ofdma_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5107. } htt_stats_tx_pdev_ppdu_dur_tlv;
  5108. /* preserve old name alias for new name consistent with the tag name */
  5109. typedef htt_stats_tx_pdev_ppdu_dur_tlv htt_tx_pdev_ppdu_dur_stats_tlv;
  5110. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  5111. * TLV_TAGS:
  5112. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  5113. */
  5114. /* NOTE:
  5115. * This structure is for documentation, and cannot be safely used directly.
  5116. * Instead, use the constituent TLV structures to fill/parse.
  5117. */
  5118. #ifdef ATH_TARGET
  5119. typedef struct {
  5120. htt_stats_tx_pdev_rate_stats_tlv rate_tlv;
  5121. htt_stats_tx_pdev_be_rate_stats_tlv rate_be_tlv;
  5122. htt_stats_tx_pdev_sawf_rate_stats_tlv rate_sawf_tlv;
  5123. htt_stats_tx_pdev_ppdu_dur_tlv tx_ppdu_dur_tlv;
  5124. } htt_tx_pdev_rate_stats_t;
  5125. #endif /* ATH_TARGET */
  5126. /* == PDEV RX RATE CTRL STATS == */
  5127. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  5128. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  5129. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  5130. #define HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  5131. #define HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  5132. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14 /* 0-13 */
  5133. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  5134. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  5135. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  5136. #define HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS \
  5137. (HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS + HTT_RX_PDEV_STATS_NUM_BW_COUNTERS)
  5138. #define HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS 5 /* 20, 40, 80, 160, 320Mhz */
  5139. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  5140. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  5141. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  5142. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  5143. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  5144. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  5145. #define HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0-13, -2, -1 */
  5146. #define HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  5147. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  5148. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  5149. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  5150. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  5151. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  5152. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  5153. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  5154. */
  5155. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  5156. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  5157. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  5158. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  5159. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  5160. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  5161. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  5162. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  5163. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  5164. */
  5165. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  5166. typedef enum {
  5167. HTT_RX_PDEV_STATS_BE_RU_SIZE_26,
  5168. HTT_RX_PDEV_STATS_BE_RU_SIZE_52,
  5169. HTT_RX_PDEV_STATS_BE_RU_SIZE_52_26,
  5170. HTT_RX_PDEV_STATS_BE_RU_SIZE_106,
  5171. HTT_RX_PDEV_STATS_BE_RU_SIZE_106_26,
  5172. HTT_RX_PDEV_STATS_BE_RU_SIZE_242,
  5173. HTT_RX_PDEV_STATS_BE_RU_SIZE_484,
  5174. HTT_RX_PDEV_STATS_BE_RU_SIZE_484_242,
  5175. HTT_RX_PDEV_STATS_BE_RU_SIZE_996,
  5176. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484,
  5177. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  5178. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2,
  5179. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  5180. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3,
  5181. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  5182. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x4,
  5183. HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  5184. } HTT_RX_PDEV_STATS_BE_RU_SIZE;
  5185. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  5186. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  5187. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  5188. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  5189. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  5190. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  5193. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  5194. } while (0)
  5195. /* Introduce new RX counters to support 320MHZ support and punctured modes */
  5196. typedef enum {
  5197. HTT_RX_PDEV_STATS_PUNCTURED_NONE = 0,
  5198. HTT_RX_PDEV_STATS_PUNCTURED_20 = 1,
  5199. HTT_RX_PDEV_STATS_PUNCTURED_40 = 2,
  5200. HTT_RX_PDEV_STATS_PUNCTURED_80 = 3,
  5201. HTT_RX_PDEV_STATS_PUNCTURED_120 = 4,
  5202. HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  5203. } HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  5204. #define HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  5205. typedef struct {
  5206. htt_tlv_hdr_t tlv_hdr;
  5207. /**
  5208. * BIT [ 7 : 0] :- mac_id
  5209. * BIT [31 : 8] :- reserved
  5210. */
  5211. A_UINT32 mac_id__word;
  5212. A_UINT32 nsts;
  5213. /** Number of rx ldpc packets */
  5214. A_UINT32 rx_ldpc;
  5215. /** Number of rx rts packets */
  5216. A_UINT32 rts_cnt;
  5217. /** units = dB above noise floor */
  5218. A_UINT32 rssi_mgmt;
  5219. /** units = dB above noise floor */
  5220. A_UINT32 rssi_data;
  5221. /** units = dB above noise floor */
  5222. A_UINT32 rssi_comb;
  5223. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5224. /** element 0,1, ...7 -> NSS 1,2, ...8 */
  5225. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5226. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  5227. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5228. /** element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  5229. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5230. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  5231. /** units = dB above noise floor */
  5232. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5233. /** Counters to track number of rx packets in each GI in each mcs (0-11) */
  5234. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5235. /** rx Signal Strength value in dBm unit */
  5236. A_INT32 rssi_in_dbm;
  5237. A_UINT32 rx_11ax_su_ext;
  5238. A_UINT32 rx_11ac_mumimo;
  5239. A_UINT32 rx_11ax_mumimo;
  5240. A_UINT32 rx_11ax_ofdma;
  5241. A_UINT32 txbf;
  5242. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  5243. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  5244. A_UINT32 rx_active_dur_us_low;
  5245. A_UINT32 rx_active_dur_us_high;
  5246. /** number of times UL MU MIMO RX packets received */
  5247. A_UINT32 rx_11ax_ul_ofdma;
  5248. /** 11AX HE UL OFDMA RX TB PPDU MCS stats */
  5249. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5250. /** 11AX HE UL OFDMA RX TB PPDU GI stats */
  5251. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5252. /**
  5253. * 11AX HE UL OFDMA RX TB PPDU NSS stats
  5254. * (Increments the individual user NSS in the OFDMA PPDU received)
  5255. */
  5256. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5257. /** 11AX HE UL OFDMA RX TB PPDU BW stats */
  5258. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5259. /** Number of times UL OFDMA TB PPDUs received with stbc */
  5260. A_UINT32 ul_ofdma_rx_stbc;
  5261. /** Number of times UL OFDMA TB PPDUs received with ldpc */
  5262. A_UINT32 ul_ofdma_rx_ldpc;
  5263. /**
  5264. * Number of non data PPDUs received for each degree (number of users)
  5265. * in UL OFDMA
  5266. */
  5267. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5268. /**
  5269. * Number of data ppdus received for each degree (number of users)
  5270. * in UL OFDMA
  5271. */
  5272. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5273. /**
  5274. * Number of mpdus passed for each degree (number of users)
  5275. * in UL OFDMA TB PPDU
  5276. */
  5277. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5278. /**
  5279. * Number of mpdus failed for each degree (number of users)
  5280. * in UL OFDMA TB PPDU
  5281. */
  5282. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5283. A_UINT32 nss_count;
  5284. A_UINT32 pilot_count;
  5285. /** RxEVM stats in dB */
  5286. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  5287. /**
  5288. * EVM mean across pilots, computed as
  5289. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  5290. */
  5291. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5292. /** dBm units */
  5293. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5294. /** per_chain_rssi_pkt_type:
  5295. * This field shows what type of rx frame the per-chain RSSI was computed
  5296. * on, by recording the frame type and sub-type as bit-fields within this
  5297. * field:
  5298. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  5299. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  5300. * BIT [31 : 8] :- Reserved
  5301. */
  5302. A_UINT32 per_chain_rssi_pkt_type;
  5303. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5304. A_UINT32 rx_su_ndpa;
  5305. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5306. A_UINT32 rx_mu_ndpa;
  5307. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5308. A_UINT32 rx_br_poll;
  5309. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5310. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  5311. /**
  5312. * Number of non data ppdus received for each degree (number of users)
  5313. * with UL MUMIMO
  5314. */
  5315. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5316. /**
  5317. * Number of data ppdus received for each degree (number of users)
  5318. * with UL MUMIMO
  5319. */
  5320. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5321. /**
  5322. * Number of mpdus passed for each degree (number of users)
  5323. * with UL MUMIMO TB PPDU
  5324. */
  5325. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5326. /**
  5327. * Number of mpdus failed for each degree (number of users)
  5328. * with UL MUMIMO TB PPDU
  5329. */
  5330. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5331. /**
  5332. * Number of non data ppdus received for each degree (number of users)
  5333. * in UL OFDMA
  5334. */
  5335. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5336. /**
  5337. * Number of data ppdus received for each degree (number of users)
  5338. *in UL OFDMA
  5339. */
  5340. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5341. /* Stats for MCS 12/13 */
  5342. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5343. /*
  5344. * NOTE - this TLV is already large enough that it causes the HTT message
  5345. * carrying it to be nearly at the message size limit that applies to
  5346. * many targets/hosts.
  5347. * No further fields should be added to this TLV without very careful
  5348. * review to ensure the size increase is acceptable.
  5349. */
  5350. } htt_stats_rx_pdev_rate_stats_tlv;
  5351. /* preserve old name alias for new name consistent with the tag name */
  5352. typedef htt_stats_rx_pdev_rate_stats_tlv htt_rx_pdev_rate_stats_tlv;
  5353. typedef struct {
  5354. htt_tlv_hdr_t tlv_hdr;
  5355. /** Tx PPDU duration histogram **/
  5356. A_UINT32 rx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5357. } htt_stats_rx_pdev_ppdu_dur_tlv;
  5358. /* preserve old name alias for new name consistent with the tag name */
  5359. typedef htt_stats_rx_pdev_ppdu_dur_tlv htt_rx_pdev_ppdu_dur_stats_tlv;
  5360. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  5361. * TLV_TAGS:
  5362. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  5363. */
  5364. /* NOTE:
  5365. * This structure is for documentation, and cannot be safely used directly.
  5366. * Instead, use the constituent TLV structures to fill/parse.
  5367. */
  5368. #ifdef ATH_TARGET
  5369. typedef struct {
  5370. htt_stats_rx_pdev_rate_stats_tlv rate_tlv;
  5371. htt_stats_rx_pdev_ppdu_dur_tlv rx_ppdu_dur_tlv;
  5372. } htt_rx_pdev_rate_stats_t;
  5373. #endif /* ATH_TARGET */
  5374. typedef struct {
  5375. htt_tlv_hdr_t tlv_hdr;
  5376. /** units = dB above noise floor */
  5377. A_UINT8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  5378. A_INT8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  5379. /** rx mcast signal strength value in dBm unit */
  5380. A_INT32 rssi_mcast_in_dbm;
  5381. /** rx mgmt packet signal Strength value in dBm unit */
  5382. A_INT32 rssi_mgmt_in_dbm;
  5383. /*
  5384. * Stats for MCS 0-13 since rx_pdev_rate_stats_tlv cannot be updated,
  5385. * due to message size limitations.
  5386. */
  5387. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5388. A_UINT32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5389. A_UINT32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5390. A_UINT32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5391. A_UINT32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5392. A_UINT32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5393. A_UINT32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5394. A_UINT32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5395. /* MCS 14,15 */
  5396. A_UINT32 rx_mcs_ext_2[HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5397. A_UINT32 rx_bw_ext[HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS];
  5398. A_UINT32 rx_gi_ext_2[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5399. A_UINT32 rx_su_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5400. A_UINT32 reduced_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5401. A_UINT8 rssi_chain_ext_2[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_2_COUNTERS]; /* units = dB above noise floor */
  5402. A_INT8 rx_per_chain_rssi_ext_2_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_2_COUNTERS];
  5403. } htt_stats_rx_pdev_rate_ext_stats_tlv;
  5404. /* preserve old name alias for new name consistent with the tag name */
  5405. typedef htt_stats_rx_pdev_rate_ext_stats_tlv htt_rx_pdev_rate_ext_stats_tlv;
  5406. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  5407. * TLV_TAGS:
  5408. * - HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG
  5409. */
  5410. /* NOTE:
  5411. * This structure is for documentation, and cannot be safely used directly.
  5412. * Instead, use the constituent TLV structures to fill/parse.
  5413. */
  5414. #ifdef ATH_TARGET
  5415. typedef struct {
  5416. htt_stats_rx_pdev_rate_ext_stats_tlv rate_tlv;
  5417. } htt_rx_pdev_rate_ext_stats_t;
  5418. #endif /* ATH_TARGET */
  5419. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  5420. #define HTT_STATS_CMN_MAC_ID_S 0
  5421. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  5422. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  5423. HTT_STATS_CMN_MAC_ID_S)
  5424. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  5425. do { \
  5426. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  5427. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  5428. } while (0)
  5429. #define HTT_RX_UL_MAX_UPLINK_RSSI_TRACK 5
  5430. typedef struct {
  5431. htt_tlv_hdr_t tlv_hdr;
  5432. /**
  5433. * BIT [ 7 : 0] :- mac_id
  5434. * BIT [31 : 8] :- reserved
  5435. */
  5436. A_UINT32 mac_id__word;
  5437. A_UINT32 rx_11ax_ul_ofdma;
  5438. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5439. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5440. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5441. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5442. A_UINT32 ul_ofdma_rx_stbc;
  5443. A_UINT32 ul_ofdma_rx_ldpc;
  5444. /*
  5445. * These are arrays to hold the number of PPDUs that we received per RU.
  5446. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  5447. * array offset 0 and similarly RU52 will be incremented in array offset 1
  5448. */
  5449. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  5450. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  5451. /*
  5452. * These arrays hold Target RSSI (rx power the AP wants),
  5453. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  5454. * which can be identified by AIDs, during trigger based RX.
  5455. * Array acts a circular buffer and holds values for last 5 STAs
  5456. * in the same order as RX.
  5457. */
  5458. /**
  5459. * STA AID array for identifying which STA the
  5460. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  5461. */
  5462. A_UINT32 uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5463. /**
  5464. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  5465. */
  5466. A_INT32 uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5467. /**
  5468. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  5469. */
  5470. A_INT32 uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5471. /**
  5472. * Trig power headroom for STA AID in same idx - UNIT(dB)
  5473. */
  5474. A_UINT32 uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5475. A_UINT32 reduced_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5476. /*
  5477. * Number of HE UL OFDMA per-user responses containing only a QoS null in
  5478. * response to basic trigger. Typically a data response is expected.
  5479. */
  5480. A_UINT32 ul_ofdma_basic_trigger_rx_qos_null_only;
  5481. } htt_stats_rx_pdev_ul_trig_stats_tlv;
  5482. /* preserve old name alias for new name consistent with the tag name */
  5483. typedef htt_stats_rx_pdev_ul_trig_stats_tlv htt_rx_pdev_ul_trigger_stats_tlv;
  5484. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  5485. * TLV_TAGS:
  5486. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  5487. * NOTE:
  5488. * This structure is for documentation, and cannot be safely used directly.
  5489. * Instead, use the constituent TLV structures to fill/parse.
  5490. */
  5491. #ifdef ATH_TARGET
  5492. typedef struct {
  5493. htt_stats_rx_pdev_ul_trig_stats_tlv ul_trigger_tlv;
  5494. } htt_rx_pdev_ul_trigger_stats_t;
  5495. #endif /* ATH_TARGET */
  5496. typedef struct {
  5497. htt_tlv_hdr_t tlv_hdr;
  5498. /**
  5499. * BIT [ 7 : 0] :- mac_id
  5500. * BIT [31 : 8] :- reserved
  5501. */
  5502. A_UINT32 mac_id__word;
  5503. A_UINT32 rx_11be_ul_ofdma;
  5504. A_UINT32 be_ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5505. A_UINT32 be_ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5506. A_UINT32 be_ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5507. A_UINT32 be_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5508. A_UINT32 be_ul_ofdma_rx_stbc;
  5509. A_UINT32 be_ul_ofdma_rx_ldpc;
  5510. /*
  5511. * These are arrays to hold the number of PPDUs that we received per RU.
  5512. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  5513. * array offset 0 and similarly RU52 will be incremented in array offset 1
  5514. */
  5515. /** PPDU level */
  5516. A_UINT32 be_rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5517. /** PPDU level */
  5518. A_UINT32 be_rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5519. /*
  5520. * These arrays hold Target RSSI (rx power the AP wants),
  5521. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  5522. * which can be identified by AIDs, during trigger based RX.
  5523. * Array acts a circular buffer and holds values for last 5 STAs
  5524. * in the same order as RX.
  5525. */
  5526. /**
  5527. * STA AID array for identifying which STA the
  5528. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  5529. */
  5530. A_UINT32 be_uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5531. /**
  5532. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  5533. */
  5534. A_INT32 be_uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5535. /**
  5536. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  5537. */
  5538. A_INT32 be_uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5539. /**
  5540. * Trig power headroom for STA AID in same idx - UNIT(dB)
  5541. */
  5542. A_UINT32 be_uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5543. /*
  5544. * Number of EHT UL OFDMA per-user responses containing only a QoS null in
  5545. * response to basic trigger. Typically a data response is expected.
  5546. */
  5547. A_UINT32 be_ul_ofdma_basic_trigger_rx_qos_null_only;
  5548. /* UL MLO Queue Depth Sharing Stats */
  5549. A_UINT32 ul_mlo_send_qdepth_params_count;
  5550. A_UINT32 ul_mlo_proc_qdepth_params_count;
  5551. A_UINT32 ul_mlo_proc_accepted_qdepth_params_count;
  5552. A_UINT32 ul_mlo_proc_discarded_qdepth_params_count;
  5553. } htt_stats_rx_pdev_be_ul_trig_stats_tlv;
  5554. /* preserve old name alias for new name consistent with the tag name */
  5555. typedef htt_stats_rx_pdev_be_ul_trig_stats_tlv
  5556. htt_rx_pdev_be_ul_trigger_stats_tlv;
  5557. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  5558. * TLV_TAGS:
  5559. * - HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG
  5560. * NOTE:
  5561. * This structure is for documentation, and cannot be safely used directly.
  5562. * Instead, use the constituent TLV structures to fill/parse.
  5563. */
  5564. #ifdef ATH_TARGET
  5565. typedef struct {
  5566. htt_stats_rx_pdev_be_ul_trig_stats_tlv ul_trigger_tlv;
  5567. } htt_rx_pdev_be_ul_trigger_stats_t;
  5568. #endif /* ATH_TARGET */
  5569. typedef struct {
  5570. htt_tlv_hdr_t tlv_hdr;
  5571. A_UINT32 user_index;
  5572. /** PPDU level */
  5573. A_UINT32 rx_ulofdma_non_data_ppdu;
  5574. /** PPDU level */
  5575. A_UINT32 rx_ulofdma_data_ppdu;
  5576. /** MPDU level */
  5577. A_UINT32 rx_ulofdma_mpdu_ok;
  5578. /** MPDU level */
  5579. A_UINT32 rx_ulofdma_mpdu_fail;
  5580. A_UINT32 rx_ulofdma_non_data_nusers;
  5581. A_UINT32 rx_ulofdma_data_nusers;
  5582. } htt_stats_rx_pdev_ul_ofdma_user_stats_tlv;
  5583. /* preserve old name alias for new name consistent with the tag name */
  5584. typedef htt_stats_rx_pdev_ul_ofdma_user_stats_tlv
  5585. htt_rx_pdev_ul_ofdma_user_stats_tlv;
  5586. typedef struct {
  5587. htt_tlv_hdr_t tlv_hdr;
  5588. A_UINT32 user_index;
  5589. /** PPDU level */
  5590. A_UINT32 be_rx_ulofdma_non_data_ppdu;
  5591. /** PPDU level */
  5592. A_UINT32 be_rx_ulofdma_data_ppdu;
  5593. /** MPDU level */
  5594. A_UINT32 be_rx_ulofdma_mpdu_ok;
  5595. /** MPDU level */
  5596. A_UINT32 be_rx_ulofdma_mpdu_fail;
  5597. A_UINT32 be_rx_ulofdma_non_data_nusers;
  5598. A_UINT32 be_rx_ulofdma_data_nusers;
  5599. } htt_stats_rx_pdev_be_ul_ofdma_user_stats_tlv;
  5600. /* preserve old name alias for new name consistent with the tag name */
  5601. typedef htt_stats_rx_pdev_be_ul_ofdma_user_stats_tlv
  5602. htt_rx_pdev_be_ul_ofdma_user_stats_tlv;
  5603. typedef struct {
  5604. htt_tlv_hdr_t tlv_hdr;
  5605. A_UINT32 user_index;
  5606. /** PPDU level */
  5607. A_UINT32 rx_ulmumimo_non_data_ppdu;
  5608. /** PPDU level */
  5609. A_UINT32 rx_ulmumimo_data_ppdu;
  5610. /** MPDU level */
  5611. A_UINT32 rx_ulmumimo_mpdu_ok;
  5612. /** MPDU level */
  5613. A_UINT32 rx_ulmumimo_mpdu_fail;
  5614. } htt_stats_rx_pdev_ul_mimo_user_stats_tlv;
  5615. /* preserve old name alias for new name consistent with the tag name */
  5616. typedef htt_stats_rx_pdev_ul_mimo_user_stats_tlv
  5617. htt_rx_pdev_ul_mimo_user_stats_tlv;
  5618. typedef struct {
  5619. htt_tlv_hdr_t tlv_hdr;
  5620. A_UINT32 user_index;
  5621. /** PPDU level */
  5622. A_UINT32 be_rx_ulmumimo_non_data_ppdu;
  5623. /** PPDU level */
  5624. A_UINT32 be_rx_ulmumimo_data_ppdu;
  5625. /** MPDU level */
  5626. A_UINT32 be_rx_ulmumimo_mpdu_ok;
  5627. /** MPDU level */
  5628. A_UINT32 be_rx_ulmumimo_mpdu_fail;
  5629. } htt_stats_rx_pdev_be_ul_mimo_user_stats_tlv;
  5630. /* preserve old name alias for new name consistent with the tag name */
  5631. typedef htt_stats_rx_pdev_be_ul_mimo_user_stats_tlv
  5632. htt_rx_pdev_be_ul_mimo_user_stats_tlv;
  5633. /* == RX PDEV/SOC STATS == */
  5634. typedef struct {
  5635. htt_tlv_hdr_t tlv_hdr;
  5636. /**
  5637. * BIT [7:0] :- mac_id
  5638. * BIT [31:8] :- reserved
  5639. *
  5640. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  5641. */
  5642. A_UINT32 mac_id__word;
  5643. /** Number of times UL MUMIMO RX packets received */
  5644. A_UINT32 rx_11ax_ul_mumimo;
  5645. /** 11AX HE UL MU-MIMO RX TB PPDU MCS stats */
  5646. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5647. /**
  5648. * 11AX HE UL MU-MIMO RX GI & LTF stats.
  5649. * Index 0 indicates 1xLTF + 1.6 msec GI
  5650. * Index 1 indicates 2xLTF + 1.6 msec GI
  5651. * Index 2 indicates 4xLTF + 3.2 msec GI
  5652. */
  5653. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5654. /**
  5655. * 11AX HE UL MU-MIMO RX TB PPDU NSS stats
  5656. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  5657. */
  5658. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5659. /** 11AX HE UL MU-MIMO RX TB PPDU BW stats */
  5660. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5661. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  5662. A_UINT32 ul_mumimo_rx_stbc;
  5663. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  5664. A_UINT32 ul_mumimo_rx_ldpc;
  5665. /* Stats for MCS 12/13 */
  5666. A_UINT32 ul_mumimo_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5667. A_UINT32 ul_mumimo_rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5668. /** RSSI in dBm for Rx TB PPDUs */
  5669. A_INT8 rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS];
  5670. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  5671. A_INT8 rx_ul_mumimo_target_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5672. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  5673. A_INT8 rx_ul_mumimo_fd_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5674. /** Average pilot EVM measued for RX UL TB PPDU */
  5675. 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];
  5676. A_UINT32 reduced_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5677. /*
  5678. * Number of HE UL MU-MIMO per-user responses containing only a QoS null in
  5679. * response to basic trigger. Typically a data response is expected.
  5680. */
  5681. A_UINT32 ul_mumimo_basic_trigger_rx_qos_null_only;
  5682. } htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv;
  5683. /* preserve old name alias for new name consistent with the tag name */
  5684. typedef htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv
  5685. htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  5686. typedef struct {
  5687. htt_tlv_hdr_t tlv_hdr;
  5688. /**
  5689. * BIT [7:0] :- mac_id
  5690. * BIT [31:8] :- reserved
  5691. *
  5692. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  5693. */
  5694. A_UINT32 mac_id__word;
  5695. /** Number of times UL MUMIMO RX packets received */
  5696. A_UINT32 rx_11be_ul_mumimo;
  5697. /** 11BE EHT UL MU-MIMO RX TB PPDU MCS stats */
  5698. A_UINT32 be_ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5699. /**
  5700. * 11BE EHT UL MU-MIMO RX GI & LTF stats.
  5701. * Index 0 indicates 1xLTF + 1.6 msec GI
  5702. * Index 1 indicates 2xLTF + 1.6 msec GI
  5703. * Index 2 indicates 4xLTF + 3.2 msec GI
  5704. */
  5705. A_UINT32 be_ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5706. /**
  5707. * 11BE EHT UL MU-MIMO RX TB PPDU NSS stats
  5708. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  5709. */
  5710. A_UINT32 be_ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5711. /** 11BE EHT UL MU-MIMO RX TB PPDU BW stats */
  5712. A_UINT32 be_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5713. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  5714. A_UINT32 be_ul_mumimo_rx_stbc;
  5715. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  5716. A_UINT32 be_ul_mumimo_rx_ldpc;
  5717. /** RSSI in dBm for Rx TB PPDUs */
  5718. A_INT8 be_rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5719. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  5720. A_INT8 be_rx_ul_mumimo_target_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5721. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  5722. A_INT8 be_rx_ul_mumimo_fd_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5723. /** Average pilot EVM measued for RX UL TB PPDU */
  5724. A_INT8 be_rx_ulmumimo_pilot_evm_dB_mean[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5725. /** Number of times UL MUMIMO TB PPDUs received in a punctured mode */
  5726. A_UINT32 rx_ul_mumimo_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5727. /*
  5728. * Number of EHT UL MU-MIMO per-user responses containing only a QoS null
  5729. * in response to basic trigger. Typically a data response is expected.
  5730. */
  5731. A_UINT32 be_ul_mumimo_basic_trigger_rx_qos_null_only;
  5732. } htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  5733. /* preserve old name alias for new name consistent with the tag name */
  5734. typedef htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv
  5735. htt_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  5736. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  5737. * TLV_TAGS:
  5738. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  5739. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG
  5740. */
  5741. #ifdef ATH_TARGET
  5742. typedef struct {
  5743. htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  5744. htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv ul_mumimo_trig_be_tlv;
  5745. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  5746. #endif /* ATH_TARGET */
  5747. typedef struct {
  5748. htt_tlv_hdr_t tlv_hdr;
  5749. /** Num Packets received on REO FW ring */
  5750. A_UINT32 fw_reo_ring_data_msdu;
  5751. /** Num bc/mc packets indicated from fw to host */
  5752. A_UINT32 fw_to_host_data_msdu_bcmc;
  5753. /** Num unicast packets indicated from fw to host */
  5754. A_UINT32 fw_to_host_data_msdu_uc;
  5755. /** Num remote buf recycle from offload */
  5756. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  5757. /** Num remote free buf given to offload */
  5758. A_UINT32 ofld_remote_free_buf_indication_cnt;
  5759. /** Num unicast packets from local path indicated to host */
  5760. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  5761. /** Num unicast packets from REO indicated to host */
  5762. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  5763. /** Num Packets received from WBM SW1 ring */
  5764. A_UINT32 wbm_sw_ring_reap;
  5765. /** Num packets from WBM forwarded from fw to host via WBM */
  5766. A_UINT32 wbm_forward_to_host_cnt;
  5767. /** Num packets from WBM recycled to target refill ring */
  5768. A_UINT32 wbm_target_recycle_cnt;
  5769. /**
  5770. * Total Num of recycled to refill ring,
  5771. * including packets from WBM and REO
  5772. */
  5773. A_UINT32 target_refill_ring_recycle_cnt;
  5774. } htt_stats_rx_soc_fw_stats_tlv;
  5775. /* preserve old name alias for new name consistent with the tag name */
  5776. typedef htt_stats_rx_soc_fw_stats_tlv htt_rx_soc_fw_stats_tlv;
  5777. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5778. /* NOTE: Variable length TLV, use length spec to infer array size */
  5779. typedef struct {
  5780. htt_tlv_hdr_t tlv_hdr;
  5781. /** refill_ring_empty_cnt:
  5782. * Num ring empty encountered,
  5783. * HTT_RX_STATS_REFILL_MAX_RING
  5784. */
  5785. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, refill_ring_empty_cnt);
  5786. } htt_stats_rx_soc_fw_refill_ring_empty_tlv;
  5787. /* preserve old name alias for new name consistent with the tag name */
  5788. typedef htt_stats_rx_soc_fw_refill_ring_empty_tlv
  5789. htt_rx_soc_fw_refill_ring_empty_tlv_v;
  5790. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5791. /* NOTE: Variable length TLV, use length spec to infer array size */
  5792. typedef struct {
  5793. htt_tlv_hdr_t tlv_hdr;
  5794. /** refill_ring_num_refill:
  5795. * Num total buf refilled from refill ring,
  5796. * HTT_RX_STATS_REFILL_MAX_RING
  5797. */
  5798. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, refill_ring_num_refill);
  5799. } htt_stats_rx_soc_fw_refill_ring_num_refill_tlv;
  5800. /* preserve old name alias for new name consistent with the tag name */
  5801. typedef htt_stats_rx_soc_fw_refill_ring_num_refill_tlv
  5802. htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  5803. /* RXDMA error code from WBM released packets */
  5804. typedef enum {
  5805. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  5806. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  5807. HTT_RX_RXDMA_FCS_ERR = 2,
  5808. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  5809. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  5810. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  5811. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  5812. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  5813. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  5814. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  5815. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  5816. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  5817. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  5818. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  5819. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  5820. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  5821. /*
  5822. * This MAX_ERR_CODE should not be used in any host/target messages,
  5823. * so that even though it is defined within a host/target interface
  5824. * definition header file, it isn't actually part of the host/target
  5825. * interface, and thus can be modified.
  5826. */
  5827. HTT_RX_RXDMA_MAX_ERR_CODE
  5828. } htt_rx_rxdma_error_code_enum;
  5829. /* NOTE: Variable length TLV, use length spec to infer array size */
  5830. typedef struct {
  5831. htt_tlv_hdr_t tlv_hdr;
  5832. /** NOTE:
  5833. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  5834. * It is expected but not required that the target will provide a rxdma_err element
  5835. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  5836. * MAX_ERR_CODE. The host should ignore any array elements whose
  5837. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5838. *
  5839. * HTT_RX_RXDMA_MAX_ERR_CODE
  5840. */
  5841. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, rxdma_err);
  5842. } htt_stats_rx_refill_rxdma_err_tlv;
  5843. /* preserve old name alias for new name consistent with the tag name */
  5844. typedef htt_stats_rx_refill_rxdma_err_tlv
  5845. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  5846. /* REO error code from WBM released packets */
  5847. typedef enum {
  5848. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  5849. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  5850. HTT_RX_AMPDU_IN_NON_BA = 2,
  5851. HTT_RX_NON_BA_DUPLICATE = 3,
  5852. HTT_RX_BA_DUPLICATE = 4,
  5853. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  5854. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  5855. HTT_RX_REGULAR_FRAME_OOR = 7,
  5856. HTT_RX_BAR_FRAME_OOR = 8,
  5857. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  5858. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  5859. HTT_RX_PN_CHECK_FAILED = 11,
  5860. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  5861. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  5862. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  5863. HTT_RX_REO_ERR_CODE_RVSD = 15,
  5864. /*
  5865. * This MAX_ERR_CODE should not be used in any host/target messages,
  5866. * so that even though it is defined within a host/target interface
  5867. * definition header file, it isn't actually part of the host/target
  5868. * interface, and thus can be modified.
  5869. */
  5870. HTT_RX_REO_MAX_ERR_CODE
  5871. } htt_rx_reo_error_code_enum;
  5872. /* NOTE: Variable length TLV, use length spec to infer array size */
  5873. typedef struct {
  5874. htt_tlv_hdr_t tlv_hdr;
  5875. /** NOTE:
  5876. * The mapping of REO error types to reo_err array elements is HW dependent.
  5877. * It is expected but not required that the target will provide a rxdma_err element
  5878. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  5879. * MAX_ERR_CODE. The host should ignore any array elements whose
  5880. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5881. *
  5882. * HTT_RX_REO_MAX_ERR_CODE
  5883. */
  5884. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, reo_err);
  5885. } htt_stats_rx_refill_reo_err_tlv;
  5886. /* preserve old name alias for new name consistent with the tag name */
  5887. typedef htt_stats_rx_refill_reo_err_tlv
  5888. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  5889. /* NOTE:
  5890. * This structure is for documentation, and cannot be safely used directly.
  5891. * Instead, use the constituent TLV structures to fill/parse.
  5892. */
  5893. #ifdef ATH_TARGET
  5894. typedef struct {
  5895. htt_stats_rx_soc_fw_stats_tlv fw_tlv;
  5896. htt_stats_rx_soc_fw_refill_ring_empty_tlv fw_refill_ring_empty_tlv;
  5897. htt_stats_rx_soc_fw_refill_ring_num_refill_tlv
  5898. fw_refill_ring_num_refill_tlv;
  5899. htt_stats_rx_refill_rxdma_err_tlv fw_refill_ring_num_rxdma_err_tlv;
  5900. htt_stats_rx_refill_reo_err_tlv fw_refill_ring_num_reo_err_tlv;
  5901. } htt_rx_soc_stats_t;
  5902. #endif /* ATH_TARGET */
  5903. /* == RX PDEV STATS == */
  5904. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  5905. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  5906. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  5907. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  5908. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  5909. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  5910. do { \
  5911. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  5912. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  5913. } while (0)
  5914. typedef struct {
  5915. htt_tlv_hdr_t tlv_hdr;
  5916. /**
  5917. * BIT [ 7 : 0] :- mac_id
  5918. * BIT [31 : 8] :- reserved
  5919. */
  5920. A_UINT32 mac_id__word;
  5921. /** Num PPDU status processed from HW */
  5922. A_UINT32 ppdu_recvd;
  5923. /** Num MPDU across PPDUs with FCS ok */
  5924. A_UINT32 mpdu_cnt_fcs_ok;
  5925. /** Num MPDU across PPDUs with FCS err */
  5926. A_UINT32 mpdu_cnt_fcs_err;
  5927. /** Num MSDU across PPDUs */
  5928. A_UINT32 tcp_msdu_cnt;
  5929. /** Num MSDU across PPDUs */
  5930. A_UINT32 tcp_ack_msdu_cnt;
  5931. /** Num MSDU across PPDUs */
  5932. A_UINT32 udp_msdu_cnt;
  5933. /** Num MSDU across PPDUs */
  5934. A_UINT32 other_msdu_cnt;
  5935. /** Num MPDU on FW ring indicated */
  5936. A_UINT32 fw_ring_mpdu_ind;
  5937. /** Num MGMT MPDU given to protocol */
  5938. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  5939. /** Num ctrl MPDU given to protocol */
  5940. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  5941. /** Num mcast data packet received */
  5942. A_UINT32 fw_ring_mcast_data_msdu;
  5943. /** Num broadcast data packet received */
  5944. A_UINT32 fw_ring_bcast_data_msdu;
  5945. /** Num unicast data packet received */
  5946. A_UINT32 fw_ring_ucast_data_msdu;
  5947. /** Num null data packet received */
  5948. A_UINT32 fw_ring_null_data_msdu;
  5949. /** Num MPDU on FW ring dropped */
  5950. A_UINT32 fw_ring_mpdu_drop;
  5951. /** Num buf indication to offload */
  5952. A_UINT32 ofld_local_data_ind_cnt;
  5953. /** Num buf recycle from offload */
  5954. A_UINT32 ofld_local_data_buf_recycle_cnt;
  5955. /** Num buf indication to data_rx */
  5956. A_UINT32 drx_local_data_ind_cnt;
  5957. /** Num buf recycle from data_rx */
  5958. A_UINT32 drx_local_data_buf_recycle_cnt;
  5959. /** Num buf indication to protocol */
  5960. A_UINT32 local_nondata_ind_cnt;
  5961. /** Num buf recycle from protocol */
  5962. A_UINT32 local_nondata_buf_recycle_cnt;
  5963. /** Num buf fed */
  5964. A_UINT32 fw_status_buf_ring_refill_cnt;
  5965. /** Num ring empty encountered */
  5966. A_UINT32 fw_status_buf_ring_empty_cnt;
  5967. /** Num buf fed */
  5968. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  5969. /** Num ring empty encountered */
  5970. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  5971. /** Num buf fed */
  5972. A_UINT32 fw_link_buf_ring_refill_cnt;
  5973. /** Num ring empty encountered */
  5974. A_UINT32 fw_link_buf_ring_empty_cnt;
  5975. /** Num buf fed */
  5976. A_UINT32 host_pkt_buf_ring_refill_cnt;
  5977. /** Num ring empty encountered */
  5978. A_UINT32 host_pkt_buf_ring_empty_cnt;
  5979. /** Num buf fed */
  5980. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  5981. /** Num ring empty encountered */
  5982. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  5983. /** Num buf fed */
  5984. A_UINT32 mon_status_buf_ring_refill_cnt;
  5985. /** Num ring empty encountered */
  5986. A_UINT32 mon_status_buf_ring_empty_cnt;
  5987. /** Num buf fed */
  5988. A_UINT32 mon_desc_buf_ring_refill_cnt;
  5989. /** Num ring empty encountered */
  5990. A_UINT32 mon_desc_buf_ring_empty_cnt;
  5991. /** Num buf fed */
  5992. A_UINT32 mon_dest_ring_update_cnt;
  5993. /** Num ring full encountered */
  5994. A_UINT32 mon_dest_ring_full_cnt;
  5995. /** Num rx suspend is attempted */
  5996. A_UINT32 rx_suspend_cnt;
  5997. /** Num rx suspend failed */
  5998. A_UINT32 rx_suspend_fail_cnt;
  5999. /** Num rx resume attempted */
  6000. A_UINT32 rx_resume_cnt;
  6001. /** Num rx resume failed */
  6002. A_UINT32 rx_resume_fail_cnt;
  6003. /** Num rx ring switch */
  6004. A_UINT32 rx_ring_switch_cnt;
  6005. /** Num rx ring restore */
  6006. A_UINT32 rx_ring_restore_cnt;
  6007. /** Num rx flush issued */
  6008. A_UINT32 rx_flush_cnt;
  6009. /** Num rx recovery */
  6010. A_UINT32 rx_recovery_reset_cnt;
  6011. } htt_stats_rx_pdev_fw_stats_tlv;
  6012. /* preserve old name alias for new name consistent with the tag name */
  6013. typedef htt_stats_rx_pdev_fw_stats_tlv htt_rx_pdev_fw_stats_tlv;
  6014. typedef struct {
  6015. htt_tlv_hdr_t tlv_hdr;
  6016. /** peer mac address */
  6017. htt_mac_addr peer_mac_addr;
  6018. /** Num of tx mgmt frames with subtype on peer level */
  6019. A_UINT32 peer_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  6020. /** Num of rx mgmt frames with subtype on peer level */
  6021. A_UINT32 peer_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  6022. } htt_stats_peer_ctrl_path_txrx_stats_tlv;
  6023. /* preserve old name alias for new name consistent with the tag name */
  6024. typedef htt_stats_peer_ctrl_path_txrx_stats_tlv
  6025. htt_peer_ctrl_path_txrx_stats_tlv;
  6026. #define HTT_STATS_PHY_ERR_MAX 43
  6027. typedef struct {
  6028. htt_tlv_hdr_t tlv_hdr;
  6029. /**
  6030. * BIT [ 7 : 0] :- mac_id
  6031. * BIT [31 : 8] :- reserved
  6032. */
  6033. A_UINT32 mac_id__word;
  6034. /** Num of phy err */
  6035. A_UINT32 total_phy_err_cnt;
  6036. /** Counts of different types of phy errs
  6037. * The mapping of PHY error types to phy_err array elements is HW dependent.
  6038. * The only currently-supported mapping is shown below:
  6039. *
  6040. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  6041. * 1 phyrx_err_synth_off
  6042. * 2 phyrx_err_ofdma_timing
  6043. * 3 phyrx_err_ofdma_signal_parity
  6044. * 4 phyrx_err_ofdma_rate_illegal
  6045. * 5 phyrx_err_ofdma_length_illegal
  6046. * 6 phyrx_err_ofdma_restart
  6047. * 7 phyrx_err_ofdma_service
  6048. * 8 phyrx_err_ppdu_ofdma_power_drop
  6049. * 9 phyrx_err_cck_blokker
  6050. * 10 phyrx_err_cck_timing
  6051. * 11 phyrx_err_cck_header_crc
  6052. * 12 phyrx_err_cck_rate_illegal
  6053. * 13 phyrx_err_cck_length_illegal
  6054. * 14 phyrx_err_cck_restart
  6055. * 15 phyrx_err_cck_service
  6056. * 16 phyrx_err_cck_power_drop
  6057. * 17 phyrx_err_ht_crc_err
  6058. * 18 phyrx_err_ht_length_illegal
  6059. * 19 phyrx_err_ht_rate_illegal
  6060. * 20 phyrx_err_ht_zlf
  6061. * 21 phyrx_err_false_radar_ext
  6062. * 22 phyrx_err_green_field
  6063. * 23 phyrx_err_bw_gt_dyn_bw
  6064. * 24 phyrx_err_leg_ht_mismatch
  6065. * 25 phyrx_err_vht_crc_error
  6066. * 26 phyrx_err_vht_siga_unsupported
  6067. * 27 phyrx_err_vht_lsig_len_invalid
  6068. * 28 phyrx_err_vht_ndp_or_zlf
  6069. * 29 phyrx_err_vht_nsym_lt_zero
  6070. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  6071. * 31 phyrx_err_vht_rx_skip_group_id0
  6072. * 32 phyrx_err_vht_rx_skip_group_id1to62
  6073. * 33 phyrx_err_vht_rx_skip_group_id63
  6074. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  6075. * 35 phyrx_err_defer_nap
  6076. * 36 phyrx_err_fdomain_timeout
  6077. * 37 phyrx_err_lsig_rel_check
  6078. * 38 phyrx_err_bt_collision
  6079. * 39 phyrx_err_unsupported_mu_feedback
  6080. * 40 phyrx_err_ppdu_tx_interrupt_rx
  6081. * 41 phyrx_err_unsupported_cbf
  6082. * 42 phyrx_err_other
  6083. */
  6084. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  6085. } htt_stats_rx_pdev_fw_stats_phy_err_tlv;
  6086. /* preserve old name alias for new name consistent with the tag name */
  6087. typedef htt_stats_rx_pdev_fw_stats_phy_err_tlv htt_rx_pdev_fw_stats_phy_err_tlv;
  6088. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  6089. /* NOTE: Variable length TLV, use length spec to infer array size */
  6090. typedef struct {
  6091. htt_tlv_hdr_t tlv_hdr;
  6092. /** fw_ring_mpdu_err:
  6093. * Num error MPDU for each RxDMA error type,
  6094. * HTT_RX_STATS_RXDMA_MAX_ERR
  6095. */
  6096. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw_ring_mpdu_err);
  6097. } htt_stats_rx_pdev_fw_ring_mpdu_err_tlv;
  6098. /* preserve old name alias for new name consistent with the tag name */
  6099. typedef htt_stats_rx_pdev_fw_ring_mpdu_err_tlv
  6100. htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  6101. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  6102. /* NOTE: Variable length TLV, use length spec to infer array size */
  6103. typedef struct {
  6104. htt_tlv_hdr_t tlv_hdr;
  6105. /** fw_mpdu_drop:
  6106. * Num MPDU dropped,
  6107. * HTT_RX_STATS_FW_DROP_REASON_MAX
  6108. */
  6109. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw_mpdu_drop);
  6110. } htt_stats_rx_pdev_fw_mpdu_drop_tlv;
  6111. /* preserve old name alias for new name consistent with the tag name */
  6112. typedef htt_stats_rx_pdev_fw_mpdu_drop_tlv htt_rx_pdev_fw_mpdu_drop_tlv_v;
  6113. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  6114. * TLV_TAGS:
  6115. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  6116. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  6117. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  6118. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  6119. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  6120. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  6121. */
  6122. /* NOTE:
  6123. * This structure is for documentation, and cannot be safely used directly.
  6124. * Instead, use the constituent TLV structures to fill/parse.
  6125. */
  6126. #ifdef ATH_TARGET
  6127. typedef struct {
  6128. htt_rx_soc_stats_t soc_stats;
  6129. htt_stats_rx_pdev_fw_stats_tlv fw_stats_tlv;
  6130. htt_stats_rx_pdev_fw_ring_mpdu_err_tlv fw_ring_mpdu_err_tlv;
  6131. htt_stats_rx_pdev_fw_mpdu_drop_tlv fw_ring_mpdu_drop;
  6132. htt_stats_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  6133. } htt_rx_pdev_stats_t;
  6134. #endif /* ATH_TARGET */
  6135. /* STATS_TYPE : HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  6136. * TLV_TAGS:
  6137. * - HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG
  6138. *
  6139. */
  6140. #ifdef ATH_TARGET
  6141. typedef struct {
  6142. htt_stats_peer_ctrl_path_txrx_stats_tlv peer_ctrl_path_txrx_stats_tlv;
  6143. } htt_ctrl_path_txrx_stats_t;
  6144. #endif /* ATH_TARGET */
  6145. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  6146. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  6147. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  6148. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  6149. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  6150. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  6151. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  6152. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  6153. typedef struct {
  6154. htt_tlv_hdr_t tlv_hdr;
  6155. /* Below values are obtained from the HW Cycles counter registers */
  6156. A_UINT32 tx_frame_usec;
  6157. A_UINT32 rx_frame_usec;
  6158. A_UINT32 rx_clear_usec;
  6159. A_UINT32 my_rx_frame_usec;
  6160. A_UINT32 usec_cnt;
  6161. A_UINT32 med_rx_idle_usec;
  6162. A_UINT32 med_tx_idle_global_usec;
  6163. A_UINT32 cca_obss_usec;
  6164. A_UINT32 pre_rx_frame_usec;
  6165. } htt_stats_pdev_cca_counters_tlv;
  6166. /* preserve old name alias for new name consistent with the tag name */
  6167. typedef htt_stats_pdev_cca_counters_tlv htt_pdev_stats_cca_counters_tlv;
  6168. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  6169. * due to lack of support in some host stats infrastructures for
  6170. * TLVs nested within TLVs.
  6171. */
  6172. typedef struct {
  6173. htt_tlv_hdr_t tlv_hdr;
  6174. /** The channel number on which these stats were collected */
  6175. A_UINT32 chan_num;
  6176. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  6177. A_UINT32 num_records;
  6178. /**
  6179. * Bit map of valid CCA counters
  6180. * Bit0 - tx_frame_usec
  6181. * Bit1 - rx_frame_usec
  6182. * Bit2 - rx_clear_usec
  6183. * Bit3 - my_rx_frame_usec
  6184. * bit4 - usec_cnt
  6185. * Bit5 - med_rx_idle_usec
  6186. * Bit6 - med_tx_idle_global_usec
  6187. * Bit7 - cca_obss_usec
  6188. *
  6189. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  6190. */
  6191. A_UINT32 valid_cca_counters_bitmap;
  6192. /** Indicates the stats collection interval
  6193. * Valid Values:
  6194. * 100 - For the 100ms interval CCA stats histogram
  6195. * 1000 - For 1sec interval CCA histogram
  6196. * 0xFFFFFFFF - For Cumulative CCA Stats
  6197. */
  6198. A_UINT32 collection_interval;
  6199. /**
  6200. * This will be followed by an array which contains the CCA stats
  6201. * collected in the last N intervals,
  6202. * if the indication is for last N intervals CCA stats.
  6203. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  6204. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  6205. */
  6206. HTT_STATS_VAR_LEN_ARRAY1(htt_stats_pdev_cca_counters_tlv, cca_hist_tlv);
  6207. } htt_pdev_cca_stats_hist_tlv;
  6208. typedef struct {
  6209. htt_tlv_hdr_t tlv_hdr;
  6210. /** The channel number on which these stats were collected */
  6211. A_UINT32 chan_num;
  6212. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  6213. A_UINT32 num_records;
  6214. /**
  6215. * Bit map of valid CCA counters
  6216. * Bit0 - tx_frame_usec
  6217. * Bit1 - rx_frame_usec
  6218. * Bit2 - rx_clear_usec
  6219. * Bit3 - my_rx_frame_usec
  6220. * bit4 - usec_cnt
  6221. * Bit5 - med_rx_idle_usec
  6222. * Bit6 - med_tx_idle_global_usec
  6223. * Bit7 - cca_obss_usec
  6224. *
  6225. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  6226. */
  6227. A_UINT32 valid_cca_counters_bitmap;
  6228. /** Indicates the stats collection interval
  6229. * Valid Values:
  6230. * 100 - For the 100ms interval CCA stats histogram
  6231. * 1000 - For 1sec interval CCA histogram
  6232. * 0xFFFFFFFF - For Cumulative CCA Stats
  6233. */
  6234. A_UINT32 collection_interval;
  6235. /**
  6236. * This will be followed by an array which contains the CCA stats
  6237. * collected in the last N intervals,
  6238. * if the indication is for last N intervals CCA stats.
  6239. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  6240. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  6241. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  6242. */
  6243. } htt_pdev_cca_stats_hist_v1_tlv;
  6244. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000000f
  6245. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  6246. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_M 0x0000fff0
  6247. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S 4
  6248. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  6249. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  6250. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  6251. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  6252. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  6253. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  6254. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  6255. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  6256. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  6257. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  6258. do { \
  6259. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  6260. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  6261. } while (0)
  6262. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_GET(_var) \
  6263. (((_var) & HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_M) >> \
  6264. HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S)
  6265. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_SET(_var, _val) \
  6266. do { \
  6267. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT, _val); \
  6268. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S)); \
  6269. } while (0)
  6270. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  6271. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  6272. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  6273. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  6274. do { \
  6275. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  6276. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  6277. } while (0)
  6278. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  6279. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  6280. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  6281. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  6282. do { \
  6283. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  6284. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  6285. } while (0)
  6286. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  6287. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  6288. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  6289. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  6290. do { \
  6291. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  6292. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  6293. } while (0)
  6294. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  6295. typedef struct {
  6296. htt_tlv_hdr_t tlv_hdr;
  6297. A_UINT32 vdev_id;
  6298. htt_mac_addr peer_mac;
  6299. A_UINT32 flow_id_flags;
  6300. /**
  6301. * TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is
  6302. * not initiated by host
  6303. */
  6304. A_UINT32 dialog_id;
  6305. A_UINT32 wake_dura_us;
  6306. A_UINT32 wake_intvl_us;
  6307. A_UINT32 sp_offset_us;
  6308. } htt_stats_pdev_twt_session_tlv;
  6309. /* preserve old name alias for new name consistent with the tag name */
  6310. typedef htt_stats_pdev_twt_session_tlv htt_pdev_stats_twt_session_tlv;
  6311. typedef struct {
  6312. htt_tlv_hdr_t tlv_hdr;
  6313. A_UINT32 pdev_id;
  6314. A_UINT32 num_sessions;
  6315. HTT_STATS_VAR_LEN_ARRAY1(htt_stats_pdev_twt_session_tlv, twt_session);
  6316. } htt_stats_pdev_twt_sessions_tlv;
  6317. /* preserve old name alias for new name consistent with the tag name */
  6318. typedef htt_stats_pdev_twt_sessions_tlv htt_pdev_stats_twt_sessions_tlv;
  6319. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  6320. * TLV_TAGS:
  6321. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  6322. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  6323. */
  6324. /* NOTE:
  6325. * This structure is for documentation, and cannot be safely used directly.
  6326. * Instead, use the constituent TLV structures to fill/parse.
  6327. */
  6328. #ifdef ATH_TARGET
  6329. typedef struct {
  6330. htt_stats_pdev_twt_session_tlv twt_sessions[1];
  6331. } htt_pdev_twt_sessions_stats_t;
  6332. #endif /* ATH_TARGET */
  6333. typedef enum {
  6334. /* Global link descriptor queued in REO */
  6335. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  6336. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  6337. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  6338. /*Number of queue descriptors of this aging group */
  6339. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  6340. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  6341. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  6342. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  6343. /* Total number of MSDUs buffered in AC */
  6344. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  6345. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  6346. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  6347. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  6348. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  6349. } htt_rx_reo_resource_sample_id_enum;
  6350. typedef struct {
  6351. htt_tlv_hdr_t tlv_hdr;
  6352. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  6353. /** htt_rx_reo_debug_sample_id_enum */
  6354. A_UINT32 sample_id;
  6355. /** Max value of all samples */
  6356. A_UINT32 total_max;
  6357. /** Average value of total samples */
  6358. A_UINT32 total_avg;
  6359. /** Num of samples including both zeros and non zeros ones*/
  6360. A_UINT32 total_sample;
  6361. /** Average value of all non zeros samples */
  6362. A_UINT32 non_zeros_avg;
  6363. /** Num of non zeros samples */
  6364. A_UINT32 non_zeros_sample;
  6365. /** Max value of last N non zero samples (N = last_non_zeros_sample) */
  6366. A_UINT32 last_non_zeros_max;
  6367. /** Min value of last N non zero samples (N = last_non_zeros_sample) */
  6368. A_UINT32 last_non_zeros_min;
  6369. /** Average value of last N non zero samples (N = last_non_zeros_sample) */
  6370. A_UINT32 last_non_zeros_avg;
  6371. /** Num of last non zero samples */
  6372. A_UINT32 last_non_zeros_sample;
  6373. } htt_stats_rx_reo_resource_stats_tlv;
  6374. /* preserve old name alias for new name consistent with the tag name */
  6375. typedef htt_stats_rx_reo_resource_stats_tlv htt_rx_reo_resource_stats_tlv_v;
  6376. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  6377. * TLV_TAGS:
  6378. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  6379. */
  6380. /* NOTE:
  6381. * This structure is for documentation, and cannot be safely used directly.
  6382. * Instead, use the constituent TLV structures to fill/parse.
  6383. */
  6384. #ifdef ATH_TARGET
  6385. typedef struct {
  6386. htt_stats_rx_reo_resource_stats_tlv reo_resource_stats;
  6387. } htt_soc_reo_resource_stats_t;
  6388. #endif /* ATH_TARGET */
  6389. /* == TX SOUNDING STATS == */
  6390. /* config_param0 */
  6391. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  6392. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  6393. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  6394. typedef enum {
  6395. /* Implicit beamforming stats */
  6396. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  6397. /* Single user short inter frame sequence steer stats */
  6398. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  6399. /* Single user random back off steer stats */
  6400. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  6401. /* Multi user short inter frame sequence steer stats */
  6402. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  6403. /* Multi user random back off steer stats */
  6404. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  6405. /* For backward compatibility new modes cannot be added */
  6406. HTT_TXBF_MAX_NUM_OF_MODES = 5
  6407. } htt_txbf_sound_steer_modes;
  6408. typedef enum {
  6409. HTT_TX_AC_SOUNDING_MODE = 0,
  6410. HTT_TX_AX_SOUNDING_MODE = 1,
  6411. HTT_TX_BE_SOUNDING_MODE = 2,
  6412. HTT_TX_CMN_SOUNDING_MODE = 3,
  6413. HTT_TX_CV_CORR_MODE = 4,
  6414. } htt_stats_sounding_tx_mode;
  6415. #define HTT_TX_CV_CORR_MAX_NUM_COLUMNS 8
  6416. typedef struct {
  6417. htt_tlv_hdr_t tlv_hdr;
  6418. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  6419. /* Counts number of soundings for all steering modes in each bw */
  6420. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  6421. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  6422. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  6423. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  6424. /**
  6425. * The sounding array is a 2-D array stored as an 1-D array of
  6426. * A_UINT32. The stats for a particular user/bw combination is
  6427. * referenced with the following:
  6428. *
  6429. * sounding[(user* max_bw) + bw]
  6430. *
  6431. * ... where max_bw == 4 for 160mhz
  6432. */
  6433. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  6434. /* cv upload handler stats */
  6435. /** total times CV nc mismatched */
  6436. A_UINT32 cv_nc_mismatch_err;
  6437. /** total times CV has FCS error */
  6438. A_UINT32 cv_fcs_err;
  6439. /** total times CV has invalid NSS index */
  6440. A_UINT32 cv_frag_idx_mismatch;
  6441. /** total times CV has invalid SW peer ID */
  6442. A_UINT32 cv_invalid_peer_id;
  6443. /** total times CV rejected because TXBF is not setup in peer */
  6444. A_UINT32 cv_no_txbf_setup;
  6445. /** total times CV expired while in updating state */
  6446. A_UINT32 cv_expiry_in_update;
  6447. /** total times Pkt b/w exceeding the cbf_bw */
  6448. A_UINT32 cv_pkt_bw_exceed;
  6449. /** total times CV DMA not completed */
  6450. A_UINT32 cv_dma_not_done_err;
  6451. /** total times CV update to peer failed */
  6452. A_UINT32 cv_update_failed;
  6453. /* cv query stats */
  6454. /** total times CV query happened */
  6455. A_UINT32 cv_total_query;
  6456. /** total pattern based CV query */
  6457. A_UINT32 cv_total_pattern_query;
  6458. /** total BW based CV query */
  6459. A_UINT32 cv_total_bw_query;
  6460. /** incorrect encoding in CV flags */
  6461. A_UINT32 cv_invalid_bw_coding;
  6462. /** forced sounding enabled for the peer */
  6463. A_UINT32 cv_forced_sounding;
  6464. /** standalone sounding sequence on-going */
  6465. A_UINT32 cv_standalone_sounding;
  6466. /** NC of available CV lower than expected */
  6467. A_UINT32 cv_nc_mismatch;
  6468. /** feedback type different from expected */
  6469. A_UINT32 cv_fb_type_mismatch;
  6470. /** CV BW not equal to expected BW for OFDMA */
  6471. A_UINT32 cv_ofdma_bw_mismatch;
  6472. /** CV BW not greater than or equal to expected BW */
  6473. A_UINT32 cv_bw_mismatch;
  6474. /** CV pattern not matching with the expected pattern */
  6475. A_UINT32 cv_pattern_mismatch;
  6476. /** CV available is of different preamble type than expected. */
  6477. A_UINT32 cv_preamble_mismatch;
  6478. /** NR of available CV is lower than expected. */
  6479. A_UINT32 cv_nr_mismatch;
  6480. /** CV in use count has exceeded threshold and cannot be used further. */
  6481. A_UINT32 cv_in_use_cnt_exceeded;
  6482. /** A valid CV has been found. */
  6483. A_UINT32 cv_found;
  6484. /** No valid CV was found. */
  6485. A_UINT32 cv_not_found;
  6486. /** Sounding per user in 320MHz bandwidth */
  6487. A_UINT32 sounding_320[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  6488. /** Counts number of soundings for all steering modes in 320MHz bandwidth */
  6489. A_UINT32 cbf_320[HTT_TXBF_MAX_NUM_OF_MODES];
  6490. /* This part can be used for new counters added for CV query/upload. */
  6491. /** non-trigger based ranging sequence on-going */
  6492. A_UINT32 cv_ntbr_sounding;
  6493. /** CV found, but upload is in progress. */
  6494. A_UINT32 cv_found_upload_in_progress;
  6495. /** Expired CV found during query. */
  6496. A_UINT32 cv_expired_during_query;
  6497. /** total times CV dma timeout happened */
  6498. A_UINT32 cv_dma_timeout_error;
  6499. /** total times CV bufs uploaded for IBF case */
  6500. A_UINT32 cv_buf_ibf_uploads;
  6501. /** total times CV bufs uploaded for EBF case */
  6502. A_UINT32 cv_buf_ebf_uploads;
  6503. /** total times CV bufs received from IPC ring */
  6504. A_UINT32 cv_buf_received;
  6505. /** total times CV bufs fed back to the IPC ring */
  6506. A_UINT32 cv_buf_fed_back;
  6507. /** Total times CV query happened for IBF case */
  6508. A_UINT32 cv_total_query_ibf;
  6509. /** A valid CV has been found for IBF case */
  6510. A_UINT32 cv_found_ibf;
  6511. /** A valid CV has not been found for IBF case */
  6512. A_UINT32 cv_not_found_ibf;
  6513. /** Expired CV found during query for IBF case */
  6514. A_UINT32 cv_expired_during_query_ibf;
  6515. /** Total number of times adaptive sounding logic has been queried */
  6516. A_UINT32 adaptive_snd_total_query;
  6517. /**
  6518. * Total number of times adaptive sounding mcs drop has been computed
  6519. * and recorded.
  6520. */
  6521. A_UINT32 adaptive_snd_total_mcs_drop[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  6522. /** Total number of times adaptive sounding logic kicked in */
  6523. A_UINT32 adaptive_snd_kicked_in;
  6524. /** Total number of times we switched back to normal sounding interval */
  6525. A_UINT32 adaptive_snd_back_to_default;
  6526. /**
  6527. * Below are CV correlation feature related stats.
  6528. * This feature is used for DL MU MIMO, but is not available
  6529. * from certain legacy targets.
  6530. */
  6531. /** number of CV Correlation triggers for online mode */
  6532. A_UINT32 cv_corr_trigger_online_mode;
  6533. /** number of CV Correlation triggers for offline mode */
  6534. A_UINT32 cv_corr_trigger_offline_mode;
  6535. /** number of CV Correlation triggers for hybrid mode */
  6536. A_UINT32 cv_corr_trigger_hybrid_mode;
  6537. /** number of CV Correlation triggers with computation level 0 */
  6538. A_UINT32 cv_corr_trigger_computation_level_0;
  6539. /** number of CV Correlation triggers with computation level 1 */
  6540. A_UINT32 cv_corr_trigger_computation_level_1;
  6541. /** number of CV Correlation triggers with computation level 2 */
  6542. A_UINT32 cv_corr_trigger_computation_level_2;
  6543. /** number of users for which CV Correlation was triggered */
  6544. A_UINT32 cv_corr_trigger_num_users[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6545. /** number of streams for which CV Correlation was triggered */
  6546. A_UINT32 cv_corr_trigger_num_streams[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6547. /** number of CV Correlation buffers received through IPC tickle */
  6548. A_UINT32 cv_corr_upload_total_buf_received;
  6549. /** number of CV Correlation buffers fed back to the IPC ring */
  6550. A_UINT32 cv_corr_upload_total_buf_fed_back;
  6551. /** number of CV Correlation buffers for which processing failed */
  6552. A_UINT32 cv_corr_upload_total_processing_failed;
  6553. /**
  6554. * number of CV Correlation buffers for which processing failed,
  6555. * due to no users being present in parsed buffer
  6556. */
  6557. A_UINT32 cv_corr_upload_failed_total_users_zero;
  6558. /**
  6559. * number of CV Correlation buffers for which processing failed,
  6560. * due to number of users present in parsed buffer exceeded
  6561. * CV_CORR_MAX_NUM_COLUMNS
  6562. */
  6563. A_UINT32 cv_corr_upload_failed_total_users_exceeded;
  6564. /**
  6565. * number of CV Correlation buffers for which processing failed,
  6566. * due to peer pointer for parsed peer not available
  6567. */
  6568. A_UINT32 cv_corr_upload_failed_peer_not_found;
  6569. /**
  6570. * number of CV Correlation buffers for which processing encountered,
  6571. * Nss of peer exceeding SCHED_ALGO_MAX_SUPPORTED_MUMIMO_NSS
  6572. */
  6573. A_UINT32 cv_corr_upload_user_nss_exceeded;
  6574. /**
  6575. * number of CV Correlation buffers for which processing encountered,
  6576. * invalid reverse look up index for fetching CV correlation results
  6577. */
  6578. A_UINT32 cv_corr_upload_invalid_lookup_index;
  6579. /** number of users present in uploaded CV Correlation results buffer */
  6580. A_UINT32 cv_corr_upload_total_num_users[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6581. /** number of streams present in uploaded CV Correlation results buffer */
  6582. A_UINT32 cv_corr_upload_total_num_streams[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6583. } htt_stats_tx_sounding_stats_tlv;
  6584. /* preserve old name alias for new name consistent with the tag name */
  6585. typedef htt_stats_tx_sounding_stats_tlv htt_tx_sounding_stats_tlv;
  6586. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  6587. * TLV_TAGS:
  6588. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  6589. */
  6590. /* NOTE:
  6591. * This structure is for documentation, and cannot be safely used directly.
  6592. * Instead, use the constituent TLV structures to fill/parse.
  6593. */
  6594. #ifdef ATH_TARGET
  6595. typedef struct {
  6596. htt_stats_tx_sounding_stats_tlv sounding_tlv;
  6597. } htt_tx_sounding_stats_t;
  6598. #endif /* ATH_TARGET */
  6599. typedef struct {
  6600. htt_tlv_hdr_t tlv_hdr;
  6601. A_UINT32 num_obss_tx_ppdu_success;
  6602. A_UINT32 num_obss_tx_ppdu_failure;
  6603. /** num_sr_tx_transmissions:
  6604. * Counter of TX done by aborting other BSS RX with spatial reuse
  6605. * (for cases where rx RSSI from other BSS is below the packet-detection
  6606. * threshold for doing spatial reuse)
  6607. */
  6608. union {
  6609. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  6610. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  6611. };
  6612. union {
  6613. /**
  6614. * Count the number of times the RSSI from an other-BSS signal
  6615. * is below the spatial reuse power threshold, thus providing an
  6616. * opportunity for spatial reuse since OBSS interference will be
  6617. * inconsequential.
  6618. */
  6619. A_UINT32 num_spatial_reuse_opportunities;
  6620. /* DEPRECATED: num_sr_rx_ge_pd_rssi_thr
  6621. * This old name has been deprecated because it does not
  6622. * clearly and accurately reflect the information stored within
  6623. * this field.
  6624. * Use the new name (num_spatial_reuse_opportunities) instead of
  6625. * the deprecated old name (num_sr_rx_ge_pd_rssi_thr).
  6626. */
  6627. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  6628. };
  6629. /**
  6630. * Count of number of times OBSS frames were aborted and non-SRG
  6631. * opportunities were created. Non-SRG opportunities are created when
  6632. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  6633. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  6634. * allow non-SRG TX.
  6635. */
  6636. A_UINT32 num_non_srg_opportunities;
  6637. /**
  6638. * Count of number of times TX PPDU were transmitted using non-SRG
  6639. * opportunities created. Incoming OBSS frame RSSI is compared with per
  6640. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  6641. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  6642. * transmission happens.
  6643. */
  6644. A_UINT32 num_non_srg_ppdu_tried;
  6645. /**
  6646. * Count of number of times non-SRG based TX transmissions were successful
  6647. */
  6648. A_UINT32 num_non_srg_ppdu_success;
  6649. /**
  6650. * Count of number of times OBSS frames were aborted and SRG opportunities
  6651. * were created. Srg opportunities are created when incoming OBSS RSSI
  6652. * is less than the global configured SRG RSSI threshold and SRC OBSS
  6653. * color / SRG OBSS BSSID / SRG partial bssid / SRG BSS color bitmap
  6654. * registers allow SRG TX.
  6655. */
  6656. A_UINT32 num_srg_opportunities;
  6657. /**
  6658. * Count of number of times TX PPDU were transmitted using SRG
  6659. * opportunities created.
  6660. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  6661. * threshold configured in each PPDU.
  6662. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  6663. * then SRG transmission happens.
  6664. */
  6665. A_UINT32 num_srg_ppdu_tried;
  6666. /**
  6667. * Count of number of times SRG based TX transmissions were successful
  6668. */
  6669. A_UINT32 num_srg_ppdu_success;
  6670. /**
  6671. * Count of number of times PSR opportunities were created by aborting
  6672. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  6673. * spatial reuse info in the OBSS trigger common field is set to allow PSR
  6674. * based spatial reuse.
  6675. */
  6676. A_UINT32 num_psr_opportunities;
  6677. /**
  6678. * Count of number of times TX PPDU were transmitted using PSR
  6679. * opportunities created.
  6680. */
  6681. A_UINT32 num_psr_ppdu_tried;
  6682. /**
  6683. * Count of number of times PSR based TX transmissions were successful.
  6684. */
  6685. A_UINT32 num_psr_ppdu_success;
  6686. /**
  6687. * Count of number of times TX PPDU per access category were transmitted
  6688. * using non-SRG opportunities created.
  6689. */
  6690. A_UINT32 num_non_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  6691. /**
  6692. * Count of number of times non-SRG based TX transmissions per access
  6693. * category were successful
  6694. */
  6695. A_UINT32 num_non_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  6696. /**
  6697. * Count of number of times TX PPDU per access category were transmitted
  6698. * using SRG opportunities created.
  6699. */
  6700. A_UINT32 num_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  6701. /**
  6702. * Count of number of times SRG based TX transmissions per access
  6703. * category were successful
  6704. */
  6705. A_UINT32 num_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  6706. /**
  6707. * Count of number of times ppdu was flushed due to ongoing OBSS
  6708. * frame duration value lesser than minimum required frame duration.
  6709. */
  6710. A_UINT32 num_obss_min_duration_check_flush_cnt;
  6711. /**
  6712. * Count of number of times ppdu was flushed due to ppdu duration
  6713. * exceeding aborted OBSS frame duration
  6714. */
  6715. A_UINT32 num_sr_ppdu_abort_flush_cnt;
  6716. } htt_stats_pdev_obss_pd_tlv;
  6717. /* preserve old name alias for new name consistent with the tag name */
  6718. typedef htt_stats_pdev_obss_pd_tlv htt_pdev_obss_pd_stats_tlv;
  6719. /* NOTE:
  6720. * This structure is for documentation, and cannot be safely used directly.
  6721. * Instead, use the constituent TLV structures to fill/parse.
  6722. */
  6723. #ifdef ATH_TARGET
  6724. typedef struct {
  6725. htt_stats_pdev_obss_pd_tlv obss_pd_stat;
  6726. } htt_pdev_obss_pd_stats_t;
  6727. #endif /* ATH_TARGET */
  6728. typedef struct {
  6729. htt_tlv_hdr_t tlv_hdr;
  6730. A_UINT32 pdev_id;
  6731. A_UINT32 current_head_idx;
  6732. A_UINT32 current_tail_idx;
  6733. A_UINT32 num_htt_msgs_sent;
  6734. /**
  6735. * Time in milliseconds for which the ring has been in
  6736. * its current backpressure condition
  6737. */
  6738. A_UINT32 backpressure_time_ms;
  6739. /** backpressure_hist -
  6740. * histogram showing how many times different degrees of backpressure
  6741. * duration occurred:
  6742. * Index 0 indicates the number of times ring was
  6743. * continuously in backpressure state for 100 - 200ms.
  6744. * Index 1 indicates the number of times ring was
  6745. * continuously in backpressure state for 200 - 300ms.
  6746. * Index 2 indicates the number of times ring was
  6747. * continuously in backpressure state for 300 - 400ms.
  6748. * Index 3 indicates the number of times ring was
  6749. * continuously in backpressure state for 400 - 500ms.
  6750. * Index 4 indicates the number of times ring was
  6751. * continuously in backpressure state beyond 500ms.
  6752. */
  6753. A_UINT32 backpressure_hist[5];
  6754. } htt_stats_ring_backpressure_stats_tlv;
  6755. /* preserve old name alias for new name consistent with the tag name */
  6756. typedef htt_stats_ring_backpressure_stats_tlv htt_ring_backpressure_stats_tlv;
  6757. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  6758. * TLV_TAGS:
  6759. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  6760. */
  6761. /* NOTE:
  6762. * This structure is for documentation, and cannot be safely used directly.
  6763. * Instead, use the constituent TLV structures to fill/parse.
  6764. */
  6765. #ifdef ATH_TARGET
  6766. typedef struct {
  6767. htt_stats_sring_cmn_tlv cmn_tlv;
  6768. struct {
  6769. htt_stats_string_tlv sring_str_tlv;
  6770. htt_stats_ring_backpressure_stats_tlv backpressure_stats_tlv;
  6771. } r[1]; /* variable-length array */
  6772. } htt_ring_backpressure_stats_t;
  6773. #endif /* ATH_TARGET */
  6774. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  6775. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  6776. #define HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST 3
  6777. typedef struct {
  6778. htt_tlv_hdr_t tlv_hdr;
  6779. /** print_header:
  6780. * This field suggests whether the host should print a header when
  6781. * displaying the TLV (because this is the first latency_prof_stats
  6782. * TLV within a series), or if only the TLV contents should be displayed
  6783. * without a header (because this is not the first TLV within the series).
  6784. */
  6785. A_UINT32 print_header;
  6786. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  6787. /** number of data values included in the tot sum */
  6788. A_UINT32 cnt;
  6789. /** time in us */
  6790. A_UINT32 min;
  6791. /** time in us */
  6792. A_UINT32 max;
  6793. A_UINT32 last;
  6794. /** time in us */
  6795. A_UINT32 tot;
  6796. /** time in us */
  6797. A_UINT32 avg;
  6798. /** hist_intvl:
  6799. * Histogram interval, i.e. the latency range covered by each
  6800. * bin of the histogram, in microsecond units.
  6801. * hist[0] counts how many latencies were between 0 to hist_intvl
  6802. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  6803. * hist[2] counts how many latencies were more than 2*hist_intvl
  6804. */
  6805. A_UINT32 hist_intvl;
  6806. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  6807. /** max page faults in any 1 sampling window */
  6808. A_UINT32 page_fault_max;
  6809. /** summed over all sampling windows */
  6810. A_UINT32 page_fault_total;
  6811. /** ignored_latency_count:
  6812. * ignore some of profile latency to avoid avg skewing
  6813. */
  6814. A_UINT32 ignored_latency_count;
  6815. /** interrupts_max: max interrupts within any single sampling window */
  6816. A_UINT32 interrupts_max;
  6817. /** interrupts_hist: histogram of interrupt rate
  6818. * bin0 contains the number of sampling windows that had 0 interrupts,
  6819. * bin1 contains the number of sampling windows that had 1-4 interrupts,
  6820. * bin2 contains the number of sampling windows that had > 4 interrupts
  6821. */
  6822. A_UINT32 interrupts_hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  6823. } htt_stats_latency_prof_stats_tlv;
  6824. /* preserve old name alias for new name consistent with the tag name */
  6825. typedef htt_stats_latency_prof_stats_tlv htt_latency_prof_stats_tlv;
  6826. typedef struct {
  6827. htt_tlv_hdr_t tlv_hdr;
  6828. /** duration:
  6829. * Time period over which counts were gathered, units = microseconds.
  6830. */
  6831. A_UINT32 duration;
  6832. A_UINT32 tx_msdu_cnt;
  6833. A_UINT32 tx_mpdu_cnt;
  6834. A_UINT32 tx_ppdu_cnt;
  6835. A_UINT32 rx_msdu_cnt;
  6836. A_UINT32 rx_mpdu_cnt;
  6837. } htt_stats_latency_ctx_tlv;
  6838. /* preserve old name alias for new name consistent with the tag name */
  6839. typedef htt_stats_latency_ctx_tlv htt_latency_prof_ctx_tlv;
  6840. typedef struct {
  6841. htt_tlv_hdr_t tlv_hdr;
  6842. /** count of enabled profiles */
  6843. A_UINT32 prof_enable_cnt;
  6844. } htt_stats_latency_cnt_tlv;
  6845. /* preserve old name alias for new name consistent with the tag name */
  6846. typedef htt_stats_latency_cnt_tlv htt_latency_prof_cnt_tlv;
  6847. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  6848. * TLV_TAGS:
  6849. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  6850. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  6851. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  6852. */
  6853. /* NOTE:
  6854. * This structure is for documentation, and cannot be safely used directly.
  6855. * Instead, use the constituent TLV structures to fill/parse.
  6856. */
  6857. #ifdef ATH_TARGET
  6858. typedef struct {
  6859. htt_stats_latency_prof_stats_tlv latency_prof_stat;
  6860. htt_stats_latency_ctx_tlv latency_ctx_stat;
  6861. htt_stats_latency_cnt_tlv latency_cnt_stat;
  6862. } htt_soc_latency_stats_t;
  6863. #endif /* ATH_TARGET */
  6864. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  6865. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  6866. #define HTT_RX_SQUARE_INDEX 6
  6867. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  6868. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  6869. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  6870. * TLV_TAGS:
  6871. * - HTT_STATS_RX_FSE_STATS_TAG
  6872. */
  6873. typedef struct {
  6874. htt_tlv_hdr_t tlv_hdr;
  6875. /**
  6876. * Number of times host requested for fse enable/disable
  6877. */
  6878. A_UINT32 fse_enable_cnt;
  6879. A_UINT32 fse_disable_cnt;
  6880. /**
  6881. * Number of times host requested for fse cache invalidation
  6882. * individual entries or full cache
  6883. */
  6884. A_UINT32 fse_cache_invalidate_entry_cnt;
  6885. A_UINT32 fse_full_cache_invalidate_cnt;
  6886. /**
  6887. * Cache hits count will increase if there is a matching flow in the cache
  6888. * There is no register for cache miss but the number of cache misses can
  6889. * be calculated as
  6890. * cache miss = (num_searches - cache_hits)
  6891. * Thus, there is no need to have a separate variable for cache misses.
  6892. * Num searches is flow search times done in the cache.
  6893. */
  6894. A_UINT32 fse_num_cache_hits_cnt;
  6895. A_UINT32 fse_num_searches_cnt;
  6896. /**
  6897. * Cache Occupancy holds 2 types of values: Peak and Current.
  6898. * 10 bins are used to keep track of peak occupancy.
  6899. * 8 of these bins represent ranges of values, while the first and last
  6900. * bins represent the extreme cases of the cache being completely empty
  6901. * or completely full.
  6902. * For the non-extreme bins, the number of cache occupancy values per
  6903. * bin is the maximum cache occupancy (128), divided by the number of
  6904. * non-extreme bins (8), so 128/8 = 16 values per bin.
  6905. * The range of values for each histogram bins is specified below:
  6906. * Bin0 = Counter increments when cache occupancy is empty
  6907. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  6908. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  6909. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  6910. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  6911. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  6912. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  6913. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  6914. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  6915. * Bin9 = Counter increments when cache occupancy is equal to 128
  6916. * The above histogram bin definitions apply to both the peak-occupancy
  6917. * histogram and the current-occupancy histogram.
  6918. *
  6919. * @fse_cache_occupancy_peak_cnt:
  6920. * Array records periodically PEAK cache occupancy values.
  6921. * Peak Occupancy will increment only if it is greater than current
  6922. * occupancy value.
  6923. *
  6924. * @fse_cache_occupancy_curr_cnt:
  6925. * Array records periodically current cache occupancy value.
  6926. * Current Cache occupancy always holds instant snapshot of
  6927. * current number of cache entries.
  6928. **/
  6929. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  6930. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  6931. /**
  6932. * Square stat is sum of squares of cache occupancy to better understand
  6933. * any variation/deviation within each cache set, over a given time-window.
  6934. *
  6935. * Square stat is calculated this way:
  6936. * Square = SUM(Squares of all Occupancy in a Set) / 8
  6937. * The cache has 16-way set associativity, so the occupancy of a
  6938. * set can vary from 0 to 16. There are 8 sets within the cache.
  6939. * Therefore, the minimum possible square value is 0, and the maximum
  6940. * possible square value is (8*16^2) / 8 = 256.
  6941. *
  6942. * 6 bins are used to keep track of square stats:
  6943. * Bin0 = increments when square of current cache occupancy is zero
  6944. * Bin1 = increments when square of current cache occupancy is within
  6945. * [1 to 50]
  6946. * Bin2 = increments when square of current cache occupancy is within
  6947. * [51 to 100]
  6948. * Bin3 = increments when square of current cache occupancy is within
  6949. * [101 to 200]
  6950. * Bin4 = increments when square of current cache occupancy is within
  6951. * [201 to 255]
  6952. * Bin5 = increments when square of current cache occupancy is 256
  6953. */
  6954. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  6955. /**
  6956. * Search stats has 2 types of values: Peak Pending and Number of
  6957. * Search Pending.
  6958. * GSE command ring for FSE can hold maximum of 5 Pending searches
  6959. * at any given time.
  6960. *
  6961. * 4 bins are used to keep track of search stats:
  6962. * Bin0 = Counter increments when there are NO pending searches
  6963. * (For peak, it will be number of pending searches greater
  6964. * than GSE command ring FIFO outstanding requests.
  6965. * For Search Pending, it will be number of pending search
  6966. * inside GSE command ring FIFO.)
  6967. * Bin1 = Counter increments when number of pending searches are within
  6968. * [1 to 2]
  6969. * Bin2 = Counter increments when number of pending searches are within
  6970. * [3 to 4]
  6971. * Bin3 = Counter increments when number of pending searches are
  6972. * greater/equal to [ >= 5]
  6973. */
  6974. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  6975. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  6976. } htt_stats_rx_fse_stats_tlv;
  6977. /* preserve old name alias for new name consistent with the tag name */
  6978. typedef htt_stats_rx_fse_stats_tlv htt_rx_fse_stats_tlv;
  6979. /* NOTE:
  6980. * This structure is for documentation, and cannot be safely used directly.
  6981. * Instead, use the constituent TLV structures to fill/parse.
  6982. */
  6983. #ifdef ATH_TARGET
  6984. typedef struct {
  6985. htt_stats_rx_fse_stats_tlv rx_fse_stats;
  6986. } htt_rx_fse_stats_t;
  6987. #endif /* ATH_TARGET */
  6988. #define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
  6989. #define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5 /* 20, 40, 80, 160, 320 */
  6990. #define HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES 2/* 0: Half, 1: Quarter */
  6991. typedef struct {
  6992. htt_tlv_hdr_t tlv_hdr;
  6993. /** SU TxBF TX MCS stats */
  6994. A_UINT32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6995. /** Implicit BF TX MCS stats */
  6996. A_UINT32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6997. /** Open loop TX MCS stats */
  6998. A_UINT32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6999. /** SU TxBF TX NSS stats */
  7000. A_UINT32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7001. /** Implicit BF TX NSS stats */
  7002. A_UINT32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7003. /** Open loop TX NSS stats */
  7004. A_UINT32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7005. /** SU TxBF TX BW stats */
  7006. A_UINT32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7007. /** Implicit BF TX BW stats */
  7008. A_UINT32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7009. /** Open loop TX BW stats */
  7010. A_UINT32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7011. /** Legacy and OFDM TX rate stats */
  7012. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  7013. /** SU TxBF TX BW stats */
  7014. A_UINT32 reduced_tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7015. /** Implicit BF TX BW stats */
  7016. A_UINT32 reduced_tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7017. /** Open loop TX BW stats */
  7018. A_UINT32 reduced_tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7019. /** Txbf flag reason stats */
  7020. A_UINT32 txbf_flag_set_mu_mode;
  7021. A_UINT32 txbf_flag_set_final_status;
  7022. A_UINT32 txbf_flag_not_set_verified_txbf_mode;
  7023. A_UINT32 txbf_flag_not_set_disable_p2p_access;
  7024. A_UINT32 txbf_flag_not_set_max_nss_reached_in_he160;
  7025. A_UINT32 txbf_flag_not_set_disable_ul_dl_ofdma;
  7026. A_UINT32 txbf_flag_not_set_mcs_threshold_value;
  7027. A_UINT32 txbf_flag_not_set_final_status;
  7028. } htt_stats_pdev_tx_rate_txbf_stats_tlv;
  7029. /* preserve old name alias for new name consistent with the tag name */
  7030. typedef htt_stats_pdev_tx_rate_txbf_stats_tlv htt_tx_pdev_txbf_rate_stats_tlv;
  7031. typedef enum {
  7032. HTT_STATS_RC_MODE_DLSU = 0,
  7033. HTT_STATS_RC_MODE_DLMUMIMO = 1,
  7034. HTT_STATS_RC_MODE_DLOFDMA = 2,
  7035. HTT_STATS_RC_MODE_ULMUMIMO = 3,
  7036. HTT_STATS_RC_MODE_ULOFDMA = 4,
  7037. } htt_stats_rc_mode;
  7038. typedef struct {
  7039. A_UINT32 ppdus_tried;
  7040. A_UINT32 ppdus_ack_failed;
  7041. A_UINT32 mpdus_tried;
  7042. A_UINT32 mpdus_failed;
  7043. } htt_tx_rate_stats_t;
  7044. typedef enum {
  7045. HTT_RC_MODE_SU_OL,
  7046. HTT_RC_MODE_SU_BF,
  7047. HTT_RC_MODE_MU1_INTF,
  7048. HTT_RC_MODE_MU2_INTF,
  7049. HTT_Rc_MODE_MU3_INTF,
  7050. HTT_RC_MODE_MU4_INTF,
  7051. HTT_RC_MODE_MU5_INTF,
  7052. HTT_RC_MODE_MU6_INTF,
  7053. HTT_RC_MODE_MU7_INTF,
  7054. HTT_RC_MODE_2D_COUNT,
  7055. } HTT_RC_MODE;
  7056. typedef enum {
  7057. HTT_STATS_RU_TYPE_INVALID = 0,
  7058. HTT_STATS_RU_TYPE_SINGLE_RU_ONLY = 1,
  7059. HTT_STATS_RU_TYPE_SINGLE_AND_MULTI_RU = 2,
  7060. } htt_stats_ru_type;
  7061. typedef struct {
  7062. htt_tlv_hdr_t tlv_hdr;
  7063. /** HTT_STATS_RC_MODE_XX */
  7064. A_UINT32 rc_mode;
  7065. A_UINT32 last_probed_mcs;
  7066. A_UINT32 last_probed_nss;
  7067. A_UINT32 last_probed_bw;
  7068. htt_tx_rate_stats_t per_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7069. htt_tx_rate_stats_t per_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7070. htt_tx_rate_stats_t per_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  7071. /** 320MHz extension for PER */
  7072. htt_tx_rate_stats_t per_bw320;
  7073. A_UINT32 probe_cnt_per_rcmode[HTT_RC_MODE_2D_COUNT];
  7074. A_UINT32 ru_type; /* refer to htt_stats_ru_type enum */
  7075. htt_tx_rate_stats_t per_ru[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  7076. } htt_stats_per_rate_stats_tlv;
  7077. /* preserve old name alias for new name consistent with the tag name */
  7078. typedef htt_stats_per_rate_stats_tlv htt_tx_rate_stats_per_tlv;
  7079. /* NOTE:
  7080. * This structure is for documentation, and cannot be safely used directly.
  7081. * Instead, use the constituent TLV structures to fill/parse.
  7082. */
  7083. #ifdef ATH_TARGET
  7084. typedef struct {
  7085. htt_stats_pdev_tx_rate_txbf_stats_tlv txbf_rate_stats;
  7086. } htt_pdev_txbf_rate_stats_t;
  7087. #endif /* ATH_TARGET */
  7088. #ifdef ATH_TARGET
  7089. typedef struct {
  7090. htt_stats_per_rate_stats_tlv per_stats;
  7091. } htt_tx_pdev_per_stats_t;
  7092. #endif /* ATH_TARGET */
  7093. typedef enum {
  7094. HTT_ULTRIG_QBOOST_TRIGGER = 0,
  7095. HTT_ULTRIG_PSPOLL_TRIGGER,
  7096. HTT_ULTRIG_UAPSD_TRIGGER,
  7097. HTT_ULTRIG_11AX_TRIGGER,
  7098. HTT_ULTRIG_11AX_WILDCARD_TRIGGER,
  7099. HTT_ULTRIG_11AX_UNASSOC_WILDCARD_TRIGGER,
  7100. HTT_STA_UL_OFDMA_NUM_TRIG_TYPE,
  7101. } HTT_STA_UL_OFDMA_RX_TRIG_TYPE;
  7102. typedef enum {
  7103. HTT_11AX_TRIGGER_BASIC_E = 0,
  7104. HTT_11AX_TRIGGER_BRPOLL_E = 1,
  7105. HTT_11AX_TRIGGER_MU_BAR_E = 2,
  7106. HTT_11AX_TRIGGER_MU_RTS_E = 3,
  7107. HTT_11AX_TRIGGER_BUFFER_SIZE_E = 4,
  7108. HTT_11AX_TRIGGER_GCR_MU_BAR_E = 5,
  7109. HTT_11AX_TRIGGER_BQRP_E = 6,
  7110. HTT_11AX_TRIGGER_NDP_FB_REPORT_POLL_E = 7,
  7111. HTT_11AX_TRIGGER_RESERVED_8_E = 8,
  7112. HTT_11AX_TRIGGER_RESERVED_9_E = 9,
  7113. HTT_11AX_TRIGGER_RESERVED_10_E = 10,
  7114. HTT_11AX_TRIGGER_RESERVED_11_E = 11,
  7115. HTT_11AX_TRIGGER_RESERVED_12_E = 12,
  7116. HTT_11AX_TRIGGER_RESERVED_13_E = 13,
  7117. HTT_11AX_TRIGGER_RESERVED_14_E = 14,
  7118. HTT_11AX_TRIGGER_RESERVED_15_E = 15,
  7119. HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE,
  7120. } HTT_STA_UL_OFDMA_11AX_TRIG_TYPE;
  7121. /* UL RESP Queues 0 - HIPRI, 1 - LOPRI & 2 - BSR */
  7122. #define HTT_STA_UL_OFDMA_NUM_UL_QUEUES 3
  7123. /* Actual resp type sent by STA for trigger
  7124. * 0 - HE TB PPDU, 1 - NULL Delimiter */
  7125. #define HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE 2
  7126. /* Counter for MCS 0-13 */
  7127. #define HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS 14
  7128. /* Counters BW 20,40,80,160,320 */
  7129. #define HTT_STA_UL_OFDMA_NUM_BW_COUNTERS 5
  7130. #define HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  7131. /* STATS_TYPE : HTT_DBG_EXT_STA_11AX_UL_STATS
  7132. * TLV_TAGS:
  7133. * - HTT_STATS_STA_UL_OFDMA_STATS_TAG
  7134. */
  7135. typedef struct {
  7136. htt_tlv_hdr_t tlv_hdr;
  7137. A_UINT32 pdev_id;
  7138. /**
  7139. * Trigger Type reported by HWSCH on RX reception
  7140. * Each index populate enum HTT_STA_UL_OFDMA_RX_TRIG_TYPE
  7141. */
  7142. A_UINT32 rx_trigger_type[HTT_STA_UL_OFDMA_NUM_TRIG_TYPE];
  7143. /**
  7144. * 11AX Trigger Type on RX reception
  7145. * Each index populate enum HTT_STA_UL_OFDMA_11AX_TRIG_TYPE
  7146. */
  7147. A_UINT32 ax_trigger_type[HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE];
  7148. /** Num data PPDUs/Delims responded to trigs. per HWQ for UL RESP */
  7149. A_UINT32 num_data_ppdu_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  7150. A_UINT32 num_null_delimiters_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  7151. /**
  7152. * Overall UL STA RESP Status 0 - HE TB PPDU, 1 - NULL Delimiter
  7153. * Super set of num_data_ppdu_responded_per_hwq,
  7154. * num_null_delimiters_responded_per_hwq
  7155. */
  7156. A_UINT32 num_total_trig_responses[HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE];
  7157. /**
  7158. * Time interval between current time ms and last successful trigger RX
  7159. * 0xFFFFFFFF denotes no trig received / timestamp roll back
  7160. */
  7161. A_UINT32 last_trig_rx_time_delta_ms;
  7162. /**
  7163. * Rate Statistics for UL OFDMA
  7164. * UL TB PPDU TX MCS, NSS, GI, BW from STA HWQ
  7165. */
  7166. A_UINT32 ul_ofdma_tx_mcs[HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  7167. A_UINT32 ul_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7168. A_UINT32 ul_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  7169. A_UINT32 ul_ofdma_tx_ldpc;
  7170. A_UINT32 ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  7171. /** Trig based PPDU TX/ RBO based PPDU TX Count */
  7172. A_UINT32 trig_based_ppdu_tx;
  7173. A_UINT32 rbo_based_ppdu_tx;
  7174. /** Switch MU EDCA to SU EDCA Count */
  7175. A_UINT32 mu_edca_to_su_edca_switch_count;
  7176. /** Num MU EDCA applied Count */
  7177. A_UINT32 num_mu_edca_param_apply_count;
  7178. /**
  7179. * Current MU EDCA Parameters for WMM ACs
  7180. * Mode - 0 - SU EDCA, 1- MU EDCA
  7181. */
  7182. A_UINT32 current_edca_hwq_mode[HTT_NUM_AC_WMM];
  7183. /** Contention Window minimum. Range: 1 - 10 */
  7184. A_UINT32 current_cw_min[HTT_NUM_AC_WMM];
  7185. /** Contention Window maximum. Range: 1 - 10 */
  7186. A_UINT32 current_cw_max[HTT_NUM_AC_WMM];
  7187. /** AIFS value - 0 -255 */
  7188. A_UINT32 current_aifs[HTT_NUM_AC_WMM];
  7189. A_UINT32 reduced_ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES][HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  7190. } htt_stats_sta_ul_ofdma_stats_tlv;
  7191. /* preserve old name alias for new name consistent with the tag name */
  7192. typedef htt_stats_sta_ul_ofdma_stats_tlv htt_sta_ul_ofdma_stats_tlv;
  7193. /* NOTE:
  7194. * This structure is for documentation, and cannot be safely used directly.
  7195. * Instead, use the constituent TLV structures to fill/parse.
  7196. */
  7197. #ifdef ATH_TARGET
  7198. typedef struct {
  7199. htt_stats_sta_ul_ofdma_stats_tlv ul_ofdma_sta_stats;
  7200. } htt_sta_11ax_ul_stats_t;
  7201. #endif /* ATH_TARGET */
  7202. typedef struct {
  7203. htt_tlv_hdr_t tlv_hdr;
  7204. /** No of Fine Timing Measurement frames transmitted successfully */
  7205. A_UINT32 tx_ftm_suc;
  7206. /**
  7207. * No of Fine Timing Measurement frames transmitted successfully
  7208. * after retry
  7209. */
  7210. A_UINT32 tx_ftm_suc_retry;
  7211. /** No of Fine Timing Measurement frames not transmitted successfully */
  7212. A_UINT32 tx_ftm_fail;
  7213. /**
  7214. * No of Fine Timing Measurement Request frames received,
  7215. * including initial, non-initial, and duplicates
  7216. */
  7217. A_UINT32 rx_ftmr_cnt;
  7218. /**
  7219. * No of duplicate Fine Timing Measurement Request frames received,
  7220. * including both initial and non-initial
  7221. */
  7222. A_UINT32 rx_ftmr_dup_cnt;
  7223. /** No of initial Fine Timing Measurement Request frames received */
  7224. A_UINT32 rx_iftmr_cnt;
  7225. /**
  7226. * No of duplicate initial Fine Timing Measurement Request frames received
  7227. */
  7228. A_UINT32 rx_iftmr_dup_cnt;
  7229. /** No of responder sessions rejected when initiator was active */
  7230. A_UINT32 initiator_active_responder_rejected_cnt;
  7231. /** Responder terminate count */
  7232. A_UINT32 responder_terminate_cnt;
  7233. A_UINT32 vdev_id;
  7234. } htt_stats_vdev_rtt_resp_stats_tlv;
  7235. /* preserve old name alias for new name consistent with the tag name */
  7236. typedef htt_stats_vdev_rtt_resp_stats_tlv htt_vdev_rtt_resp_stats_tlv;
  7237. #ifdef ATH_TARGET
  7238. typedef struct {
  7239. htt_stats_vdev_rtt_resp_stats_tlv vdev_rtt_resp_stats;
  7240. } htt_vdev_rtt_resp_stats_t;
  7241. #endif /* ATH_TARGET */
  7242. typedef struct {
  7243. htt_tlv_hdr_t tlv_hdr;
  7244. A_UINT32 vdev_id;
  7245. /**
  7246. * No of Fine Timing Measurement request frames transmitted successfully
  7247. */
  7248. A_UINT32 tx_ftmr_cnt;
  7249. /**
  7250. * No of Fine Timing Measurement request frames not transmitted successfully
  7251. */
  7252. A_UINT32 tx_ftmr_fail;
  7253. /**
  7254. * No of Fine Timing Measurement request frames transmitted successfully
  7255. * after retry
  7256. */
  7257. A_UINT32 tx_ftmr_suc_retry;
  7258. /**
  7259. * No of Fine Timing Measurement frames received, including initial,
  7260. * non-initial, and duplicates
  7261. */
  7262. A_UINT32 rx_ftm_cnt;
  7263. /** Initiator Terminate count */
  7264. A_UINT32 initiator_terminate_cnt;
  7265. /** Debug count to check the Measurement request from host */
  7266. A_UINT32 tx_meas_req_count;
  7267. } htt_stats_vdev_rtt_init_stats_tlv;
  7268. /* preserve old name alias for new name consistent with the tag name */
  7269. typedef htt_stats_vdev_rtt_init_stats_tlv htt_vdev_rtt_init_stats_tlv;
  7270. #ifdef ATH_TARGET
  7271. typedef struct {
  7272. htt_stats_vdev_rtt_init_stats_tlv vdev_rtt_init_stats;
  7273. } htt_vdev_rtt_init_stats_t;
  7274. #endif /* ATH_TARGET */
  7275. #define HTT_STATS_MAX_SCH_CMD_RESULT 25
  7276. /* TXSEND self generated frames */
  7277. typedef enum {
  7278. HTT_TXSEND_FTYPE_SGEN_TF_POLL,
  7279. HTT_TXSEND_FTYPE_SGEN_TF_SOUND,
  7280. HTT_TXSEND_FTYPE_SGEN_TBR_NDPA,
  7281. HTT_TXSEND_FTYPE_SGEN_TBR_NDP,
  7282. HTT_TXSEND_FTYPE_SGEN_TBR_LMR,
  7283. HTT_TXSEND_FTYPE_SGEN_TF_REPORT,
  7284. HTT_TXSEND_FTYPE_MAX
  7285. }
  7286. htt_stats_txsend_ftype_t;
  7287. typedef struct {
  7288. htt_tlv_hdr_t tlv_hdr;
  7289. /* 11AZ TBR SU Stats */
  7290. A_UINT32 tbr_su_ftype_queued[HTT_TXSEND_FTYPE_MAX];
  7291. /* 11AZ TBR MU Stats */
  7292. A_UINT32 tbr_mu_ftype_queued[HTT_TXSEND_FTYPE_MAX];
  7293. } htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv;
  7294. typedef struct {
  7295. htt_tlv_hdr_t tlv_hdr;
  7296. /** tbr_num_sch_cmd_result_buckets:
  7297. * Number of sch cmd results buckets in use per chip
  7298. * Each bucket contains the counter of the number of times that bucket
  7299. * index was seen in the sch_cmd_result. The last bucket will capture
  7300. * the count of sch_cmd_result matching the last bucket index and the
  7301. * count of all the sch_cmd_results that exceeded the last bucket index
  7302. * value.
  7303. * tbr_num_sch_cmd_result_buckets must be <= HTT_STATS_MAX_SCH_CMD_RESULT
  7304. */
  7305. A_UINT32 tbr_num_sch_cmd_result_buckets;
  7306. /* cmd result status for SU frames in case of TB ranging */
  7307. A_UINT32 opaque_tbr_su_ftype_cmd_result[HTT_TXSEND_FTYPE_MAX][HTT_STATS_MAX_SCH_CMD_RESULT];
  7308. /* cmd result status for MU frames in case of TB ranging */
  7309. A_UINT32 opaque_tbr_mu_ftype_cmd_result[HTT_TXSEND_FTYPE_MAX][HTT_STATS_MAX_SCH_CMD_RESULT];
  7310. } htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv;
  7311. typedef struct {
  7312. htt_tlv_hdr_t tlv_hdr;
  7313. /** ista_ranging_ndpa_cnt:
  7314. * Indicates the number of Ranging NDPA sent successfully.
  7315. */
  7316. A_UINT32 ista_ranging_ndpa_cnt;
  7317. /** ista_ranging_ndp_cnt:
  7318. * Indicates the number of Ranging NDP sent successfully.
  7319. */
  7320. A_UINT32 ista_ranging_ndp_cnt;
  7321. /** ista_ranging_i2r_lmr_cnt:
  7322. * Indicates the number of Ranging I2R LMR sent successfully.
  7323. */
  7324. A_UINT32 ista_ranging_i2r_lmr_cnt;
  7325. /** rtsa_ranging_resp_cnt
  7326. * Indicates the number of times RXPCU initiates a Ranging response
  7327. * as a RSTA.
  7328. */
  7329. A_UINT32 rtsa_ranging_resp_cnt;
  7330. /** rtsa_ranging_ndp_cnt:
  7331. * Indicates the number of Ranging NDP response sent successfully.
  7332. */
  7333. A_UINT32 rtsa_ranging_ndp_cnt;
  7334. /** rsta_ranging_lmr_cnt:
  7335. * Indicates the number of Ranging R2I LMR response sent successfully.
  7336. */
  7337. A_UINT32 rsta_ranging_lmr_cnt;
  7338. /** tb_ranging_cts2s_rcvd_cnt:
  7339. * Indicates the number of expected CTS2S response received for TF Poll
  7340. * sent.
  7341. */
  7342. A_UINT32 tb_ranging_cts2s_rcvd_cnt;
  7343. /** tb_ranging_ndp_rcvd_cnt:
  7344. * Indicates the number of expected NDP response received for TF Sound
  7345. * or Secure Sound sent.
  7346. */
  7347. A_UINT32 tb_ranging_ndp_rcvd_cnt;
  7348. /** tb_ranging_lmr_rcvd_cnt:
  7349. * Indicates the number of expected LMR response received for TF Report
  7350. * sent.
  7351. */
  7352. A_UINT32 tb_ranging_lmr_rcvd_cnt;
  7353. /** tb_ranging_tf_poll_resp_sent_cnt:
  7354. * Indicates the number of successful responses sent for TF Poll
  7355. * received.
  7356. */
  7357. A_UINT32 tb_ranging_tf_poll_resp_sent_cnt;
  7358. /** tb_ranging_tf_sound_resp_sent_cnt:
  7359. * Indicates the number of successful responses sent for TF Sound
  7360. * (or Secure) received.
  7361. */
  7362. A_UINT32 tb_ranging_tf_sound_resp_sent_cnt;
  7363. /** tb_ranging_tf_report_resp_sent_cnt:
  7364. * Indicates the number of successful responses sent for TF Report
  7365. * received.
  7366. */
  7367. A_UINT32 tb_ranging_tf_report_resp_sent_cnt;
  7368. } htt_stats_pdev_rtt_hw_stats_tlv;
  7369. typedef struct {
  7370. htt_tlv_hdr_t tlv_hdr;
  7371. A_UINT32 pdev_id;
  7372. /** tx_11mc_ftm_suc:
  7373. * Number of 11mc Fine Timing Measurement frames transmitted successfully.
  7374. */
  7375. A_UINT32 tx_11mc_ftm_suc;
  7376. /** tx_11mc_ftm_suc_retry:
  7377. * Number of Fine Timing Measurement frames transmitted successfully
  7378. * after retrying.
  7379. */
  7380. A_UINT32 tx_11mc_ftm_suc_retry;
  7381. /** tx_11mc_ftm_fail:
  7382. * Number of Fine Timing Measurement frames not transmitted successfully.
  7383. */
  7384. A_UINT32 tx_11mc_ftm_fail;
  7385. /** rx_11mc_ftmr_cnt:
  7386. * Number of FTMR frames received, including initial, non-initial,
  7387. * and duplicates.
  7388. */
  7389. A_UINT32 rx_11mc_ftmr_cnt;
  7390. /** rx_11mc_ftmr_dup_cnt:
  7391. * Number of duplicate Fine Timing Measurement Request frames received,
  7392. * including both initial and non-initial.
  7393. */
  7394. A_UINT32 rx_11mc_ftmr_dup_cnt;
  7395. /** rx_11mc_iftmr_cnt:
  7396. * Number of initial Fine Timing Measurement Request frames received.
  7397. */
  7398. A_UINT32 rx_11mc_iftmr_cnt;
  7399. /** rx_11mc_iftmr_dup_cnt:
  7400. * Number of duplicate initial Fine Timing Measurement Request frames
  7401. * received.
  7402. */
  7403. A_UINT32 rx_11mc_iftmr_dup_cnt;
  7404. /** ftmr_drop_11mc_resp_role_not_enabled_cnt:
  7405. * Number of FTMR frames dropped as 11mc is not supported for this VAP.
  7406. */
  7407. A_UINT32 ftmr_drop_11mc_resp_role_not_enabled_cnt;
  7408. /** initiator_active_responder_rejected_cnt:
  7409. * Number of responder sessions rejected when initiator was active.
  7410. */
  7411. A_UINT32 initiator_active_responder_rejected_cnt;
  7412. /** responder_terminate_cnt:
  7413. * Number of times Responder session got terminated.
  7414. */
  7415. A_UINT32 responder_terminate_cnt;
  7416. /** active_rsta_open:
  7417. * Number of active responder contexts in open mode.
  7418. */
  7419. A_UINT32 active_rsta_open;
  7420. /** active_rsta_mac:
  7421. * Number of active responder contexts in mac security mode.
  7422. */
  7423. A_UINT32 active_rsta_mac;
  7424. /** active_rsta_mac_phy:
  7425. * Number of active responder contexts in mac_phy security mode.
  7426. */
  7427. A_UINT32 active_rsta_mac_phy;
  7428. /** num_assoc_ranging_peers:
  7429. * Number of active associated ISTA ranging peers.
  7430. */
  7431. A_UINT32 num_assoc_ranging_peers;
  7432. /** num_unassoc_ranging_peers:
  7433. * Number of active un-associated ISTA ranging peers.
  7434. */
  7435. A_UINT32 num_unassoc_ranging_peers;
  7436. /** responder_alloc_cnt:
  7437. * Number of responder contexts allocated.
  7438. */
  7439. A_UINT32 responder_alloc_cnt;
  7440. /** responder_alloc_failure:
  7441. * Number of times responder context failed to be allocated.
  7442. */
  7443. A_UINT32 responder_alloc_failure;
  7444. /** pn_check_failure_cnt:
  7445. * Number of times PN check failed.
  7446. */
  7447. A_UINT32 pn_check_failure_cnt;
  7448. /** pasn_m1_auth_recv_cnt:
  7449. * Num of M1 auth frames received for PASN over the air from iSTA.
  7450. */
  7451. A_UINT32 pasn_m1_auth_recv_cnt;
  7452. /** pasn_m1_auth_drop_cnt:
  7453. * Number of M1 auth frames received for PASN over the air from iSTA
  7454. * but dropped in FW due to any reason (such as unavailability of
  7455. * responder ctxt or any other check).
  7456. */
  7457. A_UINT32 pasn_m1_auth_drop_cnt;
  7458. /** pasn_m2_auth_recv_cnt:
  7459. * Number of M2 auth frames received in FW for PASN from Host driver.
  7460. */
  7461. A_UINT32 pasn_m2_auth_recv_cnt;
  7462. /** pasn_m2_auth_tx_fail_cnt:
  7463. * Number of M2 auth frames received in FW but Tx failed.
  7464. */
  7465. A_UINT32 pasn_m2_auth_tx_fail_cnt;
  7466. /** pasn_m3_auth_recv_cnt:
  7467. * Number of M3 auth frames received for PASN.
  7468. */
  7469. A_UINT32 pasn_m3_auth_recv_cnt;
  7470. /** pasn_m3_auth_drop_cnt:
  7471. * Number of M3 auth frames received for PASN over the air from iSTA but
  7472. * dropped in FW due to any reason.
  7473. */
  7474. A_UINT32 pasn_m3_auth_drop_cnt;
  7475. /** pasn_peer_create_request_cnt:
  7476. * Number of times FW requested PASN peer create request to Host.
  7477. */
  7478. A_UINT32 pasn_peer_create_request_cnt;
  7479. /** pasn_peer_create_timeout_cnt:
  7480. * Number of times PASN peer was not created within timeout period.
  7481. */
  7482. A_UINT32 pasn_peer_create_timeout_cnt;
  7483. /** pasn_peer_created_cnt:
  7484. * Number of times Host sent PASN peer create request to FW.
  7485. */
  7486. A_UINT32 pasn_peer_created_cnt;
  7487. /** sec_ranging_not_supported_mfp_not_setup:
  7488. * management frame protection not setup, drop secure ranging request.
  7489. */
  7490. A_UINT32 sec_ranging_not_supported_mfp_not_setup;
  7491. /** non_sec_ranging_discarded_for_assoc_peer_with_mfpr_set:
  7492. * Non secured ranging request discarded for Assoc peer with MFPR set.
  7493. */
  7494. A_UINT32 non_sec_ranging_discarded_for_assoc_peer_with_mfpr_set;
  7495. /** open_ranging_discarded_with_URNM_MFPR_set_for_pasn_peer:
  7496. * Failure in case non-secured frame is received for PASN peer and
  7497. * URNM_MFPR is set.
  7498. */
  7499. A_UINT32 open_ranging_discarded_with_URNM_MFPR_set_for_pasn_peer;
  7500. /** unassoc_non_pasn_ranging_not_supported_with_URNM_MFPR:
  7501. * Failure in case non-assoc/non-PASN sta is sending open FTMR and
  7502. * RSTA does not support un-secured ranging.
  7503. */
  7504. A_UINT32 unassoc_non_pasn_ranging_not_supported_with_URNM_MFPR;
  7505. /** num_req_bw_20_MHz:
  7506. * Number of requests with BW 20 MHz.
  7507. */
  7508. A_UINT32 num_req_bw_20_MHz;
  7509. /** num_req_bw_40_MHz:
  7510. * Number of requests with BW 40 MHz.
  7511. */
  7512. A_UINT32 num_req_bw_40_MHz;
  7513. /** num_req_bw_80_MHz:
  7514. * Number of requests with BW 80 MHz.
  7515. */
  7516. A_UINT32 num_req_bw_80_MHz;
  7517. /** num_req_bw_160_MHz:
  7518. * Number of requests with BW 160 MHz.
  7519. */
  7520. A_UINT32 num_req_bw_160_MHz;
  7521. /** tx_11az_ftm_successful:
  7522. * Number of 11AZ FTM frames transmitted successfully.
  7523. */
  7524. A_UINT32 tx_11az_ftm_successful;
  7525. /** tx_11az_ftm_failed:
  7526. * Number of 11AZ FTM frames for which Tx failed.
  7527. */
  7528. A_UINT32 tx_11az_ftm_failed;
  7529. /** rx_11az_ftmr_cnt:
  7530. * Number of 11AZ FTM frames received.
  7531. */
  7532. A_UINT32 rx_11az_ftmr_cnt;
  7533. /** rx_11az_ftmr_dup_cnt:
  7534. * Number of duplicate 11az ftmr frames dropped.
  7535. */
  7536. A_UINT32 rx_11az_ftmr_dup_cnt;
  7537. /** rx_11az_iftmr_dup_cnt:
  7538. * Number of duplicate 11az iftmr frames dropped.
  7539. */
  7540. A_UINT32 rx_11az_iftmr_dup_cnt;
  7541. /** malformed_ftmr:
  7542. * Number of malformed FTMR frames received from client leading to
  7543. * frame parse error.
  7544. */
  7545. A_UINT32 malformed_ftmr;
  7546. /** ftmr_drop_ntb_resp_role_not_enabled_cnt:
  7547. * Number of FTMR frames dropped as NTB is not supported for this VAP.
  7548. */
  7549. A_UINT32 ftmr_drop_ntb_resp_role_not_enabled_cnt;
  7550. /** ftmr_drop_tb_resp_role_not_enabled_cnt:
  7551. * Number of FTMR frames dropped as TB is not supported for this VAP.
  7552. */
  7553. A_UINT32 ftmr_drop_tb_resp_role_not_enabled_cnt;
  7554. /** invalid_ftm_request_params:
  7555. * Number of FTMR frames received with invalid params.
  7556. */
  7557. A_UINT32 invalid_ftm_request_params;
  7558. /** requested_bw_format_not_supported:
  7559. * FTMR rejected as requested format is lower or higher than AP's
  7560. * capability, or unknown.
  7561. */
  7562. A_UINT32 requested_bw_format_not_supported;
  7563. /** ntb_unsec_unassoc_mode_ranging_peer_alloc_failed:
  7564. * AST entry creation failed for NTB unsecured mode.
  7565. */
  7566. A_UINT32 ntb_unsec_unassoc_mode_ranging_peer_alloc_failed;
  7567. /** tb_unassoc_unsec_mode_pasn_peer_creation_failed:
  7568. * PASN peer creation failed for unsecured mode TBR.
  7569. */
  7570. A_UINT32 tb_unassoc_unsec_mode_pasn_peer_creation_failed;
  7571. /** num_ranging_sequences_processed:
  7572. * Number of ranging sequences processed for NTB and TB.
  7573. */
  7574. A_UINT32 num_ranging_sequences_processed;
  7575. /** Number of NDPs transmitted for NTBR */
  7576. A_UINT32 ntb_tx_ndp;
  7577. A_UINT32 ndp_rx_cnt;
  7578. /** Number of NDPAs received for 11AZ NTB ranging */
  7579. A_UINT32 num_ntb_ranging_NDPAs_recv;
  7580. /** Number of LMR frames received */
  7581. A_UINT32 recv_lmr;
  7582. /** invalid_ftmr_cnt:
  7583. * Number of invalid FTMR frames received
  7584. * iftmr with null ie element is invalid
  7585. * The Frame is valid if any of the following combination is present:
  7586. * a. LCI sub ie + parameter ie
  7587. * b. LCR sub ie + parameter ie
  7588. * c. parameter ie
  7589. * d. LCI sub ie + LCR sub ie + parameter ie
  7590. */
  7591. A_UINT32 invalid_ftmr_cnt;
  7592. /** Number of times the 'max time b/w measurement' timer got expired */
  7593. A_UINT32 max_time_bw_meas_exp_cnt;
  7594. } htt_stats_pdev_rtt_resp_stats_tlv;
  7595. /* STATS_TYPE: HTT_DBG_EXT_PDEV_RTT_RESP_STATS
  7596. * TLV_TAGS:
  7597. * HTT_STATS_PDEV_RTT_RESP_STATS_TAG
  7598. * HTT_STATS_PDEV_RTT_HW_STATS_TAG
  7599. * HTT_STATS_PDEV_RTT_TBR_SELFGEN_QUEUED_STATS_TAG
  7600. * HTT_STATS_PDEV_RTT_TBR_CMD_RESULT_STATS_TAG
  7601. */
  7602. #ifdef ATH_TARGET
  7603. typedef struct {
  7604. htt_stats_pdev_rtt_resp_stats_tlv pdev_rtt_resp_stats;
  7605. htt_stats_pdev_rtt_hw_stats_tlv pdev_rtt_hw_stats;
  7606. htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv pdev_rtt_tbr_selfgen_queued_stats;
  7607. htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv pdev_rtt_tbr_cmd_result_stats;
  7608. } htt_pdev_rtt_resp_stats_t;
  7609. #endif /* ATH_TARGET */
  7610. typedef struct {
  7611. htt_tlv_hdr_t tlv_hdr;
  7612. A_UINT32 pdev_id;
  7613. /** tx_11mc_ftmr_cnt:
  7614. * Number of 11mc Fine Timing Measurement request frames transmitted
  7615. * successfully.
  7616. */
  7617. A_UINT32 tx_11mc_ftmr_cnt;
  7618. /** tx_11mc_ftmr_fail:
  7619. * Number of 11mc Fine Timing Measurement request frames not transmitted
  7620. * successfully.
  7621. */
  7622. A_UINT32 tx_11mc_ftmr_fail;
  7623. /** tx_11mc_ftmr_suc_retry:
  7624. * Number of 11mc Fine Timing Measurement request frames transmitted
  7625. * successfully after retrying.
  7626. */
  7627. A_UINT32 tx_11mc_ftmr_suc_retry;
  7628. /** rx_11mc_ftm_cnt:
  7629. * Number of 11mc Fine Timing Measurement frames received, including
  7630. * initial, non-initial, and duplicates.
  7631. */
  7632. A_UINT32 rx_11mc_ftm_cnt;
  7633. /** Count of Ranging Measurement requests received from host */
  7634. A_UINT32 tx_meas_req_count;
  7635. /** Initiator role not supported on the vdev */
  7636. A_UINT32 init_role_not_enabled;
  7637. /** Number of times Initiator context got terminated */
  7638. A_UINT32 initiator_terminate_cnt;
  7639. /** Number of times Tx of FTMR failed */
  7640. A_UINT32 tx_11az_ftmr_fail;
  7641. /** tx_11az_ftmr_start:
  7642. * Number of Fine Timing Measurement start requests transmitted
  7643. * successfully.
  7644. */
  7645. A_UINT32 tx_11az_ftmr_start;
  7646. /** tx_11az_ftmr_stop:
  7647. * Number of Fine Timing Measurement stop requests transmitted
  7648. * successfully.
  7649. */
  7650. A_UINT32 tx_11az_ftmr_stop;
  7651. /** Number of FTM frames received successfully */
  7652. A_UINT32 rx_11az_ftm_cnt;
  7653. /** Number of active ISTA sessions */
  7654. A_UINT32 active_ista;
  7655. /** HE preamble not enabled on Initiator side */
  7656. A_UINT32 invalid_preamble;
  7657. /** Initiator invalid channel bw format */
  7658. A_UINT32 invalid_chan_bw_format;
  7659. /* mgmt_buff_alloc_fail_cnt Management Buffer allocation failure count */
  7660. A_UINT32 mgmt_buff_alloc_fail_cnt;
  7661. /** ftm_parse_failure:
  7662. * Count of FTM frame IE parse failure or RSTA sending measurement
  7663. * negotiation failure.
  7664. */
  7665. A_UINT32 ftm_parse_failure;
  7666. /** Count of NTB/TB ranging negotiation completed successfully */
  7667. A_UINT32 ranging_negotiation_successful_cnt;
  7668. /** incompatible_ftm_params:
  7669. * Number of occurrences of failure due to incompatible parameters
  7670. * suggested by rSTA during negotiation.
  7671. */
  7672. A_UINT32 incompatible_ftm_params;
  7673. /** sec_ranging_req_in_open_mode:
  7674. * Number of occurrences of failure if BSS peer exists in open mode and
  7675. * secured mode RTT ranging is requested.
  7676. */
  7677. A_UINT32 sec_ranging_req_in_open_mode;
  7678. /** ftmr_tx_failed_null_11az_peer:
  7679. * Number of occurrences where FTMR was not transmitted as there was
  7680. * no 11AZ peer.
  7681. */
  7682. A_UINT32 ftmr_tx_failed_null_11az_peer;
  7683. /** Number of times ftmr retry timed out */
  7684. A_UINT32 ftmr_retry_timeout;
  7685. /** Number of times the 'max time b/w measurement' timer got expired */
  7686. A_UINT32 max_time_bw_meas_exp_cnt;
  7687. /** tb_meas_duration_expiry_cnt:
  7688. * Number of times TBR measurement duration expired.
  7689. */
  7690. A_UINT32 tb_meas_duration_expiry_cnt;
  7691. /** num_tb_ranging_requests:
  7692. * Number of TB ranging requests ready for negotiation.
  7693. */
  7694. A_UINT32 num_tb_ranging_requests;
  7695. /** Number of times NTB ranging was triggered successfully */
  7696. A_UINT32 ntbr_triggered_successfully;
  7697. /** Number of times NTB ranging failed to be triggered */
  7698. A_UINT32 ntbr_trigger_failed;
  7699. /** No valid index found for programming vreg settings */
  7700. A_UINT32 invalid_or_no_vreg_idx;
  7701. /** Number of times VREG setting failed */
  7702. A_UINT32 set_vreg_params_failed;
  7703. /** Number of occurrences of SAC mismatch */
  7704. A_UINT32 sac_mismatch;
  7705. /** pasn_m1_auth_recv_cnt:
  7706. * Number of M1 auth frames received for PASN from Host.
  7707. */
  7708. A_UINT32 pasn_m1_auth_recv_cnt;
  7709. /** pasn_m1_auth_tx_fail_cnt:
  7710. * Number of M1 auth frames received in FW but Tx failed.
  7711. */
  7712. A_UINT32 pasn_m1_auth_tx_fail_cnt;
  7713. /** pasn_m2_auth_recv_cnt:
  7714. * Number of M2 auth frames received in FW for PASN over the air from rSTA.
  7715. */
  7716. A_UINT32 pasn_m2_auth_recv_cnt;
  7717. /** pasn_m2_auth_drop_cnt:
  7718. * Number of M2 auth frames received in FW but dropped due to any reason.
  7719. */
  7720. A_UINT32 pasn_m2_auth_drop_cnt;
  7721. /** pasn_m3_auth_recv_cnt:
  7722. * Number of M3 auth frames received for PASN from Host.
  7723. */
  7724. A_UINT32 pasn_m3_auth_recv_cnt;
  7725. /** pasn_m3_auth_tx_fail_cnt:
  7726. * Number of M3 auth frames received in FW but Tx failed.
  7727. */
  7728. A_UINT32 pasn_m3_auth_tx_fail_cnt;
  7729. /** pasn_peer_create_request_cnt:
  7730. * Number of times FW requested PASN peer create request to Host.
  7731. */
  7732. A_UINT32 pasn_peer_create_request_cnt;
  7733. /** pasn_peer_create_timeout_cnt:
  7734. * Number of times PASN peer was not created within timeout period.
  7735. */
  7736. A_UINT32 pasn_peer_create_timeout_cnt;
  7737. /** pasn_peer_created_cnt:
  7738. * Number of times Host sent PASN peer create request to FW.
  7739. */
  7740. A_UINT32 pasn_peer_created_cnt;
  7741. /** Number of occurrences of Tx of NDPA failing */
  7742. A_UINT32 ntbr_ndpa_failed;
  7743. /** ntbr_sequence_successful:
  7744. * The NDPA, NDP and LMR exchanges are successful and sched cmd status
  7745. * is 0.
  7746. */
  7747. A_UINT32 ntbr_sequence_successful;
  7748. /** ntbr_ndp_failed:
  7749. * Number of occurrences of NDPA being transmitted successfully
  7750. * but NDP failing for NTB ranging.
  7751. */
  7752. A_UINT32 ntbr_ndp_failed;
  7753. /** sch_cmd_status_cnts:
  7754. * Elements 0-7 count the number of times the sch_cmd_status was equal to
  7755. * the corresponding value of the index of the array sch_cmd_status_cnts[],
  7756. * and element 8 counts the numbers of times the status was some other
  7757. * value >=8.
  7758. */
  7759. A_UINT32 sch_cmd_status_cnts[9];
  7760. /** Number of times LMR reception timed out */
  7761. A_UINT32 lmr_timeout;
  7762. /** Number of LMR frames received */
  7763. A_UINT32 lmr_recv;
  7764. /** Number of trigger frames received */
  7765. A_UINT32 num_trigger_frames_received;
  7766. /** Number of NDPAs received for TBR */
  7767. A_UINT32 num_tb_ranging_NDPAs_recv;
  7768. /** Number of ranging NDPs received for NTBR/TB */
  7769. A_UINT32 ndp_rx_cnt;
  7770. } htt_stats_pdev_rtt_init_stats_tlv;
  7771. /* STATS_TYPE: HTT_DBG_EXT_PDEV_RTT_INITIATOR_STATS
  7772. * TLV_TAGS:
  7773. * HTT_STATS_PDEV_RTT_INIT_STATS_TAG
  7774. * HTT_STATS_PDEV_RTT_HW_STATS_TAG
  7775. */
  7776. #ifdef ATH_TARGET
  7777. typedef struct {
  7778. htt_stats_pdev_rtt_init_stats_tlv pdev_rtt_init_stats;
  7779. htt_stats_pdev_rtt_hw_stats_tlv pdev_rtt_hw_stats;
  7780. } htt_pdev_rtt_init_stats_t;
  7781. #endif /* ATH_TARGET */
  7782. /* STATS_TYPE : HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  7783. * TLV_TAGS:
  7784. * - HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG
  7785. */
  7786. /* NOTE:
  7787. * This structure is for documentation, and cannot be safely used directly.
  7788. * Instead, use the constituent TLV structures to fill/parse.
  7789. */
  7790. typedef struct {
  7791. htt_tlv_hdr_t tlv_hdr;
  7792. /** No of pktlog payloads that were dropped in htt_ppdu_stats path */
  7793. A_UINT32 pktlog_lite_drop_cnt;
  7794. /** No of pktlog payloads that were dropped in TQM path */
  7795. A_UINT32 pktlog_tqm_drop_cnt;
  7796. /** No of pktlog ppdu stats payloads that were dropped */
  7797. A_UINT32 pktlog_ppdu_stats_drop_cnt;
  7798. /** No of pktlog ppdu ctrl payloads that were dropped */
  7799. A_UINT32 pktlog_ppdu_ctrl_drop_cnt;
  7800. /** No of pktlog sw events payloads that were dropped */
  7801. A_UINT32 pktlog_sw_events_drop_cnt;
  7802. } htt_stats_pktlog_and_htt_ring_stats_tlv;
  7803. /* preserve old name alias for new name consistent with the tag name */
  7804. typedef htt_stats_pktlog_and_htt_ring_stats_tlv
  7805. htt_pktlog_and_htt_ring_stats_tlv;
  7806. #define HTT_DLPAGER_STATS_MAX_HIST 10
  7807. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M 0x000000FF
  7808. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S 0
  7809. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M 0x0000FF00
  7810. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S 8
  7811. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_M 0x0000FFFF
  7812. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_S 0
  7813. #define HTT_DLPAGER_TOTAL_FREE_PAGES_M 0xFFFF0000
  7814. #define HTT_DLPAGER_TOTAL_FREE_PAGES_S 16
  7815. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M 0x0000FFFF
  7816. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S 0
  7817. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M 0xFFFF0000
  7818. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S 16
  7819. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var) \
  7820. (((_var) & HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M) >> \
  7821. HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)
  7822. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_ASYNC_LOCK_GET(_var) \
  7823. HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var)
  7824. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  7825. do { \
  7826. HTT_CHECK_SET_VAL(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT, _val); \
  7827. ((_var) &= ~(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M));\
  7828. ((_var) |= ((_val) << HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)); \
  7829. } while (0)
  7830. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var) \
  7831. (((_var) & HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M) >> \
  7832. HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)
  7833. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_SYNC_LOCK_GET(_var) \
  7834. HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var)
  7835. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  7836. do { \
  7837. HTT_CHECK_SET_VAL(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT, _val); \
  7838. ((_var) &= ~(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M));\
  7839. ((_var) |= ((_val) << HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)); \
  7840. } while (0)
  7841. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var) \
  7842. (((_var) & HTT_DLPAGER_TOTAL_LOCKED_PAGES_M) >> \
  7843. HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)
  7844. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_TOTAL_LOCKED_PAGES_GET(_var) \
  7845. HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var)
  7846. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_SET(_var, _val) \
  7847. do { \
  7848. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_LOCKED_PAGES, _val); \
  7849. ((_var) &= ~(HTT_DLPAGER_TOTAL_LOCKED_PAGES_M)); \
  7850. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)); \
  7851. } while (0)
  7852. #define HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var) \
  7853. (((_var) & HTT_DLPAGER_TOTAL_FREE_PAGES_M) >> \
  7854. HTT_DLPAGER_TOTAL_FREE_PAGES_S)
  7855. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_TOTAL_FREE_PAGES_GET(_var) \
  7856. HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var)
  7857. #define HTT_DLPAGER_TOTAL_FREE_PAGES_SET(_var, _val) \
  7858. do { \
  7859. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_FREE_PAGES, _val); \
  7860. ((_var) &= ~(HTT_DLPAGER_TOTAL_FREE_PAGES_M)); \
  7861. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_FREE_PAGES_S)); \
  7862. } while (0)
  7863. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var) \
  7864. (((_var) & HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M) >> \
  7865. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)
  7866. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_LAST_LOCKED_PAGE_IDX_GET(_var) \
  7867. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var)
  7868. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_SET(_var, _val) \
  7869. do { \
  7870. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX, _val); \
  7871. ((_var) &= ~(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M)); \
  7872. ((_var) |= ((_val) << HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)); \
  7873. } while (0)
  7874. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  7875. (((_var) & HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M) >> \
  7876. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)
  7877. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  7878. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var)
  7879. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_SET(_var, _val) \
  7880. do { \
  7881. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX, _val); \
  7882. ((_var) &= ~(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M)); \
  7883. ((_var) |= ((_val) << HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)); \
  7884. } while (0)
  7885. enum {
  7886. HTT_STATS_PAGE_LOCKED = 0,
  7887. HTT_STATS_PAGE_UNLOCKED = 1,
  7888. HTT_STATS_NUM_PAGE_LOCK_STATES
  7889. };
  7890. /* dlPagerStats structure
  7891. * Number of lock/unlock pages with last 10 lock/unlock occurrences are recorded */
  7892. typedef struct{
  7893. /** msg_dword_1 bitfields:
  7894. * async_lock : 8,
  7895. * sync_lock : 8,
  7896. * reserved : 16;
  7897. */
  7898. union {
  7899. struct {
  7900. A_UINT32 async_lock: 8,
  7901. sync_lock: 8,
  7902. reserved1: 16;
  7903. };
  7904. A_UINT32 msg_dword_1;
  7905. };
  7906. /** mst_dword_2 bitfields:
  7907. * total_locked_pages : 16,
  7908. * total_free_pages : 16;
  7909. */
  7910. union {
  7911. struct {
  7912. A_UINT32 total_locked_pages: 16,
  7913. total_free_pages: 16;
  7914. };
  7915. A_UINT32 msg_dword_2;
  7916. };
  7917. /** msg_dword_3 bitfields:
  7918. * last_locked_page_idx : 16,
  7919. * last_unlocked_page_idx : 16;
  7920. */
  7921. union {
  7922. struct {
  7923. A_UINT32 last_locked_page_idx: 16,
  7924. last_unlocked_page_idx: 16;
  7925. };
  7926. A_UINT32 msg_dword_3;
  7927. };
  7928. struct {
  7929. A_UINT32 page_num;
  7930. A_UINT32 num_of_pages;
  7931. /** timestamp is in microsecond units, from SoC timer clock */
  7932. A_UINT32 timestamp_lsbs;
  7933. A_UINT32 timestamp_msbs;
  7934. } last_pages_info[HTT_STATS_NUM_PAGE_LOCK_STATES][HTT_DLPAGER_STATS_MAX_HIST];
  7935. } htt_dl_pager_stats_tlv;
  7936. /* NOTE:
  7937. * This structure is for documentation, and cannot be safely used directly.
  7938. * Instead, use the constituent TLV structures to fill/parse.
  7939. * STATS_TYPE : HTT_DBG_EXT_STATS_DLPAGER_STATS
  7940. * TLV_TAGS:
  7941. * - HTT_STATS_DLPAGER_STATS_TAG
  7942. */
  7943. typedef struct {
  7944. htt_tlv_hdr_t tlv_hdr;
  7945. htt_dl_pager_stats_tlv dl_pager_stats;
  7946. } htt_stats_dlpager_stats_tlv;
  7947. /* preserve old name alias for new name consistent with the tag name */
  7948. typedef htt_stats_dlpager_stats_tlv htt_dlpager_stats_t;
  7949. /*======= PHY STATS ====================*/
  7950. /*
  7951. * STATS TYPE : HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  7952. * TLV_TAGS:
  7953. * - HTT_STATS_PHY_COUNTERS_TAG
  7954. * - HTT_STATS_PHY_STATS_TAG
  7955. */
  7956. #define HTT_MAX_RX_PKT_CNT 8
  7957. #define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
  7958. #define HTT_MAX_PER_BLK_ERR_CNT 20
  7959. #define HTT_MAX_RX_OTA_ERR_CNT 14
  7960. #define HTT_MAX_RX_PKT_CNT_EXT 4
  7961. #define HTT_MAX_RX_PKT_CRC_PASS_CNT_EXT 4
  7962. #define HTT_MAX_RX_PKT_MU_CNT 14
  7963. #define HTT_MAX_TX_PKT_CNT 10
  7964. #define HTT_MAX_PHY_TX_ABORT_CNT 10
  7965. typedef enum {
  7966. HTT_STATS_CHANNEL_HALF_RATE = 0x0001, /* Half rate */
  7967. HTT_STATS_CHANNEL_QUARTER_RATE = 0x0002, /* Quarter rate */
  7968. HTT_STATS_CHANNEL_DFS = 0x0004, /* Enable radar event reporting */
  7969. HTT_STATS_CHANNEL_HOME = 0x0008, /* Home channel */
  7970. HTT_STATS_CHANNEL_PASSIVE_SCAN = 0x0010, /*Passive Scan */
  7971. HTT_STATS_CHANNEL_DFS_SAP_NOT_UP = 0x0020, /* set when VDEV_START_REQUEST, clear when VDEV_UP */
  7972. HTT_STATS_CHANNEL_PASSIVE_SCAN_CAL = 0x0040, /* need to do passive scan calibration to avoid "spikes" */
  7973. HTT_STATS_CHANNEL_DFS_SAP_UP = 0x0080, /* DFS master */
  7974. HTT_STATS_CHANNEL_DFS_CFREQ2 = 0x0100, /* Enable radar event reporting for sec80 in VHT80p80 */
  7975. HTT_STATS_CHANNEL_DTIM_SYNTH = 0x0200, /* Enable DTIM */
  7976. HTT_STATS_CHANNEL_FORCE_GAIN = 0x0400, /* Force gain mmode (only used for FTM) */
  7977. HTT_STATS_CHANNEL_PERFORM_NF_CAL = 0x0800, /* Perform NF cal in channel change (only used for FTM) */
  7978. HTT_STATS_CHANNEL_165_MODE_0 = 0x1000, /* 165 MHz mode 0 */
  7979. HTT_STATS_CHANNEL_165_MODE_1 = 0x2000, /* 165 MHz mode 1 */
  7980. HTT_STATS_CHANNEL_165_MODE_2 = 0x3000, /* 165 MHz mode 2 */
  7981. HTT_STATS_CHANNEL_165_MODE_MASK = 0x3000, /* 165 MHz 2-bit mode mask */
  7982. } HTT_STATS_CHANNEL_FLAGS;
  7983. typedef enum {
  7984. HTT_STATS_RF_MODE_MIN = 0,
  7985. HTT_STATS_RF_MODE_PHYA_ONLY = 0, // only PHYA is active
  7986. HTT_STATS_RF_MODE_DBS = 1, // PHYA/5G and PHYB/2G
  7987. HTT_STATS_RF_MODE_SBS = 2, // PHYA/5G and PHYB/5G in HL/NPR; PHYA0/5G and PHYA1/5G in HK
  7988. HTT_STATS_RF_MODE_PHYB_ONLY = 3, // only PHYB is active
  7989. HTT_STATS_RF_MODE_DBS_SBS = 4, // PHYA0/5G, PHYA1/5G and PHYB/2G in HK (the 2 5G are in different channel)
  7990. HTT_STATS_RF_MODE_DBS_OR_SBS = 5, // PHYA0/5G, PHYA1/5G and PHYB/5G or 2G in HK
  7991. HTT_STATS_RF_MODE_INVALID = 0xff,
  7992. } HTT_STATS_RF_MODE;
  7993. typedef enum {
  7994. HTT_STATS_RESET_CAUSE_FIRST_RESET = 0x00000001, /* First reset by application */
  7995. HTT_STATS_RESET_CAUSE_ERROR = 0x00000002, /* Triggered due to error */
  7996. HTT_STATS_RESET_CAUSE_DEEP_SLEEP = 0x00000004, /* Reset after deep sleep */
  7997. HTT_STATS_RESET_CAUSE_FULL_RESET = 0x00000008, /* Full reset without any optimizations */
  7998. HTT_STATS_RESET_CAUSE_CHANNEL_CHANGE = 0x00000010, /* For normal channel change */
  7999. HTT_STATS_RESET_CAUSE_BAND_CHANGE = 0x00000020, /* Triggered due to band change */
  8000. HTT_STATS_RESET_CAUSE_DO_CAL = 0x00000040, /* Triggered due to calibrations */
  8001. HTT_STATS_RESET_CAUSE_MCI_ERROR = 0x00000080, /* Triggered due to MCI ERROR */
  8002. HTT_STATS_RESET_CAUSE_CHWIDTH_CHANGE = 0x00000100, /* Triggered due to channel width change */
  8003. HTT_STATS_RESET_CAUSE_WARM_RESTORE_CAL = 0x00000200, /* Triggered due to warm reset we want to just restore calibrations */
  8004. HTT_STATS_RESET_CAUSE_COLD_RESTORE_CAL = 0x00000400, /* Triggered due to cold reset we want to just restore calibrations */
  8005. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET = 0x00000800, /* Triggered due to phy warm reset we want to just restore calibrations */
  8006. HTT_STATS_RESET_CAUSE_M3_SSR = 0x00001000, /* Triggered due to SSR Restart */
  8007. HTT_STATS_RESET_CAUSE_FORCE_CAL = 0x00002000, /* Reset to force the calibration */
  8008. /* 0x00004000, 0x00008000 reserved */
  8009. HTT_STATS_NO_RESET_CHANNEL_CHANGE = 0x00010000, /* No reset, normal channel change */
  8010. HTT_STATS_NO_RESET_BAND_CHANGE = 0x00020000, /* No reset, channel change across band */
  8011. HTT_STATS_NO_RESET_CHWIDTH_CHANGE = 0x00040000, /* No reset, channel change across channel width */
  8012. HTT_STATS_NO_RESET_CHAINMASK_CHANGE = 0x00080000, /* No reset, chainmask change */
  8013. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET_UCODE_TRIG = 0x00100000, /* Triggered due to phy warm reset we want to just restore calibrations */
  8014. HTT_STATS_RESET_CAUSE_PHY_OFF_TIMEOUT_RESET = 0x00200000, /* Reset ucode because phy off ack timeout*/
  8015. HTT_STATS_RESET_CAUSE_LMAC_RESET_UMAC_NOC_ERR = 0x00400000, /* LMAC reset triggered due to NOC Address/Slave error originating at LMAC */
  8016. HTT_STATS_NO_RESET_SCAN_BACK_TO_SAME_HOME_CHANNEL_CHANGE = 0x00800000, /* No reset, scan to home channel change */
  8017. } HTT_STATS_RESET_CAUSE;
  8018. typedef enum {
  8019. HTT_CHANNEL_RATE_FULL,
  8020. HTT_CHANNEL_RATE_HALF,
  8021. HTT_CHANNEL_RATE_QUARTER,
  8022. HTT_CHANNEL_RATE_COUNT
  8023. } HTT_CHANNEL_RATE;
  8024. typedef enum {
  8025. HTT_PHY_BW_IDX_20MHz = 0,
  8026. HTT_PHY_BW_IDX_40MHz = 1,
  8027. HTT_PHY_BW_IDX_80MHz = 2,
  8028. HTT_PHY_BW_IDX_80Plus80 = 3,
  8029. HTT_PHY_BW_IDX_160MHz = 4,
  8030. HTT_PHY_BW_IDX_10MHz = 5,
  8031. HTT_PHY_BW_IDX_5MHz = 6,
  8032. HTT_PHY_BW_IDX_165MHz = 7,
  8033. } HTT_PHY_BW_IDX;
  8034. typedef enum {
  8035. HTT_WHAL_CONFIG_NONE = 0x00000000,
  8036. HTT_WHAL_CONFIG_NF_WAR = 0x00000001,
  8037. HTT_WHAL_CONFIG_CAL_WAR = 0x00000002,
  8038. HTT_WHAL_CONFIG_DO_NF_CAL = 0x00000004,
  8039. HTT_WHAL_CONFIG_SET_WAIT_FOR_NF_CAL = 0x00000008,
  8040. HTT_WHAL_CONFIG_FORCED_TX_PWR = 0x00000010,
  8041. HTT_WHAL_CONFIG_FORCED_GAIN_IDX = 0x00000020,
  8042. HTT_WHAL_CONFIG_FORCED_PER_CHAIN = 0x00000040,
  8043. } HTT_WHAL_CONFIG;
  8044. typedef struct {
  8045. htt_tlv_hdr_t tlv_hdr;
  8046. /** number of RXTD OFDMA OTA error counts except power surge and drop */
  8047. A_UINT32 rx_ofdma_timing_err_cnt;
  8048. /** rx_cck_fail_cnt:
  8049. * number of cck error counts due to rx reception failure because of
  8050. * timing error in cck
  8051. */
  8052. A_UINT32 rx_cck_fail_cnt;
  8053. /** number of times tx abort initiated by mac */
  8054. A_UINT32 mactx_abort_cnt;
  8055. /** number of times rx abort initiated by mac */
  8056. A_UINT32 macrx_abort_cnt;
  8057. /** number of times tx abort initiated by phy */
  8058. A_UINT32 phytx_abort_cnt;
  8059. /** number of times rx abort initiated by phy */
  8060. A_UINT32 phyrx_abort_cnt;
  8061. /** number of rx deferred count initiated by phy */
  8062. A_UINT32 phyrx_defer_abort_cnt;
  8063. /** number of sizing events generated at LSTF */
  8064. A_UINT32 rx_gain_adj_lstf_event_cnt; /* a.k.a sizing1 */
  8065. /** number of sizing events generated at non-legacy LTF */
  8066. A_UINT32 rx_gain_adj_non_legacy_cnt; /* a.k.a sizing2 */
  8067. /** rx_pkt_cnt -
  8068. * Received EOP (end-of-packet) count per packet type;
  8069. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  8070. * [6] = EHT; [7]=RSVD; [6] = Applicable only for BE
  8071. */
  8072. A_UINT32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
  8073. /** rx_pkt_crc_pass_cnt -
  8074. * Received EOP (end-of-packet) count per packet type;
  8075. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  8076. * [6] = EHT; [7]=RSVD; [6] = Applicable only for BE
  8077. */
  8078. A_UINT32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
  8079. /** per_blk_err_cnt -
  8080. * Error count per error source;
  8081. * [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
  8082. * [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
  8083. * [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
  8084. * [13-19]=RSVD
  8085. */
  8086. A_UINT32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
  8087. /** rx_ota_err_cnt -
  8088. * RXTD OTA (over-the-air) error count per error reason;
  8089. * [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
  8090. * [3] = cck fail; [4] = power surge; [5] = power drop;
  8091. * [6] = btcf timing timeout error; [7] = btcf packet detect error;
  8092. * [8] = coarse timing timeout error
  8093. * [9-13]=RSVD
  8094. */
  8095. A_UINT32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
  8096. /** rx_pkt_cnt_ext -
  8097. * Received EOP (end-of-packet) count per packet type for BE;
  8098. * [0] = WUR; [1] = AZ; [2-3]=RVSD
  8099. */
  8100. A_UINT32 rx_pkt_cnt_ext[HTT_MAX_RX_PKT_CNT_EXT];
  8101. /** rx_pkt_crc_pass_cnt_ext -
  8102. * Received EOP (end-of-packet) count per packet type for BE;
  8103. * [0] = WUR; [1] = AZ; [2-3]=RVSD
  8104. */
  8105. A_UINT32 rx_pkt_crc_pass_cnt_ext[HTT_MAX_RX_PKT_CRC_PASS_CNT_EXT];
  8106. /** rx_pkt_mu_cnt -
  8107. * RX MU MIMO+OFDMA packet count per packet type for BE;
  8108. * [0] = 11ax OFDMA; [1] = 11ax OFDMA+MUMIMO; [2] = 11be OFDMA;
  8109. * [3] = 11be OFDMA+MUMIMO; [4] = 11ax MIMO; [5] = 11be MIMO;
  8110. * [6] = 11ax OFDMA; [7] = 11ax OFDMA+MUMIMO; [8] = 11be OFDMA;
  8111. * [9] = 11be OFDMA+MUMIMO; [10] = 11ax MIMO; [11] = 11be MIMO;
  8112. * [12-13]=RSVD
  8113. */
  8114. A_UINT32 rx_pkt_mu_cnt[HTT_MAX_RX_PKT_MU_CNT];
  8115. /** tx_pkt_cnt -
  8116. * num of transfered packet count per packet type;
  8117. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF;
  8118. * [6]= EHT; [7] = WUR; [8] = AZ; [9]=RSVD; [6-8] = Applicable only for BE
  8119. */
  8120. A_UINT32 tx_pkt_cnt[HTT_MAX_TX_PKT_CNT];
  8121. /** phy_tx_abort_cnt -
  8122. * phy tx abort after each tlv;
  8123. * [0] = PRE-PHY desc tlv; [1] = PHY desc tlv; [2] = LSIGA tlv;
  8124. * [3] = LSIGB tlv; [4] = Per User tlv; [5] = HESIGB tlv;
  8125. * [6] = Service tlv; [7] = Tx Packet End tlv; [8-9]=RSVD;
  8126. */
  8127. A_UINT32 phy_tx_abort_cnt[HTT_MAX_PHY_TX_ABORT_CNT];
  8128. } htt_stats_phy_counters_tlv;
  8129. /* preserve old name alias for new name consistent with the tag name */
  8130. typedef htt_stats_phy_counters_tlv htt_phy_counters_tlv;
  8131. typedef struct {
  8132. htt_tlv_hdr_t tlv_hdr;
  8133. /** per chain hw noise floor values in dBm */
  8134. A_INT32 nf_chain[HTT_STATS_MAX_CHAINS];
  8135. /** number of false radars detected */
  8136. A_UINT32 false_radar_cnt;
  8137. /** number of channel switches happened due to radar detection */
  8138. A_UINT32 radar_cs_cnt;
  8139. /** ani_level -
  8140. * ANI level (noise interference) corresponds to the channel
  8141. * the desense levels range from -5 to 15 in dB units,
  8142. * higher values indicating more noise interference.
  8143. */
  8144. A_INT32 ani_level;
  8145. /** running time in minutes since FW boot */
  8146. A_UINT32 fw_run_time;
  8147. /** per chain runtime noise floor values in dBm */
  8148. A_INT32 runTime_nf_chain[HTT_STATS_MAX_CHAINS];
  8149. /** DFS SW based progressive stats - start **/
  8150. /* current AP operating bandwidth (refer to WLAN_PHY_MODE) */
  8151. A_UINT32 current_OBW;
  8152. /* current AP device bandwidth (refer to WLAN_PHY_MODE) */
  8153. A_UINT32 current_DBW;
  8154. /* last_radar_type: last detected radar type
  8155. * This last_radar_type field contains a value whose meaning is not
  8156. * exposed to the host; this field is only provided for debug purposes.
  8157. */
  8158. A_UINT32 last_radar_type;
  8159. /* dfs_reg_domain: curent DFS regulatory domain
  8160. * This dfs_reg_domain field contains a value whose meaning is not
  8161. * exposed to the host; this field is only provided for debug purposes.
  8162. */
  8163. A_UINT32 dfs_reg_domain;
  8164. /* radar_mask_bit: Radar mask setting programmed in HW registers.
  8165. * Each bit represents a 20 MHz portion of the channel.
  8166. * Bit 0 represents the highest 20 MHz portion within the channel.
  8167. * For example...
  8168. * For a 80 MHz channel, bit0 = highest 20 MHz, bit3 = lowest 20 MHz
  8169. * For a 320 MHz channel, bit0 = highest 20 MHz, bit15 = lowest 20 MHz
  8170. */
  8171. A_UINT32 radar_mask_bit;
  8172. /* DFS radar rssi threshold (units = dBm) */
  8173. A_INT32 radar_rssi;
  8174. /* DFS global flags (refer to IEEE80211_CHAN_* defines) */
  8175. A_UINT32 radar_dfs_flags;
  8176. /* band center frequency of operating bandwidth (units = MHz) */
  8177. A_UINT32 band_center_frequency_OBW;
  8178. /* band center frequency of device bandwidth (units = MHz) */
  8179. A_UINT32 band_center_frequency_DBW;
  8180. /** DFS SW based progressive stats - end **/
  8181. } htt_stats_phy_stats_tlv;
  8182. /* preserve old name alias for new name consistent with the tag name */
  8183. typedef htt_stats_phy_stats_tlv htt_phy_stats_tlv;
  8184. typedef struct {
  8185. htt_tlv_hdr_t tlv_hdr;
  8186. /** current pdev_id */
  8187. A_UINT32 pdev_id;
  8188. /** current channel information */
  8189. A_UINT32 chan_mhz;
  8190. /** center_freq1, center_freq2 in mhz */
  8191. A_UINT32 chan_band_center_freq1;
  8192. A_UINT32 chan_band_center_freq2;
  8193. /** chan_phy_mode - WLAN_PHY_MODE enum type */
  8194. A_UINT32 chan_phy_mode;
  8195. /** chan_flags follows HTT_STATS_CHANNEL_FLAGS enum */
  8196. A_UINT32 chan_flags;
  8197. /** channel Num updated to virtual phybase */
  8198. A_UINT32 chan_num;
  8199. /** Cause for the phy reset - HTT_STATS_RESET_CAUSE */
  8200. A_UINT32 reset_cause;
  8201. /** Cause for the previous phy reset */
  8202. A_UINT32 prev_reset_cause;
  8203. /** source for the phywarm reset - HTT_STATS_RESET_CAUSE */
  8204. A_UINT32 phy_warm_reset_src;
  8205. /** rxGain Table selection mode - register settings
  8206. * 0 - Auto, 1/2 - Forced with and without BT override respectively
  8207. */
  8208. A_UINT32 rx_gain_tbl_mode;
  8209. /** current xbar value - perchain analog to digital idx mapping */
  8210. A_UINT32 xbar_val;
  8211. /** Flag to indicate forced calibration */
  8212. A_UINT32 force_calibration;
  8213. /** current RF mode (e.g. SBS/DBS) - follows HTT_STATS_RF_MODE enum */
  8214. A_UINT32 phyrf_mode;
  8215. /* PDL phyInput stats */
  8216. /** homechannel flag
  8217. * 1- Homechan, 0 - scan channel
  8218. */
  8219. A_UINT32 phy_homechan;
  8220. /** Tx and Rx chainmask */
  8221. A_UINT32 phy_tx_ch_mask;
  8222. A_UINT32 phy_rx_ch_mask;
  8223. /** INI masks - to decide the INI registers to be loaded on a reset */
  8224. A_UINT32 phybb_ini_mask;
  8225. A_UINT32 phyrf_ini_mask;
  8226. /** DFS,ADFS/Spectral scan enable masks */
  8227. A_UINT32 phy_dfs_en_mask;
  8228. A_UINT32 phy_sscan_en_mask;
  8229. A_UINT32 phy_synth_sel_mask;
  8230. A_UINT32 phy_adfs_freq;
  8231. /** CCK FIR settings
  8232. * register settings - filter coefficients for Iqs conversion
  8233. * [31:24] = FIR_COEFF_3_0
  8234. * [23:16] = FIR_COEFF_2_0
  8235. * [15:8] = FIR_COEFF_1_0
  8236. * [7:0] = FIR_COEFF_0_0
  8237. */
  8238. A_UINT32 cck_fir_settings;
  8239. /** dynamic primary channel index
  8240. * primary 20MHz channel index on the current channel BW
  8241. */
  8242. A_UINT32 phy_dyn_pri_chan;
  8243. /**
  8244. * Current CCA detection threshold
  8245. * dB above noisefloor req for CCA
  8246. * Register settings for all subbands
  8247. */
  8248. A_UINT32 cca_thresh;
  8249. /**
  8250. * status for dynamic CCA adjustment
  8251. * 0-disabled, 1-enabled
  8252. */
  8253. A_UINT32 dyn_cca_status;
  8254. /** RXDEAF Register value
  8255. * rxdesense_thresh_sw - VREG Register
  8256. * rxdesense_thresh_hw - PHY Register
  8257. */
  8258. A_UINT32 rxdesense_thresh_sw;
  8259. A_UINT32 rxdesense_thresh_hw;
  8260. /** Current PHY Bandwidth -
  8261. * values are specified by the HTT_PHY_BW_IDX enum type
  8262. */
  8263. A_UINT32 phy_bw_code;
  8264. /** Current channel operating rate -
  8265. * values are specified by the HTT_CHANNEL_RATE enum type
  8266. */
  8267. A_UINT32 phy_rate_mode;
  8268. /** current channel operating band
  8269. * 0 - 5G; 1 - 2G; 2 -6G
  8270. */
  8271. A_UINT32 phy_band_code;
  8272. /** microcode processor virtual phy base address -
  8273. * provided only for debug
  8274. */
  8275. A_UINT32 phy_vreg_base;
  8276. /** microcode processor virtual phy base ext address -
  8277. * provided only for debug
  8278. */
  8279. A_UINT32 phy_vreg_base_ext;
  8280. /** HW LUT table configuration for home/scan channel -
  8281. * provided only for debug
  8282. */
  8283. A_UINT32 cur_table_index;
  8284. /** SW configuration flag for PHY reset and Calibrations -
  8285. * values are specified by the HTT_WHAL_CONFIG enum type
  8286. */
  8287. A_UINT32 whal_config_flag;
  8288. /** nfcal_iteration_counts:
  8289. * iteration count for Home/Scan/Periodic Noise Floor calibrations
  8290. * nfcal_iteration_counts[0] - home NF iteration counter
  8291. * nfcal_iteration_counts[1] - scan NF iteration counter
  8292. * nfcal_iteration_counts[2] - periodic NF iteration counter
  8293. * These counters are not reset automatically; they are only reset
  8294. * when explicitly requested by the host.
  8295. */
  8296. A_UINT32 nfcal_iteration_counts[3];
  8297. } htt_stats_phy_reset_stats_tlv;
  8298. /* preserve old name alias for new name consistent with the tag name */
  8299. typedef htt_stats_phy_reset_stats_tlv htt_phy_reset_stats_tlv;
  8300. typedef struct {
  8301. htt_tlv_hdr_t tlv_hdr;
  8302. /** current pdev_id */
  8303. A_UINT32 pdev_id;
  8304. /** ucode PHYOFF pass/failure count */
  8305. A_UINT32 cf_active_low_fail_cnt;
  8306. A_UINT32 cf_active_low_pass_cnt;
  8307. /** PHYOFF count attempted through ucode VREG */
  8308. A_UINT32 phy_off_through_vreg_cnt;
  8309. /** Force calibration count */
  8310. A_UINT32 force_calibration_cnt;
  8311. /** phyoff count during rfmode switch */
  8312. A_UINT32 rf_mode_switch_phy_off_cnt;
  8313. /** Temperature based recalibration count */
  8314. A_UINT32 temperature_recal_cnt;
  8315. } htt_stats_phy_reset_counters_tlv;
  8316. /* preserve old name alias for new name consistent with the tag name */
  8317. typedef htt_stats_phy_reset_counters_tlv htt_phy_reset_counters_tlv;
  8318. /* Considering 320 MHz maximum 16 power levels */
  8319. #define HTT_MAX_CH_PWR_INFO_SIZE 16
  8320. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_M 0x000000ff
  8321. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_S 0
  8322. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var) \
  8323. (((_var) & HTT_PHY_TPC_STATS_CTL_REGION_GRP_M) >> \
  8324. HTT_PHY_TPC_STATS_CTL_REGION_GRP_S)
  8325. /* provide properly-named macro */
  8326. #define HTT_STATS_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var) \
  8327. HTT_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var)
  8328. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_SET(_var, _val) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_CTL_REGION_GRP, _val); \
  8331. ((_var) &= ~(HTT_PHY_TPC_STATS_CTL_REGION_GRP_M)); \
  8332. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_CTL_REGION_GRP_S)); \
  8333. } while (0)
  8334. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M 0x0000ff00
  8335. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S 8
  8336. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var) \
  8337. (((_var) & HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M) >> \
  8338. HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S)
  8339. /* provide properly-named macro */
  8340. #define HTT_STATS_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var) \
  8341. HTT_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var)
  8342. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_SET(_var, _val) \
  8343. do { \
  8344. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_SUB_BAND_INDEX, _val); \
  8345. ((_var) &= ~(HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M)); \
  8346. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S)); \
  8347. } while (0)
  8348. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M 0x00ff0000
  8349. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S 16
  8350. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_GET(_var) \
  8351. (((_var) & HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M) >> \
  8352. HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S)
  8353. /* provide properly-named macro */
  8354. #define HTT_STATS_PHY_TPC_STATS_ARRAY_GAIN_CAP_EXT2_ENABLED_GET(_var) \
  8355. HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_GET(_var)
  8356. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_SET(_var, _val) \
  8357. do { \
  8358. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED, _val); \
  8359. ((_var) &= ~(HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M)); \
  8360. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S)); \
  8361. } while (0)
  8362. #define HTT_PHY_TPC_STATS_CTL_FLAG_M 0xff000000
  8363. #define HTT_PHY_TPC_STATS_CTL_FLAG_S 24
  8364. #define HTT_PHY_TPC_STATS_CTL_FLAG_GET(_var) \
  8365. (((_var) & HTT_PHY_TPC_STATS_CTL_FLAG_M) >> \
  8366. HTT_PHY_TPC_STATS_CTL_FLAG_S)
  8367. /* provide properly-named macro */
  8368. #define HTT_STATS_PHY_TPC_STATS_CTL_FLAG_GET(_var) \
  8369. HTT_PHY_TPC_STATS_CTL_FLAG_GET(_var)
  8370. #define HTT_PHY_TPC_STATS_CTL_FLAG_SET(_var, _val) \
  8371. do { \
  8372. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_CTL_FLAG, _val); \
  8373. ((_var) &= ~(HTT_PHY_TPC_STATS_CTL_FLAG_M)); \
  8374. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_CTL_FLAG_S)); \
  8375. } while (0)
  8376. typedef struct {
  8377. htt_tlv_hdr_t tlv_hdr;
  8378. /** current pdev_id */
  8379. A_UINT32 pdev_id;
  8380. /** Tranmsit power control scaling related configurations */
  8381. A_UINT32 tx_power_scale;
  8382. A_UINT32 tx_power_scale_db;
  8383. /** Minimum negative tx power supported by the target */
  8384. A_INT32 min_negative_tx_power;
  8385. /** current configured CTL domain */
  8386. A_UINT32 reg_ctl_domain;
  8387. /** Regulatory power information for the current channel */
  8388. A_INT32 max_reg_allowed_power[HTT_STATS_MAX_CHAINS];
  8389. A_INT32 max_reg_allowed_power_6g[HTT_STATS_MAX_CHAINS];
  8390. /** channel max regulatory power in 0.5dB */
  8391. A_UINT32 twice_max_rd_power;
  8392. /** current channel and home channel's maximum possible tx power */
  8393. A_INT32 max_tx_power;
  8394. A_INT32 home_max_tx_power;
  8395. /** channel's Power Spectral Density */
  8396. A_UINT32 psd_power;
  8397. /** channel's EIRP power */
  8398. A_UINT32 eirp_power;
  8399. /** 6G channel power mode
  8400. * 0-LPI, 1-SP, 2-VLPI and 3-SP_CLIENT power mode
  8401. */
  8402. A_UINT32 power_type_6ghz;
  8403. /** sub-band channels and corresponding Tx-power */
  8404. A_UINT32 sub_band_cfreq[HTT_MAX_CH_PWR_INFO_SIZE];
  8405. A_UINT32 sub_band_txpower[HTT_MAX_CH_PWR_INFO_SIZE];
  8406. /** array_gain_cap:
  8407. * CTL Array Gain cap, units are dB
  8408. * The lower-triangular portion of this square matrix is stored, i.e.
  8409. * array element 0 stores matrix element (0,0)
  8410. * array element 1 stores matrix element (1,0)
  8411. * array element 2 stores matrix element (1,1)
  8412. * array element 3 stores matrix element (2,0)
  8413. * ...
  8414. * array element 35 stores matrix element (7,7)
  8415. */
  8416. A_INT32 array_gain_cap[HTT_STATS_MAX_CHAINS * ((HTT_STATS_MAX_CHAINS/2)+1)];
  8417. union {
  8418. struct {
  8419. A_UINT32
  8420. ctl_region_grp:8, /** Group to which the ctl region belongs */
  8421. sub_band_index:8, /** Frequency subband index */
  8422. /** Array Gain Cap Ext2 feature enablement status */
  8423. array_gain_cap_ext2_enabled:8,
  8424. /** ctl_flag:
  8425. * 1st bit ULOFDMA supported
  8426. * 2nd bit DLOFDMA shared Exception supported
  8427. */
  8428. ctl_flag:8;
  8429. };
  8430. A_UINT32 ctl_args;
  8431. };
  8432. } htt_stats_phy_tpc_stats_tlv;
  8433. /* preserve old name alias for new name consistent with the tag name */
  8434. typedef htt_stats_phy_tpc_stats_tlv htt_phy_tpc_stats_tlv;
  8435. /* NOTE:
  8436. * This structure is for documentation, and cannot be safely used directly.
  8437. * Instead, use the constituent TLV structures to fill/parse.
  8438. */
  8439. #ifdef ATH_TARGET
  8440. typedef struct {
  8441. htt_stats_phy_counters_tlv phy_counters;
  8442. htt_stats_phy_stats_tlv phy_stats;
  8443. htt_stats_phy_reset_counters_tlv phy_reset_counters;
  8444. htt_stats_phy_reset_stats_tlv phy_reset_stats;
  8445. htt_stats_phy_tpc_stats_tlv phy_tpc_stats;
  8446. } htt_phy_counters_and_phy_stats_t;
  8447. #endif /* ATH_TARGET */
  8448. /* NOTE:
  8449. * This structure is for documentation, and cannot be safely used directly.
  8450. * Instead, use the constituent TLV structures to fill/parse.
  8451. */
  8452. #ifdef ATH_TARGET
  8453. typedef struct {
  8454. htt_stats_soc_txrx_stats_common_tlv soc_common_stats;
  8455. htt_stats_vdev_txrx_stats_hw_stats_tlv vdev_hw_stats[1/*or more*/];
  8456. } htt_vdevs_txrx_stats_t;
  8457. #endif /* ATH_TARGET */
  8458. typedef struct {
  8459. union {
  8460. A_UINT32 word32;
  8461. struct {
  8462. A_UINT32
  8463. success: 16,
  8464. fail: 16;
  8465. };
  8466. };
  8467. } htt_stats_strm_gen_mpdus_cntr_t;
  8468. typedef struct {
  8469. /* MSDU queue identification */
  8470. union {
  8471. A_UINT32 word32;
  8472. struct {
  8473. A_UINT32
  8474. peer_id: 16,
  8475. tid: 4, /* only TIDs 0-7 actually expected to be used */
  8476. htt_qtype: 4, /* refer to HTT_MSDUQ_INDEX */
  8477. reserved: 8;
  8478. };
  8479. };
  8480. } htt_stats_strm_msdu_queue_id;
  8481. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_PEER_ID_GET(word) \
  8482. ((word >> 0) & 0xffff)
  8483. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_TID_GET(word) \
  8484. ((word >> 16) & 0xf)
  8485. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_HTT_QTYPE_GET(word) \
  8486. ((word >> 20) & 0xf)
  8487. #define HTT_STATS_STRM_GEN_MPDUS_SVC_INTERVAL_SUCCESS_GET(word) \
  8488. ((word >> 0) & 0xffff)
  8489. #define HTT_STATS_STRM_GEN_MPDUS_SVC_INTERVAL_FAIL_GET(word) \
  8490. ((word >> 16) & 0xffff)
  8491. #define HTT_STATS_STRM_GEN_MPDUS_BURST_SIZE_SUCCESS_GET(word) \
  8492. ((word >> 0) & 0xffff)
  8493. #define HTT_STATS_STRM_GEN_MPDUS_BURST_SIZE_FAIL_GET(word) \
  8494. ((word >> 16) & 0xffff)
  8495. typedef struct {
  8496. htt_tlv_hdr_t tlv_hdr;
  8497. htt_stats_strm_msdu_queue_id queue_id;
  8498. htt_stats_strm_gen_mpdus_cntr_t svc_interval;
  8499. htt_stats_strm_gen_mpdus_cntr_t burst_size;
  8500. } htt_stats_strm_gen_mpdus_tlv;
  8501. /* preserve old name alias for new name consistent with the tag name */
  8502. typedef htt_stats_strm_gen_mpdus_tlv htt_stats_strm_gen_mpdus_tlv_t;
  8503. typedef struct {
  8504. htt_tlv_hdr_t tlv_hdr;
  8505. htt_stats_strm_msdu_queue_id queue_id;
  8506. struct {
  8507. union {
  8508. A_UINT32 timestamp_prior__timestamp_now__word;
  8509. struct {
  8510. A_UINT32
  8511. timestamp_prior_ms: 16,
  8512. timestamp_now_ms: 16;
  8513. };
  8514. };
  8515. union {
  8516. A_UINT32 interval_spec__margin__word;
  8517. struct {
  8518. A_UINT32
  8519. interval_spec_ms: 16,
  8520. margin_ms: 16;
  8521. };
  8522. };
  8523. } svc_interval;
  8524. struct {
  8525. union {
  8526. A_UINT32 consumed_bytes_orig__consumed_bytes_final__word;
  8527. struct {
  8528. A_UINT32
  8529. /* consumed_bytes_orig:
  8530. * Raw count (actually estimate) of how many bytes were
  8531. * removed from the MSDU queue by the GEN_MPDUS operation.
  8532. */
  8533. consumed_bytes_orig: 16,
  8534. /* consumed_bytes_final:
  8535. * Adjusted count of removed bytes that incorporates
  8536. * normalizing by the actual service interval compared to
  8537. * the expected service interval.
  8538. * This allows the burst size computation to be independent
  8539. * of whether the target is doing GEN_MPDUS at only the
  8540. * service interval, or substantially more often than the
  8541. * service interval.
  8542. * consumed_bytes_final = consumed_bytes_orig /
  8543. * (svc_interval / ref_svc_interval)
  8544. */
  8545. consumed_bytes_final: 16;
  8546. };
  8547. };
  8548. union {
  8549. A_UINT32 remaining_bytes__word;
  8550. struct {
  8551. A_UINT32
  8552. remaining_bytes: 16,
  8553. reserved: 16;
  8554. };
  8555. };
  8556. union {
  8557. A_UINT32 burst_size_spec__margin_bytes__word;
  8558. struct {
  8559. A_UINT32
  8560. burst_size_spec: 16,
  8561. margin_bytes: 16;
  8562. };
  8563. };
  8564. } burst_size;
  8565. } htt_stats_strm_gen_mpdus_details_tlv;
  8566. /* preserve old name alias for new name consistent with the tag name */
  8567. typedef htt_stats_strm_gen_mpdus_details_tlv
  8568. htt_stats_strm_gen_mpdus_details_tlv_t;
  8569. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_PEER_ID_GET(word) \
  8570. ((word >> 0) & 0xffff)
  8571. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_TID_GET(word) \
  8572. ((word >> 16) & 0xf)
  8573. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_HTT_QTYPE_GET(word) \
  8574. ((word >> 20) & 0xf)
  8575. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_TIMESTAMP_PRIOR_MS_GET(word) \
  8576. ((word >> 0) & 0xffff)
  8577. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_TIMESTAMP_NOW_MS_GET(word) \
  8578. ((word >> 16) & 0xffff)
  8579. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_INTERVAL_SPEC_MS_GET(word) \
  8580. ((word >> 0) & 0xffff)
  8581. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_MARGIN_MS_GET(word) \
  8582. ((word >> 16) & 0xffff)
  8583. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_CONSUMED_BYTES_ORIG_GET(word) \
  8584. ((word >> 0) & 0xffff)
  8585. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_CONSUMED_BYTES_FINAL_GET(word) \
  8586. ((word >> 16) & 0xffff)
  8587. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_REMAINING_BYTES_GET(word) \
  8588. ((word >> 0) & 0xffff)
  8589. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_BURST_SIZE_SPEC_GET(word) \
  8590. ((word >> 0) & 0xffff)
  8591. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_MARGIN_BYTES_GET(word) \
  8592. ((word >> 16) & 0xffff)
  8593. typedef struct {
  8594. htt_tlv_hdr_t tlv_hdr;
  8595. A_UINT32 reset_count;
  8596. /** lower portion (bits 31:0) of reset time, in milliseconds */
  8597. A_UINT32 reset_time_lo_ms;
  8598. /** upper portion (bits 63:32) of reset time, in milliseconds */
  8599. A_UINT32 reset_time_hi_ms;
  8600. /** lower portion (bits 31:0) of disengage time, in milliseconds */
  8601. A_UINT32 disengage_time_lo_ms;
  8602. /** upper portion (bits 63:32) of disengage time, in milliseconds */
  8603. A_UINT32 disengage_time_hi_ms;
  8604. /** lower portion (bits 31:0) of engage time, in milliseconds */
  8605. A_UINT32 engage_time_lo_ms;
  8606. /** upper portion (bits 63:32) of engage time, in milliseconds */
  8607. A_UINT32 engage_time_hi_ms;
  8608. A_UINT32 disengage_count;
  8609. A_UINT32 engage_count;
  8610. A_UINT32 drain_dest_ring_mask;
  8611. } htt_stats_dmac_reset_stats_tlv;
  8612. /* preserve old name alias for new name consistent with the tag name */
  8613. typedef htt_stats_dmac_reset_stats_tlv htt_dmac_reset_stats_tlv;
  8614. /* Support up to 640 MHz mode for future expansion */
  8615. #define HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT 32
  8616. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_M 0x000000ff
  8617. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_S 0
  8618. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_GET(_var) \
  8619. (((_var) & HTT_PDEV_PUNCTURE_STATS_MAC_ID_M) >> \
  8620. HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)
  8621. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_SET(_var, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_PDEV_PUNCTURE_STATS_MAC_ID, _val); \
  8624. ((_var) |= ((_val) << HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)); \
  8625. } while (0)
  8626. /*
  8627. * TLV used to provide puncturing related stats for TX/RX and each PPDU type.
  8628. */
  8629. typedef struct {
  8630. htt_tlv_hdr_t tlv_hdr;
  8631. /**
  8632. * BIT [ 7 : 0] :- mac_id
  8633. * BIT [31 : 8] :- reserved
  8634. */
  8635. union {
  8636. struct {
  8637. A_UINT32 mac_id: 8,
  8638. reserved: 24;
  8639. };
  8640. A_UINT32 mac_id__word;
  8641. };
  8642. /*
  8643. * Stats direction (TX/RX). Enum value from HTT_STATS_DIRECTION.
  8644. */
  8645. A_UINT32 direction;
  8646. /*
  8647. * Preamble type. Enum value from HTT_STATS_PREAM_TYPE.
  8648. *
  8649. * Note that for although OFDM rates don't technically support
  8650. * "puncturing", this TLV can be used to indicate the 20 MHz sub-bands
  8651. * utilized for OFDM legacy duplicate packets, which are also used during
  8652. * puncturing sequences.
  8653. */
  8654. A_UINT32 preamble;
  8655. /*
  8656. * Stats PPDU type. Enum value from HTT_STATS_PPDU_TYPE.
  8657. */
  8658. A_UINT32 ppdu_type;
  8659. /*
  8660. * Indicates the number of valid elements in the
  8661. * "num_subbands_used_cnt" array, and must be <=
  8662. * HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT.
  8663. *
  8664. * Also indicates how many bits in the last_used_pattern_mask may be
  8665. * non-zero.
  8666. */
  8667. A_UINT32 subband_count;
  8668. /*
  8669. * The last used transmit 20 MHz subband mask. Bit 0 represents the lowest
  8670. * 20 MHz subband mask, bit 1 the second lowest, and so on.
  8671. *
  8672. * All 32 bits are valid and will be used for expansion to higher BW modes.
  8673. */
  8674. A_UINT32 last_used_pattern_mask;
  8675. /*
  8676. * Number of array elements with valid values is equal to "subband_count".
  8677. * If subband_count is < HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT, the
  8678. * remaining elements will be implicitly set to 0x0.
  8679. *
  8680. * The array index is the number of 20 MHz subbands utilized during TX/RX,
  8681. * and the counter value at that index is the number of times that subband
  8682. * count was used.
  8683. *
  8684. * The count is incremented once for each OTA PPDU transmitted / received.
  8685. */
  8686. A_UINT32 num_subbands_used_cnt[HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT];
  8687. } htt_stats_pdev_puncture_stats_tlv;
  8688. /* preserve old name alias for new name consistent with the tag name */
  8689. typedef htt_stats_pdev_puncture_stats_tlv htt_pdev_puncture_stats_tlv;
  8690. #define HTT_STATS_PDEV_PUNCTURE_STATS_MAC_ID_GET(word) ((word >> 0) & 0xff)
  8691. enum {
  8692. HTT_STATS_CAL_PROF_COLD_BOOT = 0,
  8693. HTT_STATS_CAL_PROF_FULL_CHAN_SWITCH = 1,
  8694. HTT_STATS_CAL_PROF_SCAN_CHAN_SWITCH = 2,
  8695. HTT_STATS_CAL_PROF_DPD_SPLIT_CAL = 3,
  8696. HTT_STATS_MAX_PROF_CAL = 4,
  8697. };
  8698. #define HTT_STATS_MAX_CAL_IDX_CNT 8
  8699. typedef struct { /* DEPRECATED */
  8700. htt_tlv_hdr_t tlv_hdr;
  8701. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  8702. /** To verify whether prof cal is enabled or not */
  8703. A_UINT32 enable;
  8704. /** current pdev_id */
  8705. A_UINT32 pdev_id;
  8706. /** The cnt is incremented when each time the calindex takes place */
  8707. A_UINT32 cnt[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8708. /** Minimum time taken to complete the calibration - in us */
  8709. A_UINT32 min[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8710. /** Maximum time taken to complete the calibration -in us */
  8711. A_UINT32 max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8712. /** Time taken by the cal for its final time execution - in us */
  8713. A_UINT32 last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8714. /** Total time taken - in us */
  8715. A_UINT32 tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8716. /** hist_intvl - by default will be set to 2000 us */
  8717. A_UINT32 hist_intvl[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8718. /**
  8719. * If last is less than hist_intvl, then hist[0]++,
  8720. * If last is less than hist_intvl << 1, then hist[1]++,
  8721. * otherwise hist[2]++.
  8722. */
  8723. A_UINT32 hist[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT][HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  8724. /** Pf_last will log the current no of page faults */
  8725. A_UINT32 pf_last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8726. /** Sum of all page faults happened */
  8727. A_UINT32 pf_tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8728. /** If pf_last > pf_max then pf_max = pf_last */
  8729. A_UINT32 pf_max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8730. /**
  8731. * For each cal profile, only certain no of cal indices were invoked,
  8732. * this member will store what all the indices got invoked per each
  8733. * cal profile
  8734. */
  8735. A_UINT32 enabledCalIdx[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8736. /** No of indices invoked per each cal profile */
  8737. A_UINT32 CalCnt[HTT_STATS_MAX_PROF_CAL];
  8738. } htt_stats_latency_prof_cal_stats_tlv; /* DEPRECATED */
  8739. /* preserve old name alias for new name consistent with the tag name */
  8740. typedef htt_stats_latency_prof_cal_stats_tlv htt_latency_prof_cal_stats_tlv; /* DEPRECATED */
  8741. typedef struct {
  8742. /** The cnt is incremented when each time the calindex takes place */
  8743. A_UINT32 cnt;
  8744. /** Minimum time taken to complete the calibration - in us */
  8745. A_UINT32 min;
  8746. /** Maximum time taken to complete the calibration -in us */
  8747. A_UINT32 max;
  8748. /** Time taken by the cal for its final time execution - in us */
  8749. A_UINT32 last;
  8750. /** Total time taken - in us */
  8751. A_UINT32 tot;
  8752. /** hist_intvl - in us, by default will be set to 2000 us */
  8753. A_UINT32 hist_intvl;
  8754. /**
  8755. * If last is less than hist_intvl, then hist[0]++,
  8756. * If last is less than hist_intvl << 1, then hist[1]++,
  8757. * otherwise hist[2]++.
  8758. */
  8759. A_UINT32 hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  8760. /** pf_last will log the current no of page faults */
  8761. A_UINT32 pf_last;
  8762. /** Sum of all page faults happened */
  8763. A_UINT32 pf_tot;
  8764. /** If pf_last > pf_max then pf_max = pf_last */
  8765. A_UINT32 pf_max;
  8766. /**
  8767. * For each cal profile, only certain no of cal indices were invoked,
  8768. * this member will store what all the indices got invoked per each
  8769. * cal profile
  8770. */
  8771. A_UINT32 enabled_cal_idx;
  8772. /*
  8773. * NOTE: due to backwards-compatibility requirements,
  8774. * no fields can be added to this struct.
  8775. */
  8776. } htt_stats_latency_prof_cal_data;
  8777. typedef struct {
  8778. htt_tlv_hdr_t tlv_hdr;
  8779. /** To verify whether prof cal is enabled or not */
  8780. A_UINT32 enable;
  8781. /** current pdev_id */
  8782. A_UINT32 pdev_id;
  8783. /** No of indices invoked per each cal profile */
  8784. A_UINT32 cal_cnt[HTT_STATS_MAX_PROF_CAL];
  8785. /** Latency Cal Profile name */
  8786. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  8787. /** Latency Cal data */
  8788. htt_stats_latency_prof_cal_data latency_data[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  8789. } htt_stats_latency_prof_cal_data_tlv;
  8790. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M 0x0000003F
  8791. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S 0
  8792. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M 0x00000FC0
  8793. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S 6
  8794. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M 0x0FFFF000
  8795. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S 12
  8796. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var) \
  8797. (((_var) & HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M) >> \
  8798. HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)
  8799. /* provide properly-named macro */
  8800. #define HTT_STATS_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var) \
  8801. HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var)
  8802. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_SET(_var, _val) \
  8803. do { \
  8804. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD, _val); \
  8805. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M)); \
  8806. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)); \
  8807. } while (0)
  8808. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var) \
  8809. (((_var) & HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M) >> \
  8810. HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)
  8811. /* provide properly-named macro */
  8812. #define HTT_STATS_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var) \
  8813. HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var)
  8814. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_SET(_var, _val) \
  8815. do { \
  8816. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD, _val); \
  8817. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M)); \
  8818. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)); \
  8819. } while (0)
  8820. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var) \
  8821. (((_var) & HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M) >> \
  8822. HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)
  8823. /* provide properly-named macro */
  8824. #define HTT_STATS_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var) \
  8825. HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var)
  8826. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_SET(_var, _val) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX, _val); \
  8829. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M)); \
  8830. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)); \
  8831. } while (0)
  8832. typedef struct {
  8833. htt_tlv_hdr_t tlv_hdr;
  8834. union {
  8835. struct {
  8836. A_UINT32 peer_assoc_ipc_recvd : 6,
  8837. sched_peer_delete_recvd : 6,
  8838. mld_ast_index : 16,
  8839. reserved : 4;
  8840. };
  8841. A_UINT32 msg_dword_1;
  8842. };
  8843. } htt_stats_ml_peer_ext_details_tlv;
  8844. /* preserve old name alias for new name consistent with the tag name */
  8845. typedef htt_stats_ml_peer_ext_details_tlv htt_ml_peer_ext_details_tlv;
  8846. #define HTT_ML_LINK_INFO_VALID_M 0x00000001
  8847. #define HTT_ML_LINK_INFO_VALID_S 0
  8848. #define HTT_ML_LINK_INFO_ACTIVE_M 0x00000002
  8849. #define HTT_ML_LINK_INFO_ACTIVE_S 1
  8850. #define HTT_ML_LINK_INFO_PRIMARY_M 0x00000004
  8851. #define HTT_ML_LINK_INFO_PRIMARY_S 2
  8852. #define HTT_ML_LINK_INFO_ASSOC_LINK_M 0x00000008
  8853. #define HTT_ML_LINK_INFO_ASSOC_LINK_S 3
  8854. #define HTT_ML_LINK_INFO_CHIP_ID_M 0x00000070
  8855. #define HTT_ML_LINK_INFO_CHIP_ID_S 4
  8856. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_M 0x00007F80
  8857. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_S 7
  8858. #define HTT_ML_LINK_INFO_HW_LINK_ID_M 0x00038000
  8859. #define HTT_ML_LINK_INFO_HW_LINK_ID_S 15
  8860. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M 0x000C0000
  8861. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S 18
  8862. #define HTT_ML_LINK_INFO_MASTER_LINK_M 0x00100000
  8863. #define HTT_ML_LINK_INFO_MASTER_LINK_S 20
  8864. #define HTT_ML_LINK_INFO_ANCHOR_LINK_M 0x00200000
  8865. #define HTT_ML_LINK_INFO_ANCHOR_LINK_S 21
  8866. #define HTT_ML_LINK_INFO_INITIALIZED_M 0x00400000
  8867. #define HTT_ML_LINK_INFO_INITIALIZED_S 22
  8868. #define HTT_ML_LINK_INFO_SW_PEER_ID_M 0x0000ffff
  8869. #define HTT_ML_LINK_INFO_SW_PEER_ID_S 0
  8870. #define HTT_ML_LINK_INFO_VDEV_ID_M 0x00ff0000
  8871. #define HTT_ML_LINK_INFO_VDEV_ID_S 16
  8872. #define HTT_ML_LINK_INFO_VALID_GET(_var) \
  8873. (((_var) & HTT_ML_LINK_INFO_VALID_M) >> \
  8874. HTT_ML_LINK_INFO_VALID_S)
  8875. /* provide properly-named macro */
  8876. #define HTT_STATS_ML_LINK_INFO_DETAILS_VALID_GET(_var) \
  8877. HTT_ML_LINK_INFO_VALID_GET(_var)
  8878. #define HTT_ML_LINK_INFO_VALID_SET(_var, _val) \
  8879. do { \
  8880. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VALID, _val); \
  8881. ((_var) &= ~(HTT_ML_LINK_INFO_VALID_M)); \
  8882. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VALID_S)); \
  8883. } while (0)
  8884. #define HTT_ML_LINK_INFO_ACTIVE_GET(_var) \
  8885. (((_var) & HTT_ML_LINK_INFO_ACTIVE_M) >> \
  8886. HTT_ML_LINK_INFO_ACTIVE_S)
  8887. /* provide properly-named macro */
  8888. #define HTT_STATS_ML_LINK_INFO_DETAILS_ACTIVE_GET(_var) \
  8889. HTT_ML_LINK_INFO_ACTIVE_GET(_var)
  8890. #define HTT_ML_LINK_INFO_ACTIVE_SET(_var, _val) \
  8891. do { \
  8892. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ACTIVE, _val); \
  8893. ((_var) &= ~(HTT_ML_LINK_INFO_ACTIVE_M)); \
  8894. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ACTIVE_S)); \
  8895. } while (0)
  8896. #define HTT_ML_LINK_INFO_PRIMARY_GET(_var) \
  8897. (((_var) & HTT_ML_LINK_INFO_PRIMARY_M) >> \
  8898. HTT_ML_LINK_INFO_PRIMARY_S)
  8899. /* provide properly-named macro */
  8900. #define HTT_STATS_ML_LINK_INFO_DETAILS_PRIMARY_GET(_var) \
  8901. HTT_ML_LINK_INFO_PRIMARY_GET(_var)
  8902. #define HTT_ML_LINK_INFO_PRIMARY_SET(_var, _val) \
  8903. do { \
  8904. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_PRIMARY, _val); \
  8905. ((_var) &= ~(HTT_ML_LINK_INFO_PRIMARY_M)); \
  8906. ((_var) |= ((_val) << HTT_ML_LINK_INFO_PRIMARY_S)); \
  8907. } while (0)
  8908. #define HTT_ML_LINK_INFO_ASSOC_LINK_GET(_var) \
  8909. (((_var) & HTT_ML_LINK_INFO_ASSOC_LINK_M) >> \
  8910. HTT_ML_LINK_INFO_ASSOC_LINK_S)
  8911. /* provide properly-named macro */
  8912. #define HTT_STATS_ML_LINK_INFO_DETAILS_ASSOC_LINK_GET(_var) \
  8913. HTT_ML_LINK_INFO_ASSOC_LINK_GET(_var)
  8914. #define HTT_ML_LINK_INFO_ASSOC_LINK_SET(_var, _val) \
  8915. do { \
  8916. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ASSOC_LINK, _val); \
  8917. ((_var) &= ~(HTT_ML_LINK_INFO_ASSOC_LINK_M)); \
  8918. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ASSOC_LINK_S)); \
  8919. } while (0)
  8920. #define HTT_ML_LINK_INFO_CHIP_ID_GET(_var) \
  8921. (((_var) & HTT_ML_LINK_INFO_CHIP_ID_M) >> \
  8922. HTT_ML_LINK_INFO_CHIP_ID_S)
  8923. /* provide properly-named macro */
  8924. #define HTT_STATS_ML_LINK_INFO_DETAILS_CHIP_ID_GET(_var) \
  8925. HTT_ML_LINK_INFO_CHIP_ID_GET(_var)
  8926. #define HTT_ML_LINK_INFO_CHIP_ID_SET(_var, _val) \
  8927. do { \
  8928. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_CHIP_ID, _val); \
  8929. ((_var) &= ~(HTT_ML_LINK_INFO_CHIP_ID_M)); \
  8930. ((_var) |= ((_val) << HTT_ML_LINK_INFO_CHIP_ID_S)); \
  8931. } while (0)
  8932. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_GET(_var) \
  8933. (((_var) & HTT_ML_LINK_INFO_IEEE_LINK_ID_M) >> \
  8934. HTT_ML_LINK_INFO_IEEE_LINK_ID_S)
  8935. /* provide properly-named macro */
  8936. #define HTT_STATS_ML_LINK_INFO_DETAILS_IEEE_LINK_ID_GET(_var) \
  8937. HTT_ML_LINK_INFO_IEEE_LINK_ID_GET(_var)
  8938. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_SET(_var, _val) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_IEEE_LINK_ID, _val); \
  8941. ((_var) &= ~(HTT_ML_LINK_INFO_IEEE_LINK_ID_M)); \
  8942. ((_var) |= ((_val) << HTT_ML_LINK_INFO_IEEE_LINK_ID_S)); \
  8943. } while (0)
  8944. #define HTT_ML_LINK_INFO_HW_LINK_ID_GET(_var) \
  8945. (((_var) & HTT_ML_LINK_INFO_HW_LINK_ID_M) >> \
  8946. HTT_ML_LINK_INFO_HW_LINK_ID_S)
  8947. /* provide properly-named macro */
  8948. #define HTT_STATS_ML_LINK_INFO_DETAILS_HW_LINK_ID_GET(_var) \
  8949. HTT_ML_LINK_INFO_HW_LINK_ID_GET(_var)
  8950. #define HTT_ML_LINK_INFO_HW_LINK_ID_SET(_var, _val) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_HW_LINK_ID, _val); \
  8953. ((_var) &= ~(HTT_ML_LINK_INFO_HW_LINK_ID_M)); \
  8954. ((_var) |= ((_val) << HTT_ML_LINK_INFO_HW_LINK_ID_S)); \
  8955. } while (0)
  8956. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_GET(_var) \
  8957. (((_var) & HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M) >> \
  8958. HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)
  8959. /* provide properly-named macro */
  8960. #define HTT_STATS_ML_LINK_INFO_DETAILS_LOGICAL_LINK_ID_GET(_var) \
  8961. HTT_ML_LINK_INFO_LOGICAL_LINK_ID_GET(_var)
  8962. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_SET(_var, _val) \
  8963. do { \
  8964. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_LOGICAL_LINK_ID, _val); \
  8965. ((_var) &= ~(HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M)); \
  8966. ((_var) |= ((_val) << HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)); \
  8967. } while (0)
  8968. #define HTT_ML_LINK_INFO_MASTER_LINK_GET(_var) \
  8969. (((_var) & HTT_ML_LINK_INFO_MASTER_LINK_M) >> \
  8970. HTT_ML_LINK_INFO_MASTER_LINK_S)
  8971. /* provide properly-named macro */
  8972. #define HTT_STATS_ML_LINK_INFO_DETAILS_MASTER_LINK_GET(_var) \
  8973. HTT_ML_LINK_INFO_MASTER_LINK_GET(_var)
  8974. #define HTT_ML_LINK_INFO_MASTER_LINK_SET(_var, _val) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_MASTER_LINK, _val); \
  8977. ((_var) &= ~(HTT_ML_LINK_INFO_MASTER_LINK_M)); \
  8978. ((_var) |= ((_val) << HTT_ML_LINK_INFO_MASTER_LINK_S)); \
  8979. } while (0)
  8980. #define HTT_ML_LINK_INFO_ANCHOR_LINK_GET(_var) \
  8981. (((_var) & HTT_ML_LINK_INFO_ANCHOR_LINK_M) >> \
  8982. HTT_ML_LINK_INFO_ANCHOR_LINK_S)
  8983. /* provide properly-named macro */
  8984. #define HTT_STATS_ML_LINK_INFO_DETAILS_ANCHOR_LINK_GET(_var) \
  8985. HTT_ML_LINK_INFO_ANCHOR_LINK_GET(_var)
  8986. #define HTT_ML_LINK_INFO_ANCHOR_LINK_SET(_var, _val) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ANCHOR_LINK, _val); \
  8989. ((_var) &= ~(HTT_ML_LINK_INFO_ANCHOR_LINK_M)); \
  8990. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ANCHOR_LINK_S)); \
  8991. } while (0)
  8992. #define HTT_ML_LINK_INFO_INITIALIZED_GET(_var) \
  8993. (((_var) & HTT_ML_LINK_INFO_INITIALIZED_M) >> \
  8994. HTT_ML_LINK_INFO_INITIALIZED_S)
  8995. /* provide properly-named macro */
  8996. #define HTT_STATS_ML_LINK_INFO_DETAILS_INITIALIZED_GET(_var) \
  8997. HTT_ML_LINK_INFO_INITIALIZED_GET(_var)
  8998. #define HTT_ML_LINK_INFO_INITIALIZED_SET(_var, _val) \
  8999. do { \
  9000. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_INITIALIZED, _val); \
  9001. ((_var) &= ~(HTT_ML_LINK_INFO_INITIALIZED_M)); \
  9002. ((_var) |= ((_val) << HTT_ML_LINK_INFO_INITIALIZED_S)); \
  9003. } while (0)
  9004. #define HTT_ML_LINK_INFO_SW_PEER_ID_GET(_var) \
  9005. (((_var) & HTT_ML_LINK_INFO_SW_PEER_ID_M) >> \
  9006. HTT_ML_LINK_INFO_SW_PEER_ID_S)
  9007. /* provide properly-named macro */
  9008. #define HTT_STATS_ML_LINK_INFO_DETAILS_SW_PEER_ID_GET(_var) \
  9009. HTT_ML_LINK_INFO_SW_PEER_ID_GET(_var)
  9010. #define HTT_ML_LINK_INFO_SW_PEER_ID_SET(_var, _val) \
  9011. do { \
  9012. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_SW_PEER_ID, _val); \
  9013. ((_var) &= ~(HTT_ML_LINK_INFO_SW_PEER_ID_M)); \
  9014. ((_var) |= ((_val) << HTT_ML_LINK_INFO_SW_PEER_ID_S)); \
  9015. } while (0)
  9016. #define HTT_ML_LINK_INFO_VDEV_ID_GET(_var) \
  9017. (((_var) & HTT_ML_LINK_INFO_VDEV_ID_M) >> \
  9018. HTT_ML_LINK_INFO_VDEV_ID_S)
  9019. /* provide properly-named macro */
  9020. #define HTT_STATS_ML_LINK_INFO_DETAILS_VDEV_ID_GET(_var) \
  9021. HTT_ML_LINK_INFO_VDEV_ID_GET(_var)
  9022. #define HTT_ML_LINK_INFO_VDEV_ID_SET(_var, _val) \
  9023. do { \
  9024. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VDEV_ID, _val); \
  9025. ((_var) &= ~(HTT_ML_LINK_INFO_VDEV_ID_M)); \
  9026. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VDEV_ID_S)); \
  9027. } while (0)
  9028. typedef struct {
  9029. htt_tlv_hdr_t tlv_hdr;
  9030. union {
  9031. struct {
  9032. A_UINT32 valid : 1,
  9033. active : 1,
  9034. primary : 1,
  9035. assoc_link : 1,
  9036. chip_id : 3,
  9037. ieee_link_id : 8,
  9038. hw_link_id : 3,
  9039. logical_link_id : 2,
  9040. master_link : 1,
  9041. anchor_link : 1,
  9042. initialized : 1,
  9043. reserved : 9;
  9044. };
  9045. A_UINT32 msg_dword_1;
  9046. };
  9047. union {
  9048. struct {
  9049. A_UINT32 sw_peer_id : 16,
  9050. vdev_id : 8,
  9051. reserved1 : 8;
  9052. };
  9053. A_UINT32 msg_dword_2;
  9054. };
  9055. A_UINT32 primary_tid_mask;
  9056. } htt_stats_ml_link_info_details_tlv;
  9057. /* preserve old name alias for new name consistent with the tag name */
  9058. typedef htt_stats_ml_link_info_details_tlv htt_ml_link_info_tlv;
  9059. #define HTT_ML_PEER_DETAILS_NUM_LINKS_M 0x00000003
  9060. #define HTT_ML_PEER_DETAILS_NUM_LINKS_S 0
  9061. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_M 0x00003FFC
  9062. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_S 2
  9063. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M 0x0001C000
  9064. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S 14
  9065. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M 0x00060000
  9066. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S 17
  9067. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M 0x00380000
  9068. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S 19
  9069. #define HTT_ML_PEER_DETAILS_NON_STR_M 0x00400000
  9070. #define HTT_ML_PEER_DETAILS_NON_STR_S 22
  9071. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M 0x00800000
  9072. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S 23
  9073. /* for backwards compatibility, retain the old EMLSR name of the bitfield */
  9074. #define HTT_ML_PEER_DETAILS_EMLSR_M HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M
  9075. #define HTT_ML_PEER_DETAILS_EMLSR_S HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S
  9076. #define HTT_ML_PEER_DETAILS_IS_STA_KO_M 0x01000000
  9077. #define HTT_ML_PEER_DETAILS_IS_STA_KO_S 24
  9078. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M 0x06000000
  9079. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S 25
  9080. #define HTT_ML_PEER_DETAILS_ALLOCATED_M 0x08000000
  9081. #define HTT_ML_PEER_DETAILS_ALLOCATED_S 27
  9082. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M 0x10000000
  9083. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S 28
  9084. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M 0x000000ff
  9085. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S 0
  9086. #define HTT_ML_PEER_DETAILS_NUM_LINKS_GET(_var) \
  9087. (((_var) & HTT_ML_PEER_DETAILS_NUM_LINKS_M) >> \
  9088. HTT_ML_PEER_DETAILS_NUM_LINKS_S)
  9089. /* provide properly-named macro */
  9090. #define HTT_STATS_ML_PEER_DETAILS_NUM_LINKS_GET(_var) \
  9091. HTT_ML_PEER_DETAILS_NUM_LINKS_GET(_var)
  9092. #define HTT_ML_PEER_DETAILS_NUM_LINKS_SET(_var, _val) \
  9093. do { \
  9094. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LINKS, _val); \
  9095. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LINKS_M)); \
  9096. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LINKS_S)); \
  9097. } while (0)
  9098. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_GET(_var) \
  9099. (((_var) & HTT_ML_PEER_DETAILS_ML_PEER_ID_M) >> \
  9100. HTT_ML_PEER_DETAILS_ML_PEER_ID_S)
  9101. /* provide properly-named macro */
  9102. #define HTT_STATS_ML_PEER_DETAILS_ML_PEER_ID_GET(_var) \
  9103. HTT_ML_PEER_DETAILS_ML_PEER_ID_GET(_var)
  9104. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_SET(_var, _val) \
  9105. do { \
  9106. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ML_PEER_ID, _val); \
  9107. ((_var) &= ~(HTT_ML_PEER_DETAILS_ML_PEER_ID_M)); \
  9108. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ML_PEER_ID_S)); \
  9109. } while (0)
  9110. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var) \
  9111. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M) >> \
  9112. HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)
  9113. /* provide properly-named macro */
  9114. #define HTT_STATS_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var) \
  9115. HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var)
  9116. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_SET(_var, _val) \
  9117. do { \
  9118. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX, _val); \
  9119. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M)); \
  9120. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)); \
  9121. } while (0)
  9122. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var) \
  9123. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M) >> \
  9124. HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)
  9125. /* provide properly-named macro */
  9126. #define HTT_STATS_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var) \
  9127. HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var)
  9128. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_SET(_var, _val) \
  9129. do { \
  9130. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID, _val); \
  9131. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M)); \
  9132. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)); \
  9133. } while (0)
  9134. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var) \
  9135. (((_var) & HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M) >> \
  9136. HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)
  9137. /* provide properly-named macro */
  9138. #define HTT_STATS_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var) \
  9139. HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var)
  9140. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_SET(_var, _val) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT, _val); \
  9143. ((_var) &= ~(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M)); \
  9144. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)); \
  9145. } while (0)
  9146. #define HTT_ML_PEER_DETAILS_NON_STR_GET(_var) \
  9147. (((_var) & HTT_ML_PEER_DETAILS_NON_STR_M) >> \
  9148. HTT_ML_PEER_DETAILS_NON_STR_S)
  9149. /* provide properly-named macro */
  9150. #define HTT_STATS_ML_PEER_DETAILS_NON_STR_GET(_var) \
  9151. HTT_ML_PEER_DETAILS_NON_STR_GET(_var)
  9152. #define HTT_ML_PEER_DETAILS_NON_STR_SET(_var, _val) \
  9153. do { \
  9154. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NON_STR, _val); \
  9155. ((_var) &= ~(HTT_ML_PEER_DETAILS_NON_STR_M)); \
  9156. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NON_STR_S)); \
  9157. } while (0)
  9158. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var) \
  9159. (((_var) & HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M) >> \
  9160. HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S)
  9161. /* provide properly-named macro */
  9162. #define HTT_STATS_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var) \
  9163. HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var)
  9164. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_SET(_var, _val) \
  9165. do { \
  9166. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE, _val); \
  9167. ((_var) &= ~(HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M)); \
  9168. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S)); \
  9169. } while (0)
  9170. /* start deprecated:
  9171. * For backwards compatibility, retain a macro definition that uses
  9172. * the old EMLSR name of the bitfield
  9173. */
  9174. #define HTT_ML_PEER_DETAILS_EMLSR_GET(_var) \
  9175. (((_var) & HTT_ML_PEER_DETAILS_EMLSR_M) >> \
  9176. HTT_ML_PEER_DETAILS_EMLSR_S)
  9177. #define HTT_ML_PEER_DETAILS_EMLSR_SET(_var, _val) \
  9178. do { \
  9179. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_EMLSR, _val); \
  9180. ((_var) &= ~(HTT_ML_PEER_DETAILS_EMLSR_M)); \
  9181. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_EMLSR_S)); \
  9182. } while (0)
  9183. /* end deprecated */
  9184. #define HTT_ML_PEER_DETAILS_IS_STA_KO_GET(_var) \
  9185. (((_var) & HTT_ML_PEER_DETAILS_IS_STA_KO_M) >> \
  9186. HTT_ML_PEER_DETAILS_IS_STA_KO_S)
  9187. /* provide properly-named macro */
  9188. #define HTT_STATS_ML_PEER_DETAILS_IS_STA_KO_GET(_var) \
  9189. HTT_ML_PEER_DETAILS_IS_STA_KO_GET(_var)
  9190. #define HTT_ML_PEER_DETAILS_IS_STA_KO_SET(_var, _val) \
  9191. do { \
  9192. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_IS_STA_KO, _val); \
  9193. ((_var) &= ~(HTT_ML_PEER_DETAILS_IS_STA_KO_M)); \
  9194. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_IS_STA_KO_S)); \
  9195. } while (0)
  9196. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var) \
  9197. (((_var) & HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M) >> \
  9198. HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)
  9199. /* provide properly-named macro */
  9200. #define HTT_STATS_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var) \
  9201. HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var)
  9202. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_SET(_var, _val) \
  9203. do { \
  9204. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS, _val); \
  9205. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M)); \
  9206. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)); \
  9207. } while (0)
  9208. #define HTT_ML_PEER_DETAILS_ALLOCATED_GET(_var) \
  9209. (((_var) & HTT_ML_PEER_DETAILS_ALLOCATED_M) >> \
  9210. HTT_ML_PEER_DETAILS_ALLOCATED_S)
  9211. /* provide properly-named macro */
  9212. #define HTT_STATS_ML_PEER_DETAILS_ALLOCATED_GET(_var) \
  9213. HTT_ML_PEER_DETAILS_ALLOCATED_GET(_var)
  9214. #define HTT_ML_PEER_DETAILS_ALLOCATED_SET(_var, _val) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ALLOCATED, _val); \
  9217. ((_var) &= ~(HTT_ML_PEER_DETAILS_ALLOCATED_M)); \
  9218. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ALLOCATED_S)); \
  9219. } while (0)
  9220. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var) \
  9221. (((_var) & HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M) >> \
  9222. HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S)
  9223. /* provide properly-named macro */
  9224. #define HTT_STATS_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var) \
  9225. HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var)
  9226. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_SET(_var, _val) \
  9227. do { \
  9228. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_EMLSR_SUPPORT, _val); \
  9229. ((_var) &= ~(HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M)); \
  9230. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S)); \
  9231. } while (0)
  9232. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var) \
  9233. (((_var) & HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M) >> \
  9234. HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)
  9235. /* provide properly-named macro */
  9236. #define HTT_STATS_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var) \
  9237. HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var)
  9238. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_SET(_var, _val) \
  9239. do { \
  9240. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP, _val); \
  9241. ((_var) &= ~(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M)); \
  9242. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)); \
  9243. } while (0)
  9244. typedef struct {
  9245. htt_tlv_hdr_t tlv_hdr;
  9246. htt_mac_addr remote_mld_mac_addr;
  9247. union {
  9248. struct {
  9249. A_UINT32 num_links : 2,
  9250. ml_peer_id : 12,
  9251. primary_link_idx : 3,
  9252. primary_chip_id : 2,
  9253. link_init_count : 3,
  9254. non_str : 1,
  9255. is_emlsr_active : 1,
  9256. is_sta_ko : 1,
  9257. num_local_links : 2,
  9258. allocated : 1,
  9259. emlsr_support : 1,
  9260. reserved : 3;
  9261. };
  9262. struct {
  9263. /*
  9264. * For backwards compatibility, use a dummy union element to
  9265. * retain the old "emlsr" name for the "is_emlsr_active" bitfield.
  9266. */
  9267. A_UINT32 dummy1 : 23,
  9268. emlsr : 1,
  9269. dummy2 : 8;
  9270. };
  9271. A_UINT32 msg_dword_1;
  9272. };
  9273. union {
  9274. struct {
  9275. A_UINT32 participating_chips_bitmap : 8,
  9276. reserved1 : 24;
  9277. };
  9278. A_UINT32 msg_dword_2;
  9279. };
  9280. /*
  9281. * ml_peer_flags is an opaque field that cannot be interpreted by
  9282. * the host; it is only for off-line debug.
  9283. */
  9284. A_UINT32 ml_peer_flags;
  9285. } htt_stats_ml_peer_details_tlv;
  9286. /* preserve old name alias for new name consistent with the tag name */
  9287. typedef htt_stats_ml_peer_details_tlv htt_ml_peer_details_tlv;
  9288. /* STATS_TYPE : HTT_DBG_EXT_STATS_ML_PEERS_INFO
  9289. * TLV_TAGS:
  9290. * - HTT_STATS_ML_PEER_DETAILS_TAG
  9291. * - HTT_STATS_ML_LINK_INFO_DETAILS_TAG
  9292. * - HTT_STATS_ML_PEER_EXT_DETAILS_TAG (multiple)
  9293. */
  9294. /* NOTE:
  9295. * This structure is for documentation, and cannot be safely used directly.
  9296. * Instead, use the constituent TLV structures to fill/parse.
  9297. */
  9298. #ifdef ATH_TARGET
  9299. typedef struct _htt_ml_peer_stats {
  9300. htt_stats_ml_peer_details_tlv ml_peer_details;
  9301. htt_stats_ml_peer_ext_details_tlv ml_peer_ext_details;
  9302. htt_stats_ml_link_info_details_tlv ml_link_info[1];
  9303. } htt_ml_peer_stats_t;
  9304. #endif /* ATH_TARGET */
  9305. /*
  9306. * ODD Mandatory Stats are grouped together from all the existing different
  9307. * stats, to form a set of stats that will be used by the ODD application to
  9308. * post the stats to the cloud instead of polling for the individual stats.
  9309. * This is done to avoid non-mandatory stats to be polled as the data will not
  9310. * be required in the recipes derivation.
  9311. * Rather than the host simply printing the ODD stats, the ODD application
  9312. * will take the buffer and map it to the odd_mandatory_stats data structure.
  9313. */
  9314. typedef struct {
  9315. htt_tlv_hdr_t tlv_hdr;
  9316. A_UINT32 hw_queued;
  9317. A_UINT32 hw_reaped;
  9318. A_UINT32 hw_paused;
  9319. A_UINT32 hw_filt;
  9320. A_UINT32 seq_posted;
  9321. A_UINT32 seq_completed;
  9322. A_UINT32 underrun;
  9323. A_UINT32 hw_flush;
  9324. A_UINT32 next_seq_posted_dsr;
  9325. A_UINT32 seq_posted_isr;
  9326. A_UINT32 mpdu_cnt_fcs_ok;
  9327. A_UINT32 mpdu_cnt_fcs_err;
  9328. A_UINT32 msdu_count_tqm;
  9329. A_UINT32 mpdu_count_tqm;
  9330. A_UINT32 mpdus_ack_failed;
  9331. A_UINT32 num_data_ppdus_tried_ota;
  9332. A_UINT32 ppdu_ok;
  9333. A_UINT32 num_total_ppdus_tried_ota;
  9334. A_UINT32 thermal_suspend_cnt;
  9335. A_UINT32 dfs_suspend_cnt;
  9336. A_UINT32 tx_abort_suspend_cnt;
  9337. A_UINT32 suspended_txq_mask;
  9338. A_UINT32 last_suspend_reason;
  9339. A_UINT32 seq_failed_queueing;
  9340. A_UINT32 seq_restarted;
  9341. A_UINT32 seq_txop_repost_stop;
  9342. A_UINT32 next_seq_cancel;
  9343. A_UINT32 seq_min_msdu_repost_stop;
  9344. A_UINT32 total_phy_err_cnt;
  9345. A_UINT32 ppdu_recvd;
  9346. A_UINT32 tcp_msdu_cnt;
  9347. A_UINT32 tcp_ack_msdu_cnt;
  9348. A_UINT32 udp_msdu_cnt;
  9349. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  9350. A_UINT32 fw_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  9351. A_UINT32 fw_ring_mpdu_err[HTT_RX_STATS_RXDMA_MAX_ERR];
  9352. A_UINT32 urrn_stats[HTT_TX_PDEV_MAX_URRN_STATS];
  9353. A_UINT32 sifs_status[HTT_TX_PDEV_MAX_SIFS_BURST_STATS];
  9354. A_UINT32 sifs_hist_status[HTT_TX_PDEV_SIFS_BURST_HIST_STATS];
  9355. A_UINT32 rx_suspend_cnt;
  9356. A_UINT32 rx_suspend_fail_cnt;
  9357. A_UINT32 rx_resume_cnt;
  9358. A_UINT32 rx_resume_fail_cnt;
  9359. A_UINT32 hwq_beacon_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9360. A_UINT32 hwq_voice_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9361. A_UINT32 hwq_video_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9362. A_UINT32 hwq_best_effort_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9363. A_UINT32 hwq_beacon_mpdu_tried_cnt;
  9364. A_UINT32 hwq_voice_mpdu_tried_cnt;
  9365. A_UINT32 hwq_video_mpdu_tried_cnt;
  9366. A_UINT32 hwq_best_effort_mpdu_tried_cnt;
  9367. A_UINT32 hwq_beacon_mpdu_queued_cnt;
  9368. A_UINT32 hwq_voice_mpdu_queued_cnt;
  9369. A_UINT32 hwq_video_mpdu_queued_cnt;
  9370. A_UINT32 hwq_best_effort_mpdu_queued_cnt;
  9371. A_UINT32 hwq_beacon_mpdu_ack_fail_cnt;
  9372. A_UINT32 hwq_voice_mpdu_ack_fail_cnt;
  9373. A_UINT32 hwq_video_mpdu_ack_fail_cnt;
  9374. A_UINT32 hwq_best_effort_mpdu_ack_fail_cnt;
  9375. A_UINT32 pdev_resets;
  9376. A_UINT32 phy_warm_reset;
  9377. A_UINT32 hwsch_reset_count;
  9378. A_UINT32 phy_warm_reset_ucode_trig;
  9379. A_UINT32 mac_cold_reset;
  9380. A_UINT32 mac_warm_reset;
  9381. A_UINT32 mac_warm_reset_restore_cal;
  9382. A_UINT32 phy_warm_reset_m3_ssr;
  9383. A_UINT32 fw_rx_rings_reset;
  9384. A_UINT32 tx_flush;
  9385. A_UINT32 hwsch_dev_reset_war;
  9386. A_UINT32 mac_cold_reset_restore_cal;
  9387. A_UINT32 mac_only_reset;
  9388. A_UINT32 mac_sfm_reset;
  9389. A_UINT32 tx_ldpc; /* Number of tx PPDUs with LDPC coding */
  9390. A_UINT32 rx_ldpc; /* Number of rx PPDUs with LDPC coding */
  9391. A_UINT32 gen_mpdu_end_reason[HTT_TX_TQM_MAX_GEN_MPDU_END_REASON];
  9392. A_UINT32 list_mpdu_end_reason[HTT_TX_TQM_MAX_LIST_MPDU_END_REASON];
  9393. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  9394. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9395. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9396. A_UINT32 half_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9397. A_UINT32 quarter_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9398. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  9399. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  9400. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9401. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  9402. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  9403. A_UINT32 rts_cnt;
  9404. A_UINT32 rts_success;
  9405. } htt_stats_odd_pdev_mandatory_tlv;
  9406. /* preserve old name alias for new name consistent with the tag name */
  9407. typedef htt_stats_odd_pdev_mandatory_tlv htt_odd_mandatory_pdev_stats_tlv;
  9408. typedef struct _htt_odd_mandatory_mumimo_pdev_stats_tlv {
  9409. htt_tlv_hdr_t tlv_hdr;
  9410. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9411. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9412. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9413. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9414. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  9415. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  9416. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  9417. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  9418. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  9419. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9420. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9421. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9422. } htt_dbg_odd_mandatory_mumimo_tlv;
  9423. /* preserve old name alias for new name consistent with the tag name */
  9424. typedef htt_dbg_odd_mandatory_mumimo_tlv
  9425. htt_odd_mandatory_mumimo_pdev_stats_tlv;
  9426. typedef struct _htt_odd_mandatory_muofdma_pdev_stats_tlv {
  9427. htt_tlv_hdr_t tlv_hdr;
  9428. A_UINT32 mu_ofdma_seq_posted;
  9429. A_UINT32 ul_mu_ofdma_seq_posted;
  9430. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  9431. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9432. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9433. A_UINT32 ofdma_tx_ldpc;
  9434. A_UINT32 ul_ofdma_rx_ldpc;
  9435. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  9436. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9437. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9438. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9439. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9440. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9441. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  9442. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  9443. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  9444. } htt_dbg_odd_mandatory_muofdma_tlv;
  9445. /* preserve old name alias for new name consistent with the tag name */
  9446. typedef htt_dbg_odd_mandatory_muofdma_tlv
  9447. htt_odd_mandatory_muofdma_pdev_stats_tlv;
  9448. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M 0x000000ff
  9449. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S 0
  9450. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_GET(_var) \
  9451. (((_var) & HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M) >> \
  9452. HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)
  9453. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_SET(_var, _val) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID, _val); \
  9456. ((_var) |= ((_val) << HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)); \
  9457. } while (0)
  9458. typedef enum {
  9459. HTT_STATS_SCHED_OFDMA_TXBF = 0, /* 0 */
  9460. HTT_STATS_SCHED_OFDMA_TXBF_IS_SANITY_FAILED, /* 1 */
  9461. HTT_STATS_SCHED_OFDMA_TXBF_IS_EBF_ALLOWED_FAILIED, /* 2 */
  9462. HTT_STATS_SCHED_OFDMA_TXBF_RU_ALLOC_BW_DROP_COUNT, /* 3 */
  9463. HTT_STATS_SCHED_OFDMA_TXBF_INVALID_CV_QUERY_COUNT, /* 4 */
  9464. HTT_STATS_SCHED_OFDMA_TXBF_AVG_TXTIME_LESS_THAN_TXBF_SND_THERHOLD, /* 5 */
  9465. HTT_STATS_SCHED_OFDMA_TXBF_IS_CANDIDATE_KICKED_OUT, /* 6 */
  9466. HTT_STATS_SCHED_OFDMA_TXBF_CV_IMAGE_BUF_INVALID, /* 7 */
  9467. HTT_STATS_SCHED_OFDMA_TXBF_INELIGIBILITY_MAX,
  9468. } htt_stats_sched_ofdma_txbf_ineligibility_t;
  9469. #define HTT_MAX_NUM_CHAN_ACC_LAT_INTR 9
  9470. typedef struct {
  9471. htt_tlv_hdr_t tlv_hdr;
  9472. /**
  9473. * BIT [ 7 : 0] :- mac_id
  9474. * BIT [31 : 8] :- reserved
  9475. */
  9476. union {
  9477. struct {
  9478. A_UINT32 mac_id: 8,
  9479. reserved: 24;
  9480. };
  9481. A_UINT32 mac_id__word;
  9482. };
  9483. /** Num of instances where rate based DL OFDMA status = ENABLED */
  9484. A_UINT32 rate_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  9485. /** Num of instances where rate based DL OFDMA status = DISABLED */
  9486. A_UINT32 rate_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  9487. /** Num of instances where rate based DL OFDMA status = PROBING */
  9488. A_UINT32 rate_based_dlofdma_probing_count[HTT_NUM_AC_WMM];
  9489. /** Num of instances where rate based DL OFDMA status = MONITORING */
  9490. A_UINT32 rate_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  9491. /** Num of instances where avg. channel access latency based DL OFDMA status = ENABLED */
  9492. A_UINT32 chan_acc_lat_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  9493. /** Num of instances where avg. channel access latency based DL OFDMA status = DISABLED */
  9494. A_UINT32 chan_acc_lat_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  9495. /** Num of instances where avg. channel access latency based DL OFDMA status = MONITORING */
  9496. A_UINT32 chan_acc_lat_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  9497. /** Num of instances where dl ofdma is disabled due to ru allocation failure */
  9498. A_UINT32 downgrade_to_dl_su_ru_alloc_fail[HTT_NUM_AC_WMM];
  9499. /** Num of instances where dl ofdma is disabled because we have only one user in candidate list */
  9500. A_UINT32 candidate_list_single_user_disable_ofdma[HTT_NUM_AC_WMM];
  9501. /** Num of instances where ul is chosen over dl based on qos weight not specific to OFDMA */
  9502. A_UINT32 dl_cand_list_dropped_high_ul_qos_weight[HTT_NUM_AC_WMM];
  9503. /** Num of instances where dl ofdma is disabled due to pipelining */
  9504. A_UINT32 ax_dlofdma_disabled_due_to_pipelining[HTT_NUM_AC_WMM];
  9505. /** Num of instances where dl ofdma is disabled as the tid is su only eligible */
  9506. A_UINT32 dlofdma_disabled_su_only_eligible[HTT_NUM_AC_WMM];
  9507. /** Num of instances where dl ofdma is disabled because there are no mpdus tried consecutively */
  9508. A_UINT32 dlofdma_disabled_consec_no_mpdus_tried[HTT_NUM_AC_WMM];
  9509. /** Num of instances where dl ofdma is disabled because there are consecutive mpdu failure */
  9510. A_UINT32 dlofdma_disabled_consec_no_mpdus_success[HTT_NUM_AC_WMM];
  9511. A_UINT32 txbf_ofdma_ineligibility_stat[HTT_STATS_SCHED_OFDMA_TXBF_INELIGIBILITY_MAX];
  9512. /** Average channel access latency histogram stats
  9513. *
  9514. * avg_chan_acc_lat_hist[0]: channel access latency is < 100 us
  9515. * avg_chan_acc_lat_hist[1]: 100 us <= channel access latency < 200 us
  9516. * avg_chan_acc_lat_hist[2]: 200 us <= channel access latency < 300 us
  9517. * avg_chan_acc_lat_hist[3]: 300 us <= channel access latency < 400 us
  9518. * avg_chan_acc_lat_hist[4]: 400 us <= channel access latency < 500 us
  9519. * avg_chan_acc_lat_hist[5]: 500 us <= channel access latency < 1000 us
  9520. * avg_chan_acc_lat_hist[6]: 1000 us <= channel access latency < 1500 us
  9521. * avg_chan_acc_lat_hist[7]: 1500 us <= channel access latency < 2000 us
  9522. * avg_chan_acc_lat_hist[8]: channel access latency is >= 2000 us
  9523. */
  9524. A_UINT32 avg_chan_acc_lat_hist[HTT_MAX_NUM_CHAN_ACC_LAT_INTR];
  9525. } htt_stats_pdev_sched_algo_ofdma_stats_tlv;
  9526. /* preserve old name alias for new name consistent with the tag name */
  9527. typedef htt_stats_pdev_sched_algo_ofdma_stats_tlv
  9528. htt_pdev_sched_algo_ofdma_stats_tlv;
  9529. #define HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_GET(word) ((word >> 0) & 0xff)
  9530. typedef struct {
  9531. htt_tlv_hdr_t tlv_hdr;
  9532. /** mac_id__word:
  9533. * BIT [ 7 : 0] :- mac_id
  9534. * Use the HTT_STATS_CMN_MAC_ID_GET,_SET macros to
  9535. * read/write this bitfield.
  9536. * BIT [31 : 8] :- reserved
  9537. */
  9538. A_UINT32 mac_id__word;
  9539. A_UINT32 basic_trigger_across_bss;
  9540. A_UINT32 basic_trigger_within_bss;
  9541. A_UINT32 bsr_trigger_across_bss;
  9542. A_UINT32 bsr_trigger_within_bss;
  9543. A_UINT32 mu_rts_across_bss;
  9544. A_UINT32 mu_rts_within_bss;
  9545. A_UINT32 ul_mumimo_trigger_across_bss;
  9546. A_UINT32 ul_mumimo_trigger_within_bss;
  9547. } htt_stats_pdev_mbssid_ctrl_frame_stats_tlv;
  9548. /* preserve old name alias for new name consistent with the tag name */
  9549. typedef htt_stats_pdev_mbssid_ctrl_frame_stats_tlv
  9550. htt_pdev_mbssid_ctrl_frame_stats_tlv;
  9551. typedef struct {
  9552. htt_tlv_hdr_t tlv_hdr;
  9553. /**
  9554. * BIT [ 7 : 0] :- mac_id
  9555. * Use the HTT_STATS_TDMA_MAC_ID_GET macro to extract
  9556. * this bitfield.
  9557. * BIT [31 : 8] :- reserved
  9558. */
  9559. union {
  9560. struct {
  9561. A_UINT32 mac_id: 8,
  9562. reserved: 24;
  9563. };
  9564. A_UINT32 mac_id__word;
  9565. };
  9566. /** Num of Active TDMA schedules */
  9567. A_UINT32 num_tdma_active_schedules;
  9568. /** Num of Reserved TDMA schedules */
  9569. A_UINT32 num_tdma_reserved_schedules;
  9570. /** Num of Restricted TDMA schedules */
  9571. A_UINT32 num_tdma_restricted_schedules;
  9572. /** Num of Unconfigured TDMA schedules */
  9573. A_UINT32 num_tdma_unconfigured_schedules;
  9574. /** Num of TDMA slot switches */
  9575. A_UINT32 num_tdma_slot_switches;
  9576. /** Num of TDMA EDCA switches */
  9577. A_UINT32 num_tdma_edca_switches;
  9578. } htt_stats_pdev_tdma_tlv;
  9579. /* preserve old name alias for new name consistent with the tag name */
  9580. typedef htt_stats_pdev_tdma_tlv htt_pdev_tdma_stats_tlv;
  9581. #define HTT_STATS_TDMA_MAC_ID_M 0x000000ff
  9582. #define HTT_STATS_TDMA_MAC_ID_S 0
  9583. #define HTT_STATS_TDMA_MAC_ID_GET(_var) \
  9584. (((_var) & HTT_STATS_TDMA_MAC_ID_M) >> \
  9585. HTT_STATS_TDMA_MAC_ID_S)
  9586. /* provide properly-named macro */
  9587. #define HTT_STATS_PDEV_TDMA_MAC_ID_GET(_var) \
  9588. HTT_STATS_TDMA_MAC_ID_GET(_var)
  9589. /*======= Bandwidth Manager stats ====================*/
  9590. #define HTT_BW_MGR_STATS_MAC_ID_M 0x000000ff
  9591. #define HTT_BW_MGR_STATS_MAC_ID_S 0
  9592. #define HTT_BW_MGR_STATS_PRI20_IDX_M 0x0000ff00
  9593. #define HTT_BW_MGR_STATS_PRI20_IDX_S 8
  9594. #define HTT_BW_MGR_STATS_PRI20_FREQ_M 0xffff0000
  9595. #define HTT_BW_MGR_STATS_PRI20_FREQ_S 16
  9596. #define HTT_BW_MGR_STATS_CENTER_FREQ1_M 0x0000ffff
  9597. #define HTT_BW_MGR_STATS_CENTER_FREQ1_S 0
  9598. #define HTT_BW_MGR_STATS_CENTER_FREQ2_M 0xffff0000
  9599. #define HTT_BW_MGR_STATS_CENTER_FREQ2_S 16
  9600. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_M 0x000000ff
  9601. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_S 0
  9602. #define HTT_BW_MGR_STATS_STATIC_PATTERN_M 0x00ffff00
  9603. #define HTT_BW_MGR_STATS_STATIC_PATTERN_S 8
  9604. #define HTT_BW_MGR_STATS_MAC_ID_GET(_var) \
  9605. (((_var) & HTT_BW_MGR_STATS_MAC_ID_M) >> \
  9606. HTT_BW_MGR_STATS_MAC_ID_S)
  9607. #define HTT_BW_MGR_STATS_MAC_ID_SET(_var, _val) \
  9608. do { \
  9609. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_MAC_ID, _val); \
  9610. ((_var) |= ((_val) << HTT_BW_MGR_STATS_MAC_ID_S)); \
  9611. } while (0)
  9612. #define HTT_BW_MGR_STATS_PRI20_IDX_GET(_var) \
  9613. (((_var) & HTT_BW_MGR_STATS_PRI20_IDX_M) >> \
  9614. HTT_BW_MGR_STATS_PRI20_IDX_S)
  9615. #define HTT_BW_MGR_STATS_PRI20_IDX_SET(_var, _val) \
  9616. do { \
  9617. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_PRI20_IDX, _val); \
  9618. ((_var) |= ((_val) << HTT_BW_MGR_STATS_PRI20_IDX_S)); \
  9619. } while (0)
  9620. #define HTT_BW_MGR_STATS_PRI20_FREQ_GET(_var) \
  9621. (((_var) & HTT_BW_MGR_STATS_PRI20_FREQ_M) >> \
  9622. HTT_BW_MGR_STATS_PRI20_FREQ_S)
  9623. #define HTT_BW_MGR_STATS_PRI20_FREQ_SET(_var, _val) \
  9624. do { \
  9625. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_PRI20_FREQ, _val); \
  9626. ((_var) |= ((_val) << HTT_BW_MGR_STATS_PRI20_FREQ_S)); \
  9627. } while (0)
  9628. #define HTT_BW_MGR_STATS_CENTER_FREQ1_GET(_var) \
  9629. (((_var) & HTT_BW_MGR_STATS_CENTER_FREQ1_M) >> \
  9630. HTT_BW_MGR_STATS_CENTER_FREQ1_S)
  9631. #define HTT_BW_MGR_STATS_CENTER_FREQ1_SET(_var, _val) \
  9632. do { \
  9633. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CENTER_FREQ1, _val); \
  9634. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CENTER_FREQ1_S)); \
  9635. } while (0)
  9636. #define HTT_BW_MGR_STATS_CENTER_FREQ2_GET(_var) \
  9637. (((_var) & HTT_BW_MGR_STATS_CENTER_FREQ2_M) >> \
  9638. HTT_BW_MGR_STATS_CENTER_FREQ2_S)
  9639. #define HTT_BW_MGR_STATS_CENTER_FREQ2_SET(_var, _val) \
  9640. do { \
  9641. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CENTER_FREQ2, _val); \
  9642. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CENTER_FREQ2_S)); \
  9643. } while (0)
  9644. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_GET(_var) \
  9645. (((_var) & HTT_BW_MGR_STATS_CHAN_PHY_MODE_M) >> \
  9646. HTT_BW_MGR_STATS_CHAN_PHY_MODE_S)
  9647. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_SET(_var, _val) \
  9648. do { \
  9649. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CHAN_PHY_MODE, _val); \
  9650. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CHAN_PHY_MODE_S)); \
  9651. } while (0)
  9652. #define HTT_BW_MGR_STATS_STATIC_PATTERN_GET(_var) \
  9653. (((_var) & HTT_BW_MGR_STATS_STATIC_PATTERN_M) >> \
  9654. HTT_BW_MGR_STATS_STATIC_PATTERN_S)
  9655. #define HTT_BW_MGR_STATS_STATIC_PATTERN_SET(_var, _val) \
  9656. do { \
  9657. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_STATIC_PATTERN, _val); \
  9658. ((_var) |= ((_val) << HTT_BW_MGR_STATS_STATIC_PATTERN_S)); \
  9659. } while (0)
  9660. typedef struct {
  9661. htt_tlv_hdr_t tlv_hdr;
  9662. /* BIT [ 7 : 0] :- mac_id
  9663. * BIT [ 15 : 8] :- pri20_index
  9664. * BIT [ 31 : 16] :- pri20_freq in Mhz
  9665. */
  9666. A_UINT32 mac_id__pri20_idx__freq;
  9667. /* BIT [ 15 : 0] :- centre_freq1
  9668. * BIT [ 31 : 16] :- centre_freq2
  9669. */
  9670. A_UINT32 centre_freq1__freq2;
  9671. /* BIT [ 7 : 0] :- channel_phy_mode
  9672. * BIT [ 23 : 8] :- static_pattern
  9673. */
  9674. A_UINT32 phy_mode__static_pattern;
  9675. } htt_stats_pdev_bw_mgr_stats_tlv;
  9676. /* preserve old name alias for new name consistent with the tag name */
  9677. typedef htt_stats_pdev_bw_mgr_stats_tlv htt_pdev_bw_mgr_stats_tlv;
  9678. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_BW_MGR
  9679. * TLV_TAGS:
  9680. * - HTT_STATS_PDEV_BW_MGR_STATS_TAG
  9681. */
  9682. /* NOTE:
  9683. * This structure is for documentation, and cannot be safely used directly.
  9684. * Instead, use the constituent TLV structures to fill/parse.
  9685. */
  9686. #ifdef ATH_TARGET
  9687. typedef struct {
  9688. htt_stats_pdev_bw_mgr_stats_tlv bw_mgr_tlv;
  9689. } htt_pdev_bw_mgr_stats_t;
  9690. #endif /* ATH_TARGET */
  9691. /*============= start MLO UMAC SSR stats ============= { */
  9692. typedef enum {
  9693. HTT_MLO_UMAC_SSR_DBG_POINT_INVALID = 0,
  9694. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_DISABLE_RXDMA_PREFETCH,
  9695. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_PMACS_HWMLOS,
  9696. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_GLOBAL_WSI,
  9697. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_PMACS_DMAC,
  9698. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_TCL,
  9699. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_TQM,
  9700. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_WBM,
  9701. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_REO,
  9702. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_HOST,
  9703. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_PREREQUISITES,
  9704. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_PRE_RING_RESET,
  9705. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_APPLY_SOFT_RESET,
  9706. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_POST_RING_RESET,
  9707. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_FW_TQM_CMDQS,
  9708. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_HOST,
  9709. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_UMAC_INTERRUPTS,
  9710. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_WBM,
  9711. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_REO,
  9712. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TQM,
  9713. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_PMACS_DMAC,
  9714. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TQM_SYNC_CMD,
  9715. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_GLOBAL_WSI,
  9716. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_PMACS_HWMLOS,
  9717. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_ENABLE_RXDMA_PREFETCH,
  9718. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TCL,
  9719. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_HOST_ENQ,
  9720. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_VERIFY_UMAC_RECOVERED,
  9721. /* The below debug point values are reserved for future expansion. */
  9722. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED28,
  9723. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED29,
  9724. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED30,
  9725. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED31,
  9726. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED32,
  9727. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED33,
  9728. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED34,
  9729. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED35,
  9730. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED36,
  9731. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED37,
  9732. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED38,
  9733. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED39,
  9734. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED40,
  9735. /*
  9736. * Due to backwards compatibility requirements, no futher DBG_POINT values
  9737. * can be added (but the above reserved values can be repurposed).
  9738. */
  9739. HTT_MLO_UMAC_SSR_DBG_POINT_MAX,
  9740. } HTT_MLO_UMAC_SSR_DBG_POINTS;
  9741. typedef enum {
  9742. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_INVALID = 0,
  9743. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_PRE_RESET,
  9744. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_POST_RESET_START,
  9745. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_POST_RESET_COMPLETE,
  9746. /* The below recovery handshake values are reserved for future expansion. */
  9747. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED4,
  9748. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED5,
  9749. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED6,
  9750. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED7,
  9751. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED8,
  9752. /*
  9753. * Due to backwards compatibility requirements, no futher
  9754. * RECOVERY_HANDSHAKE values can be added (but the above
  9755. * reserved values can be repurposed).
  9756. */
  9757. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_COUNT,
  9758. } HTT_MLO_UMAC_RECOVERY_HANDSHAKES;
  9759. typedef struct {
  9760. htt_tlv_hdr_t tlv_hdr;
  9761. A_UINT32 start_ms;
  9762. A_UINT32 end_ms;
  9763. A_UINT32 delta_ms;
  9764. A_UINT32 reserved;
  9765. A_UINT32 footprint; /* holds a HTT_MLO_UMAC_SSR_DBG_POINTS value */
  9766. A_UINT32 tqm_hw_tstamp;
  9767. } htt_stats_mlo_umac_ssr_dbg_tlv;
  9768. /* preserve old name alias for new name consistent with the tag name */
  9769. typedef htt_stats_mlo_umac_ssr_dbg_tlv htt_mlo_umac_ssr_dbg_tlv;
  9770. typedef struct {
  9771. A_UINT32 last_mlo_htt_handshake_delta_ms;
  9772. A_UINT32 max_mlo_htt_handshake_delta_ms;
  9773. union {
  9774. A_UINT32 umac_recovery_done_mask;
  9775. struct {
  9776. A_UINT32 pre_reset_disable_rxdma_prefetch : 1,
  9777. pre_reset_pmacs_hwmlos : 1,
  9778. pre_reset_global_wsi : 1,
  9779. pre_reset_pmacs_dmac : 1,
  9780. pre_reset_tcl : 1,
  9781. pre_reset_tqm : 1,
  9782. pre_reset_wbm : 1,
  9783. pre_reset_reo : 1,
  9784. pre_reset_host : 1,
  9785. reset_prerequisites : 1,
  9786. reset_pre_ring_reset : 1,
  9787. reset_apply_soft_reset : 1,
  9788. reset_post_ring_reset : 1,
  9789. reset_fw_tqm_cmdqs : 1,
  9790. post_reset_host : 1,
  9791. post_reset_umac_interrupts : 1,
  9792. post_reset_wbm : 1,
  9793. post_reset_reo : 1,
  9794. post_reset_tqm : 1,
  9795. post_reset_pmacs_dmac : 1,
  9796. post_reset_tqm_sync_cmd : 1,
  9797. post_reset_global_wsi : 1,
  9798. post_reset_pmacs_hwmlos : 1,
  9799. post_reset_enable_rxdma_prefetch : 1,
  9800. post_reset_tcl : 1,
  9801. post_reset_host_enq : 1,
  9802. post_reset_verify_umac_recovered : 1,
  9803. reserved : 5;
  9804. } done_mask;
  9805. };
  9806. } htt_mlo_umac_ssr_mlo_stats_t;
  9807. typedef struct {
  9808. htt_tlv_hdr_t tlv_hdr;
  9809. htt_mlo_umac_ssr_mlo_stats_t mlo;
  9810. } htt_stats_mlo_umac_ssr_mlo_tlv;
  9811. /* preserve old name alias for new name consistent with the tag name */
  9812. typedef htt_stats_mlo_umac_ssr_mlo_tlv htt_mlo_umac_ssr_mlo_stats_tlv;
  9813. /* dword0 - b'0 - PRE_RESET_DISABLE_RXDMA_PREFETCH */
  9814. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_M 0x1
  9815. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S 0
  9816. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word0) \
  9817. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_M) >> \
  9818. HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S)
  9819. /* provide properly-named macro */
  9820. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word) \
  9821. HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word)
  9822. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_SET(word0, _val) \
  9823. do { \
  9824. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH, _val); \
  9825. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S));\
  9826. } while (0)
  9827. /* dword0 - b'1 - PRE_RESET_PMACS_HWMLOS */
  9828. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_M 0x2
  9829. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S 1
  9830. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_GET(word0) \
  9831. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_M) >> \
  9832. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S)
  9833. /* provide properly-named macro */
  9834. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_PMACS_HWMLOS_GET(word) \
  9835. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_GET(word)
  9836. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_SET(word0, _val) \
  9837. do { \
  9838. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS, _val); \
  9839. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S));\
  9840. } while (0)
  9841. /* dword0 - b'2 - PRE_RESET_GLOBAL_WSI */
  9842. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_M 0x4
  9843. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S 2
  9844. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_GET(word0) \
  9845. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_M) >> \
  9846. HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S)
  9847. /* provide properly-named macro */
  9848. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_GLOBAL_WSI_GET(word) \
  9849. HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_GET(word)
  9850. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_SET(word0, _val) \
  9851. do { \
  9852. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI, _val); \
  9853. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S));\
  9854. } while (0)
  9855. /* dword0 - b'3 - PRE_RESET_PMACS_DMAC */
  9856. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_M 0x8
  9857. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S 3
  9858. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_GET(word0) \
  9859. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_M) >> \
  9860. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S)
  9861. /* provide properly-named macro */
  9862. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_PMACS_DMAC_GET(word) \
  9863. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_GET(word)
  9864. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_SET(word0, _val) \
  9865. do { \
  9866. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC, _val); \
  9867. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S));\
  9868. } while (0)
  9869. /* dword0 - b'4 - PRE_RESET_TCL */
  9870. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_M 0x10
  9871. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S 4
  9872. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_GET(word0) \
  9873. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_M) >> \
  9874. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S)
  9875. /* provide properly-named macro */
  9876. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_TCL_GET(word) \
  9877. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_GET(word)
  9878. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_SET(word0, _val) \
  9879. do { \
  9880. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL, _val); \
  9881. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S));\
  9882. } while (0)
  9883. /* dword0 - b'5 - PRE_RESET_TQM */
  9884. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_M 0x20
  9885. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S 5
  9886. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_GET(word0) \
  9887. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_M) >> \
  9888. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S)
  9889. /* provide properly-named macro */
  9890. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_TQM_GET(word) \
  9891. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_GET(word)
  9892. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_SET(word0, _val) \
  9893. do { \
  9894. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM, _val); \
  9895. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S));\
  9896. } while (0)
  9897. /* dword0 - b'6 - PRE_RESET_WBM */
  9898. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_M 0x40
  9899. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S 6
  9900. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_GET(word0) \
  9901. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_M) >> \
  9902. HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S)
  9903. /* provide properly-named macro */
  9904. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_WBM_GET(word) \
  9905. HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_GET(word)
  9906. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_SET(word0, _val) \
  9907. do { \
  9908. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM, _val); \
  9909. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S));\
  9910. } while (0)
  9911. /* dword0 - b'7 - PRE_RESET_REO */
  9912. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_M 0x80
  9913. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S 7
  9914. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_GET(word0) \
  9915. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_M) >> \
  9916. HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S)
  9917. /* provide properly-named macro */
  9918. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_REO_GET(word) \
  9919. HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_GET(word)
  9920. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_SET(word0, _val) \
  9921. do { \
  9922. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO, _val); \
  9923. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S));\
  9924. } while (0)
  9925. /* dword0 - b'8 - PRE_RESET_HOST */
  9926. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_M 0x100
  9927. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S 8
  9928. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_GET(word0) \
  9929. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_M) >> \
  9930. HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S)
  9931. /* provide properly-named macro */
  9932. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_HOST_GET(word) \
  9933. HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_GET(word)
  9934. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_SET(word0, _val) \
  9935. do { \
  9936. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST, _val); \
  9937. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S));\
  9938. } while (0)
  9939. /* dword0 - b'9 - RESET_PREREQUISITES */
  9940. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_M 0x200
  9941. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S 9
  9942. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_GET(word0) \
  9943. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_M) >> \
  9944. HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S)
  9945. /* provide properly-named macro */
  9946. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_PREREQUISITES_GET(word) \
  9947. HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_GET(word)
  9948. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_SET(word0, _val) \
  9949. do { \
  9950. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES, _val); \
  9951. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S));\
  9952. } while (0)
  9953. /* dword0 - b'10 - RESET_PRE_RING_RESET */
  9954. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_M 0x400
  9955. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S 10
  9956. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_GET(word0) \
  9957. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_M) >> \
  9958. HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S)
  9959. /* provide properly-named macro */
  9960. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_PRE_RING_RESET_GET(word) \
  9961. HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_GET(word)
  9962. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_SET(word0, _val) \
  9963. do { \
  9964. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET, _val); \
  9965. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S));\
  9966. } while (0)
  9967. /* dword0 - b'11 - RESET_APPLY_SOFT_RESET */
  9968. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_M 0x800
  9969. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S 11
  9970. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_GET(word0) \
  9971. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_M) >> \
  9972. HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S)
  9973. /* provide properly-named macro */
  9974. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_APPLY_SOFT_RESET_GET(word) \
  9975. HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_GET(word)
  9976. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_SET(word0, _val) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET, _val); \
  9979. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S));\
  9980. } while (0)
  9981. /* dword0 - b'12 - RESET_POST_RING_RESET */
  9982. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_M 0x1000
  9983. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S 12
  9984. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_GET(word0) \
  9985. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_M) >> \
  9986. HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S)
  9987. /* provide properly-named macro */
  9988. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_POST_RING_RESET_GET(word) \
  9989. HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_GET(word)
  9990. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_SET(word0, _val) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET, _val); \
  9993. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S));\
  9994. } while (0)
  9995. /* dword0 - b'13 - RESET_FW_TQM_CMDQS */
  9996. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_M 0x2000
  9997. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S 13
  9998. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_GET(word0) \
  9999. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_M) >> \
  10000. HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S)
  10001. /* provide properly-named macro */
  10002. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_FW_TQM_CMDQS_GET(word) \
  10003. HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_GET(word)
  10004. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_SET(word0, _val) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS, _val); \
  10007. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S));\
  10008. } while (0)
  10009. /* dword0 - b'14 - POST_RESET_HOST */
  10010. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_M 0x4000
  10011. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S 14
  10012. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_GET(word0) \
  10013. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_M) >> \
  10014. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S)
  10015. /* provide properly-named macro */
  10016. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_HOST_GET(word) \
  10017. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_GET(word)
  10018. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_SET(word0, _val) \
  10019. do { \
  10020. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST, _val); \
  10021. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S));\
  10022. } while (0)
  10023. /* dword0 - b'15 - POST_RESET_UMAC_INTERRUPTS */
  10024. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_M 0x8000
  10025. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S 15
  10026. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_GET(word0) \
  10027. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_M) >> \
  10028. HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S)
  10029. /* provide properly-named macro */
  10030. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_UMAC_INTERRUPTS_GET(word) \
  10031. HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_GET(word)
  10032. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_SET(word0, _val) \
  10033. do { \
  10034. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS, _val); \
  10035. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S));\
  10036. } while (0)
  10037. /* dword0 - b'16 - POST_RESET_WBM */
  10038. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_M 0x10000
  10039. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S 16
  10040. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_GET(word0) \
  10041. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_M) >> \
  10042. HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S)
  10043. /* provide properly-named macro */
  10044. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_WBM_GET(word) \
  10045. HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_GET(word)
  10046. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_SET(word0, _val) \
  10047. do { \
  10048. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM, _val); \
  10049. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S));\
  10050. } while (0)
  10051. /* dword0 - b'17 - POST_RESET_REO */
  10052. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_M 0x20000
  10053. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S 17
  10054. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_GET(word0) \
  10055. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_M) >> \
  10056. HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S)
  10057. /* provide properly-named macro */
  10058. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_REO_GET(word) \
  10059. HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_GET(word)
  10060. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_SET(word0, _val) \
  10061. do { \
  10062. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_REO, _val); \
  10063. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S));\
  10064. } while (0)
  10065. /* dword0 - b'18 - POST_RESET_TQM */
  10066. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_M 0x40000
  10067. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S 18
  10068. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_GET(word0) \
  10069. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_M) >> \
  10070. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S)
  10071. /* provide properly-named macro */
  10072. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TQM_GET(word) \
  10073. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_GET(word)
  10074. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SET(word0, _val) \
  10075. do { \
  10076. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM, _val); \
  10077. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S));\
  10078. } while (0)
  10079. /* dword0 - b'19 - POST_RESET_PMACS_DMAC */
  10080. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_M 0x80000
  10081. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S 19
  10082. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_GET(word0) \
  10083. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_M) >> \
  10084. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S)
  10085. /* provide properly-named macro */
  10086. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_PMACS_DMAC_GET(word) \
  10087. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_GET(word)
  10088. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_SET(word0, _val) \
  10089. do { \
  10090. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC, _val); \
  10091. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S));\
  10092. } while (0)
  10093. /* dword0 - b'20 - POST_RESET_TQM_SYNC_CMD */
  10094. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_M 0x100000
  10095. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S 20
  10096. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_GET(word0) \
  10097. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_M) >> \
  10098. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S)
  10099. /* provide properly-named macro */
  10100. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TQM_SYNC_CMD_GET(word) \
  10101. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_GET(word)
  10102. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_SET(word0, _val) \
  10103. do { \
  10104. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD, _val); \
  10105. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S));\
  10106. } while (0)
  10107. /* dword0 - b'21 - POST_RESET_GLOBAL_WSI */
  10108. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_M 0x200000
  10109. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S 21
  10110. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_GET(word0) \
  10111. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_M) >> \
  10112. HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S)
  10113. /* provide properly-named macro */
  10114. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_GLOBAL_WSI_GET(word) \
  10115. HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_GET(word)
  10116. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_SET(word0, _val) \
  10117. do { \
  10118. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI, _val); \
  10119. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S));\
  10120. } while (0)
  10121. /* dword0 - b'22 - POST_RESET_PMACS_HWMLOS */
  10122. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_M 0x400000
  10123. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S 22
  10124. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_GET(word0) \
  10125. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_M) >> \
  10126. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S)
  10127. /* provide properly-named macro */
  10128. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_PMACS_HWMLOS_GET(word) \
  10129. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_GET(word)
  10130. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_SET(word0, _val) \
  10131. do { \
  10132. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS, _val); \
  10133. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S));\
  10134. } while (0)
  10135. /* dword0 - b'23 - POST_RESET_ENABLE_RXDMA_PREFETCH */
  10136. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_M 0x800000
  10137. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S 23
  10138. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word0) \
  10139. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_M) >> \
  10140. HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S)
  10141. /* provide properly-named macro */
  10142. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word) \
  10143. HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word)
  10144. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_SET(word0, _val) \
  10145. do { \
  10146. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH, _val); \
  10147. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S));\
  10148. } while (0)
  10149. /* dword0 - b'24 - POST_RESET_TCL */
  10150. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_M 0x1000000
  10151. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S 24
  10152. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_GET(word0) \
  10153. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_M) >> \
  10154. HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S)
  10155. /* provide properly-named macro */
  10156. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TCL_GET(word) \
  10157. HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_GET(word)
  10158. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_SET(word0, _val) \
  10159. do { \
  10160. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL, _val); \
  10161. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S));\
  10162. } while (0)
  10163. /* dword0 - b'25 - POST_RESET_HOST_ENQ */
  10164. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_M 0x2000000
  10165. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S 25
  10166. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_GET(word0) \
  10167. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_M) >> \
  10168. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S)
  10169. /* provide properly-named macro */
  10170. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_HOST_ENQ_GET(word) \
  10171. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_GET(word)
  10172. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_SET(word0, _val) \
  10173. do { \
  10174. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ, _val); \
  10175. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S));\
  10176. } while (0)
  10177. /* dword0 - b'26 - POST_RESET_VERIFY_UMAC_RECOVERED */
  10178. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_M 0x4000000
  10179. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S 26
  10180. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word0) \
  10181. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_M) >> \
  10182. HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S)
  10183. /* provide properly-named macro */
  10184. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word) \
  10185. HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word)
  10186. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_SET(word0, _val) \
  10187. do { \
  10188. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED, _val); \
  10189. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S));\
  10190. } while (0)
  10191. typedef struct {
  10192. htt_tlv_hdr_t tlv_hdr;
  10193. A_UINT32 last_trigger_request_ms;
  10194. A_UINT32 last_start_ms;
  10195. A_UINT32 last_start_disengage_umac_ms;
  10196. A_UINT32 last_enter_ssr_platform_thread_ms;
  10197. A_UINT32 last_exit_ssr_platform_thread_ms;
  10198. A_UINT32 last_start_engage_umac_ms;
  10199. A_UINT32 last_done_successful_ms;
  10200. A_UINT32 post_reset_tqm_sync_cmd_completion_ms;
  10201. A_UINT32 htt_sync_mlo_initiate_umac_recovery_ms;
  10202. A_UINT32 htt_sync_do_pre_reset_ms;
  10203. A_UINT32 htt_sync_do_post_reset_start_ms;
  10204. A_UINT32 htt_sync_do_post_reset_complete_ms;
  10205. } htt_stats_mlo_umac_ssr_kpi_tstmp_tlv;
  10206. /* preserve old name alias for new name consistent with the tag name */
  10207. typedef htt_stats_mlo_umac_ssr_kpi_tstmp_tlv
  10208. htt_mlo_umac_ssr_kpi_tstamp_stats_tlv;
  10209. typedef struct {
  10210. htt_tlv_hdr_t tlv_hdr;
  10211. A_UINT32 htt_sync_start_ms;
  10212. A_UINT32 htt_sync_delta_ms;
  10213. A_UINT32 post_t2h_start_ms;
  10214. A_UINT32 post_t2h_delta_ms;
  10215. A_UINT32 post_t2h_msg_read_shmem_ms;
  10216. A_UINT32 post_t2h_msg_write_shmem_ms;
  10217. A_UINT32 post_t2h_msg_send_msg_to_host_ms;
  10218. } htt_stats_mlo_umac_ssr_handshake_tlv;
  10219. /* preserve old name alias for new name consistent with the tag name */
  10220. typedef htt_stats_mlo_umac_ssr_handshake_tlv
  10221. htt_mlo_umac_htt_handshake_stats_tlv;
  10222. #ifdef ATH_TARGET
  10223. typedef struct {
  10224. /*
  10225. * Note that the host cannot use this struct directly, but instead needs
  10226. * to use the TLV header within each element of each of the arrays in
  10227. * this struct to determine where the subsequent item resides.
  10228. */
  10229. htt_stats_mlo_umac_ssr_dbg_tlv dbg_point[HTT_MLO_UMAC_SSR_DBG_POINT_MAX];
  10230. htt_stats_mlo_umac_ssr_handshake_tlv htt_handshakes[HTT_MLO_UMAC_RECOVERY_HANDSHAKE_COUNT];
  10231. } htt_mlo_umac_ssr_kpi_delta_stats_t;
  10232. #endif /* ATH_TARGET */
  10233. #ifdef ATH_TARGET
  10234. typedef struct {
  10235. /*
  10236. * Since each item within htt_mlo_umac_ssr_kpi_delta_stats_t has its own
  10237. * TLV header, and since no additional fields are added in this struct
  10238. * beyond the htt_mlo_umac_ssr_kpi_delta_stats_t info, no additional
  10239. * TLV header is needed.
  10240. *
  10241. * Note that the host cannot use this struct directly, but instead needs
  10242. * to use the TLV header within each item inside the
  10243. * htt_mlo_umac_ssr_kpi_delta_stats_t to determine where the subsequent
  10244. * item resides.
  10245. */
  10246. htt_mlo_umac_ssr_kpi_delta_stats_t kpi_delta;
  10247. } htt_mlo_umac_ssr_kpi_delta_stats_tlv;
  10248. #endif /* ATH_TARGET */
  10249. typedef struct {
  10250. A_UINT32 last_e2e_delta_ms;
  10251. A_UINT32 max_e2e_delta_ms;
  10252. A_UINT32 per_handshake_max_allowed_delta_ms;
  10253. /* Total done count */
  10254. A_UINT32 total_success_runs_cnt;
  10255. A_UINT32 umac_recovery_in_progress;
  10256. /* Count of Disengaged in Pre reset */
  10257. A_UINT32 umac_disengaged_count;
  10258. /* Count of UMAC Soft/Control Reset */
  10259. A_UINT32 umac_soft_reset_count;
  10260. /* Count of Engaged in Post reset */
  10261. A_UINT32 umac_engaged_count;
  10262. } htt_mlo_umac_ssr_common_stats_t;
  10263. typedef struct {
  10264. htt_tlv_hdr_t tlv_hdr;
  10265. htt_mlo_umac_ssr_common_stats_t cmn;
  10266. } htt_stats_mlo_umac_ssr_cmn_tlv;
  10267. /* preserve old name alias for new name consistent with the tag name */
  10268. typedef htt_stats_mlo_umac_ssr_cmn_tlv htt_mlo_umac_ssr_common_stats_tlv;
  10269. typedef struct {
  10270. A_UINT32 trigger_requests_count;
  10271. A_UINT32 trigger_count_for_umac_hang;
  10272. A_UINT32 trigger_count_for_mlo_target_recovery_mode1;
  10273. A_UINT32 trigger_count_for_unknown_signature;
  10274. A_UINT32 total_trig_dropped;
  10275. A_UINT32 trigger_count_for_unit_test_direct_trigger;
  10276. A_UINT32 trigger_count_for_tx_de_wdg_dummy_frame_tout;
  10277. A_UINT32 trigger_count_for_peer_delete_wdg_dummy_frame_tout;
  10278. A_UINT32 trigger_count_for_reo_hang;
  10279. A_UINT32 trigger_count_for_tqm_hang;
  10280. A_UINT32 trigger_count_for_tcl_hang;
  10281. A_UINT32 trigger_count_for_wbm_hang;
  10282. } htt_mlo_umac_ssr_trigger_stats_t;
  10283. typedef struct {
  10284. htt_tlv_hdr_t tlv_hdr;
  10285. htt_mlo_umac_ssr_trigger_stats_t trigger;
  10286. } htt_stats_mlo_umac_ssr_trigger_tlv;
  10287. /* preserve old name alias for new name consistent with the tag name */
  10288. typedef htt_stats_mlo_umac_ssr_trigger_tlv htt_mlo_umac_ssr_trigger_stats_tlv;
  10289. #ifdef ATH_TARGET
  10290. typedef struct {
  10291. /*
  10292. * Note that the host cannot use this struct directly, but instead needs
  10293. * to use the TLV header within each element to determine where the
  10294. * subsequent element resides.
  10295. */
  10296. htt_mlo_umac_ssr_kpi_delta_stats_tlv kpi_delta_tlv;
  10297. htt_stats_mlo_umac_ssr_kpi_tstmp_tlv kpi_tstamp_tlv;
  10298. } htt_mlo_umac_ssr_kpi_stats_t;
  10299. #endif /* ATH_TARGET */
  10300. #ifdef ATH_TARGET
  10301. typedef struct {
  10302. /*
  10303. * Since the embedded sub-struct within htt_mlo_umac_ssr_kpi_stats_tlv
  10304. * has its own TLV header, and since no additional fields are added in
  10305. * this struct beyond the htt_mlo_umac_ssr_kpi_stats_t info, no additional
  10306. * TLV header is needed.
  10307. *
  10308. * Note that the host cannot use this struct directly, but instead needs
  10309. * to use the TLV header within the htt_mlo_umac_ssr_kpi_stats_t sub-struct
  10310. * to determine how much data is present for this struct.
  10311. */
  10312. htt_mlo_umac_ssr_kpi_stats_t kpi;
  10313. } htt_mlo_umac_ssr_kpi_stats_tlv;
  10314. #endif /* ATH_TARGET */
  10315. #ifdef ATH_TARGET
  10316. typedef struct {
  10317. /*
  10318. * Note that the host cannot use this struct directly, but instead needs
  10319. * to use the TLV header within each element to determine where the
  10320. * subsequent element resides.
  10321. */
  10322. htt_stats_mlo_umac_ssr_trigger_tlv trigger_tlv;
  10323. htt_mlo_umac_ssr_kpi_stats_tlv kpi_tlv;
  10324. htt_stats_mlo_umac_ssr_mlo_tlv mlo_tlv;
  10325. htt_stats_mlo_umac_ssr_cmn_tlv cmn_tlv;
  10326. } htt_mlo_umac_ssr_stats_tlv;
  10327. #endif /* ATH_TARGET */
  10328. /*============= end MLO UMAC SSR stats ============= } */
  10329. typedef struct {
  10330. A_UINT32 total_done;
  10331. A_UINT32 trigger_requests_count;
  10332. A_UINT32 total_trig_dropped;
  10333. A_UINT32 umac_disengaged_count;
  10334. A_UINT32 umac_soft_reset_count;
  10335. A_UINT32 umac_engaged_count;
  10336. A_UINT32 last_trigger_request_ms;
  10337. A_UINT32 last_start_ms;
  10338. A_UINT32 last_start_disengage_umac_ms;
  10339. A_UINT32 last_enter_ssr_platform_thread_ms;
  10340. A_UINT32 last_exit_ssr_platform_thread_ms;
  10341. A_UINT32 last_start_engage_umac_ms;
  10342. A_UINT32 last_done_successful_ms;
  10343. A_UINT32 last_e2e_delta_ms;
  10344. A_UINT32 max_e2e_delta_ms;
  10345. A_UINT32 trigger_count_for_umac_hang;
  10346. A_UINT32 trigger_count_for_mlo_quick_ssr;
  10347. A_UINT32 trigger_count_for_unknown_signature;
  10348. A_UINT32 post_reset_tqm_sync_cmd_completion_ms;
  10349. A_UINT32 htt_sync_mlo_initiate_umac_recovery_ms;
  10350. A_UINT32 htt_sync_do_pre_reset_ms;
  10351. A_UINT32 htt_sync_do_post_reset_start_ms;
  10352. A_UINT32 htt_sync_do_post_reset_complete_ms;
  10353. } htt_umac_ssr_stats_t;
  10354. typedef struct {
  10355. htt_tlv_hdr_t tlv_hdr;
  10356. htt_umac_ssr_stats_t stats;
  10357. } htt_stats_umac_ssr_tlv;
  10358. /* preserve old name alias for new name consistent with the tag name */
  10359. typedef htt_stats_umac_ssr_tlv htt_umac_ssr_stats_tlv;
  10360. typedef struct {
  10361. htt_tlv_hdr_t tlv_hdr;
  10362. A_UINT32 svc_class_id;
  10363. /* codel_drops:
  10364. * How many times have MSDU queues belonging to this service class
  10365. * dropped their head MSDU due to the queue's latency being above
  10366. * the CoDel latency limit specified for the service class throughout
  10367. * the full CoDel latency statistics collection window.
  10368. */
  10369. A_UINT32 codel_drops;
  10370. /* codel_no_drops:
  10371. * How many times have MSDU queues belonging to this service class
  10372. * completed a CoDel latency statistics collection window and
  10373. * concluded that no head MSDU drop is needed, due to the MSDU queue's
  10374. * latency being under the limit specified for the service class at
  10375. * some point during the window.
  10376. */
  10377. A_UINT32 codel_no_drops;
  10378. } htt_stats_codel_svc_class_tlv;
  10379. /* preserve old name alias for new name consistent with the tag name */
  10380. typedef htt_stats_codel_svc_class_tlv htt_codel_svc_class_stats_tlv;
  10381. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_M 0x0000FFFF
  10382. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S 0
  10383. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_GET(_var) \
  10384. (((_var) & HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_M) >> \
  10385. HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S)
  10386. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_SET(_var, _val) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM, _val); \
  10389. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S)); \
  10390. } while (0)
  10391. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_M 0x00FF0000
  10392. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S 16
  10393. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_GET(_var) \
  10394. (((_var) & HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_M) >> \
  10395. HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S)
  10396. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_SET(_var, _val) \
  10397. do { \
  10398. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID, _val); \
  10399. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S)); \
  10400. } while (0)
  10401. #define HTT_CODEL_MSDUQ_STATS_DROPS_M 0x0000FFFF
  10402. #define HTT_CODEL_MSDUQ_STATS_DROPS_S 0
  10403. #define HTT_CODEL_MSDUQ_STATS_DROPS_GET(_var) \
  10404. (((_var) & HTT_CODEL_MSDUQ_STATS_DROPS_M) >> \
  10405. HTT_CODEL_MSDUQ_STATS_DROPS_S)
  10406. #define HTT_CODEL_MSDUQ_STATS_DROPS_SET(_var, _val) \
  10407. do { \
  10408. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_DROPS, _val); \
  10409. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_DROPS_S)); \
  10410. } while (0)
  10411. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_M 0xFFFF0000
  10412. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_S 16
  10413. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_GET(_var) \
  10414. (((_var) & HTT_CODEL_MSDUQ_STATS_NO_DROPS_M) >> \
  10415. HTT_CODEL_MSDUQ_STATS_NO_DROPS_S)
  10416. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_SET(_var, _val) \
  10417. do { \
  10418. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_NO_DROPS, _val); \
  10419. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_NO_DROPS_S)); \
  10420. } while (0)
  10421. typedef struct {
  10422. htt_tlv_hdr_t tlv_hdr;
  10423. union {
  10424. A_UINT32 id__word;
  10425. struct {
  10426. A_UINT32 tx_flow_num: 16, /* FW's MSDU queue ID */
  10427. svc_class_id: 8,
  10428. reserved: 8;
  10429. };
  10430. };
  10431. union {
  10432. A_UINT32 stats__word;
  10433. struct {
  10434. A_UINT32
  10435. codel_drops: 16,
  10436. codel_no_drops: 16;
  10437. };
  10438. };
  10439. } htt_stats_codel_msduq_tlv;
  10440. /* preserve old name alias for new name consistent with the tag name */
  10441. typedef htt_stats_codel_msduq_tlv htt_codel_msduq_stats_tlv;
  10442. /*===================== start MLO stats ====================*/
  10443. typedef struct {
  10444. htt_tlv_hdr_t tlv_hdr;
  10445. A_UINT32 pref_link_num_sec_link_sched;
  10446. A_UINT32 pref_link_num_pref_link_timeout;
  10447. A_UINT32 pref_link_num_pref_link_sch_delay_ipc;
  10448. A_UINT32 pref_link_num_pref_link_timeout_ipc;
  10449. } htt_stats_mlo_sched_stats_tlv;
  10450. /* preserve old name alias for new name consistent with the tag name */
  10451. typedef htt_stats_mlo_sched_stats_tlv htt_mlo_sched_stats_tlv;
  10452. /* STATS_TYPE : HTT_DBG_MLO_SCHED_STATS
  10453. * TLV_TAGS:
  10454. * - HTT_STATS_MLO_SCHED_STATS_TAG
  10455. */
  10456. /* NOTE:
  10457. * This structure is for documentation, and cannot be safely used directly.
  10458. * Instead, use the constituent TLV structures to fill/parse.
  10459. */
  10460. #ifdef ATH_TARGET
  10461. typedef struct _htt_mlo_sched_stats {
  10462. htt_stats_mlo_sched_stats_tlv preferred_link_stats;
  10463. } htt_mlo_sched_stats_t;
  10464. #endif /* ATH_TARGET */
  10465. #define HTT_STATS_HWMLO_MAX_LINKS 6
  10466. #define HTT_STATS_MLO_MAX_IPC_RINGS 7
  10467. typedef struct {
  10468. htt_tlv_hdr_t tlv_hdr;
  10469. A_UINT32 mlo_ipc_ring_full_cnt[HTT_STATS_HWMLO_MAX_LINKS][HTT_STATS_MLO_MAX_IPC_RINGS];
  10470. } htt_stats_pdev_mlo_ipc_stats_tlv;
  10471. /* preserve old name alias for new name consistent with the tag name */
  10472. typedef htt_stats_pdev_mlo_ipc_stats_tlv htt_pdev_mlo_ipc_stats_tlv;
  10473. /* STATS_TYPE : HTT_DBG_MLO_IPC_STATS
  10474. * TLV_TAGS:
  10475. * - HTT_STATS_PDEV_MLO_IPC_STATS_TAG
  10476. */
  10477. /* NOTE:
  10478. * This structure is for documentation, and cannot be safely used directly.
  10479. * Instead, use the constituent TLV structures to fill/parse.
  10480. */
  10481. #ifdef ATH_TARGET
  10482. typedef struct _htt_mlo_ipc_stats {
  10483. htt_stats_pdev_mlo_ipc_stats_tlv mlo_ipc_stats;
  10484. } htt_pdev_mlo_ipc_stats_t;
  10485. #endif /* ATH_TARGET */
  10486. /*===================== end MLO stats ======================*/
  10487. typedef enum {
  10488. HTT_CTRL_PATH_STATS_CAL_TYPE_ADC = 0x0,
  10489. HTT_CTRL_PATH_STATS_CAL_TYPE_DAC = 0x1,
  10490. HTT_CTRL_PATH_STATS_CAL_TYPE_PROCESS = 0x2,
  10491. HTT_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR = 0x3,
  10492. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO = 0x4,
  10493. HTT_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ = 0x5,
  10494. HTT_CTRL_PATH_STATS_CAL_TYPE_TXLO = 0x6,
  10495. HTT_CTRL_PATH_STATS_CAL_TYPE_TXIQ = 0x7,
  10496. HTT_CTRL_PATH_STATS_CAL_TYPE_RXIQ = 0x8,
  10497. HTT_CTRL_PATH_STATS_CAL_TYPE_IM2 = 0x9,
  10498. HTT_CTRL_PATH_STATS_CAL_TYPE_LNA = 0xa,
  10499. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO = 0xb,
  10500. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ = 0xc,
  10501. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS = 0xd,
  10502. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY = 0xe,
  10503. HTT_CTRL_PATH_STATS_CAL_TYPE_IBF = 0xf,
  10504. HTT_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL = 0x10,
  10505. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ = 0x11,
  10506. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM = 0x12,
  10507. HTT_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL = 0x13,
  10508. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ = 0x14,
  10509. HTT_CTRL_PATH_STATS_CAL_TYPE_BWFILTER = 0x15,
  10510. HTT_CTRL_PATH_STATS_CAL_TYPE_PEF = 0x16,
  10511. HTT_CTRL_PATH_STATS_CAL_TYPE_PADROOP = 0x17,
  10512. HTT_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC = 0x18,
  10513. HTT_CTRL_PATH_STATS_CAL_TYPE_RXSPUR = 0x19,
  10514. /* add new cal types above this line */
  10515. HTT_CTRL_PATH_STATS_CAL_TYPE_INVALID = 0xFF
  10516. } htt_ctrl_path_stats_cal_type_ids;
  10517. #define HTT_RETURN_STRING(str) case ((str)): return (A_UINT8 *)(# str);
  10518. #define HTT_GET_BITS(_val, _index, _num_bits) \
  10519. (((_val) >> (_index)) & ((1 << (_num_bits)) - 1))
  10520. #define HTT_CTRL_PATH_CALIBRATION_STATS_CAL_TYPE_GET(cal_info) \
  10521. HTT_GET_BITS(cal_info, 0, 8)
  10522. /*
  10523. * Used by some hosts to print names of cal type, based on
  10524. * htt_ctrl_path_cal_type_ids values specified in
  10525. * htt_ctrl_path_calibration_stats_struct in ctrl_path_stats event msg.
  10526. */
  10527. #ifdef HTT_CTRL_PATH_STATS_CAL_TYPE_STRINGS
  10528. static INLINE A_UINT8 *htt_ctrl_path_cal_type_id_to_name(A_UINT32 cal_type_id)
  10529. {
  10530. switch (cal_type_id)
  10531. {
  10532. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_ADC);
  10533. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DAC);
  10534. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PROCESS);
  10535. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR);
  10536. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO);
  10537. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ);
  10538. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TXLO);
  10539. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TXIQ);
  10540. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXIQ);
  10541. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_IM2);
  10542. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_LNA);
  10543. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO);
  10544. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ);
  10545. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS);
  10546. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY);
  10547. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_IBF);
  10548. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL);
  10549. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ);
  10550. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM);
  10551. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL);
  10552. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ);
  10553. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_BWFILTER);
  10554. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PEF);
  10555. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PADROOP);
  10556. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC);
  10557. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXSPUR);
  10558. }
  10559. return (A_UINT8 *) "HTT_CTRL_PATH_STATS_CAL_TYPE_UNKNOWN";
  10560. }
  10561. #endif /* HTT_CTRL_PATH_STATS_CAL_TYPE_STRINGS */
  10562. #endif /* __HTT_STATS_H__ */