htt_stats.h 312 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 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. /**
  30. * htt_dbg_ext_stats_type -
  31. * The base structure for each of the stats_type is only for reference
  32. * Host should use this information to know the type of TLVs to expect
  33. * for a particular stats type.
  34. *
  35. * Max supported stats :- 256.
  36. */
  37. enum htt_dbg_ext_stats_type {
  38. /** HTT_DBG_EXT_STATS_RESET
  39. * PARAM:
  40. * - config_param0 : start_offset (stats type)
  41. * - config_param1 : stats bmask from start offset
  42. * - config_param2 : stats bmask from start offset + 32
  43. * - config_param3 : stats bmask from start offset + 64
  44. * RESP MSG:
  45. * - No response sent.
  46. */
  47. HTT_DBG_EXT_STATS_RESET = 0,
  48. /** HTT_DBG_EXT_STATS_PDEV_TX
  49. * PARAMS:
  50. * - No Params
  51. * RESP MSG:
  52. * - htt_tx_pdev_stats_t
  53. */
  54. HTT_DBG_EXT_STATS_PDEV_TX = 1,
  55. /** HTT_DBG_EXT_STATS_PDEV_RX
  56. * PARAMS:
  57. * - No Params
  58. * RESP MSG:
  59. * - htt_rx_pdev_stats_t
  60. */
  61. HTT_DBG_EXT_STATS_PDEV_RX = 2,
  62. /** HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  63. * PARAMS:
  64. * - config_param0: [Bit31: Bit0] HWQ mask
  65. * RESP MSG:
  66. * - htt_tx_hwq_stats_t
  67. */
  68. HTT_DBG_EXT_STATS_PDEV_TX_HWQ = 3,
  69. /** HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  70. * PARAMS:
  71. * - config_param0: [Bit31: Bit0] TXQ mask
  72. * RESP MSG:
  73. * - htt_stats_tx_sched_t
  74. */
  75. HTT_DBG_EXT_STATS_PDEV_TX_SCHED = 4,
  76. /** HTT_DBG_EXT_STATS_PDEV_ERROR
  77. * PARAMS:
  78. * - No Params
  79. * RESP MSG:
  80. * - htt_hw_err_stats_t
  81. */
  82. HTT_DBG_EXT_STATS_PDEV_ERROR = 5,
  83. /** HTT_DBG_EXT_STATS_PDEV_TQM
  84. * PARAMS:
  85. * - No Params
  86. * RESP MSG:
  87. * - htt_tx_tqm_pdev_stats_t
  88. */
  89. HTT_DBG_EXT_STATS_PDEV_TQM = 6,
  90. /** HTT_DBG_EXT_STATS_TQM_CMDQ
  91. * PARAMS:
  92. * - config_param0:
  93. * [Bit15: Bit0 ] cmdq id :if 0xFFFF print all cmdq's
  94. * [Bit31: Bit16] reserved
  95. * RESP MSG:
  96. * - htt_tx_tqm_cmdq_stats_t
  97. */
  98. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  99. /** HTT_DBG_EXT_STATS_TX_DE_INFO
  100. * PARAMS:
  101. * - No Params
  102. * RESP MSG:
  103. * - htt_tx_de_stats_t
  104. */
  105. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  106. /** HTT_DBG_EXT_STATS_PDEV_TX_RATE
  107. * PARAMS:
  108. * - No Params
  109. * RESP MSG:
  110. * - htt_tx_pdev_rate_stats_t
  111. */
  112. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  113. /** HTT_DBG_EXT_STATS_PDEV_RX_RATE
  114. * PARAMS:
  115. * - No Params
  116. * RESP MSG:
  117. * - htt_rx_pdev_rate_stats_t
  118. */
  119. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  120. /** HTT_DBG_EXT_STATS_PEER_INFO
  121. * PARAMS:
  122. * - config_param0:
  123. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  124. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  125. * [Bit31 : Bit16] sw_peer_id
  126. * config_param1:
  127. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  128. * 0 bit htt_peer_stats_cmn_tlv
  129. * 1 bit htt_peer_details_tlv
  130. * 2 bit htt_tx_peer_rate_stats_tlv
  131. * 3 bit htt_rx_peer_rate_stats_tlv
  132. * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv
  133. * 5 bit htt_rx_tid_stats_tlv
  134. * 6 bit htt_msdu_flow_stats_tlv
  135. * 7 bit htt_peer_sched_stats_tlv
  136. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  137. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  138. * [Bit 16] If this bit is set, reset per peer stats
  139. * of corresponding tlv indicated by config
  140. * param 1.
  141. * HTT_DBG_EXT_PEER_STATS_RESET_GET will be
  142. * used to get this bit position.
  143. * WMI_SERVICE_PER_PEER_HTT_STATS_RESET
  144. * indicates that FW supports per peer HTT
  145. * stats reset.
  146. * [Bit31 : Bit17] reserved
  147. * RESP MSG:
  148. * - htt_peer_stats_t
  149. */
  150. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  151. /** HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  152. * PARAMS:
  153. * - No Params
  154. * RESP MSG:
  155. * - htt_tx_pdev_selfgen_stats_t
  156. */
  157. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  158. /** HTT_DBG_EXT_STATS_TX_MU_HWQ
  159. * PARAMS:
  160. * - config_param0: [Bit31: Bit0] HWQ mask
  161. * RESP MSG:
  162. * - htt_tx_hwq_mu_mimo_stats_t
  163. */
  164. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  165. /** HTT_DBG_EXT_STATS_RING_IF_INFO
  166. * PARAMS:
  167. * - config_param0:
  168. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  169. * [Bit31: Bit16] reserved
  170. * RESP MSG:
  171. * - htt_ring_if_stats_t
  172. */
  173. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  174. /** HTT_DBG_EXT_STATS_SRNG_INFO
  175. * PARAMS:
  176. * - config_param0:
  177. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  178. * [Bit31: Bit16] reserved
  179. * - No Params
  180. * RESP MSG:
  181. * - htt_sring_stats_t
  182. */
  183. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  184. /** HTT_DBG_EXT_STATS_SFM_INFO
  185. * PARAMS:
  186. * - No Params
  187. * RESP MSG:
  188. * - htt_sfm_stats_t
  189. */
  190. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  191. /** HTT_DBG_EXT_STATS_PDEV_TX_MU
  192. * PARAMS:
  193. * - No Params
  194. * RESP MSG:
  195. * - htt_tx_pdev_mu_mimo_stats_t
  196. */
  197. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  198. /** HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  199. * PARAMS:
  200. * - config_param0:
  201. * [Bit7 : Bit0] vdev_id:8
  202. * note:0xFF to get all active peers based on pdev_mask.
  203. * [Bit31 : Bit8] rsvd:24
  204. * RESP MSG:
  205. * - htt_active_peer_details_list_t
  206. */
  207. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  208. /** HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  209. * PARAMS:
  210. * - config_param0:
  211. * [Bit0] - Clear bit0 to read 1sec,100ms & cumulative CCA stats.
  212. * Set bit0 to 1 to read 1sec interval histogram.
  213. * [Bit1] - 100ms interval histogram
  214. * [Bit3] - Cumulative CCA stats
  215. * RESP MSG:
  216. * - htt_pdev_cca_stats_t
  217. */
  218. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  219. /** HTT_DBG_EXT_STATS_TWT_SESSIONS
  220. * PARAMS:
  221. * - config_param0:
  222. * No params
  223. * RESP MSG:
  224. * - htt_pdev_twt_sessions_stats_t
  225. */
  226. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  227. /** HTT_DBG_EXT_STATS_REO_CNTS
  228. * PARAMS:
  229. * - config_param0:
  230. * No params
  231. * RESP MSG:
  232. * - htt_soc_reo_resource_stats_t
  233. */
  234. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  235. /** HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  236. * PARAMS:
  237. * - config_param0:
  238. * [Bit0] vdev_id_set:1
  239. * set to 1 if vdev_id is set and vdev stats are requested.
  240. * set to 0 if pdev_stats sounding stats are requested.
  241. * [Bit8 : Bit1] vdev_id:8
  242. * note:0xFF to get all active vdevs based on pdev_mask.
  243. * [Bit31 : Bit9] rsvd:22
  244. *
  245. * RESP MSG:
  246. * - htt_tx_sounding_stats_t
  247. */
  248. HTT_DBG_EXT_STATS_TX_SOUNDING_INFO = 22,
  249. /** HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS
  250. * PARAMS:
  251. * - config_param0:
  252. * No params
  253. * RESP MSG:
  254. * - htt_pdev_obss_pd_stats_t
  255. */
  256. HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
  257. /** HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS
  258. * PARAMS:
  259. * - config_param0:
  260. * No params
  261. * RESP MSG:
  262. * - htt_stats_ring_backpressure_stats_t
  263. */
  264. HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
  265. /** HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  266. * PARAMS:
  267. *
  268. * RESP MSG:
  269. * - htt_soc_latency_prof_t
  270. */
  271. HTT_DBG_EXT_STATS_LATENCY_PROF_STATS = 25,
  272. /** HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  273. * PARAMS:
  274. * - No Params
  275. * RESP MSG:
  276. * - htt_rx_pdev_ul_trig_stats_t
  277. */
  278. HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS = 26,
  279. /** HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27
  280. * PARAMS:
  281. * - No Params
  282. * RESP MSG:
  283. * - htt_rx_pdev_ul_mumimo_trig_stats_t
  284. */
  285. HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27,
  286. /** HTT_DBG_EXT_STATS_FSE_RX
  287. * PARAMS:
  288. * - No Params
  289. * RESP MSG:
  290. * - htt_rx_fse_stats_t
  291. */
  292. HTT_DBG_EXT_STATS_FSE_RX = 28,
  293. /** HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  294. * PARAMS:
  295. * - config_param0: [Bit0] : [1] for mac_addr based request
  296. * - config_param1: [Bit31 : Bit0] mac_addr31to0
  297. * - config_param2: [Bit15 : Bit0] mac_addr47to32
  298. * RESP MSG:
  299. * - htt_ctrl_path_txrx_stats_t
  300. */
  301. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS = 29,
  302. /** HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  303. * PARAMS:
  304. * - No Params
  305. * RESP MSG:
  306. * - htt_rx_pdev_rate_ext_stats_t
  307. */
  308. HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT = 30,
  309. /** HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF
  310. * PARAMS:
  311. * - No Params
  312. * RESP MSG:
  313. * - htt_tx_pdev_txbf_rate_stats_t
  314. */
  315. HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF = 31,
  316. /** HTT_DBG_EXT_STATS_TXBF_OFDMA
  317. */
  318. HTT_DBG_EXT_STATS_TXBF_OFDMA = 32,
  319. /** HTT_DBG_EXT_STA_11AX_UL_STATS
  320. * PARAMS:
  321. * - No Params
  322. * RESP MSG:
  323. * - htt_sta_11ax_ul_stats
  324. */
  325. HTT_DBG_EXT_STA_11AX_UL_STATS = 33,
  326. /** HTT_DBG_EXT_VDEV_RTT_RESP_STATS
  327. * PARAMS:
  328. * - config_param0:
  329. * [Bit7 : Bit0] vdev_id:8
  330. * [Bit31 : Bit8] rsvd:24
  331. * RESP MSG:
  332. * -
  333. */
  334. HTT_DBG_EXT_VDEV_RTT_RESP_STATS = 34,
  335. /** HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  336. * PARAMS:
  337. * - No Params
  338. * RESP MSG:
  339. * - htt_pktlog_and_htt_ring_stats_t
  340. */
  341. HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS = 35,
  342. /** HTT_DBG_EXT_STATS_DLPAGER_STATS
  343. * PARAMS:
  344. *
  345. * RESP MSG:
  346. * - htt_dlpager_stats_t
  347. */
  348. HTT_DBG_EXT_STATS_DLPAGER_STATS = 36,
  349. /** HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  350. * PARAMS:
  351. * - No Params
  352. * RESP MSG:
  353. * - htt_phy_counters_and_phy_stats_t
  354. */
  355. HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
  356. /** HTT_DBG_EXT_VDEVS_TXRX_STATS
  357. * PARAMS:
  358. * - No Params
  359. * RESP MSG:
  360. * - htt_vdevs_txrx_stats_t
  361. */
  362. HTT_DBG_EXT_VDEVS_TXRX_STATS = 38,
  363. HTT_DBG_EXT_VDEV_RTT_INITIATOR_STATS = 39,
  364. /** HTT_DBG_EXT_PDEV_PER_STATS
  365. * PARAMS:
  366. * - No Params
  367. * RESP MSG:
  368. * - htt_tx_pdev_per_stats_t
  369. */
  370. HTT_DBG_EXT_PDEV_PER_STATS = 40,
  371. HTT_DBG_EXT_AST_ENTRIES = 41,
  372. /** HTT_DBG_EXT_RX_RING_STATS
  373. * PARAMS:
  374. * - No Params
  375. * RESP MSG:
  376. * - htt_rx_fw_ring_stats_tlv_v
  377. */
  378. HTT_DBG_EXT_RX_RING_STATS = 42,
  379. /** HTT_STRM_GEN_MPDUS_STATS, HTT_STRM_GEN_MPDUS_DETAILS_STATS
  380. * PARAMS:
  381. * - No params
  382. * RESP MSG: HTT_T2H STREAMING_STATS_IND (not EXT_STATS_CONF)
  383. * - HTT_STRM_GEN_MPDUS_STATS:
  384. * htt_stats_strm_gen_mpdus_tlv_t
  385. * - HTT_STRM_GEN_MPDUS_DETAILS_STATS:
  386. * htt_stats_strm_gen_mpdus_details_tlv_t
  387. */
  388. HTT_STRM_GEN_MPDUS_STATS = 43,
  389. HTT_STRM_GEN_MPDUS_DETAILS_STATS = 44,
  390. /** HTT_DBG_SOC_ERROR_STATS
  391. * PARAMS:
  392. * - No Params
  393. * RESP MSG:
  394. * - htt_dmac_reset_stats_tlv
  395. */
  396. HTT_DBG_SOC_ERROR_STATS = 45,
  397. /** HTT_DBG_PDEV_PUNCTURE_STATS
  398. * PARAMS:
  399. * - param 0: enum from htt_tx_pdev_puncture_stats_upload_t, indicating
  400. * the stats to upload
  401. * RESP MSG:
  402. * - one or more htt_pdev_puncture_stats_tlv, depending on param 0
  403. */
  404. HTT_DBG_PDEV_PUNCTURE_STATS = 46,
  405. /** HTT_DBG_EXT_STATS_ML_PEERS_INFO
  406. * PARAMS:
  407. * - param 0:
  408. * Bit 0 -> HTT_ML_PEER_DETAILS_TLV always enabled by default
  409. * Bit 1 -> HTT_ML_PEER_EXT_DETAILS_TLV will be uploaded when
  410. * this bit is set
  411. * Bit 2 -> HTT_ML_LINK_INFO_TLV will be uploaded when this bit is set
  412. * RESP MSG:
  413. * - htt_ml_peer_stats_t
  414. */
  415. HTT_DBG_EXT_STATS_ML_PEERS_INFO = 47,
  416. /** HTT_DBG_ODD_MANDATORY_STATS
  417. * params:
  418. * None
  419. * Response MSG:
  420. * htt_odd_mandatory_pdev_stats_tlv
  421. */
  422. HTT_DBG_ODD_MANDATORY_STATS = 48,
  423. /** HTT_DBG_PDEV_SCHED_ALGO_STATS
  424. * PARAMS:
  425. * - No Params
  426. * RESP MSG:
  427. * - htt_pdev_sched_algo_ofdma_stats_tlv
  428. */
  429. HTT_DBG_PDEV_SCHED_ALGO_STATS = 49,
  430. /** HTT_DBG_ODD_MANDATORY_MUMIMO_STATS
  431. * params:
  432. * None
  433. * Response MSG:
  434. * htt_odd_mandatory_mumimo_pdev_stats_tlv
  435. */
  436. HTT_DBG_ODD_MANDATORY_MUMIMO_STATS = 50,
  437. /** HTT_DBG_ODD_MANDATORY_MUOFDMA_STATS
  438. * params:
  439. * None
  440. * Response MSG:
  441. * htt_odd_mandatory_muofdma_pdev_stats_tlv
  442. */
  443. HTT_DBG_ODD_MANDATORY_MUOFDMA_STATS = 51,
  444. /** HTT_DBG_EXT_PHY_PROF_CAL_STATS
  445. * params:
  446. * None
  447. * Response MSG:
  448. * htt_latency_prof_cal_stats_tlv
  449. */
  450. HTT_DBG_EXT_PHY_PROF_CAL_STATS = 52,
  451. /* keep this last */
  452. HTT_DBG_NUM_EXT_STATS = 256,
  453. };
  454. /*
  455. * Macros to get/set the bit field in config param[3] that indicates to
  456. * clear corresponding per peer stats specified by config param 1
  457. */
  458. #define HTT_DBG_EXT_PEER_STATS_RESET_M 0x00010000
  459. #define HTT_DBG_EXT_PEER_STATS_RESET_S 16
  460. #define HTT_DBG_EXT_PEER_STATS_RESET_GET(_var) \
  461. (((_var) & HTT_DBG_EXT_PEER_STATS_RESET_M) >> \
  462. HTT_DBG_EXT_PEER_STATS_RESET_S)
  463. #define HTT_DBG_EXT_PEER_STATS_RESET_SET(_var, _val) \
  464. do { \
  465. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_STATS_RESET, _val); \
  466. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_STATS_RESET_S)); \
  467. } while (0)
  468. #define HTT_STATS_SUBTYPE_MAX 16
  469. /* htt_mu_stats_upload_t
  470. * Enumerations for specifying whether to upload all MU stats in response to
  471. * HTT_DBG_EXT_STATS_PDEV_TX_MU, or if not all, then which subset.
  472. */
  473. typedef enum {
  474. /* HTT_UPLOAD_MU_STATS: upload all MU stats:
  475. * UL MU-MIMO + DL MU-MIMO + UL MU-OFDMA + DL MU-OFDMA
  476. * (note: included OFDMA stats are limited to 11ax)
  477. */
  478. HTT_UPLOAD_MU_STATS,
  479. /* HTT_UPLOAD_MU_MIMO_STATS: upload UL MU-MIMO + DL MU-MIMO stats */
  480. HTT_UPLOAD_MU_MIMO_STATS,
  481. /* HTT_UPLOAD_MU_OFDMA_STATS:
  482. * upload UL MU-OFDMA + DL MU-OFDMA stats (note: 11ax only stats)
  483. */
  484. HTT_UPLOAD_MU_OFDMA_STATS,
  485. HTT_UPLOAD_DL_MU_MIMO_STATS,
  486. HTT_UPLOAD_UL_MU_MIMO_STATS,
  487. /* HTT_UPLOAD_DL_MU_OFDMA_STATS:
  488. * upload DL MU-OFDMA stats (note: 11ax only stats)
  489. */
  490. HTT_UPLOAD_DL_MU_OFDMA_STATS,
  491. /* HTT_UPLOAD_UL_MU_OFDMA_STATS:
  492. * upload UL MU-OFDMA stats (note: 11ax only stats)
  493. */
  494. HTT_UPLOAD_UL_MU_OFDMA_STATS,
  495. /*
  496. * Upload BE UL MU-OFDMA + BE DL MU-OFDMA stats,
  497. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv and
  498. * htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  499. */
  500. HTT_UPLOAD_BE_MU_OFDMA_STATS,
  501. /*
  502. * Upload BE DL MU-OFDMA
  503. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv
  504. */
  505. HTT_UPLOAD_BE_DL_MU_OFDMA_STATS,
  506. /*
  507. * Upload BE UL MU-OFDMA
  508. * TLV: htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  509. */
  510. HTT_UPLOAD_BE_UL_MU_OFDMA_STATS,
  511. } htt_mu_stats_upload_t;
  512. /* htt_tx_rate_stats_upload_t
  513. * Enumerations for specifying which stats to upload in response to
  514. * HTT_DBG_EXT_STATS_PDEV_TX_RATE.
  515. */
  516. typedef enum {
  517. /* 11abgn, 11ac, and 11ax TX stats, and a few 11be SU stats
  518. *
  519. * TLV: htt_tx_pdev_rate_stats_tlv
  520. */
  521. HTT_TX_RATE_STATS_DEFAULT,
  522. /*
  523. * Upload 11be OFDMA TX stats
  524. *
  525. * TLV: htt_tx_pdev_rate_stats_be_ofdma_tlv
  526. */
  527. HTT_TX_RATE_STATS_UPLOAD_11BE_OFDMA,
  528. } htt_tx_rate_stats_upload_t;
  529. /* htt_rx_ul_trigger_stats_upload_t
  530. * Enumerations for specifying which stats to upload in response to
  531. * HTT_DBG_EXT_STATS_PDEV_TX_RATE.
  532. */
  533. typedef enum {
  534. /* Upload 11ax UL OFDMA RX Trigger stats
  535. *
  536. * TLV: htt_rx_pdev_ul_trigger_stats_tlv
  537. */
  538. HTT_RX_UL_TRIGGER_STATS_UPLOAD_11AX_OFDMA,
  539. /*
  540. * Upload 11be UL OFDMA RX Trigger stats
  541. *
  542. * TLV: htt_rx_pdev_be_ul_trigger_stats_tlv
  543. */
  544. HTT_RX_UL_TRIGGER_STATS_UPLOAD_11BE_OFDMA,
  545. } htt_rx_ul_trigger_stats_upload_t;
  546. /*
  547. * The htt_rx_ul_mumimo_trigger_stats_upload_t enum values are
  548. * provided by the host as one of the config param elements in
  549. * the HTT_H2T EXT_STATS_REQ message, for stats type ==
  550. * HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS.
  551. */
  552. typedef enum {
  553. /*
  554. * Upload 11ax UL MUMIMO RX Trigger stats
  555. * TLV: htt_rx_pdev_ul_mumimo_trig_stats_tlv
  556. */
  557. HTT_RX_UL_MUMIMO_TRIGGER_STATS_UPLOAD_11AX,
  558. /*
  559. * Upload 11be UL MUMIMO RX Trigger stats
  560. * TLV: htt_rx_pdev_ul_mumimo_trig_be_stats_tlv
  561. */
  562. HTT_RX_UL_MUMIMO_TRIGGER_STATS_UPLOAD_11BE,
  563. } htt_rx_ul_mumimo_trigger_stats_upload_t;
  564. /* htt_tx_pdev_txbf_ofdma_stats_upload_t
  565. * Enumerations for specifying which stats to upload in response to
  566. * HTT_DBG_EXT_STATS_TXBF_OFDMA.
  567. */
  568. typedef enum {
  569. /* upload 11ax TXBF OFDMA stats
  570. *
  571. * TLV: htt_tx_pdev_ax_txbf_ofdma_stats_t
  572. */
  573. HTT_UPLOAD_AX_TXBF_OFDMA_STATS,
  574. /*
  575. * Upload 11be TXBF OFDMA stats
  576. *
  577. * TLV: htt_tx_pdev_be_txbf_ofdma_stats_t
  578. */
  579. HTT_UPLOAD_BE_TXBF_OFDMA_STATS,
  580. } htt_tx_pdev_txbf_ofdma_stats_upload_t;
  581. /* htt_tx_pdev_puncture_stats_upload_t
  582. * Enumerations for specifying which stats to upload in response to
  583. * HTT_DBG_PDEV_PUNCTURE_STATS.
  584. */
  585. typedef enum {
  586. /* upload puncture stats for all supported modes, both TX and RX */
  587. HTT_UPLOAD_PUNCTURE_STATS_ALL,
  588. /* upload puncture stats for all supported TX modes */
  589. HTT_UPLOAD_PUNCTURE_STATS_TX,
  590. /* upload puncture stats for all supported RX modes */
  591. HTT_UPLOAD_PUNCTURE_STATS_RX,
  592. } htt_tx_pdev_puncture_stats_upload_t;
  593. #define HTT_STATS_MAX_STRING_SZ32 4
  594. #define HTT_STATS_MACID_INVALID 0xff
  595. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  596. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  597. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  598. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  599. #define HTT_PDEV_STATS_PPDU_DUR_HIST_BINS 16
  600. #define HTT_PDEV_STATS_PPDU_DUR_HIST_INTERVAL_US 250
  601. typedef enum {
  602. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  603. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  604. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  605. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  606. } htt_tx_pdev_underrun_enum;
  607. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 150
  608. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  609. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  610. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  611. /* HTT_TX_PDEV_SCHED_TX_MODE_MAX:
  612. * DEPRECATED - num sched tx mode max is 8
  613. */
  614. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  615. #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  616. #define HTT_RX_STATS_REFILL_MAX_RING 4
  617. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  618. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  619. /* Bytes stored in little endian order */
  620. /* Length should be multiple of DWORD */
  621. typedef struct {
  622. htt_tlv_hdr_t tlv_hdr;
  623. A_UINT32 data[1]; /* Can be variable length */
  624. } htt_stats_string_tlv;
  625. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  626. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  627. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  628. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  629. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  630. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  631. do { \
  632. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  633. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  634. } while (0)
  635. /* == TX PDEV STATS == */
  636. typedef struct {
  637. htt_tlv_hdr_t tlv_hdr;
  638. /**
  639. * BIT [ 7 : 0] :- mac_id
  640. * BIT [31 : 8] :- reserved
  641. */
  642. A_UINT32 mac_id__word;
  643. /** Num PPDUs queued to HW */
  644. A_UINT32 hw_queued;
  645. /** Num PPDUs reaped from HW */
  646. A_UINT32 hw_reaped;
  647. /** Num underruns */
  648. A_UINT32 underrun;
  649. /** Num HW Paused counter */
  650. A_UINT32 hw_paused;
  651. /** Num HW flush counter */
  652. A_UINT32 hw_flush;
  653. /** Num HW filtered counter */
  654. A_UINT32 hw_filt;
  655. /** Num PPDUs cleaned up in TX abort */
  656. A_UINT32 tx_abort;
  657. /** Num MPDUs requeued by SW */
  658. A_UINT32 mpdu_requed;
  659. /** excessive retries */
  660. A_UINT32 tx_xretry;
  661. /** Last used data hw rate code */
  662. A_UINT32 data_rc;
  663. /** frames dropped due to excessive SW retries */
  664. A_UINT32 mpdu_dropped_xretry;
  665. /** illegal rate phy errors */
  666. A_UINT32 illgl_rate_phy_err;
  667. /** wal pdev continuous xretry */
  668. A_UINT32 cont_xretry;
  669. /** wal pdev tx timeout */
  670. A_UINT32 tx_timeout;
  671. /** wal pdev resets */
  672. A_UINT32 pdev_resets;
  673. /** PHY/BB underrun */
  674. A_UINT32 phy_underrun;
  675. /** MPDU is more than txop limit */
  676. A_UINT32 txop_ovf;
  677. /** Number of Sequences posted */
  678. A_UINT32 seq_posted;
  679. /** Number of Sequences failed queueing */
  680. A_UINT32 seq_failed_queueing;
  681. /** Number of Sequences completed */
  682. A_UINT32 seq_completed;
  683. /** Number of Sequences restarted */
  684. A_UINT32 seq_restarted;
  685. /** Number of MU Sequences posted */
  686. A_UINT32 mu_seq_posted;
  687. /** Number of time HW ring is paused between seq switch within ISR */
  688. A_UINT32 seq_switch_hw_paused;
  689. /** Number of times seq continuation in DSR */
  690. A_UINT32 next_seq_posted_dsr;
  691. /** Number of times seq continuation in ISR */
  692. A_UINT32 seq_posted_isr;
  693. /** Number of seq_ctrl cached. */
  694. A_UINT32 seq_ctrl_cached;
  695. /** Number of MPDUs successfully transmitted */
  696. A_UINT32 mpdu_count_tqm;
  697. /** Number of MSDUs successfully transmitted */
  698. A_UINT32 msdu_count_tqm;
  699. /** Number of MPDUs dropped */
  700. A_UINT32 mpdu_removed_tqm;
  701. /** Number of MSDUs dropped */
  702. A_UINT32 msdu_removed_tqm;
  703. /** Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  704. A_UINT32 mpdus_sw_flush;
  705. /** Num MPDUs filtered by HW, all filter condition (TTL expired) */
  706. A_UINT32 mpdus_hw_filter;
  707. /**
  708. * Num MPDUs truncated by PDG
  709. * (TXOP, TBTT, PPDU_duration based on rate, dyn_bw)
  710. */
  711. A_UINT32 mpdus_truncated;
  712. /** Num MPDUs that was tried but didn't receive ACK or BA */
  713. A_UINT32 mpdus_ack_failed;
  714. /** Num MPDUs that was dropped due to expiry (MSDU TTL) */
  715. A_UINT32 mpdus_expired;
  716. /** Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  717. A_UINT32 mpdus_seq_hw_retry;
  718. /** Num of TQM acked cmds processed */
  719. A_UINT32 ack_tlv_proc;
  720. /** coex_abort_mpdu_cnt valid */
  721. A_UINT32 coex_abort_mpdu_cnt_valid;
  722. /** coex_abort_mpdu_cnt from TX FES stats */
  723. A_UINT32 coex_abort_mpdu_cnt;
  724. /**
  725. * Number of total PPDUs
  726. * (DATA, MGMT, excludes selfgen) tried over the air (OTA)
  727. */
  728. A_UINT32 num_total_ppdus_tried_ota;
  729. /** Number of data PPDUs tried over the air (OTA) */
  730. A_UINT32 num_data_ppdus_tried_ota;
  731. /** Num Local control/mgmt frames (MSDUs) queued */
  732. A_UINT32 local_ctrl_mgmt_enqued;
  733. /**
  734. * Num Local control/mgmt frames (MSDUs) done
  735. * It includes all local ctrl/mgmt completions
  736. * (acked, no ack, flush, TTL, etc)
  737. */
  738. A_UINT32 local_ctrl_mgmt_freed;
  739. /** Num Local data frames (MSDUs) queued */
  740. A_UINT32 local_data_enqued;
  741. /**
  742. * Num Local data frames (MSDUs) done
  743. * It includes all local data completions
  744. * (acked, no ack, flush, TTL, etc)
  745. */
  746. A_UINT32 local_data_freed;
  747. /** Num MPDUs tried by SW */
  748. A_UINT32 mpdu_tried;
  749. /** Num of waiting seq posted in ISR completion handler */
  750. A_UINT32 isr_wait_seq_posted;
  751. A_UINT32 tx_active_dur_us_low;
  752. A_UINT32 tx_active_dur_us_high;
  753. /** Number of MPDUs dropped after max retries */
  754. A_UINT32 remove_mpdus_max_retries;
  755. /** Num HTT cookies dispatched */
  756. A_UINT32 comp_delivered;
  757. /** successful ppdu transmissions */
  758. A_UINT32 ppdu_ok;
  759. /** Scheduler self triggers */
  760. A_UINT32 self_triggers;
  761. /** FES duration of last tx data PPDU in us (sch_eval_end - ppdu_start) */
  762. A_UINT32 tx_time_dur_data;
  763. /** Num of times sequence terminated due to ppdu duration < burst limit */
  764. A_UINT32 seq_qdepth_repost_stop;
  765. /** Num of times MU sequence terminated due to MSDUs reaching threshold */
  766. A_UINT32 mu_seq_min_msdu_repost_stop;
  767. /** Num of times SU sequence terminated due to MSDUs reaching threshold */
  768. A_UINT32 seq_min_msdu_repost_stop;
  769. /** Num of times sequence terminated due to no TXOP available */
  770. A_UINT32 seq_txop_repost_stop;
  771. /** Num of times the next sequence got cancelled */
  772. A_UINT32 next_seq_cancel;
  773. /** Num of times fes offset was misaligned */
  774. A_UINT32 fes_offsets_err_cnt;
  775. /** Num of times peer denylisted for MU-MIMO transmission */
  776. A_UINT32 num_mu_peer_blacklisted;
  777. /** Num of times mu_ofdma seq posted */
  778. A_UINT32 mu_ofdma_seq_posted;
  779. /** Num of times UL MU MIMO seq posted */
  780. A_UINT32 ul_mumimo_seq_posted;
  781. /** Num of times UL OFDMA seq posted */
  782. A_UINT32 ul_ofdma_seq_posted;
  783. /** Num of times Thermal module suspended scheduler */
  784. A_UINT32 thermal_suspend_cnt;
  785. /** Num of times DFS module suspended scheduler */
  786. A_UINT32 dfs_suspend_cnt;
  787. /** Num of times TX abort module suspended scheduler */
  788. A_UINT32 tx_abort_suspend_cnt;
  789. /**
  790. * This field is a target-specific bit mask of suspended PPDU tx queues.
  791. * Since the bit mask definition is different for different targets,
  792. * this field is not meant for general use, but rather for debugging use.
  793. */
  794. A_UINT32 tgt_specific_opaque_txq_suspend_info;
  795. /**
  796. * Last SCHEDULER suspend reason
  797. * 1 -> Thermal Module
  798. * 2 -> DFS Module
  799. * 3 -> Tx Abort Module
  800. */
  801. A_UINT32 last_suspend_reason;
  802. /** Num of dynamic mimo ps dlmumimo sequences posted */
  803. A_UINT32 num_dyn_mimo_ps_dlmumimo_sequences;
  804. /** Num of times su bf sequences are denylisted */
  805. A_UINT32 num_su_txbf_denylisted;
  806. /** pdev uptime in microseconds **/
  807. A_UINT32 pdev_up_time_us;
  808. } htt_tx_pdev_stats_cmn_tlv;
  809. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  810. /* NOTE: Variable length TLV, use length spec to infer array size */
  811. typedef struct {
  812. htt_tlv_hdr_t tlv_hdr;
  813. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  814. } htt_tx_pdev_stats_urrn_tlv_v;
  815. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  816. /* NOTE: Variable length TLV, use length spec to infer array size */
  817. typedef struct {
  818. htt_tlv_hdr_t tlv_hdr;
  819. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  820. } htt_tx_pdev_stats_flush_tlv_v;
  821. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  822. /* NOTE: Variable length TLV, use length spec to infer array size */
  823. typedef struct {
  824. htt_tlv_hdr_t tlv_hdr;
  825. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  826. } htt_tx_pdev_stats_sifs_tlv_v;
  827. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  828. /* NOTE: Variable length TLV, use length spec to infer array size */
  829. typedef struct {
  830. htt_tlv_hdr_t tlv_hdr;
  831. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  832. } htt_tx_pdev_stats_phy_err_tlv_v;
  833. /*
  834. * Each array in the below struct has 16 elements, to cover the 16 possible
  835. * values for the CW and AIFS parameters. Each element within the array
  836. * stores the counter indicating how many transmissions have occurred with
  837. * that particular value for the MU EDCA parameter in question.
  838. */
  839. #define HTT_STATS_MUEDCA_VALUE_MAX 16
  840. typedef struct {
  841. htt_tlv_hdr_t tlv_hdr;
  842. A_UINT32 aifs[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  843. A_UINT32 cw_min[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  844. A_UINT32 cw_max[HTT_NUM_AC_WMM][HTT_STATS_MUEDCA_VALUE_MAX];
  845. } htt_tx_pdev_muedca_params_stats_tlv_v;
  846. #define HTT_TX_PDEV_SIFS_BURST_HIST_STATS 10
  847. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  848. /* NOTE: Variable length TLV, use length spec to infer array size */
  849. typedef struct {
  850. htt_tlv_hdr_t tlv_hdr;
  851. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  852. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  853. typedef struct {
  854. htt_tlv_hdr_t tlv_hdr;
  855. A_UINT32 num_data_ppdus_legacy_su;
  856. A_UINT32 num_data_ppdus_ac_su;
  857. A_UINT32 num_data_ppdus_ax_su;
  858. A_UINT32 num_data_ppdus_ac_su_txbf;
  859. A_UINT32 num_data_ppdus_ax_su_txbf;
  860. } htt_tx_pdev_stats_tx_ppdu_stats_tlv_v;
  861. typedef enum {
  862. HTT_TX_WAL_ISR_SCHED_SUCCESS,
  863. HTT_TX_WAL_ISR_SCHED_FILTER,
  864. HTT_TX_WAL_ISR_SCHED_RESP_TIMEOUT,
  865. HTT_TX_WAL_ISR_SCHED_RATES_EXHAUSTED,
  866. HTT_TX_WAL_ISR_SCHED_DATA_EXHAUSTED,
  867. HTT_TX_WAL_ISR_SCHED_SEQ_ABORT,
  868. HTT_TX_WAL_ISR_SCHED_NOTIFY_FRAME_ENCOUNTERED,
  869. HTT_TX_WAL_ISR_SCHED_COMPLETION,
  870. HTT_TX_WAL_ISR_SCHED_IN_PROGRESS,
  871. } htt_tx_wal_tx_isr_sched_status;
  872. /* [0]- nr4 , [1]- nr8 */
  873. #define HTT_STATS_NUM_NR_BINS 2
  874. /* Termination status stated in htt_tx_wal_tx_isr_sched_status */
  875. #define HTT_STATS_MAX_NUM_SCHED_STATUS 9
  876. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST 10
  877. #define HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS \
  878. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_SCHED_STATUS)
  879. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS \
  880. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST)
  881. typedef enum {
  882. HTT_STATS_HWMODE_AC = 0,
  883. HTT_STATS_HWMODE_AX = 1,
  884. HTT_STATS_HWMODE_BE = 2,
  885. } htt_stats_hw_mode;
  886. typedef struct {
  887. htt_tlv_hdr_t tlv_hdr;
  888. A_UINT32 hw_mode; /* HTT_STATS_HWMODE_xx */
  889. A_UINT32 mu_mimo_num_seq_term_status[HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS];
  890. A_UINT32 mu_mimo_num_ppdu_completed_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  891. A_UINT32 mu_mimo_num_seq_posted[HTT_STATS_NUM_NR_BINS];
  892. A_UINT32 mu_mimo_num_ppdu_posted_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  893. } htt_pdev_mu_ppdu_dist_tlv_v;
  894. #define HTT_TX_PDEV_STATS_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  895. /* NOTE: Variable length TLV, use length spec to infer array size .
  896. *
  897. * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
  898. * The tries here is the count of the MPDUS within a PPDU that the
  899. * HW had attempted to transmit on air, for the HWSCH Schedule
  900. * command submitted by FW.It is not the retry attempts.
  901. * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
  902. * 10 bins in this histogram. They are defined in FW using the
  903. * following macros
  904. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  905. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  906. *
  907. */
  908. typedef struct {
  909. htt_tlv_hdr_t tlv_hdr;
  910. A_UINT32 hist_bin_size;
  911. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
  912. } htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v;
  913. typedef struct {
  914. htt_tlv_hdr_t tlv_hdr;
  915. /* Num MGMT MPDU transmitted by the target */
  916. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  917. } htt_pdev_ctrl_path_tx_stats_tlv_v;
  918. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  919. * TLV_TAGS:
  920. * - HTT_STATS_TX_PDEV_CMN_TAG
  921. * - HTT_STATS_TX_PDEV_URRN_TAG
  922. * - HTT_STATS_TX_PDEV_SIFS_TAG
  923. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  924. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  925. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  926. * - HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG
  927. * - HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG
  928. * - HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG
  929. * - HTT_STATS_MU_PPDU_DIST_TAG
  930. */
  931. /* NOTE:
  932. * This structure is for documentation, and cannot be safely used directly.
  933. * Instead, use the constituent TLV structures to fill/parse.
  934. */
  935. typedef struct _htt_tx_pdev_stats {
  936. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  937. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  938. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  939. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  940. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  941. htt_tx_pdev_stats_sifs_hist_tlv_v sifs_hist_tlv;
  942. htt_tx_pdev_stats_tx_ppdu_stats_tlv_v tx_su_tlv;
  943. htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v tried_mpdu_cnt_hist_tlv;
  944. htt_pdev_ctrl_path_tx_stats_tlv_v ctrl_path_tx_tlv;
  945. htt_pdev_mu_ppdu_dist_tlv_v mu_ppdu_dist_tlv;
  946. } htt_tx_pdev_stats_t;
  947. /* == SOC ERROR STATS == */
  948. /* =============== PDEV ERROR STATS ============== */
  949. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  950. typedef struct {
  951. htt_tlv_hdr_t tlv_hdr;
  952. /* Stored as little endian */
  953. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  954. A_UINT32 mask;
  955. A_UINT32 count;
  956. } htt_hw_stats_intr_misc_tlv;
  957. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  958. typedef struct {
  959. htt_tlv_hdr_t tlv_hdr;
  960. /* Stored as little endian */
  961. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  962. A_UINT32 count;
  963. } htt_hw_stats_wd_timeout_tlv;
  964. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  965. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  966. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  967. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  968. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  969. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  970. do { \
  971. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  972. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  973. } while (0)
  974. typedef struct {
  975. htt_tlv_hdr_t tlv_hdr;
  976. /* BIT [ 7 : 0] :- mac_id
  977. * BIT [31 : 8] :- reserved
  978. */
  979. A_UINT32 mac_id__word;
  980. A_UINT32 tx_abort;
  981. A_UINT32 tx_abort_fail_count;
  982. A_UINT32 rx_abort;
  983. A_UINT32 rx_abort_fail_count;
  984. A_UINT32 warm_reset;
  985. A_UINT32 cold_reset;
  986. A_UINT32 tx_flush;
  987. A_UINT32 tx_glb_reset;
  988. A_UINT32 tx_txq_reset;
  989. A_UINT32 rx_timeout_reset;
  990. A_UINT32 mac_cold_reset_restore_cal;
  991. A_UINT32 mac_cold_reset;
  992. A_UINT32 mac_warm_reset;
  993. A_UINT32 mac_only_reset;
  994. A_UINT32 phy_warm_reset;
  995. A_UINT32 phy_warm_reset_ucode_trig;
  996. A_UINT32 mac_warm_reset_restore_cal;
  997. A_UINT32 mac_sfm_reset;
  998. A_UINT32 phy_warm_reset_m3_ssr;
  999. A_UINT32 phy_warm_reset_reason_phy_m3;
  1000. A_UINT32 phy_warm_reset_reason_tx_hw_stuck;
  1001. A_UINT32 phy_warm_reset_reason_num_cca_rx_frame_stuck;
  1002. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_rx_busy;
  1003. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_mac_hang;
  1004. A_UINT32 phy_warm_reset_reason_mac_reset_converted_phy_reset;
  1005. A_UINT32 wal_rx_recovery_rst_mac_hang_count;
  1006. A_UINT32 wal_rx_recovery_rst_known_sig_count;
  1007. A_UINT32 wal_rx_recovery_rst_no_rx_count;
  1008. A_UINT32 wal_rx_recovery_rst_no_rx_consecutive_count;
  1009. A_UINT32 wal_rx_recovery_rst_rx_busy_count;
  1010. A_UINT32 wal_rx_recovery_rst_phy_mac_hang_count;
  1011. A_UINT32 rx_flush_cnt; /* Num rx flush issued */
  1012. A_UINT32 phy_warm_reset_reason_tx_lifetime_expiry_cca_stuck;
  1013. A_UINT32 phy_warm_reset_reason_tx_consecutive_flush9_war;
  1014. A_UINT32 phy_warm_reset_reason_tx_hwsch_reset_war;
  1015. A_UINT32 phy_warm_reset_reason_hwsch_wdog_or_cca_wdog_war;
  1016. A_UINT32 fw_rx_rings_reset;
  1017. /**
  1018. * Num of iterations rx leak prevention successfully done.
  1019. */
  1020. A_UINT32 rx_dest_drain_rx_descs_leak_prevention_done;
  1021. /**
  1022. * Num of rx descs successfully saved by rx leak prevention.
  1023. */
  1024. A_UINT32 rx_dest_drain_rx_descs_saved_cnt;
  1025. /*
  1026. * Stats to debug reason Rx leak prevention
  1027. * was not required to be kicked in.
  1028. */
  1029. A_UINT32 rx_dest_drain_rxdma2reo_leak_detected;
  1030. A_UINT32 rx_dest_drain_rxdma2fw_leak_detected;
  1031. A_UINT32 rx_dest_drain_rxdma2wbm_leak_detected;
  1032. A_UINT32 rx_dest_drain_rxdma1_2sw_leak_detected;
  1033. A_UINT32 rx_dest_drain_rx_drain_ok_mac_idle;
  1034. A_UINT32 rx_dest_drain_ok_mac_not_idle;
  1035. A_UINT32 rx_dest_drain_prerequisite_invld;
  1036. A_UINT32 rx_dest_drain_skip_for_non_lmac_reset;
  1037. A_UINT32 rx_dest_drain_hw_fifo_not_empty_post_drain_wait;
  1038. } htt_hw_stats_pdev_errs_tlv;
  1039. typedef struct {
  1040. htt_tlv_hdr_t tlv_hdr;
  1041. /* BIT [ 7 : 0] :- mac_id
  1042. * BIT [31 : 8] :- reserved
  1043. */
  1044. A_UINT32 mac_id__word;
  1045. A_UINT32 last_unpause_ppdu_id;
  1046. A_UINT32 hwsch_unpause_wait_tqm_write;
  1047. A_UINT32 hwsch_dummy_tlv_skipped;
  1048. A_UINT32 hwsch_misaligned_offset_received;
  1049. A_UINT32 hwsch_reset_count;
  1050. A_UINT32 hwsch_dev_reset_war;
  1051. A_UINT32 hwsch_delayed_pause;
  1052. A_UINT32 hwsch_long_delayed_pause;
  1053. A_UINT32 sch_rx_ppdu_no_response;
  1054. A_UINT32 sch_selfgen_response;
  1055. A_UINT32 sch_rx_sifs_resp_trigger;
  1056. } htt_hw_stats_whal_tx_tlv;
  1057. typedef struct {
  1058. htt_tlv_hdr_t tlv_hdr;
  1059. /**
  1060. * BIT [ 7 : 0] :- mac_id
  1061. * BIT [31 : 8] :- reserved
  1062. */
  1063. union {
  1064. struct {
  1065. A_UINT32 mac_id: 8,
  1066. reserved: 24;
  1067. };
  1068. A_UINT32 mac_id__word;
  1069. };
  1070. /**
  1071. * hw_wars is a variable-length array, with each element counting
  1072. * the number of occurrences of the corresponding type of HW WAR.
  1073. * That is, hw_wars[0] indicates how many times HW WAR 0 occurred,
  1074. * hw_wars[1] indicates how many times HW WAR 1 occurred, etc.
  1075. * The target has an internal HW WAR mapping that it uses to keep
  1076. * track of which HW WAR is WAR 0, which HW WAR is WAR 1, etc.
  1077. */
  1078. A_UINT32 hw_wars[1/*or more*/];
  1079. } htt_hw_war_stats_tlv;
  1080. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  1081. * TLV_TAGS:
  1082. * - HTT_STATS_HW_PDEV_ERRS_TAG
  1083. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  1084. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  1085. * - HTT_STATS_WHAL_TX_TAG
  1086. * - HTT_STATS_HW_WAR_TAG
  1087. */
  1088. /* NOTE:
  1089. * This structure is for documentation, and cannot be safely used directly.
  1090. * Instead, use the constituent TLV structures to fill/parse.
  1091. */
  1092. typedef struct _htt_pdev_err_stats {
  1093. htt_hw_stats_pdev_errs_tlv pdev_errs;
  1094. htt_hw_stats_intr_misc_tlv misc_stats[1];
  1095. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  1096. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  1097. htt_hw_war_stats_tlv hw_war;
  1098. } htt_hw_err_stats_t;
  1099. /* ============ PEER STATS ============ */
  1100. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  1101. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  1102. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  1103. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  1104. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  1105. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  1106. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  1107. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  1108. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  1109. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  1110. do { \
  1111. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  1112. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  1113. } while (0)
  1114. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  1115. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  1116. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  1117. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  1118. do { \
  1119. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  1120. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  1121. } while (0)
  1122. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  1123. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  1124. HTT_MSDU_FLOW_STATS_DROP_S)
  1125. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  1126. do { \
  1127. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  1128. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  1129. } while (0)
  1130. typedef struct _htt_msdu_flow_stats_tlv {
  1131. htt_tlv_hdr_t tlv_hdr;
  1132. A_UINT32 last_update_timestamp;
  1133. A_UINT32 last_add_timestamp;
  1134. A_UINT32 last_remove_timestamp;
  1135. A_UINT32 total_processed_msdu_count;
  1136. A_UINT32 cur_msdu_count_in_flowq;
  1137. /** This will help to find which peer_id is stuck state */
  1138. A_UINT32 sw_peer_id;
  1139. /**
  1140. * BIT [15 : 0] :- tx_flow_number
  1141. * BIT [19 : 16] :- tid_num
  1142. * BIT [20 : 20] :- drop_rule
  1143. * BIT [31 : 21] :- reserved
  1144. */
  1145. A_UINT32 tx_flow_no__tid_num__drop_rule;
  1146. A_UINT32 last_cycle_enqueue_count;
  1147. A_UINT32 last_cycle_dequeue_count;
  1148. A_UINT32 last_cycle_drop_count;
  1149. /**
  1150. * BIT [15 : 0] :- current_drop_th
  1151. * BIT [31 : 16] :- reserved
  1152. */
  1153. A_UINT32 current_drop_th;
  1154. } htt_msdu_flow_stats_tlv;
  1155. #define MAX_HTT_TID_NAME 8
  1156. /* DWORD sw_peer_id__tid_num */
  1157. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1158. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  1159. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  1160. #define HTT_TX_TID_STATS_TID_NUM_S 16
  1161. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  1162. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  1163. HTT_TX_TID_STATS_SW_PEER_ID_S)
  1164. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1165. do { \
  1166. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  1167. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  1168. } while (0)
  1169. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  1170. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  1171. HTT_TX_TID_STATS_TID_NUM_S)
  1172. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  1173. do { \
  1174. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  1175. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  1176. } while (0)
  1177. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  1178. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  1179. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  1180. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  1181. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  1182. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  1183. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  1184. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  1185. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  1186. do { \
  1187. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  1188. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  1189. } while (0)
  1190. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  1191. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  1192. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  1193. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  1194. do { \
  1195. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  1196. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  1197. } while (0)
  1198. /* Tidq stats */
  1199. typedef struct _htt_tx_tid_stats_tlv {
  1200. htt_tlv_hdr_t tlv_hdr;
  1201. /** Stored as little endian */
  1202. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1203. /**
  1204. * BIT [15 : 0] :- sw_peer_id
  1205. * BIT [31 : 16] :- tid_num
  1206. */
  1207. A_UINT32 sw_peer_id__tid_num;
  1208. /**
  1209. * BIT [ 7 : 0] :- num_sched_pending
  1210. * BIT [15 : 8] :- num_ppdu_in_hwq
  1211. * BIT [31 : 16] :- reserved
  1212. */
  1213. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1214. A_UINT32 tid_flags;
  1215. /** per tid # of hw_queued ppdu */
  1216. A_UINT32 hw_queued;
  1217. /** number of per tid successful PPDU */
  1218. A_UINT32 hw_reaped;
  1219. /** per tid Num MPDUs filtered by HW */
  1220. A_UINT32 mpdus_hw_filter;
  1221. A_UINT32 qdepth_bytes;
  1222. A_UINT32 qdepth_num_msdu;
  1223. A_UINT32 qdepth_num_mpdu;
  1224. A_UINT32 last_scheduled_tsmp;
  1225. A_UINT32 pause_module_id;
  1226. A_UINT32 block_module_id;
  1227. /** tid tx airtime in sec */
  1228. A_UINT32 tid_tx_airtime;
  1229. } htt_tx_tid_stats_tlv;
  1230. /* Tidq stats */
  1231. typedef struct _htt_tx_tid_stats_v1_tlv {
  1232. htt_tlv_hdr_t tlv_hdr;
  1233. /** Stored as little endian */
  1234. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1235. /**
  1236. * BIT [15 : 0] :- sw_peer_id
  1237. * BIT [31 : 16] :- tid_num
  1238. */
  1239. A_UINT32 sw_peer_id__tid_num;
  1240. /**
  1241. * BIT [ 7 : 0] :- num_sched_pending
  1242. * BIT [15 : 8] :- num_ppdu_in_hwq
  1243. * BIT [31 : 16] :- reserved
  1244. */
  1245. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1246. A_UINT32 tid_flags;
  1247. /** Max qdepth in bytes reached by this tid */
  1248. A_UINT32 max_qdepth_bytes;
  1249. /** number of msdus qdepth reached max */
  1250. A_UINT32 max_qdepth_n_msdus;
  1251. A_UINT32 rsvd;
  1252. A_UINT32 qdepth_bytes;
  1253. A_UINT32 qdepth_num_msdu;
  1254. A_UINT32 qdepth_num_mpdu;
  1255. A_UINT32 last_scheduled_tsmp;
  1256. A_UINT32 pause_module_id;
  1257. A_UINT32 block_module_id;
  1258. /** tid tx airtime in sec */
  1259. A_UINT32 tid_tx_airtime;
  1260. A_UINT32 allow_n_flags;
  1261. /**
  1262. * BIT [15 : 0] :- sendn_frms_allowed
  1263. * BIT [31 : 16] :- reserved
  1264. */
  1265. A_UINT32 sendn_frms_allowed;
  1266. /*
  1267. * tid_ext_flags, tid_ext2_flags, and tid_flush_reason are opaque fields
  1268. * that cannot be interpreted by the host.
  1269. * They are only for off-line debug.
  1270. */
  1271. A_UINT32 tid_ext_flags;
  1272. A_UINT32 tid_ext2_flags;
  1273. A_UINT32 tid_flush_reason;
  1274. A_UINT32 mlo_flush_tqm_status_pending_low;
  1275. A_UINT32 mlo_flush_tqm_status_pending_high;
  1276. A_UINT32 mlo_flush_partner_info_low;
  1277. A_UINT32 mlo_flush_partner_info_high;
  1278. A_UINT32 mlo_flush_initator_info_low;
  1279. A_UINT32 mlo_flush_initator_info_high;
  1280. } htt_tx_tid_stats_v1_tlv;
  1281. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1282. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  1283. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  1284. #define HTT_RX_TID_STATS_TID_NUM_S 16
  1285. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  1286. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  1287. HTT_RX_TID_STATS_SW_PEER_ID_S)
  1288. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  1291. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  1292. } while (0)
  1293. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  1294. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  1295. HTT_RX_TID_STATS_TID_NUM_S)
  1296. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  1299. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  1300. } while (0)
  1301. typedef struct _htt_rx_tid_stats_tlv {
  1302. htt_tlv_hdr_t tlv_hdr;
  1303. /**
  1304. * BIT [15 : 0] : sw_peer_id
  1305. * BIT [31 : 16] : tid_num
  1306. */
  1307. A_UINT32 sw_peer_id__tid_num;
  1308. /** Stored as little endian */
  1309. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1310. /**
  1311. * dup_in_reorder not collected per tid for now,
  1312. * as there is no wal_peer back ptr in data rx peer.
  1313. */
  1314. A_UINT32 dup_in_reorder;
  1315. A_UINT32 dup_past_outside_window;
  1316. A_UINT32 dup_past_within_window;
  1317. /** Number of per tid MSDUs with flag of decrypt_err */
  1318. A_UINT32 rxdesc_err_decrypt;
  1319. /** tid rx airtime in sec */
  1320. A_UINT32 tid_rx_airtime;
  1321. } htt_rx_tid_stats_tlv;
  1322. #define HTT_MAX_COUNTER_NAME 8
  1323. typedef struct {
  1324. htt_tlv_hdr_t tlv_hdr;
  1325. /** Stored as little endian */
  1326. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  1327. A_UINT32 count;
  1328. } htt_counter_tlv;
  1329. typedef struct {
  1330. htt_tlv_hdr_t tlv_hdr;
  1331. /** Number of rx PPDU */
  1332. A_UINT32 ppdu_cnt;
  1333. /** Number of rx MPDU */
  1334. A_UINT32 mpdu_cnt;
  1335. /** Number of rx MSDU */
  1336. A_UINT32 msdu_cnt;
  1337. /** pause bitmap */
  1338. A_UINT32 pause_bitmap;
  1339. /** block bitmap */
  1340. A_UINT32 block_bitmap;
  1341. /** current timestamp */
  1342. A_UINT32 current_timestamp;
  1343. /** Peer cumulative tx airtime in sec */
  1344. A_UINT32 peer_tx_airtime;
  1345. /** Peer cumulative rx airtime in sec */
  1346. A_UINT32 peer_rx_airtime;
  1347. /** Peer current rssi in dBm */
  1348. A_INT32 rssi;
  1349. /** Total enqueued, dequeued and dropped MSDU's for peer */
  1350. A_UINT32 peer_enqueued_count_low;
  1351. A_UINT32 peer_enqueued_count_high;
  1352. A_UINT32 peer_dequeued_count_low;
  1353. A_UINT32 peer_dequeued_count_high;
  1354. A_UINT32 peer_dropped_count_low;
  1355. A_UINT32 peer_dropped_count_high;
  1356. /** Total ppdu transmitted bytes for peer: includes MAC header overhead */
  1357. A_UINT32 ppdu_transmitted_bytes_low;
  1358. A_UINT32 ppdu_transmitted_bytes_high;
  1359. A_UINT32 peer_ttl_removed_count;
  1360. /**
  1361. * inactive_time
  1362. * Running duration of the time since last tx/rx activity by this peer,
  1363. * units = seconds.
  1364. * If the peer is currently active, this inactive_time will be 0x0.
  1365. */
  1366. A_UINT32 inactive_time;
  1367. /** Number of MPDUs dropped after max retries */
  1368. A_UINT32 remove_mpdus_max_retries;
  1369. } htt_peer_stats_cmn_tlv;
  1370. #define HTT_PEER_DETAILS_ML_PEER_OFFSET_BYTES 32
  1371. #define HTT_PEER_DETAILS_ML_PEER_OFFSET_DWORD 8
  1372. #define HTT_PEER_DETAILS_ML_PEER_ID_VALID_M 0x00000001
  1373. #define HTT_PEER_DETAILS_ML_PEER_ID_VALID_S 0
  1374. #define HTT_PEER_DETAILS_ML_PEER_ID_M 0x00001ffe
  1375. #define HTT_PEER_DETAILS_ML_PEER_ID_S 1
  1376. #define HTT_PEER_DETAILS_LINK_IDX_M 0x001fe000
  1377. #define HTT_PEER_DETAILS_LINK_IDX_S 13
  1378. #define HTT_PEER_DETAILS_SET(word, httsym, val) \
  1379. do { \
  1380. HTT_CHECK_SET_VAL(HTT_PEER_DETAILS_ ## httsym, val); \
  1381. (word) |= ((val) << HTT_PEER_DETAILS_ ## httsym ## _S); \
  1382. } while(0)
  1383. #define HTT_PEER_DETAILS_GET(word, httsym) \
  1384. (((word) & HTT_PEER_DETAILS_ ## httsym ## _M) >> HTT_PEER_DETAILS_ ## httsym ## _S)
  1385. typedef struct {
  1386. htt_tlv_hdr_t tlv_hdr;
  1387. /** This enum type of HTT_PEER_TYPE */
  1388. A_UINT32 peer_type;
  1389. A_UINT32 sw_peer_id;
  1390. /**
  1391. * BIT [7 : 0] :- vdev_id
  1392. * BIT [15 : 8] :- pdev_id
  1393. * BIT [31 : 16] :- ast_indx
  1394. */
  1395. A_UINT32 vdev_pdev_ast_idx;
  1396. htt_mac_addr mac_addr;
  1397. A_UINT32 peer_flags;
  1398. A_UINT32 qpeer_flags;
  1399. /* Dword 8 */
  1400. A_UINT32 ml_peer_id_valid : 1, /* [0:0] */
  1401. ml_peer_id : 12, /* [12:1] */
  1402. link_idx : 8, /* [20:13] */
  1403. rsvd : 11; /* [31:21] */
  1404. } htt_peer_details_tlv;
  1405. typedef struct {
  1406. htt_tlv_hdr_t tlv_hdr;
  1407. A_UINT32 sw_peer_id;
  1408. A_UINT32 ast_index;
  1409. htt_mac_addr mac_addr;
  1410. A_UINT32
  1411. pdev_id : 2,
  1412. vdev_id : 8,
  1413. next_hop : 1,
  1414. mcast : 1,
  1415. monitor_direct : 1,
  1416. mesh_sta : 1,
  1417. mec : 1,
  1418. intra_bss : 1,
  1419. chip_id : 2,
  1420. ml_peer_id : 13,
  1421. reserved : 1;
  1422. } htt_ast_entry_tlv;
  1423. typedef enum {
  1424. HTT_STATS_DIRECTION_TX,
  1425. HTT_STATS_DIRECTION_RX,
  1426. } HTT_STATS_DIRECTION;
  1427. typedef enum {
  1428. HTT_STATS_PPDU_TYPE_MODE_SU,
  1429. HTT_STATS_PPDU_TYPE_DL_MU_MIMO,
  1430. HTT_STATS_PPDU_TYPE_UL_MU_MIMO,
  1431. HTT_STATS_PPDU_TYPE_DL_MU_OFDMA,
  1432. HTT_STATS_PPDU_TYPE_UL_MU_OFDMA,
  1433. } HTT_STATS_PPDU_TYPE;
  1434. typedef enum {
  1435. HTT_STATS_PREAM_OFDM,
  1436. HTT_STATS_PREAM_CCK,
  1437. HTT_STATS_PREAM_HT,
  1438. HTT_STATS_PREAM_VHT,
  1439. HTT_STATS_PREAM_HE,
  1440. HTT_STATS_PREAM_EHT,
  1441. HTT_STATS_PREAM_RSVD1,
  1442. HTT_STATS_PREAM_COUNT,
  1443. } HTT_STATS_PREAM_TYPE;
  1444. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1445. #define HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1446. /* HTT_TX_PEER_STATS_NUM_GI_COUNTERS:
  1447. * GI Index 0: WHAL_GI_800
  1448. * GI Index 1: WHAL_GI_400
  1449. * GI Index 2: WHAL_GI_1600
  1450. * GI Index 3: WHAL_GI_3200
  1451. */
  1452. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  1453. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  1454. /* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
  1455. * bw index 0: rssi_pri20_chain0
  1456. * bw index 1: rssi_ext20_chain0
  1457. * bw index 2: rssi_ext40_low20_chain0
  1458. * bw index 3: rssi_ext40_high20_chain0
  1459. */
  1460. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  1461. /* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
  1462. * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
  1463. * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
  1464. * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
  1465. * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
  1466. */
  1467. #define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
  1468. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS 4
  1469. /* HTT_RX STATS_NUM_BW_EXT_2_COUNTERS:
  1470. * bw index 8 (bw ext_2 index 0): rssi_ext160_0_chainX
  1471. * bw index 9 (bw ext_2 index 1): rssi_ext160_1_chainX
  1472. * bw index 10 (bw ext_2 index 2): rssi_ext160_2_chainX
  1473. * bw index 11 (bw ext_2 index 3): rssi_ext160_3_chainX
  1474. * bw index 12 (bw ext_2 index 4): rssi_ext160_4_chainX
  1475. * bw index 13 (bw ext_2 index 5): rssi_ext160_5_chainX
  1476. * bw index 14 (bw ext_2 index 6): rssi_ext160_6_chainX
  1477. * bw index 15 (bw ext_2 index 7): rssi_ext160_7_chainX
  1478. */
  1479. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_2_COUNTERS 8
  1480. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1481. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1482. #define HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1483. typedef struct _htt_tx_peer_rate_stats_tlv {
  1484. htt_tlv_hdr_t tlv_hdr;
  1485. /** Number of tx LDPC packets */
  1486. A_UINT32 tx_ldpc;
  1487. /** Number of tx RTS packets */
  1488. A_UINT32 rts_cnt;
  1489. /** RSSI value of last ack packet (units = dB above noise floor) */
  1490. A_UINT32 ack_rssi;
  1491. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1492. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1493. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1494. /**
  1495. * element 0,1, ...7 -> NSS 1,2, ...8
  1496. */
  1497. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS];
  1498. /**
  1499. * element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz
  1500. */
  1501. A_UINT32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
  1502. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1503. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1504. /**
  1505. * Counters to track number of tx packets in each GI
  1506. * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
  1507. */
  1508. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1509. /** Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  1510. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  1511. /** Stats for MCS 12/13 */
  1512. A_UINT32 tx_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1513. A_UINT32 tx_su_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1514. A_UINT32 tx_mu_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1515. A_UINT32 tx_stbc_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1516. A_UINT32 tx_gi_ext[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1517. A_UINT32 reduced_tx_bw[HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
  1518. A_UINT32 tx_bw_320mhz;
  1519. } htt_tx_peer_rate_stats_tlv;
  1520. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1521. #define HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1522. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  1523. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  1524. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  1525. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1526. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1527. #define HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1528. typedef struct _htt_rx_peer_rate_stats_tlv {
  1529. htt_tlv_hdr_t tlv_hdr;
  1530. A_UINT32 nsts;
  1531. /** Number of rx LDPC packets */
  1532. A_UINT32 rx_ldpc;
  1533. /** Number of rx RTS packets */
  1534. A_UINT32 rts_cnt;
  1535. /** units = dB above noise floor */
  1536. A_UINT32 rssi_mgmt;
  1537. /** units = dB above noise floor */
  1538. A_UINT32 rssi_data;
  1539. /** units = dB above noise floor */
  1540. A_UINT32 rssi_comb;
  1541. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1542. /**
  1543. * element 0,1, ...7 -> NSS 1,2, ...8
  1544. */
  1545. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS];
  1546. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  1547. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1548. /**
  1549. * element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz
  1550. */
  1551. A_UINT32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1552. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1553. /** units = dB above noise floor */
  1554. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1555. /** Counters to track number of rx packets in each GI in each mcs (0-11) */
  1556. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1557. A_UINT32 rx_ulofdma_non_data_ppdu; /** PPDU level */
  1558. A_UINT32 rx_ulofdma_data_ppdu; /** PPDU level */
  1559. A_UINT32 rx_ulofdma_mpdu_ok; /** MPDU level */
  1560. A_UINT32 rx_ulofdma_mpdu_fail; /** MPDU level */
  1561. A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* dBm unit */
  1562. /* per_chain_rssi_pkt_type:
  1563. * This field shows what type of rx frame the per-chain RSSI was computed
  1564. * on, by recording the frame type and sub-type as bit-fields within this
  1565. * field:
  1566. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  1567. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  1568. * BIT [31 : 8] :- Reserved
  1569. */
  1570. A_UINT32 per_chain_rssi_pkt_type;
  1571. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1572. /** PPDU level */
  1573. A_UINT32 rx_ulmumimo_non_data_ppdu;
  1574. /** PPDU level */
  1575. A_UINT32 rx_ulmumimo_data_ppdu;
  1576. /** MPDU level */
  1577. A_UINT32 rx_ulmumimo_mpdu_ok;
  1578. /** mpdu level */
  1579. A_UINT32 rx_ulmumimo_mpdu_fail;
  1580. /** units = dB above noise floor */
  1581. A_UINT8 rssi_chain_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS];
  1582. /** Stats for MCS 12/13 */
  1583. A_UINT32 rx_mcs_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1584. A_UINT32 rx_stbc_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1585. A_UINT32 rx_gi_ext[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1586. A_UINT32 reduced_rx_bw[HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1587. A_INT8 rx_per_chain_rssi_in_dbm_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS];
  1588. } htt_rx_peer_rate_stats_tlv;
  1589. typedef enum {
  1590. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  1591. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  1592. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  1593. } htt_peer_stats_req_mode_t;
  1594. typedef enum {
  1595. HTT_PEER_STATS_CMN_TLV = 0,
  1596. HTT_PEER_DETAILS_TLV = 1,
  1597. HTT_TX_PEER_RATE_STATS_TLV = 2,
  1598. HTT_RX_PEER_RATE_STATS_TLV = 3,
  1599. HTT_TX_TID_STATS_TLV = 4,
  1600. HTT_RX_TID_STATS_TLV = 5,
  1601. HTT_MSDU_FLOW_STATS_TLV = 6,
  1602. HTT_PEER_SCHED_STATS_TLV = 7,
  1603. HTT_PEER_STATS_MAX_TLV = 31,
  1604. } htt_peer_stats_tlv_enum;
  1605. typedef struct {
  1606. htt_tlv_hdr_t tlv_hdr;
  1607. A_UINT32 peer_id;
  1608. /** Num of DL schedules for peer */
  1609. A_UINT32 num_sched_dl;
  1610. /** Num od UL schedules for peer */
  1611. A_UINT32 num_sched_ul;
  1612. /** Peer TX time */
  1613. A_UINT32 peer_tx_active_dur_us_low;
  1614. A_UINT32 peer_tx_active_dur_us_high;
  1615. /** Peer RX time */
  1616. A_UINT32 peer_rx_active_dur_us_low;
  1617. A_UINT32 peer_rx_active_dur_us_high;
  1618. A_UINT32 peer_curr_rate_kbps;
  1619. } htt_peer_sched_stats_tlv;
  1620. /* config_param0 */
  1621. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M 0x00000001
  1622. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S 0
  1623. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_GET(_var) \
  1624. (((_var) & HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M) >> \
  1625. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)
  1626. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR, _val); \
  1629. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)); \
  1630. } while (0)
  1631. /* DEPRECATED
  1632. * The old IS_peer_MAC_ADDR_SET macro name is being retained for now,
  1633. * as an alias for the corrected macro name.
  1634. * If/when all references to the old name are removed, the definition of
  1635. * the old name will also be removed.
  1636. */
  1637. #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
  1638. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  1639. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  1640. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  1641. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  1642. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  1643. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  1644. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  1647. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  1648. } while (0)
  1649. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  1650. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  1651. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  1652. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  1653. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  1654. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  1655. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  1656. do { \
  1657. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  1658. } while (0)
  1659. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  1660. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  1661. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  1662. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  1663. do { \
  1664. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  1665. } while (0)
  1666. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  1667. * TLV_TAGS:
  1668. * - HTT_STATS_PEER_STATS_CMN_TAG
  1669. * - HTT_STATS_PEER_DETAILS_TAG
  1670. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  1671. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  1672. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  1673. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  1674. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  1675. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  1676. * - HTT_STATS_PEER_SCHED_STATS_TAG
  1677. */
  1678. /* NOTE:
  1679. * This structure is for documentation, and cannot be safely used directly.
  1680. * Instead, use the constituent TLV structures to fill/parse.
  1681. */
  1682. typedef struct _htt_peer_stats {
  1683. htt_peer_stats_cmn_tlv cmn_tlv;
  1684. htt_peer_details_tlv peer_details;
  1685. /* from g_rate_info_stats */
  1686. htt_tx_peer_rate_stats_tlv tx_rate;
  1687. htt_rx_peer_rate_stats_tlv rx_rate;
  1688. htt_tx_tid_stats_tlv tx_tid_stats[1];
  1689. htt_rx_tid_stats_tlv rx_tid_stats[1];
  1690. htt_msdu_flow_stats_tlv msdu_flowq[1];
  1691. htt_tx_tid_stats_v1_tlv tx_tid_stats_v1[1];
  1692. htt_peer_sched_stats_tlv peer_sched_stats;
  1693. } htt_peer_stats_t;
  1694. /* =========== ACTIVE PEER LIST ========== */
  1695. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  1696. * TLV_TAGS:
  1697. * - HTT_STATS_PEER_DETAILS_TAG
  1698. */
  1699. /* NOTE:
  1700. * This structure is for documentation, and cannot be safely used directly.
  1701. * Instead, use the constituent TLV structures to fill/parse.
  1702. */
  1703. typedef struct {
  1704. htt_peer_details_tlv peer_details[1];
  1705. } htt_active_peer_details_list_t;
  1706. /* =========== MUMIMO HWQ stats =========== */
  1707. /* MU MIMO stats per hwQ */
  1708. typedef struct {
  1709. htt_tlv_hdr_t tlv_hdr;
  1710. /** number of MU MIMO schedules posted to HW */
  1711. A_UINT32 mu_mimo_sch_posted;
  1712. /** number of MU MIMO schedules failed to post */
  1713. A_UINT32 mu_mimo_sch_failed;
  1714. /** number of MU MIMO PPDUs posted to HW */
  1715. A_UINT32 mu_mimo_ppdu_posted;
  1716. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  1717. typedef struct {
  1718. htt_tlv_hdr_t tlv_hdr;
  1719. /** 11AC DL MU MIMO number of mpdus queued to HW, per user */
  1720. A_UINT32 mu_mimo_mpdus_queued_usr;
  1721. /** 11AC DL MU MIMO number of mpdus tried over the air, per user */
  1722. A_UINT32 mu_mimo_mpdus_tried_usr;
  1723. /** 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  1724. A_UINT32 mu_mimo_mpdus_failed_usr;
  1725. /** 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  1726. A_UINT32 mu_mimo_mpdus_requeued_usr;
  1727. /** 11AC DL MU MIMO BA not receieved, per user */
  1728. A_UINT32 mu_mimo_err_no_ba_usr;
  1729. /** 11AC DL MU MIMO mpdu underrun encountered, per user */
  1730. A_UINT32 mu_mimo_mpdu_underrun_usr;
  1731. /** 11AC DL MU MIMO ampdu underrun encountered, per user */
  1732. A_UINT32 mu_mimo_ampdu_underrun_usr;
  1733. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  1734. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  1735. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  1736. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  1737. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  1738. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  1739. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  1740. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  1741. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  1742. do { \
  1743. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  1744. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  1745. } while (0)
  1746. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  1747. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  1748. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  1749. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  1750. do { \
  1751. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  1752. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  1753. } while (0)
  1754. typedef struct {
  1755. htt_tlv_hdr_t tlv_hdr;
  1756. /**
  1757. * BIT [ 7 : 0] :- mac_id
  1758. * BIT [15 : 8] :- hwq_id
  1759. * BIT [31 : 16] :- reserved
  1760. */
  1761. A_UINT32 mac_id__hwq_id__word;
  1762. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  1763. /* NOTE:
  1764. * This structure is for documentation, and cannot be safely used directly.
  1765. * Instead, use the constituent TLV structures to fill/parse.
  1766. */
  1767. typedef struct {
  1768. struct _hwq_mu_mimo_stats {
  1769. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  1770. /** WAL_TX_STATS_MAX_GROUP_SIZE */
  1771. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1];
  1772. /** WAL_TX_STATS_TX_MAX_NUM_USERS */
  1773. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1];
  1774. } hwq[1];
  1775. } htt_tx_hwq_mu_mimo_stats_t;
  1776. /* == TX HWQ STATS == */
  1777. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  1778. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  1779. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  1780. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  1781. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  1782. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  1783. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  1784. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  1787. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  1788. } while (0)
  1789. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  1790. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  1791. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  1792. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  1793. do { \
  1794. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  1795. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  1796. } while (0)
  1797. typedef struct {
  1798. htt_tlv_hdr_t tlv_hdr;
  1799. /**
  1800. * BIT [ 7 : 0] :- mac_id
  1801. * BIT [15 : 8] :- hwq_id
  1802. * BIT [31 : 16] :- reserved
  1803. */
  1804. A_UINT32 mac_id__hwq_id__word;
  1805. /*--- PPDU level stats */
  1806. /** Number of times ack is failed for the PPDU scheduled on this txQ */
  1807. A_UINT32 xretry;
  1808. /** Number of times sched cmd status reported mpdu underrun */
  1809. A_UINT32 underrun_cnt;
  1810. /** Number of times sched cmd is flushed */
  1811. A_UINT32 flush_cnt;
  1812. /** Number of times sched cmd is filtered */
  1813. A_UINT32 filt_cnt;
  1814. /** Number of times HWSCH uploaded null mpdu bitmap */
  1815. A_UINT32 null_mpdu_bmap;
  1816. /**
  1817. * Number of times user ack or BA TLV is not seen on FES ring
  1818. * where it is expected to be
  1819. */
  1820. A_UINT32 user_ack_failure;
  1821. /** Number of times TQM processed ack TLV received from HWSCH */
  1822. A_UINT32 ack_tlv_proc;
  1823. /** Cache latest processed scheduler ID received from ack BA TLV */
  1824. A_UINT32 sched_id_proc;
  1825. /** Number of times TxPCU reported MPDUs transmitted for a user is zero */
  1826. A_UINT32 null_mpdu_tx_count;
  1827. /**
  1828. * Number of times SW did not see any MPDU info bitmap TLV
  1829. * on FES status ring
  1830. */
  1831. A_UINT32 mpdu_bmap_not_recvd;
  1832. /*--- Selfgen stats per hwQ */
  1833. /** Number of SU/MU BAR frames posted to hwQ */
  1834. A_UINT32 num_bar;
  1835. /** Number of RTS frames posted to hwQ */
  1836. A_UINT32 rts;
  1837. /** Number of cts2self frames posted to hwQ */
  1838. A_UINT32 cts2self;
  1839. /** Number of qos null frames posted to hwQ */
  1840. A_UINT32 qos_null;
  1841. /*--- MPDU level stats */
  1842. /** mpdus tried Tx by HWSCH/TQM */
  1843. A_UINT32 mpdu_tried_cnt;
  1844. /** mpdus queued to HWSCH */
  1845. A_UINT32 mpdu_queued_cnt;
  1846. /** mpdus tried but ack was not received */
  1847. A_UINT32 mpdu_ack_fail_cnt;
  1848. /** This will include sched cmd flush and time based discard */
  1849. A_UINT32 mpdu_filt_cnt;
  1850. /** Number of MPDUs for which ACK was sucessful but no Tx happened */
  1851. A_UINT32 false_mpdu_ack_count;
  1852. /** Number of times txq timeout happened */
  1853. A_UINT32 txq_timeout;
  1854. } htt_tx_hwq_stats_cmn_tlv;
  1855. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) + /* hist_intvl */ \
  1856. (sizeof(A_UINT32) * (_num_elems)))
  1857. /* NOTE: Variable length TLV, use length spec to infer array size */
  1858. typedef struct {
  1859. htt_tlv_hdr_t tlv_hdr;
  1860. A_UINT32 hist_intvl;
  1861. /** histogram of ppdu post to hwsch - > cmd status received */
  1862. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1863. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1864. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1865. /* NOTE: Variable length TLV, use length spec to infer array size */
  1866. typedef struct {
  1867. htt_tlv_hdr_t tlv_hdr;
  1868. /** Histogram of sched cmd result */
  1869. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1870. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1871. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1872. /* NOTE: Variable length TLV, use length spec to infer array size */
  1873. typedef struct {
  1874. htt_tlv_hdr_t tlv_hdr;
  1875. /** Histogram of various pause conitions */
  1876. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1877. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1878. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1879. /* NOTE: Variable length TLV, use length spec to infer array size */
  1880. typedef struct {
  1881. htt_tlv_hdr_t tlv_hdr;
  1882. /** Histogram of number of user fes result */
  1883. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1884. } htt_tx_hwq_fes_result_stats_tlv_v;
  1885. #define HTT_TX_HWQ_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1886. /* NOTE: Variable length TLV, use length spec to infer array size
  1887. *
  1888. * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
  1889. * The tries here is the count of the MPDUS within a PPDU that the HW
  1890. * had attempted to transmit on air, for the HWSCH Schedule command
  1891. * submitted by FW in this HWQ .It is not the retry attempts. The
  1892. * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
  1893. * in this histogram.
  1894. * they are defined in FW using the following macros
  1895. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  1896. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  1897. *
  1898. * */
  1899. typedef struct {
  1900. htt_tlv_hdr_t tlv_hdr;
  1901. A_UINT32 hist_bin_size;
  1902. /** Histogram of number of mpdus on tried mpdu */
  1903. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_HWQ_TRIED_MPDU_CNT_HIST */
  1904. } htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v;
  1905. #define HTT_TX_HWQ_TXOP_USED_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1906. /* NOTE: Variable length TLV, use length spec to infer array size
  1907. *
  1908. * The txop_used_cnt_hist is the histogram of txop per burst. After
  1909. * completing the burst, we identify the txop used in the burst and
  1910. * incr the corresponding bin.
  1911. * Each bin represents 1ms & we have 10 bins in this histogram.
  1912. * they are deined in FW using the following macros
  1913. * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
  1914. * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
  1915. *
  1916. * */
  1917. typedef struct {
  1918. htt_tlv_hdr_t tlv_hdr;
  1919. /** Histogram of txop used cnt */
  1920. A_UINT32 txop_used_cnt_hist[1]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
  1921. } htt_tx_hwq_txop_used_cnt_hist_tlv_v;
  1922. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1923. * TLV_TAGS:
  1924. * - HTT_STATS_STRING_TAG
  1925. * - HTT_STATS_TX_HWQ_CMN_TAG
  1926. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1927. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1928. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1929. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1930. * - HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG
  1931. * - HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG
  1932. */
  1933. /* NOTE:
  1934. * This structure is for documentation, and cannot be safely used directly.
  1935. * Instead, use the constituent TLV structures to fill/parse.
  1936. * General HWQ stats Mechanism:
  1937. * Once the host request for the stats, FW fill all the HWQ TAGS in a buffer
  1938. * for all the HWQ requested. & the FW send the buffer to host. In the
  1939. * buffer the HWQ ID is filled in mac_id__hwq_id, thus identifying each
  1940. * HWQ distinctly.
  1941. */
  1942. typedef struct _htt_tx_hwq_stats {
  1943. htt_stats_string_tlv hwq_str_tlv;
  1944. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1945. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1946. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1947. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1948. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1949. htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v tried_mpdu_tlv;
  1950. htt_tx_hwq_txop_used_cnt_hist_tlv_v txop_used_tlv;
  1951. } htt_tx_hwq_stats_t;
  1952. /* == TX SELFGEN STATS == */
  1953. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1954. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1955. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1956. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1957. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1958. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1961. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1962. } while (0)
  1963. typedef enum {
  1964. HTT_TXERR_NONE,
  1965. HTT_TXERR_RESP, /* response timeout, mismatch,
  1966. * BW mismatch, mimo ctrl mismatch,
  1967. * CRC error.. */
  1968. HTT_TXERR_FILT, /* blocked by tx filtering */
  1969. HTT_TXERR_FIFO, /* fifo, misc errors in HW */
  1970. HTT_TXERR_SWABORT, /* software initialted abort (TX_ABORT) */
  1971. HTT_TXERR_RESERVED1,
  1972. HTT_TXERR_RESERVED2,
  1973. HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS = 7,
  1974. HTT_TXERR_INVALID = 0xff,
  1975. } htt_tx_err_status_t;
  1976. /* Matching enum for htt_tx_selfgen_sch_tsflag_error_stats */
  1977. typedef enum {
  1978. HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR,
  1979. HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR,
  1980. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR,
  1981. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR,
  1982. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR,
  1983. HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR,
  1984. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR,
  1985. HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR,
  1986. HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS = 8,
  1987. HTT_TX_SELFGEN_SCH_TSFLAG_ERROR_STATS_VALID = 8
  1988. } htt_tx_selfgen_sch_tsflag_error_stats;
  1989. typedef enum {
  1990. HTT_TX_MUMIMO_GRP_VALID,
  1991. HTT_TX_MUMIMO_GRP_INVALID_NUM_MU_USERS_EXCEEDED_MU_MAX_USERS,
  1992. HTT_TX_MUMIMO_GRP_INVALID_SCHED_ALGO_NOT_MU_COMPATIBLE_GID,
  1993. HTT_TX_MUMIMO_GRP_INVALID_NON_PRIMARY_GRP,
  1994. HTT_TX_MUMIMO_GRP_INVALID_ZERO_CANDIDATES,
  1995. HTT_TX_MUMIMO_GRP_INVALID_MORE_CANDIDATES,
  1996. HTT_TX_MUMIMO_GRP_INVALID_GROUP_SIZE_EXCEED_NSS,
  1997. HTT_TX_MUMIMO_GRP_INVALID_GROUP_INELIGIBLE,
  1998. HTT_TX_MUMIMO_GRP_INVALID,
  1999. HTT_TX_MUMIMO_GRP_INVALID_GROUP_EFF_MU_TPUT_OMBPS,
  2000. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE,
  2001. } htt_tx_mumimo_grp_invalid_reason_code_stats;
  2002. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  2003. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  2004. #define HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS 8
  2005. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  2006. #define HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS 8
  2007. #define HTT_STATS_MAX_MUMIMO_GRP_SZ 8
  2008. /*
  2009. * Each bin represents a 300 mbps throughput
  2010. * [0] - 0-300mbps; [1] - 300-600mbps [2] - 600-900mbps; [3] - 900-1200mbps; [4] - 1200-1500mbps
  2011. * [5] - 1500-1800mbps; [6] - 1800-2100mbps; [7] - 2100-2400mbps; [8] - 2400-2700mbps; [9] - >=2700mbps
  2012. */
  2013. #define HTT_STATS_MUMIMO_TPUT_NUM_BINS 10
  2014. #define HTT_STATS_MAX_INVALID_REASON_CODE \
  2015. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE
  2016. /* Reasons stated in htt_tx_mumimo_grp_invalid_reason_code_stats */
  2017. #define HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS \
  2018. (HTT_STATS_MAX_MUMIMO_GRP_SZ * HTT_STATS_MAX_INVALID_REASON_CODE)
  2019. typedef struct {
  2020. htt_tlv_hdr_t tlv_hdr;
  2021. /*
  2022. * BIT [ 7 : 0] :- mac_id
  2023. * BIT [31 : 8] :- reserved
  2024. */
  2025. A_UINT32 mac_id__word;
  2026. /** BAR sent out for SU transmission */
  2027. A_UINT32 su_bar;
  2028. /** SW generated RTS frame sent */
  2029. A_UINT32 rts;
  2030. /** SW generated CTS-to-self frame sent */
  2031. A_UINT32 cts2self;
  2032. /** SW generated QOS NULL frame sent */
  2033. A_UINT32 qos_null;
  2034. /** BAR sent for MU user 1 */
  2035. A_UINT32 delayed_bar_1;
  2036. /** BAR sent for MU user 2 */
  2037. A_UINT32 delayed_bar_2;
  2038. /** BAR sent for MU user 3 */
  2039. A_UINT32 delayed_bar_3;
  2040. /** BAR sent for MU user 4 */
  2041. A_UINT32 delayed_bar_4;
  2042. /** BAR sent for MU user 5 */
  2043. A_UINT32 delayed_bar_5;
  2044. /** BAR sent for MU user 6 */
  2045. A_UINT32 delayed_bar_6;
  2046. /** BAR sent for MU user 7 */
  2047. A_UINT32 delayed_bar_7;
  2048. A_UINT32 bar_with_tqm_head_seq_num;
  2049. A_UINT32 bar_with_tid_seq_num;
  2050. /** SW generated RTS frame queued to the HW */
  2051. A_UINT32 su_sw_rts_queued;
  2052. /** SW generated RTS frame sent over the air */
  2053. A_UINT32 su_sw_rts_tried;
  2054. /** SW generated RTS frame completed with error */
  2055. A_UINT32 su_sw_rts_err;
  2056. /** SW generated RTS frame flushed */
  2057. A_UINT32 su_sw_rts_flushed;
  2058. /** CTS (RTS response) received in different BW */
  2059. A_UINT32 su_sw_rts_rcvd_cts_diff_bw;
  2060. /** 11AX HE MU Combined Freq. BSRP Trigger frame sent over the air */
  2061. A_UINT32 combined_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2062. /** 11AX HE MU Combined Freq. BSRP Trigger completed with error(s) */
  2063. A_UINT32 combined_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2064. /** 11AX HE MU Standalone Freq. BSRP Trigger frame sent over the air */
  2065. A_UINT32 standalone_ax_bsr_trigger_tried[HTT_NUM_AC_WMM];
  2066. /** 11AX HE MU Standalone Freq. BSRP Trigger completed with error(s) */
  2067. A_UINT32 standalone_ax_bsr_trigger_err[HTT_NUM_AC_WMM];
  2068. } htt_tx_selfgen_cmn_stats_tlv;
  2069. typedef struct {
  2070. htt_tlv_hdr_t tlv_hdr;
  2071. /** 11AC VHT SU NDPA frame sent over the air */
  2072. A_UINT32 ac_su_ndpa;
  2073. /** 11AC VHT SU NDP frame sent over the air */
  2074. A_UINT32 ac_su_ndp;
  2075. /** 11AC VHT MU MIMO NDPA frame sent over the air */
  2076. A_UINT32 ac_mu_mimo_ndpa;
  2077. /** 11AC VHT MU MIMO NDP frame sent over the air */
  2078. A_UINT32 ac_mu_mimo_ndp;
  2079. /** 11AC VHT MU MIMO BR-POLL for user 1 sent over the air */
  2080. A_UINT32 ac_mu_mimo_brpoll_1;
  2081. /** 11AC VHT MU MIMO BR-POLL for user 2 sent over the air */
  2082. A_UINT32 ac_mu_mimo_brpoll_2;
  2083. /** 11AC VHT MU MIMO BR-POLL for user 3 sent over the air */
  2084. A_UINT32 ac_mu_mimo_brpoll_3;
  2085. /** 11AC VHT SU NDPA frame queued to the HW */
  2086. A_UINT32 ac_su_ndpa_queued;
  2087. /** 11AC VHT SU NDP frame queued to the HW */
  2088. A_UINT32 ac_su_ndp_queued;
  2089. /** 11AC VHT MU MIMO NDPA frame queued to the HW */
  2090. A_UINT32 ac_mu_mimo_ndpa_queued;
  2091. /** 11AC VHT MU MIMO NDP frame queued to the HW */
  2092. A_UINT32 ac_mu_mimo_ndp_queued;
  2093. /** 11AC VHT MU MIMO BR-POLL for user 1 frame queued to the HW */
  2094. A_UINT32 ac_mu_mimo_brpoll_1_queued;
  2095. /** 11AC VHT MU MIMO BR-POLL for user 2 frame queued to the HW */
  2096. A_UINT32 ac_mu_mimo_brpoll_2_queued;
  2097. /** 11AC VHT MU MIMO BR-POLL for user 3 frame queued to the HW */
  2098. A_UINT32 ac_mu_mimo_brpoll_3_queued;
  2099. } htt_tx_selfgen_ac_stats_tlv;
  2100. typedef struct {
  2101. htt_tlv_hdr_t tlv_hdr;
  2102. /** 11AX HE SU NDPA frame sent over the air */
  2103. A_UINT32 ax_su_ndpa;
  2104. /** 11AX HE NDP frame sent over the air */
  2105. A_UINT32 ax_su_ndp;
  2106. /** 11AX HE MU MIMO NDPA frame sent over the air */
  2107. A_UINT32 ax_mu_mimo_ndpa;
  2108. /** 11AX HE MU MIMO NDP frame sent over the air */
  2109. A_UINT32 ax_mu_mimo_ndp;
  2110. union {
  2111. struct {
  2112. /* deprecated old names */
  2113. A_UINT32 ax_mu_mimo_brpoll_1;
  2114. A_UINT32 ax_mu_mimo_brpoll_2;
  2115. A_UINT32 ax_mu_mimo_brpoll_3;
  2116. A_UINT32 ax_mu_mimo_brpoll_4;
  2117. A_UINT32 ax_mu_mimo_brpoll_5;
  2118. A_UINT32 ax_mu_mimo_brpoll_6;
  2119. A_UINT32 ax_mu_mimo_brpoll_7;
  2120. };
  2121. /** 11AX HE MU BR-POLL frame for users 1 - 7 sent over the air */
  2122. A_UINT32 ax_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2123. };
  2124. /** 11AX HE MU Basic Trigger frame sent over the air */
  2125. A_UINT32 ax_basic_trigger;
  2126. /** 11AX HE MU BSRP Trigger frame sent over the air */
  2127. A_UINT32 ax_bsr_trigger;
  2128. /** 11AX HE MU BAR Trigger frame sent over the air */
  2129. A_UINT32 ax_mu_bar_trigger;
  2130. /** 11AX HE MU RTS Trigger frame sent over the air */
  2131. A_UINT32 ax_mu_rts_trigger;
  2132. /** 11AX HE MU UL-MUMIMO Trigger frame sent over the air */
  2133. A_UINT32 ax_ulmumimo_trigger;
  2134. /** 11AX HE SU NDPA frame queued to the HW */
  2135. A_UINT32 ax_su_ndpa_queued;
  2136. /** 11AX HE SU NDP frame queued to the HW */
  2137. A_UINT32 ax_su_ndp_queued;
  2138. /** 11AX HE MU MIMO NDPA frame queued to the HW */
  2139. A_UINT32 ax_mu_mimo_ndpa_queued;
  2140. /** 11AX HE MU MIMO NDP frame queued to the HW */
  2141. A_UINT32 ax_mu_mimo_ndp_queued;
  2142. /** 11AX HE MU BR-POLL frame for users 1 - 7 queued to the HW */
  2143. A_UINT32 ax_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2144. /**
  2145. * 11AX HE UL-MUMIMO Trigger frame for users 0 - 7
  2146. * successfully sent over the air
  2147. */
  2148. A_UINT32 ax_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2149. } htt_tx_selfgen_ax_stats_tlv;
  2150. typedef struct {
  2151. htt_tlv_hdr_t tlv_hdr;
  2152. /** 11be EHT SU NDPA frame sent over the air */
  2153. A_UINT32 be_su_ndpa;
  2154. /** 11be EHT NDP frame sent over the air */
  2155. A_UINT32 be_su_ndp;
  2156. /** 11be EHT MU MIMO NDPA frame sent over the air */
  2157. A_UINT32 be_mu_mimo_ndpa;
  2158. /** 11be EHT MU MIMO NDP frame sent over theT air */
  2159. A_UINT32 be_mu_mimo_ndp;
  2160. /** 11be EHT MU BR-POLL frame for users 1 - 7 sent over the air */
  2161. A_UINT32 be_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2162. /** 11be EHT MU Basic Trigger frame sent over the air */
  2163. A_UINT32 be_basic_trigger;
  2164. /** 11be EHT MU BSRP Trigger frame sent over the air */
  2165. A_UINT32 be_bsr_trigger;
  2166. /** 11be EHT MU BAR Trigger frame sent over the air */
  2167. A_UINT32 be_mu_bar_trigger;
  2168. /** 11be EHT MU RTS Trigger frame sent over the air */
  2169. A_UINT32 be_mu_rts_trigger;
  2170. /** 11be EHT MU UL-MUMIMO Trigger frame sent over the air */
  2171. A_UINT32 be_ulmumimo_trigger;
  2172. /** 11be EHT SU NDPA frame queued to the HW */
  2173. A_UINT32 be_su_ndpa_queued;
  2174. /** 11be EHT SU NDP frame queued to the HW */
  2175. A_UINT32 be_su_ndp_queued;
  2176. /** 11be EHT MU MIMO NDPA frame queued to the HW */
  2177. A_UINT32 be_mu_mimo_ndpa_queued;
  2178. /** 11be EHT MU MIMO NDP frame queued to the HW */
  2179. A_UINT32 be_mu_mimo_ndp_queued;
  2180. /** 11be EHT MU BR-POLL frame for users 1 - 7 queued to the HW */
  2181. A_UINT32 be_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2182. /**
  2183. * 11be EHT UL-MUMIMO Trigger frame for users 0 - 7
  2184. * successfully sent over the air
  2185. */
  2186. A_UINT32 be_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2187. } htt_tx_selfgen_be_stats_tlv;
  2188. typedef struct { /* DEPRECATED */
  2189. htt_tlv_hdr_t tlv_hdr;
  2190. /** 11AX HE OFDMA NDPA frame queued to the HW */
  2191. A_UINT32 ax_ofdma_ndpa_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2192. /** 11AX HE OFDMA NDPA frame sent over the air */
  2193. A_UINT32 ax_ofdma_ndpa_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2194. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2195. A_UINT32 ax_ofdma_ndpa_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2196. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2197. A_UINT32 ax_ofdma_ndpa_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2198. } htt_txbf_ofdma_ndpa_stats_tlv;
  2199. typedef struct { /* DEPRECATED */
  2200. htt_tlv_hdr_t tlv_hdr;
  2201. /** 11AX HE OFDMA NDP frame queued to the HW */
  2202. A_UINT32 ax_ofdma_ndp_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2203. /** 11AX HE OFDMA NDPA frame sent over the air */
  2204. A_UINT32 ax_ofdma_ndp_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2205. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2206. A_UINT32 ax_ofdma_ndp_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2207. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2208. A_UINT32 ax_ofdma_ndp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2209. } htt_txbf_ofdma_ndp_stats_tlv;
  2210. typedef struct { /* DEPRECATED */
  2211. htt_tlv_hdr_t tlv_hdr;
  2212. /** 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  2213. A_UINT32 ax_ofdma_brpoll_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2214. /** 11AX HE OFDMA MU BRPOLL frame sent over the air */
  2215. A_UINT32 ax_ofdma_brpoll_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2216. /** 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  2217. A_UINT32 ax_ofdma_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2218. /** 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  2219. A_UINT32 ax_ofdma_brp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2220. /**
  2221. * Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame
  2222. * completed with error(s)
  2223. */
  2224. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS+1];
  2225. } htt_txbf_ofdma_brp_stats_tlv;
  2226. typedef struct { /* DEPRECATED */
  2227. htt_tlv_hdr_t tlv_hdr;
  2228. /**
  2229. * 11AX HE OFDMA PPDUs that were sent over the air with steering
  2230. * (TXBF + OFDMA)
  2231. */
  2232. A_UINT32 ax_ofdma_num_ppdu_steer[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2233. /** 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  2234. A_UINT32 ax_ofdma_num_ppdu_ol[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2235. /**
  2236. * 11AX HE OFDMA number of users for which CBF prefetch was initiated
  2237. * to PHY HW during TX
  2238. */
  2239. A_UINT32 ax_ofdma_num_usrs_prefetch[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2240. /**
  2241. * 11AX HE OFDMA number of users for which sounding was initiated
  2242. * during TX
  2243. */
  2244. A_UINT32 ax_ofdma_num_usrs_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2245. /** 11AX HE OFDMA number of users for which sounding was forced during TX */
  2246. A_UINT32 ax_ofdma_num_usrs_force_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2247. } htt_txbf_ofdma_steer_stats_tlv;
  2248. /* Note:
  2249. * This struct htt_tx_pdev_txbf_ofdma_stats_t and all its constituent
  2250. * struct TLVs are deprecated, due to the need for restructuring these
  2251. * stats into a variable length array
  2252. */
  2253. typedef struct { /* DEPRECATED */
  2254. htt_txbf_ofdma_ndpa_stats_tlv ofdma_ndpa_tlv;
  2255. htt_txbf_ofdma_ndp_stats_tlv ofdma_ndp_tlv;
  2256. htt_txbf_ofdma_brp_stats_tlv ofdma_brp_tlv;
  2257. htt_txbf_ofdma_steer_stats_tlv ofdma_steer_tlv;
  2258. } htt_tx_pdev_txbf_ofdma_stats_t;
  2259. typedef struct {
  2260. /** 11AX HE OFDMA NDPA frame queued to the HW */
  2261. A_UINT32 ax_ofdma_ndpa_queued;
  2262. /** 11AX HE OFDMA NDPA frame sent over the air */
  2263. A_UINT32 ax_ofdma_ndpa_tried;
  2264. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2265. A_UINT32 ax_ofdma_ndpa_flushed;
  2266. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2267. A_UINT32 ax_ofdma_ndpa_err;
  2268. } htt_txbf_ofdma_ax_ndpa_stats_elem_t;
  2269. typedef struct {
  2270. htt_tlv_hdr_t tlv_hdr;
  2271. /**
  2272. * This field is populated with the num of elems in the ax_ndpa[]
  2273. * variable length array.
  2274. */
  2275. A_UINT32 num_elems_ax_ndpa_arr;
  2276. /**
  2277. * This field will be filled by target with value of
  2278. * sizeof(htt_txbf_ofdma_ax_ndpa_stats_elem_t).
  2279. * This is for allowing host to infer how much data target has provided,
  2280. * even if it using different version of the struct def than what target
  2281. * had used.
  2282. */
  2283. A_UINT32 arr_elem_size_ax_ndpa;
  2284. htt_txbf_ofdma_ax_ndpa_stats_elem_t ax_ndpa[1]; /* variable length */
  2285. } htt_txbf_ofdma_ax_ndpa_stats_tlv;
  2286. typedef struct {
  2287. /** 11AX HE OFDMA NDP frame queued to the HW */
  2288. A_UINT32 ax_ofdma_ndp_queued;
  2289. /** 11AX HE OFDMA NDPA frame sent over the air */
  2290. A_UINT32 ax_ofdma_ndp_tried;
  2291. /** 11AX HE OFDMA NDPA frame flushed by HW */
  2292. A_UINT32 ax_ofdma_ndp_flushed;
  2293. /** 11AX HE OFDMA NDPA frame completed with error(s) */
  2294. A_UINT32 ax_ofdma_ndp_err;
  2295. } htt_txbf_ofdma_ax_ndp_stats_elem_t;
  2296. typedef struct {
  2297. htt_tlv_hdr_t tlv_hdr;
  2298. /**
  2299. * This field is populated with the num of elems in the the ax_ndp[]
  2300. * variable length array.
  2301. */
  2302. A_UINT32 num_elems_ax_ndp_arr;
  2303. /**
  2304. * This field will be filled by target with value of
  2305. * sizeof(htt_txbf_ofdma_ax_ndp_stats_elem_t).
  2306. * This is for allowing host to infer how much data target has provided,
  2307. * even if it using different version of the struct def than what target
  2308. * had used.
  2309. */
  2310. A_UINT32 arr_elem_size_ax_ndp;
  2311. htt_txbf_ofdma_ax_ndp_stats_elem_t ax_ndp[1]; /* variable length */
  2312. } htt_txbf_ofdma_ax_ndp_stats_tlv;
  2313. typedef struct {
  2314. /** 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  2315. A_UINT32 ax_ofdma_brpoll_queued;
  2316. /** 11AX HE OFDMA MU BRPOLL frame sent over the air */
  2317. A_UINT32 ax_ofdma_brpoll_tried;
  2318. /** 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  2319. A_UINT32 ax_ofdma_brpoll_flushed;
  2320. /** 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  2321. A_UINT32 ax_ofdma_brp_err;
  2322. /**
  2323. * Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame
  2324. * completed with error(s)
  2325. */
  2326. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd;
  2327. } htt_txbf_ofdma_ax_brp_stats_elem_t;
  2328. typedef struct {
  2329. htt_tlv_hdr_t tlv_hdr;
  2330. /**
  2331. * This field is populated with the num of elems in the the ax_brp[]
  2332. * variable length array.
  2333. */
  2334. A_UINT32 num_elems_ax_brp_arr;
  2335. /**
  2336. * This field will be filled by target with value of
  2337. * sizeof(htt_txbf_ofdma_ax_brp_stats_elem_t).
  2338. * This is for allowing host to infer how much data target has provided,
  2339. * even if it using different version of the struct than what target
  2340. * had used.
  2341. */
  2342. A_UINT32 arr_elem_size_ax_brp;
  2343. htt_txbf_ofdma_ax_brp_stats_elem_t ax_brp[1]; /* variable length */
  2344. } htt_txbf_ofdma_ax_brp_stats_tlv;
  2345. typedef struct {
  2346. /**
  2347. * 11AX HE OFDMA PPDUs that were sent over the air with steering
  2348. * (TXBF + OFDMA)
  2349. */
  2350. A_UINT32 ax_ofdma_num_ppdu_steer;
  2351. /** 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  2352. A_UINT32 ax_ofdma_num_ppdu_ol;
  2353. /**
  2354. * 11AX HE OFDMA number of users for which CBF prefetch was initiated
  2355. * to PHY HW during TX
  2356. */
  2357. A_UINT32 ax_ofdma_num_usrs_prefetch;
  2358. /**
  2359. * 11AX HE OFDMA number of users for which sounding was initiated
  2360. * during TX
  2361. */
  2362. A_UINT32 ax_ofdma_num_usrs_sound;
  2363. /** 11AX HE OFDMA number of users for which sounding was forced during TX */
  2364. A_UINT32 ax_ofdma_num_usrs_force_sound;
  2365. } htt_txbf_ofdma_ax_steer_stats_elem_t;
  2366. typedef struct {
  2367. htt_tlv_hdr_t tlv_hdr;
  2368. /**
  2369. * This field is populated with the num of elems in the ax_steer[]
  2370. * variable length array.
  2371. */
  2372. A_UINT32 num_elems_ax_steer_arr;
  2373. /**
  2374. * This field will be filled by target with value of
  2375. * sizeof(htt_txbf_ofdma_ax_steer_stats_elem_t).
  2376. * This is for allowing host to infer how much data target has provided,
  2377. * even if it using different version of the struct than what target
  2378. * had used.
  2379. */
  2380. A_UINT32 arr_elem_size_ax_steer;
  2381. htt_txbf_ofdma_ax_steer_stats_elem_t ax_steer[1]; /* variable length */
  2382. } htt_txbf_ofdma_ax_steer_stats_tlv;
  2383. typedef struct {
  2384. /** 11BE EHT OFDMA NDPA frame queued to the HW */
  2385. A_UINT32 be_ofdma_ndpa_queued;
  2386. /** 11BE EHT OFDMA NDPA frame sent over the air */
  2387. A_UINT32 be_ofdma_ndpa_tried;
  2388. /** 11BE EHT OFDMA NDPA frame flushed by HW */
  2389. A_UINT32 be_ofdma_ndpa_flushed;
  2390. /** 11BE EHT OFDMA NDPA frame completed with error(s) */
  2391. A_UINT32 be_ofdma_ndpa_err;
  2392. } htt_txbf_ofdma_be_ndpa_stats_elem_t;
  2393. typedef struct {
  2394. htt_tlv_hdr_t tlv_hdr;
  2395. /**
  2396. * This field is populated with the num of elems in the be_ndpa[]
  2397. * variable length array.
  2398. */
  2399. A_UINT32 num_elems_be_ndpa_arr;
  2400. /**
  2401. * This field will be filled by target with value of
  2402. * sizeof(htt_txbf_ofdma_be_ndpa_stats_elem_t).
  2403. * This is for allowing host to infer how much data target has provided,
  2404. * even if it using different version of the struct than what target
  2405. * had used.
  2406. */
  2407. A_UINT32 arr_elem_size_be_ndpa;
  2408. htt_txbf_ofdma_be_ndpa_stats_elem_t be_ndpa[1]; /* variable length */
  2409. } htt_txbf_ofdma_be_ndpa_stats_tlv;
  2410. typedef struct {
  2411. /** 11BE EHT OFDMA NDP frame queued to the HW */
  2412. A_UINT32 be_ofdma_ndp_queued;
  2413. /** 11BE EHT OFDMA NDPA frame sent over the air */
  2414. A_UINT32 be_ofdma_ndp_tried;
  2415. /** 11BE EHT OFDMA NDPA frame flushed by HW */
  2416. A_UINT32 be_ofdma_ndp_flushed;
  2417. /** 11BE EHT OFDMA NDPA frame completed with error(s) */
  2418. A_UINT32 be_ofdma_ndp_err;
  2419. } htt_txbf_ofdma_be_ndp_stats_elem_t;
  2420. typedef struct {
  2421. htt_tlv_hdr_t tlv_hdr;
  2422. /**
  2423. * This field is populated with the num of elems in the be_ndp[]
  2424. * variable length array.
  2425. */
  2426. A_UINT32 num_elems_be_ndp_arr;
  2427. /**
  2428. * This field will be filled by target with value of
  2429. * sizeof(htt_txbf_ofdma_be_ndp_stats_elem_t).
  2430. * This is for allowing host to infer how much data target has provided,
  2431. * even if it using different version of the struct than what target
  2432. * had used.
  2433. */
  2434. A_UINT32 arr_elem_size_be_ndp;
  2435. htt_txbf_ofdma_be_ndp_stats_elem_t be_ndp[1]; /* variable length */
  2436. } htt_txbf_ofdma_be_ndp_stats_tlv;
  2437. typedef struct {
  2438. /** 11BE EHT OFDMA MU BRPOLL frame queued to the HW */
  2439. A_UINT32 be_ofdma_brpoll_queued;
  2440. /** 11BE EHT OFDMA MU BRPOLL frame sent over the air */
  2441. A_UINT32 be_ofdma_brpoll_tried;
  2442. /** 11BE EHT OFDMA MU BRPOLL frame flushed by HW */
  2443. A_UINT32 be_ofdma_brpoll_flushed;
  2444. /** 11BE EHT OFDMA MU BRPOLL frame completed with error(s) */
  2445. A_UINT32 be_ofdma_brp_err;
  2446. /**
  2447. * Number of CBF(s) received when 11BE EHT OFDMA MU BRPOLL frame
  2448. * completed with error(s)
  2449. */
  2450. A_UINT32 be_ofdma_brp_err_num_cbf_rcvd;
  2451. } htt_txbf_ofdma_be_brp_stats_elem_t;
  2452. typedef struct {
  2453. htt_tlv_hdr_t tlv_hdr;
  2454. /**
  2455. * This field is populated with the num of elems in the be_brp[]
  2456. * variable length array.
  2457. */
  2458. A_UINT32 num_elems_be_brp_arr;
  2459. /**
  2460. * This field will be filled by target with value of
  2461. * sizeof(htt_txbf_ofdma_be_brp_stats_elem_t).
  2462. * This is for allowing host to infer how much data target has provided,
  2463. * even if it using different version of the struct than what target
  2464. * had used
  2465. */
  2466. A_UINT32 arr_elem_size_be_brp;
  2467. htt_txbf_ofdma_be_brp_stats_elem_t be_brp[1]; /* variable length */
  2468. } htt_txbf_ofdma_be_brp_stats_tlv;
  2469. typedef struct {
  2470. /**
  2471. * 11BE EHT OFDMA PPDUs that were sent over the air with steering
  2472. * (TXBF + OFDMA)
  2473. */
  2474. A_UINT32 be_ofdma_num_ppdu_steer;
  2475. /** 11BE EHT OFDMA PPDUs that were sent over the air in open loop */
  2476. A_UINT32 be_ofdma_num_ppdu_ol;
  2477. /**
  2478. * 11BE EHT OFDMA number of users for which CBF prefetch was initiated
  2479. * to PHY HW during TX
  2480. */
  2481. A_UINT32 be_ofdma_num_usrs_prefetch;
  2482. /**
  2483. * 11BE EHT OFDMA number of users for which sounding was initiated
  2484. * during TX
  2485. */
  2486. A_UINT32 be_ofdma_num_usrs_sound;
  2487. /**
  2488. * 11BE EHT OFDMA number of users for which sounding was forced during TX
  2489. */
  2490. A_UINT32 be_ofdma_num_usrs_force_sound;
  2491. } htt_txbf_ofdma_be_steer_stats_elem_t;
  2492. typedef struct {
  2493. htt_tlv_hdr_t tlv_hdr;
  2494. /**
  2495. * This field is populated with the num of elems in the be_steer[]
  2496. * variable length array.
  2497. */
  2498. A_UINT32 num_elems_be_steer_arr;
  2499. /**
  2500. * This field will be filled by target with value of
  2501. * sizeof(htt_txbf_ofdma_be_steer_stats_elem_t).
  2502. * This is for allowing host to infer how much data target has provided,
  2503. * even if it using different version of the struct than what target
  2504. * had used.
  2505. */
  2506. A_UINT32 arr_elem_size_be_steer;
  2507. htt_txbf_ofdma_be_steer_stats_elem_t be_steer[1]; /* variable length */
  2508. } htt_txbf_ofdma_be_steer_stats_tlv;
  2509. /* STATS_TYPE : HTT_DBG_EXT_STATS_TXBF_OFDMA
  2510. * TLV_TAGS:
  2511. * - HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG
  2512. * - HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG
  2513. * - HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG
  2514. * - HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG
  2515. * - HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG
  2516. * - HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG
  2517. * - HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG
  2518. * - HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG
  2519. */
  2520. typedef struct {
  2521. htt_tlv_hdr_t tlv_hdr;
  2522. /** 11AC VHT SU NDP frame completed with error(s) */
  2523. A_UINT32 ac_su_ndp_err;
  2524. /** 11AC VHT SU NDPA frame completed with error(s) */
  2525. A_UINT32 ac_su_ndpa_err;
  2526. /** 11AC VHT MU MIMO NDPA frame completed with error(s) */
  2527. A_UINT32 ac_mu_mimo_ndpa_err;
  2528. /** 11AC VHT MU MIMO NDP frame completed with error(s) */
  2529. A_UINT32 ac_mu_mimo_ndp_err;
  2530. /** 11AC VHT MU MIMO BRPOLL for user 1 frame completed with error(s) */
  2531. A_UINT32 ac_mu_mimo_brp1_err;
  2532. /** 11AC VHT MU MIMO BRPOLL for user 2 frame completed with error(s) */
  2533. A_UINT32 ac_mu_mimo_brp2_err;
  2534. /** 11AC VHT MU MIMO BRPOLL for user 3 frame completed with error(s) */
  2535. A_UINT32 ac_mu_mimo_brp3_err;
  2536. /** 11AC VHT SU NDPA frame flushed by HW */
  2537. A_UINT32 ac_su_ndpa_flushed;
  2538. /** 11AC VHT SU NDP frame flushed by HW */
  2539. A_UINT32 ac_su_ndp_flushed;
  2540. /** 11AC VHT MU MIMO NDPA frame flushed by HW */
  2541. A_UINT32 ac_mu_mimo_ndpa_flushed;
  2542. /** 11AC VHT MU MIMO NDP frame flushed by HW */
  2543. A_UINT32 ac_mu_mimo_ndp_flushed;
  2544. /** 11AC VHT MU MIMO BRPOLL for user 1 frame flushed by HW */
  2545. A_UINT32 ac_mu_mimo_brpoll1_flushed;
  2546. /** 11AC VHT MU MIMO BRPOLL for user 2 frame flushed by HW */
  2547. A_UINT32 ac_mu_mimo_brpoll2_flushed;
  2548. /** 11AC VHT MU MIMO BRPOLL for user 3 frame flushed by HW */
  2549. A_UINT32 ac_mu_mimo_brpoll3_flushed;
  2550. } htt_tx_selfgen_ac_err_stats_tlv;
  2551. typedef struct {
  2552. htt_tlv_hdr_t tlv_hdr;
  2553. /** 11AX HE SU NDP frame completed with error(s) */
  2554. A_UINT32 ax_su_ndp_err;
  2555. /** 11AX HE SU NDPA frame completed with error(s) */
  2556. A_UINT32 ax_su_ndpa_err;
  2557. /** 11AX HE MU MIMO NDPA frame completed with error(s) */
  2558. A_UINT32 ax_mu_mimo_ndpa_err;
  2559. /** 11AX HE MU MIMO NDP frame completed with error(s) */
  2560. A_UINT32 ax_mu_mimo_ndp_err;
  2561. union {
  2562. struct {
  2563. /* deprecated old names */
  2564. A_UINT32 ax_mu_mimo_brp1_err;
  2565. A_UINT32 ax_mu_mimo_brp2_err;
  2566. A_UINT32 ax_mu_mimo_brp3_err;
  2567. A_UINT32 ax_mu_mimo_brp4_err;
  2568. A_UINT32 ax_mu_mimo_brp5_err;
  2569. A_UINT32 ax_mu_mimo_brp6_err;
  2570. A_UINT32 ax_mu_mimo_brp7_err;
  2571. };
  2572. /** 11AX HE MU BR-POLL frame for 1 - 7 users completed with error(s) */
  2573. A_UINT32 ax_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2574. };
  2575. /** 11AX HE MU Basic Trigger frame completed with error(s) */
  2576. A_UINT32 ax_basic_trigger_err;
  2577. /** 11AX HE MU BSRP Trigger frame completed with error(s) */
  2578. A_UINT32 ax_bsr_trigger_err;
  2579. /** 11AX HE MU BAR Trigger frame completed with error(s) */
  2580. A_UINT32 ax_mu_bar_trigger_err;
  2581. /** 11AX HE MU RTS Trigger frame completed with error(s) */
  2582. A_UINT32 ax_mu_rts_trigger_err;
  2583. /** 11AX HE MU ULMUMIMO Trigger frame completed with error(s) */
  2584. A_UINT32 ax_ulmumimo_trigger_err;
  2585. /**
  2586. * Number of CBF(s) received when 11AX HE MU MIMO BRPOLL
  2587. * frame completed with error(s)
  2588. */
  2589. A_UINT32 ax_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2590. /** 11AX HE SU NDPA frame flushed by HW */
  2591. A_UINT32 ax_su_ndpa_flushed;
  2592. /** 11AX HE SU NDP frame flushed by HW */
  2593. A_UINT32 ax_su_ndp_flushed;
  2594. /** 11AX HE MU MIMO NDPA frame flushed by HW */
  2595. A_UINT32 ax_mu_mimo_ndpa_flushed;
  2596. /** 11AX HE MU MIMO NDP frame flushed by HW */
  2597. A_UINT32 ax_mu_mimo_ndp_flushed;
  2598. /** 11AX HE MU BR-POLL frame for users 1 - 7 flushed by HW */
  2599. A_UINT32 ax_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  2600. /**
  2601. * 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  2602. */
  2603. A_UINT32 ax_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2604. /** 11AX HE MU OFDMA Basic Trigger frame completed with partial user response */
  2605. A_UINT32 ax_basic_trigger_partial_resp;
  2606. /** 11AX HE MU BSRP Trigger frame completed with partial user response */
  2607. A_UINT32 ax_bsr_trigger_partial_resp;
  2608. /** 11AX HE MU BAR Trigger frame completed with partial user response */
  2609. A_UINT32 ax_mu_bar_trigger_partial_resp;
  2610. } htt_tx_selfgen_ax_err_stats_tlv;
  2611. typedef struct {
  2612. htt_tlv_hdr_t tlv_hdr;
  2613. /** 11BE EHT SU NDP frame completed with error(s) */
  2614. A_UINT32 be_su_ndp_err;
  2615. /** 11BE EHT SU NDPA frame completed with error(s) */
  2616. A_UINT32 be_su_ndpa_err;
  2617. /** 11BE EHT MU MIMO NDPA frame completed with error(s) */
  2618. A_UINT32 be_mu_mimo_ndpa_err;
  2619. /** 11BE EHT MU MIMO NDP frame completed with error(s) */
  2620. A_UINT32 be_mu_mimo_ndp_err;
  2621. /** 11BE EHT MU BR-POLL frame for 1 - 7 users completed with error(s) */
  2622. A_UINT32 be_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2623. /** 11BE EHT MU Basic Trigger frame completed with error(s) */
  2624. A_UINT32 be_basic_trigger_err;
  2625. /** 11BE EHT MU BSRP Trigger frame completed with error(s) */
  2626. A_UINT32 be_bsr_trigger_err;
  2627. /** 11BE EHT MU BAR Trigger frame completed with error(s) */
  2628. A_UINT32 be_mu_bar_trigger_err;
  2629. /** 11BE EHT MU RTS Trigger frame completed with error(s) */
  2630. A_UINT32 be_mu_rts_trigger_err;
  2631. /** 11BE EHT MU ULMUMIMO Trigger frame completed with error(s) */
  2632. A_UINT32 be_ulmumimo_trigger_err;
  2633. /**
  2634. * Number of CBF(s) received when 11BE EHT MU MIMO BRPOLL frame
  2635. * completed with error(s)
  2636. */
  2637. A_UINT32 be_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2638. /** 11BE EHT SU NDPA frame flushed by HW */
  2639. A_UINT32 be_su_ndpa_flushed;
  2640. /** 11BE EHT SU NDP frame flushed by HW */
  2641. A_UINT32 be_su_ndp_flushed;
  2642. /** 11BE EHT MU MIMO NDPA frame flushed by HW */
  2643. A_UINT32 be_mu_mimo_ndpa_flushed;
  2644. /** 11BE HT MU MIMO NDP frame flushed by HW */
  2645. A_UINT32 be_mu_mimo_ndp_flushed;
  2646. /** 11BE EHT MU BR-POLL frame for users 1 - 7 flushed by HW */
  2647. A_UINT32 be_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  2648. /**
  2649. * 11BE EHT UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  2650. */
  2651. A_UINT32 be_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2652. /** 11BE EHT MU OFDMA Basic Trigger frame completed with partial user response */
  2653. A_UINT32 be_basic_trigger_partial_resp;
  2654. /** 11BE EHT MU BSRP Trigger frame completed with partial user response */
  2655. A_UINT32 be_bsr_trigger_partial_resp;
  2656. /** 11BE EHT MU BAR Trigger frame completed with partial user response */
  2657. A_UINT32 be_mu_bar_trigger_partial_resp;
  2658. } htt_tx_selfgen_be_err_stats_tlv;
  2659. /*
  2660. * Scheduler completion status reason code.
  2661. * (0) HTT_TXERR_NONE - No error (Success).
  2662. * (1) HTT_TXERR_RESP - Response timeout, response mismatch, BW mismatch,
  2663. * MIMO control mismatch, CRC error etc.
  2664. * (2) HTT_TXERR_FILT - Blocked by HW tx filtering.
  2665. * (3) HTT_TXERR_FIFO - FIFO, misc. errors in HW.
  2666. * (4) HTT_TXERR_SWABORT - Software initialted abort (TX_ABORT).
  2667. * (5) HTT_TXERR_RESERVED1 - Currently reserved.
  2668. * (6) HTT_TXERR_RESERVED2 - Currently reserved.
  2669. */
  2670. /* Scheduler error code.
  2671. * (0) HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR - Flush received from HW.
  2672. * (1) HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR - Scheduler command was
  2673. * filtered by HW.
  2674. * (2) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR - Response frame mismatch
  2675. * error.
  2676. * (3) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR - CBF
  2677. * received with MIMO control mismatch.
  2678. * (4) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR - CBF received with
  2679. * BW mismatch.
  2680. * (5) HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR - Error in transmitting
  2681. * frame even after maximum retries.
  2682. * (6) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR - Response frame
  2683. * received outside RX window.
  2684. * (7) HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR - No frame
  2685. * received by HW for queuing within SIFS interval.
  2686. */
  2687. typedef struct {
  2688. htt_tlv_hdr_t tlv_hdr;
  2689. /** 11AC VHT SU NDPA scheduler completion status reason code */
  2690. A_UINT32 ac_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2691. /** 11AC VHT SU NDP scheduler completion status reason code */
  2692. A_UINT32 ac_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2693. /** 11AC VHT SU NDP scheduler error code */
  2694. A_UINT32 ac_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2695. /** 11AC VHT MU MIMO NDPA scheduler completion status reason code */
  2696. A_UINT32 ac_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2697. /** 11AC VHT MU MIMO NDP scheduler completion status reason code */
  2698. A_UINT32 ac_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2699. /** 11AC VHT MU MIMO NDP scheduler error code */
  2700. A_UINT32 ac_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2701. /** 11AC VHT MU MIMO BRPOLL scheduler completion status reason code */
  2702. A_UINT32 ac_mu_mimo_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2703. /** 11AC VHT MU MIMO BRPOLL scheduler error code */
  2704. A_UINT32 ac_mu_mimo_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2705. } htt_tx_selfgen_ac_sched_status_stats_tlv;
  2706. typedef struct {
  2707. htt_tlv_hdr_t tlv_hdr;
  2708. /** 11AX HE SU NDPA scheduler completion status reason code */
  2709. A_UINT32 ax_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2710. /** 11AX SU NDP scheduler completion status reason code */
  2711. A_UINT32 ax_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2712. /** 11AX HE SU NDP scheduler error code */
  2713. A_UINT32 ax_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2714. /** 11AX HE MU MIMO NDPA scheduler completion status reason code */
  2715. A_UINT32 ax_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2716. /** 11AX HE MU MIMO NDP scheduler completion status reason code */
  2717. A_UINT32 ax_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2718. /** 11AX HE MU MIMO NDP scheduler error code */
  2719. A_UINT32 ax_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2720. /** 11AX HE MU MIMO MU BRPOLL scheduler completion status reason code */
  2721. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2722. /** 11AX HE MU MIMO MU BRPOLL scheduler error code */
  2723. A_UINT32 ax_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2724. /** 11AX HE MU BAR scheduler completion status reason code */
  2725. A_UINT32 ax_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2726. /** 11AX HE MU BAR scheduler error code */
  2727. A_UINT32 ax_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2728. /**
  2729. * 11AX HE UL OFDMA Basic Trigger scheduler completion status reason code
  2730. */
  2731. A_UINT32 ax_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2732. /** 11AX HE UL OFDMA Basic Trigger scheduler error code */
  2733. A_UINT32 ax_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2734. /**
  2735. * 11AX HE UL MUMIMO Basic Trigger scheduler completion status reason code
  2736. */
  2737. A_UINT32 ax_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2738. /** 11AX HE UL MUMIMO Basic Trigger scheduler error code */
  2739. A_UINT32 ax_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2740. } htt_tx_selfgen_ax_sched_status_stats_tlv;
  2741. typedef struct {
  2742. htt_tlv_hdr_t tlv_hdr;
  2743. /** 11BE EHT SU NDPA scheduler completion status reason code */
  2744. A_UINT32 be_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2745. /** 11BE SU NDP scheduler completion status reason code */
  2746. A_UINT32 be_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2747. /** 11BE EHT SU NDP scheduler error code */
  2748. A_UINT32 be_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2749. /** 11BE EHT MU MIMO NDPA scheduler completion status reason code */
  2750. A_UINT32 be_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2751. /** 11BE EHT MU MIMO NDP scheduler completion status reason code */
  2752. A_UINT32 be_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2753. /** 11BE EHT MU MIMO NDP scheduler error code */
  2754. A_UINT32 be_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2755. /** 11BE EHT MU MIMO MU BRPOLL scheduler completion status reason code */
  2756. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2757. /** 11BE EHT MU MIMO MU BRPOLL scheduler error code */
  2758. A_UINT32 be_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2759. /** 11BE EHT MU BAR scheduler completion status reason code */
  2760. A_UINT32 be_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2761. /** 11BE EHT MU BAR scheduler error code */
  2762. A_UINT32 be_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2763. /**
  2764. * 11BE EHT UL OFDMA Basic Trigger scheduler completion status reason code
  2765. */
  2766. A_UINT32 be_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2767. /** 11BE EHT UL OFDMA Basic Trigger scheduler error code */
  2768. A_UINT32 be_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2769. /**
  2770. * 11BE EHT UL MUMIMO Basic Trigger scheduler completion status reason code
  2771. */
  2772. A_UINT32 be_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2773. /** 11BE EHT UL MUMIMO Basic Trigger scheduler error code */
  2774. A_UINT32 be_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2775. } htt_tx_selfgen_be_sched_status_stats_tlv;
  2776. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  2777. * TLV_TAGS:
  2778. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  2779. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  2780. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  2781. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  2782. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  2783. * - HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG
  2784. * - HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG
  2785. * - HTT_STATS_TX_SELFGEN_BE_STATS_TAG
  2786. * - HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG
  2787. * - HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG
  2788. */
  2789. /* NOTE:
  2790. * This structure is for documentation, and cannot be safely used directly.
  2791. * Instead, use the constituent TLV structures to fill/parse.
  2792. */
  2793. typedef struct {
  2794. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  2795. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  2796. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  2797. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  2798. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  2799. htt_tx_selfgen_ac_sched_status_stats_tlv ac_sched_status_tlv;
  2800. htt_tx_selfgen_ax_sched_status_stats_tlv ax_sched_status_tlv;
  2801. htt_tx_selfgen_be_stats_tlv be_tlv;
  2802. htt_tx_selfgen_be_err_stats_tlv be_err_tlv;
  2803. htt_tx_selfgen_be_sched_status_stats_tlv be_sched_status_tlv;
  2804. } htt_tx_pdev_selfgen_stats_t;
  2805. /* == TX MU STATS == */
  2806. typedef struct {
  2807. htt_tlv_hdr_t tlv_hdr;
  2808. /** Number of MU MIMO schedules posted to HW */
  2809. A_UINT32 mu_mimo_sch_posted;
  2810. /** Number of MU MIMO schedules failed to post */
  2811. A_UINT32 mu_mimo_sch_failed;
  2812. /** Number of MU MIMO PPDUs posted to HW */
  2813. A_UINT32 mu_mimo_ppdu_posted;
  2814. /*
  2815. * This is the common description for the below sch stats.
  2816. * Counts the number of transmissions of each number of MU users
  2817. * in each TX mode.
  2818. * The array index is the "number of users - 1".
  2819. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  2820. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  2821. * TX PPDUs and so on.
  2822. * The same is applicable for the other TX mode stats.
  2823. */
  2824. /** Represents the count for 11AC DL MU MIMO sequences */
  2825. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2826. /** Represents the count for 11AX DL MU MIMO sequences */
  2827. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2828. /** Represents the count for 11AX DL MU OFDMA sequences */
  2829. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2830. /**
  2831. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  2832. */
  2833. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2834. /** Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  2835. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2836. /** Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  2837. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2838. /** Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  2839. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2840. /**
  2841. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  2842. */
  2843. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2844. /** Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  2845. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2846. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  2847. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2848. /** Number of 11AX DL MU MIMO schedules posted per group size */
  2849. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2850. /** Represents the count for 11BE DL MU MIMO sequences */
  2851. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2852. /** Number of 11BE DL MU MIMO schedules posted per group size */
  2853. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2854. /** Number of 11AC DL MU MIMO schedules posted per group size (4-7) */
  2855. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2856. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  2857. typedef struct {
  2858. htt_tlv_hdr_t tlv_hdr;
  2859. A_UINT32 dl_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2860. A_UINT32 dl_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2861. A_UINT32 dl_mumimo_grp_eligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2862. A_UINT32 dl_mumimo_grp_ineligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2863. A_UINT32 dl_mumimo_grp_invalid[HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS];
  2864. A_UINT32 dl_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  2865. A_UINT32 ul_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2866. A_UINT32 ul_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2867. A_UINT32 ul_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  2868. } htt_tx_pdev_mumimo_grp_stats_tlv;
  2869. typedef struct {
  2870. htt_tlv_hdr_t tlv_hdr;
  2871. /** Number of MU MIMO schedules posted to HW */
  2872. A_UINT32 mu_mimo_sch_posted;
  2873. /** Number of MU MIMO schedules failed to post */
  2874. A_UINT32 mu_mimo_sch_failed;
  2875. /** Number of MU MIMO PPDUs posted to HW */
  2876. A_UINT32 mu_mimo_ppdu_posted;
  2877. /*
  2878. * This is the common description for the below sch stats.
  2879. * Counts the number of transmissions of each number of MU users
  2880. * in each TX mode.
  2881. * The array index is the "number of users - 1".
  2882. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  2883. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  2884. * TX PPDUs and so on.
  2885. * The same is applicable for the other TX mode stats.
  2886. */
  2887. /** Represents the count for 11AC DL MU MIMO sequences */
  2888. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2889. /** Represents the count for 11AX DL MU MIMO sequences */
  2890. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2891. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  2892. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2893. /** Number of 11AX DL MU MIMO schedules posted per group size */
  2894. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2895. /** Represents the count for 11BE DL MU MIMO sequences */
  2896. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2897. /** Number of 11BE DL MU MIMO schedules posted per group size */
  2898. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2899. /** Number of 11AC DL MU MIMO schedules posted per group size (4 - 7)*/
  2900. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2901. } htt_tx_pdev_dl_mu_mimo_sch_stats_tlv;
  2902. typedef struct {
  2903. htt_tlv_hdr_t tlv_hdr;
  2904. /** Represents the count for 11AX DL MU OFDMA sequences */
  2905. A_UINT32 ax_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2906. } htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv;
  2907. typedef struct {
  2908. htt_tlv_hdr_t tlv_hdr;
  2909. /** Represents the count for 11BE DL MU OFDMA sequences */
  2910. A_UINT32 be_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2911. } htt_tx_pdev_be_dl_mu_ofdma_sch_stats_tlv;
  2912. typedef struct {
  2913. htt_tlv_hdr_t tlv_hdr;
  2914. /**
  2915. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  2916. */
  2917. A_UINT32 ax_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2918. /**
  2919. * Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers
  2920. */
  2921. A_UINT32 ax_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2922. /**
  2923. * Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers
  2924. */
  2925. A_UINT32 ax_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2926. /**
  2927. * Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers
  2928. */
  2929. A_UINT32 ax_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2930. } htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv;
  2931. typedef struct {
  2932. htt_tlv_hdr_t tlv_hdr;
  2933. /**
  2934. * Represents the count for 11BE UL MU OFDMA sequences with Basic Triggers
  2935. */
  2936. A_UINT32 be_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2937. /**
  2938. * Represents the count for 11BE UL MU OFDMA sequences with BSRP Triggers
  2939. */
  2940. A_UINT32 be_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2941. /**
  2942. * Represents the count for 11BE UL MU OFDMA sequences with BAR Triggers
  2943. */
  2944. A_UINT32 be_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2945. /**
  2946. * Represents the count for 11BE UL MU OFDMA sequences with BRP Triggers
  2947. */
  2948. A_UINT32 be_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2949. } htt_tx_pdev_be_ul_mu_ofdma_sch_stats_tlv;
  2950. typedef struct {
  2951. htt_tlv_hdr_t tlv_hdr;
  2952. /**
  2953. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  2954. */
  2955. A_UINT32 ax_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2956. /**
  2957. * Represents the count for 11AX UL MU MIMO sequences with BRP Triggers
  2958. */
  2959. A_UINT32 ax_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2960. } htt_tx_pdev_ul_mu_mimo_sch_stats_tlv;
  2961. typedef struct {
  2962. htt_tlv_hdr_t tlv_hdr;
  2963. /**
  2964. * Represents the count for 11BE UL MU MIMO sequences with Basic Triggers
  2965. */
  2966. A_UINT32 be_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2967. /**
  2968. * Represents the count for 11BE UL MU MIMO sequences with BRP Triggers
  2969. */
  2970. A_UINT32 be_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2971. } htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv;
  2972. typedef struct {
  2973. htt_tlv_hdr_t tlv_hdr;
  2974. /** 11AC DL MU MIMO number of mpdus queued to HW, per user */
  2975. A_UINT32 mu_mimo_mpdus_queued_usr;
  2976. /** 11AC DL MU MIMO number of mpdus tried over the air, per user */
  2977. A_UINT32 mu_mimo_mpdus_tried_usr;
  2978. /** 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  2979. A_UINT32 mu_mimo_mpdus_failed_usr;
  2980. /** 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  2981. A_UINT32 mu_mimo_mpdus_requeued_usr;
  2982. /** 11AC DL MU MIMO BA not receieved, per user */
  2983. A_UINT32 mu_mimo_err_no_ba_usr;
  2984. /** 11AC DL MU MIMO mpdu underrun encountered, per user */
  2985. A_UINT32 mu_mimo_mpdu_underrun_usr;
  2986. /** 11AC DL MU MIMO ampdu underrun encountered, per user */
  2987. A_UINT32 mu_mimo_ampdu_underrun_usr;
  2988. /** 11AX MU MIMO number of mpdus queued to HW, per user */
  2989. A_UINT32 ax_mu_mimo_mpdus_queued_usr;
  2990. /** 11AX MU MIMO number of mpdus tried over the air, per user */
  2991. A_UINT32 ax_mu_mimo_mpdus_tried_usr;
  2992. /** 11AX DL MU MIMO number of mpdus failed acknowledgement, per user */
  2993. A_UINT32 ax_mu_mimo_mpdus_failed_usr;
  2994. /** 11AX DL MU MIMO number of mpdus re-queued to HW, per user */
  2995. A_UINT32 ax_mu_mimo_mpdus_requeued_usr;
  2996. /** 11AX DL MU MIMO BA not receieved, per user */
  2997. A_UINT32 ax_mu_mimo_err_no_ba_usr;
  2998. /** 11AX DL MU MIMO mpdu underrun encountered, per user */
  2999. A_UINT32 ax_mu_mimo_mpdu_underrun_usr;
  3000. /** 11AX DL MU MIMO ampdu underrun encountered, per user */
  3001. A_UINT32 ax_mu_mimo_ampdu_underrun_usr;
  3002. /** 11AX MU OFDMA number of mpdus queued to HW, per user */
  3003. A_UINT32 ax_ofdma_mpdus_queued_usr;
  3004. /** 11AX MU OFDMA number of mpdus tried over the air, per user */
  3005. A_UINT32 ax_ofdma_mpdus_tried_usr;
  3006. /** 11AX MU OFDMA number of mpdus failed acknowledgement, per user */
  3007. A_UINT32 ax_ofdma_mpdus_failed_usr;
  3008. /** 11AX MU OFDMA number of mpdus re-queued to HW, per user */
  3009. A_UINT32 ax_ofdma_mpdus_requeued_usr;
  3010. /** 11AX MU OFDMA BA not receieved, per user */
  3011. A_UINT32 ax_ofdma_err_no_ba_usr;
  3012. /** 11AX MU OFDMA mpdu underrun encountered, per user */
  3013. A_UINT32 ax_ofdma_mpdu_underrun_usr;
  3014. /** 11AX MU OFDMA ampdu underrun encountered, per user */
  3015. A_UINT32 ax_ofdma_ampdu_underrun_usr;
  3016. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  3017. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  3018. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  3019. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  3020. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_BE 4 /* SCHED_TX_MODE_MU_OFDMA_BE */
  3021. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_BE 5 /* SCHED_TX_MODE_MU_MIMO_BE */
  3022. typedef struct {
  3023. htt_tlv_hdr_t tlv_hdr;
  3024. /* mpdu level stats */
  3025. A_UINT32 mpdus_queued_usr;
  3026. A_UINT32 mpdus_tried_usr;
  3027. A_UINT32 mpdus_failed_usr;
  3028. A_UINT32 mpdus_requeued_usr;
  3029. A_UINT32 err_no_ba_usr;
  3030. A_UINT32 mpdu_underrun_usr;
  3031. A_UINT32 ampdu_underrun_usr;
  3032. A_UINT32 user_index;
  3033. /** HTT_STATS_TX_SCHED_MODE_xxx */
  3034. A_UINT32 tx_sched_mode;
  3035. } htt_tx_pdev_mpdu_stats_tlv;
  3036. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  3037. * TLV_TAGS:
  3038. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  3039. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  3040. */
  3041. /* NOTE:
  3042. * This structure is for documentation, and cannot be safely used directly.
  3043. * Instead, use the constituent TLV structures to fill/parse.
  3044. */
  3045. typedef struct {
  3046. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  3047. htt_tx_pdev_dl_mu_mimo_sch_stats_tlv dl_mu_mimo_sch_stats_tlv[1];
  3048. htt_tx_pdev_ul_mu_mimo_sch_stats_tlv ul_mu_mimo_sch_stats_tlv[1];
  3049. htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv dl_mu_ofdma_sch_stats_tlv[1];
  3050. htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv ul_mu_ofdma_sch_stats_tlv[1];
  3051. /*
  3052. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  3053. * it can also hold MU-OFDMA stats.
  3054. */
  3055. htt_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  3056. htt_tx_pdev_mumimo_grp_stats_tlv mumimo_grp_stats_tlv;
  3057. } htt_tx_pdev_mu_mimo_stats_t;
  3058. /* == TX SCHED STATS == */
  3059. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3060. /* NOTE: Variable length TLV, use length spec to infer array size */
  3061. typedef struct {
  3062. htt_tlv_hdr_t tlv_hdr;
  3063. /** Scheduler command posted per tx_mode */
  3064. A_UINT32 sched_cmd_posted[1/* length = num tx modes */];
  3065. } htt_sched_txq_cmd_posted_tlv_v;
  3066. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3067. /* NOTE: Variable length TLV, use length spec to infer array size */
  3068. typedef struct {
  3069. htt_tlv_hdr_t tlv_hdr;
  3070. /** Scheduler command reaped per tx_mode */
  3071. A_UINT32 sched_cmd_reaped[1/* length = num tx modes */];
  3072. } htt_sched_txq_cmd_reaped_tlv_v;
  3073. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3074. /* NOTE: Variable length TLV, use length spec to infer array size */
  3075. typedef struct {
  3076. htt_tlv_hdr_t tlv_hdr;
  3077. /**
  3078. * sched_order_su contains the peer IDs of peers chosen in the last
  3079. * NUM_SCHED_ORDER_LOG scheduler instances.
  3080. * The array is circular; it's unspecified which array element corresponds
  3081. * to the most recent scheduler invocation, and which corresponds to
  3082. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  3083. */
  3084. A_UINT32 sched_order_su[1]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
  3085. } htt_sched_txq_sched_order_su_tlv_v;
  3086. typedef struct {
  3087. htt_tlv_hdr_t tlv_hdr;
  3088. A_UINT32 htt_stats_type;
  3089. } htt_stats_error_tlv_v;
  3090. typedef enum {
  3091. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  3092. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  3093. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  3094. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  3095. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  3096. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  3097. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  3098. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  3099. HTT_SCHED_TID_SKIP_NO_DATA, /* Skip tid without data */
  3100. HTT_SCHED_TID_SKIP_NO_ENQ = HTT_SCHED_TID_SKIP_NO_DATA, /* deprecated old name */
  3101. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  3102. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  3103. HTT_SCHED_TID_SKIP_UL_RESP, /* skip UL response tid */
  3104. HTT_SCHED_TID_SKIP_UL = HTT_SCHED_TID_SKIP_UL_RESP, /* deprecated old name */
  3105. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  3106. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  3107. HTT_SCHED_TID_REMOVE_UL_RESP, /* Remove tid UL response */
  3108. HTT_SCHED_TID_REMOVE_UL = HTT_SCHED_TID_REMOVE_UL_RESP, /* deprecated old name */
  3109. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  3110. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  3111. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  3112. HTT_SCHED_TID_SKIP_EXCEPT_EAPOL, /* skip tid except eapol */
  3113. HTT_SCHED_TID_SU_LOW_PRI_ONLY, /* su low priority tid only */
  3114. HTT_SCHED_TID_SKIP_SOUND_IN_PROGRESS, /* skip tid sound in progress */
  3115. HTT_SCHED_TID_SKIP_NO_UL_DATA, /* skip ul tid when no ul data */
  3116. HTT_SCHED_TID_REMOVE_UL_NOT_CAPABLE, /* Remove tid that are not UL capable */
  3117. HTT_SCHED_TID_UL_ELIGIBLE, /* Tid is eligible for UL scheduling */
  3118. HTT_SCHED_TID_FALLBACK_TO_PREV_DECISION, /* Fall back to previous decision */
  3119. HTT_SCHED_TID_SKIP_PEER_ALREADY_IN_TXQ, /* skip tid, peer is already available in the txq */
  3120. HTT_SCHED_TID_SKIP_DELAY_UL_SCHED, /* skip tid delay UL schedule */
  3121. HTT_SCHED_TID_SKIP_PWR_SAVE_STATE_OFF, /* Limit UL scheduling to primary link if not in power save state */
  3122. HTT_SCHED_TID_SKIP_TWT_SUSPEND, /* Skip UL trigger for certain cases ex TWT suspend */
  3123. HTT_SCHED_TID_SKIP_DISABLE_160MHZ_OFDMA, /* Skip ul tid if peer supports 160MHZ */
  3124. HTT_SCHED_TID_SKIP_ULMU_DISABLE_FROM_OMI, /* Skip ul tid if sta send omi to indicate to disable UL mu data */
  3125. HTT_SCHED_TID_SKIP_UL_MAX_SCHED_CMD_EXCEEDED,/* skip ul tid if max sched cmd is exceeded */
  3126. HTT_SCHED_TID_SKIP_UL_SMALL_QDEPTH, /* Skip ul tid for small qdepth */
  3127. HTT_SCHED_TID_SKIP_UL_TWT_PAUSED, /* Skip ul tid if twt txq is paused */
  3128. HTT_SCHED_TID_SKIP_PEER_UL_RX_NOT_ACTIVE, /* Skip ul tid if peer ul rx is not active */
  3129. HTT_SCHED_TID_SKIP_NO_FORCE_TRIGGER, /* Skip ul tid if there is no force triggers */
  3130. HTT_SCHED_TID_SKIP_SMART_BASIC_TRIGGER, /* Skip ul tid if smart basic trigger doesnot have enough data */
  3131. HTT_SCHED_INELIGIBILITY_MAX,
  3132. } htt_sched_txq_sched_ineligibility_tlv_enum;
  3133. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3134. /* NOTE: Variable length TLV, use length spec to infer array size */
  3135. typedef struct {
  3136. htt_tlv_hdr_t tlv_hdr;
  3137. /**
  3138. * sched_ineligibility counts the number of occurrences of different
  3139. * reasons for tid ineligibility during eligibility checks per txq
  3140. * in scheduling
  3141. *
  3142. * Indexed by htt_sched_txq_sched_ineligibility_tlv_enum.
  3143. */
  3144. A_UINT32 sched_ineligibility[1];
  3145. } htt_sched_txq_sched_ineligibility_tlv_v;
  3146. typedef enum {
  3147. HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0, /* Supercycle not triggerd */
  3148. HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED, /* forced supercycle trigger */
  3149. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES, /* Num tidq entries is less than max_client threshold */
  3150. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS, /* Num active tids is less than max_client threshold */
  3151. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED, /* max sched iteration reached */
  3152. HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED, /* duration threshold reached */
  3153. HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER, /* TWT supercycle trigger */
  3154. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  3155. } htt_sched_txq_supercycle_triggers_tlv_enum;
  3156. #define HTT_SCHED_TXQ_SUPERCYCLE_TRIGGERS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3157. /* NOTE: Variable length TLV, use length spec to infer array size */
  3158. typedef struct {
  3159. htt_tlv_hdr_t tlv_hdr;
  3160. /**
  3161. * supercycle_triggers[] is a histogram that counts the number of
  3162. * occurrences of each different reason for a transmit scheduler
  3163. * supercycle to be triggered.
  3164. * The htt_sched_txq_supercycle_triggers_tlv_enum is used to index
  3165. * supercycle_triggers[], e.g. supercycle_triggers[1] holds the number
  3166. * of times a supercycle has been forced.
  3167. * These supercycle trigger counts are not automatically reset, but
  3168. * are reset upon request.
  3169. */
  3170. A_UINT32 supercycle_triggers[1/*HTT_SCHED_SUPERCYCLE_TRIGGER_MAX*/];
  3171. } htt_sched_txq_supercycle_triggers_tlv_v;
  3172. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  3173. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  3174. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  3175. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  3176. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  3177. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  3178. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  3179. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  3180. do { \
  3181. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  3182. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  3183. } while (0)
  3184. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  3185. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  3186. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  3187. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  3188. do { \
  3189. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  3190. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  3191. } while (0)
  3192. typedef struct {
  3193. htt_tlv_hdr_t tlv_hdr;
  3194. /**
  3195. * BIT [ 7 : 0] :- mac_id
  3196. * BIT [15 : 8] :- txq_id
  3197. * BIT [31 : 16] :- reserved
  3198. */
  3199. A_UINT32 mac_id__txq_id__word;
  3200. /** Scheduler policy ised for this TxQ */
  3201. A_UINT32 sched_policy;
  3202. /** Timestamp of last scheduler command posted */
  3203. A_UINT32 last_sched_cmd_posted_timestamp;
  3204. /** Timestamp of last scheduler command completed */
  3205. A_UINT32 last_sched_cmd_compl_timestamp;
  3206. /** Num of Sched2TAC ring hit Low Water Mark condition */
  3207. A_UINT32 sched_2_tac_lwm_count;
  3208. /** Num of Sched2TAC ring full condition */
  3209. A_UINT32 sched_2_tac_ring_full;
  3210. /**
  3211. * Num of scheduler command post failures that includes SU/MU-MIMO/MU-OFDMA
  3212. * sequence type
  3213. */
  3214. A_UINT32 sched_cmd_post_failure;
  3215. /** Num of active tids for this TxQ at current instance */
  3216. A_UINT32 num_active_tids;
  3217. /** Num of powersave schedules */
  3218. A_UINT32 num_ps_schedules;
  3219. /** Num of scheduler commands pending for this TxQ */
  3220. A_UINT32 sched_cmds_pending;
  3221. /** Num of tidq registration for this TxQ */
  3222. A_UINT32 num_tid_register;
  3223. /** Num of tidq de-registration for this TxQ */
  3224. A_UINT32 num_tid_unregister;
  3225. /** Num of iterations msduq stats was updated */
  3226. A_UINT32 num_qstats_queried;
  3227. /** qstats query update status */
  3228. A_UINT32 qstats_update_pending;
  3229. /** Timestamp of Last query stats made */
  3230. A_UINT32 last_qstats_query_timestamp;
  3231. /** Num of sched2tqm command queue full condition */
  3232. A_UINT32 num_tqm_cmdq_full;
  3233. /** Num of scheduler trigger from DE Module */
  3234. A_UINT32 num_de_sched_algo_trigger;
  3235. /** Num of scheduler trigger from RT Module */
  3236. A_UINT32 num_rt_sched_algo_trigger;
  3237. /** Num of scheduler trigger from TQM Module */
  3238. A_UINT32 num_tqm_sched_algo_trigger;
  3239. /** Num of schedules for notify frame */
  3240. A_UINT32 notify_sched;
  3241. /** Duration based sendn termination */
  3242. A_UINT32 dur_based_sendn_term;
  3243. /** scheduled via NOTIFY2 */
  3244. A_UINT32 su_notify2_sched;
  3245. /** schedule if queued packets are greater than avg MSDUs in PPDU */
  3246. A_UINT32 su_optimal_queued_msdus_sched;
  3247. /** schedule due to timeout */
  3248. A_UINT32 su_delay_timeout_sched;
  3249. /** delay if txtime is less than 500us */
  3250. A_UINT32 su_min_txtime_sched_delay;
  3251. /** scheduled via no delay */
  3252. A_UINT32 su_no_delay;
  3253. /** Num of supercycles for this TxQ */
  3254. A_UINT32 num_supercycles;
  3255. /** Num of subcycles with sort for this TxQ */
  3256. A_UINT32 num_subcycles_with_sort;
  3257. /** Num of subcycles without sort for this Txq */
  3258. A_UINT32 num_subcycles_no_sort;
  3259. } htt_tx_pdev_stats_sched_per_txq_tlv;
  3260. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  3261. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  3262. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  3263. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  3264. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  3265. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  3266. do { \
  3267. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  3268. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  3269. } while (0)
  3270. typedef struct {
  3271. htt_tlv_hdr_t tlv_hdr;
  3272. /**
  3273. * BIT [ 7 : 0] :- mac_id
  3274. * BIT [31 : 8] :- reserved
  3275. */
  3276. A_UINT32 mac_id__word;
  3277. /** Current timestamp */
  3278. A_UINT32 current_timestamp;
  3279. } htt_stats_tx_sched_cmn_tlv;
  3280. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  3281. * TLV_TAGS:
  3282. * - HTT_STATS_TX_SCHED_CMN_TAG
  3283. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  3284. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  3285. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  3286. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  3287. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  3288. * - HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG
  3289. */
  3290. /* NOTE:
  3291. * This structure is for documentation, and cannot be safely used directly.
  3292. * Instead, use the constituent TLV structures to fill/parse.
  3293. */
  3294. typedef struct {
  3295. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  3296. struct _txq_tx_sched_stats {
  3297. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  3298. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  3299. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  3300. htt_sched_txq_sched_order_su_tlv_v sched_order_su_tlv;
  3301. htt_sched_txq_sched_ineligibility_tlv_v sched_ineligibility_tlv;
  3302. htt_sched_txq_supercycle_triggers_tlv_v sched_supercycle_trigger_tlv;
  3303. } txq[1];
  3304. } htt_stats_tx_sched_t;
  3305. /* == TQM STATS == */
  3306. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 17
  3307. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  3308. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  3309. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3310. /* NOTE: Variable length TLV, use length spec to infer array size */
  3311. typedef struct {
  3312. htt_tlv_hdr_t tlv_hdr;
  3313. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  3314. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  3315. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3316. /* NOTE: Variable length TLV, use length spec to infer array size */
  3317. typedef struct {
  3318. htt_tlv_hdr_t tlv_hdr;
  3319. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  3320. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  3321. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3322. /* NOTE: Variable length TLV, use length spec to infer array size */
  3323. typedef struct {
  3324. htt_tlv_hdr_t tlv_hdr;
  3325. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  3326. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  3327. typedef struct {
  3328. htt_tlv_hdr_t tlv_hdr;
  3329. A_UINT32 msdu_count;
  3330. A_UINT32 mpdu_count;
  3331. A_UINT32 remove_msdu;
  3332. A_UINT32 remove_mpdu;
  3333. A_UINT32 remove_msdu_ttl;
  3334. A_UINT32 send_bar;
  3335. A_UINT32 bar_sync;
  3336. A_UINT32 notify_mpdu;
  3337. A_UINT32 sync_cmd;
  3338. A_UINT32 write_cmd;
  3339. A_UINT32 hwsch_trigger;
  3340. A_UINT32 ack_tlv_proc;
  3341. A_UINT32 gen_mpdu_cmd;
  3342. A_UINT32 gen_list_cmd;
  3343. A_UINT32 remove_mpdu_cmd;
  3344. A_UINT32 remove_mpdu_tried_cmd;
  3345. A_UINT32 mpdu_queue_stats_cmd;
  3346. A_UINT32 mpdu_head_info_cmd;
  3347. A_UINT32 msdu_flow_stats_cmd;
  3348. A_UINT32 remove_msdu_cmd;
  3349. A_UINT32 remove_msdu_ttl_cmd;
  3350. A_UINT32 flush_cache_cmd;
  3351. A_UINT32 update_mpduq_cmd;
  3352. A_UINT32 enqueue;
  3353. A_UINT32 enqueue_notify;
  3354. A_UINT32 notify_mpdu_at_head;
  3355. A_UINT32 notify_mpdu_state_valid;
  3356. /*
  3357. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  3358. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  3359. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  3360. * for non-UDP MSDUs.
  3361. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  3362. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  3363. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  3364. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  3365. *
  3366. * Notify signifies that we trigger the scheduler.
  3367. */
  3368. A_UINT32 sched_udp_notify1;
  3369. A_UINT32 sched_udp_notify2;
  3370. A_UINT32 sched_nonudp_notify1;
  3371. A_UINT32 sched_nonudp_notify2;
  3372. } htt_tx_tqm_pdev_stats_tlv_v;
  3373. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  3374. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  3375. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  3376. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  3377. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  3378. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  3379. do { \
  3380. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  3381. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  3382. } while (0)
  3383. typedef struct {
  3384. htt_tlv_hdr_t tlv_hdr;
  3385. /**
  3386. * BIT [ 7 : 0] :- mac_id
  3387. * BIT [31 : 8] :- reserved
  3388. */
  3389. A_UINT32 mac_id__word;
  3390. A_UINT32 max_cmdq_id;
  3391. A_UINT32 list_mpdu_cnt_hist_intvl;
  3392. /* Global stats */
  3393. A_UINT32 add_msdu;
  3394. A_UINT32 q_empty;
  3395. A_UINT32 q_not_empty;
  3396. A_UINT32 drop_notification;
  3397. A_UINT32 desc_threshold;
  3398. A_UINT32 hwsch_tqm_invalid_status;
  3399. A_UINT32 missed_tqm_gen_mpdus;
  3400. A_UINT32 tqm_active_tids;
  3401. A_UINT32 tqm_inactive_tids;
  3402. A_UINT32 tqm_active_msduq_flows;
  3403. /* SAWF system delay reference timestamp updation related stats */
  3404. A_UINT32 total_msduq_timestamp_updates;
  3405. A_UINT32 total_msduq_timestamp_updates_by_get_mpdu_head_info_cmd;
  3406. A_UINT32 total_msduq_timestamp_updates_by_empty_to_nonempty_status;
  3407. A_UINT32 total_get_mpdu_head_info_cmds_by_sched_algo_la_query;
  3408. A_UINT32 total_get_mpdu_head_info_cmds_by_tac;
  3409. A_UINT32 total_gen_mpdu_cmds_by_sched_algo_la_query;
  3410. } htt_tx_tqm_cmn_stats_tlv;
  3411. typedef struct {
  3412. htt_tlv_hdr_t tlv_hdr;
  3413. /* Error stats */
  3414. A_UINT32 q_empty_failure;
  3415. A_UINT32 q_not_empty_failure;
  3416. A_UINT32 add_msdu_failure;
  3417. /* TQM reset debug stats */
  3418. A_UINT32 tqm_cache_ctl_err;
  3419. A_UINT32 tqm_soft_reset;
  3420. A_UINT32 tqm_reset_total_num_in_use_link_descs;
  3421. A_UINT32 tqm_reset_worst_case_num_lost_link_descs;
  3422. A_UINT32 tqm_reset_worst_case_num_lost_host_tx_bufs_count;
  3423. A_UINT32 tqm_reset_num_in_use_link_descs_internal_tqm;
  3424. A_UINT32 tqm_reset_num_in_use_link_descs_wbm_idle_link_ring;
  3425. A_UINT32 tqm_reset_time_to_tqm_hang_delta_ms;
  3426. A_UINT32 tqm_reset_recovery_time_ms;
  3427. A_UINT32 tqm_reset_num_peers_hdl;
  3428. A_UINT32 tqm_reset_cumm_dirty_hw_mpduq_proc_cnt;
  3429. A_UINT32 tqm_reset_cumm_dirty_hw_msduq_proc;
  3430. A_UINT32 tqm_reset_flush_cache_cmd_su_cnt;
  3431. A_UINT32 tqm_reset_flush_cache_cmd_other_cnt;
  3432. A_UINT32 tqm_reset_flush_cache_cmd_trig_type;
  3433. A_UINT32 tqm_reset_flush_cache_cmd_trig_cfg;
  3434. A_UINT32 tqm_reset_flush_cache_cmd_skip_cmd_status_null;
  3435. } htt_tx_tqm_error_stats_tlv;
  3436. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  3437. * TLV_TAGS:
  3438. * - HTT_STATS_TX_TQM_CMN_TAG
  3439. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  3440. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  3441. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  3442. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  3443. * - HTT_STATS_TX_TQM_PDEV_TAG
  3444. */
  3445. /* NOTE:
  3446. * This structure is for documentation, and cannot be safely used directly.
  3447. * Instead, use the constituent TLV structures to fill/parse.
  3448. */
  3449. typedef struct {
  3450. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  3451. htt_tx_tqm_error_stats_tlv err_tlv;
  3452. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  3453. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  3454. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  3455. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  3456. } htt_tx_tqm_pdev_stats_t;
  3457. /* == TQM CMDQ stats == */
  3458. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  3459. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  3460. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  3461. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  3462. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  3463. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  3464. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  3465. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  3466. do { \
  3467. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  3468. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  3469. } while (0)
  3470. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  3471. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  3472. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  3473. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  3476. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  3477. } while (0)
  3478. typedef struct {
  3479. htt_tlv_hdr_t tlv_hdr;
  3480. /*
  3481. * BIT [ 7 : 0] :- mac_id
  3482. * BIT [15 : 8] :- cmdq_id
  3483. * BIT [31 : 16] :- reserved
  3484. */
  3485. A_UINT32 mac_id__cmdq_id__word;
  3486. A_UINT32 sync_cmd;
  3487. A_UINT32 write_cmd;
  3488. A_UINT32 gen_mpdu_cmd;
  3489. A_UINT32 mpdu_queue_stats_cmd;
  3490. A_UINT32 mpdu_head_info_cmd;
  3491. A_UINT32 msdu_flow_stats_cmd;
  3492. A_UINT32 remove_mpdu_cmd;
  3493. A_UINT32 remove_msdu_cmd;
  3494. A_UINT32 flush_cache_cmd;
  3495. A_UINT32 update_mpduq_cmd;
  3496. A_UINT32 update_msduq_cmd;
  3497. } htt_tx_tqm_cmdq_status_tlv;
  3498. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  3499. * TLV_TAGS:
  3500. * - HTT_STATS_STRING_TAG
  3501. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  3502. */
  3503. /* NOTE:
  3504. * This structure is for documentation, and cannot be safely used directly.
  3505. * Instead, use the constituent TLV structures to fill/parse.
  3506. */
  3507. typedef struct {
  3508. struct _cmdq_stats {
  3509. htt_stats_string_tlv cmdq_str_tlv;
  3510. htt_tx_tqm_cmdq_status_tlv status_tlv;
  3511. } q[1];
  3512. } htt_tx_tqm_cmdq_stats_t;
  3513. /* == TX-DE STATS == */
  3514. /* Structures for tx de stats */
  3515. typedef struct {
  3516. htt_tlv_hdr_t tlv_hdr;
  3517. A_UINT32 m1_packets;
  3518. A_UINT32 m2_packets;
  3519. A_UINT32 m3_packets;
  3520. A_UINT32 m4_packets;
  3521. A_UINT32 g1_packets;
  3522. A_UINT32 g2_packets;
  3523. A_UINT32 rc4_packets;
  3524. A_UINT32 eap_packets;
  3525. A_UINT32 eapol_start_packets;
  3526. A_UINT32 eapol_logoff_packets;
  3527. A_UINT32 eapol_encap_asf_packets;
  3528. } htt_tx_de_eapol_packets_stats_tlv;
  3529. typedef struct {
  3530. htt_tlv_hdr_t tlv_hdr;
  3531. A_UINT32 ap_bss_peer_not_found;
  3532. A_UINT32 ap_bcast_mcast_no_peer;
  3533. A_UINT32 sta_delete_in_progress;
  3534. A_UINT32 ibss_no_bss_peer;
  3535. A_UINT32 invaild_vdev_type;
  3536. A_UINT32 invalid_ast_peer_entry;
  3537. A_UINT32 peer_entry_invalid;
  3538. A_UINT32 ethertype_not_ip;
  3539. A_UINT32 eapol_lookup_failed;
  3540. A_UINT32 qpeer_not_allow_data;
  3541. A_UINT32 fse_tid_override;
  3542. A_UINT32 ipv6_jumbogram_zero_length;
  3543. A_UINT32 qos_to_non_qos_in_prog;
  3544. A_UINT32 ap_bcast_mcast_eapol;
  3545. A_UINT32 unicast_on_ap_bss_peer;
  3546. A_UINT32 ap_vdev_invalid;
  3547. A_UINT32 incomplete_llc;
  3548. A_UINT32 eapol_duplicate_m3;
  3549. A_UINT32 eapol_duplicate_m4;
  3550. } htt_tx_de_classify_failed_stats_tlv;
  3551. typedef struct {
  3552. htt_tlv_hdr_t tlv_hdr;
  3553. A_UINT32 arp_packets;
  3554. A_UINT32 igmp_packets;
  3555. A_UINT32 dhcp_packets;
  3556. A_UINT32 host_inspected;
  3557. A_UINT32 htt_included;
  3558. A_UINT32 htt_valid_mcs;
  3559. A_UINT32 htt_valid_nss;
  3560. A_UINT32 htt_valid_preamble_type;
  3561. A_UINT32 htt_valid_chainmask;
  3562. A_UINT32 htt_valid_guard_interval;
  3563. A_UINT32 htt_valid_retries;
  3564. A_UINT32 htt_valid_bw_info;
  3565. A_UINT32 htt_valid_power;
  3566. A_UINT32 htt_valid_key_flags;
  3567. A_UINT32 htt_valid_no_encryption;
  3568. A_UINT32 fse_entry_count;
  3569. A_UINT32 fse_priority_be;
  3570. A_UINT32 fse_priority_high;
  3571. A_UINT32 fse_priority_low;
  3572. A_UINT32 fse_traffic_ptrn_be;
  3573. A_UINT32 fse_traffic_ptrn_over_sub;
  3574. A_UINT32 fse_traffic_ptrn_bursty;
  3575. A_UINT32 fse_traffic_ptrn_interactive;
  3576. A_UINT32 fse_traffic_ptrn_periodic;
  3577. A_UINT32 fse_hwqueue_alloc;
  3578. A_UINT32 fse_hwqueue_created;
  3579. A_UINT32 fse_hwqueue_send_to_host;
  3580. A_UINT32 mcast_entry;
  3581. A_UINT32 bcast_entry;
  3582. A_UINT32 htt_update_peer_cache;
  3583. A_UINT32 htt_learning_frame;
  3584. A_UINT32 fse_invalid_peer;
  3585. /**
  3586. * mec_notify is HTT TX WBM multicast echo check notification
  3587. * from firmware to host. FW sends SA addresses to host for all
  3588. * multicast/broadcast packets received on STA side.
  3589. */
  3590. A_UINT32 mec_notify;
  3591. } htt_tx_de_classify_stats_tlv;
  3592. typedef struct {
  3593. htt_tlv_hdr_t tlv_hdr;
  3594. A_UINT32 eok;
  3595. A_UINT32 classify_done;
  3596. A_UINT32 lookup_failed;
  3597. A_UINT32 send_host_dhcp;
  3598. A_UINT32 send_host_mcast;
  3599. A_UINT32 send_host_unknown_dest;
  3600. A_UINT32 send_host;
  3601. A_UINT32 status_invalid;
  3602. } htt_tx_de_classify_status_stats_tlv;
  3603. typedef struct {
  3604. htt_tlv_hdr_t tlv_hdr;
  3605. A_UINT32 enqueued_pkts;
  3606. A_UINT32 to_tqm;
  3607. A_UINT32 to_tqm_bypass;
  3608. } htt_tx_de_enqueue_packets_stats_tlv;
  3609. typedef struct {
  3610. htt_tlv_hdr_t tlv_hdr;
  3611. A_UINT32 discarded_pkts;
  3612. A_UINT32 local_frames;
  3613. A_UINT32 is_ext_msdu;
  3614. } htt_tx_de_enqueue_discard_stats_tlv;
  3615. typedef struct {
  3616. htt_tlv_hdr_t tlv_hdr;
  3617. A_UINT32 tcl_dummy_frame;
  3618. A_UINT32 tqm_dummy_frame;
  3619. A_UINT32 tqm_notify_frame;
  3620. A_UINT32 fw2wbm_enq;
  3621. A_UINT32 tqm_bypass_frame;
  3622. } htt_tx_de_compl_stats_tlv;
  3623. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  3624. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  3625. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  3626. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  3627. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  3628. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  3629. do { \
  3630. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  3631. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  3632. } while (0)
  3633. /*
  3634. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  3635. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  3636. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  3637. * 200us & again request for it. This is a histogram of time we wait, with
  3638. * bin of 200ms & there are 10 bin (2 seconds max)
  3639. * They are defined by the following macros in FW
  3640. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  3641. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  3642. * ENTRIES_PER_BIN_COUNT)
  3643. */
  3644. typedef struct {
  3645. htt_tlv_hdr_t tlv_hdr;
  3646. A_UINT32 fw2wbm_ring_full_hist[1];
  3647. } htt_tx_de_fw2wbm_ring_full_hist_tlv;
  3648. typedef struct {
  3649. htt_tlv_hdr_t tlv_hdr;
  3650. /**
  3651. * BIT [ 7 : 0] :- mac_id
  3652. * BIT [31 : 8] :- reserved
  3653. */
  3654. A_UINT32 mac_id__word;
  3655. /* Global Stats */
  3656. A_UINT32 tcl2fw_entry_count;
  3657. A_UINT32 not_to_fw;
  3658. A_UINT32 invalid_pdev_vdev_peer;
  3659. A_UINT32 tcl_res_invalid_addrx;
  3660. A_UINT32 wbm2fw_entry_count;
  3661. A_UINT32 invalid_pdev;
  3662. A_UINT32 tcl_res_addrx_timeout;
  3663. A_UINT32 invalid_vdev;
  3664. A_UINT32 invalid_tcl_exp_frame_desc;
  3665. A_UINT32 vdev_id_mismatch_cnt;
  3666. } htt_tx_de_cmn_stats_tlv;
  3667. #define HTT_STATS_RX_FW_RING_SIZE_NUM_ENTRIES(dword) ((dword >> 0) & 0xffff)
  3668. #define HTT_STATS_RX_FW_RING_CURR_NUM_ENTRIES(dword) ((dword >> 16) & 0xffff)
  3669. /* Rx debug info for status rings */
  3670. typedef struct {
  3671. htt_tlv_hdr_t tlv_hdr;
  3672. /**
  3673. * BIT [15 : 0] :- max possible number of entries in respective ring
  3674. * (size of the ring in terms of entries)
  3675. * BIT [16 : 31] :- current number of entries occupied in respective ring
  3676. */
  3677. A_UINT32 entry_status_sw2rxdma;
  3678. A_UINT32 entry_status_rxdma2reo;
  3679. A_UINT32 entry_status_reo2sw1;
  3680. A_UINT32 entry_status_reo2sw4;
  3681. A_UINT32 entry_status_refillringipa;
  3682. A_UINT32 entry_status_refillringhost;
  3683. /** datarate - Moving Average of Number of Entries */
  3684. A_UINT32 datarate_refillringipa;
  3685. A_UINT32 datarate_refillringhost;
  3686. /**
  3687. * refillringhost_backpress_hist and refillringipa_backpress_hist are
  3688. * deprecated, and will be filled with 0x0 by the target.
  3689. */
  3690. A_UINT32 refillringhost_backpress_hist[3];
  3691. A_UINT32 refillringipa_backpress_hist[3];
  3692. /**
  3693. * Number of times reo2sw4(IPA_DEST_RING) ring is back-pressured
  3694. * in recent time periods
  3695. * element 0: in last 0 to 250ms
  3696. * element 1: 250ms to 500ms
  3697. * element 2: above 500ms
  3698. */
  3699. A_UINT32 reo2sw4ringipa_backpress_hist[3];
  3700. } htt_rx_fw_ring_stats_tlv_v;
  3701. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  3702. * TLV_TAGS:
  3703. * - HTT_STATS_TX_DE_CMN_TAG
  3704. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  3705. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  3706. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  3707. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  3708. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  3709. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  3710. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  3711. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  3712. */
  3713. /* NOTE:
  3714. * This structure is for documentation, and cannot be safely used directly.
  3715. * Instead, use the constituent TLV structures to fill/parse.
  3716. */
  3717. typedef struct {
  3718. htt_tx_de_cmn_stats_tlv cmn_tlv;
  3719. htt_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  3720. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  3721. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  3722. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  3723. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  3724. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  3725. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  3726. htt_tx_de_compl_stats_tlv comp_status_tlv;
  3727. } htt_tx_de_stats_t;
  3728. /* == RING-IF STATS == */
  3729. /* DWORD num_elems__prefetch_tail_idx */
  3730. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  3731. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  3732. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  3733. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  3734. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  3735. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  3736. HTT_RING_IF_STATS_NUM_ELEMS_S)
  3737. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  3738. do { \
  3739. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  3740. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  3741. } while (0)
  3742. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  3743. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  3744. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  3745. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  3746. do { \
  3747. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  3748. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  3749. } while (0)
  3750. /* DWORD head_idx__tail_idx */
  3751. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  3752. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  3753. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  3754. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  3755. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  3756. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  3757. HTT_RING_IF_STATS_HEAD_IDX_S)
  3758. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  3759. do { \
  3760. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  3761. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  3762. } while (0)
  3763. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  3764. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  3765. HTT_RING_IF_STATS_TAIL_IDX_S)
  3766. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  3767. do { \
  3768. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  3769. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  3770. } while (0)
  3771. /* DWORD shadow_head_idx__shadow_tail_idx */
  3772. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  3773. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  3774. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  3775. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  3776. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  3777. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  3778. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  3779. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  3780. do { \
  3781. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  3782. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  3783. } while (0)
  3784. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  3785. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  3786. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  3787. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  3788. do { \
  3789. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  3790. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  3791. } while (0)
  3792. /* DWORD lwm_thresh__hwm_thresh */
  3793. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  3794. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  3795. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  3796. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  3797. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  3798. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  3799. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  3800. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  3801. do { \
  3802. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  3803. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  3804. } while (0)
  3805. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  3806. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  3807. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  3808. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  3809. do { \
  3810. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  3811. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  3812. } while (0)
  3813. #define HTT_STATS_LOW_WM_BINS 5
  3814. #define HTT_STATS_HIGH_WM_BINS 5
  3815. typedef struct {
  3816. /** DWORD aligned base memory address of the ring */
  3817. A_UINT32 base_addr;
  3818. /** size of each ring element */
  3819. A_UINT32 elem_size;
  3820. /**
  3821. * BIT [15 : 0] :- num_elems
  3822. * BIT [31 : 16] :- prefetch_tail_idx
  3823. */
  3824. A_UINT32 num_elems__prefetch_tail_idx;
  3825. /**
  3826. * BIT [15 : 0] :- head_idx
  3827. * BIT [31 : 16] :- tail_idx
  3828. */
  3829. A_UINT32 head_idx__tail_idx;
  3830. /**
  3831. * BIT [15 : 0] :- shadow_head_idx
  3832. * BIT [31 : 16] :- shadow_tail_idx
  3833. */
  3834. A_UINT32 shadow_head_idx__shadow_tail_idx;
  3835. A_UINT32 num_tail_incr;
  3836. /**
  3837. * BIT [15 : 0] :- lwm_thresh
  3838. * BIT [31 : 16] :- hwm_thresh
  3839. */
  3840. A_UINT32 lwm_thresh__hwm_thresh;
  3841. A_UINT32 overrun_hit_count;
  3842. A_UINT32 underrun_hit_count;
  3843. A_UINT32 prod_blockwait_count;
  3844. A_UINT32 cons_blockwait_count;
  3845. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS];
  3846. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS];
  3847. } htt_ring_if_stats_tlv;
  3848. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  3849. #define HTT_RING_IF_CMN_MAC_ID_S 0
  3850. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  3851. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  3852. HTT_RING_IF_CMN_MAC_ID_S)
  3853. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  3854. do { \
  3855. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  3856. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  3857. } while (0)
  3858. typedef struct {
  3859. htt_tlv_hdr_t tlv_hdr;
  3860. /**
  3861. * BIT [ 7 : 0] :- mac_id
  3862. * BIT [31 : 8] :- reserved
  3863. */
  3864. A_UINT32 mac_id__word;
  3865. A_UINT32 num_records;
  3866. } htt_ring_if_cmn_tlv;
  3867. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  3868. * TLV_TAGS:
  3869. * - HTT_STATS_RING_IF_CMN_TAG
  3870. * - HTT_STATS_STRING_TAG
  3871. * - HTT_STATS_RING_IF_TAG
  3872. */
  3873. /* NOTE:
  3874. * This structure is for documentation, and cannot be safely used directly.
  3875. * Instead, use the constituent TLV structures to fill/parse.
  3876. */
  3877. typedef struct {
  3878. htt_ring_if_cmn_tlv cmn_tlv;
  3879. /** Variable based on the Number of records. */
  3880. struct _ring_if {
  3881. htt_stats_string_tlv ring_str_tlv;
  3882. htt_ring_if_stats_tlv ring_tlv;
  3883. } r[1];
  3884. } htt_ring_if_stats_t;
  3885. /* == SFM STATS == */
  3886. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3887. /* NOTE: Variable length TLV, use length spec to infer array size */
  3888. typedef struct {
  3889. htt_tlv_hdr_t tlv_hdr;
  3890. /** Number of DWORDS used per user and per client */
  3891. A_UINT32 dwords_used_by_user_n[1];
  3892. } htt_sfm_client_user_tlv_v;
  3893. typedef struct {
  3894. htt_tlv_hdr_t tlv_hdr;
  3895. /** Client ID */
  3896. A_UINT32 client_id;
  3897. /** Minimum number of buffers */
  3898. A_UINT32 buf_min;
  3899. /** Maximum number of buffers */
  3900. A_UINT32 buf_max;
  3901. /** Number of Busy buffers */
  3902. A_UINT32 buf_busy;
  3903. /** Number of Allocated buffers */
  3904. A_UINT32 buf_alloc;
  3905. /** Number of Available/Usable buffers */
  3906. A_UINT32 buf_avail;
  3907. /** Number of users */
  3908. A_UINT32 num_users;
  3909. } htt_sfm_client_tlv;
  3910. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  3911. #define HTT_SFM_CMN_MAC_ID_S 0
  3912. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  3913. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  3914. HTT_SFM_CMN_MAC_ID_S)
  3915. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  3916. do { \
  3917. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  3918. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  3919. } while (0)
  3920. typedef struct {
  3921. htt_tlv_hdr_t tlv_hdr;
  3922. /**
  3923. * BIT [ 7 : 0] :- mac_id
  3924. * BIT [31 : 8] :- reserved
  3925. */
  3926. A_UINT32 mac_id__word;
  3927. /**
  3928. * Indicates the total number of 128 byte buffers in the CMEM
  3929. * that are available for buffer sharing
  3930. */
  3931. A_UINT32 buf_total;
  3932. /**
  3933. * Indicates for certain client or all the clients there is no
  3934. * dword saved in SFM, refer to SFM_R1_MEM_EMPTY
  3935. */
  3936. A_UINT32 mem_empty;
  3937. /** DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  3938. A_UINT32 deallocate_bufs;
  3939. /** Number of Records */
  3940. A_UINT32 num_records;
  3941. } htt_sfm_cmn_tlv;
  3942. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  3943. * TLV_TAGS:
  3944. * - HTT_STATS_SFM_CMN_TAG
  3945. * - HTT_STATS_STRING_TAG
  3946. * - HTT_STATS_SFM_CLIENT_TAG
  3947. * - HTT_STATS_SFM_CLIENT_USER_TAG
  3948. */
  3949. /* NOTE:
  3950. * This structure is for documentation, and cannot be safely used directly.
  3951. * Instead, use the constituent TLV structures to fill/parse.
  3952. */
  3953. typedef struct {
  3954. htt_sfm_cmn_tlv cmn_tlv;
  3955. /** Variable based on the Number of records. */
  3956. struct _sfm_client {
  3957. htt_stats_string_tlv client_str_tlv;
  3958. htt_sfm_client_tlv client_tlv;
  3959. htt_sfm_client_user_tlv_v user_tlv;
  3960. } r[1];
  3961. } htt_sfm_stats_t;
  3962. /* == SRNG STATS == */
  3963. /* DWORD mac_id__ring_id__arena__ep */
  3964. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  3965. #define HTT_SRING_STATS_MAC_ID_S 0
  3966. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  3967. #define HTT_SRING_STATS_RING_ID_S 8
  3968. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  3969. #define HTT_SRING_STATS_ARENA_S 16
  3970. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  3971. #define HTT_SRING_STATS_EP_TYPE_S 24
  3972. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  3973. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  3974. HTT_SRING_STATS_MAC_ID_S)
  3975. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  3976. do { \
  3977. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  3978. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  3979. } while (0)
  3980. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  3981. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  3982. HTT_SRING_STATS_RING_ID_S)
  3983. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  3984. do { \
  3985. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  3986. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  3987. } while (0)
  3988. #define HTT_SRING_STATS_ARENA_GET(_var) \
  3989. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  3990. HTT_SRING_STATS_ARENA_S)
  3991. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  3992. do { \
  3993. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  3994. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  3995. } while (0)
  3996. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  3997. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  3998. HTT_SRING_STATS_EP_TYPE_S)
  3999. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  4000. do { \
  4001. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  4002. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  4003. } while (0)
  4004. /* DWORD num_avail_words__num_valid_words */
  4005. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  4006. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  4007. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  4008. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  4009. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  4010. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  4011. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  4012. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  4013. do { \
  4014. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  4015. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  4016. } while (0)
  4017. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  4018. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  4019. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  4020. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  4021. do { \
  4022. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  4023. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  4024. } while (0)
  4025. /* DWORD head_ptr__tail_ptr */
  4026. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  4027. #define HTT_SRING_STATS_HEAD_PTR_S 0
  4028. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  4029. #define HTT_SRING_STATS_TAIL_PTR_S 16
  4030. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  4031. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  4032. HTT_SRING_STATS_HEAD_PTR_S)
  4033. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  4034. do { \
  4035. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  4036. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  4037. } while (0)
  4038. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  4039. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  4040. HTT_SRING_STATS_TAIL_PTR_S)
  4041. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  4042. do { \
  4043. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  4044. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  4045. } while (0)
  4046. /* DWORD consumer_empty__producer_full */
  4047. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  4048. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  4049. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  4050. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  4051. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  4052. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  4053. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  4054. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  4055. do { \
  4056. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  4057. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  4058. } while (0)
  4059. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  4060. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  4061. HTT_SRING_STATS_PRODUCER_FULL_S)
  4062. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  4065. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  4066. } while (0)
  4067. /* DWORD prefetch_count__internal_tail_ptr */
  4068. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  4069. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  4070. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  4071. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  4072. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  4073. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  4074. HTT_SRING_STATS_PREFETCH_COUNT_S)
  4075. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  4078. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  4079. } while (0)
  4080. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  4081. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  4082. HTT_SRING_STATS_INTERNAL_TP_S)
  4083. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  4084. do { \
  4085. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  4086. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_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] :- ring_id
  4093. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  4094. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  4095. * BIT [31 : 25] :- reserved
  4096. */
  4097. A_UINT32 mac_id__ring_id__arena__ep;
  4098. /** DWORD aligned base memory address of the ring */
  4099. A_UINT32 base_addr_lsb;
  4100. A_UINT32 base_addr_msb;
  4101. /** size of ring */
  4102. A_UINT32 ring_size;
  4103. /** size of each ring element */
  4104. A_UINT32 elem_size;
  4105. /** Ring status
  4106. *
  4107. * BIT [15 : 0] :- num_avail_words
  4108. * BIT [31 : 16] :- num_valid_words
  4109. */
  4110. A_UINT32 num_avail_words__num_valid_words;
  4111. /** Index of head and tail
  4112. * BIT [15 : 0] :- head_ptr
  4113. * BIT [31 : 16] :- tail_ptr
  4114. */
  4115. A_UINT32 head_ptr__tail_ptr;
  4116. /** Empty or full counter of rings
  4117. * BIT [15 : 0] :- consumer_empty
  4118. * BIT [31 : 16] :- producer_full
  4119. */
  4120. A_UINT32 consumer_empty__producer_full;
  4121. /** Prefetch status of consumer ring
  4122. * BIT [15 : 0] :- prefetch_count
  4123. * BIT [31 : 16] :- internal_tail_ptr
  4124. */
  4125. A_UINT32 prefetch_count__internal_tail_ptr;
  4126. } htt_sring_stats_tlv;
  4127. typedef struct {
  4128. htt_tlv_hdr_t tlv_hdr;
  4129. A_UINT32 num_records;
  4130. } htt_sring_cmn_tlv;
  4131. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  4132. * TLV_TAGS:
  4133. * - HTT_STATS_SRING_CMN_TAG
  4134. * - HTT_STATS_STRING_TAG
  4135. * - HTT_STATS_SRING_STATS_TAG
  4136. */
  4137. /* NOTE:
  4138. * This structure is for documentation, and cannot be safely used directly.
  4139. * Instead, use the constituent TLV structures to fill/parse.
  4140. */
  4141. typedef struct {
  4142. htt_sring_cmn_tlv cmn_tlv;
  4143. /** Variable based on the Number of records */
  4144. struct _sring_stats {
  4145. htt_stats_string_tlv sring_str_tlv;
  4146. htt_sring_stats_tlv sring_stats_tlv;
  4147. } r[1];
  4148. } htt_sring_stats_t;
  4149. /* == PDEV TX RATE CTRL STATS == */
  4150. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  4151. #define HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  4152. #define HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  4153. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  4154. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  4155. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  4156. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  4157. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  4158. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  4159. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  4160. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  4161. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  4162. #define HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES 6
  4163. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  4164. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  4165. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  4166. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  4167. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  4168. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  4169. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  4170. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  4171. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  4172. do { \
  4173. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  4174. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  4175. } while (0)
  4176. #define HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS \
  4177. (HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + \
  4178. HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + \
  4179. HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS)
  4180. #define HTT_TX_PDEV_STATS_NUM_PER_COUNTERS 101
  4181. /*
  4182. * Introduce new TX counters to support 320MHz support and punctured modes
  4183. */
  4184. typedef enum {
  4185. HTT_TX_PDEV_STATS_PUNCTURED_NONE = 0,
  4186. HTT_TX_PDEV_STATS_PUNCTURED_20 = 1,
  4187. HTT_TX_PDEV_STATS_PUNCTURED_40 = 2,
  4188. HTT_TX_PDEV_STATS_PUNCTURED_80 = 3,
  4189. HTT_TX_PDEV_STATS_PUNCTURED_120 = 4,
  4190. HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  4191. } HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  4192. #define HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  4193. /* 11be related updates */
  4194. #define HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0...13,-2,-1 */
  4195. #define HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  4196. #define HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS 6
  4197. #define HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS 4
  4198. typedef enum {
  4199. HTT_TX_PDEV_STATS_AX_RU_SIZE_26,
  4200. HTT_TX_PDEV_STATS_AX_RU_SIZE_52,
  4201. HTT_TX_PDEV_STATS_AX_RU_SIZE_106,
  4202. HTT_TX_PDEV_STATS_AX_RU_SIZE_242,
  4203. HTT_TX_PDEV_STATS_AX_RU_SIZE_484,
  4204. HTT_TX_PDEV_STATS_AX_RU_SIZE_996,
  4205. HTT_TX_PDEV_STATS_AX_RU_SIZE_996x2,
  4206. HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS,
  4207. } HTT_TX_PDEV_STATS_AX_RU_SIZE;
  4208. typedef enum {
  4209. HTT_TX_PDEV_STATS_BE_RU_SIZE_26,
  4210. HTT_TX_PDEV_STATS_BE_RU_SIZE_52,
  4211. HTT_TX_PDEV_STATS_BE_RU_SIZE_52_26,
  4212. HTT_TX_PDEV_STATS_BE_RU_SIZE_106,
  4213. HTT_TX_PDEV_STATS_BE_RU_SIZE_106_26,
  4214. HTT_TX_PDEV_STATS_BE_RU_SIZE_242,
  4215. HTT_TX_PDEV_STATS_BE_RU_SIZE_484,
  4216. HTT_TX_PDEV_STATS_BE_RU_SIZE_484_242,
  4217. HTT_TX_PDEV_STATS_BE_RU_SIZE_996,
  4218. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484,
  4219. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  4220. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2,
  4221. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  4222. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3,
  4223. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  4224. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x4,
  4225. HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  4226. } HTT_TX_PDEV_STATS_BE_RU_SIZE;
  4227. typedef struct {
  4228. htt_tlv_hdr_t tlv_hdr;
  4229. /**
  4230. * BIT [ 7 : 0] :- mac_id
  4231. * BIT [31 : 8] :- reserved
  4232. */
  4233. A_UINT32 mac_id__word;
  4234. /** Number of tx ldpc packets */
  4235. A_UINT32 tx_ldpc;
  4236. /** Number of tx rts packets */
  4237. A_UINT32 rts_cnt;
  4238. /** RSSI value of last ack packet (units = dB above noise floor) */
  4239. A_UINT32 ack_rssi;
  4240. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4241. /** tx_xx_mcs: currently unused */
  4242. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4243. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4244. /* element 0,1, ...7 -> NSS 1,2, ...8 */
  4245. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4246. /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  4247. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4248. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4249. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  4250. /**
  4251. * Counters to track number of tx packets in each GI
  4252. * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
  4253. */
  4254. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4255. /** Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  4256. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  4257. /** Number of CTS-acknowledged RTS packets */
  4258. A_UINT32 rts_success;
  4259. /**
  4260. * Counters for legacy 11a and 11b transmissions.
  4261. *
  4262. * The index corresponds to:
  4263. *
  4264. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  4265. *
  4266. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  4267. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  4268. */
  4269. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  4270. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4271. /** 11AC VHT DL MU MIMO LDPC count */
  4272. A_UINT32 ac_mu_mimo_tx_ldpc;
  4273. /** 11AX HE DL MU MIMO LDPC count */
  4274. A_UINT32 ax_mu_mimo_tx_ldpc;
  4275. /** 11AX HE DL MU OFDMA LDPC count */
  4276. A_UINT32 ofdma_tx_ldpc;
  4277. /**
  4278. * Counters for 11ax HE LTF selection during TX.
  4279. *
  4280. * The index corresponds to:
  4281. *
  4282. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  4283. */
  4284. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  4285. /** 11AC VHT DL MU MIMO TX MCS stats */
  4286. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4287. /** 11AX HE DL MU MIMO TX MCS stats */
  4288. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4289. /** 11AX HE DL MU OFDMA TX MCS stats */
  4290. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4291. /** 11AC VHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4292. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4293. /** 11AX HE DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4294. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4295. /** 11AX HE DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  4296. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4297. /** 11AC VHT DL MU MIMO TX BW stats */
  4298. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4299. /** 11AX HE DL MU MIMO TX BW stats */
  4300. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4301. /** 11AX HE DL MU OFDMA TX BW stats */
  4302. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4303. /** 11AC VHT DL MU MIMO TX guard interval stats */
  4304. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4305. /** 11AX HE DL MU MIMO TX guard interval stats */
  4306. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4307. /** 11AX HE DL MU OFDMA TX guard interval stats */
  4308. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4309. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  4310. A_UINT32 tx_11ax_su_ext;
  4311. /* Stats for MCS 12/13 */
  4312. A_UINT32 tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4313. A_UINT32 tx_stbc_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4314. A_UINT32 tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4315. /** 11AX VHT DL MU MIMO extended TX MCS stats for MCS 12/13 */
  4316. A_UINT32 ax_mu_mimo_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4317. /** 11AX VHT DL MU OFDMA extended TX MCS stats for MCS 12/13 */
  4318. A_UINT32 ofdma_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4319. /** 11AX VHT DL MU MIMO extended TX guard interval stats for MCS 12/13 */
  4320. A_UINT32 ax_mu_mimo_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4321. /** 11AX VHT DL MU OFDMA extended TX guard interval stats for MCS 12/13 */
  4322. A_UINT32 ofdma_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4323. /* Stats for MCS 14/15 */
  4324. A_UINT32 tx_mcs_ext_2[HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4325. A_UINT32 tx_bw_320mhz;
  4326. A_UINT32 tx_gi_ext_2[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4327. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  4328. A_UINT32 reduced_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4329. /** 11AC VHT DL MU MIMO TX BW stats at reduced channel config */
  4330. A_UINT32 reduced_ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4331. /** 11AX HE DL MU MIMO TX BW stats at reduced channel config */
  4332. A_UINT32 reduced_ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4333. /** 11AX HE DL MU OFDMA TX BW stats at reduced channel config */
  4334. A_UINT32 reduced_ax_mu_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4335. /** 11AX HE DL MU OFDMA TX RU Size stats */
  4336. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  4337. /** 11AX HE DL MU OFDMA HE-SIG-B MCS stats */
  4338. A_UINT32 ofdma_he_sig_b_mcs[HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS];
  4339. /** 11AX HE SU data + embedded trigger PPDU success stats (stats for HETP ack success PPDU cnt) */
  4340. A_UINT32 ax_su_embedded_trigger_data_ppdu;
  4341. /** 11AX HE SU data + embedded trigger PPDU failure stats (stats for HETP ack failure PPDU cnt) */
  4342. A_UINT32 ax_su_embedded_trigger_data_ppdu_err;
  4343. /** sta side trigger stats */
  4344. A_UINT32 trigger_type_11be[HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES];
  4345. } htt_tx_pdev_rate_stats_tlv;
  4346. typedef struct {
  4347. /* 11be mode pdev rate stats; placed in a separate TLV to adhere to size restrictions */
  4348. htt_tlv_hdr_t tlv_hdr;
  4349. /** 11BE EHT DL MU MIMO TX MCS stats */
  4350. A_UINT32 be_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4351. /** 11BE EHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4352. A_UINT32 be_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4353. /** 11BE EHT DL MU MIMO TX BW stats */
  4354. A_UINT32 be_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  4355. /** 11BE EHT DL MU MIMO TX guard interval stats */
  4356. A_UINT32 be_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4357. /** 11BE DL MU MIMO LDPC count */
  4358. A_UINT32 be_mu_mimo_tx_ldpc;
  4359. } htt_tx_pdev_rate_stats_be_tlv;
  4360. typedef struct {
  4361. /*
  4362. * SAWF pdev rate stats;
  4363. * placed in a separate TLV to adhere to size restrictions
  4364. */
  4365. htt_tlv_hdr_t tlv_hdr;
  4366. /**
  4367. * Counter incremented when MCS is dropped due to the successive retries
  4368. * to a peer reaching the configured limit.
  4369. */
  4370. A_UINT32 rate_retry_mcs_drop_cnt;
  4371. /**
  4372. * histogram of MCS rate drop down, indexed by pre-drop MCS
  4373. */
  4374. A_UINT32 mcs_drop_rate[HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS];
  4375. /**
  4376. * PPDU PER histogram - each PPDU has its PER computed,
  4377. * and the bin corresponding to that PER percentage is incremented.
  4378. */
  4379. A_UINT32 per_histogram_cnt[HTT_TX_PDEV_STATS_NUM_PER_COUNTERS];
  4380. /**
  4381. * When the service class contains delay bound rate parameters which
  4382. * indicate low latency and we enable latency-based RA params then
  4383. * the low_latency_rate_count will be incremented.
  4384. * This counts the number of peer-TIDs that have been categorized as
  4385. * low-latency.
  4386. */
  4387. A_UINT32 low_latency_rate_cnt;
  4388. /** Indicate how many times rate drop happened within SIFS burst */
  4389. A_UINT32 su_burst_rate_drop_cnt;
  4390. /** Indicates how many within SIFS burst failed to deliver any pkt */
  4391. A_UINT32 su_burst_rate_drop_fail_cnt;
  4392. } htt_tx_pdev_rate_stats_sawf_tlv;
  4393. typedef struct {
  4394. htt_tlv_hdr_t tlv_hdr;
  4395. /**
  4396. * BIT [ 7 : 0] :- mac_id
  4397. * BIT [31 : 8] :- reserved
  4398. */
  4399. A_UINT32 mac_id__word;
  4400. /** 11BE EHT DL MU OFDMA LDPC count */
  4401. A_UINT32 be_ofdma_tx_ldpc;
  4402. /** 11BE EHT DL MU OFDMA TX MCS stats */
  4403. A_UINT32 be_ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4404. /**
  4405. * 11BE EHT DL MU OFDMA TX NSS stats (Indicates NSS for individual users)
  4406. */
  4407. A_UINT32 be_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4408. /** 11BE EHT DL MU OFDMA TX BW stats */
  4409. A_UINT32 be_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  4410. /** 11BE EHT DL MU OFDMA TX guard interval stats */
  4411. A_UINT32 be_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4412. /** 11BE EHT DL MU OFDMA TX RU Size stats */
  4413. A_UINT32 be_ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  4414. /** 11BE EHT DL MU OFDMA EHT-SIG MCS stats */
  4415. A_UINT32 be_ofdma_eht_sig_mcs[HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS];
  4416. } htt_tx_pdev_rate_stats_be_ofdma_tlv;
  4417. typedef struct {
  4418. htt_tlv_hdr_t tlv_hdr;
  4419. /** Tx PPDU duration histogram **/
  4420. A_UINT32 tx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  4421. A_UINT32 tx_success_time_us;
  4422. A_UINT32 tx_fail_time_us;
  4423. } htt_tx_pdev_ppdu_dur_stats_tlv;
  4424. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  4425. * TLV_TAGS:
  4426. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  4427. */
  4428. /* NOTE:
  4429. * This structure is for documentation, and cannot be safely used directly.
  4430. * Instead, use the constituent TLV structures to fill/parse.
  4431. */
  4432. typedef struct {
  4433. htt_tx_pdev_rate_stats_tlv rate_tlv;
  4434. htt_tx_pdev_rate_stats_be_tlv rate_be_tlv;
  4435. htt_tx_pdev_rate_stats_sawf_tlv rate_sawf_tlv;
  4436. htt_tx_pdev_ppdu_dur_stats_tlv tx_ppdu_dur_tlv;
  4437. } htt_tx_pdev_rate_stats_t;
  4438. /* == PDEV RX RATE CTRL STATS == */
  4439. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  4440. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  4441. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  4442. #define HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  4443. #define HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  4444. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14 /* 0-13 */
  4445. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  4446. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  4447. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  4448. #define HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS \
  4449. (HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS + HTT_RX_PDEV_STATS_NUM_BW_COUNTERS)
  4450. #define HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS 5 /* 20, 40, 80, 160, 320Mhz */
  4451. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  4452. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  4453. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  4454. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  4455. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  4456. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  4457. #define HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0-13, -2, -1 */
  4458. #define HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  4459. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  4460. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  4461. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  4462. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  4463. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  4464. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  4465. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  4466. */
  4467. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  4468. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  4469. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  4470. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  4471. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  4472. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  4473. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  4474. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  4475. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  4476. */
  4477. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  4478. typedef enum {
  4479. HTT_RX_PDEV_STATS_BE_RU_SIZE_26,
  4480. HTT_RX_PDEV_STATS_BE_RU_SIZE_52,
  4481. HTT_RX_PDEV_STATS_BE_RU_SIZE_52_26,
  4482. HTT_RX_PDEV_STATS_BE_RU_SIZE_106,
  4483. HTT_RX_PDEV_STATS_BE_RU_SIZE_106_26,
  4484. HTT_RX_PDEV_STATS_BE_RU_SIZE_242,
  4485. HTT_RX_PDEV_STATS_BE_RU_SIZE_484,
  4486. HTT_RX_PDEV_STATS_BE_RU_SIZE_484_242,
  4487. HTT_RX_PDEV_STATS_BE_RU_SIZE_996,
  4488. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484,
  4489. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  4490. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2,
  4491. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  4492. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3,
  4493. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  4494. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x4,
  4495. HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  4496. } HTT_RX_PDEV_STATS_BE_RU_SIZE;
  4497. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  4498. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  4499. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  4500. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  4501. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  4502. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  4503. do { \
  4504. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  4505. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  4506. } while (0)
  4507. /* Introduce new RX counters to support 320MHZ support and punctured modes */
  4508. typedef enum {
  4509. HTT_RX_PDEV_STATS_PUNCTURED_NONE = 0,
  4510. HTT_RX_PDEV_STATS_PUNCTURED_20 = 1,
  4511. HTT_RX_PDEV_STATS_PUNCTURED_40 = 2,
  4512. HTT_RX_PDEV_STATS_PUNCTURED_80 = 3,
  4513. HTT_RX_PDEV_STATS_PUNCTURED_120 = 4,
  4514. HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  4515. } HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  4516. #define HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  4517. typedef struct {
  4518. htt_tlv_hdr_t tlv_hdr;
  4519. /**
  4520. * BIT [ 7 : 0] :- mac_id
  4521. * BIT [31 : 8] :- reserved
  4522. */
  4523. A_UINT32 mac_id__word;
  4524. A_UINT32 nsts;
  4525. /** Number of rx ldpc packets */
  4526. A_UINT32 rx_ldpc;
  4527. /** Number of rx rts packets */
  4528. A_UINT32 rts_cnt;
  4529. /** units = dB above noise floor */
  4530. A_UINT32 rssi_mgmt;
  4531. /** units = dB above noise floor */
  4532. A_UINT32 rssi_data;
  4533. /** units = dB above noise floor */
  4534. A_UINT32 rssi_comb;
  4535. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4536. /** element 0,1, ...7 -> NSS 1,2, ...8 */
  4537. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4538. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  4539. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4540. /** element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  4541. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4542. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  4543. /** units = dB above noise floor */
  4544. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4545. /** Counters to track number of rx packets in each GI in each mcs (0-11) */
  4546. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4547. /** rx Signal Strength value in dBm unit */
  4548. A_INT32 rssi_in_dbm;
  4549. A_UINT32 rx_11ax_su_ext;
  4550. A_UINT32 rx_11ac_mumimo;
  4551. A_UINT32 rx_11ax_mumimo;
  4552. A_UINT32 rx_11ax_ofdma;
  4553. A_UINT32 txbf;
  4554. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  4555. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4556. A_UINT32 rx_active_dur_us_low;
  4557. A_UINT32 rx_active_dur_us_high;
  4558. /** number of times UL MU MIMO RX packets received */
  4559. A_UINT32 rx_11ax_ul_ofdma;
  4560. /** 11AX HE UL OFDMA RX TB PPDU MCS stats */
  4561. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4562. /** 11AX HE UL OFDMA RX TB PPDU GI stats */
  4563. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4564. /**
  4565. * 11AX HE UL OFDMA RX TB PPDU NSS stats
  4566. * (Increments the individual user NSS in the OFDMA PPDU received)
  4567. */
  4568. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4569. /** 11AX HE UL OFDMA RX TB PPDU BW stats */
  4570. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4571. /** Number of times UL OFDMA TB PPDUs received with stbc */
  4572. A_UINT32 ul_ofdma_rx_stbc;
  4573. /** Number of times UL OFDMA TB PPDUs received with ldpc */
  4574. A_UINT32 ul_ofdma_rx_ldpc;
  4575. /**
  4576. * Number of non data PPDUs received for each degree (number of users)
  4577. * in UL OFDMA
  4578. */
  4579. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4580. /**
  4581. * Number of data ppdus received for each degree (number of users)
  4582. * in UL OFDMA
  4583. */
  4584. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4585. /**
  4586. * Number of mpdus passed for each degree (number of users)
  4587. * in UL OFDMA TB PPDU
  4588. */
  4589. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4590. /**
  4591. * Number of mpdus failed for each degree (number of users)
  4592. * in UL OFDMA TB PPDU
  4593. */
  4594. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4595. A_UINT32 nss_count;
  4596. A_UINT32 pilot_count;
  4597. /** RxEVM stats in dB */
  4598. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  4599. /**
  4600. * EVM mean across pilots, computed as
  4601. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  4602. */
  4603. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4604. /** dBm units */
  4605. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4606. /** per_chain_rssi_pkt_type:
  4607. * This field shows what type of rx frame the per-chain RSSI was computed
  4608. * on, by recording the frame type and sub-type as bit-fields within this
  4609. * field:
  4610. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  4611. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  4612. * BIT [31 : 8] :- Reserved
  4613. */
  4614. A_UINT32 per_chain_rssi_pkt_type;
  4615. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4616. A_UINT32 rx_su_ndpa;
  4617. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4618. A_UINT32 rx_mu_ndpa;
  4619. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4620. A_UINT32 rx_br_poll;
  4621. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4622. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  4623. /**
  4624. * Number of non data ppdus received for each degree (number of users)
  4625. * with UL MUMIMO
  4626. */
  4627. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  4628. /**
  4629. * Number of data ppdus received for each degree (number of users)
  4630. * with UL MUMIMO
  4631. */
  4632. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  4633. /**
  4634. * Number of mpdus passed for each degree (number of users)
  4635. * with UL MUMIMO TB PPDU
  4636. */
  4637. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  4638. /**
  4639. * Number of mpdus failed for each degree (number of users)
  4640. * with UL MUMIMO TB PPDU
  4641. */
  4642. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  4643. /**
  4644. * Number of non data ppdus received for each degree (number of users)
  4645. * in UL OFDMA
  4646. */
  4647. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4648. /**
  4649. * Number of data ppdus received for each degree (number of users)
  4650. *in UL OFDMA
  4651. */
  4652. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  4653. /* Stats for MCS 12/13 */
  4654. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4655. /*
  4656. * NOTE - this TLV is already large enough that it causes the HTT message
  4657. * carrying it to be nearly at the message size limit that applies to
  4658. * many targets/hosts.
  4659. * No further fields should be added to this TLV without very careful
  4660. * review to ensure the size increase is acceptable.
  4661. */
  4662. } htt_rx_pdev_rate_stats_tlv;
  4663. typedef struct {
  4664. htt_tlv_hdr_t tlv_hdr;
  4665. /** Tx PPDU duration histogram **/
  4666. A_UINT32 rx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  4667. } htt_rx_pdev_ppdu_dur_stats_tlv;
  4668. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  4669. * TLV_TAGS:
  4670. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  4671. */
  4672. /* NOTE:
  4673. * This structure is for documentation, and cannot be safely used directly.
  4674. * Instead, use the constituent TLV structures to fill/parse.
  4675. */
  4676. typedef struct {
  4677. htt_rx_pdev_rate_stats_tlv rate_tlv;
  4678. htt_rx_pdev_ppdu_dur_stats_tlv rx_ppdu_dur_tlv;
  4679. } htt_rx_pdev_rate_stats_t;
  4680. typedef struct {
  4681. htt_tlv_hdr_t tlv_hdr;
  4682. /** units = dB above noise floor */
  4683. A_UINT8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  4684. A_INT8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  4685. /** rx mcast signal strength value in dBm unit */
  4686. A_INT32 rssi_mcast_in_dbm;
  4687. /** rx mgmt packet signal Strength value in dBm unit */
  4688. A_INT32 rssi_mgmt_in_dbm;
  4689. /*
  4690. * Stats for MCS 0-13 since rx_pdev_rate_stats_tlv cannot be updated,
  4691. * due to message size limitations.
  4692. */
  4693. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4694. A_UINT32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4695. A_UINT32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4696. A_UINT32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4697. A_UINT32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4698. A_UINT32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4699. A_UINT32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4700. A_UINT32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  4701. /* MCS 14,15 */
  4702. A_UINT32 rx_mcs_ext_2[HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4703. A_UINT32 rx_bw_ext[HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS];
  4704. A_UINT32 rx_gi_ext_2[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  4705. A_UINT32 rx_su_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  4706. A_UINT32 reduced_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4707. 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 */
  4708. 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];
  4709. } htt_rx_pdev_rate_ext_stats_tlv;
  4710. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  4711. * TLV_TAGS:
  4712. * - HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG
  4713. */
  4714. /* NOTE:
  4715. * This structure is for documentation, and cannot be safely used directly.
  4716. * Instead, use the constituent TLV structures to fill/parse.
  4717. */
  4718. typedef struct {
  4719. htt_rx_pdev_rate_ext_stats_tlv rate_tlv;
  4720. } htt_rx_pdev_rate_ext_stats_t;
  4721. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  4722. #define HTT_STATS_CMN_MAC_ID_S 0
  4723. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  4724. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  4725. HTT_STATS_CMN_MAC_ID_S)
  4726. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  4729. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  4730. } while (0)
  4731. #define HTT_RX_UL_MAX_UPLINK_RSSI_TRACK 5
  4732. typedef struct {
  4733. htt_tlv_hdr_t tlv_hdr;
  4734. /**
  4735. * BIT [ 7 : 0] :- mac_id
  4736. * BIT [31 : 8] :- reserved
  4737. */
  4738. A_UINT32 mac_id__word;
  4739. A_UINT32 rx_11ax_ul_ofdma;
  4740. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4741. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4742. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4743. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4744. A_UINT32 ul_ofdma_rx_stbc;
  4745. A_UINT32 ul_ofdma_rx_ldpc;
  4746. /*
  4747. * These are arrays to hold the number of PPDUs that we received per RU.
  4748. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  4749. * array offset 0 and similarly RU52 will be incremented in array offset 1
  4750. */
  4751. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  4752. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  4753. /*
  4754. * These arrays hold Target RSSI (rx power the AP wants),
  4755. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  4756. * which can be identified by AIDs, during trigger based RX.
  4757. * Array acts a circular buffer and holds values for last 5 STAs
  4758. * in the same order as RX.
  4759. */
  4760. /**
  4761. * STA AID array for identifying which STA the
  4762. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  4763. */
  4764. A_UINT32 uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4765. /**
  4766. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  4767. */
  4768. A_INT32 uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4769. /**
  4770. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  4771. */
  4772. A_INT32 uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4773. /**
  4774. * Trig power headroom for STA AID in same idx - UNIT(dB)
  4775. */
  4776. A_UINT32 uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4777. A_UINT32 reduced_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4778. /*
  4779. * Number of HE UL OFDMA per-user responses containing only a QoS null in
  4780. * response to basic trigger. Typically a data response is expected.
  4781. */
  4782. A_UINT32 ul_ofdma_basic_trigger_rx_qos_null_only;
  4783. } htt_rx_pdev_ul_trigger_stats_tlv;
  4784. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  4785. * TLV_TAGS:
  4786. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  4787. * NOTE:
  4788. * This structure is for documentation, and cannot be safely used directly.
  4789. * Instead, use the constituent TLV structures to fill/parse.
  4790. */
  4791. typedef struct {
  4792. htt_rx_pdev_ul_trigger_stats_tlv ul_trigger_tlv;
  4793. } htt_rx_pdev_ul_trigger_stats_t;
  4794. typedef struct {
  4795. htt_tlv_hdr_t tlv_hdr;
  4796. /**
  4797. * BIT [ 7 : 0] :- mac_id
  4798. * BIT [31 : 8] :- reserved
  4799. */
  4800. A_UINT32 mac_id__word;
  4801. A_UINT32 rx_11be_ul_ofdma;
  4802. A_UINT32 be_ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4803. A_UINT32 be_ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4804. A_UINT32 be_ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4805. A_UINT32 be_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  4806. A_UINT32 be_ul_ofdma_rx_stbc;
  4807. A_UINT32 be_ul_ofdma_rx_ldpc;
  4808. /*
  4809. * These are arrays to hold the number of PPDUs that we received per RU.
  4810. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  4811. * array offset 0 and similarly RU52 will be incremented in array offset 1
  4812. */
  4813. /** PPDU level */
  4814. A_UINT32 be_rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  4815. /** PPDU level */
  4816. A_UINT32 be_rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  4817. /*
  4818. * These arrays hold Target RSSI (rx power the AP wants),
  4819. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  4820. * which can be identified by AIDs, during trigger based RX.
  4821. * Array acts a circular buffer and holds values for last 5 STAs
  4822. * in the same order as RX.
  4823. */
  4824. /**
  4825. * STA AID array for identifying which STA the
  4826. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  4827. */
  4828. A_UINT32 be_uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4829. /**
  4830. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  4831. */
  4832. A_INT32 be_uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4833. /**
  4834. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  4835. */
  4836. A_INT32 be_uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4837. /**
  4838. * Trig power headroom for STA AID in same idx - UNIT(dB)
  4839. */
  4840. A_UINT32 be_uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  4841. /*
  4842. * Number of EHT UL OFDMA per-user responses containing only a QoS null in
  4843. * response to basic trigger. Typically a data response is expected.
  4844. */
  4845. A_UINT32 be_ul_ofdma_basic_trigger_rx_qos_null_only;
  4846. } htt_rx_pdev_be_ul_trigger_stats_tlv;
  4847. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  4848. * TLV_TAGS:
  4849. * - HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG
  4850. * NOTE:
  4851. * This structure is for documentation, and cannot be safely used directly.
  4852. * Instead, use the constituent TLV structures to fill/parse.
  4853. */
  4854. typedef struct {
  4855. htt_rx_pdev_be_ul_trigger_stats_tlv ul_trigger_tlv;
  4856. } htt_rx_pdev_be_ul_trigger_stats_t;
  4857. typedef struct {
  4858. htt_tlv_hdr_t tlv_hdr;
  4859. A_UINT32 user_index;
  4860. /** PPDU level */
  4861. A_UINT32 rx_ulofdma_non_data_ppdu;
  4862. /** PPDU level */
  4863. A_UINT32 rx_ulofdma_data_ppdu;
  4864. /** MPDU level */
  4865. A_UINT32 rx_ulofdma_mpdu_ok;
  4866. /** MPDU level */
  4867. A_UINT32 rx_ulofdma_mpdu_fail;
  4868. A_UINT32 rx_ulofdma_non_data_nusers;
  4869. A_UINT32 rx_ulofdma_data_nusers;
  4870. } htt_rx_pdev_ul_ofdma_user_stats_tlv;
  4871. typedef struct {
  4872. htt_tlv_hdr_t tlv_hdr;
  4873. A_UINT32 user_index;
  4874. /** PPDU level */
  4875. A_UINT32 be_rx_ulofdma_non_data_ppdu;
  4876. /** PPDU level */
  4877. A_UINT32 be_rx_ulofdma_data_ppdu;
  4878. /** MPDU level */
  4879. A_UINT32 be_rx_ulofdma_mpdu_ok;
  4880. /** MPDU level */
  4881. A_UINT32 be_rx_ulofdma_mpdu_fail;
  4882. A_UINT32 be_rx_ulofdma_non_data_nusers;
  4883. A_UINT32 be_rx_ulofdma_data_nusers;
  4884. } htt_rx_pdev_be_ul_ofdma_user_stats_tlv;
  4885. typedef struct {
  4886. htt_tlv_hdr_t tlv_hdr;
  4887. A_UINT32 user_index;
  4888. /** PPDU level */
  4889. A_UINT32 rx_ulmumimo_non_data_ppdu;
  4890. /** PPDU level */
  4891. A_UINT32 rx_ulmumimo_data_ppdu;
  4892. /** MPDU level */
  4893. A_UINT32 rx_ulmumimo_mpdu_ok;
  4894. /** MPDU level */
  4895. A_UINT32 rx_ulmumimo_mpdu_fail;
  4896. } htt_rx_pdev_ul_mimo_user_stats_tlv;
  4897. typedef struct {
  4898. htt_tlv_hdr_t tlv_hdr;
  4899. A_UINT32 user_index;
  4900. /** PPDU level */
  4901. A_UINT32 be_rx_ulmumimo_non_data_ppdu;
  4902. /** PPDU level */
  4903. A_UINT32 be_rx_ulmumimo_data_ppdu;
  4904. /** MPDU level */
  4905. A_UINT32 be_rx_ulmumimo_mpdu_ok;
  4906. /** MPDU level */
  4907. A_UINT32 be_rx_ulmumimo_mpdu_fail;
  4908. } htt_rx_pdev_be_ul_mimo_user_stats_tlv;
  4909. /* == RX PDEV/SOC STATS == */
  4910. typedef struct {
  4911. htt_tlv_hdr_t tlv_hdr;
  4912. /**
  4913. * BIT [7:0] :- mac_id
  4914. * BIT [31:8] :- reserved
  4915. *
  4916. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  4917. */
  4918. A_UINT32 mac_id__word;
  4919. /** Number of times UL MUMIMO RX packets received */
  4920. A_UINT32 rx_11ax_ul_mumimo;
  4921. /** 11AX HE UL MU-MIMO RX TB PPDU MCS stats */
  4922. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4923. /**
  4924. * 11AX HE UL MU-MIMO RX GI & LTF stats.
  4925. * Index 0 indicates 1xLTF + 1.6 msec GI
  4926. * Index 1 indicates 2xLTF + 1.6 msec GI
  4927. * Index 2 indicates 4xLTF + 3.2 msec GI
  4928. */
  4929. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  4930. /**
  4931. * 11AX HE UL MU-MIMO RX TB PPDU NSS stats
  4932. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  4933. */
  4934. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  4935. /** 11AX HE UL MU-MIMO RX TB PPDU BW stats */
  4936. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4937. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  4938. A_UINT32 ul_mumimo_rx_stbc;
  4939. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  4940. A_UINT32 ul_mumimo_rx_ldpc;
  4941. /* Stats for MCS 12/13 */
  4942. A_UINT32 ul_mumimo_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4943. A_UINT32 ul_mumimo_rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  4944. /** RSSI in dBm for Rx TB PPDUs */
  4945. A_INT8 rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS];
  4946. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  4947. A_INT8 rx_ul_mumimo_target_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4948. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  4949. A_INT8 rx_ul_mumimo_fd_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  4950. /** Average pilot EVM measued for RX UL TB PPDU */
  4951. 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];
  4952. A_UINT32 reduced_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  4953. /*
  4954. * Number of HE UL MU-MIMO per-user responses containing only a QoS null in
  4955. * response to basic trigger. Typically a data response is expected.
  4956. */
  4957. A_UINT32 ul_mumimo_basic_trigger_rx_qos_null_only;
  4958. } htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  4959. typedef struct {
  4960. htt_tlv_hdr_t tlv_hdr;
  4961. /**
  4962. * BIT [7:0] :- mac_id
  4963. * BIT [31:8] :- reserved
  4964. *
  4965. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  4966. */
  4967. A_UINT32 mac_id__word;
  4968. /** Number of times UL MUMIMO RX packets received */
  4969. A_UINT32 rx_11be_ul_mumimo;
  4970. /** 11BE EHT UL MU-MIMO RX TB PPDU MCS stats */
  4971. A_UINT32 be_ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4972. /**
  4973. * 11BE EHT UL MU-MIMO RX GI & LTF stats.
  4974. * Index 0 indicates 1xLTF + 1.6 msec GI
  4975. * Index 1 indicates 2xLTF + 1.6 msec GI
  4976. * Index 2 indicates 4xLTF + 3.2 msec GI
  4977. */
  4978. A_UINT32 be_ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  4979. /**
  4980. * 11BE EHT UL MU-MIMO RX TB PPDU NSS stats
  4981. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  4982. */
  4983. A_UINT32 be_ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  4984. /** 11BE EHT UL MU-MIMO RX TB PPDU BW stats */
  4985. A_UINT32 be_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  4986. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  4987. A_UINT32 be_ul_mumimo_rx_stbc;
  4988. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  4989. A_UINT32 be_ul_mumimo_rx_ldpc;
  4990. /** RSSI in dBm for Rx TB PPDUs */
  4991. 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];
  4992. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  4993. A_INT8 be_rx_ul_mumimo_target_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  4994. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  4995. A_INT8 be_rx_ul_mumimo_fd_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  4996. /** Average pilot EVM measued for RX UL TB PPDU */
  4997. A_INT8 be_rx_ulmumimo_pilot_evm_dB_mean[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  4998. /** Number of times UL MUMIMO TB PPDUs received in a punctured mode */
  4999. A_UINT32 rx_ul_mumimo_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5000. /*
  5001. * Number of EHT UL MU-MIMO per-user responses containing only a QoS null
  5002. * in response to basic trigger. Typically a data response is expected.
  5003. */
  5004. A_UINT32 be_ul_mumimo_basic_trigger_rx_qos_null_only;
  5005. } htt_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  5006. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  5007. * TLV_TAGS:
  5008. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  5009. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG
  5010. */
  5011. typedef struct {
  5012. htt_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  5013. htt_rx_pdev_ul_mumimo_trig_be_stats_tlv ul_mumimo_trig_be_tlv;
  5014. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  5015. typedef struct {
  5016. htt_tlv_hdr_t tlv_hdr;
  5017. /** Num Packets received on REO FW ring */
  5018. A_UINT32 fw_reo_ring_data_msdu;
  5019. /** Num bc/mc packets indicated from fw to host */
  5020. A_UINT32 fw_to_host_data_msdu_bcmc;
  5021. /** Num unicast packets indicated from fw to host */
  5022. A_UINT32 fw_to_host_data_msdu_uc;
  5023. /** Num remote buf recycle from offload */
  5024. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  5025. /** Num remote free buf given to offload */
  5026. A_UINT32 ofld_remote_free_buf_indication_cnt;
  5027. /** Num unicast packets from local path indicated to host */
  5028. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  5029. /** Num unicast packets from REO indicated to host */
  5030. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  5031. /** Num Packets received from WBM SW1 ring */
  5032. A_UINT32 wbm_sw_ring_reap;
  5033. /** Num packets from WBM forwarded from fw to host via WBM */
  5034. A_UINT32 wbm_forward_to_host_cnt;
  5035. /** Num packets from WBM recycled to target refill ring */
  5036. A_UINT32 wbm_target_recycle_cnt;
  5037. /**
  5038. * Total Num of recycled to refill ring,
  5039. * including packets from WBM and REO
  5040. */
  5041. A_UINT32 target_refill_ring_recycle_cnt;
  5042. } htt_rx_soc_fw_stats_tlv;
  5043. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5044. /* NOTE: Variable length TLV, use length spec to infer array size */
  5045. typedef struct {
  5046. htt_tlv_hdr_t tlv_hdr;
  5047. /** Num ring empty encountered */
  5048. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  5049. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  5050. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5051. /* NOTE: Variable length TLV, use length spec to infer array size */
  5052. typedef struct {
  5053. htt_tlv_hdr_t tlv_hdr;
  5054. /** Num total buf refilled from refill ring */
  5055. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  5056. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  5057. /* RXDMA error code from WBM released packets */
  5058. typedef enum {
  5059. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  5060. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  5061. HTT_RX_RXDMA_FCS_ERR = 2,
  5062. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  5063. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  5064. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  5065. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  5066. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  5067. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  5068. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  5069. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  5070. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  5071. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  5072. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  5073. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  5074. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  5075. /*
  5076. * This MAX_ERR_CODE should not be used in any host/target messages,
  5077. * so that even though it is defined within a host/target interface
  5078. * definition header file, it isn't actually part of the host/target
  5079. * interface, and thus can be modified.
  5080. */
  5081. HTT_RX_RXDMA_MAX_ERR_CODE
  5082. } htt_rx_rxdma_error_code_enum;
  5083. /* NOTE: Variable length TLV, use length spec to infer array size */
  5084. typedef struct {
  5085. htt_tlv_hdr_t tlv_hdr;
  5086. /** NOTE:
  5087. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  5088. * It is expected but not required that the target will provide a rxdma_err element
  5089. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  5090. * MAX_ERR_CODE. The host should ignore any array elements whose
  5091. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5092. */
  5093. A_UINT32 rxdma_err[1]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
  5094. } htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  5095. /* REO error code from WBM released packets */
  5096. typedef enum {
  5097. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  5098. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  5099. HTT_RX_AMPDU_IN_NON_BA = 2,
  5100. HTT_RX_NON_BA_DUPLICATE = 3,
  5101. HTT_RX_BA_DUPLICATE = 4,
  5102. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  5103. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  5104. HTT_RX_REGULAR_FRAME_OOR = 7,
  5105. HTT_RX_BAR_FRAME_OOR = 8,
  5106. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  5107. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  5108. HTT_RX_PN_CHECK_FAILED = 11,
  5109. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  5110. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  5111. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  5112. HTT_RX_REO_ERR_CODE_RVSD = 15,
  5113. /*
  5114. * This MAX_ERR_CODE should not be used in any host/target messages,
  5115. * so that even though it is defined within a host/target interface
  5116. * definition header file, it isn't actually part of the host/target
  5117. * interface, and thus can be modified.
  5118. */
  5119. HTT_RX_REO_MAX_ERR_CODE
  5120. } htt_rx_reo_error_code_enum;
  5121. /* NOTE: Variable length TLV, use length spec to infer array size */
  5122. typedef struct {
  5123. htt_tlv_hdr_t tlv_hdr;
  5124. /** NOTE:
  5125. * The mapping of REO error types to reo_err array elements is HW dependent.
  5126. * It is expected but not required that the target will provide a rxdma_err element
  5127. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  5128. * MAX_ERR_CODE. The host should ignore any array elements whose
  5129. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5130. */
  5131. A_UINT32 reo_err[1]; /* HTT_RX_REO_MAX_ERR_CODE */
  5132. } htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  5133. /* NOTE:
  5134. * This structure is for documentation, and cannot be safely used directly.
  5135. * Instead, use the constituent TLV structures to fill/parse.
  5136. */
  5137. typedef struct {
  5138. htt_rx_soc_fw_stats_tlv fw_tlv;
  5139. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  5140. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  5141. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v fw_refill_ring_num_rxdma_err_tlv;
  5142. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v fw_refill_ring_num_reo_err_tlv;
  5143. } htt_rx_soc_stats_t;
  5144. /* == RX PDEV STATS == */
  5145. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  5146. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  5147. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  5148. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  5149. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  5150. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  5151. do { \
  5152. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  5153. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  5154. } while (0)
  5155. typedef struct {
  5156. htt_tlv_hdr_t tlv_hdr;
  5157. /**
  5158. * BIT [ 7 : 0] :- mac_id
  5159. * BIT [31 : 8] :- reserved
  5160. */
  5161. A_UINT32 mac_id__word;
  5162. /** Num PPDU status processed from HW */
  5163. A_UINT32 ppdu_recvd;
  5164. /** Num MPDU across PPDUs with FCS ok */
  5165. A_UINT32 mpdu_cnt_fcs_ok;
  5166. /** Num MPDU across PPDUs with FCS err */
  5167. A_UINT32 mpdu_cnt_fcs_err;
  5168. /** Num MSDU across PPDUs */
  5169. A_UINT32 tcp_msdu_cnt;
  5170. /** Num MSDU across PPDUs */
  5171. A_UINT32 tcp_ack_msdu_cnt;
  5172. /** Num MSDU across PPDUs */
  5173. A_UINT32 udp_msdu_cnt;
  5174. /** Num MSDU across PPDUs */
  5175. A_UINT32 other_msdu_cnt;
  5176. /** Num MPDU on FW ring indicated */
  5177. A_UINT32 fw_ring_mpdu_ind;
  5178. /** Num MGMT MPDU given to protocol */
  5179. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  5180. /** Num ctrl MPDU given to protocol */
  5181. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  5182. /** Num mcast data packet received */
  5183. A_UINT32 fw_ring_mcast_data_msdu;
  5184. /** Num broadcast data packet received */
  5185. A_UINT32 fw_ring_bcast_data_msdu;
  5186. /** Num unicast data packet received */
  5187. A_UINT32 fw_ring_ucast_data_msdu;
  5188. /** Num null data packet received */
  5189. A_UINT32 fw_ring_null_data_msdu;
  5190. /** Num MPDU on FW ring dropped */
  5191. A_UINT32 fw_ring_mpdu_drop;
  5192. /** Num buf indication to offload */
  5193. A_UINT32 ofld_local_data_ind_cnt;
  5194. /** Num buf recycle from offload */
  5195. A_UINT32 ofld_local_data_buf_recycle_cnt;
  5196. /** Num buf indication to data_rx */
  5197. A_UINT32 drx_local_data_ind_cnt;
  5198. /** Num buf recycle from data_rx */
  5199. A_UINT32 drx_local_data_buf_recycle_cnt;
  5200. /** Num buf indication to protocol */
  5201. A_UINT32 local_nondata_ind_cnt;
  5202. /** Num buf recycle from protocol */
  5203. A_UINT32 local_nondata_buf_recycle_cnt;
  5204. /** Num buf fed */
  5205. A_UINT32 fw_status_buf_ring_refill_cnt;
  5206. /** Num ring empty encountered */
  5207. A_UINT32 fw_status_buf_ring_empty_cnt;
  5208. /** Num buf fed */
  5209. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  5210. /** Num ring empty encountered */
  5211. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  5212. /** Num buf fed */
  5213. A_UINT32 fw_link_buf_ring_refill_cnt;
  5214. /** Num ring empty encountered */
  5215. A_UINT32 fw_link_buf_ring_empty_cnt;
  5216. /** Num buf fed */
  5217. A_UINT32 host_pkt_buf_ring_refill_cnt;
  5218. /** Num ring empty encountered */
  5219. A_UINT32 host_pkt_buf_ring_empty_cnt;
  5220. /** Num buf fed */
  5221. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  5222. /** Num ring empty encountered */
  5223. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  5224. /** Num buf fed */
  5225. A_UINT32 mon_status_buf_ring_refill_cnt;
  5226. /** Num ring empty encountered */
  5227. A_UINT32 mon_status_buf_ring_empty_cnt;
  5228. /** Num buf fed */
  5229. A_UINT32 mon_desc_buf_ring_refill_cnt;
  5230. /** Num ring empty encountered */
  5231. A_UINT32 mon_desc_buf_ring_empty_cnt;
  5232. /** Num buf fed */
  5233. A_UINT32 mon_dest_ring_update_cnt;
  5234. /** Num ring full encountered */
  5235. A_UINT32 mon_dest_ring_full_cnt;
  5236. /** Num rx suspend is attempted */
  5237. A_UINT32 rx_suspend_cnt;
  5238. /** Num rx suspend failed */
  5239. A_UINT32 rx_suspend_fail_cnt;
  5240. /** Num rx resume attempted */
  5241. A_UINT32 rx_resume_cnt;
  5242. /** Num rx resume failed */
  5243. A_UINT32 rx_resume_fail_cnt;
  5244. /** Num rx ring switch */
  5245. A_UINT32 rx_ring_switch_cnt;
  5246. /** Num rx ring restore */
  5247. A_UINT32 rx_ring_restore_cnt;
  5248. /** Num rx flush issued */
  5249. A_UINT32 rx_flush_cnt;
  5250. /** Num rx recovery */
  5251. A_UINT32 rx_recovery_reset_cnt;
  5252. } htt_rx_pdev_fw_stats_tlv;
  5253. typedef struct {
  5254. htt_tlv_hdr_t tlv_hdr;
  5255. /** peer mac address */
  5256. htt_mac_addr peer_mac_addr;
  5257. /** Num of tx mgmt frames with subtype on peer level */
  5258. A_UINT32 peer_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  5259. /** Num of rx mgmt frames with subtype on peer level */
  5260. A_UINT32 peer_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  5261. } htt_peer_ctrl_path_txrx_stats_tlv;
  5262. #define HTT_STATS_PHY_ERR_MAX 43
  5263. typedef struct {
  5264. htt_tlv_hdr_t tlv_hdr;
  5265. /**
  5266. * BIT [ 7 : 0] :- mac_id
  5267. * BIT [31 : 8] :- reserved
  5268. */
  5269. A_UINT32 mac_id__word;
  5270. /** Num of phy err */
  5271. A_UINT32 total_phy_err_cnt;
  5272. /** Counts of different types of phy errs
  5273. * The mapping of PHY error types to phy_err array elements is HW dependent.
  5274. * The only currently-supported mapping is shown below:
  5275. *
  5276. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  5277. * 1 phyrx_err_synth_off
  5278. * 2 phyrx_err_ofdma_timing
  5279. * 3 phyrx_err_ofdma_signal_parity
  5280. * 4 phyrx_err_ofdma_rate_illegal
  5281. * 5 phyrx_err_ofdma_length_illegal
  5282. * 6 phyrx_err_ofdma_restart
  5283. * 7 phyrx_err_ofdma_service
  5284. * 8 phyrx_err_ppdu_ofdma_power_drop
  5285. * 9 phyrx_err_cck_blokker
  5286. * 10 phyrx_err_cck_timing
  5287. * 11 phyrx_err_cck_header_crc
  5288. * 12 phyrx_err_cck_rate_illegal
  5289. * 13 phyrx_err_cck_length_illegal
  5290. * 14 phyrx_err_cck_restart
  5291. * 15 phyrx_err_cck_service
  5292. * 16 phyrx_err_cck_power_drop
  5293. * 17 phyrx_err_ht_crc_err
  5294. * 18 phyrx_err_ht_length_illegal
  5295. * 19 phyrx_err_ht_rate_illegal
  5296. * 20 phyrx_err_ht_zlf
  5297. * 21 phyrx_err_false_radar_ext
  5298. * 22 phyrx_err_green_field
  5299. * 23 phyrx_err_bw_gt_dyn_bw
  5300. * 24 phyrx_err_leg_ht_mismatch
  5301. * 25 phyrx_err_vht_crc_error
  5302. * 26 phyrx_err_vht_siga_unsupported
  5303. * 27 phyrx_err_vht_lsig_len_invalid
  5304. * 28 phyrx_err_vht_ndp_or_zlf
  5305. * 29 phyrx_err_vht_nsym_lt_zero
  5306. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  5307. * 31 phyrx_err_vht_rx_skip_group_id0
  5308. * 32 phyrx_err_vht_rx_skip_group_id1to62
  5309. * 33 phyrx_err_vht_rx_skip_group_id63
  5310. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  5311. * 35 phyrx_err_defer_nap
  5312. * 36 phyrx_err_fdomain_timeout
  5313. * 37 phyrx_err_lsig_rel_check
  5314. * 38 phyrx_err_bt_collision
  5315. * 39 phyrx_err_unsupported_mu_feedback
  5316. * 40 phyrx_err_ppdu_tx_interrupt_rx
  5317. * 41 phyrx_err_unsupported_cbf
  5318. * 42 phyrx_err_other
  5319. */
  5320. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  5321. } htt_rx_pdev_fw_stats_phy_err_tlv;
  5322. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5323. /* NOTE: Variable length TLV, use length spec to infer array size */
  5324. typedef struct {
  5325. htt_tlv_hdr_t tlv_hdr;
  5326. /** Num error MPDU for each RxDMA error type */
  5327. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  5328. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  5329. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5330. /* NOTE: Variable length TLV, use length spec to infer array size */
  5331. typedef struct {
  5332. htt_tlv_hdr_t tlv_hdr;
  5333. /** Num MPDU dropped */
  5334. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  5335. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  5336. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  5337. * TLV_TAGS:
  5338. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  5339. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  5340. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  5341. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  5342. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  5343. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  5344. */
  5345. /* NOTE:
  5346. * This structure is for documentation, and cannot be safely used directly.
  5347. * Instead, use the constituent TLV structures to fill/parse.
  5348. */
  5349. typedef struct {
  5350. htt_rx_soc_stats_t soc_stats;
  5351. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  5352. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  5353. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  5354. htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  5355. } htt_rx_pdev_stats_t;
  5356. /* STATS_TYPE : HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  5357. * TLV_TAGS:
  5358. * - HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG
  5359. *
  5360. */
  5361. typedef struct {
  5362. htt_peer_ctrl_path_txrx_stats_tlv peer_ctrl_path_txrx_stats_tlv;
  5363. } htt_ctrl_path_txrx_stats_t;
  5364. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  5365. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  5366. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  5367. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  5368. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  5369. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  5370. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  5371. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  5372. typedef struct {
  5373. htt_tlv_hdr_t tlv_hdr;
  5374. /* Below values are obtained from the HW Cycles counter registers */
  5375. A_UINT32 tx_frame_usec;
  5376. A_UINT32 rx_frame_usec;
  5377. A_UINT32 rx_clear_usec;
  5378. A_UINT32 my_rx_frame_usec;
  5379. A_UINT32 usec_cnt;
  5380. A_UINT32 med_rx_idle_usec;
  5381. A_UINT32 med_tx_idle_global_usec;
  5382. A_UINT32 cca_obss_usec;
  5383. } htt_pdev_stats_cca_counters_tlv;
  5384. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  5385. * due to lack of support in some host stats infrastructures for
  5386. * TLVs nested within TLVs.
  5387. */
  5388. typedef struct {
  5389. htt_tlv_hdr_t tlv_hdr;
  5390. /** The channel number on which these stats were collected */
  5391. A_UINT32 chan_num;
  5392. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  5393. A_UINT32 num_records;
  5394. /**
  5395. * Bit map of valid CCA counters
  5396. * Bit0 - tx_frame_usec
  5397. * Bit1 - rx_frame_usec
  5398. * Bit2 - rx_clear_usec
  5399. * Bit3 - my_rx_frame_usec
  5400. * bit4 - usec_cnt
  5401. * Bit5 - med_rx_idle_usec
  5402. * Bit6 - med_tx_idle_global_usec
  5403. * Bit7 - cca_obss_usec
  5404. *
  5405. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  5406. */
  5407. A_UINT32 valid_cca_counters_bitmap;
  5408. /** Indicates the stats collection interval
  5409. * Valid Values:
  5410. * 100 - For the 100ms interval CCA stats histogram
  5411. * 1000 - For 1sec interval CCA histogram
  5412. * 0xFFFFFFFF - For Cumulative CCA Stats
  5413. */
  5414. A_UINT32 collection_interval;
  5415. /**
  5416. * This will be followed by an array which contains the CCA stats
  5417. * collected in the last N intervals,
  5418. * if the indication is for last N intervals CCA stats.
  5419. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  5420. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  5421. */
  5422. htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  5423. } htt_pdev_cca_stats_hist_tlv;
  5424. typedef struct {
  5425. htt_tlv_hdr_t tlv_hdr;
  5426. /** The channel number on which these stats were collected */
  5427. A_UINT32 chan_num;
  5428. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  5429. A_UINT32 num_records;
  5430. /**
  5431. * Bit map of valid CCA counters
  5432. * Bit0 - tx_frame_usec
  5433. * Bit1 - rx_frame_usec
  5434. * Bit2 - rx_clear_usec
  5435. * Bit3 - my_rx_frame_usec
  5436. * bit4 - usec_cnt
  5437. * Bit5 - med_rx_idle_usec
  5438. * Bit6 - med_tx_idle_global_usec
  5439. * Bit7 - cca_obss_usec
  5440. *
  5441. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  5442. */
  5443. A_UINT32 valid_cca_counters_bitmap;
  5444. /** Indicates the stats collection interval
  5445. * Valid Values:
  5446. * 100 - For the 100ms interval CCA stats histogram
  5447. * 1000 - For 1sec interval CCA histogram
  5448. * 0xFFFFFFFF - For Cumulative CCA Stats
  5449. */
  5450. A_UINT32 collection_interval;
  5451. /**
  5452. * This will be followed by an array which contains the CCA stats
  5453. * collected in the last N intervals,
  5454. * if the indication is for last N intervals CCA stats.
  5455. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  5456. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  5457. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  5458. */
  5459. } htt_pdev_cca_stats_hist_v1_tlv;
  5460. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000ffff
  5461. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  5462. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  5463. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  5464. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  5465. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  5466. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  5467. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  5468. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  5469. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  5470. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  5471. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  5474. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  5475. } while (0)
  5476. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  5477. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  5478. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  5479. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  5482. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  5483. } while (0)
  5484. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  5485. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  5486. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  5487. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  5488. do { \
  5489. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  5490. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  5491. } while (0)
  5492. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  5493. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  5494. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  5495. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  5496. do { \
  5497. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  5498. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  5499. } while (0)
  5500. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  5501. typedef struct {
  5502. htt_tlv_hdr_t tlv_hdr;
  5503. A_UINT32 vdev_id;
  5504. htt_mac_addr peer_mac;
  5505. A_UINT32 flow_id_flags;
  5506. /**
  5507. * TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is
  5508. * not initiated by host
  5509. */
  5510. A_UINT32 dialog_id;
  5511. A_UINT32 wake_dura_us;
  5512. A_UINT32 wake_intvl_us;
  5513. A_UINT32 sp_offset_us;
  5514. } htt_pdev_stats_twt_session_tlv;
  5515. typedef struct {
  5516. htt_tlv_hdr_t tlv_hdr;
  5517. A_UINT32 pdev_id;
  5518. A_UINT32 num_sessions;
  5519. htt_pdev_stats_twt_session_tlv twt_session[1];
  5520. } htt_pdev_stats_twt_sessions_tlv;
  5521. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  5522. * TLV_TAGS:
  5523. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  5524. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  5525. */
  5526. /* NOTE:
  5527. * This structure is for documentation, and cannot be safely used directly.
  5528. * Instead, use the constituent TLV structures to fill/parse.
  5529. */
  5530. typedef struct {
  5531. htt_pdev_stats_twt_sessions_tlv twt_sessions[1];
  5532. } htt_pdev_twt_sessions_stats_t;
  5533. typedef enum {
  5534. /* Global link descriptor queued in REO */
  5535. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  5536. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  5537. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  5538. /*Number of queue descriptors of this aging group */
  5539. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  5540. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  5541. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  5542. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  5543. /* Total number of MSDUs buffered in AC */
  5544. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  5545. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  5546. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  5547. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  5548. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  5549. } htt_rx_reo_resource_sample_id_enum;
  5550. typedef struct {
  5551. htt_tlv_hdr_t tlv_hdr;
  5552. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  5553. /** htt_rx_reo_debug_sample_id_enum */
  5554. A_UINT32 sample_id;
  5555. /** Max value of all samples */
  5556. A_UINT32 total_max;
  5557. /** Average value of total samples */
  5558. A_UINT32 total_avg;
  5559. /** Num of samples including both zeros and non zeros ones*/
  5560. A_UINT32 total_sample;
  5561. /** Average value of all non zeros samples */
  5562. A_UINT32 non_zeros_avg;
  5563. /** Num of non zeros samples */
  5564. A_UINT32 non_zeros_sample;
  5565. /** Max value of last N non zero samples (N = last_non_zeros_sample) */
  5566. A_UINT32 last_non_zeros_max;
  5567. /** Min value of last N non zero samples (N = last_non_zeros_sample) */
  5568. A_UINT32 last_non_zeros_min;
  5569. /** Average value of last N non zero samples (N = last_non_zeros_sample) */
  5570. A_UINT32 last_non_zeros_avg;
  5571. /** Num of last non zero samples */
  5572. A_UINT32 last_non_zeros_sample;
  5573. } htt_rx_reo_resource_stats_tlv_v;
  5574. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  5575. * TLV_TAGS:
  5576. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  5577. */
  5578. /* NOTE:
  5579. * This structure is for documentation, and cannot be safely used directly.
  5580. * Instead, use the constituent TLV structures to fill/parse.
  5581. */
  5582. typedef struct {
  5583. htt_rx_reo_resource_stats_tlv_v reo_resource_stats;
  5584. } htt_soc_reo_resource_stats_t;
  5585. /* == TX SOUNDING STATS == */
  5586. /* config_param0 */
  5587. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  5588. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  5589. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  5590. typedef enum {
  5591. /* Implicit beamforming stats */
  5592. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  5593. /* Single user short inter frame sequence steer stats */
  5594. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  5595. /* Single user random back off steer stats */
  5596. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  5597. /* Multi user short inter frame sequence steer stats */
  5598. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  5599. /* Multi user random back off steer stats */
  5600. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  5601. /* For backward compatability new modes cannot be added */
  5602. HTT_TXBF_MAX_NUM_OF_MODES = 5
  5603. } htt_txbf_sound_steer_modes;
  5604. typedef enum {
  5605. HTT_TX_AC_SOUNDING_MODE = 0,
  5606. HTT_TX_AX_SOUNDING_MODE = 1,
  5607. HTT_TX_BE_SOUNDING_MODE = 2,
  5608. HTT_TX_CMN_SOUNDING_MODE = 3,
  5609. } htt_stats_sounding_tx_mode;
  5610. typedef struct {
  5611. htt_tlv_hdr_t tlv_hdr;
  5612. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  5613. /* Counts number of soundings for all steering modes in each bw */
  5614. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  5615. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  5616. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  5617. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  5618. /**
  5619. * The sounding array is a 2-D array stored as an 1-D array of
  5620. * A_UINT32. The stats for a particular user/bw combination is
  5621. * referenced with the following:
  5622. *
  5623. * sounding[(user* max_bw) + bw]
  5624. *
  5625. * ... where max_bw == 4 for 160mhz
  5626. */
  5627. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  5628. /* cv upload handler stats */
  5629. /** total times CV nc mismatched */
  5630. A_UINT32 cv_nc_mismatch_err;
  5631. /** total times CV has FCS error */
  5632. A_UINT32 cv_fcs_err;
  5633. /** total times CV has invalid NSS index */
  5634. A_UINT32 cv_frag_idx_mismatch;
  5635. /** total times CV has invalid SW peer ID */
  5636. A_UINT32 cv_invalid_peer_id;
  5637. /** total times CV rejected because TXBF is not setup in peer */
  5638. A_UINT32 cv_no_txbf_setup;
  5639. /** total times CV expired while in updating state */
  5640. A_UINT32 cv_expiry_in_update;
  5641. /** total times Pkt b/w exceeding the cbf_bw */
  5642. A_UINT32 cv_pkt_bw_exceed;
  5643. /** total times CV DMA not completed */
  5644. A_UINT32 cv_dma_not_done_err;
  5645. /** total times CV update to peer failed */
  5646. A_UINT32 cv_update_failed;
  5647. /* cv query stats */
  5648. /** total times CV query happened */
  5649. A_UINT32 cv_total_query;
  5650. /** total pattern based CV query */
  5651. A_UINT32 cv_total_pattern_query;
  5652. /** total BW based CV query */
  5653. A_UINT32 cv_total_bw_query;
  5654. /** incorrect encoding in CV flags */
  5655. A_UINT32 cv_invalid_bw_coding;
  5656. /** forced sounding enabled for the peer */
  5657. A_UINT32 cv_forced_sounding;
  5658. /** standalone sounding sequence on-going */
  5659. A_UINT32 cv_standalone_sounding;
  5660. /** NC of available CV lower than expected */
  5661. A_UINT32 cv_nc_mismatch;
  5662. /** feedback type different from expected */
  5663. A_UINT32 cv_fb_type_mismatch;
  5664. /** CV BW not equal to expected BW for OFDMA */
  5665. A_UINT32 cv_ofdma_bw_mismatch;
  5666. /** CV BW not greater than or equal to expected BW */
  5667. A_UINT32 cv_bw_mismatch;
  5668. /** CV pattern not matching with the expected pattern */
  5669. A_UINT32 cv_pattern_mismatch;
  5670. /** CV available is of different preamble type than expected. */
  5671. A_UINT32 cv_preamble_mismatch;
  5672. /** NR of available CV is lower than expected. */
  5673. A_UINT32 cv_nr_mismatch;
  5674. /** CV in use count has exceeded threshold and cannot be used further. */
  5675. A_UINT32 cv_in_use_cnt_exceeded;
  5676. /** A valid CV has been found. */
  5677. A_UINT32 cv_found;
  5678. /** No valid CV was found. */
  5679. A_UINT32 cv_not_found;
  5680. /** Sounding per user in 320MHz bandwidth */
  5681. A_UINT32 sounding_320[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  5682. /** Counts number of soundings for all steering modes in 320MHz bandwidth */
  5683. A_UINT32 cbf_320[HTT_TXBF_MAX_NUM_OF_MODES];
  5684. /* This part can be used for new counters added for CV query/upload. */
  5685. /** non-trigger based ranging sequence on-going */
  5686. A_UINT32 cv_ntbr_sounding;
  5687. /** CV found, but upload is in progress. */
  5688. A_UINT32 cv_found_upload_in_progress;
  5689. /** Expired CV found during query. */
  5690. A_UINT32 cv_expired_during_query;
  5691. /** total times CV dma timeout happened */
  5692. A_UINT32 cv_dma_timeout_error;
  5693. /** total times CV bufs uploaded for IBF case */
  5694. A_UINT32 cv_buf_ibf_uploads;
  5695. /** total times CV bufs uploaded for EBF case */
  5696. A_UINT32 cv_buf_ebf_uploads;
  5697. /** total times CV bufs received from IPC ring */
  5698. A_UINT32 cv_buf_received;
  5699. /** total times CV bufs fed back to the IPC ring */
  5700. A_UINT32 cv_buf_fed_back;
  5701. } htt_tx_sounding_stats_tlv;
  5702. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  5703. * TLV_TAGS:
  5704. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  5705. */
  5706. /* NOTE:
  5707. * This structure is for documentation, and cannot be safely used directly.
  5708. * Instead, use the constituent TLV structures to fill/parse.
  5709. */
  5710. typedef struct {
  5711. htt_tx_sounding_stats_tlv sounding_tlv;
  5712. } htt_tx_sounding_stats_t;
  5713. typedef struct {
  5714. htt_tlv_hdr_t tlv_hdr;
  5715. A_UINT32 num_obss_tx_ppdu_success;
  5716. A_UINT32 num_obss_tx_ppdu_failure;
  5717. /** num_sr_tx_transmissions:
  5718. * Counter of TX done by aborting other BSS RX with spatial reuse
  5719. * (for cases where rx RSSI from other BSS is below the packet-detection
  5720. * threshold for doing spatial reuse)
  5721. */
  5722. union {
  5723. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  5724. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  5725. };
  5726. union {
  5727. /**
  5728. * Count the number of times the RSSI from an other-BSS signal
  5729. * is below the spatial reuse power threshold, thus providing an
  5730. * opportunity for spatial reuse since OBSS interference will be
  5731. * inconsequential.
  5732. */
  5733. A_UINT32 num_spatial_reuse_opportunities;
  5734. /* DEPRECATED: num_sr_rx_ge_pd_rssi_thr
  5735. * This old name has been deprecated because it does not
  5736. * clearly and accurately reflect the information stored within
  5737. * this field.
  5738. * Use the new name (num_spatial_reuse_opportunities) instead of
  5739. * the deprecated old name (num_sr_rx_ge_pd_rssi_thr).
  5740. */
  5741. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  5742. };
  5743. /**
  5744. * Count of number of times OBSS frames were aborted and non-SRG
  5745. * opportunities were created. Non-SRG opportunities are created when
  5746. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  5747. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  5748. * allow non-SRG TX.
  5749. */
  5750. A_UINT32 num_non_srg_opportunities;
  5751. /**
  5752. * Count of number of times TX PPDU were transmitted using non-SRG
  5753. * opportunities created. Incoming OBSS frame RSSI is compared with per
  5754. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  5755. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  5756. * tranmission happens.
  5757. */
  5758. A_UINT32 num_non_srg_ppdu_tried;
  5759. /**
  5760. * Count of number of times non-SRG based TX transmissions were successful
  5761. */
  5762. A_UINT32 num_non_srg_ppdu_success;
  5763. /**
  5764. * Count of number of times OBSS frames were aborted and SRG opportunities
  5765. * were created. Srg opportunities are created when incoming OBSS RSSI
  5766. * is less than the global configured SRG RSSI threshold and SRC OBSS
  5767. * color / SRG OBSS BSSID / SRG partial bssid / SRG BSS color bitmap
  5768. * registers allow SRG TX.
  5769. */
  5770. A_UINT32 num_srg_opportunities;
  5771. /**
  5772. * Count of number of times TX PPDU were transmitted using SRG
  5773. * opportunities created.
  5774. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  5775. * threshold configured in each PPDU.
  5776. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  5777. * then SRG tranmission happens.
  5778. */
  5779. A_UINT32 num_srg_ppdu_tried;
  5780. /**
  5781. * Count of number of times SRG based TX transmissions were successful
  5782. */
  5783. A_UINT32 num_srg_ppdu_success;
  5784. /**
  5785. * Count of number of times PSR opportunities were created by aborting
  5786. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  5787. * spatial reuse info in the OBSS trigger common field is set to allow PSR
  5788. * based spatial reuse.
  5789. */
  5790. A_UINT32 num_psr_opportunities;
  5791. /**
  5792. * Count of number of times TX PPDU were transmitted using PSR
  5793. * opportunities created.
  5794. */
  5795. A_UINT32 num_psr_ppdu_tried;
  5796. /**
  5797. * Count of number of times PSR based TX transmissions were successful.
  5798. */
  5799. A_UINT32 num_psr_ppdu_success;
  5800. /**
  5801. * Count of number of times TX PPDU per access category were transmitted
  5802. * using non-SRG opportunities created.
  5803. */
  5804. A_UINT32 num_non_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  5805. /**
  5806. * Count of number of times non-SRG based TX transmissions per access
  5807. * category were successful
  5808. */
  5809. A_UINT32 num_non_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  5810. /**
  5811. * Count of number of times TX PPDU per access category were transmitted
  5812. * using SRG opportunities created.
  5813. */
  5814. A_UINT32 num_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  5815. /**
  5816. * Count of number of times SRG based TX transmissions per access
  5817. * category were successful
  5818. */
  5819. A_UINT32 num_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  5820. /**
  5821. * Count of number of times ppdu was flushed due to ongoing OBSS
  5822. * frame duration value lesser than minimum required frame duration.
  5823. */
  5824. A_UINT32 num_obss_min_duration_check_flush_cnt;
  5825. /**
  5826. * Count of number of times ppdu was flushed due to ppdu duration
  5827. * exceeding aborted OBSS frame duration
  5828. */
  5829. A_UINT32 num_sr_ppdu_abort_flush_cnt;
  5830. } htt_pdev_obss_pd_stats_tlv;
  5831. /* NOTE:
  5832. * This structure is for documentation, and cannot be safely used directly.
  5833. * Instead, use the constituent TLV structures to fill/parse.
  5834. */
  5835. typedef struct {
  5836. htt_pdev_obss_pd_stats_tlv obss_pd_stat;
  5837. } htt_pdev_obss_pd_stats_t;
  5838. typedef struct {
  5839. htt_tlv_hdr_t tlv_hdr;
  5840. A_UINT32 pdev_id;
  5841. A_UINT32 current_head_idx;
  5842. A_UINT32 current_tail_idx;
  5843. A_UINT32 num_htt_msgs_sent;
  5844. /**
  5845. * Time in milliseconds for which the ring has been in
  5846. * its current backpressure condition
  5847. */
  5848. A_UINT32 backpressure_time_ms;
  5849. /** backpressure_hist -
  5850. * histogram showing how many times different degrees of backpressure
  5851. * duration occurred:
  5852. * Index 0 indicates the number of times ring was
  5853. * continously in backpressure state for 100 - 200ms.
  5854. * Index 1 indicates the number of times ring was
  5855. * continously in backpressure state for 200 - 300ms.
  5856. * Index 2 indicates the number of times ring was
  5857. * continously in backpressure state for 300 - 400ms.
  5858. * Index 3 indicates the number of times ring was
  5859. * continously in backpressure state for 400 - 500ms.
  5860. * Index 4 indicates the number of times ring was
  5861. * continously in backpressure state beyond 500ms.
  5862. */
  5863. A_UINT32 backpressure_hist[5];
  5864. } htt_ring_backpressure_stats_tlv;
  5865. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  5866. * TLV_TAGS:
  5867. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  5868. */
  5869. /* NOTE:
  5870. * This structure is for documentation, and cannot be safely used directly.
  5871. * Instead, use the constituent TLV structures to fill/parse.
  5872. */
  5873. typedef struct {
  5874. htt_sring_cmn_tlv cmn_tlv;
  5875. struct {
  5876. htt_stats_string_tlv sring_str_tlv;
  5877. htt_ring_backpressure_stats_tlv backpressure_stats_tlv;
  5878. } r[1]; /* variable-length array */
  5879. } htt_ring_backpressure_stats_t;
  5880. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  5881. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  5882. #define HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST 3
  5883. typedef struct {
  5884. htt_tlv_hdr_t tlv_hdr;
  5885. /** print_header:
  5886. * This field suggests whether the host should print a header when
  5887. * displaying the TLV (because this is the first latency_prof_stats
  5888. * TLV within a series), or if only the TLV contents should be displayed
  5889. * without a header (because this is not the first TLV within the series).
  5890. */
  5891. A_UINT32 print_header;
  5892. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  5893. /** number of data values included in the tot sum */
  5894. A_UINT32 cnt;
  5895. /** time in us */
  5896. A_UINT32 min;
  5897. /** time in us */
  5898. A_UINT32 max;
  5899. A_UINT32 last;
  5900. /** time in us */
  5901. A_UINT32 tot;
  5902. /** time in us */
  5903. A_UINT32 avg;
  5904. /** hist_intvl:
  5905. * Histogram interval, i.e. the latency range covered by each
  5906. * bin of the histogram, in microsecond units.
  5907. * hist[0] counts how many latencies were between 0 to hist_intvl
  5908. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  5909. * hist[2] counts how many latencies were more than 2*hist_intvl
  5910. */
  5911. A_UINT32 hist_intvl;
  5912. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  5913. /** max page faults in any 1 sampling window */
  5914. A_UINT32 page_fault_max;
  5915. /** summed over all sampling windows */
  5916. A_UINT32 page_fault_total;
  5917. /** ignored_latency_count:
  5918. * ignore some of profile latency to avoid avg skewing
  5919. */
  5920. A_UINT32 ignored_latency_count;
  5921. /** interrupts_max: max interrupts within any single sampling window */
  5922. A_UINT32 interrupts_max;
  5923. /** interrupts_hist: histogram of interrupt rate
  5924. * bin0 contains the number of sampling windows that had 0 interrupts,
  5925. * bin1 contains the number of sampling windows that had 1-4 interrupts,
  5926. * bin2 contains the number of sampling windows that had > 4 interrupts
  5927. */
  5928. A_UINT32 interrupts_hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  5929. } htt_latency_prof_stats_tlv;
  5930. typedef struct {
  5931. htt_tlv_hdr_t tlv_hdr;
  5932. /** duration:
  5933. * Time period over which counts were gathered, units = microseconds.
  5934. */
  5935. A_UINT32 duration;
  5936. A_UINT32 tx_msdu_cnt;
  5937. A_UINT32 tx_mpdu_cnt;
  5938. A_UINT32 tx_ppdu_cnt;
  5939. A_UINT32 rx_msdu_cnt;
  5940. A_UINT32 rx_mpdu_cnt;
  5941. } htt_latency_prof_ctx_tlv;
  5942. typedef struct {
  5943. htt_tlv_hdr_t tlv_hdr;
  5944. /** count of enabled profiles */
  5945. A_UINT32 prof_enable_cnt;
  5946. } htt_latency_prof_cnt_tlv;
  5947. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  5948. * TLV_TAGS:
  5949. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  5950. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  5951. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  5952. */
  5953. /* NOTE:
  5954. * This structure is for documentation, and cannot be safely used directly.
  5955. * Instead, use the constituent TLV structures to fill/parse.
  5956. */
  5957. typedef struct {
  5958. htt_latency_prof_stats_tlv latency_prof_stat;
  5959. htt_latency_prof_ctx_tlv latency_ctx_stat;
  5960. htt_latency_prof_cnt_tlv latency_cnt_stat;
  5961. } htt_soc_latency_stats_t;
  5962. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  5963. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  5964. #define HTT_RX_SQUARE_INDEX 6
  5965. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  5966. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  5967. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  5968. * TLV_TAGS:
  5969. * - HTT_STATS_RX_FSE_STATS_TAG
  5970. */
  5971. typedef struct {
  5972. htt_tlv_hdr_t tlv_hdr;
  5973. /**
  5974. * Number of times host requested for fse enable/disable
  5975. */
  5976. A_UINT32 fse_enable_cnt;
  5977. A_UINT32 fse_disable_cnt;
  5978. /**
  5979. * Number of times host requested for fse cache invalidation
  5980. * individual entries or full cache
  5981. */
  5982. A_UINT32 fse_cache_invalidate_entry_cnt;
  5983. A_UINT32 fse_full_cache_invalidate_cnt;
  5984. /**
  5985. * Cache hits count will increase if there is a matching flow in the cache
  5986. * There is no register for cache miss but the number of cache misses can
  5987. * be calculated as
  5988. * cache miss = (num_searches - cache_hits)
  5989. * Thus, there is no need to have a separate variable for cache misses.
  5990. * Num searches is flow search times done in the cache.
  5991. */
  5992. A_UINT32 fse_num_cache_hits_cnt;
  5993. A_UINT32 fse_num_searches_cnt;
  5994. /**
  5995. * Cache Occupancy holds 2 types of values: Peak and Current.
  5996. * 10 bins are used to keep track of peak occupancy.
  5997. * 8 of these bins represent ranges of values, while the first and last
  5998. * bins represent the extreme cases of the cache being completely empty
  5999. * or completely full.
  6000. * For the non-extreme bins, the number of cache occupancy values per
  6001. * bin is the maximum cache occupancy (128), divided by the number of
  6002. * non-extreme bins (8), so 128/8 = 16 values per bin.
  6003. * The range of values for each histogram bins is specified below:
  6004. * Bin0 = Counter increments when cache occupancy is empty
  6005. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  6006. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  6007. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  6008. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  6009. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  6010. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  6011. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  6012. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  6013. * Bin9 = Counter increments when cache occupancy is equal to 128
  6014. * The above histogram bin definitions apply to both the peak-occupancy
  6015. * histogram and the current-occupancy histogram.
  6016. *
  6017. * @fse_cache_occupancy_peak_cnt:
  6018. * Array records periodically PEAK cache occupancy values.
  6019. * Peak Occupancy will increment only if it is greater than current
  6020. * occupancy value.
  6021. *
  6022. * @fse_cache_occupancy_curr_cnt:
  6023. * Array records periodically current cache occupancy value.
  6024. * Current Cache occupancy always holds instant snapshot of
  6025. * current number of cache entries.
  6026. **/
  6027. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  6028. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  6029. /**
  6030. * Square stat is sum of squares of cache occupancy to better understand
  6031. * any variation/deviation within each cache set, over a given time-window.
  6032. *
  6033. * Square stat is calculated this way:
  6034. * Square = SUM(Squares of all Occupancy in a Set) / 8
  6035. * The cache has 16-way set associativity, so the occupancy of a
  6036. * set can vary from 0 to 16. There are 8 sets within the cache.
  6037. * Therefore, the minimum possible square value is 0, and the maximum
  6038. * possible square value is (8*16^2) / 8 = 256.
  6039. *
  6040. * 6 bins are used to keep track of square stats:
  6041. * Bin0 = increments when square of current cache occupancy is zero
  6042. * Bin1 = increments when square of current cache occupancy is within
  6043. * [1 to 50]
  6044. * Bin2 = increments when square of current cache occupancy is within
  6045. * [51 to 100]
  6046. * Bin3 = increments when square of current cache occupancy is within
  6047. * [101 to 200]
  6048. * Bin4 = increments when square of current cache occupancy is within
  6049. * [201 to 255]
  6050. * Bin5 = increments when square of current cache occupancy is 256
  6051. */
  6052. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  6053. /**
  6054. * Search stats has 2 types of values: Peak Pending and Number of
  6055. * Search Pending.
  6056. * GSE command ring for FSE can hold maximum of 5 Pending searches
  6057. * at any given time.
  6058. *
  6059. * 4 bins are used to keep track of search stats:
  6060. * Bin0 = Counter increments when there are NO pending searches
  6061. * (For peak, it will be number of pending searches greater
  6062. * than GSE command ring FIFO outstanding requests.
  6063. * For Search Pending, it will be number of pending search
  6064. * inside GSE command ring FIFO.)
  6065. * Bin1 = Counter increments when number of pending searches are within
  6066. * [1 to 2]
  6067. * Bin2 = Counter increments when number of pending searches are within
  6068. * [3 to 4]
  6069. * Bin3 = Counter increments when number of pending searches are
  6070. * greater/equal to [ >= 5]
  6071. */
  6072. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  6073. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  6074. } htt_rx_fse_stats_tlv;
  6075. /* NOTE:
  6076. * This structure is for documentation, and cannot be safely used directly.
  6077. * Instead, use the constituent TLV structures to fill/parse.
  6078. */
  6079. typedef struct {
  6080. htt_rx_fse_stats_tlv rx_fse_stats;
  6081. } htt_rx_fse_stats_t;
  6082. #define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
  6083. #define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5 /* 20, 40, 80, 160, 320 */
  6084. #define HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES 2/* 0: Half, 1: Quarter */
  6085. typedef struct {
  6086. htt_tlv_hdr_t tlv_hdr;
  6087. /** SU TxBF TX MCS stats */
  6088. A_UINT32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6089. /** Implicit BF TX MCS stats */
  6090. A_UINT32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6091. /** Open loop TX MCS stats */
  6092. A_UINT32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6093. /** SU TxBF TX NSS stats */
  6094. A_UINT32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  6095. /** Implicit BF TX NSS stats */
  6096. A_UINT32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  6097. /** Open loop TX NSS stats */
  6098. A_UINT32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  6099. /** SU TxBF TX BW stats */
  6100. A_UINT32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6101. /** Implicit BF TX BW stats */
  6102. A_UINT32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6103. /** Open loop TX BW stats */
  6104. A_UINT32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6105. /** Legacy and OFDM TX rate stats */
  6106. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  6107. /** SU TxBF TX BW stats */
  6108. A_UINT32 reduced_tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6109. /** Implicit BF TX BW stats */
  6110. A_UINT32 reduced_tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6111. /** Open loop TX BW stats */
  6112. A_UINT32 reduced_tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  6113. } htt_tx_pdev_txbf_rate_stats_tlv;
  6114. typedef enum {
  6115. HTT_STATS_RC_MODE_DLSU = 0,
  6116. HTT_STATS_RC_MODE_DLMUMIMO = 1,
  6117. HTT_STATS_RC_MODE_DLOFDMA = 2,
  6118. HTT_STATS_RC_MODE_ULMUMIMO = 3,
  6119. } htt_stats_rc_mode;
  6120. typedef struct {
  6121. A_UINT32 ppdus_tried;
  6122. A_UINT32 ppdus_ack_failed;
  6123. A_UINT32 mpdus_tried;
  6124. A_UINT32 mpdus_failed;
  6125. } htt_tx_rate_stats_t;
  6126. typedef enum {
  6127. HTT_RC_MODE_SU_OL,
  6128. HTT_RC_MODE_SU_BF,
  6129. HTT_RC_MODE_MU1_INTF,
  6130. HTT_RC_MODE_MU2_INTF,
  6131. HTT_Rc_MODE_MU3_INTF,
  6132. HTT_RC_MODE_MU4_INTF,
  6133. HTT_RC_MODE_MU5_INTF,
  6134. HTT_RC_MODE_MU6_INTF,
  6135. HTT_RC_MODE_MU7_INTF,
  6136. HTT_RC_MODE_2D_COUNT,
  6137. } HTT_RC_MODE;
  6138. typedef enum {
  6139. HTT_STATS_RU_TYPE_INVALID = 0,
  6140. HTT_STATS_RU_TYPE_SINGLE_RU_ONLY = 1,
  6141. HTT_STATS_RU_TYPE_SINGLE_AND_MULTI_RU = 2,
  6142. } htt_stats_ru_type;
  6143. typedef struct {
  6144. htt_tlv_hdr_t tlv_hdr;
  6145. /** HTT_STATS_RC_MODE_XX */
  6146. A_UINT32 rc_mode;
  6147. A_UINT32 last_probed_mcs;
  6148. A_UINT32 last_probed_nss;
  6149. A_UINT32 last_probed_bw;
  6150. htt_tx_rate_stats_t per_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  6151. htt_tx_rate_stats_t per_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  6152. htt_tx_rate_stats_t per_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  6153. /** 320MHz extension for PER */
  6154. htt_tx_rate_stats_t per_bw320;
  6155. A_UINT32 probe_cnt_per_rcmode[HTT_RC_MODE_2D_COUNT];
  6156. htt_stats_ru_type ru_type; /* refer to htt_stats_ru_type */
  6157. htt_tx_rate_stats_t per_ru[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  6158. } htt_tx_rate_stats_per_tlv;
  6159. /* NOTE:
  6160. * This structure is for documentation, and cannot be safely used directly.
  6161. * Instead, use the constituent TLV structures to fill/parse.
  6162. */
  6163. typedef struct {
  6164. htt_tx_pdev_txbf_rate_stats_tlv txbf_rate_stats;
  6165. } htt_pdev_txbf_rate_stats_t;
  6166. typedef struct {
  6167. htt_tx_rate_stats_per_tlv per_stats;
  6168. } htt_tx_pdev_per_stats_t;
  6169. typedef enum {
  6170. HTT_ULTRIG_QBOOST_TRIGGER = 0,
  6171. HTT_ULTRIG_PSPOLL_TRIGGER,
  6172. HTT_ULTRIG_UAPSD_TRIGGER,
  6173. HTT_ULTRIG_11AX_TRIGGER,
  6174. HTT_ULTRIG_11AX_WILDCARD_TRIGGER,
  6175. HTT_ULTRIG_11AX_UNASSOC_WILDCARD_TRIGGER,
  6176. HTT_STA_UL_OFDMA_NUM_TRIG_TYPE,
  6177. } HTT_STA_UL_OFDMA_RX_TRIG_TYPE;
  6178. typedef enum {
  6179. HTT_11AX_TRIGGER_BASIC_E = 0,
  6180. HTT_11AX_TRIGGER_BRPOLL_E = 1,
  6181. HTT_11AX_TRIGGER_MU_BAR_E = 2,
  6182. HTT_11AX_TRIGGER_MU_RTS_E = 3,
  6183. HTT_11AX_TRIGGER_BUFFER_SIZE_E = 4,
  6184. HTT_11AX_TRIGGER_GCR_MU_BAR_E = 5,
  6185. HTT_11AX_TRIGGER_BQRP_E = 6,
  6186. HTT_11AX_TRIGGER_NDP_FB_REPORT_POLL_E = 7,
  6187. HTT_11AX_TRIGGER_RESERVED_8_E = 8,
  6188. HTT_11AX_TRIGGER_RESERVED_9_E = 9,
  6189. HTT_11AX_TRIGGER_RESERVED_10_E = 10,
  6190. HTT_11AX_TRIGGER_RESERVED_11_E = 11,
  6191. HTT_11AX_TRIGGER_RESERVED_12_E = 12,
  6192. HTT_11AX_TRIGGER_RESERVED_13_E = 13,
  6193. HTT_11AX_TRIGGER_RESERVED_14_E = 14,
  6194. HTT_11AX_TRIGGER_RESERVED_15_E = 15,
  6195. HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE,
  6196. } HTT_STA_UL_OFDMA_11AX_TRIG_TYPE;
  6197. /* UL RESP Queues 0 - HIPRI, 1 - LOPRI & 2 - BSR */
  6198. #define HTT_STA_UL_OFDMA_NUM_UL_QUEUES 3
  6199. /* Actual resp type sent by STA for trigger
  6200. * 0 - HE TB PPDU, 1 - NULL Delimiter */
  6201. #define HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE 2
  6202. /* Counter for MCS 0-13 */
  6203. #define HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS 14
  6204. /* Counters BW 20,40,80,160,320 */
  6205. #define HTT_STA_UL_OFDMA_NUM_BW_COUNTERS 5
  6206. #define HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  6207. /* STATS_TYPE : HTT_DBG_EXT_STA_11AX_UL_STATS
  6208. * TLV_TAGS:
  6209. * - HTT_STATS_STA_UL_OFDMA_STATS_TAG
  6210. */
  6211. typedef struct {
  6212. htt_tlv_hdr_t tlv_hdr;
  6213. A_UINT32 pdev_id;
  6214. /**
  6215. * Trigger Type reported by HWSCH on RX reception
  6216. * Each index populate enum HTT_STA_UL_OFDMA_RX_TRIG_TYPE
  6217. */
  6218. A_UINT32 rx_trigger_type[HTT_STA_UL_OFDMA_NUM_TRIG_TYPE];
  6219. /**
  6220. * 11AX Trigger Type on RX reception
  6221. * Each index populate enum HTT_STA_UL_OFDMA_11AX_TRIG_TYPE
  6222. */
  6223. A_UINT32 ax_trigger_type[HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE];
  6224. /** Num data PPDUs/Delims responded to trigs. per HWQ for UL RESP */
  6225. A_UINT32 num_data_ppdu_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  6226. A_UINT32 num_null_delimiters_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  6227. /**
  6228. * Overall UL STA RESP Status 0 - HE TB PPDU, 1 - NULL Delimiter
  6229. * Super set of num_data_ppdu_responded_per_hwq,
  6230. * num_null_delimiters_responded_per_hwq
  6231. */
  6232. A_UINT32 num_total_trig_responses[HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE];
  6233. /**
  6234. * Time interval between current time ms and last successful trigger RX
  6235. * 0xFFFFFFFF denotes no trig received / timestamp roll back
  6236. */
  6237. A_UINT32 last_trig_rx_time_delta_ms;
  6238. /**
  6239. * Rate Statistics for UL OFDMA
  6240. * UL TB PPDU TX MCS, NSS, GI, BW from STA HWQ
  6241. */
  6242. A_UINT32 ul_ofdma_tx_mcs[HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  6243. A_UINT32 ul_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  6244. A_UINT32 ul_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  6245. A_UINT32 ul_ofdma_tx_ldpc;
  6246. A_UINT32 ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  6247. /** Trig based PPDU TX/ RBO based PPDU TX Count */
  6248. A_UINT32 trig_based_ppdu_tx;
  6249. A_UINT32 rbo_based_ppdu_tx;
  6250. /** Switch MU EDCA to SU EDCA Count */
  6251. A_UINT32 mu_edca_to_su_edca_switch_count;
  6252. /** Num MU EDCA applied Count */
  6253. A_UINT32 num_mu_edca_param_apply_count;
  6254. /**
  6255. * Current MU EDCA Parameters for WMM ACs
  6256. * Mode - 0 - SU EDCA, 1- MU EDCA
  6257. */
  6258. A_UINT32 current_edca_hwq_mode[HTT_NUM_AC_WMM];
  6259. /** Contention Window minimum. Range: 1 - 10 */
  6260. A_UINT32 current_cw_min[HTT_NUM_AC_WMM];
  6261. /** Contention Window maximum. Range: 1 - 10 */
  6262. A_UINT32 current_cw_max[HTT_NUM_AC_WMM];
  6263. /** AIFS value - 0 -255 */
  6264. A_UINT32 current_aifs[HTT_NUM_AC_WMM];
  6265. A_UINT32 reduced_ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES][HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  6266. } htt_sta_ul_ofdma_stats_tlv;
  6267. /* NOTE:
  6268. * This structure is for documentation, and cannot be safely used directly.
  6269. * Instead, use the constituent TLV structures to fill/parse.
  6270. */
  6271. typedef struct {
  6272. htt_sta_ul_ofdma_stats_tlv ul_ofdma_sta_stats;
  6273. } htt_sta_11ax_ul_stats_t;
  6274. typedef struct {
  6275. htt_tlv_hdr_t tlv_hdr;
  6276. /** No of Fine Timing Measurement frames transmitted successfully */
  6277. A_UINT32 tx_ftm_suc;
  6278. /**
  6279. * No of Fine Timing Measurement frames transmitted successfully
  6280. * after retry
  6281. */
  6282. A_UINT32 tx_ftm_suc_retry;
  6283. /** No of Fine Timing Measurement frames not transmitted successfully */
  6284. A_UINT32 tx_ftm_fail;
  6285. /**
  6286. * No of Fine Timing Measurement Request frames received,
  6287. * including initial, non-initial, and duplicates
  6288. */
  6289. A_UINT32 rx_ftmr_cnt;
  6290. /**
  6291. * No of duplicate Fine Timing Measurement Request frames received,
  6292. * including both initial and non-initial
  6293. */
  6294. A_UINT32 rx_ftmr_dup_cnt;
  6295. /** No of initial Fine Timing Measurement Request frames received */
  6296. A_UINT32 rx_iftmr_cnt;
  6297. /**
  6298. * No of duplicate initial Fine Timing Measurement Request frames received
  6299. */
  6300. A_UINT32 rx_iftmr_dup_cnt;
  6301. /** No of responder sessions rejected when initiator was active */
  6302. A_UINT32 initiator_active_responder_rejected_cnt;
  6303. /** Responder terminate count */
  6304. A_UINT32 responder_terminate_cnt;
  6305. A_UINT32 vdev_id;
  6306. } htt_vdev_rtt_resp_stats_tlv;
  6307. typedef struct {
  6308. htt_vdev_rtt_resp_stats_tlv vdev_rtt_resp_stats;
  6309. } htt_vdev_rtt_resp_stats_t;
  6310. typedef struct {
  6311. htt_tlv_hdr_t tlv_hdr;
  6312. A_UINT32 vdev_id;
  6313. /**
  6314. * No of Fine Timing Measurement request frames transmitted successfully
  6315. */
  6316. A_UINT32 tx_ftmr_cnt;
  6317. /**
  6318. * No of Fine Timing Measurement request frames not transmitted successfully
  6319. */
  6320. A_UINT32 tx_ftmr_fail;
  6321. /**
  6322. * No of Fine Timing Measurement request frames transmitted successfully
  6323. * after retry
  6324. */
  6325. A_UINT32 tx_ftmr_suc_retry;
  6326. /**
  6327. * No of Fine Timing Measurement frames received, including initial,
  6328. * non-initial, and duplicates
  6329. */
  6330. A_UINT32 rx_ftm_cnt;
  6331. /** Initiator Terminate count */
  6332. A_UINT32 initiator_terminate_cnt;
  6333. /** Debug count to check the Measurement request from host */
  6334. A_UINT32 tx_meas_req_count;
  6335. } htt_vdev_rtt_init_stats_tlv;
  6336. typedef struct {
  6337. htt_vdev_rtt_init_stats_tlv vdev_rtt_init_stats;
  6338. } htt_vdev_rtt_init_stats_t;
  6339. /* STATS_TYPE : HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  6340. * TLV_TAGS:
  6341. * - HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG
  6342. */
  6343. /* NOTE:
  6344. * This structure is for documentation, and cannot be safely used directly.
  6345. * Instead, use the constituent TLV structures to fill/parse.
  6346. */
  6347. typedef struct {
  6348. htt_tlv_hdr_t tlv_hdr;
  6349. /** No of pktlog payloads that were dropped in htt_ppdu_stats path */
  6350. A_UINT32 pktlog_lite_drop_cnt;
  6351. /** No of pktlog payloads that were dropped in TQM path */
  6352. A_UINT32 pktlog_tqm_drop_cnt;
  6353. /** No of pktlog ppdu stats payloads that were dropped */
  6354. A_UINT32 pktlog_ppdu_stats_drop_cnt;
  6355. /** No of pktlog ppdu ctrl payloads that were dropped */
  6356. A_UINT32 pktlog_ppdu_ctrl_drop_cnt;
  6357. /** No of pktlog sw events payloads that were dropped */
  6358. A_UINT32 pktlog_sw_events_drop_cnt;
  6359. } htt_pktlog_and_htt_ring_stats_tlv;
  6360. #define HTT_DLPAGER_STATS_MAX_HIST 10
  6361. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M 0x000000FF
  6362. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S 0
  6363. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M 0x0000FF00
  6364. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S 8
  6365. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_M 0x0000FFFF
  6366. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_S 0
  6367. #define HTT_DLPAGER_TOTAL_FREE_PAGES_M 0xFFFF0000
  6368. #define HTT_DLPAGER_TOTAL_FREE_PAGES_S 16
  6369. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M 0x0000FFFF
  6370. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S 0
  6371. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M 0xFFFF0000
  6372. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S 16
  6373. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var) \
  6374. (((_var) & HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M) >> \
  6375. HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)
  6376. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  6377. do { \
  6378. HTT_CHECK_SET_VAL(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT, _val); \
  6379. ((_var) &= ~(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M));\
  6380. ((_var) |= ((_val) << HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)); \
  6381. } while (0)
  6382. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var) \
  6383. (((_var) & HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M) >> \
  6384. HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)
  6385. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  6386. do { \
  6387. HTT_CHECK_SET_VAL(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT, _val); \
  6388. ((_var) &= ~(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M));\
  6389. ((_var) |= ((_val) << HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)); \
  6390. } while (0)
  6391. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var) \
  6392. (((_var) & HTT_DLPAGER_TOTAL_LOCKED_PAGES_M) >> \
  6393. HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)
  6394. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_SET(_var, _val) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_LOCKED_PAGES, _val); \
  6397. ((_var) &= ~(HTT_DLPAGER_TOTAL_LOCKED_PAGES_M)); \
  6398. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)); \
  6399. } while (0)
  6400. #define HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var) \
  6401. (((_var) & HTT_DLPAGER_TOTAL_FREE_PAGES_M) >> \
  6402. HTT_DLPAGER_TOTAL_FREE_PAGES_S)
  6403. #define HTT_DLPAGER_TOTAL_FREE_PAGES_SET(_var, _val) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_FREE_PAGES, _val); \
  6406. ((_var) &= ~(HTT_DLPAGER_TOTAL_FREE_PAGES_M)); \
  6407. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_FREE_PAGES_S)); \
  6408. } while (0)
  6409. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var) \
  6410. (((_var) & HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M) >> \
  6411. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)
  6412. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_SET(_var, _val) \
  6413. do { \
  6414. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX, _val); \
  6415. ((_var) &= ~(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M)); \
  6416. ((_var) |= ((_val) << HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)); \
  6417. } while (0)
  6418. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  6419. (((_var) & HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M) >> \
  6420. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)
  6421. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX, _val); \
  6424. ((_var) &= ~(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M)); \
  6425. ((_var) |= ((_val) << HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)); \
  6426. } while (0)
  6427. enum {
  6428. HTT_STATS_PAGE_LOCKED = 0,
  6429. HTT_STATS_PAGE_UNLOCKED = 1,
  6430. HTT_STATS_NUM_PAGE_LOCK_STATES
  6431. };
  6432. /* dlPagerStats structure
  6433. * Number of lock/unlock pages with last 10 lock/unlock occurrences are recorded */
  6434. typedef struct{
  6435. /** msg_dword_1 bitfields:
  6436. * async_lock : 8,
  6437. * sync_lock : 8,
  6438. * reserved : 16;
  6439. */
  6440. A_UINT32 msg_dword_1;
  6441. /** mst_dword_2 bitfields:
  6442. * total_locked_pages : 16,
  6443. * total_free_pages : 16;
  6444. */
  6445. A_UINT32 msg_dword_2;
  6446. /** msg_dword_3 bitfields:
  6447. * last_locked_page_idx : 16,
  6448. * last_unlocked_page_idx : 16;
  6449. */
  6450. A_UINT32 msg_dword_3;
  6451. struct {
  6452. A_UINT32 page_num;
  6453. A_UINT32 num_of_pages;
  6454. /** timestamp is in microsecond units, from SoC timer clock */
  6455. A_UINT32 timestamp_lsbs;
  6456. A_UINT32 timestamp_msbs;
  6457. } last_pages_info[HTT_STATS_NUM_PAGE_LOCK_STATES][HTT_DLPAGER_STATS_MAX_HIST];
  6458. } htt_dl_pager_stats_tlv;
  6459. /* NOTE:
  6460. * This structure is for documentation, and cannot be safely used directly.
  6461. * Instead, use the constituent TLV structures to fill/parse.
  6462. * STATS_TYPE : HTT_DBG_EXT_STATS_DLPAGER_STATS
  6463. * TLV_TAGS:
  6464. * - HTT_STATS_DLPAGER_STATS_TAG
  6465. */
  6466. typedef struct {
  6467. htt_tlv_hdr_t tlv_hdr;
  6468. htt_dl_pager_stats_tlv dl_pager_stats;
  6469. } htt_dlpager_stats_t;
  6470. /*======= PHY STATS ====================*/
  6471. /*
  6472. * STATS TYPE : HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  6473. * TLV_TAGS:
  6474. * - HTT_STATS_PHY_COUNTERS_TAG
  6475. * - HTT_STATS_PHY_STATS_TAG
  6476. */
  6477. #define HTT_MAX_RX_PKT_CNT 8
  6478. #define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
  6479. #define HTT_MAX_PER_BLK_ERR_CNT 20
  6480. #define HTT_MAX_RX_OTA_ERR_CNT 14
  6481. typedef enum {
  6482. HTT_STATS_CHANNEL_HALF_RATE = 0x0001, /* Half rate */
  6483. HTT_STATS_CHANNEL_QUARTER_RATE = 0x0002, /* Quarter rate */
  6484. HTT_STATS_CHANNEL_DFS = 0x0004, /* Enable radar event reporting */
  6485. HTT_STATS_CHANNEL_HOME = 0x0008, /* Home channel */
  6486. HTT_STATS_CHANNEL_PASSIVE_SCAN = 0x0010, /*Passive Scan */
  6487. HTT_STATS_CHANNEL_DFS_SAP_NOT_UP = 0x0020, /* set when VDEV_START_REQUEST, clear when VDEV_UP */
  6488. HTT_STATS_CHANNEL_PASSIVE_SCAN_CAL = 0x0040, /* need to do passive scan calibration to avoid "spikes" */
  6489. HTT_STATS_CHANNEL_DFS_SAP_UP = 0x0080, /* DFS master */
  6490. HTT_STATS_CHANNEL_DFS_CFREQ2 = 0x0100, /* Enable radar event reporting for sec80 in VHT80p80 */
  6491. HTT_STATS_CHANNEL_DTIM_SYNTH = 0x0200, /* Enable DTIM */
  6492. HTT_STATS_CHANNEL_FORCE_GAIN = 0x0400, /* Force gain mmode (only used for FTM) */
  6493. HTT_STATS_CHANNEL_PERFORM_NF_CAL = 0x0800, /* Perform NF cal in channel change (only used for FTM) */
  6494. HTT_STATS_CHANNEL_165_MODE_0 = 0x1000, /* 165 MHz mode 0 */
  6495. HTT_STATS_CHANNEL_165_MODE_1 = 0x2000, /* 165 MHz mode 1 */
  6496. HTT_STATS_CHANNEL_165_MODE_2 = 0x3000, /* 165 MHz mode 2 */
  6497. HTT_STATS_CHANNEL_165_MODE_MASK = 0x3000, /* 165 MHz 2-bit mode mask */
  6498. } HTT_STATS_CHANNEL_FLAGS;
  6499. typedef enum {
  6500. HTT_STATS_RF_MODE_MIN = 0,
  6501. HTT_STATS_RF_MODE_PHYA_ONLY = 0, // only PHYA is active
  6502. HTT_STATS_RF_MODE_DBS = 1, // PHYA/5G and PHYB/2G
  6503. HTT_STATS_RF_MODE_SBS = 2, // PHYA/5G and PHYB/5G in HL/NPR; PHYA0/5G and PHYA1/5G in HK
  6504. HTT_STATS_RF_MODE_PHYB_ONLY = 3, // only PHYB is active
  6505. HTT_STATS_RF_MODE_DBS_SBS = 4, // PHYA0/5G, PHYA1/5G and PHYB/2G in HK (the 2 5G are in different channel)
  6506. HTT_STATS_RF_MODE_DBS_OR_SBS = 5, // PHYA0/5G, PHYA1/5G and PHYB/5G or 2G in HK
  6507. HTT_STATS_RF_MODE_INVALID = 0xff,
  6508. } HTT_STATS_RF_MODE;
  6509. typedef enum {
  6510. HTT_STATS_RESET_CAUSE_FIRST_RESET = 0x00000001, /* First reset by application */
  6511. HTT_STATS_RESET_CAUSE_ERROR = 0x00000002, /* Trigered due to error */
  6512. HTT_STATS_RESET_CAUSE_DEEP_SLEEP = 0x00000004, /* Reset after deep sleep */
  6513. HTT_STATS_RESET_CAUSE_FULL_RESET = 0x00000008, /* Full reset without any optimizations */
  6514. HTT_STATS_RESET_CAUSE_CHANNEL_CHANGE = 0x00000010, /* For normal channel change */
  6515. HTT_STATS_RESET_CAUSE_BAND_CHANGE = 0x00000020, /* Trigered due to band change */
  6516. HTT_STATS_RESET_CAUSE_DO_CAL = 0x00000040, /* Trigered due to calibrations */
  6517. HTT_STATS_RESET_CAUSE_MCI_ERROR = 0x00000080, /* Triggered due to MCI ERROR */
  6518. HTT_STATS_RESET_CAUSE_CHWIDTH_CHANGE = 0x00000100, /* Trigered due to channel width change */
  6519. HTT_STATS_RESET_CAUSE_WARM_RESTORE_CAL = 0x00000200, /* Trigered due to warm reset we want to just restore calibrations */
  6520. HTT_STATS_RESET_CAUSE_COLD_RESTORE_CAL = 0x00000400, /* Trigered due to cold reset we want to just restore calibrations */
  6521. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET = 0x00000800, /* Trigered due to phy warm reset we want to just restore calibrations */
  6522. HTT_STATS_RESET_CAUSE_M3_SSR = 0x00001000, /* Trigered due to SSR Restart */
  6523. HTT_STATS_RESET_CAUSE_FORCE_CAL = 0x00002000, /* Reset to force the calibration */
  6524. /* 0x00004000, 0x00008000 reserved */
  6525. HTT_STATS_NO_RESET_CHANNEL_CHANGE = 0x00010000, /* No reset, normal channel change */
  6526. HTT_STATS_NO_RESET_BAND_CHANGE = 0x00020000, /* No reset, channel change across band */
  6527. HTT_STATS_NO_RESET_CHWIDTH_CHANGE = 0x00040000, /* No reset, channel change across channel width */
  6528. HTT_STATS_NO_RESET_CHAINMASK_CHANGE = 0x00080000, /* No reset, chainmask change */
  6529. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET_UCODE_TRIG = 0x00100000, /* Trigered due to phy warm reset we want to just restore calibrations */
  6530. HTT_STATS_RESET_CAUSE_PHY_OFF_TIMEOUT_RESET = 0x00200000, /* Reset ucode because phy off ack timeout*/
  6531. HTT_STATS_RESET_CAUSE_LMAC_RESET_UMAC_NOC_ERR = 0x00400000, /* LMAC reset trigered due to NOC Address/Slave error originating at LMAC */
  6532. HTT_STATS_NO_RESET_SCAN_BACK_TO_SAME_HOME_CHANNEL_CHANGE = 0x00800000, /* No reset, scan to home channel change */
  6533. } HTT_STATS_RESET_CAUSE;
  6534. typedef enum {
  6535. HTT_CHANNEL_RATE_FULL,
  6536. HTT_CHANNEL_RATE_HALF,
  6537. HTT_CHANNEL_RATE_QUARTER,
  6538. HTT_CHANNEL_RATE_COUNT
  6539. } HTT_CHANNEL_RATE;
  6540. typedef enum {
  6541. HTT_PHY_BW_IDX_20MHz = 0,
  6542. HTT_PHY_BW_IDX_40MHz = 1,
  6543. HTT_PHY_BW_IDX_80MHz = 2,
  6544. HTT_PHY_BW_IDX_80Plus80 = 3,
  6545. HTT_PHY_BW_IDX_160MHz = 4,
  6546. HTT_PHY_BW_IDX_10MHz = 5,
  6547. HTT_PHY_BW_IDX_5MHz = 6,
  6548. HTT_PHY_BW_IDX_165MHz = 7,
  6549. } HTT_PHY_BW_IDX;
  6550. typedef enum {
  6551. HTT_WHAL_CONFIG_NONE = 0x00000000,
  6552. HTT_WHAL_CONFIG_NF_WAR = 0x00000001,
  6553. HTT_WHAL_CONFIG_CAL_WAR = 0x00000002,
  6554. HTT_WHAL_CONFIG_DO_NF_CAL = 0x00000004,
  6555. HTT_WHAL_CONFIG_SET_WAIT_FOR_NF_CAL = 0x00000008,
  6556. HTT_WHAL_CONFIG_FORCED_TX_PWR = 0x00000010,
  6557. HTT_WHAL_CONFIG_FORCED_GAIN_IDX = 0x00000020,
  6558. HTT_WHAL_CONFIG_FORCED_PER_CHAIN = 0x00000040,
  6559. } HTT_WHAL_CONFIG;
  6560. typedef struct {
  6561. htt_tlv_hdr_t tlv_hdr;
  6562. /** number of RXTD OFDMA OTA error counts except power surge and drop */
  6563. A_UINT32 rx_ofdma_timing_err_cnt;
  6564. /** rx_cck_fail_cnt:
  6565. * number of cck error counts due to rx reception failure because of
  6566. * timing error in cck
  6567. */
  6568. A_UINT32 rx_cck_fail_cnt;
  6569. /** number of times tx abort initiated by mac */
  6570. A_UINT32 mactx_abort_cnt;
  6571. /** number of times rx abort initiated by mac */
  6572. A_UINT32 macrx_abort_cnt;
  6573. /** number of times tx abort initiated by phy */
  6574. A_UINT32 phytx_abort_cnt;
  6575. /** number of times rx abort initiated by phy */
  6576. A_UINT32 phyrx_abort_cnt;
  6577. /** number of rx defered count initiated by phy */
  6578. A_UINT32 phyrx_defer_abort_cnt;
  6579. /** number of sizing events generated at LSTF */
  6580. A_UINT32 rx_gain_adj_lstf_event_cnt; /* a.k.a sizing1 */
  6581. /** number of sizing events generated at non-legacy LTF */
  6582. A_UINT32 rx_gain_adj_non_legacy_cnt; /* a.k.a sizing2 */
  6583. /** rx_pkt_cnt -
  6584. * Received EOP (end-of-packet) count per packet type;
  6585. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  6586. * [6-7]=RSVD
  6587. */
  6588. A_UINT32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
  6589. /** rx_pkt_crc_pass_cnt -
  6590. * Received EOP (end-of-packet) count per packet type;
  6591. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  6592. * [6-7]=RSVD
  6593. */
  6594. A_UINT32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
  6595. /** per_blk_err_cnt -
  6596. * Error count per error source;
  6597. * [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
  6598. * [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
  6599. * [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
  6600. * [13-19]=RSVD
  6601. */
  6602. A_UINT32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
  6603. /** rx_ota_err_cnt -
  6604. * RXTD OTA (over-the-air) error count per error reason;
  6605. * [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
  6606. * [3] = cck fail; [4] = power surge; [5] = power drop;
  6607. * [6] = btcf timing timeout error; [7] = btcf packet detect error;
  6608. * [8] = coarse timing timeout error
  6609. * [9-13]=RSVD
  6610. */
  6611. A_UINT32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
  6612. } htt_phy_counters_tlv;
  6613. typedef struct {
  6614. htt_tlv_hdr_t tlv_hdr;
  6615. /** per chain hw noise floor values in dBm */
  6616. A_INT32 nf_chain[HTT_STATS_MAX_CHAINS];
  6617. /** number of false radars detected */
  6618. A_UINT32 false_radar_cnt;
  6619. /** number of channel switches happened due to radar detection */
  6620. A_UINT32 radar_cs_cnt;
  6621. /** ani_level -
  6622. * ANI level (noise interference) corresponds to the channel
  6623. * the desense levels range from -5 to 15 in dB units,
  6624. * higher values indicating more noise interference.
  6625. */
  6626. A_INT32 ani_level;
  6627. /** running time in minutes since FW boot */
  6628. A_UINT32 fw_run_time;
  6629. /** per chain runtime noise floor values in dBm */
  6630. A_INT32 runTime_nf_chain[HTT_STATS_MAX_CHAINS];
  6631. } htt_phy_stats_tlv;
  6632. typedef struct {
  6633. htt_tlv_hdr_t tlv_hdr;
  6634. /** current pdev_id */
  6635. A_UINT32 pdev_id;
  6636. /** current channel information */
  6637. A_UINT32 chan_mhz;
  6638. /** center_freq1, center_freq2 in mhz */
  6639. A_UINT32 chan_band_center_freq1;
  6640. A_UINT32 chan_band_center_freq2;
  6641. /** chan_phy_mode - WLAN_PHY_MODE enum type */
  6642. A_UINT32 chan_phy_mode;
  6643. /** chan_flags follows HTT_STATS_CHANNEL_FLAGS enum */
  6644. A_UINT32 chan_flags;
  6645. /** channel Num updated to virtual phybase */
  6646. A_UINT32 chan_num;
  6647. /** Cause for the phy reset - HTT_STATS_RESET_CAUSE */
  6648. A_UINT32 reset_cause;
  6649. /** Cause for the previous phy reset */
  6650. A_UINT32 prev_reset_cause;
  6651. /** source for the phywarm reset - HTT_STATS_RESET_CAUSE */
  6652. A_UINT32 phy_warm_reset_src;
  6653. /** rxGain Table selection mode - register settings
  6654. * 0 - Auto, 1/2 - Forced with and without BT override respectively
  6655. */
  6656. A_UINT32 rx_gain_tbl_mode;
  6657. /** current xbar value - perchain analog to digital idx mapping */
  6658. A_UINT32 xbar_val;
  6659. /** Flag to indicate forced calibration */
  6660. A_UINT32 force_calibration;
  6661. /** current RF mode (e.g. SBS/DBS) - follows HTT_STATS_RF_MODE enum */
  6662. A_UINT32 phyrf_mode;
  6663. /* PDL phyInput stats */
  6664. /** homechannel flag
  6665. * 1- Homechan, 0 - scan channel
  6666. */
  6667. A_UINT32 phy_homechan;
  6668. /** Tx and Rx chainmask */
  6669. A_UINT32 phy_tx_ch_mask;
  6670. A_UINT32 phy_rx_ch_mask;
  6671. /** INI masks - to decide the INI registers to be loaded on a reset */
  6672. A_UINT32 phybb_ini_mask;
  6673. A_UINT32 phyrf_ini_mask;
  6674. /** DFS,ADFS/Spectral scan enable masks */
  6675. A_UINT32 phy_dfs_en_mask;
  6676. A_UINT32 phy_sscan_en_mask;
  6677. A_UINT32 phy_synth_sel_mask;
  6678. A_UINT32 phy_adfs_freq;
  6679. /** CCK FIR settings
  6680. * register settings - filter coefficients for Iqs conversion
  6681. * [31:24] = FIR_COEFF_3_0
  6682. * [23:16] = FIR_COEFF_2_0
  6683. * [15:8] = FIR_COEFF_1_0
  6684. * [7:0] = FIR_COEFF_0_0
  6685. */
  6686. A_UINT32 cck_fir_settings;
  6687. /** dynamic primary channel index
  6688. * primary 20MHz channel index on the current channel BW
  6689. */
  6690. A_UINT32 phy_dyn_pri_chan;
  6691. /**
  6692. * Current CCA detection threshold
  6693. * dB above noisefloor req for CCA
  6694. * Register settings for all subbands
  6695. */
  6696. A_UINT32 cca_thresh;
  6697. /**
  6698. * status for dynamic CCA adjustment
  6699. * 0-disabled, 1-enabled
  6700. */
  6701. A_UINT32 dyn_cca_status;
  6702. /** RXDEAF Register value
  6703. * rxdesense_thresh_sw - VREG Register
  6704. * rxdesense_thresh_hw - PHY Register
  6705. */
  6706. A_UINT32 rxdesense_thresh_sw;
  6707. A_UINT32 rxdesense_thresh_hw;
  6708. /** Current PHY Bandwidth -
  6709. * values are specified by the HTT_PHY_BW_IDX enum type
  6710. */
  6711. A_UINT32 phy_bw_code;
  6712. /** Current channel operating rate -
  6713. * values are specified by the HTT_CHANNEL_RATE enum type
  6714. */
  6715. A_UINT32 phy_rate_mode;
  6716. /** current channel operating band
  6717. * 0 - 5G; 1 - 2G; 2 -6G
  6718. */
  6719. A_UINT32 phy_band_code;
  6720. /** microcode processor virtual phy base address -
  6721. * provided only for debug
  6722. */
  6723. A_UINT32 phy_vreg_base;
  6724. /** microcode processor virtual phy base ext address -
  6725. * provided only for debug
  6726. */
  6727. A_UINT32 phy_vreg_base_ext;
  6728. /** HW LUT table configuration for home/scan channel -
  6729. * provided only for debug
  6730. */
  6731. A_UINT32 cur_table_index;
  6732. /** SW configuration flag for PHY reset and Calibrations -
  6733. * values are specified by the HTT_WHAL_CONFIG enum type
  6734. */
  6735. A_UINT32 whal_config_flag;
  6736. } htt_phy_reset_stats_tlv;
  6737. typedef struct {
  6738. htt_tlv_hdr_t tlv_hdr;
  6739. /** current pdev_id */
  6740. A_UINT32 pdev_id;
  6741. /** ucode PHYOFF pass/failure count */
  6742. A_UINT32 cf_active_low_fail_cnt;
  6743. A_UINT32 cf_active_low_pass_cnt;
  6744. /** PHYOFF count attempted through ucode VREG */
  6745. A_UINT32 phy_off_through_vreg_cnt;
  6746. /** Force calibration count */
  6747. A_UINT32 force_calibration_cnt;
  6748. /** phyoff count during rfmode switch */
  6749. A_UINT32 rf_mode_switch_phy_off_cnt;
  6750. /** Temperature based recalibration count */
  6751. A_UINT32 temperature_recal_cnt;
  6752. } htt_phy_reset_counters_tlv;
  6753. /* Considering 320 MHz maximum 16 power levels */
  6754. #define HTT_MAX_CH_PWR_INFO_SIZE 16
  6755. typedef struct {
  6756. htt_tlv_hdr_t tlv_hdr;
  6757. /** current pdev_id */
  6758. A_UINT32 pdev_id;
  6759. /** Tranmsit power control scaling related configurations */
  6760. A_UINT32 tx_power_scale;
  6761. A_UINT32 tx_power_scale_db;
  6762. /** Minimum negative tx power supported by the target */
  6763. A_INT32 min_negative_tx_power;
  6764. /** current configured CTL domain */
  6765. A_UINT32 reg_ctl_domain;
  6766. /** Regulatory power information for the current channel */
  6767. A_INT32 max_reg_allowed_power[HTT_STATS_MAX_CHAINS];
  6768. A_INT32 max_reg_allowed_power_6g[HTT_STATS_MAX_CHAINS];
  6769. /** channel max regulatory power in 0.5dB */
  6770. A_UINT32 twice_max_rd_power;
  6771. /** current channel and home channel's maximum possible tx power */
  6772. A_INT32 max_tx_power;
  6773. A_INT32 home_max_tx_power;
  6774. /** channel's Power Spectral Density */
  6775. A_UINT32 psd_power;
  6776. /** channel's EIRP power */
  6777. A_UINT32 eirp_power;
  6778. /** 6G channel power mode
  6779. * 0-LPI, 1-SP, 2-VLPI and 3-SP_CLIENT power mode
  6780. */
  6781. A_UINT32 power_type_6ghz;
  6782. /** sub-band channels and corresponding Tx-power */
  6783. A_UINT32 sub_band_cfreq[HTT_MAX_CH_PWR_INFO_SIZE];
  6784. A_UINT32 sub_band_txpower[HTT_MAX_CH_PWR_INFO_SIZE];
  6785. } htt_phy_tpc_stats_tlv;
  6786. /* NOTE:
  6787. * This structure is for documentation, and cannot be safely used directly.
  6788. * Instead, use the constituent TLV structures to fill/parse.
  6789. */
  6790. typedef struct {
  6791. htt_phy_counters_tlv phy_counters;
  6792. htt_phy_stats_tlv phy_stats;
  6793. htt_phy_reset_counters_tlv phy_reset_counters;
  6794. htt_phy_reset_stats_tlv phy_reset_stats;
  6795. htt_phy_tpc_stats_tlv phy_tpc_stats;
  6796. } htt_phy_counters_and_phy_stats_t;
  6797. /* NOTE:
  6798. * This structure is for documentation, and cannot be safely used directly.
  6799. * Instead, use the constituent TLV structures to fill/parse.
  6800. */
  6801. typedef struct {
  6802. htt_t2h_soc_txrx_stats_common_tlv soc_common_stats;
  6803. htt_t2h_vdev_txrx_stats_hw_stats_tlv vdev_hw_stats[1/*or more*/];
  6804. } htt_vdevs_txrx_stats_t;
  6805. typedef struct {
  6806. A_UINT32
  6807. success: 16,
  6808. fail: 16;
  6809. } htt_stats_strm_gen_mpdus_cntr_t;
  6810. typedef struct {
  6811. /* MSDU queue identification */
  6812. A_UINT32
  6813. peer_id: 16,
  6814. tid: 4, /* only TIDs 0-7 actually expected to be used */
  6815. htt_qtype: 4, /* refer to HTT_MSDUQ_INDEX */
  6816. reserved: 8;
  6817. } htt_stats_strm_msdu_queue_id;
  6818. typedef struct {
  6819. htt_tlv_hdr_t tlv_hdr;
  6820. htt_stats_strm_msdu_queue_id queue_id;
  6821. htt_stats_strm_gen_mpdus_cntr_t svc_interval;
  6822. htt_stats_strm_gen_mpdus_cntr_t burst_size;
  6823. } htt_stats_strm_gen_mpdus_tlv_t;
  6824. typedef struct {
  6825. htt_tlv_hdr_t tlv_hdr;
  6826. htt_stats_strm_msdu_queue_id queue_id;
  6827. struct {
  6828. A_UINT32
  6829. timestamp_prior_ms: 16,
  6830. timestamp_now_ms: 16;
  6831. A_UINT32
  6832. interval_spec_ms: 16,
  6833. margin_ms: 16;
  6834. } svc_interval;
  6835. struct {
  6836. A_UINT32
  6837. /* consumed_bytes_orig:
  6838. * Raw count (actually estimate) of how many bytes were removed
  6839. * from the MSDU queue by the GEN_MPDUS operation.
  6840. */
  6841. consumed_bytes_orig: 16,
  6842. /* consumed_bytes_final:
  6843. * Adjusted count of removed bytes that incorporates normalizing
  6844. * by the actual service interval compared to the expected
  6845. * service interval.
  6846. * This allows the burst size computation to be independent of
  6847. * whether the target is doing GEN_MPDUS at only the service
  6848. * interval, or substantially more often than the service
  6849. * interval.
  6850. * consumed_bytes_final = consumed_bytes_orig /
  6851. * (svc_interval / ref_svc_interval)
  6852. */
  6853. consumed_bytes_final: 16;
  6854. A_UINT32
  6855. remaining_bytes: 16,
  6856. reserved: 16;
  6857. A_UINT32
  6858. burst_size_spec: 16,
  6859. margin_bytes: 16;
  6860. } burst_size;
  6861. } htt_stats_strm_gen_mpdus_details_tlv_t;
  6862. typedef struct {
  6863. htt_tlv_hdr_t tlv_hdr;
  6864. A_UINT32 reset_count;
  6865. /** lower portion (bits 31:0) of reset time, in milliseconds */
  6866. A_UINT32 reset_time_lo_ms;
  6867. /** upper portion (bits 63:32) of reset time, in milliseconds */
  6868. A_UINT32 reset_time_hi_ms;
  6869. /** lower portion (bits 31:0) of disengage time, in milliseconds */
  6870. A_UINT32 disengage_time_lo_ms;
  6871. /** upper portion (bits 63:32) of disengage time, in milliseconds */
  6872. A_UINT32 disengage_time_hi_ms;
  6873. /** lower portion (bits 31:0) of engage time, in milliseconds */
  6874. A_UINT32 engage_time_lo_ms;
  6875. /** upper portion (bits 63:32) of engage time, in milliseconds */
  6876. A_UINT32 engage_time_hi_ms;
  6877. A_UINT32 disengage_count;
  6878. A_UINT32 engage_count;
  6879. A_UINT32 drain_dest_ring_mask;
  6880. } htt_dmac_reset_stats_tlv;
  6881. /* Support up to 640 MHz mode for future expansion */
  6882. #define HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT 32
  6883. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_M 0x000000ff
  6884. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_S 0
  6885. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_GET(_var) \
  6886. (((_var) & HTT_PDEV_PUNCTURE_STATS_MAC_ID_M) >> \
  6887. HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)
  6888. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_SET(_var, _val) \
  6889. do { \
  6890. HTT_CHECK_SET_VAL(HTT_PDEV_PUNCTURE_STATS_MAC_ID, _val); \
  6891. ((_var) |= ((_val) << HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)); \
  6892. } while (0)
  6893. /*
  6894. * TLV used to provide puncturing related stats for TX/RX and each PPDU type.
  6895. */
  6896. typedef struct {
  6897. htt_tlv_hdr_t tlv_hdr;
  6898. /**
  6899. * BIT [ 7 : 0] :- mac_id
  6900. * BIT [31 : 8] :- reserved
  6901. */
  6902. union {
  6903. struct {
  6904. A_UINT32 mac_id: 8,
  6905. reserved: 24;
  6906. };
  6907. A_UINT32 mac_id__word;
  6908. };
  6909. /*
  6910. * Stats direction (TX/RX). Enum value from HTT_STATS_DIRECTION.
  6911. */
  6912. A_UINT32 direction;
  6913. /*
  6914. * Preamble type. Enum value from HTT_STATS_PREAM_TYPE.
  6915. *
  6916. * Note that for although OFDM rates don't technically support
  6917. * "puncturing", this TLV can be used to indicate the 20 MHz sub-bands
  6918. * utilized for OFDM legacy duplicate packets, which are also used during
  6919. * puncturing sequences.
  6920. */
  6921. A_UINT32 preamble;
  6922. /*
  6923. * Stats PPDU type. Enum value from HTT_STATS_PPDU_TYPE.
  6924. */
  6925. A_UINT32 ppdu_type;
  6926. /*
  6927. * Indicates the number of valid elements in the
  6928. * "num_subbands_used_cnt" array, and must be <=
  6929. * HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT.
  6930. *
  6931. * Also indicates how many bits in the last_used_pattern_mask may be
  6932. * non-zero.
  6933. */
  6934. A_UINT32 subband_count;
  6935. /*
  6936. * The last used transmit 20 MHz subband mask. Bit 0 represents the lowest
  6937. * 20 MHz subband mask, bit 1 the second lowest, and so on.
  6938. *
  6939. * All 32 bits are valid and will be used for expansion to higher BW modes.
  6940. */
  6941. A_UINT32 last_used_pattern_mask;
  6942. /*
  6943. * Number of array elements with valid values is equal to "subband_count".
  6944. * If subband_count is < HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT, the
  6945. * remaining elements will be implicitly set to 0x0.
  6946. *
  6947. * The array index is the number of 20 MHz subbands utilized during TX/RX,
  6948. * and the counter value at that index is the number of times that subband
  6949. * count was used.
  6950. *
  6951. * The count is incremented once for each OTA PPDU transmitted / received.
  6952. */
  6953. A_UINT32 num_subbands_used_cnt[HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT];
  6954. } htt_pdev_puncture_stats_tlv;
  6955. enum {
  6956. HTT_STATS_CAL_PROF_COLD_BOOT = 0,
  6957. HTT_STATS_CAL_PROF_FULL_CHAN_SWITCH = 1,
  6958. HTT_STATS_CAL_PROF_SCAN_CHAN_SWITCH = 2,
  6959. HTT_STATS_CAL_PROF_DPD_SPLIT_CAL = 3,
  6960. HTT_STATS_MAX_PROF_CAL = 4,
  6961. };
  6962. #define HTT_STATS_MAX_CAL_IDX_CNT 8
  6963. typedef struct {
  6964. htt_tlv_hdr_t tlv_hdr;
  6965. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  6966. /** To verify whether prof cal is enabled or not */
  6967. A_UINT32 enable;
  6968. /** current pdev_id */
  6969. A_UINT32 pdev_id;
  6970. /** The cnt is incremented when each time the calindex takes place */
  6971. A_UINT32 cnt[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6972. /** Minimum time taken to complete the calibration - in us */
  6973. A_UINT32 min[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6974. /** Maximum time taken to complete the calibration -in us */
  6975. A_UINT32 max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6976. /** Time taken by the cal for its final time execution - in us */
  6977. A_UINT32 last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6978. /** Total time taken - in us */
  6979. A_UINT32 tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6980. /** hist_intvl - by default will be set to 2000 us */
  6981. A_UINT32 hist_intvl[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6982. /**
  6983. * If last is less than hist_intvl, then hist[0]++,
  6984. * If last is less than hist_intvl << 1, then hist[1]++,
  6985. * otherwise hist[2]++.
  6986. */
  6987. A_UINT32 hist[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT][HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  6988. /** Pf_last will log the current no of page faults */
  6989. A_UINT32 pf_last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6990. /** Sum of all page faults happened */
  6991. A_UINT32 pf_tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6992. /** If pf_last > pf_max then pf_max = pf_last */
  6993. A_UINT32 pf_max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  6994. /**
  6995. * For each cal profile, only certain no of cal indices were invoked,
  6996. * this member will store what all the indices got invoked per each
  6997. * cal profile
  6998. */
  6999. A_UINT32 enabledCalIdx[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  7000. /** No of indices invoked per each cal profile */
  7001. A_UINT32 CalCnt[HTT_STATS_MAX_PROF_CAL];
  7002. } htt_latency_prof_cal_stats_tlv;
  7003. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M 0x0000003F
  7004. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S 0
  7005. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M 0x00000FC0
  7006. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S 6
  7007. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M 0x0FFFF000
  7008. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S 12
  7009. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var) \
  7010. (((_var) & HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M) >> \
  7011. HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)
  7012. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_SET(_var, _val) \
  7013. do { \
  7014. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD, _val); \
  7015. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M)); \
  7016. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)); \
  7017. } while (0)
  7018. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var) \
  7019. (((_var) & HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M) >> \
  7020. HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)
  7021. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_SET(_var, _val) \
  7022. do { \
  7023. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD, _val); \
  7024. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M)); \
  7025. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)); \
  7026. } while (0)
  7027. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var) \
  7028. (((_var) & HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M) >> \
  7029. HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)
  7030. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_SET(_var, _val) \
  7031. do { \
  7032. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX, _val); \
  7033. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M)); \
  7034. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)); \
  7035. } while (0)
  7036. typedef struct {
  7037. htt_tlv_hdr_t tlv_hdr;
  7038. union {
  7039. struct {
  7040. A_UINT32 peer_assoc_ipc_recvd : 6,
  7041. sched_peer_delete_recvd : 6,
  7042. mld_ast_index : 16,
  7043. reserved : 4;
  7044. };
  7045. A_UINT32 msg_dword_1;
  7046. };
  7047. } htt_ml_peer_ext_details_tlv;
  7048. #define HTT_ML_LINK_INFO_VALID_M 0x00000001
  7049. #define HTT_ML_LINK_INFO_VALID_S 0
  7050. #define HTT_ML_LINK_INFO_ACTIVE_M 0x00000002
  7051. #define HTT_ML_LINK_INFO_ACTIVE_S 1
  7052. #define HTT_ML_LINK_INFO_PRIMARY_M 0x00000004
  7053. #define HTT_ML_LINK_INFO_PRIMARY_S 2
  7054. #define HTT_ML_LINK_INFO_ASSOC_LINK_M 0x00000008
  7055. #define HTT_ML_LINK_INFO_ASSOC_LINK_S 3
  7056. #define HTT_ML_LINK_INFO_CHIP_ID_M 0x00000070
  7057. #define HTT_ML_LINK_INFO_CHIP_ID_S 4
  7058. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_M 0x00007F80
  7059. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_S 7
  7060. #define HTT_ML_LINK_INFO_HW_LINK_ID_M 0x00038000
  7061. #define HTT_ML_LINK_INFO_HW_LINK_ID_S 15
  7062. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M 0x000C0000
  7063. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S 18
  7064. #define HTT_ML_LINK_INFO_MASTER_LINK_M 0x00100000
  7065. #define HTT_ML_LINK_INFO_MASTER_LINK_S 20
  7066. #define HTT_ML_LINK_INFO_ANCHOR_LINK_M 0x00200000
  7067. #define HTT_ML_LINK_INFO_ANCHOR_LINK_S 21
  7068. #define HTT_ML_LINK_INFO_INITIALIZED_M 0x00400000
  7069. #define HTT_ML_LINK_INFO_INITIALIZED_S 22
  7070. #define HTT_ML_LINK_INFO_SW_PEER_ID_M 0x0000ffff
  7071. #define HTT_ML_LINK_INFO_SW_PEER_ID_S 0
  7072. #define HTT_ML_LINK_INFO_VDEV_ID_M 0x00ff0000
  7073. #define HTT_ML_LINK_INFO_VDEV_ID_S 16
  7074. #define HTT_ML_LINK_INFO_VALID_GET(_var) \
  7075. (((_var) & HTT_ML_LINK_INFO_VALID_M) >> \
  7076. HTT_ML_LINK_INFO_VALID_S)
  7077. #define HTT_ML_LINK_INFO_VALID_SET(_var, _val) \
  7078. do { \
  7079. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VALID, _val); \
  7080. ((_var) &= ~(HTT_ML_LINK_INFO_VALID_M)); \
  7081. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VALID_S)); \
  7082. } while (0)
  7083. #define HTT_ML_LINK_INFO_ACTIVE_GET(_var) \
  7084. (((_var) & HTT_ML_LINK_INFO_ACTIVE_M) >> \
  7085. HTT_ML_LINK_INFO_ACTIVE_S)
  7086. #define HTT_ML_LINK_INFO_ACTIVE_SET(_var, _val) \
  7087. do { \
  7088. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ACTIVE, _val); \
  7089. ((_var) &= ~(HTT_ML_LINK_INFO_ACTIVE_M)); \
  7090. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ACTIVE_S)); \
  7091. } while (0)
  7092. #define HTT_ML_LINK_INFO_PRIMARY_GET(_var) \
  7093. (((_var) & HTT_ML_LINK_INFO_PRIMARY_M) >> \
  7094. HTT_ML_LINK_INFO_PRIMARY_S)
  7095. #define HTT_ML_LINK_INFO_PRIMARY_SET(_var, _val) \
  7096. do { \
  7097. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_PRIMARY, _val); \
  7098. ((_var) &= ~(HTT_ML_LINK_INFO_PRIMARY_M)); \
  7099. ((_var) |= ((_val) << HTT_ML_LINK_INFO_PRIMARY_S)); \
  7100. } while (0)
  7101. #define HTT_ML_LINK_INFO_ASSOC_LINK_GET(_var) \
  7102. (((_var) & HTT_ML_LINK_INFO_ASSOC_LINK_M) >> \
  7103. HTT_ML_LINK_INFO_ASSOC_LINK_S)
  7104. #define HTT_ML_LINK_INFO_ASSOC_LINK_SET(_var, _val) \
  7105. do { \
  7106. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ASSOC_LINK, _val); \
  7107. ((_var) &= ~(HTT_ML_LINK_INFO_ASSOC_LINK_M)); \
  7108. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ASSOC_LINK_S)); \
  7109. } while (0)
  7110. #define HTT_ML_LINK_INFO_CHIP_ID_GET(_var) \
  7111. (((_var) & HTT_ML_LINK_INFO_CHIP_ID_M) >> \
  7112. HTT_ML_LINK_INFO_CHIP_ID_S)
  7113. #define HTT_ML_LINK_INFO_CHIP_ID_SET(_var, _val) \
  7114. do { \
  7115. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_CHIP_ID, _val); \
  7116. ((_var) &= ~(HTT_ML_LINK_INFO_CHIP_ID_M)); \
  7117. ((_var) |= ((_val) << HTT_ML_LINK_INFO_CHIP_ID_S)); \
  7118. } while (0)
  7119. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_GET(_var) \
  7120. (((_var) & HTT_ML_LINK_INFO_IEEE_LINK_ID_M) >> \
  7121. HTT_ML_LINK_INFO_IEEE_LINK_ID_S)
  7122. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_SET(_var, _val) \
  7123. do { \
  7124. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_IEEE_LINK_ID, _val); \
  7125. ((_var) &= ~(HTT_ML_LINK_INFO_IEEE_LINK_ID_M)); \
  7126. ((_var) |= ((_val) << HTT_ML_LINK_INFO_IEEE_LINK_ID_S)); \
  7127. } while (0)
  7128. #define HTT_ML_LINK_INFO_HW_LINK_ID_GET(_var) \
  7129. (((_var) & HTT_ML_LINK_INFO_HW_LINK_ID_M) >> \
  7130. HTT_ML_LINK_INFO_HW_LINK_ID_S)
  7131. #define HTT_ML_LINK_INFO_HW_LINK_ID_SET(_var, _val) \
  7132. do { \
  7133. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_HW_LINK_ID, _val); \
  7134. ((_var) &= ~(HTT_ML_LINK_INFO_HW_LINK_ID_M)); \
  7135. ((_var) |= ((_val) << HTT_ML_LINK_INFO_HW_LINK_ID_S)); \
  7136. } while (0)
  7137. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_GET(_var) \
  7138. (((_var) & HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M) >> \
  7139. HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)
  7140. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_SET(_var, _val) \
  7141. do { \
  7142. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_LOGICAL_LINK_ID, _val); \
  7143. ((_var) &= ~(HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M)); \
  7144. ((_var) |= ((_val) << HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)); \
  7145. } while (0)
  7146. #define HTT_ML_LINK_INFO_MASTER_LINK_GET(_var) \
  7147. (((_var) & HTT_ML_LINK_INFO_MASTER_LINK_M) >> \
  7148. HTT_ML_LINK_INFO_MASTER_LINK_S)
  7149. #define HTT_ML_LINK_INFO_MASTER_LINK_SET(_var, _val) \
  7150. do { \
  7151. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_MASTER_LINK, _val); \
  7152. ((_var) &= ~(HTT_ML_LINK_INFO_MASTER_LINK_M)); \
  7153. ((_var) |= ((_val) << HTT_ML_LINK_INFO_MASTER_LINK_S)); \
  7154. } while (0)
  7155. #define HTT_ML_LINK_INFO_ANCHOR_LINK_GET(_var) \
  7156. (((_var) & HTT_ML_LINK_INFO_ANCHOR_LINK_M) >> \
  7157. HTT_ML_LINK_INFO_ANCHOR_LINK_S)
  7158. #define HTT_ML_LINK_INFO_ANCHOR_LINK_SET(_var, _val) \
  7159. do { \
  7160. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ANCHOR_LINK, _val); \
  7161. ((_var) &= ~(HTT_ML_LINK_INFO_ANCHOR_LINK_M)); \
  7162. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ANCHOR_LINK_S)); \
  7163. } while (0)
  7164. #define HTT_ML_LINK_INFO_INITIALIZED_GET(_var) \
  7165. (((_var) & HTT_ML_LINK_INFO_INITIALIZED_M) >> \
  7166. HTT_ML_LINK_INFO_INITIALIZED_S)
  7167. #define HTT_ML_LINK_INFO_INITIALIZED_SET(_var, _val) \
  7168. do { \
  7169. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_INITIALIZED, _val); \
  7170. ((_var) &= ~(HTT_ML_LINK_INFO_INITIALIZED_M)); \
  7171. ((_var) |= ((_val) << HTT_ML_LINK_INFO_INITIALIZED_S)); \
  7172. } while (0)
  7173. #define HTT_ML_LINK_INFO_SW_PEER_ID_GET(_var) \
  7174. (((_var) & HTT_ML_LINK_INFO_SW_PEER_ID_M) >> \
  7175. HTT_ML_LINK_INFO_SW_PEER_ID_S)
  7176. #define HTT_ML_LINK_INFO_SW_PEER_ID_SET(_var, _val) \
  7177. do { \
  7178. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_SW_PEER_ID, _val); \
  7179. ((_var) &= ~(HTT_ML_LINK_INFO_SW_PEER_ID_M)); \
  7180. ((_var) |= ((_val) << HTT_ML_LINK_INFO_SW_PEER_ID_S)); \
  7181. } while (0)
  7182. #define HTT_ML_LINK_INFO_VDEV_ID_GET(_var) \
  7183. (((_var) & HTT_ML_LINK_INFO_VDEV_ID_M) >> \
  7184. HTT_ML_LINK_INFO_VDEV_ID_S)
  7185. #define HTT_ML_LINK_INFO_VDEV_ID_SET(_var, _val) \
  7186. do { \
  7187. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VDEV_ID, _val); \
  7188. ((_var) &= ~(HTT_ML_LINK_INFO_VDEV_ID_M)); \
  7189. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VDEV_ID_S)); \
  7190. } while (0)
  7191. typedef struct {
  7192. htt_tlv_hdr_t tlv_hdr;
  7193. union {
  7194. struct {
  7195. A_UINT32 valid : 1,
  7196. active : 1,
  7197. primary : 1,
  7198. assoc_link : 1,
  7199. chip_id : 3,
  7200. ieee_link_id : 8,
  7201. hw_link_id : 3,
  7202. logical_link_id : 2,
  7203. master_link : 1,
  7204. anchor_link : 1,
  7205. initialized : 1,
  7206. reserved : 9;
  7207. };
  7208. A_UINT32 msg_dword_1;
  7209. };
  7210. union {
  7211. struct {
  7212. A_UINT32 sw_peer_id : 16,
  7213. vdev_id : 8,
  7214. reserved1 : 8;
  7215. };
  7216. A_UINT32 msg_dword_2;
  7217. };
  7218. A_UINT32 primary_tid_mask;
  7219. } htt_ml_link_info_tlv;
  7220. #define HTT_ML_PEER_DETAILS_NUM_LINKS_M 0x00000003
  7221. #define HTT_ML_PEER_DETAILS_NUM_LINKS_S 0
  7222. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_M 0x00003FFC
  7223. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_S 2
  7224. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M 0x0001C000
  7225. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S 14
  7226. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M 0x00060000
  7227. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S 17
  7228. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M 0x00380000
  7229. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S 19
  7230. #define HTT_ML_PEER_DETAILS_NON_STR_M 0x00400000
  7231. #define HTT_ML_PEER_DETAILS_NON_STR_S 22
  7232. #define HTT_ML_PEER_DETAILS_EMLSR_M 0x00800000
  7233. #define HTT_ML_PEER_DETAILS_EMLSR_S 23
  7234. #define HTT_ML_PEER_DETAILS_IS_STA_KO_M 0x01000000
  7235. #define HTT_ML_PEER_DETAILS_IS_STA_KO_S 24
  7236. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M 0x06000000
  7237. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S 25
  7238. #define HTT_ML_PEER_DETAILS_ALLOCATED_M 0x08000000
  7239. #define HTT_ML_PEER_DETAILS_ALLOCATED_S 27
  7240. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M 0x000000ff
  7241. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S 0
  7242. #define HTT_ML_PEER_DETAILS_NUM_LINKS_GET(_var) \
  7243. (((_var) & HTT_ML_PEER_DETAILS_NUM_LINKS_M) >> \
  7244. HTT_ML_PEER_DETAILS_NUM_LINKS_S)
  7245. #define HTT_ML_PEER_DETAILS_NUM_LINKS_SET(_var, _val) \
  7246. do { \
  7247. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LINKS, _val); \
  7248. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LINKS_M)); \
  7249. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LINKS_S)); \
  7250. } while (0)
  7251. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_GET(_var) \
  7252. (((_var) & HTT_ML_PEER_DETAILS_ML_PEER_ID_M) >> \
  7253. HTT_ML_PEER_DETAILS_ML_PEER_ID_S)
  7254. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_SET(_var, _val) \
  7255. do { \
  7256. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ML_PEER_ID, _val); \
  7257. ((_var) &= ~(HTT_ML_PEER_DETAILS_ML_PEER_ID_M)); \
  7258. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ML_PEER_ID_S)); \
  7259. } while (0)
  7260. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var) \
  7261. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M) >> \
  7262. HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)
  7263. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_SET(_var, _val) \
  7264. do { \
  7265. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX, _val); \
  7266. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M)); \
  7267. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)); \
  7268. } while (0)
  7269. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var) \
  7270. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M) >> \
  7271. HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)
  7272. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_SET(_var, _val) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID, _val); \
  7275. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M)); \
  7276. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)); \
  7277. } while (0)
  7278. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var) \
  7279. (((_var) & HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M) >> \
  7280. HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)
  7281. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_SET(_var, _val) \
  7282. do { \
  7283. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT, _val); \
  7284. ((_var) &= ~(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M)); \
  7285. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)); \
  7286. } while (0)
  7287. #define HTT_ML_PEER_DETAILS_NON_STR_GET(_var) \
  7288. (((_var) & HTT_ML_PEER_DETAILS_NON_STR_M) >> \
  7289. HTT_ML_PEER_DETAILS_NON_STR_S)
  7290. #define HTT_ML_PEER_DETAILS_NON_STR_SET(_var, _val) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NON_STR, _val); \
  7293. ((_var) &= ~(HTT_ML_PEER_DETAILS_NON_STR_M)); \
  7294. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NON_STR_S)); \
  7295. } while (0)
  7296. #define HTT_ML_PEER_DETAILS_EMLSR_GET(_var) \
  7297. (((_var) & HTT_ML_PEER_DETAILS_EMLSR_M) >> \
  7298. HTT_ML_PEER_DETAILS_EMLSR_S)
  7299. #define HTT_ML_PEER_DETAILS_EMLSR_SET(_var, _val) \
  7300. do { \
  7301. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_EMLSR, _val); \
  7302. ((_var) &= ~(HTT_ML_PEER_DETAILS_EMLSR_M)); \
  7303. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_EMLSR_S)); \
  7304. } while (0)
  7305. #define HTT_ML_PEER_DETAILS_IS_STA_KO_GET(_var) \
  7306. (((_var) & HTT_ML_PEER_DETAILS_IS_STA_KO_M) >> \
  7307. HTT_ML_PEER_DETAILS_IS_STA_KO_S)
  7308. #define HTT_ML_PEER_DETAILS_IS_STA_KO_SET(_var, _val) \
  7309. do { \
  7310. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_IS_STA_KO, _val); \
  7311. ((_var) &= ~(HTT_ML_PEER_DETAILS_IS_STA_KO_M)); \
  7312. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_IS_STA_KO_S)); \
  7313. } while (0)
  7314. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var) \
  7315. (((_var) & HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M) >> \
  7316. HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)
  7317. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_SET(_var, _val) \
  7318. do { \
  7319. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS, _val); \
  7320. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M)); \
  7321. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)); \
  7322. } while (0)
  7323. #define HTT_ML_PEER_DETAILS_ALLOCATED_GET(_var) \
  7324. (((_var) & HTT_ML_PEER_DETAILS_ALLOCATED_M) >> \
  7325. HTT_ML_PEER_DETAILS_ALLOCATED_S)
  7326. #define HTT_ML_PEER_DETAILS_ALLOCATED_SET(_var, _val) \
  7327. do { \
  7328. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ALLOCATED, _val); \
  7329. ((_var) &= ~(HTT_ML_PEER_DETAILS_ALLOCATED_M)); \
  7330. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ALLOCATED_S)); \
  7331. } while (0)
  7332. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var) \
  7333. (((_var) & HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M) >> \
  7334. HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)
  7335. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_SET(_var, _val) \
  7336. do { \
  7337. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP, _val); \
  7338. ((_var) &= ~(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M)); \
  7339. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)); \
  7340. } while (0)
  7341. typedef struct {
  7342. htt_tlv_hdr_t tlv_hdr;
  7343. htt_mac_addr remote_mld_mac_addr;
  7344. union {
  7345. struct {
  7346. A_UINT32 num_links : 2,
  7347. ml_peer_id : 12,
  7348. primary_link_idx : 3,
  7349. primary_chip_id : 2,
  7350. link_init_count : 3,
  7351. non_str : 1,
  7352. emlsr : 1,
  7353. is_sta_ko : 1,
  7354. num_local_links : 2,
  7355. allocated : 1,
  7356. reserved : 4;
  7357. };
  7358. A_UINT32 msg_dword_1;
  7359. };
  7360. union {
  7361. struct {
  7362. A_UINT32 participating_chips_bitmap : 8,
  7363. reserved1 : 24;
  7364. };
  7365. A_UINT32 msg_dword_2;
  7366. };
  7367. /*
  7368. * ml_peer_flags is an opaque field that cannot be interpreted by
  7369. * the host; it is only for off-line debug.
  7370. */
  7371. A_UINT32 ml_peer_flags;
  7372. } htt_ml_peer_details_tlv;
  7373. /* STATS_TYPE : HTT_DBG_EXT_STATS_ML_PEERS_INFO
  7374. * TLV_TAGS:
  7375. * - HTT_STATS_ML_PEER_DETAILS_TAG
  7376. * - HTT_STATS_ML_LINK_INFO_DETAILS_TAG
  7377. * - HTT_STATS_ML_PEER_EXT_DETAILS_TAG (multiple)
  7378. */
  7379. /* NOTE:
  7380. * This structure is for documentation, and cannot be safely used directly.
  7381. * Instead, use the constituent TLV structures to fill/parse.
  7382. */
  7383. typedef struct _htt_ml_peer_stats {
  7384. htt_ml_peer_details_tlv ml_peer_details;
  7385. htt_ml_peer_ext_details_tlv ml_peer_ext_details;
  7386. htt_ml_link_info_tlv ml_link_info[];
  7387. } htt_ml_peer_stats_t;
  7388. /*
  7389. * ODD Mandatory Stats are grouped together from all the exisitng different
  7390. * stats, to form a set of stats that will be used by the ODD application to
  7391. * post the stats to the cloud instead of polling for the individual stats.
  7392. * This is done to avoid non-mandatory stats to be polled as the data will not
  7393. * be required in the recipes derivation.
  7394. * Rather than the host simply printing the ODD stats, the ODD application
  7395. * will take the buffer and map it to the odd_mandatory_stats data structure.
  7396. */
  7397. typedef struct {
  7398. htt_tlv_hdr_t tlv_hdr;
  7399. A_UINT32 hw_queued;
  7400. A_UINT32 hw_reaped;
  7401. A_UINT32 hw_paused;
  7402. A_UINT32 hw_filt;
  7403. A_UINT32 seq_posted;
  7404. A_UINT32 seq_completed;
  7405. A_UINT32 underrun;
  7406. A_UINT32 hw_flush;
  7407. A_UINT32 next_seq_posted_dsr;
  7408. A_UINT32 seq_posted_isr;
  7409. A_UINT32 mpdu_cnt_fcs_ok;
  7410. A_UINT32 mpdu_cnt_fcs_err;
  7411. A_UINT32 msdu_count_tqm;
  7412. A_UINT32 mpdu_count_tqm;
  7413. A_UINT32 mpdus_ack_failed;
  7414. A_UINT32 num_data_ppdus_tried_ota;
  7415. A_UINT32 ppdu_ok;
  7416. A_UINT32 num_total_ppdus_tried_ota;
  7417. A_UINT32 thermal_suspend_cnt;
  7418. A_UINT32 dfs_suspend_cnt;
  7419. A_UINT32 tx_abort_suspend_cnt;
  7420. A_UINT32 suspended_txq_mask;
  7421. A_UINT32 last_suspend_reason;
  7422. A_UINT32 seq_failed_queueing;
  7423. A_UINT32 seq_restarted;
  7424. A_UINT32 seq_txop_repost_stop;
  7425. A_UINT32 next_seq_cancel;
  7426. A_UINT32 seq_min_msdu_repost_stop;
  7427. A_UINT32 total_phy_err_cnt;
  7428. A_UINT32 ppdu_recvd;
  7429. A_UINT32 tcp_msdu_cnt;
  7430. A_UINT32 tcp_ack_msdu_cnt;
  7431. A_UINT32 udp_msdu_cnt;
  7432. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  7433. A_UINT32 fw_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  7434. A_UINT32 fw_ring_mpdu_err[HTT_RX_STATS_RXDMA_MAX_ERR];
  7435. A_UINT32 urrn_stats[HTT_TX_PDEV_MAX_URRN_STATS];
  7436. A_UINT32 sifs_status[HTT_TX_PDEV_MAX_SIFS_BURST_STATS];
  7437. A_UINT32 sifs_hist_status[HTT_TX_PDEV_SIFS_BURST_HIST_STATS];
  7438. A_UINT32 rx_suspend_cnt;
  7439. A_UINT32 rx_suspend_fail_cnt;
  7440. A_UINT32 rx_resume_cnt;
  7441. A_UINT32 rx_resume_fail_cnt;
  7442. A_UINT32 hwq_beacon_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  7443. A_UINT32 hwq_voice_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  7444. A_UINT32 hwq_video_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  7445. A_UINT32 hwq_best_effort_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  7446. A_UINT32 hwq_beacon_mpdu_tried_cnt;
  7447. A_UINT32 hwq_voice_mpdu_tried_cnt;
  7448. A_UINT32 hwq_video_mpdu_tried_cnt;
  7449. A_UINT32 hwq_best_effort_mpdu_tried_cnt;
  7450. A_UINT32 hwq_beacon_mpdu_queued_cnt;
  7451. A_UINT32 hwq_voice_mpdu_queued_cnt;
  7452. A_UINT32 hwq_video_mpdu_queued_cnt;
  7453. A_UINT32 hwq_best_effort_mpdu_queued_cnt;
  7454. A_UINT32 hwq_beacon_mpdu_ack_fail_cnt;
  7455. A_UINT32 hwq_voice_mpdu_ack_fail_cnt;
  7456. A_UINT32 hwq_video_mpdu_ack_fail_cnt;
  7457. A_UINT32 hwq_best_effort_mpdu_ack_fail_cnt;
  7458. A_UINT32 pdev_resets;
  7459. A_UINT32 phy_warm_reset;
  7460. A_UINT32 hwsch_reset_count;
  7461. A_UINT32 phy_warm_reset_ucode_trig;
  7462. A_UINT32 mac_cold_reset;
  7463. A_UINT32 mac_warm_reset;
  7464. A_UINT32 mac_warm_reset_restore_cal;
  7465. A_UINT32 phy_warm_reset_m3_ssr;
  7466. A_UINT32 fw_rx_rings_reset;
  7467. A_UINT32 tx_flush;
  7468. A_UINT32 hwsch_dev_reset_war;
  7469. A_UINT32 mac_cold_reset_restore_cal;
  7470. A_UINT32 mac_only_reset;
  7471. A_UINT32 mac_sfm_reset;
  7472. A_UINT32 tx_ldpc; /* Number of tx PPDUs with LDPC coding */
  7473. A_UINT32 rx_ldpc; /* Number of rx PPDUs with LDPC coding */
  7474. A_UINT32 gen_mpdu_end_reason[HTT_TX_TQM_MAX_GEN_MPDU_END_REASON];
  7475. A_UINT32 list_mpdu_end_reason[HTT_TX_TQM_MAX_LIST_MPDU_END_REASON];
  7476. 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];
  7477. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7478. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7479. A_UINT32 half_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7480. A_UINT32 quarter_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7481. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  7482. 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];
  7483. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7484. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  7485. 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];
  7486. A_UINT32 rts_cnt;
  7487. A_UINT32 rts_success;
  7488. } htt_odd_mandatory_pdev_stats_tlv;
  7489. typedef struct _htt_odd_mandatory_mumimo_pdev_stats_tlv {
  7490. htt_tlv_hdr_t tlv_hdr;
  7491. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7492. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7493. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7494. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7495. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  7496. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  7497. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  7498. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  7499. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  7500. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7501. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7502. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7503. } htt_odd_mandatory_mumimo_pdev_stats_tlv;
  7504. typedef struct _htt_odd_mandatory_muofdma_pdev_stats_tlv {
  7505. htt_tlv_hdr_t tlv_hdr;
  7506. A_UINT32 mu_ofdma_seq_posted;
  7507. A_UINT32 ul_mu_ofdma_seq_posted;
  7508. 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];
  7509. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7510. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7511. A_UINT32 ofdma_tx_ldpc;
  7512. A_UINT32 ul_ofdma_rx_ldpc;
  7513. 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];
  7514. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7515. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7516. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7517. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7518. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  7519. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  7520. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  7521. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  7522. } htt_odd_mandatory_muofdma_pdev_stats_tlv;
  7523. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M 0x000000ff
  7524. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S 0
  7525. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_GET(_var) \
  7526. (((_var) & HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M) >> \
  7527. HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)
  7528. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_SET(_var, _val) \
  7529. do { \
  7530. HTT_CHECK_SET_VAL(HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID, _val); \
  7531. ((_var) |= ((_val) << HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)); \
  7532. } while (0)
  7533. typedef struct {
  7534. htt_tlv_hdr_t tlv_hdr;
  7535. /**
  7536. * BIT [ 7 : 0] :- mac_id
  7537. * BIT [31 : 8] :- reserved
  7538. */
  7539. union {
  7540. struct {
  7541. A_UINT32 mac_id: 8,
  7542. reserved: 24;
  7543. };
  7544. A_UINT32 mac_id__word;
  7545. };
  7546. /** Num of instances where rate based DL OFDMA status = ENABLED */
  7547. A_UINT32 rate_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  7548. /** Num of instances where rate based DL OFDMA status = DISABLED */
  7549. A_UINT32 rate_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  7550. /** Num of instances where rate based DL OFDMA status = PROBING */
  7551. A_UINT32 rate_based_dlofdma_probing_count[HTT_NUM_AC_WMM];
  7552. /** Num of instances where rate based DL OFDMA status = MONITORING */
  7553. A_UINT32 rate_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  7554. /** Num of instances where avg. channel access latency based DL OFDMA status = ENABLED */
  7555. A_UINT32 chan_acc_lat_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  7556. /** Num of instances where avg. channel access latency based DL OFDMA status = DISABLED */
  7557. A_UINT32 chan_acc_lat_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  7558. /** Num of instances where avg. channel access latency based DL OFDMA status = MONITORING */
  7559. A_UINT32 chan_acc_lat_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  7560. } htt_pdev_sched_algo_ofdma_stats_tlv;
  7561. #endif /* __HTT_STATS_H__ */