htt_stats.h 365 KB

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