htt_stats.h 468 KB

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