htt_stats.h 231 KB

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