htt_stats.h 243 KB

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