htt_stats.h 242 KB

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