htt_stats.h 326 KB

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