htt_stats.h 467 KB

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