htt_stats.h 404 KB

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