htt_stats.h 277 KB

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