htt_stats.h 465 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086
  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. /* STATS_TYPE : HTT_DBG_EXT_STATS_TXBF_OFDMA
  3055. * TLV_TAGS:
  3056. * - HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG
  3057. * - HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG
  3058. * - HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG
  3059. * - HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG
  3060. * - HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG
  3061. * - HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG
  3062. * - HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG
  3063. * - HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG
  3064. * - HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG
  3065. * - HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG
  3066. */
  3067. typedef struct {
  3068. htt_tlv_hdr_t tlv_hdr;
  3069. /** 11AC VHT SU NDP frame completed with error(s) */
  3070. A_UINT32 ac_su_ndp_err;
  3071. /** 11AC VHT SU NDPA frame completed with error(s) */
  3072. A_UINT32 ac_su_ndpa_err;
  3073. /** 11AC VHT MU MIMO NDPA frame completed with error(s) */
  3074. A_UINT32 ac_mu_mimo_ndpa_err;
  3075. /** 11AC VHT MU MIMO NDP frame completed with error(s) */
  3076. A_UINT32 ac_mu_mimo_ndp_err;
  3077. /** 11AC VHT MU MIMO BRPOLL for user 1 frame completed with error(s) */
  3078. A_UINT32 ac_mu_mimo_brp1_err;
  3079. /** 11AC VHT MU MIMO BRPOLL for user 2 frame completed with error(s) */
  3080. A_UINT32 ac_mu_mimo_brp2_err;
  3081. /** 11AC VHT MU MIMO BRPOLL for user 3 frame completed with error(s) */
  3082. A_UINT32 ac_mu_mimo_brp3_err;
  3083. /** 11AC VHT SU NDPA frame flushed by HW */
  3084. A_UINT32 ac_su_ndpa_flushed;
  3085. /** 11AC VHT SU NDP frame flushed by HW */
  3086. A_UINT32 ac_su_ndp_flushed;
  3087. /** 11AC VHT MU MIMO NDPA frame flushed by HW */
  3088. A_UINT32 ac_mu_mimo_ndpa_flushed;
  3089. /** 11AC VHT MU MIMO NDP frame flushed by HW */
  3090. A_UINT32 ac_mu_mimo_ndp_flushed;
  3091. /** 11AC VHT MU MIMO BRPOLL for user 1 frame flushed by HW */
  3092. A_UINT32 ac_mu_mimo_brpoll1_flushed;
  3093. /** 11AC VHT MU MIMO BRPOLL for user 2 frame flushed by HW */
  3094. A_UINT32 ac_mu_mimo_brpoll2_flushed;
  3095. /** 11AC VHT MU MIMO BRPOLL for user 3 frame flushed by HW */
  3096. A_UINT32 ac_mu_mimo_brpoll3_flushed;
  3097. } htt_stats_tx_selfgen_ac_err_stats_tlv;
  3098. /* preserve old name alias for new name consistent with the tag name */
  3099. typedef htt_stats_tx_selfgen_ac_err_stats_tlv htt_tx_selfgen_ac_err_stats_tlv;
  3100. typedef struct {
  3101. htt_tlv_hdr_t tlv_hdr;
  3102. /** 11AX HE SU NDP frame completed with error(s) */
  3103. A_UINT32 ax_su_ndp_err;
  3104. /** 11AX HE SU NDPA frame completed with error(s) */
  3105. A_UINT32 ax_su_ndpa_err;
  3106. /** 11AX HE MU MIMO NDPA frame completed with error(s) */
  3107. A_UINT32 ax_mu_mimo_ndpa_err;
  3108. /** 11AX HE MU MIMO NDP frame completed with error(s) */
  3109. A_UINT32 ax_mu_mimo_ndp_err;
  3110. union {
  3111. struct {
  3112. /* deprecated old names */
  3113. A_UINT32 ax_mu_mimo_brp1_err;
  3114. A_UINT32 ax_mu_mimo_brp2_err;
  3115. A_UINT32 ax_mu_mimo_brp3_err;
  3116. A_UINT32 ax_mu_mimo_brp4_err;
  3117. A_UINT32 ax_mu_mimo_brp5_err;
  3118. A_UINT32 ax_mu_mimo_brp6_err;
  3119. A_UINT32 ax_mu_mimo_brp7_err;
  3120. };
  3121. /** 11AX HE MU BR-POLL frame for 1 - 7 users completed with error(s) */
  3122. A_UINT32 ax_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  3123. };
  3124. /** 11AX HE MU Basic Trigger frame completed with error(s) */
  3125. A_UINT32 ax_basic_trigger_err;
  3126. /** 11AX HE MU BSRP Trigger frame completed with error(s) */
  3127. A_UINT32 ax_bsr_trigger_err;
  3128. /** 11AX HE MU BAR Trigger frame completed with error(s) */
  3129. A_UINT32 ax_mu_bar_trigger_err;
  3130. /** 11AX HE MU RTS Trigger frame completed with error(s) */
  3131. A_UINT32 ax_mu_rts_trigger_err;
  3132. /** 11AX HE MU ULMUMIMO Trigger frame completed with error(s) */
  3133. A_UINT32 ax_ulmumimo_trigger_err;
  3134. /**
  3135. * Number of CBF(s) received when 11AX HE MU MIMO BRPOLL
  3136. * frame completed with error(s)
  3137. */
  3138. A_UINT32 ax_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3139. /** 11AX HE SU NDPA frame flushed by HW */
  3140. A_UINT32 ax_su_ndpa_flushed;
  3141. /** 11AX HE SU NDP frame flushed by HW */
  3142. A_UINT32 ax_su_ndp_flushed;
  3143. /** 11AX HE MU MIMO NDPA frame flushed by HW */
  3144. A_UINT32 ax_mu_mimo_ndpa_flushed;
  3145. /** 11AX HE MU MIMO NDP frame flushed by HW */
  3146. A_UINT32 ax_mu_mimo_ndp_flushed;
  3147. /** 11AX HE MU BR-POLL frame for users 1 - 7 flushed by HW */
  3148. A_UINT32 ax_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  3149. /**
  3150. * 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  3151. */
  3152. A_UINT32 ax_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3153. /** 11AX HE MU OFDMA Basic Trigger frame completed with partial user response */
  3154. A_UINT32 ax_basic_trigger_partial_resp;
  3155. /** 11AX HE MU BSRP Trigger frame completed with partial user response */
  3156. A_UINT32 ax_bsr_trigger_partial_resp;
  3157. /** 11AX HE MU BAR Trigger frame completed with partial user response */
  3158. A_UINT32 ax_mu_bar_trigger_partial_resp;
  3159. } htt_stats_tx_selfgen_ax_err_stats_tlv;
  3160. /* preserve old name alias for new name consistent with the tag name */
  3161. typedef htt_stats_tx_selfgen_ax_err_stats_tlv htt_tx_selfgen_ax_err_stats_tlv;
  3162. typedef struct {
  3163. htt_tlv_hdr_t tlv_hdr;
  3164. /** 11BE EHT SU NDP frame completed with error(s) */
  3165. A_UINT32 be_su_ndp_err;
  3166. /** 11BE EHT SU NDPA frame completed with error(s) */
  3167. A_UINT32 be_su_ndpa_err;
  3168. /** 11BE EHT MU MIMO NDPA frame completed with error(s) */
  3169. A_UINT32 be_mu_mimo_ndpa_err;
  3170. /** 11BE EHT MU MIMO NDP frame completed with error(s) */
  3171. A_UINT32 be_mu_mimo_ndp_err;
  3172. /** 11BE EHT MU BR-POLL frame for 1 - 7 users completed with error(s) */
  3173. A_UINT32 be_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  3174. /** 11BE EHT MU Basic Trigger frame completed with error(s) */
  3175. A_UINT32 be_basic_trigger_err;
  3176. /** 11BE EHT MU BSRP Trigger frame completed with error(s) */
  3177. A_UINT32 be_bsr_trigger_err;
  3178. /** 11BE EHT MU BAR Trigger frame completed with error(s) */
  3179. A_UINT32 be_mu_bar_trigger_err;
  3180. /** 11BE EHT MU RTS Trigger frame completed with error(s) */
  3181. A_UINT32 be_mu_rts_trigger_err;
  3182. /** 11BE EHT MU ULMUMIMO Trigger frame completed with error(s) */
  3183. A_UINT32 be_ulmumimo_trigger_err;
  3184. /**
  3185. * Number of CBF(s) received when 11BE EHT MU MIMO BRPOLL frame
  3186. * completed with error(s)
  3187. */
  3188. A_UINT32 be_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3189. /** 11BE EHT SU NDPA frame flushed by HW */
  3190. A_UINT32 be_su_ndpa_flushed;
  3191. /** 11BE EHT SU NDP frame flushed by HW */
  3192. A_UINT32 be_su_ndp_flushed;
  3193. /** 11BE EHT MU MIMO NDPA frame flushed by HW */
  3194. A_UINT32 be_mu_mimo_ndpa_flushed;
  3195. /** 11BE HT MU MIMO NDP frame flushed by HW */
  3196. A_UINT32 be_mu_mimo_ndp_flushed;
  3197. /** 11BE EHT MU BR-POLL frame for users 1 - 7 flushed by HW */
  3198. A_UINT32 be_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  3199. /**
  3200. * 11BE EHT UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s)
  3201. */
  3202. A_UINT32 be_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3203. /** 11BE EHT MU OFDMA Basic Trigger frame completed with partial user response */
  3204. A_UINT32 be_basic_trigger_partial_resp;
  3205. /** 11BE EHT MU BSRP Trigger frame completed with partial user response */
  3206. A_UINT32 be_bsr_trigger_partial_resp;
  3207. /** 11BE EHT MU BAR Trigger frame completed with partial user response */
  3208. A_UINT32 be_mu_bar_trigger_partial_resp;
  3209. /** 11BE EHT MU RTS Trigger frame blocked due to partner link TX/RX(eMLSR) */
  3210. A_UINT32 be_mu_rts_trigger_blocked;
  3211. /** 11BE EHT MU BSR Trigger frame blocked due to partner link TX/RX(eMLSR) */
  3212. A_UINT32 be_bsr_trigger_blocked;
  3213. } htt_stats_tx_selfgen_be_err_stats_tlv;
  3214. /* preserve old name alias for new name consistent with the tag name */
  3215. typedef htt_stats_tx_selfgen_be_err_stats_tlv htt_tx_selfgen_be_err_stats_tlv;
  3216. /*
  3217. * Scheduler completion status reason code.
  3218. * (0) HTT_TXERR_NONE - No error (Success).
  3219. * (1) HTT_TXERR_RESP - Response timeout, response mismatch, BW mismatch,
  3220. * MIMO control mismatch, CRC error etc.
  3221. * (2) HTT_TXERR_FILT - Blocked by HW tx filtering.
  3222. * (3) HTT_TXERR_FIFO - FIFO, misc. errors in HW.
  3223. * (4) HTT_TXERR_SWABORT - Software initialted abort (TX_ABORT).
  3224. * (5) HTT_TXERR_RESERVED1 - Currently reserved.
  3225. * (6) HTT_TXERR_RESERVED2 - Currently reserved.
  3226. */
  3227. /* Scheduler error code.
  3228. * (0) HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR - Flush received from HW.
  3229. * (1) HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR - Scheduler command was
  3230. * filtered by HW.
  3231. * (2) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR - Response frame mismatch
  3232. * error.
  3233. * (3) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR - CBF
  3234. * received with MIMO control mismatch.
  3235. * (4) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR - CBF received with
  3236. * BW mismatch.
  3237. * (5) HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR - Error in transmitting
  3238. * frame even after maximum retries.
  3239. * (6) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR - Response frame
  3240. * received outside RX window.
  3241. * (7) HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR - No frame
  3242. * received by HW for queuing within SIFS interval.
  3243. */
  3244. typedef struct {
  3245. htt_tlv_hdr_t tlv_hdr;
  3246. /** 11AC VHT SU NDPA scheduler completion status reason code */
  3247. A_UINT32 ac_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3248. /** 11AC VHT SU NDP scheduler completion status reason code */
  3249. A_UINT32 ac_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3250. /** 11AC VHT SU NDP scheduler error code */
  3251. A_UINT32 ac_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3252. /** 11AC VHT MU MIMO NDPA scheduler completion status reason code */
  3253. A_UINT32 ac_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3254. /** 11AC VHT MU MIMO NDP scheduler completion status reason code */
  3255. A_UINT32 ac_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3256. /** 11AC VHT MU MIMO NDP scheduler error code */
  3257. A_UINT32 ac_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3258. /** 11AC VHT MU MIMO BRPOLL scheduler completion status reason code */
  3259. A_UINT32 ac_mu_mimo_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3260. /** 11AC VHT MU MIMO BRPOLL scheduler error code */
  3261. A_UINT32 ac_mu_mimo_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3262. } htt_stats_tx_selfgen_ac_sched_status_stats_tlv;
  3263. /* preserve old name alias for new name consistent with the tag name */
  3264. typedef htt_stats_tx_selfgen_ac_sched_status_stats_tlv
  3265. htt_tx_selfgen_ac_sched_status_stats_tlv;
  3266. typedef struct {
  3267. htt_tlv_hdr_t tlv_hdr;
  3268. /** 11AX HE SU NDPA scheduler completion status reason code */
  3269. A_UINT32 ax_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3270. /** 11AX SU NDP scheduler completion status reason code */
  3271. A_UINT32 ax_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3272. /** 11AX HE SU NDP scheduler error code */
  3273. A_UINT32 ax_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3274. /** 11AX HE MU MIMO NDPA scheduler completion status reason code */
  3275. A_UINT32 ax_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3276. /** 11AX HE MU MIMO NDP scheduler completion status reason code */
  3277. A_UINT32 ax_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3278. /** 11AX HE MU MIMO NDP scheduler error code */
  3279. A_UINT32 ax_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3280. /** 11AX HE MU MIMO MU BRPOLL scheduler completion status reason code */
  3281. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3282. /** 11AX HE MU MIMO MU BRPOLL scheduler error code */
  3283. A_UINT32 ax_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3284. /** 11AX HE MU BAR scheduler completion status reason code */
  3285. A_UINT32 ax_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3286. /** 11AX HE MU BAR scheduler error code */
  3287. A_UINT32 ax_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3288. /**
  3289. * 11AX HE UL OFDMA Basic Trigger scheduler completion status reason code
  3290. */
  3291. A_UINT32 ax_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3292. /** 11AX HE UL OFDMA Basic Trigger scheduler error code */
  3293. A_UINT32 ax_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3294. /**
  3295. * 11AX HE UL MUMIMO Basic Trigger scheduler completion status reason code
  3296. */
  3297. A_UINT32 ax_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3298. /** 11AX HE UL MUMIMO Basic Trigger scheduler error code */
  3299. A_UINT32 ax_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3300. } htt_stats_tx_selfgen_ax_sched_status_stats_tlv;
  3301. /* preserve old name alias for new name consistent with the tag name */
  3302. typedef htt_stats_tx_selfgen_ax_sched_status_stats_tlv
  3303. htt_tx_selfgen_ax_sched_status_stats_tlv;
  3304. typedef struct {
  3305. htt_tlv_hdr_t tlv_hdr;
  3306. /** 11BE EHT SU NDPA scheduler completion status reason code */
  3307. A_UINT32 be_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3308. /** 11BE SU NDP scheduler completion status reason code */
  3309. A_UINT32 be_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3310. /** 11BE EHT SU NDP scheduler error code */
  3311. A_UINT32 be_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3312. /** 11BE EHT MU MIMO NDPA scheduler completion status reason code */
  3313. A_UINT32 be_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3314. /** 11BE EHT MU MIMO NDP scheduler completion status reason code */
  3315. A_UINT32 be_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3316. /** 11BE EHT MU MIMO NDP scheduler error code */
  3317. A_UINT32 be_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3318. /** 11BE EHT MU MIMO MU BRPOLL scheduler completion status reason code */
  3319. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3320. /** 11BE EHT MU MIMO MU BRPOLL scheduler error code */
  3321. A_UINT32 be_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3322. /** 11BE EHT MU BAR scheduler completion status reason code */
  3323. A_UINT32 be_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3324. /** 11BE EHT MU BAR scheduler error code */
  3325. A_UINT32 be_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3326. /**
  3327. * 11BE EHT UL OFDMA Basic Trigger scheduler completion status reason code
  3328. */
  3329. A_UINT32 be_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3330. /** 11BE EHT UL OFDMA Basic Trigger scheduler error code */
  3331. A_UINT32 be_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3332. /**
  3333. * 11BE EHT UL MUMIMO Basic Trigger scheduler completion status reason code
  3334. */
  3335. A_UINT32 be_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  3336. /** 11BE EHT UL MUMIMO Basic Trigger scheduler error code */
  3337. A_UINT32 be_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  3338. } htt_stats_tx_selfgen_be_sched_status_stats_tlv;
  3339. /* preserve old name alias for new name consistent with the tag name */
  3340. typedef htt_stats_tx_selfgen_be_sched_status_stats_tlv
  3341. htt_tx_selfgen_be_sched_status_stats_tlv;
  3342. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  3343. * TLV_TAGS:
  3344. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  3345. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  3346. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  3347. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  3348. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  3349. * - HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG
  3350. * - HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG
  3351. * - HTT_STATS_TX_SELFGEN_BE_STATS_TAG
  3352. * - HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG
  3353. * - HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG
  3354. */
  3355. /* NOTE:
  3356. * This structure is for documentation, and cannot be safely used directly.
  3357. * Instead, use the constituent TLV structures to fill/parse.
  3358. */
  3359. #ifdef ATH_TARGET
  3360. typedef struct {
  3361. htt_stats_tx_selfgen_cmn_stats_tlv cmn_tlv;
  3362. htt_stats_tx_selfgen_ac_stats_tlv ac_tlv;
  3363. htt_stats_tx_selfgen_ax_stats_tlv ax_tlv;
  3364. htt_stats_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  3365. htt_stats_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  3366. htt_stats_tx_selfgen_ac_sched_status_stats_tlv ac_sched_status_tlv;
  3367. htt_stats_tx_selfgen_ax_sched_status_stats_tlv ax_sched_status_tlv;
  3368. htt_stats_tx_selfgen_be_stats_tlv be_tlv;
  3369. htt_stats_tx_selfgen_be_err_stats_tlv be_err_tlv;
  3370. htt_stats_tx_selfgen_be_sched_status_stats_tlv be_sched_status_tlv;
  3371. } htt_tx_pdev_selfgen_stats_t;
  3372. #endif /* ATH_TARGET */
  3373. /* == TX MU STATS == */
  3374. typedef struct {
  3375. htt_tlv_hdr_t tlv_hdr;
  3376. /** Number of MU MIMO schedules posted to HW */
  3377. A_UINT32 mu_mimo_sch_posted;
  3378. /** Number of MU MIMO schedules failed to post */
  3379. A_UINT32 mu_mimo_sch_failed;
  3380. /** Number of MU MIMO PPDUs posted to HW */
  3381. A_UINT32 mu_mimo_ppdu_posted;
  3382. /*
  3383. * This is the common description for the below sch stats.
  3384. * Counts the number of transmissions of each number of MU users
  3385. * in each TX mode.
  3386. * The array index is the "number of users - 1".
  3387. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  3388. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  3389. * TX PPDUs and so on.
  3390. * The same is applicable for the other TX mode stats.
  3391. */
  3392. /** Represents the count for 11AC DL MU MIMO sequences */
  3393. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3394. /** Represents the count for 11AX DL MU MIMO sequences */
  3395. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3396. /** Represents the count for 11AX DL MU OFDMA sequences */
  3397. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3398. /**
  3399. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  3400. */
  3401. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3402. /** Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  3403. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3404. /** Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  3405. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3406. /** Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  3407. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3408. /**
  3409. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  3410. */
  3411. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3412. /** Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  3413. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3414. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  3415. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3416. /** Number of 11AX DL MU MIMO schedules posted per group size */
  3417. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3418. /** Represents the count for 11BE DL MU MIMO sequences */
  3419. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3420. /** Number of 11BE DL MU MIMO schedules posted per group size */
  3421. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3422. /** Number of 11AC DL MU MIMO schedules posted per group size (4-7) */
  3423. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3424. } htt_stats_tx_pdev_mu_mimo_stats_tlv;
  3425. /* preserve old name alias for new name consistent with the tag name */
  3426. typedef htt_stats_tx_pdev_mu_mimo_stats_tlv htt_tx_pdev_mu_mimo_sch_stats_tlv;
  3427. typedef struct {
  3428. htt_tlv_hdr_t tlv_hdr;
  3429. A_UINT32 dl_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3430. A_UINT32 dl_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3431. A_UINT32 dl_mumimo_grp_eligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3432. A_UINT32 dl_mumimo_grp_ineligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3433. A_UINT32 dl_mumimo_grp_invalid[HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS];
  3434. A_UINT32 dl_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  3435. A_UINT32 ul_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  3436. A_UINT32 ul_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3437. A_UINT32 ul_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  3438. } htt_stats_tx_pdev_mumimo_grp_stats_tlv;
  3439. /* preserve old name alias for new name consistent with the tag name */
  3440. typedef htt_stats_tx_pdev_mumimo_grp_stats_tlv htt_tx_pdev_mumimo_grp_stats_tlv;
  3441. typedef struct {
  3442. htt_tlv_hdr_t tlv_hdr;
  3443. /** Number of MU MIMO schedules posted to HW */
  3444. A_UINT32 mu_mimo_sch_posted;
  3445. /** Number of MU MIMO schedules failed to post */
  3446. A_UINT32 mu_mimo_sch_failed;
  3447. /** Number of MU MIMO PPDUs posted to HW */
  3448. A_UINT32 mu_mimo_ppdu_posted;
  3449. /*
  3450. * This is the common description for the below sch stats.
  3451. * Counts the number of transmissions of each number of MU users
  3452. * in each TX mode.
  3453. * The array index is the "number of users - 1".
  3454. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  3455. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  3456. * TX PPDUs and so on.
  3457. * The same is applicable for the other TX mode stats.
  3458. */
  3459. /** Represents the count for 11AC DL MU MIMO sequences */
  3460. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3461. /** Represents the count for 11AX DL MU MIMO sequences */
  3462. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3463. /** Number of 11AC DL MU MIMO schedules posted per group size (0-3) */
  3464. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3465. /** Number of 11AX DL MU MIMO schedules posted per group size */
  3466. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  3467. /** Represents the count for 11BE DL MU MIMO sequences */
  3468. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3469. /** Number of 11BE DL MU MIMO schedules posted per group size */
  3470. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  3471. /** Number of 11AC DL MU MIMO schedules posted per group size (4 - 7)*/
  3472. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz_ext[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  3473. } htt_stats_tx_pdev_dl_mu_mimo_stats_tlv;
  3474. /* preserve old name alias for new name consistent with the tag name */
  3475. typedef htt_stats_tx_pdev_dl_mu_mimo_stats_tlv
  3476. htt_tx_pdev_dl_mu_mimo_sch_stats_tlv;
  3477. typedef struct {
  3478. htt_tlv_hdr_t tlv_hdr;
  3479. /** Represents the count for 11AX DL MU OFDMA sequences */
  3480. A_UINT32 ax_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3481. } htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv;
  3482. /* preserve old name alias for new name consistent with the tag name */
  3483. typedef htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv
  3484. htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv;
  3485. typedef struct {
  3486. htt_tlv_hdr_t tlv_hdr;
  3487. /** Represents the count for 11BE DL MU OFDMA sequences */
  3488. A_UINT32 be_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3489. } htt_stats_tx_pdev_be_dl_mu_ofdma_stats_tlv;
  3490. /* preserve old name alias for new name consistent with the tag name */
  3491. typedef htt_stats_tx_pdev_be_dl_mu_ofdma_stats_tlv
  3492. htt_tx_pdev_be_dl_mu_ofdma_sch_stats_tlv;
  3493. typedef struct {
  3494. htt_tlv_hdr_t tlv_hdr;
  3495. /**
  3496. * Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers
  3497. */
  3498. A_UINT32 ax_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3499. /**
  3500. * Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers
  3501. */
  3502. A_UINT32 ax_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3503. /**
  3504. * Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers
  3505. */
  3506. A_UINT32 ax_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3507. /**
  3508. * Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers
  3509. */
  3510. A_UINT32 ax_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3511. } htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv;
  3512. /* preserve old name alias for new name consistent with the tag name */
  3513. typedef htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv
  3514. htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv;
  3515. typedef struct {
  3516. htt_tlv_hdr_t tlv_hdr;
  3517. /**
  3518. * Represents the count for 11BE UL MU OFDMA sequences with Basic Triggers
  3519. */
  3520. A_UINT32 be_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3521. /**
  3522. * Represents the count for 11BE UL MU OFDMA sequences with BSRP Triggers
  3523. */
  3524. A_UINT32 be_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3525. /**
  3526. * Represents the count for 11BE UL MU OFDMA sequences with BAR Triggers
  3527. */
  3528. A_UINT32 be_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3529. /**
  3530. * Represents the count for 11BE UL MU OFDMA sequences with BRP Triggers
  3531. */
  3532. A_UINT32 be_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  3533. } htt_stats_tx_pdev_be_ul_mu_ofdma_stats_tlv;
  3534. /* preserve old name alias for new name consistent with the tag name */
  3535. typedef htt_stats_tx_pdev_be_ul_mu_ofdma_stats_tlv
  3536. htt_tx_pdev_be_ul_mu_ofdma_sch_stats_tlv;
  3537. typedef struct {
  3538. htt_tlv_hdr_t tlv_hdr;
  3539. /**
  3540. * Represents the count for 11AX UL MU MIMO sequences with Basic Triggers
  3541. */
  3542. A_UINT32 ax_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3543. /**
  3544. * Represents the count for 11AX UL MU MIMO sequences with BRP Triggers
  3545. */
  3546. A_UINT32 ax_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3547. } htt_stats_tx_pdev_ul_mu_mimo_stats_tlv;
  3548. /* preserve old name alias for new name consistent with the tag name */
  3549. typedef htt_stats_tx_pdev_ul_mu_mimo_stats_tlv
  3550. htt_tx_pdev_ul_mu_mimo_sch_stats_tlv;
  3551. typedef struct {
  3552. htt_tlv_hdr_t tlv_hdr;
  3553. /**
  3554. * Represents the count for 11BE UL MU MIMO sequences with Basic Triggers
  3555. */
  3556. A_UINT32 be_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3557. /**
  3558. * Represents the count for 11BE UL MU MIMO sequences with BRP Triggers
  3559. */
  3560. A_UINT32 be_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  3561. } htt_stats_tx_pdev_be_ul_mu_mimo_stats_tlv;
  3562. /* preserve old name alias for new name consistent with the tag name */
  3563. typedef htt_stats_tx_pdev_be_ul_mu_mimo_stats_tlv
  3564. htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv;
  3565. typedef struct {
  3566. htt_tlv_hdr_t tlv_hdr;
  3567. /** 11AC DL MU MIMO number of mpdus queued to HW, per user */
  3568. A_UINT32 mu_mimo_mpdus_queued_usr;
  3569. /** 11AC DL MU MIMO number of mpdus tried over the air, per user */
  3570. A_UINT32 mu_mimo_mpdus_tried_usr;
  3571. /** 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  3572. A_UINT32 mu_mimo_mpdus_failed_usr;
  3573. /** 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  3574. A_UINT32 mu_mimo_mpdus_requeued_usr;
  3575. /** 11AC DL MU MIMO BA not received, per user */
  3576. A_UINT32 mu_mimo_err_no_ba_usr;
  3577. /** 11AC DL MU MIMO mpdu underrun encountered, per user */
  3578. A_UINT32 mu_mimo_mpdu_underrun_usr;
  3579. /** 11AC DL MU MIMO ampdu underrun encountered, per user */
  3580. A_UINT32 mu_mimo_ampdu_underrun_usr;
  3581. /** 11AX MU MIMO number of mpdus queued to HW, per user */
  3582. A_UINT32 ax_mu_mimo_mpdus_queued_usr;
  3583. /** 11AX MU MIMO number of mpdus tried over the air, per user */
  3584. A_UINT32 ax_mu_mimo_mpdus_tried_usr;
  3585. /** 11AX DL MU MIMO number of mpdus failed acknowledgement, per user */
  3586. A_UINT32 ax_mu_mimo_mpdus_failed_usr;
  3587. /** 11AX DL MU MIMO number of mpdus re-queued to HW, per user */
  3588. A_UINT32 ax_mu_mimo_mpdus_requeued_usr;
  3589. /** 11AX DL MU MIMO BA not received, per user */
  3590. A_UINT32 ax_mu_mimo_err_no_ba_usr;
  3591. /** 11AX DL MU MIMO mpdu underrun encountered, per user */
  3592. A_UINT32 ax_mu_mimo_mpdu_underrun_usr;
  3593. /** 11AX DL MU MIMO ampdu underrun encountered, per user */
  3594. A_UINT32 ax_mu_mimo_ampdu_underrun_usr;
  3595. /** 11AX MU OFDMA number of mpdus queued to HW, per user */
  3596. A_UINT32 ax_ofdma_mpdus_queued_usr;
  3597. /** 11AX MU OFDMA number of mpdus tried over the air, per user */
  3598. A_UINT32 ax_ofdma_mpdus_tried_usr;
  3599. /** 11AX MU OFDMA number of mpdus failed acknowledgement, per user */
  3600. A_UINT32 ax_ofdma_mpdus_failed_usr;
  3601. /** 11AX MU OFDMA number of mpdus re-queued to HW, per user */
  3602. A_UINT32 ax_ofdma_mpdus_requeued_usr;
  3603. /** 11AX MU OFDMA BA not received, per user */
  3604. A_UINT32 ax_ofdma_err_no_ba_usr;
  3605. /** 11AX MU OFDMA mpdu underrun encountered, per user */
  3606. A_UINT32 ax_ofdma_mpdu_underrun_usr;
  3607. /** 11AX MU OFDMA ampdu underrun encountered, per user */
  3608. A_UINT32 ax_ofdma_ampdu_underrun_usr;
  3609. } htt_stats_tx_pdev_mumimo_mpdu_stats_tlv;
  3610. /* preserve old name alias for new name consistent with the tag name */
  3611. typedef htt_stats_tx_pdev_mumimo_mpdu_stats_tlv
  3612. htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  3613. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  3614. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  3615. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  3616. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_BE 4 /* SCHED_TX_MODE_MU_OFDMA_BE */
  3617. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_BE 5 /* SCHED_TX_MODE_MU_MIMO_BE */
  3618. typedef struct {
  3619. htt_tlv_hdr_t tlv_hdr;
  3620. /* mpdu level stats */
  3621. A_UINT32 mpdus_queued_usr;
  3622. A_UINT32 mpdus_tried_usr;
  3623. A_UINT32 mpdus_failed_usr;
  3624. A_UINT32 mpdus_requeued_usr;
  3625. A_UINT32 err_no_ba_usr;
  3626. A_UINT32 mpdu_underrun_usr;
  3627. A_UINT32 ampdu_underrun_usr;
  3628. A_UINT32 user_index;
  3629. /** HTT_STATS_TX_SCHED_MODE_xxx */
  3630. A_UINT32 tx_sched_mode;
  3631. } htt_stats_tx_pdev_mpdu_stats_tlv;
  3632. /* preserve old name alias for new name consistent with the tag name */
  3633. typedef htt_stats_tx_pdev_mpdu_stats_tlv htt_tx_pdev_mpdu_stats_tlv;
  3634. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  3635. * TLV_TAGS:
  3636. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  3637. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  3638. */
  3639. /* NOTE:
  3640. * This structure is for documentation, and cannot be safely used directly.
  3641. * Instead, use the constituent TLV structures to fill/parse.
  3642. */
  3643. #ifdef ATH_TARGET
  3644. typedef struct {
  3645. htt_stats_tx_pdev_mu_mimo_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  3646. htt_stats_tx_pdev_dl_mu_mimo_stats_tlv dl_mu_mimo_sch_stats_tlv[1];
  3647. htt_stats_tx_pdev_ul_mu_mimo_stats_tlv ul_mu_mimo_sch_stats_tlv[1];
  3648. htt_stats_tx_pdev_dl_mu_ofdma_stats_tlv dl_mu_ofdma_sch_stats_tlv[1];
  3649. htt_stats_tx_pdev_ul_mu_ofdma_stats_tlv ul_mu_ofdma_sch_stats_tlv[1];
  3650. /*
  3651. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  3652. * it can also hold MU-OFDMA stats.
  3653. */
  3654. htt_stats_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  3655. htt_stats_tx_pdev_mumimo_grp_stats_tlv mumimo_grp_stats_tlv;
  3656. } htt_tx_pdev_mu_mimo_stats_t;
  3657. #endif /* ATH_TARGET */
  3658. /* == TX SCHED STATS == */
  3659. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3660. /* NOTE: Variable length TLV, use length spec to infer array size */
  3661. typedef struct {
  3662. htt_tlv_hdr_t tlv_hdr;
  3663. /** Scheduler command posted per tx_mode */
  3664. A_UINT32 sched_cmd_posted[1/* length = num tx modes */];
  3665. } htt_stats_sched_txq_cmd_posted_tlv;
  3666. /* preserve old name alias for new name consistent with the tag name */
  3667. typedef htt_stats_sched_txq_cmd_posted_tlv htt_sched_txq_cmd_posted_tlv_v;
  3668. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3669. /* NOTE: Variable length TLV, use length spec to infer array size */
  3670. typedef struct {
  3671. htt_tlv_hdr_t tlv_hdr;
  3672. /** Scheduler command reaped per tx_mode */
  3673. A_UINT32 sched_cmd_reaped[1/* length = num tx modes */];
  3674. } htt_stats_sched_txq_cmd_reaped_tlv;
  3675. /* preserve old name alias for new name consistent with the tag name */
  3676. typedef htt_stats_sched_txq_cmd_reaped_tlv htt_sched_txq_cmd_reaped_tlv_v;
  3677. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3678. /* NOTE: Variable length TLV, use length spec to infer array size */
  3679. typedef struct {
  3680. htt_tlv_hdr_t tlv_hdr;
  3681. /**
  3682. * sched_order_su contains the peer IDs of peers chosen in the last
  3683. * NUM_SCHED_ORDER_LOG scheduler instances.
  3684. * The array is circular; it's unspecified which array element corresponds
  3685. * to the most recent scheduler invocation, and which corresponds to
  3686. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  3687. *
  3688. * HTT_TX_PDEV_NUM_SCHED_ORDER_LOG
  3689. */
  3690. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sched_order_su);
  3691. } htt_stats_sched_txq_sched_order_su_tlv;
  3692. /* preserve old name alias for new name consistent with the tag name */
  3693. typedef htt_stats_sched_txq_sched_order_su_tlv htt_sched_txq_sched_order_su_tlv_v;
  3694. typedef struct {
  3695. htt_tlv_hdr_t tlv_hdr;
  3696. A_UINT32 htt_stats_type;
  3697. } htt_stats_error_tlv_v;
  3698. typedef enum {
  3699. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  3700. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  3701. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  3702. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  3703. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  3704. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  3705. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  3706. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  3707. HTT_SCHED_TID_SKIP_NO_DATA, /* Skip tid without data */
  3708. HTT_SCHED_TID_SKIP_NO_ENQ = HTT_SCHED_TID_SKIP_NO_DATA, /* deprecated old name */
  3709. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  3710. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  3711. HTT_SCHED_TID_SKIP_UL_RESP, /* skip UL response tid */
  3712. HTT_SCHED_TID_SKIP_UL = HTT_SCHED_TID_SKIP_UL_RESP, /* deprecated old name */
  3713. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  3714. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  3715. HTT_SCHED_TID_REMOVE_UL_RESP, /* Remove tid UL response */
  3716. HTT_SCHED_TID_REMOVE_UL = HTT_SCHED_TID_REMOVE_UL_RESP, /* deprecated old name */
  3717. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  3718. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  3719. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  3720. HTT_SCHED_TID_SKIP_EXCEPT_EAPOL, /* skip tid except eapol */
  3721. HTT_SCHED_TID_SU_LOW_PRI_ONLY, /* su low priority tid only */
  3722. HTT_SCHED_TID_SKIP_SOUND_IN_PROGRESS, /* skip tid sound in progress */
  3723. HTT_SCHED_TID_SKIP_NO_UL_DATA, /* skip ul tid when no ul data */
  3724. HTT_SCHED_TID_REMOVE_UL_NOT_CAPABLE, /* Remove tid that are not UL capable */
  3725. HTT_SCHED_TID_UL_ELIGIBLE, /* Tid is eligible for UL scheduling */
  3726. HTT_SCHED_TID_FALLBACK_TO_PREV_DECISION, /* Fall back to previous decision */
  3727. HTT_SCHED_TID_SKIP_PEER_ALREADY_IN_TXQ, /* skip tid, peer is already available in the txq */
  3728. HTT_SCHED_TID_SKIP_DELAY_UL_SCHED, /* skip tid delay UL schedule */
  3729. HTT_SCHED_TID_SKIP_PWR_SAVE_STATE_OFF, /* Limit UL scheduling to primary link if not in power save state */
  3730. HTT_SCHED_TID_SKIP_TWT_SUSPEND, /* Skip UL trigger for certain cases ex TWT suspend */
  3731. HTT_SCHED_TID_SKIP_DISABLE_160MHZ_OFDMA, /* Skip ul tid if peer supports 160MHZ */
  3732. HTT_SCHED_TID_SKIP_ULMU_DISABLE_FROM_OMI, /* Skip ul tid if sta send omi to indicate to disable UL mu data */
  3733. HTT_SCHED_TID_SKIP_UL_MAX_SCHED_CMD_EXCEEDED,/* skip ul tid if max sched cmd is exceeded */
  3734. HTT_SCHED_TID_SKIP_UL_SMALL_QDEPTH, /* Skip ul tid for small qdepth */
  3735. HTT_SCHED_TID_SKIP_UL_TWT_PAUSED, /* Skip ul tid if twt txq is paused */
  3736. HTT_SCHED_TID_SKIP_PEER_UL_RX_NOT_ACTIVE, /* Skip ul tid if peer ul rx is not active */
  3737. HTT_SCHED_TID_SKIP_NO_FORCE_TRIGGER, /* Skip ul tid if there is no force triggers */
  3738. HTT_SCHED_TID_SKIP_SMART_BASIC_TRIGGER, /* Skip ul tid if smart basic trigger doesn't have enough data */
  3739. HTT_SCHED_INELIGIBILITY_MAX,
  3740. } htt_sched_txq_sched_ineligibility_tlv_enum;
  3741. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3742. /* NOTE: Variable length TLV, use length spec to infer array size */
  3743. typedef struct {
  3744. htt_tlv_hdr_t tlv_hdr;
  3745. /**
  3746. * sched_ineligibility counts the number of occurrences of different
  3747. * reasons for tid ineligibility during eligibility checks per txq
  3748. * in scheduling
  3749. *
  3750. * Indexed by htt_sched_txq_sched_ineligibility_tlv_enum.
  3751. */
  3752. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, sched_ineligibility);
  3753. } htt_stats_sched_txq_sched_ineligibility_tlv;
  3754. /* preserve old name alias for new name consistent with the tag name */
  3755. typedef htt_stats_sched_txq_sched_ineligibility_tlv
  3756. htt_sched_txq_sched_ineligibility_tlv_v;
  3757. typedef enum {
  3758. HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0, /* Supercycle not triggered */
  3759. HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED, /* forced supercycle trigger */
  3760. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES, /* Num tidq entries is less than max_client threshold */
  3761. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS, /* Num active tids is less than max_client threshold */
  3762. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED, /* max sched iteration reached */
  3763. HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED, /* duration threshold reached */
  3764. HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER, /* TWT supercycle trigger */
  3765. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  3766. } htt_sched_txq_supercycle_triggers_tlv_enum;
  3767. #define HTT_SCHED_TXQ_SUPERCYCLE_TRIGGERS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3768. /* NOTE: Variable length TLV, use length spec to infer array size */
  3769. typedef struct {
  3770. htt_tlv_hdr_t tlv_hdr;
  3771. /**
  3772. * supercycle_triggers[] is a histogram that counts the number of
  3773. * occurrences of each different reason for a transmit scheduler
  3774. * supercycle to be triggered.
  3775. * The htt_sched_txq_supercycle_triggers_tlv_enum is used to index
  3776. * supercycle_triggers[], e.g. supercycle_triggers[1] holds the number
  3777. * of times a supercycle has been forced.
  3778. * These supercycle trigger counts are not automatically reset, but
  3779. * are reset upon request.
  3780. */
  3781. A_UINT32 supercycle_triggers[1/*HTT_SCHED_SUPERCYCLE_TRIGGER_MAX*/];
  3782. } htt_stats_sched_txq_supercycle_trigger_tlv;
  3783. /* preserve old name alias for new name consistent with the tag name */
  3784. typedef htt_stats_sched_txq_supercycle_trigger_tlv
  3785. htt_sched_txq_supercycle_triggers_tlv_v;
  3786. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  3787. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  3788. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  3789. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  3790. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  3791. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  3792. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  3793. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  3796. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  3797. } while (0)
  3798. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  3799. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  3800. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  3801. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  3804. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  3805. } while (0)
  3806. typedef struct {
  3807. htt_tlv_hdr_t tlv_hdr;
  3808. /**
  3809. * BIT [ 7 : 0] :- mac_id
  3810. * BIT [15 : 8] :- txq_id
  3811. * BIT [31 : 16] :- reserved
  3812. */
  3813. A_UINT32 mac_id__txq_id__word;
  3814. /** Scheduler policy ised for this TxQ */
  3815. A_UINT32 sched_policy;
  3816. /** Timestamp of last scheduler command posted */
  3817. A_UINT32 last_sched_cmd_posted_timestamp;
  3818. /** Timestamp of last scheduler command completed */
  3819. A_UINT32 last_sched_cmd_compl_timestamp;
  3820. /** Num of Sched2TAC ring hit Low Water Mark condition */
  3821. A_UINT32 sched_2_tac_lwm_count;
  3822. /** Num of Sched2TAC ring full condition */
  3823. A_UINT32 sched_2_tac_ring_full;
  3824. /**
  3825. * Num of scheduler command post failures that includes SU/MU-MIMO/MU-OFDMA
  3826. * sequence type
  3827. */
  3828. A_UINT32 sched_cmd_post_failure;
  3829. /** Num of active tids for this TxQ at current instance */
  3830. A_UINT32 num_active_tids;
  3831. /** Num of powersave schedules */
  3832. A_UINT32 num_ps_schedules;
  3833. /** Num of scheduler commands pending for this TxQ */
  3834. A_UINT32 sched_cmds_pending;
  3835. /** Num of tidq registration for this TxQ */
  3836. A_UINT32 num_tid_register;
  3837. /** Num of tidq de-registration for this TxQ */
  3838. A_UINT32 num_tid_unregister;
  3839. /** Num of iterations msduq stats was updated */
  3840. A_UINT32 num_qstats_queried;
  3841. /** qstats query update status */
  3842. A_UINT32 qstats_update_pending;
  3843. /** Timestamp of Last query stats made */
  3844. A_UINT32 last_qstats_query_timestamp;
  3845. /** Num of sched2tqm command queue full condition */
  3846. A_UINT32 num_tqm_cmdq_full;
  3847. /** Num of scheduler trigger from DE Module */
  3848. A_UINT32 num_de_sched_algo_trigger;
  3849. /** Num of scheduler trigger from RT Module */
  3850. A_UINT32 num_rt_sched_algo_trigger;
  3851. /** Num of scheduler trigger from TQM Module */
  3852. A_UINT32 num_tqm_sched_algo_trigger;
  3853. /** Num of schedules for notify frame */
  3854. A_UINT32 notify_sched;
  3855. /** Duration based sendn termination */
  3856. A_UINT32 dur_based_sendn_term;
  3857. /** scheduled via NOTIFY2 */
  3858. A_UINT32 su_notify2_sched;
  3859. /** schedule if queued packets are greater than avg MSDUs in PPDU */
  3860. A_UINT32 su_optimal_queued_msdus_sched;
  3861. /** schedule due to timeout */
  3862. A_UINT32 su_delay_timeout_sched;
  3863. /** delay if txtime is less than 500us */
  3864. A_UINT32 su_min_txtime_sched_delay;
  3865. /** scheduled via no delay */
  3866. A_UINT32 su_no_delay;
  3867. /** Num of supercycles for this TxQ */
  3868. A_UINT32 num_supercycles;
  3869. /** Num of subcycles with sort for this TxQ */
  3870. A_UINT32 num_subcycles_with_sort;
  3871. /** Num of subcycles without sort for this Txq */
  3872. A_UINT32 num_subcycles_no_sort;
  3873. } htt_stats_tx_pdev_scheduler_txq_stats_tlv;
  3874. /* preserve old name alias for new name consistent with the tag name */
  3875. typedef htt_stats_tx_pdev_scheduler_txq_stats_tlv
  3876. htt_tx_pdev_stats_sched_per_txq_tlv;
  3877. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  3878. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  3879. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  3880. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  3881. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  3882. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  3885. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  3886. } while (0)
  3887. typedef struct {
  3888. htt_tlv_hdr_t tlv_hdr;
  3889. /**
  3890. * BIT [ 7 : 0] :- mac_id
  3891. * BIT [31 : 8] :- reserved
  3892. */
  3893. A_UINT32 mac_id__word;
  3894. /** Current timestamp */
  3895. A_UINT32 current_timestamp;
  3896. } htt_stats_tx_sched_cmn_tlv;
  3897. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  3898. * TLV_TAGS:
  3899. * - HTT_STATS_TX_SCHED_CMN_TAG
  3900. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  3901. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  3902. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  3903. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  3904. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  3905. * - HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG
  3906. */
  3907. /* NOTE:
  3908. * This structure is for documentation, and cannot be safely used directly.
  3909. * Instead, use the constituent TLV structures to fill/parse.
  3910. */
  3911. typedef struct {
  3912. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  3913. struct {
  3914. htt_stats_tx_pdev_scheduler_txq_stats_tlv txq_tlv;
  3915. htt_stats_sched_txq_cmd_posted_tlv cmd_posted_tlv;
  3916. htt_stats_sched_txq_cmd_reaped_tlv cmd_reaped_tlv;
  3917. htt_stats_sched_txq_sched_order_su_tlv sched_order_su_tlv;
  3918. htt_stats_sched_txq_sched_ineligibility_tlv sched_ineligibility_tlv;
  3919. htt_stats_sched_txq_supercycle_trigger_tlv htt_sched_txq_sched_ineligibility_tlv_esched_supercycle_trigger_tlv;
  3920. } txq[1];
  3921. } htt_stats_tx_sched_t;
  3922. /* == TQM STATS == */
  3923. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 17
  3924. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  3925. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  3926. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3927. /* NOTE: Variable length TLV, use length spec to infer array size */
  3928. typedef struct {
  3929. htt_tlv_hdr_t tlv_hdr;
  3930. /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  3931. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, gen_mpdu_end_reason);
  3932. } htt_stats_tx_tqm_gen_mpdu_tlv;
  3933. /* preserve old name alias for new name consistent with the tag name */
  3934. typedef htt_stats_tx_tqm_gen_mpdu_tlv htt_tx_tqm_gen_mpdu_stats_tlv_v;
  3935. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3936. /* NOTE: Variable length TLV, use length spec to infer array size */
  3937. typedef struct {
  3938. htt_tlv_hdr_t tlv_hdr;
  3939. /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  3940. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, list_mpdu_end_reason);
  3941. } htt_stats_tx_tqm_list_mpdu_tlv;
  3942. /* preserve old name alias for new name consistent with the tag name */
  3943. typedef htt_stats_tx_tqm_list_mpdu_tlv htt_tx_tqm_list_mpdu_stats_tlv_v;
  3944. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3945. /* NOTE: Variable length TLV, use length spec to infer array size */
  3946. typedef struct {
  3947. htt_tlv_hdr_t tlv_hdr;
  3948. /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  3949. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, list_mpdu_cnt_hist);
  3950. } htt_stats_tx_tqm_list_mpdu_cnt_tlv;
  3951. /* preserve old name alias for new name consistent with the tag name */
  3952. typedef htt_stats_tx_tqm_list_mpdu_cnt_tlv htt_tx_tqm_list_mpdu_cnt_tlv_v;
  3953. typedef struct {
  3954. htt_tlv_hdr_t tlv_hdr;
  3955. A_UINT32 msdu_count;
  3956. A_UINT32 mpdu_count;
  3957. A_UINT32 remove_msdu;
  3958. A_UINT32 remove_mpdu;
  3959. A_UINT32 remove_msdu_ttl;
  3960. A_UINT32 send_bar;
  3961. A_UINT32 bar_sync;
  3962. A_UINT32 notify_mpdu;
  3963. A_UINT32 sync_cmd;
  3964. A_UINT32 write_cmd;
  3965. A_UINT32 hwsch_trigger;
  3966. A_UINT32 ack_tlv_proc;
  3967. A_UINT32 gen_mpdu_cmd;
  3968. A_UINT32 gen_list_cmd;
  3969. A_UINT32 remove_mpdu_cmd;
  3970. A_UINT32 remove_mpdu_tried_cmd;
  3971. A_UINT32 mpdu_queue_stats_cmd;
  3972. A_UINT32 mpdu_head_info_cmd;
  3973. A_UINT32 msdu_flow_stats_cmd;
  3974. A_UINT32 remove_msdu_cmd;
  3975. A_UINT32 remove_msdu_ttl_cmd;
  3976. A_UINT32 flush_cache_cmd;
  3977. A_UINT32 update_mpduq_cmd;
  3978. A_UINT32 enqueue;
  3979. A_UINT32 enqueue_notify;
  3980. A_UINT32 notify_mpdu_at_head;
  3981. A_UINT32 notify_mpdu_state_valid;
  3982. /*
  3983. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  3984. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  3985. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  3986. * for non-UDP MSDUs.
  3987. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  3988. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  3989. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  3990. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  3991. *
  3992. * Notify signifies that we trigger the scheduler.
  3993. */
  3994. A_UINT32 sched_udp_notify1;
  3995. A_UINT32 sched_udp_notify2;
  3996. A_UINT32 sched_nonudp_notify1;
  3997. A_UINT32 sched_nonudp_notify2;
  3998. A_UINT32 tqm_enqueue_msdu_count;
  3999. A_UINT32 tqm_dropped_msdu_count;
  4000. A_UINT32 tqm_dequeue_msdu_count;
  4001. } htt_stats_tx_tqm_pdev_tlv;
  4002. /* preserve old name alias for new name consistent with the tag name */
  4003. typedef htt_stats_tx_tqm_pdev_tlv htt_tx_tqm_pdev_stats_tlv_v;
  4004. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  4005. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  4006. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  4007. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  4008. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  4009. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  4010. do { \
  4011. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  4012. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  4013. } while (0)
  4014. typedef struct {
  4015. htt_tlv_hdr_t tlv_hdr;
  4016. /**
  4017. * BIT [ 7 : 0] :- mac_id
  4018. * BIT [31 : 8] :- reserved
  4019. */
  4020. A_UINT32 mac_id__word;
  4021. A_UINT32 max_cmdq_id;
  4022. A_UINT32 list_mpdu_cnt_hist_intvl;
  4023. /* Global stats */
  4024. A_UINT32 add_msdu;
  4025. A_UINT32 q_empty;
  4026. A_UINT32 q_not_empty;
  4027. A_UINT32 drop_notification;
  4028. A_UINT32 desc_threshold;
  4029. A_UINT32 hwsch_tqm_invalid_status;
  4030. A_UINT32 missed_tqm_gen_mpdus;
  4031. A_UINT32 tqm_active_tids;
  4032. A_UINT32 tqm_inactive_tids;
  4033. A_UINT32 tqm_active_msduq_flows;
  4034. /* SAWF system delay reference timestamp updation related stats */
  4035. A_UINT32 total_msduq_timestamp_updates;
  4036. A_UINT32 total_msduq_timestamp_updates_by_get_mpdu_head_info_cmd;
  4037. A_UINT32 total_msduq_timestamp_updates_by_empty_to_nonempty_status;
  4038. A_UINT32 total_get_mpdu_head_info_cmds_by_sched_algo_la_query;
  4039. A_UINT32 total_get_mpdu_head_info_cmds_by_tac;
  4040. A_UINT32 total_gen_mpdu_cmds_by_sched_algo_la_query;
  4041. A_UINT32 high_prio_q_not_empty;
  4042. } htt_stats_tx_tqm_cmn_tlv;
  4043. /* preserve old name alias for new name consistent with the tag name */
  4044. typedef htt_stats_tx_tqm_cmn_tlv htt_tx_tqm_cmn_stats_tlv;
  4045. typedef struct {
  4046. htt_tlv_hdr_t tlv_hdr;
  4047. /* Error stats */
  4048. A_UINT32 q_empty_failure;
  4049. A_UINT32 q_not_empty_failure;
  4050. A_UINT32 add_msdu_failure;
  4051. /* TQM reset debug stats */
  4052. A_UINT32 tqm_cache_ctl_err;
  4053. A_UINT32 tqm_soft_reset;
  4054. A_UINT32 tqm_reset_total_num_in_use_link_descs;
  4055. A_UINT32 tqm_reset_worst_case_num_lost_link_descs;
  4056. A_UINT32 tqm_reset_worst_case_num_lost_host_tx_bufs_count;
  4057. A_UINT32 tqm_reset_num_in_use_link_descs_internal_tqm;
  4058. A_UINT32 tqm_reset_num_in_use_link_descs_wbm_idle_link_ring;
  4059. A_UINT32 tqm_reset_time_to_tqm_hang_delta_ms;
  4060. A_UINT32 tqm_reset_recovery_time_ms;
  4061. A_UINT32 tqm_reset_num_peers_hdl;
  4062. A_UINT32 tqm_reset_cumm_dirty_hw_mpduq_proc_cnt;
  4063. A_UINT32 tqm_reset_cumm_dirty_hw_msduq_proc;
  4064. A_UINT32 tqm_reset_flush_cache_cmd_su_cnt;
  4065. A_UINT32 tqm_reset_flush_cache_cmd_other_cnt;
  4066. A_UINT32 tqm_reset_flush_cache_cmd_trig_type;
  4067. A_UINT32 tqm_reset_flush_cache_cmd_trig_cfg;
  4068. A_UINT32 tqm_reset_flush_cache_cmd_skip_cmd_status_null;
  4069. } htt_stats_tx_tqm_error_stats_tlv;
  4070. /* preserve old name alias for new name consistent with the tag name */
  4071. typedef htt_stats_tx_tqm_error_stats_tlv htt_tx_tqm_error_stats_tlv;
  4072. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  4073. * TLV_TAGS:
  4074. * - HTT_STATS_TX_TQM_CMN_TAG
  4075. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  4076. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  4077. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  4078. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  4079. * - HTT_STATS_TX_TQM_PDEV_TAG
  4080. */
  4081. /* NOTE:
  4082. * This structure is for documentation, and cannot be safely used directly.
  4083. * Instead, use the constituent TLV structures to fill/parse.
  4084. */
  4085. #ifdef ATH_TARGET
  4086. typedef struct {
  4087. htt_stats_tx_tqm_cmn_tlv cmn_tlv;
  4088. htt_stats_tx_tqm_error_stats_tlv err_tlv;
  4089. htt_stats_tx_tqm_gen_mpdu_tlv gen_mpdu_stats_tlv;
  4090. htt_stats_tx_tqm_list_mpdu_tlv list_mpdu_stats_tlv;
  4091. htt_stats_tx_tqm_list_mpdu_cnt_tlv list_mpdu_cnt_tlv;
  4092. htt_stats_tx_tqm_pdev_tlv tqm_pdev_stats_tlv;
  4093. } htt_tx_tqm_pdev_stats_t;
  4094. #endif /* ATH_TARGET */
  4095. /* == TQM CMDQ stats == */
  4096. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  4097. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  4098. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  4099. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  4100. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  4101. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  4102. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  4103. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  4106. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  4107. } while (0)
  4108. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  4109. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  4110. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  4111. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  4114. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  4115. } while (0)
  4116. typedef struct {
  4117. htt_tlv_hdr_t tlv_hdr;
  4118. /*
  4119. * BIT [ 7 : 0] :- mac_id
  4120. * BIT [15 : 8] :- cmdq_id
  4121. * BIT [31 : 16] :- reserved
  4122. */
  4123. A_UINT32 mac_id__cmdq_id__word;
  4124. A_UINT32 sync_cmd;
  4125. A_UINT32 write_cmd;
  4126. A_UINT32 gen_mpdu_cmd;
  4127. A_UINT32 mpdu_queue_stats_cmd;
  4128. A_UINT32 mpdu_head_info_cmd;
  4129. A_UINT32 msdu_flow_stats_cmd;
  4130. A_UINT32 remove_mpdu_cmd;
  4131. A_UINT32 remove_msdu_cmd;
  4132. A_UINT32 flush_cache_cmd;
  4133. A_UINT32 update_mpduq_cmd;
  4134. A_UINT32 update_msduq_cmd;
  4135. } htt_stats_tx_tqm_cmdq_status_tlv;
  4136. /* preserve old name alias for new name consistent with the tag name */
  4137. typedef htt_stats_tx_tqm_cmdq_status_tlv htt_tx_tqm_cmdq_status_tlv;
  4138. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  4139. * TLV_TAGS:
  4140. * - HTT_STATS_STRING_TAG
  4141. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  4142. */
  4143. /* NOTE:
  4144. * This structure is for documentation, and cannot be safely used directly.
  4145. * Instead, use the constituent TLV structures to fill/parse.
  4146. */
  4147. #ifdef ATH_TARGET
  4148. typedef struct {
  4149. struct {
  4150. htt_stats_string_tlv cmdq_str_tlv;
  4151. htt_stats_tx_tqm_cmdq_status_tlv status_tlv;
  4152. } q[1];
  4153. } htt_tx_tqm_cmdq_stats_t;
  4154. #endif /* ATH_TARGET */
  4155. /* == TX-DE STATS == */
  4156. /* Structures for tx de stats */
  4157. typedef struct {
  4158. htt_tlv_hdr_t tlv_hdr;
  4159. A_UINT32 m1_packets;
  4160. A_UINT32 m2_packets;
  4161. A_UINT32 m3_packets;
  4162. A_UINT32 m4_packets;
  4163. A_UINT32 g1_packets;
  4164. A_UINT32 g2_packets;
  4165. A_UINT32 rc4_packets;
  4166. A_UINT32 eap_packets;
  4167. A_UINT32 eapol_start_packets;
  4168. A_UINT32 eapol_logoff_packets;
  4169. A_UINT32 eapol_encap_asf_packets;
  4170. A_UINT32 m1_success;
  4171. A_UINT32 m1_compl_fail;
  4172. A_UINT32 m2_success;
  4173. A_UINT32 m2_compl_fail;
  4174. A_UINT32 m3_success;
  4175. A_UINT32 m3_compl_fail;
  4176. A_UINT32 m4_success;
  4177. A_UINT32 m4_compl_fail;
  4178. A_UINT32 g1_success;
  4179. A_UINT32 g1_compl_fail;
  4180. A_UINT32 g2_success;
  4181. A_UINT32 g2_compl_fail;
  4182. } htt_stats_tx_de_eapol_packets_tlv;
  4183. /* preserve old name alias for new name consistent with the tag name */
  4184. typedef htt_stats_tx_de_eapol_packets_tlv htt_tx_de_eapol_packets_stats_tlv;
  4185. typedef struct {
  4186. htt_tlv_hdr_t tlv_hdr;
  4187. A_UINT32 ap_bss_peer_not_found;
  4188. A_UINT32 ap_bcast_mcast_no_peer;
  4189. A_UINT32 sta_delete_in_progress;
  4190. A_UINT32 ibss_no_bss_peer;
  4191. A_UINT32 invaild_vdev_type;
  4192. A_UINT32 invalid_ast_peer_entry;
  4193. A_UINT32 peer_entry_invalid;
  4194. A_UINT32 ethertype_not_ip;
  4195. A_UINT32 eapol_lookup_failed;
  4196. A_UINT32 qpeer_not_allow_data;
  4197. A_UINT32 fse_tid_override;
  4198. A_UINT32 ipv6_jumbogram_zero_length;
  4199. A_UINT32 qos_to_non_qos_in_prog;
  4200. A_UINT32 ap_bcast_mcast_eapol;
  4201. A_UINT32 unicast_on_ap_bss_peer;
  4202. A_UINT32 ap_vdev_invalid;
  4203. A_UINT32 incomplete_llc;
  4204. A_UINT32 eapol_duplicate_m3;
  4205. A_UINT32 eapol_duplicate_m4;
  4206. } htt_stats_tx_de_classify_failed_tlv;
  4207. /* preserve old name alias for new name consistent with the tag name */
  4208. typedef htt_stats_tx_de_classify_failed_tlv htt_tx_de_classify_failed_stats_tlv;
  4209. typedef struct {
  4210. htt_tlv_hdr_t tlv_hdr;
  4211. A_UINT32 arp_packets;
  4212. A_UINT32 igmp_packets;
  4213. A_UINT32 dhcp_packets;
  4214. A_UINT32 host_inspected;
  4215. A_UINT32 htt_included;
  4216. A_UINT32 htt_valid_mcs;
  4217. A_UINT32 htt_valid_nss;
  4218. A_UINT32 htt_valid_preamble_type;
  4219. A_UINT32 htt_valid_chainmask;
  4220. A_UINT32 htt_valid_guard_interval;
  4221. A_UINT32 htt_valid_retries;
  4222. A_UINT32 htt_valid_bw_info;
  4223. A_UINT32 htt_valid_power;
  4224. A_UINT32 htt_valid_key_flags;
  4225. A_UINT32 htt_valid_no_encryption;
  4226. A_UINT32 fse_entry_count;
  4227. A_UINT32 fse_priority_be;
  4228. A_UINT32 fse_priority_high;
  4229. A_UINT32 fse_priority_low;
  4230. A_UINT32 fse_traffic_ptrn_be;
  4231. A_UINT32 fse_traffic_ptrn_over_sub;
  4232. A_UINT32 fse_traffic_ptrn_bursty;
  4233. A_UINT32 fse_traffic_ptrn_interactive;
  4234. A_UINT32 fse_traffic_ptrn_periodic;
  4235. A_UINT32 fse_hwqueue_alloc;
  4236. A_UINT32 fse_hwqueue_created;
  4237. A_UINT32 fse_hwqueue_send_to_host;
  4238. A_UINT32 mcast_entry;
  4239. A_UINT32 bcast_entry;
  4240. A_UINT32 htt_update_peer_cache;
  4241. A_UINT32 htt_learning_frame;
  4242. A_UINT32 fse_invalid_peer;
  4243. /**
  4244. * mec_notify is HTT TX WBM multicast echo check notification
  4245. * from firmware to host. FW sends SA addresses to host for all
  4246. * multicast/broadcast packets received on STA side.
  4247. */
  4248. A_UINT32 mec_notify;
  4249. A_UINT32 arp_response;
  4250. A_UINT32 arp_request;
  4251. } htt_stats_tx_de_classify_stats_tlv;
  4252. /* preserve old name alias for new name consistent with the tag name */
  4253. typedef htt_stats_tx_de_classify_stats_tlv htt_tx_de_classify_stats_tlv;
  4254. typedef struct {
  4255. htt_tlv_hdr_t tlv_hdr;
  4256. A_UINT32 eok;
  4257. A_UINT32 classify_done;
  4258. A_UINT32 lookup_failed;
  4259. A_UINT32 send_host_dhcp;
  4260. A_UINT32 send_host_mcast;
  4261. A_UINT32 send_host_unknown_dest;
  4262. A_UINT32 send_host;
  4263. A_UINT32 status_invalid;
  4264. } htt_stats_tx_de_classify_status_tlv;
  4265. /* preserve old name alias for new name consistent with the tag name */
  4266. typedef htt_stats_tx_de_classify_status_tlv htt_tx_de_classify_status_stats_tlv;
  4267. typedef struct {
  4268. htt_tlv_hdr_t tlv_hdr;
  4269. A_UINT32 enqueued_pkts;
  4270. A_UINT32 to_tqm;
  4271. A_UINT32 to_tqm_bypass;
  4272. } htt_stats_tx_de_enqueue_packets_tlv;
  4273. /* preserve old name alias for new name consistent with the tag name */
  4274. typedef htt_stats_tx_de_enqueue_packets_tlv htt_tx_de_enqueue_packets_stats_tlv;
  4275. typedef struct {
  4276. htt_tlv_hdr_t tlv_hdr;
  4277. A_UINT32 discarded_pkts;
  4278. A_UINT32 local_frames;
  4279. A_UINT32 is_ext_msdu;
  4280. A_UINT32 mlo_invalid_routing_discard;
  4281. A_UINT32 mlo_invalid_routing_dup_entry_discard;
  4282. A_UINT32 discard_peer_unauthorized_pkts;
  4283. } htt_stats_tx_de_enqueue_discard_tlv;
  4284. /* preserve old name alias for new name consistent with the tag name */
  4285. typedef htt_stats_tx_de_enqueue_discard_tlv htt_tx_de_enqueue_discard_stats_tlv;
  4286. typedef struct {
  4287. htt_tlv_hdr_t tlv_hdr;
  4288. A_UINT32 tcl_dummy_frame;
  4289. A_UINT32 tqm_dummy_frame;
  4290. A_UINT32 tqm_notify_frame;
  4291. A_UINT32 fw2wbm_enq;
  4292. A_UINT32 tqm_bypass_frame;
  4293. } htt_stats_tx_de_compl_stats_tlv;
  4294. /* preserve old name alias for new name consistent with the tag name */
  4295. typedef htt_stats_tx_de_compl_stats_tlv htt_tx_de_compl_stats_tlv;
  4296. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  4297. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  4298. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  4299. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  4300. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  4301. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  4302. do { \
  4303. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  4304. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  4305. } while (0)
  4306. /*
  4307. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  4308. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  4309. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  4310. * 200us & again request for it. This is a histogram of time we wait, with
  4311. * bin of 200ms & there are 10 bin (2 seconds max)
  4312. * They are defined by the following macros in FW
  4313. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  4314. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  4315. * ENTRIES_PER_BIN_COUNT)
  4316. */
  4317. typedef struct {
  4318. htt_tlv_hdr_t tlv_hdr;
  4319. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw2wbm_ring_full_hist);
  4320. } htt_stats_tx_de_fw2wbm_ring_full_hist_tlv;
  4321. /* preserve old name alias for new name consistent with the tag name */
  4322. typedef htt_stats_tx_de_fw2wbm_ring_full_hist_tlv
  4323. htt_tx_de_fw2wbm_ring_full_hist_tlv;
  4324. typedef struct {
  4325. htt_tlv_hdr_t tlv_hdr;
  4326. /**
  4327. * BIT [ 7 : 0] :- mac_id
  4328. * BIT [31 : 8] :- reserved
  4329. */
  4330. A_UINT32 mac_id__word;
  4331. /* Global Stats */
  4332. A_UINT32 tcl2fw_entry_count;
  4333. A_UINT32 not_to_fw;
  4334. A_UINT32 invalid_pdev_vdev_peer;
  4335. A_UINT32 tcl_res_invalid_addrx;
  4336. A_UINT32 wbm2fw_entry_count;
  4337. A_UINT32 invalid_pdev;
  4338. A_UINT32 tcl_res_addrx_timeout;
  4339. A_UINT32 invalid_vdev;
  4340. A_UINT32 invalid_tcl_exp_frame_desc;
  4341. A_UINT32 vdev_id_mismatch_cnt;
  4342. } htt_stats_tx_de_cmn_tlv;
  4343. /* preserve old name alias for new name consistent with the tag name */
  4344. typedef htt_stats_tx_de_cmn_tlv htt_tx_de_cmn_stats_tlv;
  4345. #define HTT_STATS_RX_FW_RING_SIZE_NUM_ENTRIES(dword) ((dword >> 0) & 0xffff)
  4346. #define HTT_STATS_RX_FW_RING_CURR_NUM_ENTRIES(dword) ((dword >> 16) & 0xffff)
  4347. /* Rx debug info for status rings */
  4348. typedef struct {
  4349. htt_tlv_hdr_t tlv_hdr;
  4350. /**
  4351. * BIT [15 : 0] :- max possible number of entries in respective ring
  4352. * (size of the ring in terms of entries)
  4353. * BIT [16 : 31] :- current number of entries occupied in respective ring
  4354. */
  4355. A_UINT32 entry_status_sw2rxdma;
  4356. A_UINT32 entry_status_rxdma2reo;
  4357. A_UINT32 entry_status_reo2sw1;
  4358. A_UINT32 entry_status_reo2sw4;
  4359. A_UINT32 entry_status_refillringipa;
  4360. A_UINT32 entry_status_refillringhost;
  4361. /** datarate - Moving Average of Number of Entries */
  4362. A_UINT32 datarate_refillringipa;
  4363. A_UINT32 datarate_refillringhost;
  4364. /**
  4365. * refillringhost_backpress_hist and refillringipa_backpress_hist are
  4366. * deprecated, and will be filled with 0x0 by the target.
  4367. */
  4368. A_UINT32 refillringhost_backpress_hist[3];
  4369. A_UINT32 refillringipa_backpress_hist[3];
  4370. /**
  4371. * Number of times reo2sw4(IPA_DEST_RING) ring is back-pressured
  4372. * in recent time periods
  4373. * element 0: in last 0 to 250ms
  4374. * element 1: 250ms to 500ms
  4375. * element 2: above 500ms
  4376. */
  4377. A_UINT32 reo2sw4ringipa_backpress_hist[3];
  4378. } htt_stats_rx_ring_stats_tlv;
  4379. /* preserve old name alias for new name consistent with the tag name */
  4380. typedef htt_stats_rx_ring_stats_tlv htt_rx_fw_ring_stats_tlv_v;
  4381. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  4382. * TLV_TAGS:
  4383. * - HTT_STATS_TX_DE_CMN_TAG
  4384. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  4385. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  4386. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  4387. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  4388. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  4389. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  4390. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  4391. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  4392. */
  4393. /* NOTE:
  4394. * This structure is for documentation, and cannot be safely used directly.
  4395. * Instead, use the constituent TLV structures to fill/parse.
  4396. */
  4397. #ifdef ATH_TARGET
  4398. typedef struct {
  4399. htt_stats_tx_de_cmn_tlv cmn_tlv;
  4400. htt_stats_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  4401. htt_stats_tx_de_eapol_packets_tlv eapol_stats_tlv;
  4402. htt_stats_tx_de_classify_stats_tlv classify_stats_tlv;
  4403. htt_stats_tx_de_classify_failed_tlv classify_failed_tlv;
  4404. htt_stats_tx_de_classify_status_tlv classify_status_rlv;
  4405. htt_stats_tx_de_enqueue_packets_tlv enqueue_packets_tlv;
  4406. htt_stats_tx_de_enqueue_discard_tlv enqueue_discard_tlv;
  4407. htt_stats_tx_de_compl_stats_tlv comp_status_tlv;
  4408. } htt_tx_de_stats_t;
  4409. #endif /* ATH_TARGET */
  4410. /* == RING-IF STATS == */
  4411. /* DWORD num_elems__prefetch_tail_idx */
  4412. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  4413. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  4414. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  4415. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  4416. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  4417. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  4418. HTT_RING_IF_STATS_NUM_ELEMS_S)
  4419. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  4420. do { \
  4421. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  4422. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  4423. } while (0)
  4424. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  4425. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  4426. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  4427. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  4428. do { \
  4429. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  4430. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  4431. } while (0)
  4432. /* DWORD head_idx__tail_idx */
  4433. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  4434. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  4435. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  4436. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  4437. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  4438. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  4439. HTT_RING_IF_STATS_HEAD_IDX_S)
  4440. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  4441. do { \
  4442. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  4443. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  4444. } while (0)
  4445. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  4446. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  4447. HTT_RING_IF_STATS_TAIL_IDX_S)
  4448. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  4449. do { \
  4450. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  4451. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  4452. } while (0)
  4453. /* DWORD shadow_head_idx__shadow_tail_idx */
  4454. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  4455. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  4456. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  4457. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  4458. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  4459. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  4460. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  4461. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  4464. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  4465. } while (0)
  4466. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  4467. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  4468. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  4469. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  4470. do { \
  4471. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  4472. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  4473. } while (0)
  4474. /* DWORD lwm_thresh__hwm_thresh */
  4475. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  4476. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  4477. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  4478. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  4479. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  4480. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  4481. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  4482. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  4483. do { \
  4484. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  4485. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  4486. } while (0)
  4487. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  4488. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  4489. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  4490. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  4491. do { \
  4492. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  4493. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  4494. } while (0)
  4495. #define HTT_STATS_LOW_WM_BINS 5
  4496. #define HTT_STATS_HIGH_WM_BINS 5
  4497. typedef struct {
  4498. /** DWORD aligned base memory address of the ring */
  4499. A_UINT32 base_addr;
  4500. /** size of each ring element */
  4501. A_UINT32 elem_size;
  4502. /**
  4503. * BIT [15 : 0] :- num_elems
  4504. * BIT [31 : 16] :- prefetch_tail_idx
  4505. */
  4506. A_UINT32 num_elems__prefetch_tail_idx;
  4507. /**
  4508. * BIT [15 : 0] :- head_idx
  4509. * BIT [31 : 16] :- tail_idx
  4510. */
  4511. A_UINT32 head_idx__tail_idx;
  4512. /**
  4513. * BIT [15 : 0] :- shadow_head_idx
  4514. * BIT [31 : 16] :- shadow_tail_idx
  4515. */
  4516. A_UINT32 shadow_head_idx__shadow_tail_idx;
  4517. A_UINT32 num_tail_incr;
  4518. /**
  4519. * BIT [15 : 0] :- lwm_thresh
  4520. * BIT [31 : 16] :- hwm_thresh
  4521. */
  4522. A_UINT32 lwm_thresh__hwm_thresh;
  4523. A_UINT32 overrun_hit_count;
  4524. A_UINT32 underrun_hit_count;
  4525. A_UINT32 prod_blockwait_count;
  4526. A_UINT32 cons_blockwait_count;
  4527. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS];
  4528. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS];
  4529. } htt_stats_ring_if_tlv;
  4530. /* preserve old name alias for new name consistent with the tag name */
  4531. typedef htt_stats_ring_if_tlv htt_ring_if_stats_tlv;
  4532. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  4533. #define HTT_RING_IF_CMN_MAC_ID_S 0
  4534. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  4535. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  4536. HTT_RING_IF_CMN_MAC_ID_S)
  4537. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  4538. do { \
  4539. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  4540. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  4541. } while (0)
  4542. typedef struct {
  4543. htt_tlv_hdr_t tlv_hdr;
  4544. /**
  4545. * BIT [ 7 : 0] :- mac_id
  4546. * BIT [31 : 8] :- reserved
  4547. */
  4548. A_UINT32 mac_id__word;
  4549. A_UINT32 num_records;
  4550. } htt_stats_ring_if_cmn_tlv;
  4551. /* preserve old name alias for new name consistent with the tag name */
  4552. typedef htt_stats_ring_if_cmn_tlv htt_ring_if_cmn_tlv;
  4553. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  4554. * TLV_TAGS:
  4555. * - HTT_STATS_RING_IF_CMN_TAG
  4556. * - HTT_STATS_STRING_TAG
  4557. * - HTT_STATS_RING_IF_TAG
  4558. */
  4559. /* NOTE:
  4560. * This structure is for documentation, and cannot be safely used directly.
  4561. * Instead, use the constituent TLV structures to fill/parse.
  4562. */
  4563. #ifdef ATH_TARGET
  4564. typedef struct {
  4565. htt_stats_ring_if_cmn_tlv cmn_tlv;
  4566. /** Variable based on the Number of records. */
  4567. struct {
  4568. htt_stats_string_tlv ring_str_tlv;
  4569. htt_stats_ring_if_tlv ring_tlv;
  4570. } r[1];
  4571. } htt_ring_if_stats_t;
  4572. #endif /* ATH_TARGET */
  4573. /* == SFM STATS == */
  4574. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  4575. /* NOTE: Variable length TLV, use length spec to infer array size */
  4576. typedef struct {
  4577. htt_tlv_hdr_t tlv_hdr;
  4578. /** Number of DWORDS used per user and per client */
  4579. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, dwords_used_by_user_n);
  4580. } htt_stats_sfm_client_user_tlv;
  4581. /* preserve old name alias for new name consistent with the tag name */
  4582. typedef htt_stats_sfm_client_user_tlv htt_sfm_client_user_tlv_v;
  4583. typedef struct {
  4584. htt_tlv_hdr_t tlv_hdr;
  4585. /** Client ID */
  4586. A_UINT32 client_id;
  4587. /** Minimum number of buffers */
  4588. A_UINT32 buf_min;
  4589. /** Maximum number of buffers */
  4590. A_UINT32 buf_max;
  4591. /** Number of Busy buffers */
  4592. A_UINT32 buf_busy;
  4593. /** Number of Allocated buffers */
  4594. A_UINT32 buf_alloc;
  4595. /** Number of Available/Usable buffers */
  4596. A_UINT32 buf_avail;
  4597. /** Number of users */
  4598. A_UINT32 num_users;
  4599. } htt_stats_sfm_client_tlv;
  4600. /* preserve old name alias for new name consistent with the tag name */
  4601. typedef htt_stats_sfm_client_tlv htt_sfm_client_tlv;
  4602. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  4603. #define HTT_SFM_CMN_MAC_ID_S 0
  4604. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  4605. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  4606. HTT_SFM_CMN_MAC_ID_S)
  4607. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  4608. do { \
  4609. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  4610. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  4611. } while (0)
  4612. typedef struct {
  4613. htt_tlv_hdr_t tlv_hdr;
  4614. /**
  4615. * BIT [ 7 : 0] :- mac_id
  4616. * BIT [31 : 8] :- reserved
  4617. */
  4618. A_UINT32 mac_id__word;
  4619. /**
  4620. * Indicates the total number of 128 byte buffers in the CMEM
  4621. * that are available for buffer sharing
  4622. */
  4623. A_UINT32 buf_total;
  4624. /**
  4625. * Indicates for certain client or all the clients there is no
  4626. * dword saved in SFM, refer to SFM_R1_MEM_EMPTY
  4627. */
  4628. A_UINT32 mem_empty;
  4629. /** DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  4630. A_UINT32 deallocate_bufs;
  4631. /** Number of Records */
  4632. A_UINT32 num_records;
  4633. } htt_stats_sfm_cmn_tlv;
  4634. /* preserve old name alias for new name consistent with the tag name */
  4635. typedef htt_stats_sfm_cmn_tlv htt_sfm_cmn_tlv;
  4636. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  4637. * TLV_TAGS:
  4638. * - HTT_STATS_SFM_CMN_TAG
  4639. * - HTT_STATS_STRING_TAG
  4640. * - HTT_STATS_SFM_CLIENT_TAG
  4641. * - HTT_STATS_SFM_CLIENT_USER_TAG
  4642. */
  4643. /* NOTE:
  4644. * This structure is for documentation, and cannot be safely used directly.
  4645. * Instead, use the constituent TLV structures to fill/parse.
  4646. */
  4647. #ifdef ATH_TARGET
  4648. typedef struct {
  4649. htt_stats_sfm_cmn_tlv cmn_tlv;
  4650. /** Variable based on the Number of records. */
  4651. struct {
  4652. htt_stats_string_tlv client_str_tlv;
  4653. htt_stats_sfm_client_tlv client_tlv;
  4654. htt_stats_sfm_client_user_tlv user_tlv;
  4655. } r[1];
  4656. } htt_sfm_stats_t;
  4657. #endif /* ATH_TARGET */
  4658. /* == SRNG STATS == */
  4659. /* DWORD mac_id__ring_id__arena__ep */
  4660. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  4661. #define HTT_SRING_STATS_MAC_ID_S 0
  4662. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  4663. #define HTT_SRING_STATS_RING_ID_S 8
  4664. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  4665. #define HTT_SRING_STATS_ARENA_S 16
  4666. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  4667. #define HTT_SRING_STATS_EP_TYPE_S 24
  4668. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  4669. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  4670. HTT_SRING_STATS_MAC_ID_S)
  4671. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  4672. do { \
  4673. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  4674. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  4675. } while (0)
  4676. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  4677. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  4678. HTT_SRING_STATS_RING_ID_S)
  4679. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  4680. do { \
  4681. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  4682. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  4683. } while (0)
  4684. #define HTT_SRING_STATS_ARENA_GET(_var) \
  4685. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  4686. HTT_SRING_STATS_ARENA_S)
  4687. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  4688. do { \
  4689. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  4690. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  4691. } while (0)
  4692. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  4693. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  4694. HTT_SRING_STATS_EP_TYPE_S)
  4695. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  4696. do { \
  4697. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  4698. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  4699. } while (0)
  4700. /* DWORD num_avail_words__num_valid_words */
  4701. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  4702. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  4703. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  4704. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  4705. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  4706. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  4707. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  4708. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  4709. do { \
  4710. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  4711. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  4712. } while (0)
  4713. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  4714. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  4715. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  4716. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  4717. do { \
  4718. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  4719. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  4720. } while (0)
  4721. /* DWORD head_ptr__tail_ptr */
  4722. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  4723. #define HTT_SRING_STATS_HEAD_PTR_S 0
  4724. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  4725. #define HTT_SRING_STATS_TAIL_PTR_S 16
  4726. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  4727. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  4728. HTT_SRING_STATS_HEAD_PTR_S)
  4729. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  4730. do { \
  4731. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  4732. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  4733. } while (0)
  4734. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  4735. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  4736. HTT_SRING_STATS_TAIL_PTR_S)
  4737. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  4740. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  4741. } while (0)
  4742. /* DWORD consumer_empty__producer_full */
  4743. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  4744. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  4745. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  4746. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  4747. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  4748. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  4749. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  4750. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  4751. do { \
  4752. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  4753. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  4754. } while (0)
  4755. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  4756. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  4757. HTT_SRING_STATS_PRODUCER_FULL_S)
  4758. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  4761. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  4762. } while (0)
  4763. /* DWORD prefetch_count__internal_tail_ptr */
  4764. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  4765. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  4766. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  4767. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  4768. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  4769. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  4770. HTT_SRING_STATS_PREFETCH_COUNT_S)
  4771. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  4774. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  4775. } while (0)
  4776. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  4777. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  4778. HTT_SRING_STATS_INTERNAL_TP_S)
  4779. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  4780. do { \
  4781. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  4782. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  4783. } while (0)
  4784. typedef struct {
  4785. htt_tlv_hdr_t tlv_hdr;
  4786. /**
  4787. * BIT [ 7 : 0] :- mac_id
  4788. * BIT [15 : 8] :- ring_id
  4789. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  4790. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  4791. * BIT [31 : 25] :- reserved
  4792. */
  4793. A_UINT32 mac_id__ring_id__arena__ep;
  4794. /** DWORD aligned base memory address of the ring */
  4795. A_UINT32 base_addr_lsb;
  4796. A_UINT32 base_addr_msb;
  4797. /** size of ring */
  4798. A_UINT32 ring_size;
  4799. /** size of each ring element */
  4800. A_UINT32 elem_size;
  4801. /** Ring status
  4802. *
  4803. * BIT [15 : 0] :- num_avail_words
  4804. * BIT [31 : 16] :- num_valid_words
  4805. */
  4806. A_UINT32 num_avail_words__num_valid_words;
  4807. /** Index of head and tail
  4808. * BIT [15 : 0] :- head_ptr
  4809. * BIT [31 : 16] :- tail_ptr
  4810. */
  4811. A_UINT32 head_ptr__tail_ptr;
  4812. /** Empty or full counter of rings
  4813. * BIT [15 : 0] :- consumer_empty
  4814. * BIT [31 : 16] :- producer_full
  4815. */
  4816. A_UINT32 consumer_empty__producer_full;
  4817. /** Prefetch status of consumer ring
  4818. * BIT [15 : 0] :- prefetch_count
  4819. * BIT [31 : 16] :- internal_tail_ptr
  4820. */
  4821. A_UINT32 prefetch_count__internal_tail_ptr;
  4822. } htt_stats_sring_stats_tlv;
  4823. /* preserve old name alias for new name consistent with the tag name */
  4824. typedef htt_stats_sring_stats_tlv htt_sring_stats_tlv;
  4825. typedef struct {
  4826. htt_tlv_hdr_t tlv_hdr;
  4827. A_UINT32 num_records;
  4828. } htt_stats_sring_cmn_tlv;
  4829. /* preserve old name alias for new name consistent with the tag name */
  4830. typedef htt_stats_sring_cmn_tlv htt_sring_cmn_tlv;
  4831. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  4832. * TLV_TAGS:
  4833. * - HTT_STATS_SRING_CMN_TAG
  4834. * - HTT_STATS_STRING_TAG
  4835. * - HTT_STATS_SRING_STATS_TAG
  4836. */
  4837. /* NOTE:
  4838. * This structure is for documentation, and cannot be safely used directly.
  4839. * Instead, use the constituent TLV structures to fill/parse.
  4840. */
  4841. #ifdef ATH_TARGET
  4842. typedef struct {
  4843. htt_stats_sring_cmn_tlv cmn_tlv;
  4844. /** Variable based on the Number of records */
  4845. struct {
  4846. htt_stats_string_tlv sring_str_tlv;
  4847. htt_stats_sring_stats_tlv sring_stats_tlv;
  4848. } r[1];
  4849. } htt_sring_stats_t;
  4850. #endif /* ATH_TARGET */
  4851. /* == PDEV TX RATE CTRL STATS == */
  4852. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  4853. #define HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  4854. #define HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  4855. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  4856. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  4857. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  4858. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  4859. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  4860. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  4861. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  4862. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  4863. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  4864. #define HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES 6
  4865. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  4866. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  4867. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  4868. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  4869. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  4870. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  4871. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  4872. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  4873. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  4874. do { \
  4875. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  4876. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  4877. } while (0)
  4878. #define HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS \
  4879. (HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + \
  4880. HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS + \
  4881. HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS)
  4882. #define HTT_TX_PDEV_STATS_NUM_PER_COUNTERS 101
  4883. #define HTT_MAX_POWER_LEVEL 32 /* 0 to 32 dBm */
  4884. #define HTT_MAX_NEGATIVE_POWER_LEVEL 10 /* 0 to -10 dBm */
  4885. /*
  4886. * Introduce new TX counters to support 320MHz support and punctured modes
  4887. */
  4888. typedef enum {
  4889. HTT_TX_PDEV_STATS_PUNCTURED_NONE = 0,
  4890. HTT_TX_PDEV_STATS_PUNCTURED_20 = 1,
  4891. HTT_TX_PDEV_STATS_PUNCTURED_40 = 2,
  4892. HTT_TX_PDEV_STATS_PUNCTURED_80 = 3,
  4893. HTT_TX_PDEV_STATS_PUNCTURED_120 = 4,
  4894. HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  4895. } HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  4896. #define HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  4897. /* 11be related updates */
  4898. #define HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0...13,-2,-1 */
  4899. #define HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  4900. #define HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS 6
  4901. #define HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS 4
  4902. typedef enum {
  4903. HTT_TX_PDEV_STATS_AX_RU_SIZE_26,
  4904. HTT_TX_PDEV_STATS_AX_RU_SIZE_52,
  4905. HTT_TX_PDEV_STATS_AX_RU_SIZE_106,
  4906. HTT_TX_PDEV_STATS_AX_RU_SIZE_242,
  4907. HTT_TX_PDEV_STATS_AX_RU_SIZE_484,
  4908. HTT_TX_PDEV_STATS_AX_RU_SIZE_996,
  4909. HTT_TX_PDEV_STATS_AX_RU_SIZE_996x2,
  4910. HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS,
  4911. } HTT_TX_PDEV_STATS_AX_RU_SIZE;
  4912. typedef enum {
  4913. HTT_TX_PDEV_STATS_BE_RU_SIZE_26,
  4914. HTT_TX_PDEV_STATS_BE_RU_SIZE_52,
  4915. HTT_TX_PDEV_STATS_BE_RU_SIZE_52_26,
  4916. HTT_TX_PDEV_STATS_BE_RU_SIZE_106,
  4917. HTT_TX_PDEV_STATS_BE_RU_SIZE_106_26,
  4918. HTT_TX_PDEV_STATS_BE_RU_SIZE_242,
  4919. HTT_TX_PDEV_STATS_BE_RU_SIZE_484,
  4920. HTT_TX_PDEV_STATS_BE_RU_SIZE_484_242,
  4921. HTT_TX_PDEV_STATS_BE_RU_SIZE_996,
  4922. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484,
  4923. HTT_TX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  4924. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2,
  4925. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  4926. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3,
  4927. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  4928. HTT_TX_PDEV_STATS_BE_RU_SIZE_996x4,
  4929. HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  4930. } HTT_TX_PDEV_STATS_BE_RU_SIZE;
  4931. typedef struct {
  4932. htt_tlv_hdr_t tlv_hdr;
  4933. /**
  4934. * BIT [ 7 : 0] :- mac_id
  4935. * BIT [31 : 8] :- reserved
  4936. */
  4937. A_UINT32 mac_id__word;
  4938. /** Number of tx ldpc packets */
  4939. A_UINT32 tx_ldpc;
  4940. /** Number of tx rts packets */
  4941. A_UINT32 rts_cnt;
  4942. /** RSSI value of last ack packet (units = dB above noise floor) */
  4943. A_UINT32 ack_rssi;
  4944. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4945. /** tx_xx_mcs: currently unused */
  4946. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4947. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4948. /* element 0,1, ...7 -> NSS 1,2, ...8 */
  4949. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4950. /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  4951. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4952. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4953. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  4954. /**
  4955. * Counters to track number of tx packets in each GI
  4956. * (400us, 800us, 1600us & 3200us) in each mcs (0-11)
  4957. */
  4958. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4959. /** Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  4960. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  4961. /** Number of CTS-acknowledged RTS packets */
  4962. A_UINT32 rts_success;
  4963. /**
  4964. * Counters for legacy 11a and 11b transmissions.
  4965. *
  4966. * The index corresponds to:
  4967. *
  4968. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  4969. *
  4970. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  4971. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  4972. */
  4973. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  4974. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4975. /** 11AC VHT DL MU MIMO LDPC count */
  4976. A_UINT32 ac_mu_mimo_tx_ldpc;
  4977. /** 11AX HE DL MU MIMO LDPC count */
  4978. A_UINT32 ax_mu_mimo_tx_ldpc;
  4979. /** 11AX HE DL MU OFDMA LDPC count */
  4980. A_UINT32 ofdma_tx_ldpc;
  4981. /**
  4982. * Counters for 11ax HE LTF selection during TX.
  4983. *
  4984. * The index corresponds to:
  4985. *
  4986. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  4987. */
  4988. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  4989. /** 11AC VHT DL MU MIMO TX MCS stats */
  4990. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4991. /** 11AX HE DL MU MIMO TX MCS stats */
  4992. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4993. /** 11AX HE DL MU OFDMA TX MCS stats */
  4994. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  4995. /** 11AC VHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4996. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4997. /** 11AX HE DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  4998. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4999. /** 11AX HE DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  5000. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5001. /** 11AC VHT DL MU MIMO TX BW stats */
  5002. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5003. /** 11AX HE DL MU MIMO TX BW stats */
  5004. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5005. /** 11AX HE DL MU OFDMA TX BW stats */
  5006. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5007. /** 11AC VHT DL MU MIMO TX guard interval stats */
  5008. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  5009. /** 11AX HE DL MU MIMO TX guard interval stats */
  5010. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  5011. /** 11AX HE DL MU OFDMA TX guard interval stats */
  5012. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  5013. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  5014. A_UINT32 tx_11ax_su_ext;
  5015. /* Stats for MCS 12/13 */
  5016. A_UINT32 tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5017. A_UINT32 tx_stbc_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5018. A_UINT32 tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5019. /** 11AX VHT DL MU MIMO extended TX MCS stats for MCS 12/13 */
  5020. A_UINT32 ax_mu_mimo_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5021. /** 11AX VHT DL MU OFDMA extended TX MCS stats for MCS 12/13 */
  5022. A_UINT32 ofdma_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5023. /** 11AX VHT DL MU MIMO extended TX guard interval stats for MCS 12/13 */
  5024. A_UINT32 ax_mu_mimo_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5025. /** 11AX VHT DL MU OFDMA extended TX guard interval stats for MCS 12/13 */
  5026. A_UINT32 ofdma_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5027. /* Stats for MCS 14/15 */
  5028. A_UINT32 tx_mcs_ext_2[HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5029. A_UINT32 tx_bw_320mhz;
  5030. A_UINT32 tx_gi_ext_2[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5031. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5032. A_UINT32 reduced_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5033. /** 11AC VHT DL MU MIMO TX BW stats at reduced channel config */
  5034. A_UINT32 reduced_ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5035. /** 11AX HE DL MU MIMO TX BW stats at reduced channel config */
  5036. A_UINT32 reduced_ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5037. /** 11AX HE DL MU OFDMA TX BW stats at reduced channel config */
  5038. A_UINT32 reduced_ax_mu_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5039. /** 11AX HE DL MU OFDMA TX RU Size stats */
  5040. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  5041. /** 11AX HE DL MU OFDMA HE-SIG-B MCS stats */
  5042. A_UINT32 ofdma_he_sig_b_mcs[HTT_TX_PDEV_STATS_NUM_HE_SIG_B_MCS_COUNTERS];
  5043. /** 11AX HE SU data + embedded trigger PPDU success stats (stats for HETP ack success PPDU cnt) */
  5044. A_UINT32 ax_su_embedded_trigger_data_ppdu;
  5045. /** 11AX HE SU data + embedded trigger PPDU failure stats (stats for HETP ack failure PPDU cnt) */
  5046. A_UINT32 ax_su_embedded_trigger_data_ppdu_err;
  5047. /** sta side trigger stats */
  5048. A_UINT32 trigger_type_11be[HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES];
  5049. /** Stats for Extra EHT LTF */
  5050. A_UINT32 extra_eht_ltf;
  5051. /** Counter for Extra EHT LTFs in OFDMA sequences */
  5052. A_UINT32 extra_eht_ltf_ofdma;
  5053. /** 11AX HE UL_BA RU Size stats */
  5054. A_UINT32 ofdma_ba_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  5055. } htt_stats_tx_pdev_rate_stats_tlv;
  5056. /* preserve old name alias for new name consistent with the tag name */
  5057. typedef htt_stats_tx_pdev_rate_stats_tlv htt_tx_pdev_rate_stats_tlv;
  5058. typedef struct {
  5059. /* 11be mode pdev rate stats; placed in a separate TLV to adhere to size restrictions */
  5060. htt_tlv_hdr_t tlv_hdr;
  5061. /** 11BE EHT DL MU MIMO TX MCS stats */
  5062. A_UINT32 be_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5063. /** 11BE EHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  5064. A_UINT32 be_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5065. /** 11BE EHT DL MU MIMO TX BW stats */
  5066. A_UINT32 be_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5067. /** 11BE EHT DL MU MIMO TX guard interval stats */
  5068. A_UINT32 be_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5069. /** 11BE DL MU MIMO LDPC count */
  5070. A_UINT32 be_mu_mimo_tx_ldpc;
  5071. } htt_stats_tx_pdev_be_rate_stats_tlv;
  5072. /* preserve old name alias for new name consistent with the tag name */
  5073. typedef htt_stats_tx_pdev_be_rate_stats_tlv htt_tx_pdev_rate_stats_be_tlv;
  5074. typedef struct {
  5075. /*
  5076. * SAWF pdev rate stats;
  5077. * placed in a separate TLV to adhere to size restrictions
  5078. */
  5079. htt_tlv_hdr_t tlv_hdr;
  5080. /**
  5081. * Counter incremented when MCS is dropped due to the successive retries
  5082. * to a peer reaching the configured limit.
  5083. */
  5084. A_UINT32 rate_retry_mcs_drop_cnt;
  5085. /**
  5086. * histogram of MCS rate drop down, indexed by pre-drop MCS
  5087. */
  5088. A_UINT32 mcs_drop_rate[HTT_TX_PDEV_STATS_NUM_MCS_DROP_COUNTERS];
  5089. /**
  5090. * PPDU PER histogram - each PPDU has its PER computed,
  5091. * and the bin corresponding to that PER percentage is incremented.
  5092. */
  5093. A_UINT32 per_histogram_cnt[HTT_TX_PDEV_STATS_NUM_PER_COUNTERS];
  5094. /**
  5095. * When the service class contains delay bound rate parameters which
  5096. * indicate low latency and we enable latency-based RA params then
  5097. * the low_latency_rate_count will be incremented.
  5098. * This counts the number of peer-TIDs that have been categorized as
  5099. * low-latency.
  5100. */
  5101. A_UINT32 low_latency_rate_cnt;
  5102. /** Indicate how many times rate drop happened within SIFS burst */
  5103. A_UINT32 su_burst_rate_drop_cnt;
  5104. /** Indicates how many within SIFS burst failed to deliver any pkt */
  5105. A_UINT32 su_burst_rate_drop_fail_cnt;
  5106. } htt_stats_tx_pdev_sawf_rate_stats_tlv;
  5107. /* preserve old name alias for new name consistent with the tag name */
  5108. typedef htt_stats_tx_pdev_sawf_rate_stats_tlv htt_tx_pdev_rate_stats_sawf_tlv;
  5109. typedef struct {
  5110. htt_tlv_hdr_t tlv_hdr;
  5111. /**
  5112. * BIT [ 7 : 0] :- mac_id
  5113. * BIT [31 : 8] :- reserved
  5114. */
  5115. A_UINT32 mac_id__word;
  5116. /** 11BE EHT DL MU OFDMA LDPC count */
  5117. A_UINT32 be_ofdma_tx_ldpc;
  5118. /** 11BE EHT DL MU OFDMA TX MCS stats */
  5119. A_UINT32 be_ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5120. /**
  5121. * 11BE EHT DL MU OFDMA TX NSS stats (Indicates NSS for individual users)
  5122. */
  5123. A_UINT32 be_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5124. /** 11BE EHT DL MU OFDMA TX BW stats */
  5125. A_UINT32 be_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5126. /** 11BE EHT DL MU OFDMA TX guard interval stats */
  5127. A_UINT32 be_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5128. /** 11BE EHT DL MU OFDMA TX RU Size stats */
  5129. A_UINT32 be_ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5130. /** 11BE EHT DL MU OFDMA EHT-SIG MCS stats */
  5131. A_UINT32 be_ofdma_eht_sig_mcs[HTT_TX_PDEV_STATS_NUM_EHT_SIG_MCS_COUNTERS];
  5132. A_UINT32 be_ofdma_ba_ru_size[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5133. } htt_stats_tx_pdev_rate_stats_be_ofdma_tlv;
  5134. /* preserve old name alias for new name consistent with the tag name */
  5135. typedef htt_stats_tx_pdev_rate_stats_be_ofdma_tlv
  5136. htt_tx_pdev_rate_stats_be_ofdma_tlv;
  5137. typedef struct {
  5138. htt_tlv_hdr_t tlv_hdr;
  5139. /** tx_ppdu_dur_hist:
  5140. * Tx PPDU duration histogram, which holds the tx duration of PPDUs
  5141. * under histogram bins of interval 250us
  5142. */
  5143. A_UINT32 tx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5144. A_UINT32 tx_success_time_us_low;
  5145. A_UINT32 tx_success_time_us_high;
  5146. A_UINT32 tx_fail_time_us_low;
  5147. A_UINT32 tx_fail_time_us_high;
  5148. A_UINT32 pdev_up_time_us_low;
  5149. A_UINT32 pdev_up_time_us_high;
  5150. /** tx_ofdma_ppdu_dur_hist:
  5151. * Tx OFDMA PPDU duration histogram, which holds the tx duration of
  5152. * OFDMA PPDUs under histogram bins of interval 250us
  5153. */
  5154. A_UINT32 tx_ofdma_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5155. } htt_stats_tx_pdev_ppdu_dur_tlv;
  5156. /* preserve old name alias for new name consistent with the tag name */
  5157. typedef htt_stats_tx_pdev_ppdu_dur_tlv htt_tx_pdev_ppdu_dur_stats_tlv;
  5158. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  5159. * TLV_TAGS:
  5160. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  5161. */
  5162. /* NOTE:
  5163. * This structure is for documentation, and cannot be safely used directly.
  5164. * Instead, use the constituent TLV structures to fill/parse.
  5165. */
  5166. #ifdef ATH_TARGET
  5167. typedef struct {
  5168. htt_stats_tx_pdev_rate_stats_tlv rate_tlv;
  5169. htt_stats_tx_pdev_be_rate_stats_tlv rate_be_tlv;
  5170. htt_stats_tx_pdev_sawf_rate_stats_tlv rate_sawf_tlv;
  5171. htt_stats_tx_pdev_ppdu_dur_tlv tx_ppdu_dur_tlv;
  5172. } htt_tx_pdev_rate_stats_t;
  5173. #endif /* ATH_TARGET */
  5174. /* == PDEV RX RATE CTRL STATS == */
  5175. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  5176. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  5177. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  5178. #define HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  5179. #define HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  5180. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14 /* 0-13 */
  5181. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  5182. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  5183. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  5184. #define HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS \
  5185. (HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS + HTT_RX_PDEV_STATS_NUM_BW_COUNTERS)
  5186. #define HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS 5 /* 20, 40, 80, 160, 320Mhz */
  5187. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  5188. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  5189. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  5190. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  5191. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  5192. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  5193. #define HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0-13, -2, -1 */
  5194. #define HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  5195. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  5196. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  5197. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  5198. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  5199. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  5200. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  5201. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  5202. */
  5203. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  5204. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  5205. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  5206. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  5207. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  5208. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  5209. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  5210. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  5211. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  5212. */
  5213. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  5214. typedef enum {
  5215. HTT_RX_PDEV_STATS_BE_RU_SIZE_26,
  5216. HTT_RX_PDEV_STATS_BE_RU_SIZE_52,
  5217. HTT_RX_PDEV_STATS_BE_RU_SIZE_52_26,
  5218. HTT_RX_PDEV_STATS_BE_RU_SIZE_106,
  5219. HTT_RX_PDEV_STATS_BE_RU_SIZE_106_26,
  5220. HTT_RX_PDEV_STATS_BE_RU_SIZE_242,
  5221. HTT_RX_PDEV_STATS_BE_RU_SIZE_484,
  5222. HTT_RX_PDEV_STATS_BE_RU_SIZE_484_242,
  5223. HTT_RX_PDEV_STATS_BE_RU_SIZE_996,
  5224. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484,
  5225. HTT_RX_PDEV_STATS_BE_RU_SIZE_996_484_242,
  5226. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2,
  5227. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x2_484,
  5228. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3,
  5229. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x3_484,
  5230. HTT_RX_PDEV_STATS_BE_RU_SIZE_996x4,
  5231. HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS,
  5232. } HTT_RX_PDEV_STATS_BE_RU_SIZE;
  5233. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  5234. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  5235. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  5236. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  5237. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  5238. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  5239. do { \
  5240. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  5241. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  5242. } while (0)
  5243. /* Introduce new RX counters to support 320MHZ support and punctured modes */
  5244. typedef enum {
  5245. HTT_RX_PDEV_STATS_PUNCTURED_NONE = 0,
  5246. HTT_RX_PDEV_STATS_PUNCTURED_20 = 1,
  5247. HTT_RX_PDEV_STATS_PUNCTURED_40 = 2,
  5248. HTT_RX_PDEV_STATS_PUNCTURED_80 = 3,
  5249. HTT_RX_PDEV_STATS_PUNCTURED_120 = 4,
  5250. HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  5251. } HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  5252. #define HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  5253. typedef struct {
  5254. htt_tlv_hdr_t tlv_hdr;
  5255. /**
  5256. * BIT [ 7 : 0] :- mac_id
  5257. * BIT [31 : 8] :- reserved
  5258. */
  5259. A_UINT32 mac_id__word;
  5260. A_UINT32 nsts;
  5261. /** Number of rx ldpc packets */
  5262. A_UINT32 rx_ldpc;
  5263. /** Number of rx rts packets */
  5264. A_UINT32 rts_cnt;
  5265. /** units = dB above noise floor */
  5266. A_UINT32 rssi_mgmt;
  5267. /** units = dB above noise floor */
  5268. A_UINT32 rssi_data;
  5269. /** units = dB above noise floor */
  5270. A_UINT32 rssi_comb;
  5271. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5272. /** element 0,1, ...7 -> NSS 1,2, ...8 */
  5273. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5274. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  5275. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5276. /** element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  5277. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5278. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  5279. /** units = dB above noise floor */
  5280. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5281. /** Counters to track number of rx packets in each GI in each mcs (0-11) */
  5282. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5283. /** rx Signal Strength value in dBm unit */
  5284. A_INT32 rssi_in_dbm;
  5285. A_UINT32 rx_11ax_su_ext;
  5286. A_UINT32 rx_11ac_mumimo;
  5287. A_UINT32 rx_11ax_mumimo;
  5288. A_UINT32 rx_11ax_ofdma;
  5289. A_UINT32 txbf;
  5290. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  5291. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  5292. A_UINT32 rx_active_dur_us_low;
  5293. A_UINT32 rx_active_dur_us_high;
  5294. /** number of times UL MU MIMO RX packets received */
  5295. A_UINT32 rx_11ax_ul_ofdma;
  5296. /** 11AX HE UL OFDMA RX TB PPDU MCS stats */
  5297. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5298. /** 11AX HE UL OFDMA RX TB PPDU GI stats */
  5299. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5300. /**
  5301. * 11AX HE UL OFDMA RX TB PPDU NSS stats
  5302. * (Increments the individual user NSS in the OFDMA PPDU received)
  5303. */
  5304. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5305. /** 11AX HE UL OFDMA RX TB PPDU BW stats */
  5306. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  5307. /** Number of times UL OFDMA TB PPDUs received with stbc */
  5308. A_UINT32 ul_ofdma_rx_stbc;
  5309. /** Number of times UL OFDMA TB PPDUs received with ldpc */
  5310. A_UINT32 ul_ofdma_rx_ldpc;
  5311. /**
  5312. * Number of non data PPDUs received for each degree (number of users)
  5313. * in UL OFDMA
  5314. */
  5315. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5316. /**
  5317. * Number of data ppdus received for each degree (number of users)
  5318. * in UL OFDMA
  5319. */
  5320. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5321. /**
  5322. * Number of mpdus passed for each degree (number of users)
  5323. * in UL OFDMA TB PPDU
  5324. */
  5325. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5326. /**
  5327. * Number of mpdus failed for each degree (number of users)
  5328. * in UL OFDMA TB PPDU
  5329. */
  5330. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5331. A_UINT32 nss_count;
  5332. A_UINT32 pilot_count;
  5333. /** RxEVM stats in dB */
  5334. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  5335. /**
  5336. * EVM mean across pilots, computed as
  5337. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  5338. */
  5339. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5340. /** dBm units */
  5341. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5342. /** per_chain_rssi_pkt_type:
  5343. * This field shows what type of rx frame the per-chain RSSI was computed
  5344. * on, by recording the frame type and sub-type as bit-fields within this
  5345. * field:
  5346. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  5347. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  5348. * BIT [31 : 8] :- Reserved
  5349. */
  5350. A_UINT32 per_chain_rssi_pkt_type;
  5351. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5352. A_UINT32 rx_su_ndpa;
  5353. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5354. A_UINT32 rx_mu_ndpa;
  5355. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5356. A_UINT32 rx_br_poll;
  5357. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5358. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  5359. /**
  5360. * Number of non data ppdus received for each degree (number of users)
  5361. * with UL MUMIMO
  5362. */
  5363. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5364. /**
  5365. * Number of data ppdus received for each degree (number of users)
  5366. * with UL MUMIMO
  5367. */
  5368. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5369. /**
  5370. * Number of mpdus passed for each degree (number of users)
  5371. * with UL MUMIMO TB PPDU
  5372. */
  5373. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5374. /**
  5375. * Number of mpdus failed for each degree (number of users)
  5376. * with UL MUMIMO TB PPDU
  5377. */
  5378. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  5379. /**
  5380. * Number of non data ppdus received for each degree (number of users)
  5381. * in UL OFDMA
  5382. */
  5383. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5384. /**
  5385. * Number of data ppdus received for each degree (number of users)
  5386. *in UL OFDMA
  5387. */
  5388. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  5389. /* Stats for MCS 12/13 */
  5390. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5391. /*
  5392. * NOTE - this TLV is already large enough that it causes the HTT message
  5393. * carrying it to be nearly at the message size limit that applies to
  5394. * many targets/hosts.
  5395. * No further fields should be added to this TLV without very careful
  5396. * review to ensure the size increase is acceptable.
  5397. */
  5398. } htt_stats_rx_pdev_rate_stats_tlv;
  5399. /* preserve old name alias for new name consistent with the tag name */
  5400. typedef htt_stats_rx_pdev_rate_stats_tlv htt_rx_pdev_rate_stats_tlv;
  5401. typedef struct {
  5402. htt_tlv_hdr_t tlv_hdr;
  5403. /** Tx PPDU duration histogram **/
  5404. A_UINT32 rx_ppdu_dur_hist[HTT_PDEV_STATS_PPDU_DUR_HIST_BINS];
  5405. } htt_stats_rx_pdev_ppdu_dur_tlv;
  5406. /* preserve old name alias for new name consistent with the tag name */
  5407. typedef htt_stats_rx_pdev_ppdu_dur_tlv htt_rx_pdev_ppdu_dur_stats_tlv;
  5408. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  5409. * TLV_TAGS:
  5410. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  5411. */
  5412. /* NOTE:
  5413. * This structure is for documentation, and cannot be safely used directly.
  5414. * Instead, use the constituent TLV structures to fill/parse.
  5415. */
  5416. #ifdef ATH_TARGET
  5417. typedef struct {
  5418. htt_stats_rx_pdev_rate_stats_tlv rate_tlv;
  5419. htt_stats_rx_pdev_ppdu_dur_tlv rx_ppdu_dur_tlv;
  5420. } htt_rx_pdev_rate_stats_t;
  5421. #endif /* ATH_TARGET */
  5422. typedef struct {
  5423. htt_tlv_hdr_t tlv_hdr;
  5424. /** units = dB above noise floor */
  5425. A_UINT8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  5426. A_INT8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  5427. /** rx mcast signal strength value in dBm unit */
  5428. A_INT32 rssi_mcast_in_dbm;
  5429. /** rx mgmt packet signal Strength value in dBm unit */
  5430. A_INT32 rssi_mgmt_in_dbm;
  5431. /*
  5432. * Stats for MCS 0-13 since rx_pdev_rate_stats_tlv cannot be updated,
  5433. * due to message size limitations.
  5434. */
  5435. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5436. A_UINT32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5437. A_UINT32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5438. A_UINT32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5439. A_UINT32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5440. A_UINT32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5441. A_UINT32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5442. A_UINT32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  5443. /* MCS 14,15 */
  5444. A_UINT32 rx_mcs_ext_2[HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5445. A_UINT32 rx_bw_ext[HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS];
  5446. A_UINT32 rx_gi_ext_2[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  5447. A_UINT32 rx_su_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5448. A_UINT32 reduced_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5449. 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 */
  5450. 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];
  5451. } htt_stats_rx_pdev_rate_ext_stats_tlv;
  5452. /* preserve old name alias for new name consistent with the tag name */
  5453. typedef htt_stats_rx_pdev_rate_ext_stats_tlv htt_rx_pdev_rate_ext_stats_tlv;
  5454. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  5455. * TLV_TAGS:
  5456. * - HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG
  5457. */
  5458. /* NOTE:
  5459. * This structure is for documentation, and cannot be safely used directly.
  5460. * Instead, use the constituent TLV structures to fill/parse.
  5461. */
  5462. #ifdef ATH_TARGET
  5463. typedef struct {
  5464. htt_stats_rx_pdev_rate_ext_stats_tlv rate_tlv;
  5465. } htt_rx_pdev_rate_ext_stats_t;
  5466. #endif /* ATH_TARGET */
  5467. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  5468. #define HTT_STATS_CMN_MAC_ID_S 0
  5469. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  5470. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  5471. HTT_STATS_CMN_MAC_ID_S)
  5472. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  5473. do { \
  5474. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  5475. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  5476. } while (0)
  5477. #define HTT_RX_UL_MAX_UPLINK_RSSI_TRACK 5
  5478. typedef struct {
  5479. htt_tlv_hdr_t tlv_hdr;
  5480. /**
  5481. * BIT [ 7 : 0] :- mac_id
  5482. * BIT [31 : 8] :- reserved
  5483. */
  5484. A_UINT32 mac_id__word;
  5485. A_UINT32 rx_11ax_ul_ofdma;
  5486. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5487. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5488. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5489. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5490. A_UINT32 ul_ofdma_rx_stbc;
  5491. A_UINT32 ul_ofdma_rx_ldpc;
  5492. /*
  5493. * These are arrays to hold the number of PPDUs that we received per RU.
  5494. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  5495. * array offset 0 and similarly RU52 will be incremented in array offset 1
  5496. */
  5497. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  5498. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  5499. /*
  5500. * These arrays hold Target RSSI (rx power the AP wants),
  5501. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  5502. * which can be identified by AIDs, during trigger based RX.
  5503. * Array acts a circular buffer and holds values for last 5 STAs
  5504. * in the same order as RX.
  5505. */
  5506. /**
  5507. * STA AID array for identifying which STA the
  5508. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  5509. */
  5510. A_UINT32 uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5511. /**
  5512. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  5513. */
  5514. A_INT32 uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5515. /**
  5516. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  5517. */
  5518. A_INT32 uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5519. /**
  5520. * Trig power headroom for STA AID in same idx - UNIT(dB)
  5521. */
  5522. A_UINT32 uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5523. A_UINT32 reduced_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5524. /*
  5525. * Number of HE UL OFDMA per-user responses containing only a QoS null in
  5526. * response to basic trigger. Typically a data response is expected.
  5527. */
  5528. A_UINT32 ul_ofdma_basic_trigger_rx_qos_null_only;
  5529. } htt_stats_rx_pdev_ul_trig_stats_tlv;
  5530. /* preserve old name alias for new name consistent with the tag name */
  5531. typedef htt_stats_rx_pdev_ul_trig_stats_tlv htt_rx_pdev_ul_trigger_stats_tlv;
  5532. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  5533. * TLV_TAGS:
  5534. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  5535. * NOTE:
  5536. * This structure is for documentation, and cannot be safely used directly.
  5537. * Instead, use the constituent TLV structures to fill/parse.
  5538. */
  5539. #ifdef ATH_TARGET
  5540. typedef struct {
  5541. htt_stats_rx_pdev_ul_trig_stats_tlv ul_trigger_tlv;
  5542. } htt_rx_pdev_ul_trigger_stats_t;
  5543. #endif /* ATH_TARGET */
  5544. typedef struct {
  5545. htt_tlv_hdr_t tlv_hdr;
  5546. /**
  5547. * BIT [ 7 : 0] :- mac_id
  5548. * BIT [31 : 8] :- reserved
  5549. */
  5550. A_UINT32 mac_id__word;
  5551. A_UINT32 rx_11be_ul_ofdma;
  5552. A_UINT32 be_ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5553. A_UINT32 be_ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5554. A_UINT32 be_ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  5555. A_UINT32 be_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5556. A_UINT32 be_ul_ofdma_rx_stbc;
  5557. A_UINT32 be_ul_ofdma_rx_ldpc;
  5558. /*
  5559. * These are arrays to hold the number of PPDUs that we received per RU.
  5560. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  5561. * array offset 0 and similarly RU52 will be incremented in array offset 1
  5562. */
  5563. /** PPDU level */
  5564. A_UINT32 be_rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5565. /** PPDU level */
  5566. A_UINT32 be_rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  5567. /*
  5568. * These arrays hold Target RSSI (rx power the AP wants),
  5569. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  5570. * which can be identified by AIDs, during trigger based RX.
  5571. * Array acts a circular buffer and holds values for last 5 STAs
  5572. * in the same order as RX.
  5573. */
  5574. /**
  5575. * STA AID array for identifying which STA the
  5576. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  5577. */
  5578. A_UINT32 be_uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5579. /**
  5580. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  5581. */
  5582. A_INT32 be_uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5583. /**
  5584. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  5585. */
  5586. A_INT32 be_uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5587. /**
  5588. * Trig power headroom for STA AID in same idx - UNIT(dB)
  5589. */
  5590. A_UINT32 be_uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  5591. /*
  5592. * Number of EHT UL OFDMA per-user responses containing only a QoS null in
  5593. * response to basic trigger. Typically a data response is expected.
  5594. */
  5595. A_UINT32 be_ul_ofdma_basic_trigger_rx_qos_null_only;
  5596. /* UL MLO Queue Depth Sharing Stats */
  5597. A_UINT32 ul_mlo_send_qdepth_params_count;
  5598. A_UINT32 ul_mlo_proc_qdepth_params_count;
  5599. A_UINT32 ul_mlo_proc_accepted_qdepth_params_count;
  5600. A_UINT32 ul_mlo_proc_discarded_qdepth_params_count;
  5601. } htt_stats_rx_pdev_be_ul_trig_stats_tlv;
  5602. /* preserve old name alias for new name consistent with the tag name */
  5603. typedef htt_stats_rx_pdev_be_ul_trig_stats_tlv
  5604. htt_rx_pdev_be_ul_trigger_stats_tlv;
  5605. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  5606. * TLV_TAGS:
  5607. * - HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG
  5608. * NOTE:
  5609. * This structure is for documentation, and cannot be safely used directly.
  5610. * Instead, use the constituent TLV structures to fill/parse.
  5611. */
  5612. #ifdef ATH_TARGET
  5613. typedef struct {
  5614. htt_stats_rx_pdev_be_ul_trig_stats_tlv ul_trigger_tlv;
  5615. } htt_rx_pdev_be_ul_trigger_stats_t;
  5616. #endif /* ATH_TARGET */
  5617. typedef struct {
  5618. htt_tlv_hdr_t tlv_hdr;
  5619. A_UINT32 user_index;
  5620. /** PPDU level */
  5621. A_UINT32 rx_ulofdma_non_data_ppdu;
  5622. /** PPDU level */
  5623. A_UINT32 rx_ulofdma_data_ppdu;
  5624. /** MPDU level */
  5625. A_UINT32 rx_ulofdma_mpdu_ok;
  5626. /** MPDU level */
  5627. A_UINT32 rx_ulofdma_mpdu_fail;
  5628. A_UINT32 rx_ulofdma_non_data_nusers;
  5629. A_UINT32 rx_ulofdma_data_nusers;
  5630. } htt_stats_rx_pdev_ul_ofdma_user_stats_tlv;
  5631. /* preserve old name alias for new name consistent with the tag name */
  5632. typedef htt_stats_rx_pdev_ul_ofdma_user_stats_tlv
  5633. htt_rx_pdev_ul_ofdma_user_stats_tlv;
  5634. typedef struct {
  5635. htt_tlv_hdr_t tlv_hdr;
  5636. A_UINT32 user_index;
  5637. /** PPDU level */
  5638. A_UINT32 be_rx_ulofdma_non_data_ppdu;
  5639. /** PPDU level */
  5640. A_UINT32 be_rx_ulofdma_data_ppdu;
  5641. /** MPDU level */
  5642. A_UINT32 be_rx_ulofdma_mpdu_ok;
  5643. /** MPDU level */
  5644. A_UINT32 be_rx_ulofdma_mpdu_fail;
  5645. A_UINT32 be_rx_ulofdma_non_data_nusers;
  5646. A_UINT32 be_rx_ulofdma_data_nusers;
  5647. } htt_stats_rx_pdev_be_ul_ofdma_user_stats_tlv;
  5648. /* preserve old name alias for new name consistent with the tag name */
  5649. typedef htt_stats_rx_pdev_be_ul_ofdma_user_stats_tlv
  5650. htt_rx_pdev_be_ul_ofdma_user_stats_tlv;
  5651. typedef struct {
  5652. htt_tlv_hdr_t tlv_hdr;
  5653. A_UINT32 user_index;
  5654. /** PPDU level */
  5655. A_UINT32 rx_ulmumimo_non_data_ppdu;
  5656. /** PPDU level */
  5657. A_UINT32 rx_ulmumimo_data_ppdu;
  5658. /** MPDU level */
  5659. A_UINT32 rx_ulmumimo_mpdu_ok;
  5660. /** MPDU level */
  5661. A_UINT32 rx_ulmumimo_mpdu_fail;
  5662. } htt_stats_rx_pdev_ul_mimo_user_stats_tlv;
  5663. /* preserve old name alias for new name consistent with the tag name */
  5664. typedef htt_stats_rx_pdev_ul_mimo_user_stats_tlv
  5665. htt_rx_pdev_ul_mimo_user_stats_tlv;
  5666. typedef struct {
  5667. htt_tlv_hdr_t tlv_hdr;
  5668. A_UINT32 user_index;
  5669. /** PPDU level */
  5670. A_UINT32 be_rx_ulmumimo_non_data_ppdu;
  5671. /** PPDU level */
  5672. A_UINT32 be_rx_ulmumimo_data_ppdu;
  5673. /** MPDU level */
  5674. A_UINT32 be_rx_ulmumimo_mpdu_ok;
  5675. /** MPDU level */
  5676. A_UINT32 be_rx_ulmumimo_mpdu_fail;
  5677. } htt_stats_rx_pdev_be_ul_mimo_user_stats_tlv;
  5678. /* preserve old name alias for new name consistent with the tag name */
  5679. typedef htt_stats_rx_pdev_be_ul_mimo_user_stats_tlv
  5680. htt_rx_pdev_be_ul_mimo_user_stats_tlv;
  5681. /* == RX PDEV/SOC STATS == */
  5682. typedef struct {
  5683. htt_tlv_hdr_t tlv_hdr;
  5684. /**
  5685. * BIT [7:0] :- mac_id
  5686. * BIT [31:8] :- reserved
  5687. *
  5688. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  5689. */
  5690. A_UINT32 mac_id__word;
  5691. /** Number of times UL MUMIMO RX packets received */
  5692. A_UINT32 rx_11ax_ul_mumimo;
  5693. /** 11AX HE UL MU-MIMO RX TB PPDU MCS stats */
  5694. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5695. /**
  5696. * 11AX HE UL MU-MIMO RX GI & LTF stats.
  5697. * Index 0 indicates 1xLTF + 1.6 msec GI
  5698. * Index 1 indicates 2xLTF + 1.6 msec GI
  5699. * Index 2 indicates 4xLTF + 3.2 msec GI
  5700. */
  5701. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  5702. /**
  5703. * 11AX HE UL MU-MIMO RX TB PPDU NSS stats
  5704. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  5705. */
  5706. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5707. /** 11AX HE UL MU-MIMO RX TB PPDU BW stats */
  5708. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5709. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  5710. A_UINT32 ul_mumimo_rx_stbc;
  5711. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  5712. A_UINT32 ul_mumimo_rx_ldpc;
  5713. /* Stats for MCS 12/13 */
  5714. A_UINT32 ul_mumimo_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5715. A_UINT32 ul_mumimo_rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  5716. /** RSSI in dBm for Rx TB PPDUs */
  5717. A_INT8 rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS];
  5718. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  5719. A_INT8 rx_ul_mumimo_target_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5720. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  5721. A_INT8 rx_ul_mumimo_fd_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5722. /** Average pilot EVM measued for RX UL TB PPDU */
  5723. 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];
  5724. A_UINT32 reduced_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  5725. /*
  5726. * Number of HE UL MU-MIMO per-user responses containing only a QoS null in
  5727. * response to basic trigger. Typically a data response is expected.
  5728. */
  5729. A_UINT32 ul_mumimo_basic_trigger_rx_qos_null_only;
  5730. } htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv;
  5731. /* preserve old name alias for new name consistent with the tag name */
  5732. typedef htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv
  5733. htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  5734. typedef struct {
  5735. htt_tlv_hdr_t tlv_hdr;
  5736. /**
  5737. * BIT [7:0] :- mac_id
  5738. * BIT [31:8] :- reserved
  5739. *
  5740. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  5741. */
  5742. A_UINT32 mac_id__word;
  5743. /** Number of times UL MUMIMO RX packets received */
  5744. A_UINT32 rx_11be_ul_mumimo;
  5745. /** 11BE EHT UL MU-MIMO RX TB PPDU MCS stats */
  5746. A_UINT32 be_ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5747. /**
  5748. * 11BE EHT UL MU-MIMO RX GI & LTF stats.
  5749. * Index 0 indicates 1xLTF + 1.6 msec GI
  5750. * Index 1 indicates 2xLTF + 1.6 msec GI
  5751. * Index 2 indicates 4xLTF + 3.2 msec GI
  5752. */
  5753. A_UINT32 be_ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  5754. /**
  5755. * 11BE EHT UL MU-MIMO RX TB PPDU NSS stats
  5756. * (Increments the individual user NSS in the UL MU MIMO PPDU received)
  5757. */
  5758. A_UINT32 be_ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5759. /** 11BE EHT UL MU-MIMO RX TB PPDU BW stats */
  5760. A_UINT32 be_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5761. /** Number of times UL MUMIMO TB PPDUs received with STBC */
  5762. A_UINT32 be_ul_mumimo_rx_stbc;
  5763. /** Number of times UL MUMIMO TB PPDUs received with LDPC */
  5764. A_UINT32 be_ul_mumimo_rx_ldpc;
  5765. /** RSSI in dBm for Rx TB PPDUs */
  5766. 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];
  5767. /** Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  5768. A_INT8 be_rx_ul_mumimo_target_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  5769. /** FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  5770. A_INT8 be_rx_ul_mumimo_fd_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5771. /** Average pilot EVM measued for RX UL TB PPDU */
  5772. A_INT8 be_rx_ulmumimo_pilot_evm_dB_mean[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  5773. /** Number of times UL MUMIMO TB PPDUs received in a punctured mode */
  5774. A_UINT32 rx_ul_mumimo_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  5775. /*
  5776. * Number of EHT UL MU-MIMO per-user responses containing only a QoS null
  5777. * in response to basic trigger. Typically a data response is expected.
  5778. */
  5779. A_UINT32 be_ul_mumimo_basic_trigger_rx_qos_null_only;
  5780. } htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  5781. /* preserve old name alias for new name consistent with the tag name */
  5782. typedef htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv
  5783. htt_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  5784. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  5785. * TLV_TAGS:
  5786. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  5787. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG
  5788. */
  5789. #ifdef ATH_TARGET
  5790. typedef struct {
  5791. htt_stats_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  5792. htt_stats_rx_pdev_ul_mumimo_trig_be_stats_tlv ul_mumimo_trig_be_tlv;
  5793. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  5794. #endif /* ATH_TARGET */
  5795. typedef struct {
  5796. htt_tlv_hdr_t tlv_hdr;
  5797. /** Num Packets received on REO FW ring */
  5798. A_UINT32 fw_reo_ring_data_msdu;
  5799. /** Num bc/mc packets indicated from fw to host */
  5800. A_UINT32 fw_to_host_data_msdu_bcmc;
  5801. /** Num unicast packets indicated from fw to host */
  5802. A_UINT32 fw_to_host_data_msdu_uc;
  5803. /** Num remote buf recycle from offload */
  5804. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  5805. /** Num remote free buf given to offload */
  5806. A_UINT32 ofld_remote_free_buf_indication_cnt;
  5807. /** Num unicast packets from local path indicated to host */
  5808. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  5809. /** Num unicast packets from REO indicated to host */
  5810. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  5811. /** Num Packets received from WBM SW1 ring */
  5812. A_UINT32 wbm_sw_ring_reap;
  5813. /** Num packets from WBM forwarded from fw to host via WBM */
  5814. A_UINT32 wbm_forward_to_host_cnt;
  5815. /** Num packets from WBM recycled to target refill ring */
  5816. A_UINT32 wbm_target_recycle_cnt;
  5817. /**
  5818. * Total Num of recycled to refill ring,
  5819. * including packets from WBM and REO
  5820. */
  5821. A_UINT32 target_refill_ring_recycle_cnt;
  5822. } htt_stats_rx_soc_fw_stats_tlv;
  5823. /* preserve old name alias for new name consistent with the tag name */
  5824. typedef htt_stats_rx_soc_fw_stats_tlv htt_rx_soc_fw_stats_tlv;
  5825. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5826. /* NOTE: Variable length TLV, use length spec to infer array size */
  5827. typedef struct {
  5828. htt_tlv_hdr_t tlv_hdr;
  5829. /** refill_ring_empty_cnt:
  5830. * Num ring empty encountered,
  5831. * HTT_RX_STATS_REFILL_MAX_RING
  5832. */
  5833. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, refill_ring_empty_cnt);
  5834. } htt_stats_rx_soc_fw_refill_ring_empty_tlv;
  5835. /* preserve old name alias for new name consistent with the tag name */
  5836. typedef htt_stats_rx_soc_fw_refill_ring_empty_tlv
  5837. htt_rx_soc_fw_refill_ring_empty_tlv_v;
  5838. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  5839. /* NOTE: Variable length TLV, use length spec to infer array size */
  5840. typedef struct {
  5841. htt_tlv_hdr_t tlv_hdr;
  5842. /** refill_ring_num_refill:
  5843. * Num total buf refilled from refill ring,
  5844. * HTT_RX_STATS_REFILL_MAX_RING
  5845. */
  5846. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, refill_ring_num_refill);
  5847. } htt_stats_rx_soc_fw_refill_ring_num_refill_tlv;
  5848. /* preserve old name alias for new name consistent with the tag name */
  5849. typedef htt_stats_rx_soc_fw_refill_ring_num_refill_tlv
  5850. htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  5851. /* RXDMA error code from WBM released packets */
  5852. typedef enum {
  5853. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  5854. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  5855. HTT_RX_RXDMA_FCS_ERR = 2,
  5856. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  5857. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  5858. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  5859. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  5860. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  5861. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  5862. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  5863. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  5864. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  5865. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  5866. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  5867. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  5868. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  5869. /*
  5870. * This MAX_ERR_CODE should not be used in any host/target messages,
  5871. * so that even though it is defined within a host/target interface
  5872. * definition header file, it isn't actually part of the host/target
  5873. * interface, and thus can be modified.
  5874. */
  5875. HTT_RX_RXDMA_MAX_ERR_CODE
  5876. } htt_rx_rxdma_error_code_enum;
  5877. /* NOTE: Variable length TLV, use length spec to infer array size */
  5878. typedef struct {
  5879. htt_tlv_hdr_t tlv_hdr;
  5880. /** NOTE:
  5881. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  5882. * It is expected but not required that the target will provide a rxdma_err element
  5883. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  5884. * MAX_ERR_CODE. The host should ignore any array elements whose
  5885. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5886. *
  5887. * HTT_RX_RXDMA_MAX_ERR_CODE
  5888. */
  5889. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, rxdma_err);
  5890. } htt_stats_rx_refill_rxdma_err_tlv;
  5891. /* preserve old name alias for new name consistent with the tag name */
  5892. typedef htt_stats_rx_refill_rxdma_err_tlv
  5893. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  5894. /* REO error code from WBM released packets */
  5895. typedef enum {
  5896. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  5897. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  5898. HTT_RX_AMPDU_IN_NON_BA = 2,
  5899. HTT_RX_NON_BA_DUPLICATE = 3,
  5900. HTT_RX_BA_DUPLICATE = 4,
  5901. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  5902. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  5903. HTT_RX_REGULAR_FRAME_OOR = 7,
  5904. HTT_RX_BAR_FRAME_OOR = 8,
  5905. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  5906. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  5907. HTT_RX_PN_CHECK_FAILED = 11,
  5908. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  5909. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  5910. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  5911. HTT_RX_REO_ERR_CODE_RVSD = 15,
  5912. /*
  5913. * This MAX_ERR_CODE should not be used in any host/target messages,
  5914. * so that even though it is defined within a host/target interface
  5915. * definition header file, it isn't actually part of the host/target
  5916. * interface, and thus can be modified.
  5917. */
  5918. HTT_RX_REO_MAX_ERR_CODE
  5919. } htt_rx_reo_error_code_enum;
  5920. /* NOTE: Variable length TLV, use length spec to infer array size */
  5921. typedef struct {
  5922. htt_tlv_hdr_t tlv_hdr;
  5923. /** NOTE:
  5924. * The mapping of REO error types to reo_err array elements is HW dependent.
  5925. * It is expected but not required that the target will provide a rxdma_err element
  5926. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  5927. * MAX_ERR_CODE. The host should ignore any array elements whose
  5928. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  5929. *
  5930. * HTT_RX_REO_MAX_ERR_CODE
  5931. */
  5932. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, reo_err);
  5933. } htt_stats_rx_refill_reo_err_tlv;
  5934. /* preserve old name alias for new name consistent with the tag name */
  5935. typedef htt_stats_rx_refill_reo_err_tlv
  5936. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  5937. /* NOTE:
  5938. * This structure is for documentation, and cannot be safely used directly.
  5939. * Instead, use the constituent TLV structures to fill/parse.
  5940. */
  5941. #ifdef ATH_TARGET
  5942. typedef struct {
  5943. htt_stats_rx_soc_fw_stats_tlv fw_tlv;
  5944. htt_stats_rx_soc_fw_refill_ring_empty_tlv fw_refill_ring_empty_tlv;
  5945. htt_stats_rx_soc_fw_refill_ring_num_refill_tlv
  5946. fw_refill_ring_num_refill_tlv;
  5947. htt_stats_rx_refill_rxdma_err_tlv fw_refill_ring_num_rxdma_err_tlv;
  5948. htt_stats_rx_refill_reo_err_tlv fw_refill_ring_num_reo_err_tlv;
  5949. } htt_rx_soc_stats_t;
  5950. #endif /* ATH_TARGET */
  5951. /* == RX PDEV STATS == */
  5952. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  5953. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  5954. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  5955. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  5956. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  5957. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  5958. do { \
  5959. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  5960. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  5961. } while (0)
  5962. typedef struct {
  5963. htt_tlv_hdr_t tlv_hdr;
  5964. /**
  5965. * BIT [ 7 : 0] :- mac_id
  5966. * BIT [31 : 8] :- reserved
  5967. */
  5968. A_UINT32 mac_id__word;
  5969. /** Num PPDU status processed from HW */
  5970. A_UINT32 ppdu_recvd;
  5971. /** Num MPDU across PPDUs with FCS ok */
  5972. A_UINT32 mpdu_cnt_fcs_ok;
  5973. /** Num MPDU across PPDUs with FCS err */
  5974. A_UINT32 mpdu_cnt_fcs_err;
  5975. /** Num MSDU across PPDUs */
  5976. A_UINT32 tcp_msdu_cnt;
  5977. /** Num MSDU across PPDUs */
  5978. A_UINT32 tcp_ack_msdu_cnt;
  5979. /** Num MSDU across PPDUs */
  5980. A_UINT32 udp_msdu_cnt;
  5981. /** Num MSDU across PPDUs */
  5982. A_UINT32 other_msdu_cnt;
  5983. /** Num MPDU on FW ring indicated */
  5984. A_UINT32 fw_ring_mpdu_ind;
  5985. /** Num MGMT MPDU given to protocol */
  5986. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  5987. /** Num ctrl MPDU given to protocol */
  5988. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  5989. /** Num mcast data packet received */
  5990. A_UINT32 fw_ring_mcast_data_msdu;
  5991. /** Num broadcast data packet received */
  5992. A_UINT32 fw_ring_bcast_data_msdu;
  5993. /** Num unicast data packet received */
  5994. A_UINT32 fw_ring_ucast_data_msdu;
  5995. /** Num null data packet received */
  5996. A_UINT32 fw_ring_null_data_msdu;
  5997. /** Num MPDU on FW ring dropped */
  5998. A_UINT32 fw_ring_mpdu_drop;
  5999. /** Num buf indication to offload */
  6000. A_UINT32 ofld_local_data_ind_cnt;
  6001. /** Num buf recycle from offload */
  6002. A_UINT32 ofld_local_data_buf_recycle_cnt;
  6003. /** Num buf indication to data_rx */
  6004. A_UINT32 drx_local_data_ind_cnt;
  6005. /** Num buf recycle from data_rx */
  6006. A_UINT32 drx_local_data_buf_recycle_cnt;
  6007. /** Num buf indication to protocol */
  6008. A_UINT32 local_nondata_ind_cnt;
  6009. /** Num buf recycle from protocol */
  6010. A_UINT32 local_nondata_buf_recycle_cnt;
  6011. /** Num buf fed */
  6012. A_UINT32 fw_status_buf_ring_refill_cnt;
  6013. /** Num ring empty encountered */
  6014. A_UINT32 fw_status_buf_ring_empty_cnt;
  6015. /** Num buf fed */
  6016. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  6017. /** Num ring empty encountered */
  6018. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  6019. /** Num buf fed */
  6020. A_UINT32 fw_link_buf_ring_refill_cnt;
  6021. /** Num ring empty encountered */
  6022. A_UINT32 fw_link_buf_ring_empty_cnt;
  6023. /** Num buf fed */
  6024. A_UINT32 host_pkt_buf_ring_refill_cnt;
  6025. /** Num ring empty encountered */
  6026. A_UINT32 host_pkt_buf_ring_empty_cnt;
  6027. /** Num buf fed */
  6028. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  6029. /** Num ring empty encountered */
  6030. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  6031. /** Num buf fed */
  6032. A_UINT32 mon_status_buf_ring_refill_cnt;
  6033. /** Num ring empty encountered */
  6034. A_UINT32 mon_status_buf_ring_empty_cnt;
  6035. /** Num buf fed */
  6036. A_UINT32 mon_desc_buf_ring_refill_cnt;
  6037. /** Num ring empty encountered */
  6038. A_UINT32 mon_desc_buf_ring_empty_cnt;
  6039. /** Num buf fed */
  6040. A_UINT32 mon_dest_ring_update_cnt;
  6041. /** Num ring full encountered */
  6042. A_UINT32 mon_dest_ring_full_cnt;
  6043. /** Num rx suspend is attempted */
  6044. A_UINT32 rx_suspend_cnt;
  6045. /** Num rx suspend failed */
  6046. A_UINT32 rx_suspend_fail_cnt;
  6047. /** Num rx resume attempted */
  6048. A_UINT32 rx_resume_cnt;
  6049. /** Num rx resume failed */
  6050. A_UINT32 rx_resume_fail_cnt;
  6051. /** Num rx ring switch */
  6052. A_UINT32 rx_ring_switch_cnt;
  6053. /** Num rx ring restore */
  6054. A_UINT32 rx_ring_restore_cnt;
  6055. /** Num rx flush issued */
  6056. A_UINT32 rx_flush_cnt;
  6057. /** Num rx recovery */
  6058. A_UINT32 rx_recovery_reset_cnt;
  6059. } htt_stats_rx_pdev_fw_stats_tlv;
  6060. /* preserve old name alias for new name consistent with the tag name */
  6061. typedef htt_stats_rx_pdev_fw_stats_tlv htt_rx_pdev_fw_stats_tlv;
  6062. typedef struct {
  6063. htt_tlv_hdr_t tlv_hdr;
  6064. /** peer mac address */
  6065. htt_mac_addr peer_mac_addr;
  6066. /** Num of tx mgmt frames with subtype on peer level */
  6067. A_UINT32 peer_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  6068. /** Num of rx mgmt frames with subtype on peer level */
  6069. A_UINT32 peer_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  6070. } htt_stats_peer_ctrl_path_txrx_stats_tlv;
  6071. /* preserve old name alias for new name consistent with the tag name */
  6072. typedef htt_stats_peer_ctrl_path_txrx_stats_tlv
  6073. htt_peer_ctrl_path_txrx_stats_tlv;
  6074. #define HTT_STATS_PHY_ERR_MAX 43
  6075. typedef struct {
  6076. htt_tlv_hdr_t tlv_hdr;
  6077. /**
  6078. * BIT [ 7 : 0] :- mac_id
  6079. * BIT [31 : 8] :- reserved
  6080. */
  6081. A_UINT32 mac_id__word;
  6082. /** Num of phy err */
  6083. A_UINT32 total_phy_err_cnt;
  6084. /** Counts of different types of phy errs
  6085. * The mapping of PHY error types to phy_err array elements is HW dependent.
  6086. * The only currently-supported mapping is shown below:
  6087. *
  6088. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  6089. * 1 phyrx_err_synth_off
  6090. * 2 phyrx_err_ofdma_timing
  6091. * 3 phyrx_err_ofdma_signal_parity
  6092. * 4 phyrx_err_ofdma_rate_illegal
  6093. * 5 phyrx_err_ofdma_length_illegal
  6094. * 6 phyrx_err_ofdma_restart
  6095. * 7 phyrx_err_ofdma_service
  6096. * 8 phyrx_err_ppdu_ofdma_power_drop
  6097. * 9 phyrx_err_cck_blokker
  6098. * 10 phyrx_err_cck_timing
  6099. * 11 phyrx_err_cck_header_crc
  6100. * 12 phyrx_err_cck_rate_illegal
  6101. * 13 phyrx_err_cck_length_illegal
  6102. * 14 phyrx_err_cck_restart
  6103. * 15 phyrx_err_cck_service
  6104. * 16 phyrx_err_cck_power_drop
  6105. * 17 phyrx_err_ht_crc_err
  6106. * 18 phyrx_err_ht_length_illegal
  6107. * 19 phyrx_err_ht_rate_illegal
  6108. * 20 phyrx_err_ht_zlf
  6109. * 21 phyrx_err_false_radar_ext
  6110. * 22 phyrx_err_green_field
  6111. * 23 phyrx_err_bw_gt_dyn_bw
  6112. * 24 phyrx_err_leg_ht_mismatch
  6113. * 25 phyrx_err_vht_crc_error
  6114. * 26 phyrx_err_vht_siga_unsupported
  6115. * 27 phyrx_err_vht_lsig_len_invalid
  6116. * 28 phyrx_err_vht_ndp_or_zlf
  6117. * 29 phyrx_err_vht_nsym_lt_zero
  6118. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  6119. * 31 phyrx_err_vht_rx_skip_group_id0
  6120. * 32 phyrx_err_vht_rx_skip_group_id1to62
  6121. * 33 phyrx_err_vht_rx_skip_group_id63
  6122. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  6123. * 35 phyrx_err_defer_nap
  6124. * 36 phyrx_err_fdomain_timeout
  6125. * 37 phyrx_err_lsig_rel_check
  6126. * 38 phyrx_err_bt_collision
  6127. * 39 phyrx_err_unsupported_mu_feedback
  6128. * 40 phyrx_err_ppdu_tx_interrupt_rx
  6129. * 41 phyrx_err_unsupported_cbf
  6130. * 42 phyrx_err_other
  6131. */
  6132. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  6133. } htt_stats_rx_pdev_fw_stats_phy_err_tlv;
  6134. /* preserve old name alias for new name consistent with the tag name */
  6135. typedef htt_stats_rx_pdev_fw_stats_phy_err_tlv htt_rx_pdev_fw_stats_phy_err_tlv;
  6136. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  6137. /* NOTE: Variable length TLV, use length spec to infer array size */
  6138. typedef struct {
  6139. htt_tlv_hdr_t tlv_hdr;
  6140. /** fw_ring_mpdu_err:
  6141. * Num error MPDU for each RxDMA error type,
  6142. * HTT_RX_STATS_RXDMA_MAX_ERR
  6143. */
  6144. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw_ring_mpdu_err);
  6145. } htt_stats_rx_pdev_fw_ring_mpdu_err_tlv;
  6146. /* preserve old name alias for new name consistent with the tag name */
  6147. typedef htt_stats_rx_pdev_fw_ring_mpdu_err_tlv
  6148. htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  6149. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  6150. /* NOTE: Variable length TLV, use length spec to infer array size */
  6151. typedef struct {
  6152. htt_tlv_hdr_t tlv_hdr;
  6153. /** fw_mpdu_drop:
  6154. * Num MPDU dropped,
  6155. * HTT_RX_STATS_FW_DROP_REASON_MAX
  6156. */
  6157. HTT_STATS_VAR_LEN_ARRAY1(A_UINT32, fw_mpdu_drop);
  6158. } htt_stats_rx_pdev_fw_mpdu_drop_tlv;
  6159. /* preserve old name alias for new name consistent with the tag name */
  6160. typedef htt_stats_rx_pdev_fw_mpdu_drop_tlv htt_rx_pdev_fw_mpdu_drop_tlv_v;
  6161. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  6162. * TLV_TAGS:
  6163. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  6164. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  6165. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  6166. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  6167. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  6168. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  6169. */
  6170. /* NOTE:
  6171. * This structure is for documentation, and cannot be safely used directly.
  6172. * Instead, use the constituent TLV structures to fill/parse.
  6173. */
  6174. #ifdef ATH_TARGET
  6175. typedef struct {
  6176. htt_rx_soc_stats_t soc_stats;
  6177. htt_stats_rx_pdev_fw_stats_tlv fw_stats_tlv;
  6178. htt_stats_rx_pdev_fw_ring_mpdu_err_tlv fw_ring_mpdu_err_tlv;
  6179. htt_stats_rx_pdev_fw_mpdu_drop_tlv fw_ring_mpdu_drop;
  6180. htt_stats_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  6181. } htt_rx_pdev_stats_t;
  6182. #endif /* ATH_TARGET */
  6183. /* STATS_TYPE : HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  6184. * TLV_TAGS:
  6185. * - HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG
  6186. *
  6187. */
  6188. #ifdef ATH_TARGET
  6189. typedef struct {
  6190. htt_stats_peer_ctrl_path_txrx_stats_tlv peer_ctrl_path_txrx_stats_tlv;
  6191. } htt_ctrl_path_txrx_stats_t;
  6192. #endif /* ATH_TARGET */
  6193. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  6194. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  6195. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  6196. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  6197. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  6198. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  6199. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  6200. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  6201. typedef struct {
  6202. htt_tlv_hdr_t tlv_hdr;
  6203. /* Below values are obtained from the HW Cycles counter registers */
  6204. A_UINT32 tx_frame_usec;
  6205. A_UINT32 rx_frame_usec;
  6206. A_UINT32 rx_clear_usec;
  6207. A_UINT32 my_rx_frame_usec;
  6208. A_UINT32 usec_cnt;
  6209. A_UINT32 med_rx_idle_usec;
  6210. A_UINT32 med_tx_idle_global_usec;
  6211. A_UINT32 cca_obss_usec;
  6212. A_UINT32 pre_rx_frame_usec;
  6213. } htt_stats_pdev_cca_counters_tlv;
  6214. /* preserve old name alias for new name consistent with the tag name */
  6215. typedef htt_stats_pdev_cca_counters_tlv htt_pdev_stats_cca_counters_tlv;
  6216. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  6217. * due to lack of support in some host stats infrastructures for
  6218. * TLVs nested within TLVs.
  6219. */
  6220. typedef struct {
  6221. htt_tlv_hdr_t tlv_hdr;
  6222. /** The channel number on which these stats were collected */
  6223. A_UINT32 chan_num;
  6224. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  6225. A_UINT32 num_records;
  6226. /**
  6227. * Bit map of valid CCA counters
  6228. * Bit0 - tx_frame_usec
  6229. * Bit1 - rx_frame_usec
  6230. * Bit2 - rx_clear_usec
  6231. * Bit3 - my_rx_frame_usec
  6232. * bit4 - usec_cnt
  6233. * Bit5 - med_rx_idle_usec
  6234. * Bit6 - med_tx_idle_global_usec
  6235. * Bit7 - cca_obss_usec
  6236. *
  6237. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  6238. */
  6239. A_UINT32 valid_cca_counters_bitmap;
  6240. /** Indicates the stats collection interval
  6241. * Valid Values:
  6242. * 100 - For the 100ms interval CCA stats histogram
  6243. * 1000 - For 1sec interval CCA histogram
  6244. * 0xFFFFFFFF - For Cumulative CCA Stats
  6245. */
  6246. A_UINT32 collection_interval;
  6247. /**
  6248. * This will be followed by an array which contains the CCA stats
  6249. * collected in the last N intervals,
  6250. * if the indication is for last N intervals CCA stats.
  6251. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  6252. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  6253. */
  6254. HTT_STATS_VAR_LEN_ARRAY1(htt_stats_pdev_cca_counters_tlv, cca_hist_tlv);
  6255. } htt_pdev_cca_stats_hist_tlv;
  6256. typedef struct {
  6257. htt_tlv_hdr_t tlv_hdr;
  6258. /** The channel number on which these stats were collected */
  6259. A_UINT32 chan_num;
  6260. /** num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  6261. A_UINT32 num_records;
  6262. /**
  6263. * Bit map of valid CCA counters
  6264. * Bit0 - tx_frame_usec
  6265. * Bit1 - rx_frame_usec
  6266. * Bit2 - rx_clear_usec
  6267. * Bit3 - my_rx_frame_usec
  6268. * bit4 - usec_cnt
  6269. * Bit5 - med_rx_idle_usec
  6270. * Bit6 - med_tx_idle_global_usec
  6271. * Bit7 - cca_obss_usec
  6272. *
  6273. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  6274. */
  6275. A_UINT32 valid_cca_counters_bitmap;
  6276. /** Indicates the stats collection interval
  6277. * Valid Values:
  6278. * 100 - For the 100ms interval CCA stats histogram
  6279. * 1000 - For 1sec interval CCA histogram
  6280. * 0xFFFFFFFF - For Cumulative CCA Stats
  6281. */
  6282. A_UINT32 collection_interval;
  6283. /**
  6284. * This will be followed by an array which contains the CCA stats
  6285. * collected in the last N intervals,
  6286. * if the indication is for last N intervals CCA stats.
  6287. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  6288. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  6289. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  6290. */
  6291. } htt_pdev_cca_stats_hist_v1_tlv;
  6292. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000000f
  6293. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  6294. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_M 0x0000fff0
  6295. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S 4
  6296. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  6297. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  6298. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  6299. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  6300. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  6301. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  6302. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  6303. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  6304. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  6305. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  6306. do { \
  6307. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  6308. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  6309. } while (0)
  6310. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_GET(_var) \
  6311. (((_var) & HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_M) >> \
  6312. HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S)
  6313. #define HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_SET(_var, _val) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT, _val); \
  6316. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BTWT_PEER_CNT_S)); \
  6317. } while (0)
  6318. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  6319. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  6320. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  6321. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  6324. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  6325. } while (0)
  6326. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  6327. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  6328. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  6329. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  6330. do { \
  6331. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  6332. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  6333. } while (0)
  6334. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  6335. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  6336. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  6337. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  6340. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  6341. } while (0)
  6342. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  6343. typedef struct {
  6344. htt_tlv_hdr_t tlv_hdr;
  6345. A_UINT32 vdev_id;
  6346. htt_mac_addr peer_mac;
  6347. A_UINT32 flow_id_flags;
  6348. /**
  6349. * TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is
  6350. * not initiated by host
  6351. */
  6352. A_UINT32 dialog_id;
  6353. A_UINT32 wake_dura_us;
  6354. A_UINT32 wake_intvl_us;
  6355. A_UINT32 sp_offset_us;
  6356. } htt_stats_pdev_twt_session_tlv;
  6357. /* preserve old name alias for new name consistent with the tag name */
  6358. typedef htt_stats_pdev_twt_session_tlv htt_pdev_stats_twt_session_tlv;
  6359. typedef struct {
  6360. htt_tlv_hdr_t tlv_hdr;
  6361. A_UINT32 pdev_id;
  6362. A_UINT32 num_sessions;
  6363. HTT_STATS_VAR_LEN_ARRAY1(htt_stats_pdev_twt_session_tlv, twt_session);
  6364. } htt_stats_pdev_twt_sessions_tlv;
  6365. /* preserve old name alias for new name consistent with the tag name */
  6366. typedef htt_stats_pdev_twt_sessions_tlv htt_pdev_stats_twt_sessions_tlv;
  6367. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  6368. * TLV_TAGS:
  6369. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  6370. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  6371. */
  6372. /* NOTE:
  6373. * This structure is for documentation, and cannot be safely used directly.
  6374. * Instead, use the constituent TLV structures to fill/parse.
  6375. */
  6376. #ifdef ATH_TARGET
  6377. typedef struct {
  6378. htt_stats_pdev_twt_session_tlv twt_sessions[1];
  6379. } htt_pdev_twt_sessions_stats_t;
  6380. #endif /* ATH_TARGET */
  6381. typedef enum {
  6382. /* Global link descriptor queued in REO */
  6383. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  6384. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  6385. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  6386. /*Number of queue descriptors of this aging group */
  6387. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  6388. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  6389. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  6390. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  6391. /* Total number of MSDUs buffered in AC */
  6392. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  6393. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  6394. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  6395. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  6396. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  6397. } htt_rx_reo_resource_sample_id_enum;
  6398. typedef struct {
  6399. htt_tlv_hdr_t tlv_hdr;
  6400. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  6401. /** htt_rx_reo_debug_sample_id_enum */
  6402. A_UINT32 sample_id;
  6403. /** Max value of all samples */
  6404. A_UINT32 total_max;
  6405. /** Average value of total samples */
  6406. A_UINT32 total_avg;
  6407. /** Num of samples including both zeros and non zeros ones*/
  6408. A_UINT32 total_sample;
  6409. /** Average value of all non zeros samples */
  6410. A_UINT32 non_zeros_avg;
  6411. /** Num of non zeros samples */
  6412. A_UINT32 non_zeros_sample;
  6413. /** Max value of last N non zero samples (N = last_non_zeros_sample) */
  6414. A_UINT32 last_non_zeros_max;
  6415. /** Min value of last N non zero samples (N = last_non_zeros_sample) */
  6416. A_UINT32 last_non_zeros_min;
  6417. /** Average value of last N non zero samples (N = last_non_zeros_sample) */
  6418. A_UINT32 last_non_zeros_avg;
  6419. /** Num of last non zero samples */
  6420. A_UINT32 last_non_zeros_sample;
  6421. } htt_stats_rx_reo_resource_stats_tlv;
  6422. /* preserve old name alias for new name consistent with the tag name */
  6423. typedef htt_stats_rx_reo_resource_stats_tlv htt_rx_reo_resource_stats_tlv_v;
  6424. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  6425. * TLV_TAGS:
  6426. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  6427. */
  6428. /* NOTE:
  6429. * This structure is for documentation, and cannot be safely used directly.
  6430. * Instead, use the constituent TLV structures to fill/parse.
  6431. */
  6432. #ifdef ATH_TARGET
  6433. typedef struct {
  6434. htt_stats_rx_reo_resource_stats_tlv reo_resource_stats;
  6435. } htt_soc_reo_resource_stats_t;
  6436. #endif /* ATH_TARGET */
  6437. /* == TX SOUNDING STATS == */
  6438. /* config_param0 */
  6439. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  6440. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  6441. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  6442. typedef enum {
  6443. /* Implicit beamforming stats */
  6444. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  6445. /* Single user short inter frame sequence steer stats */
  6446. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  6447. /* Single user random back off steer stats */
  6448. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  6449. /* Multi user short inter frame sequence steer stats */
  6450. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  6451. /* Multi user random back off steer stats */
  6452. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  6453. /* For backward compatibility new modes cannot be added */
  6454. HTT_TXBF_MAX_NUM_OF_MODES = 5
  6455. } htt_txbf_sound_steer_modes;
  6456. typedef enum {
  6457. HTT_TX_AC_SOUNDING_MODE = 0,
  6458. HTT_TX_AX_SOUNDING_MODE = 1,
  6459. HTT_TX_BE_SOUNDING_MODE = 2,
  6460. HTT_TX_CMN_SOUNDING_MODE = 3,
  6461. HTT_TX_CV_CORR_MODE = 4,
  6462. } htt_stats_sounding_tx_mode;
  6463. #define HTT_TX_CV_CORR_MAX_NUM_COLUMNS 8
  6464. typedef struct {
  6465. htt_tlv_hdr_t tlv_hdr;
  6466. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  6467. /* Counts number of soundings for all steering modes in each bw */
  6468. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  6469. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  6470. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  6471. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  6472. /**
  6473. * The sounding array is a 2-D array stored as an 1-D array of
  6474. * A_UINT32. The stats for a particular user/bw combination is
  6475. * referenced with the following:
  6476. *
  6477. * sounding[(user* max_bw) + bw]
  6478. *
  6479. * ... where max_bw == 4 for 160mhz
  6480. */
  6481. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  6482. /* cv upload handler stats */
  6483. /** total times CV nc mismatched */
  6484. A_UINT32 cv_nc_mismatch_err;
  6485. /** total times CV has FCS error */
  6486. A_UINT32 cv_fcs_err;
  6487. /** total times CV has invalid NSS index */
  6488. A_UINT32 cv_frag_idx_mismatch;
  6489. /** total times CV has invalid SW peer ID */
  6490. A_UINT32 cv_invalid_peer_id;
  6491. /** total times CV rejected because TXBF is not setup in peer */
  6492. A_UINT32 cv_no_txbf_setup;
  6493. /** total times CV expired while in updating state */
  6494. A_UINT32 cv_expiry_in_update;
  6495. /** total times Pkt b/w exceeding the cbf_bw */
  6496. A_UINT32 cv_pkt_bw_exceed;
  6497. /** total times CV DMA not completed */
  6498. A_UINT32 cv_dma_not_done_err;
  6499. /** total times CV update to peer failed */
  6500. A_UINT32 cv_update_failed;
  6501. /* cv query stats */
  6502. /** total times CV query happened */
  6503. A_UINT32 cv_total_query;
  6504. /** total pattern based CV query */
  6505. A_UINT32 cv_total_pattern_query;
  6506. /** total BW based CV query */
  6507. A_UINT32 cv_total_bw_query;
  6508. /** incorrect encoding in CV flags */
  6509. A_UINT32 cv_invalid_bw_coding;
  6510. /** forced sounding enabled for the peer */
  6511. A_UINT32 cv_forced_sounding;
  6512. /** standalone sounding sequence on-going */
  6513. A_UINT32 cv_standalone_sounding;
  6514. /** NC of available CV lower than expected */
  6515. A_UINT32 cv_nc_mismatch;
  6516. /** feedback type different from expected */
  6517. A_UINT32 cv_fb_type_mismatch;
  6518. /** CV BW not equal to expected BW for OFDMA */
  6519. A_UINT32 cv_ofdma_bw_mismatch;
  6520. /** CV BW not greater than or equal to expected BW */
  6521. A_UINT32 cv_bw_mismatch;
  6522. /** CV pattern not matching with the expected pattern */
  6523. A_UINT32 cv_pattern_mismatch;
  6524. /** CV available is of different preamble type than expected. */
  6525. A_UINT32 cv_preamble_mismatch;
  6526. /** NR of available CV is lower than expected. */
  6527. A_UINT32 cv_nr_mismatch;
  6528. /** CV in use count has exceeded threshold and cannot be used further. */
  6529. A_UINT32 cv_in_use_cnt_exceeded;
  6530. /** A valid CV has been found. */
  6531. A_UINT32 cv_found;
  6532. /** No valid CV was found. */
  6533. A_UINT32 cv_not_found;
  6534. /** Sounding per user in 320MHz bandwidth */
  6535. A_UINT32 sounding_320[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  6536. /** Counts number of soundings for all steering modes in 320MHz bandwidth */
  6537. A_UINT32 cbf_320[HTT_TXBF_MAX_NUM_OF_MODES];
  6538. /* This part can be used for new counters added for CV query/upload. */
  6539. /** non-trigger based ranging sequence on-going */
  6540. A_UINT32 cv_ntbr_sounding;
  6541. /** CV found, but upload is in progress. */
  6542. A_UINT32 cv_found_upload_in_progress;
  6543. /** Expired CV found during query. */
  6544. A_UINT32 cv_expired_during_query;
  6545. /** total times CV dma timeout happened */
  6546. A_UINT32 cv_dma_timeout_error;
  6547. /** total times CV bufs uploaded for IBF case */
  6548. A_UINT32 cv_buf_ibf_uploads;
  6549. /** total times CV bufs uploaded for EBF case */
  6550. A_UINT32 cv_buf_ebf_uploads;
  6551. /** total times CV bufs received from IPC ring */
  6552. A_UINT32 cv_buf_received;
  6553. /** total times CV bufs fed back to the IPC ring */
  6554. A_UINT32 cv_buf_fed_back;
  6555. /** Total times CV query happened for IBF case */
  6556. A_UINT32 cv_total_query_ibf;
  6557. /** A valid CV has been found for IBF case */
  6558. A_UINT32 cv_found_ibf;
  6559. /** A valid CV has not been found for IBF case */
  6560. A_UINT32 cv_not_found_ibf;
  6561. /** Expired CV found during query for IBF case */
  6562. A_UINT32 cv_expired_during_query_ibf;
  6563. /** Total number of times adaptive sounding logic has been queried */
  6564. A_UINT32 adaptive_snd_total_query;
  6565. /**
  6566. * Total number of times adaptive sounding mcs drop has been computed
  6567. * and recorded.
  6568. */
  6569. A_UINT32 adaptive_snd_total_mcs_drop[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS + HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  6570. /** Total number of times adaptive sounding logic kicked in */
  6571. A_UINT32 adaptive_snd_kicked_in;
  6572. /** Total number of times we switched back to normal sounding interval */
  6573. A_UINT32 adaptive_snd_back_to_default;
  6574. /**
  6575. * Below are CV correlation feature related stats.
  6576. * This feature is used for DL MU MIMO, but is not available
  6577. * from certain legacy targets.
  6578. */
  6579. /** number of CV Correlation triggers for online mode */
  6580. A_UINT32 cv_corr_trigger_online_mode;
  6581. /** number of CV Correlation triggers for offline mode */
  6582. A_UINT32 cv_corr_trigger_offline_mode;
  6583. /** number of CV Correlation triggers for hybrid mode */
  6584. A_UINT32 cv_corr_trigger_hybrid_mode;
  6585. /** number of CV Correlation triggers with computation level 0 */
  6586. A_UINT32 cv_corr_trigger_computation_level_0;
  6587. /** number of CV Correlation triggers with computation level 1 */
  6588. A_UINT32 cv_corr_trigger_computation_level_1;
  6589. /** number of CV Correlation triggers with computation level 2 */
  6590. A_UINT32 cv_corr_trigger_computation_level_2;
  6591. /** number of users for which CV Correlation was triggered */
  6592. A_UINT32 cv_corr_trigger_num_users[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6593. /** number of streams for which CV Correlation was triggered */
  6594. A_UINT32 cv_corr_trigger_num_streams[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6595. /** number of CV Correlation buffers received through IPC tickle */
  6596. A_UINT32 cv_corr_upload_total_buf_received;
  6597. /** number of CV Correlation buffers fed back to the IPC ring */
  6598. A_UINT32 cv_corr_upload_total_buf_fed_back;
  6599. /** number of CV Correlation buffers for which processing failed */
  6600. A_UINT32 cv_corr_upload_total_processing_failed;
  6601. /**
  6602. * number of CV Correlation buffers for which processing failed,
  6603. * due to no users being present in parsed buffer
  6604. */
  6605. A_UINT32 cv_corr_upload_failed_total_users_zero;
  6606. /**
  6607. * number of CV Correlation buffers for which processing failed,
  6608. * due to number of users present in parsed buffer exceeded
  6609. * CV_CORR_MAX_NUM_COLUMNS
  6610. */
  6611. A_UINT32 cv_corr_upload_failed_total_users_exceeded;
  6612. /**
  6613. * number of CV Correlation buffers for which processing failed,
  6614. * due to peer pointer for parsed peer not available
  6615. */
  6616. A_UINT32 cv_corr_upload_failed_peer_not_found;
  6617. /**
  6618. * number of CV Correlation buffers for which processing encountered,
  6619. * Nss of peer exceeding SCHED_ALGO_MAX_SUPPORTED_MUMIMO_NSS
  6620. */
  6621. A_UINT32 cv_corr_upload_user_nss_exceeded;
  6622. /**
  6623. * number of CV Correlation buffers for which processing encountered,
  6624. * invalid reverse look up index for fetching CV correlation results
  6625. */
  6626. A_UINT32 cv_corr_upload_invalid_lookup_index;
  6627. /** number of users present in uploaded CV Correlation results buffer */
  6628. A_UINT32 cv_corr_upload_total_num_users[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6629. /** number of streams present in uploaded CV Correlation results buffer */
  6630. A_UINT32 cv_corr_upload_total_num_streams[HTT_TX_CV_CORR_MAX_NUM_COLUMNS];
  6631. } htt_stats_tx_sounding_stats_tlv;
  6632. /* preserve old name alias for new name consistent with the tag name */
  6633. typedef htt_stats_tx_sounding_stats_tlv htt_tx_sounding_stats_tlv;
  6634. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  6635. * TLV_TAGS:
  6636. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  6637. */
  6638. /* NOTE:
  6639. * This structure is for documentation, and cannot be safely used directly.
  6640. * Instead, use the constituent TLV structures to fill/parse.
  6641. */
  6642. #ifdef ATH_TARGET
  6643. typedef struct {
  6644. htt_stats_tx_sounding_stats_tlv sounding_tlv;
  6645. } htt_tx_sounding_stats_t;
  6646. #endif /* ATH_TARGET */
  6647. typedef struct {
  6648. htt_tlv_hdr_t tlv_hdr;
  6649. A_UINT32 num_obss_tx_ppdu_success;
  6650. A_UINT32 num_obss_tx_ppdu_failure;
  6651. /** num_sr_tx_transmissions:
  6652. * Counter of TX done by aborting other BSS RX with spatial reuse
  6653. * (for cases where rx RSSI from other BSS is below the packet-detection
  6654. * threshold for doing spatial reuse)
  6655. */
  6656. union {
  6657. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  6658. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  6659. };
  6660. union {
  6661. /**
  6662. * Count the number of times the RSSI from an other-BSS signal
  6663. * is below the spatial reuse power threshold, thus providing an
  6664. * opportunity for spatial reuse since OBSS interference will be
  6665. * inconsequential.
  6666. */
  6667. A_UINT32 num_spatial_reuse_opportunities;
  6668. /* DEPRECATED: num_sr_rx_ge_pd_rssi_thr
  6669. * This old name has been deprecated because it does not
  6670. * clearly and accurately reflect the information stored within
  6671. * this field.
  6672. * Use the new name (num_spatial_reuse_opportunities) instead of
  6673. * the deprecated old name (num_sr_rx_ge_pd_rssi_thr).
  6674. */
  6675. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  6676. };
  6677. /**
  6678. * Count of number of times OBSS frames were aborted and non-SRG
  6679. * opportunities were created. Non-SRG opportunities are created when
  6680. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  6681. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  6682. * allow non-SRG TX.
  6683. */
  6684. A_UINT32 num_non_srg_opportunities;
  6685. /**
  6686. * Count of number of times TX PPDU were transmitted using non-SRG
  6687. * opportunities created. Incoming OBSS frame RSSI is compared with per
  6688. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  6689. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  6690. * transmission happens.
  6691. */
  6692. A_UINT32 num_non_srg_ppdu_tried;
  6693. /**
  6694. * Count of number of times non-SRG based TX transmissions were successful
  6695. */
  6696. A_UINT32 num_non_srg_ppdu_success;
  6697. /**
  6698. * Count of number of times OBSS frames were aborted and SRG opportunities
  6699. * were created. Srg opportunities are created when incoming OBSS RSSI
  6700. * is less than the global configured SRG RSSI threshold and SRC OBSS
  6701. * color / SRG OBSS BSSID / SRG partial bssid / SRG BSS color bitmap
  6702. * registers allow SRG TX.
  6703. */
  6704. A_UINT32 num_srg_opportunities;
  6705. /**
  6706. * Count of number of times TX PPDU were transmitted using SRG
  6707. * opportunities created.
  6708. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  6709. * threshold configured in each PPDU.
  6710. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  6711. * then SRG transmission happens.
  6712. */
  6713. A_UINT32 num_srg_ppdu_tried;
  6714. /**
  6715. * Count of number of times SRG based TX transmissions were successful
  6716. */
  6717. A_UINT32 num_srg_ppdu_success;
  6718. /**
  6719. * Count of number of times PSR opportunities were created by aborting
  6720. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  6721. * spatial reuse info in the OBSS trigger common field is set to allow PSR
  6722. * based spatial reuse.
  6723. */
  6724. A_UINT32 num_psr_opportunities;
  6725. /**
  6726. * Count of number of times TX PPDU were transmitted using PSR
  6727. * opportunities created.
  6728. */
  6729. A_UINT32 num_psr_ppdu_tried;
  6730. /**
  6731. * Count of number of times PSR based TX transmissions were successful.
  6732. */
  6733. A_UINT32 num_psr_ppdu_success;
  6734. /**
  6735. * Count of number of times TX PPDU per access category were transmitted
  6736. * using non-SRG opportunities created.
  6737. */
  6738. A_UINT32 num_non_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  6739. /**
  6740. * Count of number of times non-SRG based TX transmissions per access
  6741. * category were successful
  6742. */
  6743. A_UINT32 num_non_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  6744. /**
  6745. * Count of number of times TX PPDU per access category were transmitted
  6746. * using SRG opportunities created.
  6747. */
  6748. A_UINT32 num_srg_ppdu_tried_per_ac[HTT_NUM_AC_WMM];
  6749. /**
  6750. * Count of number of times SRG based TX transmissions per access
  6751. * category were successful
  6752. */
  6753. A_UINT32 num_srg_ppdu_success_per_ac[HTT_NUM_AC_WMM];
  6754. /**
  6755. * Count of number of times ppdu was flushed due to ongoing OBSS
  6756. * frame duration value lesser than minimum required frame duration.
  6757. */
  6758. A_UINT32 num_obss_min_duration_check_flush_cnt;
  6759. /**
  6760. * Count of number of times ppdu was flushed due to ppdu duration
  6761. * exceeding aborted OBSS frame duration
  6762. */
  6763. A_UINT32 num_sr_ppdu_abort_flush_cnt;
  6764. } htt_stats_pdev_obss_pd_tlv;
  6765. /* preserve old name alias for new name consistent with the tag name */
  6766. typedef htt_stats_pdev_obss_pd_tlv htt_pdev_obss_pd_stats_tlv;
  6767. /* NOTE:
  6768. * This structure is for documentation, and cannot be safely used directly.
  6769. * Instead, use the constituent TLV structures to fill/parse.
  6770. */
  6771. #ifdef ATH_TARGET
  6772. typedef struct {
  6773. htt_stats_pdev_obss_pd_tlv obss_pd_stat;
  6774. } htt_pdev_obss_pd_stats_t;
  6775. #endif /* ATH_TARGET */
  6776. typedef struct {
  6777. htt_tlv_hdr_t tlv_hdr;
  6778. A_UINT32 pdev_id;
  6779. A_UINT32 current_head_idx;
  6780. A_UINT32 current_tail_idx;
  6781. A_UINT32 num_htt_msgs_sent;
  6782. /**
  6783. * Time in milliseconds for which the ring has been in
  6784. * its current backpressure condition
  6785. */
  6786. A_UINT32 backpressure_time_ms;
  6787. /** backpressure_hist -
  6788. * histogram showing how many times different degrees of backpressure
  6789. * duration occurred:
  6790. * Index 0 indicates the number of times ring was
  6791. * continuously in backpressure state for 100 - 200ms.
  6792. * Index 1 indicates the number of times ring was
  6793. * continuously in backpressure state for 200 - 300ms.
  6794. * Index 2 indicates the number of times ring was
  6795. * continuously in backpressure state for 300 - 400ms.
  6796. * Index 3 indicates the number of times ring was
  6797. * continuously in backpressure state for 400 - 500ms.
  6798. * Index 4 indicates the number of times ring was
  6799. * continuously in backpressure state beyond 500ms.
  6800. */
  6801. A_UINT32 backpressure_hist[5];
  6802. } htt_stats_ring_backpressure_stats_tlv;
  6803. /* preserve old name alias for new name consistent with the tag name */
  6804. typedef htt_stats_ring_backpressure_stats_tlv htt_ring_backpressure_stats_tlv;
  6805. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  6806. * TLV_TAGS:
  6807. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  6808. */
  6809. /* NOTE:
  6810. * This structure is for documentation, and cannot be safely used directly.
  6811. * Instead, use the constituent TLV structures to fill/parse.
  6812. */
  6813. #ifdef ATH_TARGET
  6814. typedef struct {
  6815. htt_stats_sring_cmn_tlv cmn_tlv;
  6816. struct {
  6817. htt_stats_string_tlv sring_str_tlv;
  6818. htt_stats_ring_backpressure_stats_tlv backpressure_stats_tlv;
  6819. } r[1]; /* variable-length array */
  6820. } htt_ring_backpressure_stats_t;
  6821. #endif /* ATH_TARGET */
  6822. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  6823. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  6824. #define HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST 3
  6825. typedef struct {
  6826. htt_tlv_hdr_t tlv_hdr;
  6827. /** print_header:
  6828. * This field suggests whether the host should print a header when
  6829. * displaying the TLV (because this is the first latency_prof_stats
  6830. * TLV within a series), or if only the TLV contents should be displayed
  6831. * without a header (because this is not the first TLV within the series).
  6832. */
  6833. A_UINT32 print_header;
  6834. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  6835. /** number of data values included in the tot sum */
  6836. A_UINT32 cnt;
  6837. /** time in us */
  6838. A_UINT32 min;
  6839. /** time in us */
  6840. A_UINT32 max;
  6841. A_UINT32 last;
  6842. /** time in us */
  6843. A_UINT32 tot;
  6844. /** time in us */
  6845. A_UINT32 avg;
  6846. /** hist_intvl:
  6847. * Histogram interval, i.e. the latency range covered by each
  6848. * bin of the histogram, in microsecond units.
  6849. * hist[0] counts how many latencies were between 0 to hist_intvl
  6850. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  6851. * hist[2] counts how many latencies were more than 2*hist_intvl
  6852. */
  6853. A_UINT32 hist_intvl;
  6854. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  6855. /** max page faults in any 1 sampling window */
  6856. A_UINT32 page_fault_max;
  6857. /** summed over all sampling windows */
  6858. A_UINT32 page_fault_total;
  6859. /** ignored_latency_count:
  6860. * ignore some of profile latency to avoid avg skewing
  6861. */
  6862. A_UINT32 ignored_latency_count;
  6863. /** interrupts_max: max interrupts within any single sampling window */
  6864. A_UINT32 interrupts_max;
  6865. /** interrupts_hist: histogram of interrupt rate
  6866. * bin0 contains the number of sampling windows that had 0 interrupts,
  6867. * bin1 contains the number of sampling windows that had 1-4 interrupts,
  6868. * bin2 contains the number of sampling windows that had > 4 interrupts
  6869. */
  6870. A_UINT32 interrupts_hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  6871. /* min time in us for pcycles spent on q6 core on all HW threads */
  6872. A_UINT32 min_pcycles_time;
  6873. /* max time in us for pcycles spent on q6 core on all HW threads */
  6874. A_UINT32 max_pcycles_time;
  6875. /* total time in us for pcycles spent on q6 core on all HW threads */
  6876. A_UINT32 tot_pcycles_time;
  6877. /* avg time in us for pcycles spent on q6 core on all HW threads */
  6878. A_UINT32 avg_pcycles_time;
  6879. } htt_stats_latency_prof_stats_tlv;
  6880. /* preserve old name alias for new name consistent with the tag name */
  6881. typedef htt_stats_latency_prof_stats_tlv htt_latency_prof_stats_tlv;
  6882. typedef struct {
  6883. htt_tlv_hdr_t tlv_hdr;
  6884. /** duration:
  6885. * Time period over which counts were gathered, units = microseconds.
  6886. */
  6887. A_UINT32 duration;
  6888. A_UINT32 tx_msdu_cnt;
  6889. A_UINT32 tx_mpdu_cnt;
  6890. A_UINT32 tx_ppdu_cnt;
  6891. A_UINT32 rx_msdu_cnt;
  6892. A_UINT32 rx_mpdu_cnt;
  6893. } htt_stats_latency_ctx_tlv;
  6894. /* preserve old name alias for new name consistent with the tag name */
  6895. typedef htt_stats_latency_ctx_tlv htt_latency_prof_ctx_tlv;
  6896. typedef struct {
  6897. htt_tlv_hdr_t tlv_hdr;
  6898. /** count of enabled profiles */
  6899. A_UINT32 prof_enable_cnt;
  6900. } htt_stats_latency_cnt_tlv;
  6901. /* preserve old name alias for new name consistent with the tag name */
  6902. typedef htt_stats_latency_cnt_tlv htt_latency_prof_cnt_tlv;
  6903. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  6904. * TLV_TAGS:
  6905. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  6906. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  6907. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  6908. */
  6909. /* NOTE:
  6910. * This structure is for documentation, and cannot be safely used directly.
  6911. * Instead, use the constituent TLV structures to fill/parse.
  6912. */
  6913. #ifdef ATH_TARGET
  6914. typedef struct {
  6915. htt_stats_latency_prof_stats_tlv latency_prof_stat;
  6916. htt_stats_latency_ctx_tlv latency_ctx_stat;
  6917. htt_stats_latency_cnt_tlv latency_cnt_stat;
  6918. } htt_soc_latency_stats_t;
  6919. #endif /* ATH_TARGET */
  6920. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  6921. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  6922. #define HTT_RX_SQUARE_INDEX 6
  6923. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  6924. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  6925. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  6926. * TLV_TAGS:
  6927. * - HTT_STATS_RX_FSE_STATS_TAG
  6928. */
  6929. typedef struct {
  6930. htt_tlv_hdr_t tlv_hdr;
  6931. /**
  6932. * Number of times host requested for fse enable/disable
  6933. */
  6934. A_UINT32 fse_enable_cnt;
  6935. A_UINT32 fse_disable_cnt;
  6936. /**
  6937. * Number of times host requested for fse cache invalidation
  6938. * individual entries or full cache
  6939. */
  6940. A_UINT32 fse_cache_invalidate_entry_cnt;
  6941. A_UINT32 fse_full_cache_invalidate_cnt;
  6942. /**
  6943. * Cache hits count will increase if there is a matching flow in the cache
  6944. * There is no register for cache miss but the number of cache misses can
  6945. * be calculated as
  6946. * cache miss = (num_searches - cache_hits)
  6947. * Thus, there is no need to have a separate variable for cache misses.
  6948. * Num searches is flow search times done in the cache.
  6949. */
  6950. A_UINT32 fse_num_cache_hits_cnt;
  6951. A_UINT32 fse_num_searches_cnt;
  6952. /**
  6953. * Cache Occupancy holds 2 types of values: Peak and Current.
  6954. * 10 bins are used to keep track of peak occupancy.
  6955. * 8 of these bins represent ranges of values, while the first and last
  6956. * bins represent the extreme cases of the cache being completely empty
  6957. * or completely full.
  6958. * For the non-extreme bins, the number of cache occupancy values per
  6959. * bin is the maximum cache occupancy (128), divided by the number of
  6960. * non-extreme bins (8), so 128/8 = 16 values per bin.
  6961. * The range of values for each histogram bins is specified below:
  6962. * Bin0 = Counter increments when cache occupancy is empty
  6963. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  6964. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  6965. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  6966. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  6967. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  6968. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  6969. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  6970. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  6971. * Bin9 = Counter increments when cache occupancy is equal to 128
  6972. * The above histogram bin definitions apply to both the peak-occupancy
  6973. * histogram and the current-occupancy histogram.
  6974. *
  6975. * @fse_cache_occupancy_peak_cnt:
  6976. * Array records periodically PEAK cache occupancy values.
  6977. * Peak Occupancy will increment only if it is greater than current
  6978. * occupancy value.
  6979. *
  6980. * @fse_cache_occupancy_curr_cnt:
  6981. * Array records periodically current cache occupancy value.
  6982. * Current Cache occupancy always holds instant snapshot of
  6983. * current number of cache entries.
  6984. **/
  6985. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  6986. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  6987. /**
  6988. * Square stat is sum of squares of cache occupancy to better understand
  6989. * any variation/deviation within each cache set, over a given time-window.
  6990. *
  6991. * Square stat is calculated this way:
  6992. * Square = SUM(Squares of all Occupancy in a Set) / 8
  6993. * The cache has 16-way set associativity, so the occupancy of a
  6994. * set can vary from 0 to 16. There are 8 sets within the cache.
  6995. * Therefore, the minimum possible square value is 0, and the maximum
  6996. * possible square value is (8*16^2) / 8 = 256.
  6997. *
  6998. * 6 bins are used to keep track of square stats:
  6999. * Bin0 = increments when square of current cache occupancy is zero
  7000. * Bin1 = increments when square of current cache occupancy is within
  7001. * [1 to 50]
  7002. * Bin2 = increments when square of current cache occupancy is within
  7003. * [51 to 100]
  7004. * Bin3 = increments when square of current cache occupancy is within
  7005. * [101 to 200]
  7006. * Bin4 = increments when square of current cache occupancy is within
  7007. * [201 to 255]
  7008. * Bin5 = increments when square of current cache occupancy is 256
  7009. */
  7010. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  7011. /**
  7012. * Search stats has 2 types of values: Peak Pending and Number of
  7013. * Search Pending.
  7014. * GSE command ring for FSE can hold maximum of 5 Pending searches
  7015. * at any given time.
  7016. *
  7017. * 4 bins are used to keep track of search stats:
  7018. * Bin0 = Counter increments when there are NO pending searches
  7019. * (For peak, it will be number of pending searches greater
  7020. * than GSE command ring FIFO outstanding requests.
  7021. * For Search Pending, it will be number of pending search
  7022. * inside GSE command ring FIFO.)
  7023. * Bin1 = Counter increments when number of pending searches are within
  7024. * [1 to 2]
  7025. * Bin2 = Counter increments when number of pending searches are within
  7026. * [3 to 4]
  7027. * Bin3 = Counter increments when number of pending searches are
  7028. * greater/equal to [ >= 5]
  7029. */
  7030. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  7031. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  7032. } htt_stats_rx_fse_stats_tlv;
  7033. /* preserve old name alias for new name consistent with the tag name */
  7034. typedef htt_stats_rx_fse_stats_tlv htt_rx_fse_stats_tlv;
  7035. /* NOTE:
  7036. * This structure is for documentation, and cannot be safely used directly.
  7037. * Instead, use the constituent TLV structures to fill/parse.
  7038. */
  7039. #ifdef ATH_TARGET
  7040. typedef struct {
  7041. htt_stats_rx_fse_stats_tlv rx_fse_stats;
  7042. } htt_rx_fse_stats_t;
  7043. #endif /* ATH_TARGET */
  7044. #define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
  7045. #define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5 /* 20, 40, 80, 160, 320 */
  7046. #define HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES 2/* 0: Half, 1: Quarter */
  7047. typedef struct {
  7048. htt_tlv_hdr_t tlv_hdr;
  7049. /** SU TxBF TX MCS stats */
  7050. A_UINT32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  7051. /** Implicit BF TX MCS stats */
  7052. A_UINT32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  7053. /** Open loop TX MCS stats */
  7054. A_UINT32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  7055. /** SU TxBF TX NSS stats */
  7056. A_UINT32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7057. /** Implicit BF TX NSS stats */
  7058. A_UINT32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7059. /** Open loop TX NSS stats */
  7060. A_UINT32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7061. /** SU TxBF TX BW stats */
  7062. A_UINT32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7063. /** Implicit BF TX BW stats */
  7064. A_UINT32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7065. /** Open loop TX BW stats */
  7066. A_UINT32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7067. /** Legacy and OFDM TX rate stats */
  7068. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  7069. /** SU TxBF TX BW stats */
  7070. A_UINT32 reduced_tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7071. /** Implicit BF TX BW stats */
  7072. A_UINT32 reduced_tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7073. /** Open loop TX BW stats */
  7074. A_UINT32 reduced_tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  7075. /** Txbf flag reason stats */
  7076. A_UINT32 txbf_flag_set_mu_mode;
  7077. A_UINT32 txbf_flag_set_final_status;
  7078. A_UINT32 txbf_flag_not_set_verified_txbf_mode;
  7079. A_UINT32 txbf_flag_not_set_disable_p2p_access;
  7080. A_UINT32 txbf_flag_not_set_max_nss_reached_in_he160;
  7081. A_UINT32 txbf_flag_not_set_disable_ul_dl_ofdma;
  7082. A_UINT32 txbf_flag_not_set_mcs_threshold_value;
  7083. A_UINT32 txbf_flag_not_set_final_status;
  7084. } htt_stats_pdev_tx_rate_txbf_stats_tlv;
  7085. /* preserve old name alias for new name consistent with the tag name */
  7086. typedef htt_stats_pdev_tx_rate_txbf_stats_tlv htt_tx_pdev_txbf_rate_stats_tlv;
  7087. typedef enum {
  7088. HTT_STATS_RC_MODE_DLSU = 0,
  7089. HTT_STATS_RC_MODE_DLMUMIMO = 1,
  7090. HTT_STATS_RC_MODE_DLOFDMA = 2,
  7091. HTT_STATS_RC_MODE_ULMUMIMO = 3,
  7092. HTT_STATS_RC_MODE_ULOFDMA = 4,
  7093. } htt_stats_rc_mode;
  7094. typedef struct {
  7095. A_UINT32 ppdus_tried;
  7096. A_UINT32 ppdus_ack_failed;
  7097. A_UINT32 mpdus_tried;
  7098. A_UINT32 mpdus_failed;
  7099. } htt_tx_rate_stats_t;
  7100. typedef enum {
  7101. HTT_RC_MODE_SU_OL,
  7102. HTT_RC_MODE_SU_BF,
  7103. HTT_RC_MODE_MU1_INTF,
  7104. HTT_RC_MODE_MU2_INTF,
  7105. HTT_Rc_MODE_MU3_INTF,
  7106. HTT_RC_MODE_MU4_INTF,
  7107. HTT_RC_MODE_MU5_INTF,
  7108. HTT_RC_MODE_MU6_INTF,
  7109. HTT_RC_MODE_MU7_INTF,
  7110. HTT_RC_MODE_2D_COUNT,
  7111. } HTT_RC_MODE;
  7112. typedef enum {
  7113. HTT_STATS_RU_TYPE_INVALID = 0,
  7114. HTT_STATS_RU_TYPE_SINGLE_RU_ONLY = 1,
  7115. HTT_STATS_RU_TYPE_SINGLE_AND_MULTI_RU = 2,
  7116. } htt_stats_ru_type;
  7117. typedef struct {
  7118. htt_tlv_hdr_t tlv_hdr;
  7119. /** HTT_STATS_RC_MODE_XX */
  7120. A_UINT32 rc_mode;
  7121. A_UINT32 last_probed_mcs;
  7122. A_UINT32 last_probed_nss;
  7123. A_UINT32 last_probed_bw;
  7124. htt_tx_rate_stats_t per_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  7125. htt_tx_rate_stats_t per_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7126. htt_tx_rate_stats_t per_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  7127. /** 320MHz extension for PER */
  7128. htt_tx_rate_stats_t per_bw320;
  7129. A_UINT32 probe_cnt_per_rcmode[HTT_RC_MODE_2D_COUNT];
  7130. A_UINT32 ru_type; /* refer to htt_stats_ru_type enum */
  7131. htt_tx_rate_stats_t per_ru[HTT_TX_PDEV_STATS_NUM_BE_RU_SIZE_COUNTERS];
  7132. } htt_stats_per_rate_stats_tlv;
  7133. /* preserve old name alias for new name consistent with the tag name */
  7134. typedef htt_stats_per_rate_stats_tlv htt_tx_rate_stats_per_tlv;
  7135. /* NOTE:
  7136. * This structure is for documentation, and cannot be safely used directly.
  7137. * Instead, use the constituent TLV structures to fill/parse.
  7138. */
  7139. #ifdef ATH_TARGET
  7140. typedef struct {
  7141. htt_stats_pdev_tx_rate_txbf_stats_tlv txbf_rate_stats;
  7142. } htt_pdev_txbf_rate_stats_t;
  7143. #endif /* ATH_TARGET */
  7144. #ifdef ATH_TARGET
  7145. typedef struct {
  7146. htt_stats_per_rate_stats_tlv per_stats;
  7147. } htt_tx_pdev_per_stats_t;
  7148. #endif /* ATH_TARGET */
  7149. typedef enum {
  7150. HTT_ULTRIG_QBOOST_TRIGGER = 0,
  7151. HTT_ULTRIG_PSPOLL_TRIGGER,
  7152. HTT_ULTRIG_UAPSD_TRIGGER,
  7153. HTT_ULTRIG_11AX_TRIGGER,
  7154. HTT_ULTRIG_11AX_WILDCARD_TRIGGER,
  7155. HTT_ULTRIG_11AX_UNASSOC_WILDCARD_TRIGGER,
  7156. HTT_STA_UL_OFDMA_NUM_TRIG_TYPE,
  7157. } HTT_STA_UL_OFDMA_RX_TRIG_TYPE;
  7158. typedef enum {
  7159. HTT_11AX_TRIGGER_BASIC_E = 0,
  7160. HTT_11AX_TRIGGER_BRPOLL_E = 1,
  7161. HTT_11AX_TRIGGER_MU_BAR_E = 2,
  7162. HTT_11AX_TRIGGER_MU_RTS_E = 3,
  7163. HTT_11AX_TRIGGER_BUFFER_SIZE_E = 4,
  7164. HTT_11AX_TRIGGER_GCR_MU_BAR_E = 5,
  7165. HTT_11AX_TRIGGER_BQRP_E = 6,
  7166. HTT_11AX_TRIGGER_NDP_FB_REPORT_POLL_E = 7,
  7167. HTT_11AX_TRIGGER_RESERVED_8_E = 8,
  7168. HTT_11AX_TRIGGER_RESERVED_9_E = 9,
  7169. HTT_11AX_TRIGGER_RESERVED_10_E = 10,
  7170. HTT_11AX_TRIGGER_RESERVED_11_E = 11,
  7171. HTT_11AX_TRIGGER_RESERVED_12_E = 12,
  7172. HTT_11AX_TRIGGER_RESERVED_13_E = 13,
  7173. HTT_11AX_TRIGGER_RESERVED_14_E = 14,
  7174. HTT_11AX_TRIGGER_RESERVED_15_E = 15,
  7175. HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE,
  7176. } HTT_STA_UL_OFDMA_11AX_TRIG_TYPE;
  7177. /* UL RESP Queues 0 - HIPRI, 1 - LOPRI & 2 - BSR */
  7178. #define HTT_STA_UL_OFDMA_NUM_UL_QUEUES 3
  7179. /* Actual resp type sent by STA for trigger
  7180. * 0 - HE TB PPDU, 1 - NULL Delimiter */
  7181. #define HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE 2
  7182. /* Counter for MCS 0-13 */
  7183. #define HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS 14
  7184. /* Counters BW 20,40,80,160,320 */
  7185. #define HTT_STA_UL_OFDMA_NUM_BW_COUNTERS 5
  7186. #define HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  7187. /* STATS_TYPE : HTT_DBG_EXT_STA_11AX_UL_STATS
  7188. * TLV_TAGS:
  7189. * - HTT_STATS_STA_UL_OFDMA_STATS_TAG
  7190. */
  7191. typedef struct {
  7192. htt_tlv_hdr_t tlv_hdr;
  7193. A_UINT32 pdev_id;
  7194. /**
  7195. * Trigger Type reported by HWSCH on RX reception
  7196. * Each index populate enum HTT_STA_UL_OFDMA_RX_TRIG_TYPE
  7197. */
  7198. A_UINT32 rx_trigger_type[HTT_STA_UL_OFDMA_NUM_TRIG_TYPE];
  7199. /**
  7200. * 11AX Trigger Type on RX reception
  7201. * Each index populate enum HTT_STA_UL_OFDMA_11AX_TRIG_TYPE
  7202. */
  7203. A_UINT32 ax_trigger_type[HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE];
  7204. /** Num data PPDUs/Delims responded to trigs. per HWQ for UL RESP */
  7205. A_UINT32 num_data_ppdu_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  7206. A_UINT32 num_null_delimiters_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  7207. /**
  7208. * Overall UL STA RESP Status 0 - HE TB PPDU, 1 - NULL Delimiter
  7209. * Super set of num_data_ppdu_responded_per_hwq,
  7210. * num_null_delimiters_responded_per_hwq
  7211. */
  7212. A_UINT32 num_total_trig_responses[HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE];
  7213. /**
  7214. * Time interval between current time ms and last successful trigger RX
  7215. * 0xFFFFFFFF denotes no trig received / timestamp roll back
  7216. */
  7217. A_UINT32 last_trig_rx_time_delta_ms;
  7218. /**
  7219. * Rate Statistics for UL OFDMA
  7220. * UL TB PPDU TX MCS, NSS, GI, BW from STA HWQ
  7221. */
  7222. A_UINT32 ul_ofdma_tx_mcs[HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  7223. A_UINT32 ul_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  7224. A_UINT32 ul_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  7225. A_UINT32 ul_ofdma_tx_ldpc;
  7226. A_UINT32 ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  7227. /** Trig based PPDU TX/ RBO based PPDU TX Count */
  7228. A_UINT32 trig_based_ppdu_tx;
  7229. A_UINT32 rbo_based_ppdu_tx;
  7230. /** Switch MU EDCA to SU EDCA Count */
  7231. A_UINT32 mu_edca_to_su_edca_switch_count;
  7232. /** Num MU EDCA applied Count */
  7233. A_UINT32 num_mu_edca_param_apply_count;
  7234. /**
  7235. * Current MU EDCA Parameters for WMM ACs
  7236. * Mode - 0 - SU EDCA, 1- MU EDCA
  7237. */
  7238. A_UINT32 current_edca_hwq_mode[HTT_NUM_AC_WMM];
  7239. /** Contention Window minimum. Range: 1 - 10 */
  7240. A_UINT32 current_cw_min[HTT_NUM_AC_WMM];
  7241. /** Contention Window maximum. Range: 1 - 10 */
  7242. A_UINT32 current_cw_max[HTT_NUM_AC_WMM];
  7243. /** AIFS value - 0 -255 */
  7244. A_UINT32 current_aifs[HTT_NUM_AC_WMM];
  7245. A_UINT32 reduced_ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES][HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  7246. } htt_stats_sta_ul_ofdma_stats_tlv;
  7247. /* preserve old name alias for new name consistent with the tag name */
  7248. typedef htt_stats_sta_ul_ofdma_stats_tlv htt_sta_ul_ofdma_stats_tlv;
  7249. /* NOTE:
  7250. * This structure is for documentation, and cannot be safely used directly.
  7251. * Instead, use the constituent TLV structures to fill/parse.
  7252. */
  7253. #ifdef ATH_TARGET
  7254. typedef struct {
  7255. htt_stats_sta_ul_ofdma_stats_tlv ul_ofdma_sta_stats;
  7256. } htt_sta_11ax_ul_stats_t;
  7257. #endif /* ATH_TARGET */
  7258. typedef struct {
  7259. htt_tlv_hdr_t tlv_hdr;
  7260. /** No of Fine Timing Measurement frames transmitted successfully */
  7261. A_UINT32 tx_ftm_suc;
  7262. /**
  7263. * No of Fine Timing Measurement frames transmitted successfully
  7264. * after retry
  7265. */
  7266. A_UINT32 tx_ftm_suc_retry;
  7267. /** No of Fine Timing Measurement frames not transmitted successfully */
  7268. A_UINT32 tx_ftm_fail;
  7269. /**
  7270. * No of Fine Timing Measurement Request frames received,
  7271. * including initial, non-initial, and duplicates
  7272. */
  7273. A_UINT32 rx_ftmr_cnt;
  7274. /**
  7275. * No of duplicate Fine Timing Measurement Request frames received,
  7276. * including both initial and non-initial
  7277. */
  7278. A_UINT32 rx_ftmr_dup_cnt;
  7279. /** No of initial Fine Timing Measurement Request frames received */
  7280. A_UINT32 rx_iftmr_cnt;
  7281. /**
  7282. * No of duplicate initial Fine Timing Measurement Request frames received
  7283. */
  7284. A_UINT32 rx_iftmr_dup_cnt;
  7285. /** No of responder sessions rejected when initiator was active */
  7286. A_UINT32 initiator_active_responder_rejected_cnt;
  7287. /** Responder terminate count */
  7288. A_UINT32 responder_terminate_cnt;
  7289. A_UINT32 vdev_id;
  7290. } htt_stats_vdev_rtt_resp_stats_tlv;
  7291. /* preserve old name alias for new name consistent with the tag name */
  7292. typedef htt_stats_vdev_rtt_resp_stats_tlv htt_vdev_rtt_resp_stats_tlv;
  7293. #ifdef ATH_TARGET
  7294. typedef struct {
  7295. htt_stats_vdev_rtt_resp_stats_tlv vdev_rtt_resp_stats;
  7296. } htt_vdev_rtt_resp_stats_t;
  7297. #endif /* ATH_TARGET */
  7298. typedef struct {
  7299. htt_tlv_hdr_t tlv_hdr;
  7300. A_UINT32 vdev_id;
  7301. /**
  7302. * No of Fine Timing Measurement request frames transmitted successfully
  7303. */
  7304. A_UINT32 tx_ftmr_cnt;
  7305. /**
  7306. * No of Fine Timing Measurement request frames not transmitted successfully
  7307. */
  7308. A_UINT32 tx_ftmr_fail;
  7309. /**
  7310. * No of Fine Timing Measurement request frames transmitted successfully
  7311. * after retry
  7312. */
  7313. A_UINT32 tx_ftmr_suc_retry;
  7314. /**
  7315. * No of Fine Timing Measurement frames received, including initial,
  7316. * non-initial, and duplicates
  7317. */
  7318. A_UINT32 rx_ftm_cnt;
  7319. /** Initiator Terminate count */
  7320. A_UINT32 initiator_terminate_cnt;
  7321. /** Debug count to check the Measurement request from host */
  7322. A_UINT32 tx_meas_req_count;
  7323. } htt_stats_vdev_rtt_init_stats_tlv;
  7324. /* preserve old name alias for new name consistent with the tag name */
  7325. typedef htt_stats_vdev_rtt_init_stats_tlv htt_vdev_rtt_init_stats_tlv;
  7326. #ifdef ATH_TARGET
  7327. typedef struct {
  7328. htt_stats_vdev_rtt_init_stats_tlv vdev_rtt_init_stats;
  7329. } htt_vdev_rtt_init_stats_t;
  7330. #endif /* ATH_TARGET */
  7331. #define HTT_STATS_MAX_SCH_CMD_RESULT 25
  7332. /* TXSEND self generated frames */
  7333. typedef enum {
  7334. HTT_TXSEND_FTYPE_SGEN_TF_POLL,
  7335. HTT_TXSEND_FTYPE_SGEN_TF_SOUND,
  7336. HTT_TXSEND_FTYPE_SGEN_TBR_NDPA,
  7337. HTT_TXSEND_FTYPE_SGEN_TBR_NDP,
  7338. HTT_TXSEND_FTYPE_SGEN_TBR_LMR,
  7339. HTT_TXSEND_FTYPE_SGEN_TF_REPORT,
  7340. HTT_TXSEND_FTYPE_MAX
  7341. }
  7342. htt_stats_txsend_ftype_t;
  7343. typedef struct {
  7344. htt_tlv_hdr_t tlv_hdr;
  7345. /* 11AZ TBR SU Stats */
  7346. A_UINT32 tbr_su_ftype_queued[HTT_TXSEND_FTYPE_MAX];
  7347. /* 11AZ TBR MU Stats */
  7348. A_UINT32 tbr_mu_ftype_queued[HTT_TXSEND_FTYPE_MAX];
  7349. } htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv;
  7350. typedef struct {
  7351. htt_tlv_hdr_t tlv_hdr;
  7352. /** tbr_num_sch_cmd_result_buckets:
  7353. * Number of sch cmd results buckets in use per chip
  7354. * Each bucket contains the counter of the number of times that bucket
  7355. * index was seen in the sch_cmd_result. The last bucket will capture
  7356. * the count of sch_cmd_result matching the last bucket index and the
  7357. * count of all the sch_cmd_results that exceeded the last bucket index
  7358. * value.
  7359. * tbr_num_sch_cmd_result_buckets must be <= HTT_STATS_MAX_SCH_CMD_RESULT
  7360. */
  7361. A_UINT32 tbr_num_sch_cmd_result_buckets;
  7362. /* cmd result status for SU frames in case of TB ranging */
  7363. A_UINT32 opaque_tbr_su_ftype_cmd_result[HTT_TXSEND_FTYPE_MAX][HTT_STATS_MAX_SCH_CMD_RESULT];
  7364. /* cmd result status for MU frames in case of TB ranging */
  7365. A_UINT32 opaque_tbr_mu_ftype_cmd_result[HTT_TXSEND_FTYPE_MAX][HTT_STATS_MAX_SCH_CMD_RESULT];
  7366. } htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv;
  7367. typedef struct {
  7368. htt_tlv_hdr_t tlv_hdr;
  7369. /** ista_ranging_ndpa_cnt:
  7370. * Indicates the number of Ranging NDPA sent successfully.
  7371. */
  7372. A_UINT32 ista_ranging_ndpa_cnt;
  7373. /** ista_ranging_ndp_cnt:
  7374. * Indicates the number of Ranging NDP sent successfully.
  7375. */
  7376. A_UINT32 ista_ranging_ndp_cnt;
  7377. /** ista_ranging_i2r_lmr_cnt:
  7378. * Indicates the number of Ranging I2R LMR sent successfully.
  7379. */
  7380. A_UINT32 ista_ranging_i2r_lmr_cnt;
  7381. /** rtsa_ranging_resp_cnt
  7382. * Indicates the number of times RXPCU initiates a Ranging response
  7383. * as a RSTA.
  7384. */
  7385. A_UINT32 rtsa_ranging_resp_cnt;
  7386. /** rtsa_ranging_ndp_cnt:
  7387. * Indicates the number of Ranging NDP response sent successfully.
  7388. */
  7389. A_UINT32 rtsa_ranging_ndp_cnt;
  7390. /** rsta_ranging_lmr_cnt:
  7391. * Indicates the number of Ranging R2I LMR response sent successfully.
  7392. */
  7393. A_UINT32 rsta_ranging_lmr_cnt;
  7394. /** tb_ranging_cts2s_rcvd_cnt:
  7395. * Indicates the number of expected CTS2S response received for TF Poll
  7396. * sent.
  7397. */
  7398. A_UINT32 tb_ranging_cts2s_rcvd_cnt;
  7399. /** tb_ranging_ndp_rcvd_cnt:
  7400. * Indicates the number of expected NDP response received for TF Sound
  7401. * or Secure Sound sent.
  7402. */
  7403. A_UINT32 tb_ranging_ndp_rcvd_cnt;
  7404. /** tb_ranging_lmr_rcvd_cnt:
  7405. * Indicates the number of expected LMR response received for TF Report
  7406. * sent.
  7407. */
  7408. A_UINT32 tb_ranging_lmr_rcvd_cnt;
  7409. /** tb_ranging_tf_poll_resp_sent_cnt:
  7410. * Indicates the number of successful responses sent for TF Poll
  7411. * received.
  7412. */
  7413. A_UINT32 tb_ranging_tf_poll_resp_sent_cnt;
  7414. /** tb_ranging_tf_sound_resp_sent_cnt:
  7415. * Indicates the number of successful responses sent for TF Sound
  7416. * (or Secure) received.
  7417. */
  7418. A_UINT32 tb_ranging_tf_sound_resp_sent_cnt;
  7419. /** tb_ranging_tf_report_resp_sent_cnt:
  7420. * Indicates the number of successful responses sent for TF Report
  7421. * received.
  7422. */
  7423. A_UINT32 tb_ranging_tf_report_resp_sent_cnt;
  7424. } htt_stats_pdev_rtt_hw_stats_tlv;
  7425. typedef struct {
  7426. htt_tlv_hdr_t tlv_hdr;
  7427. A_UINT32 pdev_id;
  7428. /** tx_11mc_ftm_suc:
  7429. * Number of 11mc Fine Timing Measurement frames transmitted successfully.
  7430. */
  7431. A_UINT32 tx_11mc_ftm_suc;
  7432. /** tx_11mc_ftm_suc_retry:
  7433. * Number of Fine Timing Measurement frames transmitted successfully
  7434. * after retrying.
  7435. */
  7436. A_UINT32 tx_11mc_ftm_suc_retry;
  7437. /** tx_11mc_ftm_fail:
  7438. * Number of Fine Timing Measurement frames not transmitted successfully.
  7439. */
  7440. A_UINT32 tx_11mc_ftm_fail;
  7441. /** rx_11mc_ftmr_cnt:
  7442. * Number of FTMR frames received, including initial, non-initial,
  7443. * and duplicates.
  7444. */
  7445. A_UINT32 rx_11mc_ftmr_cnt;
  7446. /** rx_11mc_ftmr_dup_cnt:
  7447. * Number of duplicate Fine Timing Measurement Request frames received,
  7448. * including both initial and non-initial.
  7449. */
  7450. A_UINT32 rx_11mc_ftmr_dup_cnt;
  7451. /** rx_11mc_iftmr_cnt:
  7452. * Number of initial Fine Timing Measurement Request frames received.
  7453. */
  7454. A_UINT32 rx_11mc_iftmr_cnt;
  7455. /** rx_11mc_iftmr_dup_cnt:
  7456. * Number of duplicate initial Fine Timing Measurement Request frames
  7457. * received.
  7458. */
  7459. A_UINT32 rx_11mc_iftmr_dup_cnt;
  7460. /** ftmr_drop_11mc_resp_role_not_enabled_cnt:
  7461. * Number of FTMR frames dropped as 11mc is not supported for this VAP.
  7462. */
  7463. A_UINT32 ftmr_drop_11mc_resp_role_not_enabled_cnt;
  7464. /** initiator_active_responder_rejected_cnt:
  7465. * Number of responder sessions rejected when initiator was active.
  7466. */
  7467. A_UINT32 initiator_active_responder_rejected_cnt;
  7468. /** responder_terminate_cnt:
  7469. * Number of times Responder session got terminated.
  7470. */
  7471. A_UINT32 responder_terminate_cnt;
  7472. /** active_rsta_open:
  7473. * Number of active responder contexts in open mode.
  7474. */
  7475. A_UINT32 active_rsta_open;
  7476. /** active_rsta_mac:
  7477. * Number of active responder contexts in mac security mode.
  7478. */
  7479. A_UINT32 active_rsta_mac;
  7480. /** active_rsta_mac_phy:
  7481. * Number of active responder contexts in mac_phy security mode.
  7482. */
  7483. A_UINT32 active_rsta_mac_phy;
  7484. /** num_assoc_ranging_peers:
  7485. * Number of active associated ISTA ranging peers.
  7486. */
  7487. A_UINT32 num_assoc_ranging_peers;
  7488. /** num_unassoc_ranging_peers:
  7489. * Number of active un-associated ISTA ranging peers.
  7490. */
  7491. A_UINT32 num_unassoc_ranging_peers;
  7492. /** responder_alloc_cnt:
  7493. * Number of responder contexts allocated.
  7494. */
  7495. A_UINT32 responder_alloc_cnt;
  7496. /** responder_alloc_failure:
  7497. * Number of times responder context failed to be allocated.
  7498. */
  7499. A_UINT32 responder_alloc_failure;
  7500. /** pn_check_failure_cnt:
  7501. * Number of times PN check failed.
  7502. */
  7503. A_UINT32 pn_check_failure_cnt;
  7504. /** pasn_m1_auth_recv_cnt:
  7505. * Num of M1 auth frames received for PASN over the air from iSTA.
  7506. */
  7507. A_UINT32 pasn_m1_auth_recv_cnt;
  7508. /** pasn_m1_auth_drop_cnt:
  7509. * Number of M1 auth frames received for PASN over the air from iSTA
  7510. * but dropped in FW due to any reason (such as unavailability of
  7511. * responder ctxt or any other check).
  7512. */
  7513. A_UINT32 pasn_m1_auth_drop_cnt;
  7514. /** pasn_m2_auth_recv_cnt:
  7515. * Number of M2 auth frames received in FW for PASN from Host driver.
  7516. */
  7517. A_UINT32 pasn_m2_auth_recv_cnt;
  7518. /** pasn_m2_auth_tx_fail_cnt:
  7519. * Number of M2 auth frames received in FW but Tx failed.
  7520. */
  7521. A_UINT32 pasn_m2_auth_tx_fail_cnt;
  7522. /** pasn_m3_auth_recv_cnt:
  7523. * Number of M3 auth frames received for PASN.
  7524. */
  7525. A_UINT32 pasn_m3_auth_recv_cnt;
  7526. /** pasn_m3_auth_drop_cnt:
  7527. * Number of M3 auth frames received for PASN over the air from iSTA but
  7528. * dropped in FW due to any reason.
  7529. */
  7530. A_UINT32 pasn_m3_auth_drop_cnt;
  7531. /** pasn_peer_create_request_cnt:
  7532. * Number of times FW requested PASN peer create request to Host.
  7533. */
  7534. A_UINT32 pasn_peer_create_request_cnt;
  7535. /** pasn_peer_create_timeout_cnt:
  7536. * Number of times PASN peer was not created within timeout period.
  7537. */
  7538. A_UINT32 pasn_peer_create_timeout_cnt;
  7539. /** pasn_peer_created_cnt:
  7540. * Number of times Host sent PASN peer create request to FW.
  7541. */
  7542. A_UINT32 pasn_peer_created_cnt;
  7543. /** sec_ranging_not_supported_mfp_not_setup:
  7544. * management frame protection not setup, drop secure ranging request.
  7545. */
  7546. A_UINT32 sec_ranging_not_supported_mfp_not_setup;
  7547. /** non_sec_ranging_discarded_for_assoc_peer_with_mfpr_set:
  7548. * Non secured ranging request discarded for Assoc peer with MFPR set.
  7549. */
  7550. A_UINT32 non_sec_ranging_discarded_for_assoc_peer_with_mfpr_set;
  7551. /** open_ranging_discarded_with_URNM_MFPR_set_for_pasn_peer:
  7552. * Failure in case non-secured frame is received for PASN peer and
  7553. * URNM_MFPR is set.
  7554. */
  7555. A_UINT32 open_ranging_discarded_with_URNM_MFPR_set_for_pasn_peer;
  7556. /** unassoc_non_pasn_ranging_not_supported_with_URNM_MFPR:
  7557. * Failure in case non-assoc/non-PASN sta is sending open FTMR and
  7558. * RSTA does not support un-secured ranging.
  7559. */
  7560. A_UINT32 unassoc_non_pasn_ranging_not_supported_with_URNM_MFPR;
  7561. /** num_req_bw_20_MHz:
  7562. * Number of requests with BW 20 MHz.
  7563. */
  7564. A_UINT32 num_req_bw_20_MHz;
  7565. /** num_req_bw_40_MHz:
  7566. * Number of requests with BW 40 MHz.
  7567. */
  7568. A_UINT32 num_req_bw_40_MHz;
  7569. /** num_req_bw_80_MHz:
  7570. * Number of requests with BW 80 MHz.
  7571. */
  7572. A_UINT32 num_req_bw_80_MHz;
  7573. /** num_req_bw_160_MHz:
  7574. * Number of requests with BW 160 MHz.
  7575. */
  7576. A_UINT32 num_req_bw_160_MHz;
  7577. /** tx_11az_ftm_successful:
  7578. * Number of 11AZ FTM frames transmitted successfully.
  7579. */
  7580. A_UINT32 tx_11az_ftm_successful;
  7581. /** tx_11az_ftm_failed:
  7582. * Number of 11AZ FTM frames for which Tx failed.
  7583. */
  7584. A_UINT32 tx_11az_ftm_failed;
  7585. /** rx_11az_ftmr_cnt:
  7586. * Number of 11AZ FTM frames received.
  7587. */
  7588. A_UINT32 rx_11az_ftmr_cnt;
  7589. /** rx_11az_ftmr_dup_cnt:
  7590. * Number of duplicate 11az ftmr frames dropped.
  7591. */
  7592. A_UINT32 rx_11az_ftmr_dup_cnt;
  7593. /** rx_11az_iftmr_dup_cnt:
  7594. * Number of duplicate 11az iftmr frames dropped.
  7595. */
  7596. A_UINT32 rx_11az_iftmr_dup_cnt;
  7597. /** malformed_ftmr:
  7598. * Number of malformed FTMR frames received from client leading to
  7599. * frame parse error.
  7600. */
  7601. A_UINT32 malformed_ftmr;
  7602. /** ftmr_drop_ntb_resp_role_not_enabled_cnt:
  7603. * Number of FTMR frames dropped as NTB is not supported for this VAP.
  7604. */
  7605. A_UINT32 ftmr_drop_ntb_resp_role_not_enabled_cnt;
  7606. /** ftmr_drop_tb_resp_role_not_enabled_cnt:
  7607. * Number of FTMR frames dropped as TB is not supported for this VAP.
  7608. */
  7609. A_UINT32 ftmr_drop_tb_resp_role_not_enabled_cnt;
  7610. /** invalid_ftm_request_params:
  7611. * Number of FTMR frames received with invalid params.
  7612. */
  7613. A_UINT32 invalid_ftm_request_params;
  7614. /** requested_bw_format_not_supported:
  7615. * FTMR rejected as requested format is lower or higher than AP's
  7616. * capability, or unknown.
  7617. */
  7618. A_UINT32 requested_bw_format_not_supported;
  7619. /** ntb_unsec_unassoc_mode_ranging_peer_alloc_failed:
  7620. * AST entry creation failed for NTB unsecured mode.
  7621. */
  7622. A_UINT32 ntb_unsec_unassoc_mode_ranging_peer_alloc_failed;
  7623. /** tb_unassoc_unsec_mode_pasn_peer_creation_failed:
  7624. * PASN peer creation failed for unsecured mode TBR.
  7625. */
  7626. A_UINT32 tb_unassoc_unsec_mode_pasn_peer_creation_failed;
  7627. /** num_ranging_sequences_processed:
  7628. * Number of ranging sequences processed for NTB and TB.
  7629. */
  7630. A_UINT32 num_ranging_sequences_processed;
  7631. /** Number of NDPs transmitted for NTBR */
  7632. A_UINT32 ntb_tx_ndp;
  7633. A_UINT32 ndp_rx_cnt;
  7634. /** Number of NDPAs received for 11AZ NTB ranging */
  7635. A_UINT32 num_ntb_ranging_NDPAs_recv;
  7636. /** Number of LMR frames received */
  7637. A_UINT32 recv_lmr;
  7638. /** invalid_ftmr_cnt:
  7639. * Number of invalid FTMR frames received
  7640. * iftmr with null ie element is invalid
  7641. * The Frame is valid if any of the following combination is present:
  7642. * a. LCI sub ie + parameter ie
  7643. * b. LCR sub ie + parameter ie
  7644. * c. parameter ie
  7645. * d. LCI sub ie + LCR sub ie + parameter ie
  7646. */
  7647. A_UINT32 invalid_ftmr_cnt;
  7648. /** Number of times the 'max time b/w measurement' timer got expired */
  7649. A_UINT32 max_time_bw_meas_exp_cnt;
  7650. } htt_stats_pdev_rtt_resp_stats_tlv;
  7651. /* STATS_TYPE: HTT_DBG_EXT_PDEV_RTT_RESP_STATS
  7652. * TLV_TAGS:
  7653. * HTT_STATS_PDEV_RTT_RESP_STATS_TAG
  7654. * HTT_STATS_PDEV_RTT_HW_STATS_TAG
  7655. * HTT_STATS_PDEV_RTT_TBR_SELFGEN_QUEUED_STATS_TAG
  7656. * HTT_STATS_PDEV_RTT_TBR_CMD_RESULT_STATS_TAG
  7657. */
  7658. #ifdef ATH_TARGET
  7659. typedef struct {
  7660. htt_stats_pdev_rtt_resp_stats_tlv pdev_rtt_resp_stats;
  7661. htt_stats_pdev_rtt_hw_stats_tlv pdev_rtt_hw_stats;
  7662. htt_stats_pdev_rtt_tbr_selfgen_queued_stats_tlv pdev_rtt_tbr_selfgen_queued_stats;
  7663. htt_stats_pdev_rtt_tbr_cmd_result_stats_tlv pdev_rtt_tbr_cmd_result_stats;
  7664. } htt_pdev_rtt_resp_stats_t;
  7665. #endif /* ATH_TARGET */
  7666. typedef struct {
  7667. htt_tlv_hdr_t tlv_hdr;
  7668. A_UINT32 pdev_id;
  7669. /** tx_11mc_ftmr_cnt:
  7670. * Number of 11mc Fine Timing Measurement request frames transmitted
  7671. * successfully.
  7672. */
  7673. A_UINT32 tx_11mc_ftmr_cnt;
  7674. /** tx_11mc_ftmr_fail:
  7675. * Number of 11mc Fine Timing Measurement request frames not transmitted
  7676. * successfully.
  7677. */
  7678. A_UINT32 tx_11mc_ftmr_fail;
  7679. /** tx_11mc_ftmr_suc_retry:
  7680. * Number of 11mc Fine Timing Measurement request frames transmitted
  7681. * successfully after retrying.
  7682. */
  7683. A_UINT32 tx_11mc_ftmr_suc_retry;
  7684. /** rx_11mc_ftm_cnt:
  7685. * Number of 11mc Fine Timing Measurement frames received, including
  7686. * initial, non-initial, and duplicates.
  7687. */
  7688. A_UINT32 rx_11mc_ftm_cnt;
  7689. /** Count of Ranging Measurement requests received from host */
  7690. A_UINT32 tx_meas_req_count;
  7691. /** Initiator role not supported on the vdev */
  7692. A_UINT32 init_role_not_enabled;
  7693. /** Number of times Initiator context got terminated */
  7694. A_UINT32 initiator_terminate_cnt;
  7695. /** Number of times Tx of FTMR failed */
  7696. A_UINT32 tx_11az_ftmr_fail;
  7697. /** tx_11az_ftmr_start:
  7698. * Number of Fine Timing Measurement start requests transmitted
  7699. * successfully.
  7700. */
  7701. A_UINT32 tx_11az_ftmr_start;
  7702. /** tx_11az_ftmr_stop:
  7703. * Number of Fine Timing Measurement stop requests transmitted
  7704. * successfully.
  7705. */
  7706. A_UINT32 tx_11az_ftmr_stop;
  7707. /** Number of FTM frames received successfully */
  7708. A_UINT32 rx_11az_ftm_cnt;
  7709. /** Number of active ISTA sessions */
  7710. A_UINT32 active_ista;
  7711. /** HE preamble not enabled on Initiator side */
  7712. A_UINT32 invalid_preamble;
  7713. /** Initiator invalid channel bw format */
  7714. A_UINT32 invalid_chan_bw_format;
  7715. /* mgmt_buff_alloc_fail_cnt Management Buffer allocation failure count */
  7716. A_UINT32 mgmt_buff_alloc_fail_cnt;
  7717. /** ftm_parse_failure:
  7718. * Count of FTM frame IE parse failure or RSTA sending measurement
  7719. * negotiation failure.
  7720. */
  7721. A_UINT32 ftm_parse_failure;
  7722. /** Count of NTB/TB ranging negotiation completed successfully */
  7723. A_UINT32 ranging_negotiation_successful_cnt;
  7724. /** incompatible_ftm_params:
  7725. * Number of occurrences of failure due to incompatible parameters
  7726. * suggested by rSTA during negotiation.
  7727. */
  7728. A_UINT32 incompatible_ftm_params;
  7729. /** sec_ranging_req_in_open_mode:
  7730. * Number of occurrences of failure if BSS peer exists in open mode and
  7731. * secured mode RTT ranging is requested.
  7732. */
  7733. A_UINT32 sec_ranging_req_in_open_mode;
  7734. /** ftmr_tx_failed_null_11az_peer:
  7735. * Number of occurrences where FTMR was not transmitted as there was
  7736. * no 11AZ peer.
  7737. */
  7738. A_UINT32 ftmr_tx_failed_null_11az_peer;
  7739. /** Number of times ftmr retry timed out */
  7740. A_UINT32 ftmr_retry_timeout;
  7741. /** Number of times the 'max time b/w measurement' timer got expired */
  7742. A_UINT32 max_time_bw_meas_exp_cnt;
  7743. /** tb_meas_duration_expiry_cnt:
  7744. * Number of times TBR measurement duration expired.
  7745. */
  7746. A_UINT32 tb_meas_duration_expiry_cnt;
  7747. /** num_tb_ranging_requests:
  7748. * Number of TB ranging requests ready for negotiation.
  7749. */
  7750. A_UINT32 num_tb_ranging_requests;
  7751. /** Number of times NTB ranging was triggered successfully */
  7752. A_UINT32 ntbr_triggered_successfully;
  7753. /** Number of times NTB ranging failed to be triggered */
  7754. A_UINT32 ntbr_trigger_failed;
  7755. /** No valid index found for programming vreg settings */
  7756. A_UINT32 invalid_or_no_vreg_idx;
  7757. /** Number of times VREG setting failed */
  7758. A_UINT32 set_vreg_params_failed;
  7759. /** Number of occurrences of SAC mismatch */
  7760. A_UINT32 sac_mismatch;
  7761. /** pasn_m1_auth_recv_cnt:
  7762. * Number of M1 auth frames received for PASN from Host.
  7763. */
  7764. A_UINT32 pasn_m1_auth_recv_cnt;
  7765. /** pasn_m1_auth_tx_fail_cnt:
  7766. * Number of M1 auth frames received in FW but Tx failed.
  7767. */
  7768. A_UINT32 pasn_m1_auth_tx_fail_cnt;
  7769. /** pasn_m2_auth_recv_cnt:
  7770. * Number of M2 auth frames received in FW for PASN over the air from rSTA.
  7771. */
  7772. A_UINT32 pasn_m2_auth_recv_cnt;
  7773. /** pasn_m2_auth_drop_cnt:
  7774. * Number of M2 auth frames received in FW but dropped due to any reason.
  7775. */
  7776. A_UINT32 pasn_m2_auth_drop_cnt;
  7777. /** pasn_m3_auth_recv_cnt:
  7778. * Number of M3 auth frames received for PASN from Host.
  7779. */
  7780. A_UINT32 pasn_m3_auth_recv_cnt;
  7781. /** pasn_m3_auth_tx_fail_cnt:
  7782. * Number of M3 auth frames received in FW but Tx failed.
  7783. */
  7784. A_UINT32 pasn_m3_auth_tx_fail_cnt;
  7785. /** pasn_peer_create_request_cnt:
  7786. * Number of times FW requested PASN peer create request to Host.
  7787. */
  7788. A_UINT32 pasn_peer_create_request_cnt;
  7789. /** pasn_peer_create_timeout_cnt:
  7790. * Number of times PASN peer was not created within timeout period.
  7791. */
  7792. A_UINT32 pasn_peer_create_timeout_cnt;
  7793. /** pasn_peer_created_cnt:
  7794. * Number of times Host sent PASN peer create request to FW.
  7795. */
  7796. A_UINT32 pasn_peer_created_cnt;
  7797. /** Number of occurrences of Tx of NDPA failing */
  7798. A_UINT32 ntbr_ndpa_failed;
  7799. /** ntbr_sequence_successful:
  7800. * The NDPA, NDP and LMR exchanges are successful and sched cmd status
  7801. * is 0.
  7802. */
  7803. A_UINT32 ntbr_sequence_successful;
  7804. /** ntbr_ndp_failed:
  7805. * Number of occurrences of NDPA being transmitted successfully
  7806. * but NDP failing for NTB ranging.
  7807. */
  7808. A_UINT32 ntbr_ndp_failed;
  7809. /** sch_cmd_status_cnts:
  7810. * Elements 0-7 count the number of times the sch_cmd_status was equal to
  7811. * the corresponding value of the index of the array sch_cmd_status_cnts[],
  7812. * and element 8 counts the numbers of times the status was some other
  7813. * value >=8.
  7814. */
  7815. A_UINT32 sch_cmd_status_cnts[9];
  7816. /** Number of times LMR reception timed out */
  7817. A_UINT32 lmr_timeout;
  7818. /** Number of LMR frames received */
  7819. A_UINT32 lmr_recv;
  7820. /** Number of trigger frames received */
  7821. A_UINT32 num_trigger_frames_received;
  7822. /** Number of NDPAs received for TBR */
  7823. A_UINT32 num_tb_ranging_NDPAs_recv;
  7824. /** Number of ranging NDPs received for NTBR/TB */
  7825. A_UINT32 ndp_rx_cnt;
  7826. } htt_stats_pdev_rtt_init_stats_tlv;
  7827. /* STATS_TYPE: HTT_DBG_EXT_PDEV_RTT_INITIATOR_STATS
  7828. * TLV_TAGS:
  7829. * HTT_STATS_PDEV_RTT_INIT_STATS_TAG
  7830. * HTT_STATS_PDEV_RTT_HW_STATS_TAG
  7831. */
  7832. #ifdef ATH_TARGET
  7833. typedef struct {
  7834. htt_stats_pdev_rtt_init_stats_tlv pdev_rtt_init_stats;
  7835. htt_stats_pdev_rtt_hw_stats_tlv pdev_rtt_hw_stats;
  7836. } htt_pdev_rtt_init_stats_t;
  7837. #endif /* ATH_TARGET */
  7838. enum {
  7839. HTT_STATS_WIFI_RADAR_CAL_TYPE_NONE = 0,
  7840. HTT_STATS_WIFI_RADAR_CAL_TYPE_GAIN_BINARY_SEARCH = 1,
  7841. HTT_STATS_WIFI_RADAR_CAL_TYPE_TX_GAIN_BINARY_SEARCH = 2,
  7842. HTT_STATS_WIFI_RADAR_CAL_TYPE_RECAL_GAIN_VALIDATION = 3,
  7843. HTT_STATS_WIFI_RADAR_CAL_TYPE_RECAL_GAIN_BINARY_SEARCH = 4,
  7844. /* the value 5 is reserved for future use */
  7845. HTT_STATS_NUM_WIFI_RADAR_CAL_TYPES = 6
  7846. };
  7847. enum {
  7848. HTT_STATS_WIFI_RADAR_CAL_FAILURE_NONE = 0,
  7849. HTT_STATS_WIFI_RADAR_CAL_FAILURE_DPD_ABORT = 1,
  7850. HTT_STATS_WIFI_RADAR_CAL_FAILURE_CONVERGENCE = 2,
  7851. HTT_STATS_WIFI_RADAR_CAL_FAILURE_TX_EXCEEDS_RETRY = 3,
  7852. HTT_STATS_WIFI_RADAR_CAL_FAILURE_CAPTURE = 4,
  7853. HTT_STATS_WIFI_RADAR_CAL_FAILURE_NEW_CHANNEL_CHANGE = 5,
  7854. HTT_STATS_WIFI_RADAR_CAL_FAILURE_NEW_CAL_REQ = 6,
  7855. /* the values 7-9 are reserved for future use */
  7856. HTT_STATS_NUM_WIFI_RADAR_CAL_FAILURE_REASONS = 10
  7857. };
  7858. typedef struct {
  7859. htt_tlv_hdr_t tlv_hdr;
  7860. A_UINT32 capture_in_progress;
  7861. A_UINT32 calibration_in_progress;
  7862. /* Capture time interval, in ms */
  7863. A_UINT32 periodicity;
  7864. /* Last user request timestamp, in ms */
  7865. A_UINT32 latest_req_timestamp;
  7866. /* Last target res timestamp, in ms */
  7867. A_UINT32 latest_resp_timestamp;
  7868. /* Time taken by last calibration to end, in ms */
  7869. A_UINT32 latest_calibration_timing;
  7870. /* Time taken by last calibration to end, in ms for each chain */
  7871. A_UINT32 calibration_timing_per_chain[HTT_STATS_MAX_CHAINS];
  7872. /* To log user request count */
  7873. A_UINT32 wifi_radar_req_count;
  7874. /* Total packet success count */
  7875. A_UINT32 num_wifi_radar_pkt_success;
  7876. /* Total packet queued count */
  7877. A_UINT32 num_wifi_radar_pkt_queued;
  7878. /* Total packet success count during latest calibration alone */
  7879. A_UINT32 num_wifi_radar_cal_pkt_success;
  7880. /* Tx Gain Calibration Output - Initial Tx Gain index*/
  7881. A_UINT32 wifi_radar_cal_init_tx_gain;
  7882. /* Last Calibration Type, refer to HTT_STATS_WIFI_RADAR_CAL_TYPE_ consts */
  7883. A_UINT32 latest_wifi_radar_cal_type;
  7884. /* Calibration Type counters */
  7885. A_UINT32 wifi_radar_cal_type_counts[HTT_STATS_NUM_WIFI_RADAR_CAL_TYPES];
  7886. /*
  7887. * Last Calibration Fail Reason,
  7888. * refer to HTT_STATS_WIFI_RADAR_CAL_FAILURE_ consts
  7889. */
  7890. A_UINT32 latest_wifi_radar_cal_fail_reason;
  7891. /* Calibration Fail Reason counters */
  7892. A_UINT32 wifi_radar_cal_fail_reason_counts[HTT_STATS_NUM_WIFI_RADAR_CAL_FAILURE_REASONS];
  7893. /* WiFi Radar Licensed for SKU: 0 - No; 1 - Yes */
  7894. A_UINT32 wifi_radar_licensed;
  7895. /*
  7896. * cmd result to show failure count of CTS2SELF across MAX_CMD_RESULT
  7897. * reasons
  7898. */
  7899. A_UINT32 cmd_results_cts2self[HTT_STATS_MAX_SCH_CMD_RESULT];
  7900. /*
  7901. * cmd result to show failure count of wifi radar across MAX_CMD_RESULT
  7902. * reasons
  7903. */
  7904. A_UINT32 cmd_results_wifi_radar[HTT_STATS_MAX_SCH_CMD_RESULT];
  7905. /* Tx gain index from gain table obtained/used for calibration */
  7906. A_UINT32 wifi_radar_tx_gains[HTT_STATS_MAX_CHAINS];
  7907. /* Rx gain index from gain table obtained/used from calibration */
  7908. A_UINT32 wifi_radar_rx_gains[HTT_STATS_MAX_CHAINS][HTT_STATS_MAX_CHAINS];
  7909. } htt_stats_tx_pdev_wifi_radar_tlv;
  7910. /* STATS_TYPE : HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  7911. * TLV_TAGS:
  7912. * - HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG
  7913. */
  7914. /* NOTE:
  7915. * This structure is for documentation, and cannot be safely used directly.
  7916. * Instead, use the constituent TLV structures to fill/parse.
  7917. */
  7918. typedef struct {
  7919. htt_tlv_hdr_t tlv_hdr;
  7920. /** No of pktlog payloads that were dropped in htt_ppdu_stats path */
  7921. A_UINT32 pktlog_lite_drop_cnt;
  7922. /** No of pktlog payloads that were dropped in TQM path */
  7923. A_UINT32 pktlog_tqm_drop_cnt;
  7924. /** No of pktlog ppdu stats payloads that were dropped */
  7925. A_UINT32 pktlog_ppdu_stats_drop_cnt;
  7926. /** No of pktlog ppdu ctrl payloads that were dropped */
  7927. A_UINT32 pktlog_ppdu_ctrl_drop_cnt;
  7928. /** No of pktlog sw events payloads that were dropped */
  7929. A_UINT32 pktlog_sw_events_drop_cnt;
  7930. } htt_stats_pktlog_and_htt_ring_stats_tlv;
  7931. /* preserve old name alias for new name consistent with the tag name */
  7932. typedef htt_stats_pktlog_and_htt_ring_stats_tlv
  7933. htt_pktlog_and_htt_ring_stats_tlv;
  7934. #define HTT_DLPAGER_STATS_MAX_HIST 10
  7935. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M 0x000000FF
  7936. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S 0
  7937. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M 0x0000FF00
  7938. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S 8
  7939. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_M 0x0000FFFF
  7940. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_S 0
  7941. #define HTT_DLPAGER_TOTAL_FREE_PAGES_M 0xFFFF0000
  7942. #define HTT_DLPAGER_TOTAL_FREE_PAGES_S 16
  7943. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M 0x0000FFFF
  7944. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S 0
  7945. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M 0xFFFF0000
  7946. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S 16
  7947. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var) \
  7948. (((_var) & HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M) >> \
  7949. HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)
  7950. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_ASYNC_LOCK_GET(_var) \
  7951. HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var)
  7952. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  7953. do { \
  7954. HTT_CHECK_SET_VAL(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT, _val); \
  7955. ((_var) &= ~(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M));\
  7956. ((_var) |= ((_val) << HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)); \
  7957. } while (0)
  7958. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var) \
  7959. (((_var) & HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M) >> \
  7960. HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)
  7961. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_SYNC_LOCK_GET(_var) \
  7962. HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var)
  7963. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT, _val); \
  7966. ((_var) &= ~(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M));\
  7967. ((_var) |= ((_val) << HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)); \
  7968. } while (0)
  7969. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var) \
  7970. (((_var) & HTT_DLPAGER_TOTAL_LOCKED_PAGES_M) >> \
  7971. HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)
  7972. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_TOTAL_LOCKED_PAGES_GET(_var) \
  7973. HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var)
  7974. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_SET(_var, _val) \
  7975. do { \
  7976. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_LOCKED_PAGES, _val); \
  7977. ((_var) &= ~(HTT_DLPAGER_TOTAL_LOCKED_PAGES_M)); \
  7978. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)); \
  7979. } while (0)
  7980. #define HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var) \
  7981. (((_var) & HTT_DLPAGER_TOTAL_FREE_PAGES_M) >> \
  7982. HTT_DLPAGER_TOTAL_FREE_PAGES_S)
  7983. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_TOTAL_FREE_PAGES_GET(_var) \
  7984. HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var)
  7985. #define HTT_DLPAGER_TOTAL_FREE_PAGES_SET(_var, _val) \
  7986. do { \
  7987. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_FREE_PAGES, _val); \
  7988. ((_var) &= ~(HTT_DLPAGER_TOTAL_FREE_PAGES_M)); \
  7989. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_FREE_PAGES_S)); \
  7990. } while (0)
  7991. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var) \
  7992. (((_var) & HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M) >> \
  7993. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)
  7994. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_LAST_LOCKED_PAGE_IDX_GET(_var) \
  7995. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var)
  7996. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_SET(_var, _val) \
  7997. do { \
  7998. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX, _val); \
  7999. ((_var) &= ~(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M)); \
  8000. ((_var) |= ((_val) << HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)); \
  8001. } while (0)
  8002. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  8003. (((_var) & HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M) >> \
  8004. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)
  8005. #define HTT_STATS_DLPAGER_STATS_DL_PAGER_STATS_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  8006. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var)
  8007. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_SET(_var, _val) \
  8008. do { \
  8009. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX, _val); \
  8010. ((_var) &= ~(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M)); \
  8011. ((_var) |= ((_val) << HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)); \
  8012. } while (0)
  8013. enum {
  8014. HTT_STATS_PAGE_LOCKED = 0,
  8015. HTT_STATS_PAGE_UNLOCKED = 1,
  8016. HTT_STATS_NUM_PAGE_LOCK_STATES
  8017. };
  8018. /* dlPagerStats structure
  8019. * Number of lock/unlock pages with last 10 lock/unlock occurrences are recorded */
  8020. typedef struct{
  8021. /** msg_dword_1 bitfields:
  8022. * async_lock : 8,
  8023. * sync_lock : 8,
  8024. * reserved : 16;
  8025. */
  8026. union {
  8027. struct {
  8028. A_UINT32 async_lock: 8,
  8029. sync_lock: 8,
  8030. reserved1: 16;
  8031. };
  8032. A_UINT32 msg_dword_1;
  8033. };
  8034. /** mst_dword_2 bitfields:
  8035. * total_locked_pages : 16,
  8036. * total_free_pages : 16;
  8037. */
  8038. union {
  8039. struct {
  8040. A_UINT32 total_locked_pages: 16,
  8041. total_free_pages: 16;
  8042. };
  8043. A_UINT32 msg_dword_2;
  8044. };
  8045. /** msg_dword_3 bitfields:
  8046. * last_locked_page_idx : 16,
  8047. * last_unlocked_page_idx : 16;
  8048. */
  8049. union {
  8050. struct {
  8051. A_UINT32 last_locked_page_idx: 16,
  8052. last_unlocked_page_idx: 16;
  8053. };
  8054. A_UINT32 msg_dword_3;
  8055. };
  8056. struct {
  8057. A_UINT32 page_num;
  8058. A_UINT32 num_of_pages;
  8059. /** timestamp is in microsecond units, from SoC timer clock */
  8060. A_UINT32 timestamp_lsbs;
  8061. A_UINT32 timestamp_msbs;
  8062. } last_pages_info[HTT_STATS_NUM_PAGE_LOCK_STATES][HTT_DLPAGER_STATS_MAX_HIST];
  8063. } htt_dl_pager_stats_tlv;
  8064. /* NOTE:
  8065. * This structure is for documentation, and cannot be safely used directly.
  8066. * Instead, use the constituent TLV structures to fill/parse.
  8067. * STATS_TYPE : HTT_DBG_EXT_STATS_DLPAGER_STATS
  8068. * TLV_TAGS:
  8069. * - HTT_STATS_DLPAGER_STATS_TAG
  8070. */
  8071. typedef struct {
  8072. htt_tlv_hdr_t tlv_hdr;
  8073. htt_dl_pager_stats_tlv dl_pager_stats;
  8074. } htt_stats_dlpager_stats_tlv;
  8075. /* preserve old name alias for new name consistent with the tag name */
  8076. typedef htt_stats_dlpager_stats_tlv htt_dlpager_stats_t;
  8077. /*======= PHY STATS ====================*/
  8078. /*
  8079. * STATS TYPE : HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  8080. * TLV_TAGS:
  8081. * - HTT_STATS_PHY_COUNTERS_TAG
  8082. * - HTT_STATS_PHY_STATS_TAG
  8083. */
  8084. #define HTT_MAX_RX_PKT_CNT 8
  8085. #define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
  8086. #define HTT_MAX_PER_BLK_ERR_CNT 20
  8087. #define HTT_MAX_RX_OTA_ERR_CNT 14
  8088. #define HTT_MAX_RX_PKT_CNT_EXT 4
  8089. #define HTT_MAX_RX_PKT_CRC_PASS_CNT_EXT 4
  8090. #define HTT_MAX_RX_PKT_MU_CNT 14
  8091. #define HTT_MAX_TX_PKT_CNT 10
  8092. #define HTT_MAX_PHY_TX_ABORT_CNT 10
  8093. typedef enum {
  8094. HTT_STATS_CHANNEL_HALF_RATE = 0x0001, /* Half rate */
  8095. HTT_STATS_CHANNEL_QUARTER_RATE = 0x0002, /* Quarter rate */
  8096. HTT_STATS_CHANNEL_DFS = 0x0004, /* Enable radar event reporting */
  8097. HTT_STATS_CHANNEL_HOME = 0x0008, /* Home channel */
  8098. HTT_STATS_CHANNEL_PASSIVE_SCAN = 0x0010, /*Passive Scan */
  8099. HTT_STATS_CHANNEL_DFS_SAP_NOT_UP = 0x0020, /* set when VDEV_START_REQUEST, clear when VDEV_UP */
  8100. HTT_STATS_CHANNEL_PASSIVE_SCAN_CAL = 0x0040, /* need to do passive scan calibration to avoid "spikes" */
  8101. HTT_STATS_CHANNEL_DFS_SAP_UP = 0x0080, /* DFS master */
  8102. HTT_STATS_CHANNEL_DFS_CFREQ2 = 0x0100, /* Enable radar event reporting for sec80 in VHT80p80 */
  8103. HTT_STATS_CHANNEL_DTIM_SYNTH = 0x0200, /* Enable DTIM */
  8104. HTT_STATS_CHANNEL_FORCE_GAIN = 0x0400, /* Force gain mmode (only used for FTM) */
  8105. HTT_STATS_CHANNEL_PERFORM_NF_CAL = 0x0800, /* Perform NF cal in channel change (only used for FTM) */
  8106. HTT_STATS_CHANNEL_165_MODE_0 = 0x1000, /* 165 MHz mode 0 */
  8107. HTT_STATS_CHANNEL_165_MODE_1 = 0x2000, /* 165 MHz mode 1 */
  8108. HTT_STATS_CHANNEL_165_MODE_2 = 0x3000, /* 165 MHz mode 2 */
  8109. HTT_STATS_CHANNEL_165_MODE_MASK = 0x3000, /* 165 MHz 2-bit mode mask */
  8110. } HTT_STATS_CHANNEL_FLAGS;
  8111. typedef enum {
  8112. HTT_STATS_RF_MODE_MIN = 0,
  8113. HTT_STATS_RF_MODE_PHYA_ONLY = 0, // only PHYA is active
  8114. HTT_STATS_RF_MODE_DBS = 1, // PHYA/5G and PHYB/2G
  8115. HTT_STATS_RF_MODE_SBS = 2, // PHYA/5G and PHYB/5G in HL/NPR; PHYA0/5G and PHYA1/5G in HK
  8116. HTT_STATS_RF_MODE_PHYB_ONLY = 3, // only PHYB is active
  8117. HTT_STATS_RF_MODE_DBS_SBS = 4, // PHYA0/5G, PHYA1/5G and PHYB/2G in HK (the 2 5G are in different channel)
  8118. HTT_STATS_RF_MODE_DBS_OR_SBS = 5, // PHYA0/5G, PHYA1/5G and PHYB/5G or 2G in HK
  8119. HTT_STATS_RF_MODE_INVALID = 0xff,
  8120. } HTT_STATS_RF_MODE;
  8121. typedef enum {
  8122. HTT_STATS_RESET_CAUSE_FIRST_RESET = 0x00000001, /* First reset by application */
  8123. HTT_STATS_RESET_CAUSE_ERROR = 0x00000002, /* Triggered due to error */
  8124. HTT_STATS_RESET_CAUSE_DEEP_SLEEP = 0x00000004, /* Reset after deep sleep */
  8125. HTT_STATS_RESET_CAUSE_FULL_RESET = 0x00000008, /* Full reset without any optimizations */
  8126. HTT_STATS_RESET_CAUSE_CHANNEL_CHANGE = 0x00000010, /* For normal channel change */
  8127. HTT_STATS_RESET_CAUSE_BAND_CHANGE = 0x00000020, /* Triggered due to band change */
  8128. HTT_STATS_RESET_CAUSE_DO_CAL = 0x00000040, /* Triggered due to calibrations */
  8129. HTT_STATS_RESET_CAUSE_MCI_ERROR = 0x00000080, /* Triggered due to MCI ERROR */
  8130. HTT_STATS_RESET_CAUSE_CHWIDTH_CHANGE = 0x00000100, /* Triggered due to channel width change */
  8131. HTT_STATS_RESET_CAUSE_WARM_RESTORE_CAL = 0x00000200, /* Triggered due to warm reset we want to just restore calibrations */
  8132. HTT_STATS_RESET_CAUSE_COLD_RESTORE_CAL = 0x00000400, /* Triggered due to cold reset we want to just restore calibrations */
  8133. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET = 0x00000800, /* Triggered due to phy warm reset we want to just restore calibrations */
  8134. HTT_STATS_RESET_CAUSE_M3_SSR = 0x00001000, /* Triggered due to SSR Restart */
  8135. HTT_STATS_RESET_CAUSE_FORCE_CAL = 0x00002000, /* Reset to force the calibration */
  8136. /* 0x00004000, 0x00008000 reserved */
  8137. HTT_STATS_NO_RESET_CHANNEL_CHANGE = 0x00010000, /* No reset, normal channel change */
  8138. HTT_STATS_NO_RESET_BAND_CHANGE = 0x00020000, /* No reset, channel change across band */
  8139. HTT_STATS_NO_RESET_CHWIDTH_CHANGE = 0x00040000, /* No reset, channel change across channel width */
  8140. HTT_STATS_NO_RESET_CHAINMASK_CHANGE = 0x00080000, /* No reset, chainmask change */
  8141. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET_UCODE_TRIG = 0x00100000, /* Triggered due to phy warm reset we want to just restore calibrations */
  8142. HTT_STATS_RESET_CAUSE_PHY_OFF_TIMEOUT_RESET = 0x00200000, /* Reset ucode because phy off ack timeout*/
  8143. HTT_STATS_RESET_CAUSE_LMAC_RESET_UMAC_NOC_ERR = 0x00400000, /* LMAC reset triggered due to NOC Address/Slave error originating at LMAC */
  8144. HTT_STATS_NO_RESET_SCAN_BACK_TO_SAME_HOME_CHANNEL_CHANGE = 0x00800000, /* No reset, scan to home channel change */
  8145. } HTT_STATS_RESET_CAUSE;
  8146. typedef enum {
  8147. HTT_CHANNEL_RATE_FULL,
  8148. HTT_CHANNEL_RATE_HALF,
  8149. HTT_CHANNEL_RATE_QUARTER,
  8150. HTT_CHANNEL_RATE_COUNT
  8151. } HTT_CHANNEL_RATE;
  8152. typedef enum {
  8153. HTT_PHY_BW_IDX_20MHz = 0,
  8154. HTT_PHY_BW_IDX_40MHz = 1,
  8155. HTT_PHY_BW_IDX_80MHz = 2,
  8156. HTT_PHY_BW_IDX_80Plus80 = 3,
  8157. HTT_PHY_BW_IDX_160MHz = 4,
  8158. HTT_PHY_BW_IDX_10MHz = 5,
  8159. HTT_PHY_BW_IDX_5MHz = 6,
  8160. HTT_PHY_BW_IDX_165MHz = 7,
  8161. } HTT_PHY_BW_IDX;
  8162. typedef enum {
  8163. HTT_WHAL_CONFIG_NONE = 0x00000000,
  8164. HTT_WHAL_CONFIG_NF_WAR = 0x00000001,
  8165. HTT_WHAL_CONFIG_CAL_WAR = 0x00000002,
  8166. HTT_WHAL_CONFIG_DO_NF_CAL = 0x00000004,
  8167. HTT_WHAL_CONFIG_SET_WAIT_FOR_NF_CAL = 0x00000008,
  8168. HTT_WHAL_CONFIG_FORCED_TX_PWR = 0x00000010,
  8169. HTT_WHAL_CONFIG_FORCED_GAIN_IDX = 0x00000020,
  8170. HTT_WHAL_CONFIG_FORCED_PER_CHAIN = 0x00000040,
  8171. } HTT_WHAL_CONFIG;
  8172. typedef struct {
  8173. htt_tlv_hdr_t tlv_hdr;
  8174. /** number of RXTD OFDMA OTA error counts except power surge and drop */
  8175. A_UINT32 rx_ofdma_timing_err_cnt;
  8176. /** rx_cck_fail_cnt:
  8177. * number of cck error counts due to rx reception failure because of
  8178. * timing error in cck
  8179. */
  8180. A_UINT32 rx_cck_fail_cnt;
  8181. /** number of times tx abort initiated by mac */
  8182. A_UINT32 mactx_abort_cnt;
  8183. /** number of times rx abort initiated by mac */
  8184. A_UINT32 macrx_abort_cnt;
  8185. /** number of times tx abort initiated by phy */
  8186. A_UINT32 phytx_abort_cnt;
  8187. /** number of times rx abort initiated by phy */
  8188. A_UINT32 phyrx_abort_cnt;
  8189. /** number of rx deferred count initiated by phy */
  8190. A_UINT32 phyrx_defer_abort_cnt;
  8191. /** number of sizing events generated at LSTF */
  8192. A_UINT32 rx_gain_adj_lstf_event_cnt; /* a.k.a sizing1 */
  8193. /** number of sizing events generated at non-legacy LTF */
  8194. A_UINT32 rx_gain_adj_non_legacy_cnt; /* a.k.a sizing2 */
  8195. /** rx_pkt_cnt -
  8196. * Received EOP (end-of-packet) count per packet type;
  8197. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  8198. * [6] = EHT; [7]=RSVD; [6] = Applicable only for BE
  8199. */
  8200. A_UINT32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
  8201. /** rx_pkt_crc_pass_cnt -
  8202. * Received EOP (end-of-packet) count per packet type;
  8203. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  8204. * [6] = EHT; [7]=RSVD; [6] = Applicable only for BE
  8205. */
  8206. A_UINT32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
  8207. /** per_blk_err_cnt -
  8208. * Error count per error source;
  8209. * [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
  8210. * [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
  8211. * [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
  8212. * [13-19]=RSVD
  8213. */
  8214. A_UINT32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
  8215. /** rx_ota_err_cnt -
  8216. * RXTD OTA (over-the-air) error count per error reason;
  8217. * [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
  8218. * [3] = cck fail; [4] = power surge; [5] = power drop;
  8219. * [6] = btcf timing timeout error; [7] = btcf packet detect error;
  8220. * [8] = coarse timing timeout error
  8221. * [9-13]=RSVD
  8222. */
  8223. A_UINT32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
  8224. /** rx_pkt_cnt_ext -
  8225. * Received EOP (end-of-packet) count per packet type for BE;
  8226. * [0] = WUR; [1] = AZ; [2-3]=RVSD
  8227. */
  8228. A_UINT32 rx_pkt_cnt_ext[HTT_MAX_RX_PKT_CNT_EXT];
  8229. /** rx_pkt_crc_pass_cnt_ext -
  8230. * Received EOP (end-of-packet) count per packet type for BE;
  8231. * [0] = WUR; [1] = AZ; [2-3]=RVSD
  8232. */
  8233. A_UINT32 rx_pkt_crc_pass_cnt_ext[HTT_MAX_RX_PKT_CRC_PASS_CNT_EXT];
  8234. /** rx_pkt_mu_cnt -
  8235. * RX MU MIMO+OFDMA packet count per packet type for BE;
  8236. * [0] = 11ax OFDMA; [1] = 11ax OFDMA+MUMIMO; [2] = 11be OFDMA;
  8237. * [3] = 11be OFDMA+MUMIMO; [4] = 11ax MIMO; [5] = 11be MIMO;
  8238. * [6] = 11ax OFDMA; [7] = 11ax OFDMA+MUMIMO; [8] = 11be OFDMA;
  8239. * [9] = 11be OFDMA+MUMIMO; [10] = 11ax MIMO; [11] = 11be MIMO;
  8240. * [12-13]=RSVD
  8241. */
  8242. A_UINT32 rx_pkt_mu_cnt[HTT_MAX_RX_PKT_MU_CNT];
  8243. /** tx_pkt_cnt -
  8244. * num of transfered packet count per packet type;
  8245. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF;
  8246. * [6]= EHT; [7] = WUR; [8] = AZ; [9]=RSVD; [6-8] = Applicable only for BE
  8247. */
  8248. A_UINT32 tx_pkt_cnt[HTT_MAX_TX_PKT_CNT];
  8249. /** phy_tx_abort_cnt -
  8250. * phy tx abort after each tlv;
  8251. * [0] = PRE-PHY desc tlv; [1] = PHY desc tlv; [2] = LSIGA tlv;
  8252. * [3] = LSIGB tlv; [4] = Per User tlv; [5] = HESIGB tlv;
  8253. * [6] = Service tlv; [7] = Tx Packet End tlv; [8-9]=RSVD;
  8254. */
  8255. A_UINT32 phy_tx_abort_cnt[HTT_MAX_PHY_TX_ABORT_CNT];
  8256. } htt_stats_phy_counters_tlv;
  8257. /* preserve old name alias for new name consistent with the tag name */
  8258. typedef htt_stats_phy_counters_tlv htt_phy_counters_tlv;
  8259. typedef struct {
  8260. htt_tlv_hdr_t tlv_hdr;
  8261. /** per chain hw noise floor values in dBm */
  8262. A_INT32 nf_chain[HTT_STATS_MAX_CHAINS];
  8263. /** number of false radars detected */
  8264. A_UINT32 false_radar_cnt;
  8265. /** number of channel switches happened due to radar detection */
  8266. A_UINT32 radar_cs_cnt;
  8267. /** ani_level -
  8268. * ANI level (noise interference) corresponds to the channel
  8269. * the desense levels range from -5 to 15 in dB units,
  8270. * higher values indicating more noise interference.
  8271. */
  8272. A_INT32 ani_level;
  8273. /** running time in minutes since FW boot */
  8274. A_UINT32 fw_run_time;
  8275. /** per chain runtime noise floor values in dBm */
  8276. A_INT32 runTime_nf_chain[HTT_STATS_MAX_CHAINS];
  8277. /** DFS SW based progressive stats - start **/
  8278. /* current AP operating bandwidth (refer to WLAN_PHY_MODE) */
  8279. A_UINT32 current_OBW;
  8280. /* current AP device bandwidth (refer to WLAN_PHY_MODE) */
  8281. A_UINT32 current_DBW;
  8282. /* last_radar_type: last detected radar type
  8283. * This last_radar_type field contains a value whose meaning is not
  8284. * exposed to the host; this field is only provided for debug purposes.
  8285. */
  8286. A_UINT32 last_radar_type;
  8287. /* dfs_reg_domain: curent DFS regulatory domain
  8288. * This dfs_reg_domain field contains a value whose meaning is not
  8289. * exposed to the host; this field is only provided for debug purposes.
  8290. */
  8291. A_UINT32 dfs_reg_domain;
  8292. /* radar_mask_bit: Radar mask setting programmed in HW registers.
  8293. * Each bit represents a 20 MHz portion of the channel.
  8294. * Bit 0 represents the highest 20 MHz portion within the channel.
  8295. * For example...
  8296. * For a 80 MHz channel, bit0 = highest 20 MHz, bit3 = lowest 20 MHz
  8297. * For a 320 MHz channel, bit0 = highest 20 MHz, bit15 = lowest 20 MHz
  8298. */
  8299. A_UINT32 radar_mask_bit;
  8300. /* DFS radar rssi threshold (units = dBm) */
  8301. A_INT32 radar_rssi;
  8302. /* DFS global flags (refer to IEEE80211_CHAN_* defines) */
  8303. A_UINT32 radar_dfs_flags;
  8304. /* band center frequency of operating bandwidth (units = MHz) */
  8305. A_UINT32 band_center_frequency_OBW;
  8306. /* band center frequency of device bandwidth (units = MHz) */
  8307. A_UINT32 band_center_frequency_DBW;
  8308. /** DFS SW based progressive stats - end **/
  8309. } htt_stats_phy_stats_tlv;
  8310. /* preserve old name alias for new name consistent with the tag name */
  8311. typedef htt_stats_phy_stats_tlv htt_phy_stats_tlv;
  8312. #define HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_M 0x00000001
  8313. #define HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_S 0
  8314. #define HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_GET(_var) \
  8315. (((_var) & HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_M) >> \
  8316. HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_S)
  8317. #define HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED_SET(_var, _val) \
  8318. do { \
  8319. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_CAL_DATA_COMPRESSED, _val); \
  8320. ((_var) |= ((_val) << STATS_PHY_RESET_CAL_DATA_COMPRESSED_S)); \
  8321. } while (0)
  8322. #define HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_M 0x00000006
  8323. #define HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_S 1
  8324. #define HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_GET(_var) \
  8325. (((_var) & HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_M) >> \
  8326. HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_S)
  8327. #define HTT_STATS_PHY_RESET_CAL_DATA_SOURCE_SET(_var, _val) \
  8328. do { \
  8329. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_CAL_DATA_SOURCE, _val); \
  8330. ((_var) |= ((_val) << STATS_PHY_RESET_CAL_DATA_SOURCE_S)); \
  8331. } while (0)
  8332. #define HTT_STATS_PHY_RESET_XTALCAL_M 0x00000008
  8333. #define HTT_STATS_PHY_RESET_XTALCAL_S 3
  8334. #define HTT_STATS_PHY_RESET_XTALCAL_GET(_var) \
  8335. (((_var) & HTT_STATS_PHY_RESET_XTALCAL_M) >> \
  8336. HTT_STATS_PHY_RESET_XTALCAL_S)
  8337. #define HTT_STATS_PHY_RESET_XTALCAL_SET(_var, _val) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_XTALCAL, _val); \
  8340. ((_var) |= ((_val) << STATS_PHY_RESET_XTALCAL_S)); \
  8341. } while (0)
  8342. #define HTT_STATS_PHY_RESET_TPCCAL2GOPC_M 0x00000010
  8343. #define HTT_STATS_PHY_RESET_TPCCAL2GOPC_S 4
  8344. #define HTT_STATS_PHY_RESET_TPCCAL2GOPC_GET(_var) \
  8345. (((_var) & HTT_STATS_PHY_RESET_TPCCAL2GOPC_M) >> \
  8346. HTT_STATS_PHY_RESET_TPCCAL2GOPC_S)
  8347. #define HTT_STATS_PHY_RESET_TPCCAL2GOPC_SET(_var, _val) \
  8348. do { \
  8349. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL2GOPC, _val); \
  8350. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL2GOPC_S)); \
  8351. } while (0)
  8352. #define HTT_STATS_PHY_RESET_TPCCAL2GFPC_M 0x00000020
  8353. #define HTT_STATS_PHY_RESET_TPCCAL2GFPC_S 5
  8354. #define HTT_STATS_PHY_RESET_TPCCAL2GFPC_GET(_var) \
  8355. (((_var) & HTT_STATS_PHY_RESET_TPCCAL2GFPC_M) >> \
  8356. HTT_STATS_PHY_RESET_TPCCAL2GFPC_S)
  8357. #define HTT_STATS_PHY_RESET_TPCCAL2GFPC_SET(_var, _val) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL2GFPC, _val); \
  8360. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL2GFPC_S)); \
  8361. } while (0)
  8362. #define HTT_STATS_PHY_RESET_TPCCAL5GOPC_M 0x00000040
  8363. #define HTT_STATS_PHY_RESET_TPCCAL5GOPC_S 6
  8364. #define HTT_STATS_PHY_RESET_TPCCAL5GOPC_GET(_var) \
  8365. (((_var) & HTT_STATS_PHY_RESET_TPCCAL5GOPC_M) >> \
  8366. HTT_STATS_PHY_RESET_TPCCAL5GOPC_S)
  8367. #define HTT_STATS_PHY_RESET_TPCCAL5GOPC_SET(_var, _val) \
  8368. do { \
  8369. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL5GOPC, _val); \
  8370. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL5GOPC_S)); \
  8371. } while (0)
  8372. #define HTT_STATS_PHY_RESET_TPCCAL5GFPC_M 0x00000080
  8373. #define HTT_STATS_PHY_RESET_TPCCAL5GFPC_S 7
  8374. #define HTT_STATS_PHY_RESET_TPCCAL5GFPC_GET(_var) \
  8375. (((_var) & HTT_STATS_PHY_RESET_TPCCAL5GFPC_M) >> \
  8376. HTT_STATS_PHY_RESET_TPCCAL5GFPC_S)
  8377. #define HTT_STATS_PHY_RESET_TPCCAL5GFPC_SET(_var, _val) \
  8378. do { \
  8379. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL5GFPC, _val); \
  8380. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL5GFPC_S)); \
  8381. } while (0)
  8382. #define HTT_STATS_PHY_RESET_TPCCAL6GOPC_M 0x00000100
  8383. #define HTT_STATS_PHY_RESET_TPCCAL6GOPC_S 8
  8384. #define HTT_STATS_PHY_RESET_TPCCAL6GOPC_GET(_var) \
  8385. (((_var) & HTT_STATS_PHY_RESET_TPCCAL6GOPC_M) >> \
  8386. HTT_STATS_PHY_RESET_TPCCAL6GOPC_S)
  8387. #define HTT_STATS_PHY_RESET_TPCCAL6GOPC_SET(_var, _val) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL6GOPC, _val); \
  8390. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL6GOPC_S)); \
  8391. } while (0)
  8392. #define HTT_STATS_PHY_RESET_TPCCAL6GFPC_M 0x00000200
  8393. #define HTT_STATS_PHY_RESET_TPCCAL6GFPC_S 9
  8394. #define HTT_STATS_PHY_RESET_TPCCAL6GFPC_GET(_var) \
  8395. (((_var) & HTT_STATS_PHY_RESET_TPCCAL6GFPC_M) >> \
  8396. HTT_STATS_PHY_RESET_TPCCAL6GFPC_S)
  8397. #define HTT_STATS_PHY_RESET_TPCCAL6GFPC_SET(_var, _val) \
  8398. do { \
  8399. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_TPCCAL6GFPC, _val); \
  8400. ((_var) |= ((_val) << STATS_PHY_RESET_TPCCAL6GFPC_S)); \
  8401. } while (0)
  8402. #define HTT_STATS_PHY_RESET_RXGAINCAL2G_M 0x00000400
  8403. #define HTT_STATS_PHY_RESET_RXGAINCAL2G_S 10
  8404. #define HTT_STATS_PHY_RESET_RXGAINCAL2G_GET(_var) \
  8405. (((_var) & HTT_STATS_PHY_RESET_RXGAINCAL2G_M) >> \
  8406. HTT_STATS_PHY_RESET_RXGAINCAL2G_S)
  8407. #define HTT_STATS_PHY_RESET_RXGAINCAL2G_SET(_var, _val) \
  8408. do { \
  8409. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_RXGAINCAL2G, _val); \
  8410. ((_var) |= ((_val) << STATS_PHY_RESET_RXGAINCAL2G_S)); \
  8411. } while (0)
  8412. #define HTT_STATS_PHY_RESET_RXGAINCAL5G_M 0x00000800
  8413. #define HTT_STATS_PHY_RESET_RXGAINCAL5G_S 11
  8414. #define HTT_STATS_PHY_RESET_RXGAINCAL5G_GET(_var) \
  8415. (((_var) & HTT_STATS_PHY_RESET_RXGAINCAL5G_M) >> \
  8416. HTT_STATS_PHY_RESET_RXGAINCAL5G_S)
  8417. #define HTT_STATS_PHY_RESET_RXGAINCAL5G_SET(_var, _val) \
  8418. do { \
  8419. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_RXGAINCAL5G, _val); \
  8420. ((_var) |= ((_val) << STATS_PHY_RESET_RXGAINCAL5G_S)); \
  8421. } while (0)
  8422. #define HTT_STATS_PHY_RESET_RXGAINCAL6G_M 0x00001000
  8423. #define HTT_STATS_PHY_RESET_RXGAINCAL6G_S 12
  8424. #define HTT_STATS_PHY_RESET_RXGAINCAL6G_GET(_var) \
  8425. (((_var) & HTT_STATS_PHY_RESET_RXGAINCAL6G_M) >> \
  8426. HTT_STATS_PHY_RESET_RXGAINCAL6G_S)
  8427. #define HTT_STATS_PHY_RESET_RXGAINCAL6G_SET(_var, _val) \
  8428. do { \
  8429. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_RXGAINCAL6G, _val); \
  8430. ((_var) |= ((_val) << STATS_PHY_RESET_RXGAINCAL6G_S)); \
  8431. } while (0)
  8432. #define HTT_STATS_PHY_RESET_AOACAL2G_M 0x00002000
  8433. #define HTT_STATS_PHY_RESET_AOACAL2G_S 13
  8434. #define HTT_STATS_PHY_RESET_AOACAL2G_GET(_var) \
  8435. (((_var) & HTT_STATS_PHY_RESET_AOACAL2G_M) >> \
  8436. HTT_STATS_PHY_RESET_AOACAL2G_S)
  8437. #define HTT_STATS_PHY_RESET_AOACAL2G_SET(_var, _val) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_AOACAL2G, _val); \
  8440. ((_var) |= ((_val) << STATS_PHY_RESET_AOACAL2G_S)); \
  8441. } while (0)
  8442. #define HTT_STATS_PHY_RESET_AOACAL5G_M 0x00004000
  8443. #define HTT_STATS_PHY_RESET_AOACAL5G_S 14
  8444. #define HTT_STATS_PHY_RESET_AOACAL5G_GET(_var) \
  8445. (((_var) & HTT_STATS_PHY_RESET_AOACAL5G_M) >> \
  8446. HTT_STATS_PHY_RESET_AOACAL5G_S)
  8447. #define HTT_STATS_PHY_RESET_AOACAL5G_SET(_var, _val) \
  8448. do { \
  8449. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_AOACAL5G, _val); \
  8450. ((_var) |= ((_val) << STATS_PHY_RESET_AOACAL5G_S)); \
  8451. } while (0)
  8452. #define HTT_STATS_PHY_RESET_AOACAL6G_M 0x00008000
  8453. #define HTT_STATS_PHY_RESET_AOACAL6G_S 15
  8454. #define HTT_STATS_PHY_RESET_AOACAL6G_GET(_var) \
  8455. (((_var) & HTT_STATS_PHY_RESET_AOACAL6G_M) >> \
  8456. HTT_STATS_PHY_RESET_AOACAL6G_S)
  8457. #define HTT_STATS_PHY_RESET_AOACAL6G_SET(_var, _val) \
  8458. do { \
  8459. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_AOACAL6G, _val); \
  8460. ((_var) |= ((_val) << STATS_PHY_RESET_AOACAL6G_S)); \
  8461. } while (0)
  8462. #define HTT_STATS_PHY_RESET_XTAL_FROM_OTP_M 0x00010000
  8463. #define HTT_STATS_PHY_RESET_XTAL_FROM_OTP_S 16
  8464. #define HTT_STATS_PHY_RESET_XTAL_FROM_OTP_GET(_var) \
  8465. (((_var) & HTT_STATS_PHY_RESET_XTAL_FROM_OTP_M) >> \
  8466. HTT_STATS_PHY_RESET_XTAL_FROM_OTP_S)
  8467. #define HTT_STATS_PHY_RESET_XTAL_FROM_OTP_SET(_var, _val) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_XTAL_FROM_OTP, _val); \
  8470. ((_var) |= ((_val) << STATS_PHY_RESET_XTAL_FROM_OTP_S)); \
  8471. } while (0)
  8472. #define HTT_STATS_PHY_RESET_GLUT_LINEARITY_M 0x000000FF
  8473. #define HTT_STATS_PHY_RESET_GLUT_LINEARITY_S 0
  8474. #define HTT_STATS_PHY_RESET_GLUT_LINEARITY_GET(_var) \
  8475. (((_var) & HTT_STATS_PHY_RESET_GLUT_LINEARITY_M) >> \
  8476. HTT_STATS_PHY_RESET_GLUT_LINEARITY_S)
  8477. #define HTT_STATS_PHY_RESET_GLUT_LINEARITY_SET(_var, _val) \
  8478. do { \
  8479. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_GLUT_LINEARITY, _val); \
  8480. ((_var) |= ((_val) << STATS_PHY_RESET_GLUT_LINEARITY_S)); \
  8481. } while (0)
  8482. #define HTT_STATS_PHY_RESET_PLUT_LINEARITY_M 0x0000FF00
  8483. #define HTT_STATS_PHY_RESET_PLUT_LINEARITY_S 8
  8484. #define HTT_STATS_PHY_RESET_PLUT_LINEARITY_GET(_var) \
  8485. (((_var) & HTT_STATS_PHY_RESET_PLUT_LINEARITY_M) >> \
  8486. HTT_STATS_PHY_RESET_PLUT_LINEARITY_S)
  8487. #define HTT_STATS_PHY_RESET_PLUT_LINEARITY_SET(_var, _val) \
  8488. do { \
  8489. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_PLUT_LINEARITY, _val); \
  8490. ((_var) |= ((_val) << STATS_PHY_RESET_PLUT_LINEARITY_S)); \
  8491. } while (0)
  8492. #define HTT_STATS_PHY_RESET_WLANDRIVERMODE_M 0x00FF0000
  8493. #define HTT_STATS_PHY_RESET_WLANDRIVERMODE_S 16
  8494. #define HTT_STATS_PHY_RESET_WLANDRIVERMODE_GET(_var) \
  8495. (((_var) & HTT_STATS_PHY_RESET_WLANDRIVERMODE_M) >> \
  8496. HTT_STATS_PHY_RESET_WLANDRIVERMODE_S)
  8497. #define HTT_STATS_PHY_RESET_WLANDRIVERMODE_SET(_var, _val) \
  8498. do { \
  8499. HTT_CHECK_SET_VAL(HTT_STATS_PHY_RESET_WLANDRIVERMODE, _val); \
  8500. ((_var) |= ((_val) << STATS_PHY_RESET_WLANDRIVERMODE_S)); \
  8501. } while (0)
  8502. typedef struct {
  8503. htt_tlv_hdr_t tlv_hdr;
  8504. /** current pdev_id */
  8505. A_UINT32 pdev_id;
  8506. /** current channel information */
  8507. A_UINT32 chan_mhz;
  8508. /** center_freq1, center_freq2 in mhz */
  8509. A_UINT32 chan_band_center_freq1;
  8510. A_UINT32 chan_band_center_freq2;
  8511. /** chan_phy_mode - WLAN_PHY_MODE enum type */
  8512. A_UINT32 chan_phy_mode;
  8513. /** chan_flags follows HTT_STATS_CHANNEL_FLAGS enum */
  8514. A_UINT32 chan_flags;
  8515. /** channel Num updated to virtual phybase */
  8516. A_UINT32 chan_num;
  8517. /** Cause for the phy reset - HTT_STATS_RESET_CAUSE */
  8518. A_UINT32 reset_cause;
  8519. /** Cause for the previous phy reset */
  8520. A_UINT32 prev_reset_cause;
  8521. /** source for the phywarm reset - HTT_STATS_RESET_CAUSE */
  8522. A_UINT32 phy_warm_reset_src;
  8523. /** rxGain Table selection mode - register settings
  8524. * 0 - Auto, 1/2 - Forced with and without BT override respectively
  8525. */
  8526. A_UINT32 rx_gain_tbl_mode;
  8527. /** current xbar value - perchain analog to digital idx mapping */
  8528. A_UINT32 xbar_val;
  8529. /** Flag to indicate forced calibration */
  8530. A_UINT32 force_calibration;
  8531. /** current RF mode (e.g. SBS/DBS) - follows HTT_STATS_RF_MODE enum */
  8532. A_UINT32 phyrf_mode;
  8533. /* PDL phyInput stats */
  8534. /** homechannel flag
  8535. * 1- Homechan, 0 - scan channel
  8536. */
  8537. A_UINT32 phy_homechan;
  8538. /** Tx and Rx chainmask */
  8539. A_UINT32 phy_tx_ch_mask;
  8540. A_UINT32 phy_rx_ch_mask;
  8541. /** INI masks - to decide the INI registers to be loaded on a reset */
  8542. A_UINT32 phybb_ini_mask;
  8543. A_UINT32 phyrf_ini_mask;
  8544. /** DFS,ADFS/Spectral scan enable masks */
  8545. A_UINT32 phy_dfs_en_mask;
  8546. A_UINT32 phy_sscan_en_mask;
  8547. A_UINT32 phy_synth_sel_mask;
  8548. A_UINT32 phy_adfs_freq;
  8549. /** CCK FIR settings
  8550. * register settings - filter coefficients for Iqs conversion
  8551. * [31:24] = FIR_COEFF_3_0
  8552. * [23:16] = FIR_COEFF_2_0
  8553. * [15:8] = FIR_COEFF_1_0
  8554. * [7:0] = FIR_COEFF_0_0
  8555. */
  8556. A_UINT32 cck_fir_settings;
  8557. /** dynamic primary channel index
  8558. * primary 20MHz channel index on the current channel BW
  8559. */
  8560. A_UINT32 phy_dyn_pri_chan;
  8561. /**
  8562. * Current CCA detection threshold
  8563. * dB above noisefloor req for CCA
  8564. * Register settings for all subbands
  8565. */
  8566. A_UINT32 cca_thresh;
  8567. /**
  8568. * status for dynamic CCA adjustment
  8569. * 0-disabled, 1-enabled
  8570. */
  8571. A_UINT32 dyn_cca_status;
  8572. /** RXDEAF Register value
  8573. * rxdesense_thresh_sw - VREG Register
  8574. * rxdesense_thresh_hw - PHY Register
  8575. */
  8576. A_UINT32 rxdesense_thresh_sw;
  8577. A_UINT32 rxdesense_thresh_hw;
  8578. /** Current PHY Bandwidth -
  8579. * values are specified by the HTT_PHY_BW_IDX enum type
  8580. */
  8581. A_UINT32 phy_bw_code;
  8582. /** Current channel operating rate -
  8583. * values are specified by the HTT_CHANNEL_RATE enum type
  8584. */
  8585. A_UINT32 phy_rate_mode;
  8586. /** current channel operating band
  8587. * 0 - 5G; 1 - 2G; 2 -6G
  8588. */
  8589. A_UINT32 phy_band_code;
  8590. /** microcode processor virtual phy base address -
  8591. * provided only for debug
  8592. */
  8593. A_UINT32 phy_vreg_base;
  8594. /** microcode processor virtual phy base ext address -
  8595. * provided only for debug
  8596. */
  8597. A_UINT32 phy_vreg_base_ext;
  8598. /** HW LUT table configuration for home/scan channel -
  8599. * provided only for debug
  8600. */
  8601. A_UINT32 cur_table_index;
  8602. /** SW configuration flag for PHY reset and Calibrations -
  8603. * values are specified by the HTT_WHAL_CONFIG enum type
  8604. */
  8605. A_UINT32 whal_config_flag;
  8606. /** nfcal_iteration_counts:
  8607. * iteration count for Home/Scan/Periodic Noise Floor calibrations
  8608. * nfcal_iteration_counts[0] - home NF iteration counter
  8609. * nfcal_iteration_counts[1] - scan NF iteration counter
  8610. * nfcal_iteration_counts[2] - periodic NF iteration counter
  8611. * These counters are not reset automatically; they are only reset
  8612. * when explicitly requested by the host.
  8613. */
  8614. A_UINT32 nfcal_iteration_counts[3];
  8615. /** Below union indicates the merge status for different cal */
  8616. union {
  8617. A_UINT32 calmerge_stats;
  8618. struct {
  8619. A_UINT32 CalData_Compressed:1,
  8620. CalDataSource:2,
  8621. xtalcal:1,
  8622. tpccal2GFPC:1,
  8623. tpccal2GOPC:1,
  8624. tpccal5GFPC:1,
  8625. tpccal5GOPC:1,
  8626. tpccal6GFPC:1,
  8627. tpccal6GOPC:1,
  8628. rxgaincal2G:1,
  8629. rxgaincal5G:1,
  8630. rxgaincal6G:1,
  8631. aoacal2G:1,
  8632. aoacal5G:1,
  8633. aoacal6G:1,
  8634. XTAL_from_OTP:1,
  8635. rsvd1:15;
  8636. };
  8637. };
  8638. /** Below union lets us know of any non-linearity in plut/glut
  8639. * and the mode we are in
  8640. */
  8641. union {
  8642. A_UINT32 misc_stats;
  8643. struct {
  8644. A_UINT32 GLUT_linearity:8,
  8645. PLUT_linearity:8,
  8646. WlanDriverMode:8,
  8647. rsvd2:8;
  8648. };
  8649. };
  8650. /** BoardId fetched from OTP */
  8651. A_UINT32 BoardIDfromOTP;
  8652. } htt_stats_phy_reset_stats_tlv;
  8653. /* preserve old name alias for new name consistent with the tag name */
  8654. typedef htt_stats_phy_reset_stats_tlv htt_phy_reset_stats_tlv;
  8655. typedef struct {
  8656. htt_tlv_hdr_t tlv_hdr;
  8657. /** current pdev_id */
  8658. A_UINT32 pdev_id;
  8659. /** ucode PHYOFF pass/failure count */
  8660. A_UINT32 cf_active_low_fail_cnt;
  8661. A_UINT32 cf_active_low_pass_cnt;
  8662. /** PHYOFF count attempted through ucode VREG */
  8663. A_UINT32 phy_off_through_vreg_cnt;
  8664. /** Force calibration count */
  8665. A_UINT32 force_calibration_cnt;
  8666. /** phyoff count during rfmode switch */
  8667. A_UINT32 rf_mode_switch_phy_off_cnt;
  8668. /** Temperature based recalibration count */
  8669. A_UINT32 temperature_recal_cnt;
  8670. } htt_stats_phy_reset_counters_tlv;
  8671. /* preserve old name alias for new name consistent with the tag name */
  8672. typedef htt_stats_phy_reset_counters_tlv htt_phy_reset_counters_tlv;
  8673. /* Considering 320 MHz maximum 16 power levels */
  8674. #define HTT_MAX_CH_PWR_INFO_SIZE 16
  8675. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_M 0x000000ff
  8676. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_S 0
  8677. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var) \
  8678. (((_var) & HTT_PHY_TPC_STATS_CTL_REGION_GRP_M) >> \
  8679. HTT_PHY_TPC_STATS_CTL_REGION_GRP_S)
  8680. /* provide properly-named macro */
  8681. #define HTT_STATS_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var) \
  8682. HTT_PHY_TPC_STATS_CTL_REGION_GRP_GET(_var)
  8683. #define HTT_PHY_TPC_STATS_CTL_REGION_GRP_SET(_var, _val) \
  8684. do { \
  8685. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_CTL_REGION_GRP, _val); \
  8686. ((_var) &= ~(HTT_PHY_TPC_STATS_CTL_REGION_GRP_M)); \
  8687. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_CTL_REGION_GRP_S)); \
  8688. } while (0)
  8689. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M 0x0000ff00
  8690. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S 8
  8691. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var) \
  8692. (((_var) & HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M) >> \
  8693. HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S)
  8694. /* provide properly-named macro */
  8695. #define HTT_STATS_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var) \
  8696. HTT_PHY_TPC_STATS_SUB_BAND_INDEX_GET(_var)
  8697. #define HTT_PHY_TPC_STATS_SUB_BAND_INDEX_SET(_var, _val) \
  8698. do { \
  8699. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_SUB_BAND_INDEX, _val); \
  8700. ((_var) &= ~(HTT_PHY_TPC_STATS_SUB_BAND_INDEX_M)); \
  8701. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_SUB_BAND_INDEX_S)); \
  8702. } while (0)
  8703. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M 0x00ff0000
  8704. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S 16
  8705. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_GET(_var) \
  8706. (((_var) & HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M) >> \
  8707. HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S)
  8708. /* provide properly-named macro */
  8709. #define HTT_STATS_PHY_TPC_STATS_ARRAY_GAIN_CAP_EXT2_ENABLED_GET(_var) \
  8710. HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_GET(_var)
  8711. #define HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_SET(_var, _val) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED, _val); \
  8714. ((_var) &= ~(HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_M)); \
  8715. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_AG_CAP_EXT2_ENABLED_S)); \
  8716. } while (0)
  8717. #define HTT_PHY_TPC_STATS_CTL_FLAG_M 0xff000000
  8718. #define HTT_PHY_TPC_STATS_CTL_FLAG_S 24
  8719. #define HTT_PHY_TPC_STATS_CTL_FLAG_GET(_var) \
  8720. (((_var) & HTT_PHY_TPC_STATS_CTL_FLAG_M) >> \
  8721. HTT_PHY_TPC_STATS_CTL_FLAG_S)
  8722. /* provide properly-named macro */
  8723. #define HTT_STATS_PHY_TPC_STATS_CTL_FLAG_GET(_var) \
  8724. HTT_PHY_TPC_STATS_CTL_FLAG_GET(_var)
  8725. #define HTT_PHY_TPC_STATS_CTL_FLAG_SET(_var, _val) \
  8726. do { \
  8727. HTT_CHECK_SET_VAL(HTT_PHY_TPC_STATS_CTL_FLAG, _val); \
  8728. ((_var) &= ~(HTT_PHY_TPC_STATS_CTL_FLAG_M)); \
  8729. ((_var) |= ((_val) << HTT_PHY_TPC_STATS_CTL_FLAG_S)); \
  8730. } while (0)
  8731. typedef struct {
  8732. htt_tlv_hdr_t tlv_hdr;
  8733. /** current pdev_id */
  8734. A_UINT32 pdev_id;
  8735. /** Tranmsit power control scaling related configurations */
  8736. A_UINT32 tx_power_scale;
  8737. A_UINT32 tx_power_scale_db;
  8738. /** Minimum negative tx power supported by the target */
  8739. A_INT32 min_negative_tx_power;
  8740. /** current configured CTL domain */
  8741. A_UINT32 reg_ctl_domain;
  8742. /** Regulatory power information for the current channel */
  8743. A_INT32 max_reg_allowed_power[HTT_STATS_MAX_CHAINS];
  8744. A_INT32 max_reg_allowed_power_6g[HTT_STATS_MAX_CHAINS];
  8745. /** channel max regulatory power in 0.5dB */
  8746. A_UINT32 twice_max_rd_power;
  8747. /** current channel and home channel's maximum possible tx power */
  8748. A_INT32 max_tx_power;
  8749. A_INT32 home_max_tx_power;
  8750. /** channel's Power Spectral Density */
  8751. A_UINT32 psd_power;
  8752. /** channel's EIRP power */
  8753. A_UINT32 eirp_power;
  8754. /** 6G channel power mode
  8755. * 0-LPI, 1-SP, 2-VLPI and 3-SP_CLIENT power mode
  8756. */
  8757. A_UINT32 power_type_6ghz;
  8758. /** sub-band channels and corresponding Tx-power */
  8759. A_UINT32 sub_band_cfreq[HTT_MAX_CH_PWR_INFO_SIZE];
  8760. A_UINT32 sub_band_txpower[HTT_MAX_CH_PWR_INFO_SIZE];
  8761. /** array_gain_cap:
  8762. * CTL Array Gain cap, units are dB
  8763. * The lower-triangular portion of this square matrix is stored, i.e.
  8764. * array element 0 stores matrix element (0,0)
  8765. * array element 1 stores matrix element (1,0)
  8766. * array element 2 stores matrix element (1,1)
  8767. * array element 3 stores matrix element (2,0)
  8768. * ...
  8769. * array element 35 stores matrix element (7,7)
  8770. */
  8771. A_INT32 array_gain_cap[HTT_STATS_MAX_CHAINS * ((HTT_STATS_MAX_CHAINS/2)+1)];
  8772. union {
  8773. struct {
  8774. A_UINT32
  8775. ctl_region_grp:8, /** Group to which the ctl region belongs */
  8776. sub_band_index:8, /** Frequency subband index */
  8777. /** Array Gain Cap Ext2 feature enablement status */
  8778. array_gain_cap_ext2_enabled:8,
  8779. /** ctl_flag:
  8780. * 1st bit ULOFDMA supported
  8781. * 2nd bit DLOFDMA shared Exception supported
  8782. */
  8783. ctl_flag:8;
  8784. };
  8785. A_UINT32 ctl_args;
  8786. };
  8787. /** max_reg_only_allowed_power:
  8788. * units = 0.25dBm
  8789. */
  8790. A_INT32 max_reg_only_allowed_power[HTT_STATS_MAX_CHAINS];
  8791. /** number of PPDUs transmitted for each number of tx chains */
  8792. A_UINT32 tx_num_chains[HTT_STATS_MAX_CHAINS];
  8793. /** tx_power:
  8794. * Number of PPDUs transmitted with each power level >= 0 dBm.
  8795. * tx_power[0]: number of PPDUs with tx power in the [0 dBm, 1 dBm) range
  8796. * tx_power[1]: number of PPDUs with tx power in the [1 dBm, 2 dBm) range
  8797. * ...
  8798. * tx_power[30]: number of PPDUs with tx power in the [30 dBm, 31 dBm) range
  8799. * tx_power[31]: number of PPDUs with tx power >= 31 dBm
  8800. */
  8801. A_UINT32 tx_power[HTT_MAX_POWER_LEVEL];
  8802. /** tx_power_neg:
  8803. * Number of PPDUs transmitted with each power level < 0 dBm.
  8804. * tx_power_neg[0]: cnt of PPDUs with tx pwr in the [-1 dBm, 0 dBm) range
  8805. * tx_power_neg[1]: cnt of PPDUs with tx pwr in the [-2 dBm, -1 dBm) range
  8806. * ...
  8807. * tx_power_neg[8]: cnt of PPDUs with tx pwr in the [-9 dBm, -8 dBm) range
  8808. * tx_power_neg[9]: cnt of PPDUs with tx pwr < -9 dBm
  8809. */
  8810. A_UINT32 tx_power_neg[HTT_MAX_NEGATIVE_POWER_LEVEL];
  8811. } htt_stats_phy_tpc_stats_tlv;
  8812. /* preserve old name alias for new name consistent with the tag name */
  8813. typedef htt_stats_phy_tpc_stats_tlv htt_phy_tpc_stats_tlv;
  8814. /* NOTE:
  8815. * This structure is for documentation, and cannot be safely used directly.
  8816. * Instead, use the constituent TLV structures to fill/parse.
  8817. */
  8818. #ifdef ATH_TARGET
  8819. typedef struct {
  8820. htt_stats_phy_counters_tlv phy_counters;
  8821. htt_stats_phy_stats_tlv phy_stats;
  8822. htt_stats_phy_reset_counters_tlv phy_reset_counters;
  8823. htt_stats_phy_reset_stats_tlv phy_reset_stats;
  8824. htt_stats_phy_tpc_stats_tlv phy_tpc_stats;
  8825. } htt_phy_counters_and_phy_stats_t;
  8826. #endif /* ATH_TARGET */
  8827. /* NOTE:
  8828. * This structure is for documentation, and cannot be safely used directly.
  8829. * Instead, use the constituent TLV structures to fill/parse.
  8830. */
  8831. #ifdef ATH_TARGET
  8832. typedef struct {
  8833. htt_stats_soc_txrx_stats_common_tlv soc_common_stats;
  8834. htt_stats_vdev_txrx_stats_hw_stats_tlv vdev_hw_stats[1/*or more*/];
  8835. } htt_vdevs_txrx_stats_t;
  8836. #endif /* ATH_TARGET */
  8837. typedef struct {
  8838. union {
  8839. A_UINT32 word32;
  8840. struct {
  8841. A_UINT32
  8842. success: 16,
  8843. fail: 16;
  8844. };
  8845. };
  8846. } htt_stats_strm_gen_mpdus_cntr_t;
  8847. typedef struct {
  8848. /* MSDU queue identification */
  8849. union {
  8850. A_UINT32 word32;
  8851. struct {
  8852. A_UINT32
  8853. peer_id: 16,
  8854. tid: 4, /* only TIDs 0-7 actually expected to be used */
  8855. htt_qtype: 4, /* refer to HTT_MSDUQ_INDEX */
  8856. reserved: 8;
  8857. };
  8858. };
  8859. } htt_stats_strm_msdu_queue_id;
  8860. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_PEER_ID_GET(word) \
  8861. ((word >> 0) & 0xffff)
  8862. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_TID_GET(word) \
  8863. ((word >> 16) & 0xf)
  8864. #define HTT_STATS_STRM_GEN_MPDUS_QUEUE_ID_HTT_QTYPE_GET(word) \
  8865. ((word >> 20) & 0xf)
  8866. #define HTT_STATS_STRM_GEN_MPDUS_SVC_INTERVAL_SUCCESS_GET(word) \
  8867. ((word >> 0) & 0xffff)
  8868. #define HTT_STATS_STRM_GEN_MPDUS_SVC_INTERVAL_FAIL_GET(word) \
  8869. ((word >> 16) & 0xffff)
  8870. #define HTT_STATS_STRM_GEN_MPDUS_BURST_SIZE_SUCCESS_GET(word) \
  8871. ((word >> 0) & 0xffff)
  8872. #define HTT_STATS_STRM_GEN_MPDUS_BURST_SIZE_FAIL_GET(word) \
  8873. ((word >> 16) & 0xffff)
  8874. typedef struct {
  8875. htt_tlv_hdr_t tlv_hdr;
  8876. htt_stats_strm_msdu_queue_id queue_id;
  8877. htt_stats_strm_gen_mpdus_cntr_t svc_interval;
  8878. htt_stats_strm_gen_mpdus_cntr_t burst_size;
  8879. } htt_stats_strm_gen_mpdus_tlv;
  8880. /* preserve old name alias for new name consistent with the tag name */
  8881. typedef htt_stats_strm_gen_mpdus_tlv htt_stats_strm_gen_mpdus_tlv_t;
  8882. typedef struct {
  8883. htt_tlv_hdr_t tlv_hdr;
  8884. htt_stats_strm_msdu_queue_id queue_id;
  8885. struct {
  8886. union {
  8887. A_UINT32 timestamp_prior__timestamp_now__word;
  8888. struct {
  8889. A_UINT32
  8890. timestamp_prior_ms: 16,
  8891. timestamp_now_ms: 16;
  8892. };
  8893. };
  8894. union {
  8895. A_UINT32 interval_spec__margin__word;
  8896. struct {
  8897. A_UINT32
  8898. interval_spec_ms: 16,
  8899. margin_ms: 16;
  8900. };
  8901. };
  8902. } svc_interval;
  8903. struct {
  8904. union {
  8905. A_UINT32 consumed_bytes_orig__consumed_bytes_final__word;
  8906. struct {
  8907. A_UINT32
  8908. /* consumed_bytes_orig:
  8909. * Raw count (actually estimate) of how many bytes were
  8910. * removed from the MSDU queue by the GEN_MPDUS operation.
  8911. */
  8912. consumed_bytes_orig: 16,
  8913. /* consumed_bytes_final:
  8914. * Adjusted count of removed bytes that incorporates
  8915. * normalizing by the actual service interval compared to
  8916. * the expected service interval.
  8917. * This allows the burst size computation to be independent
  8918. * of whether the target is doing GEN_MPDUS at only the
  8919. * service interval, or substantially more often than the
  8920. * service interval.
  8921. * consumed_bytes_final = consumed_bytes_orig /
  8922. * (svc_interval / ref_svc_interval)
  8923. */
  8924. consumed_bytes_final: 16;
  8925. };
  8926. };
  8927. union {
  8928. A_UINT32 remaining_bytes__word;
  8929. struct {
  8930. A_UINT32
  8931. remaining_bytes: 16,
  8932. reserved: 16;
  8933. };
  8934. };
  8935. union {
  8936. A_UINT32 burst_size_spec__margin_bytes__word;
  8937. struct {
  8938. A_UINT32
  8939. burst_size_spec: 16,
  8940. margin_bytes: 16;
  8941. };
  8942. };
  8943. } burst_size;
  8944. } htt_stats_strm_gen_mpdus_details_tlv;
  8945. /* preserve old name alias for new name consistent with the tag name */
  8946. typedef htt_stats_strm_gen_mpdus_details_tlv
  8947. htt_stats_strm_gen_mpdus_details_tlv_t;
  8948. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_PEER_ID_GET(word) \
  8949. ((word >> 0) & 0xffff)
  8950. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_TID_GET(word) \
  8951. ((word >> 16) & 0xf)
  8952. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_QUEUE_ID_HTT_QTYPE_GET(word) \
  8953. ((word >> 20) & 0xf)
  8954. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_TIMESTAMP_PRIOR_MS_GET(word) \
  8955. ((word >> 0) & 0xffff)
  8956. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_TIMESTAMP_NOW_MS_GET(word) \
  8957. ((word >> 16) & 0xffff)
  8958. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_INTERVAL_SPEC_MS_GET(word) \
  8959. ((word >> 0) & 0xffff)
  8960. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_SVC_INTERVAL_MARGIN_MS_GET(word) \
  8961. ((word >> 16) & 0xffff)
  8962. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_CONSUMED_BYTES_ORIG_GET(word) \
  8963. ((word >> 0) & 0xffff)
  8964. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_CONSUMED_BYTES_FINAL_GET(word) \
  8965. ((word >> 16) & 0xffff)
  8966. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_REMAINING_BYTES_GET(word) \
  8967. ((word >> 0) & 0xffff)
  8968. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_BURST_SIZE_SPEC_GET(word) \
  8969. ((word >> 0) & 0xffff)
  8970. #define HTT_STATS_STRM_GEN_MPDUS_DETAILS_BURST_SIZE_MARGIN_BYTES_GET(word) \
  8971. ((word >> 16) & 0xffff)
  8972. typedef struct {
  8973. htt_tlv_hdr_t tlv_hdr;
  8974. A_UINT32 reset_count;
  8975. /** lower portion (bits 31:0) of reset time, in milliseconds */
  8976. A_UINT32 reset_time_lo_ms;
  8977. /** upper portion (bits 63:32) of reset time, in milliseconds */
  8978. A_UINT32 reset_time_hi_ms;
  8979. /** lower portion (bits 31:0) of disengage time, in milliseconds */
  8980. A_UINT32 disengage_time_lo_ms;
  8981. /** upper portion (bits 63:32) of disengage time, in milliseconds */
  8982. A_UINT32 disengage_time_hi_ms;
  8983. /** lower portion (bits 31:0) of engage time, in milliseconds */
  8984. A_UINT32 engage_time_lo_ms;
  8985. /** upper portion (bits 63:32) of engage time, in milliseconds */
  8986. A_UINT32 engage_time_hi_ms;
  8987. A_UINT32 disengage_count;
  8988. A_UINT32 engage_count;
  8989. A_UINT32 drain_dest_ring_mask;
  8990. } htt_stats_dmac_reset_stats_tlv;
  8991. /* preserve old name alias for new name consistent with the tag name */
  8992. typedef htt_stats_dmac_reset_stats_tlv htt_dmac_reset_stats_tlv;
  8993. /* Support up to 640 MHz mode for future expansion */
  8994. #define HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT 32
  8995. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_M 0x000000ff
  8996. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_S 0
  8997. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_GET(_var) \
  8998. (((_var) & HTT_PDEV_PUNCTURE_STATS_MAC_ID_M) >> \
  8999. HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)
  9000. #define HTT_PDEV_PUNCTURE_STATS_MAC_ID_SET(_var, _val) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_PDEV_PUNCTURE_STATS_MAC_ID, _val); \
  9003. ((_var) |= ((_val) << HTT_PDEV_PUNCTURE_STATS_MAC_ID_S)); \
  9004. } while (0)
  9005. /*
  9006. * TLV used to provide puncturing related stats for TX/RX and each PPDU type.
  9007. */
  9008. typedef struct {
  9009. htt_tlv_hdr_t tlv_hdr;
  9010. /**
  9011. * BIT [ 7 : 0] :- mac_id
  9012. * BIT [31 : 8] :- reserved
  9013. */
  9014. union {
  9015. struct {
  9016. A_UINT32 mac_id: 8,
  9017. reserved: 24;
  9018. };
  9019. A_UINT32 mac_id__word;
  9020. };
  9021. /*
  9022. * Stats direction (TX/RX). Enum value from HTT_STATS_DIRECTION.
  9023. */
  9024. A_UINT32 direction;
  9025. /*
  9026. * Preamble type. Enum value from HTT_STATS_PREAM_TYPE.
  9027. *
  9028. * Note that for although OFDM rates don't technically support
  9029. * "puncturing", this TLV can be used to indicate the 20 MHz sub-bands
  9030. * utilized for OFDM legacy duplicate packets, which are also used during
  9031. * puncturing sequences.
  9032. */
  9033. A_UINT32 preamble;
  9034. /*
  9035. * Stats PPDU type. Enum value from HTT_STATS_PPDU_TYPE.
  9036. */
  9037. A_UINT32 ppdu_type;
  9038. /*
  9039. * Indicates the number of valid elements in the
  9040. * "num_subbands_used_cnt" array, and must be <=
  9041. * HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT.
  9042. *
  9043. * Also indicates how many bits in the last_used_pattern_mask may be
  9044. * non-zero.
  9045. */
  9046. A_UINT32 subband_count;
  9047. /*
  9048. * The last used transmit 20 MHz subband mask. Bit 0 represents the lowest
  9049. * 20 MHz subband mask, bit 1 the second lowest, and so on.
  9050. *
  9051. * All 32 bits are valid and will be used for expansion to higher BW modes.
  9052. */
  9053. A_UINT32 last_used_pattern_mask;
  9054. /*
  9055. * Number of array elements with valid values is equal to "subband_count".
  9056. * If subband_count is < HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT, the
  9057. * remaining elements will be implicitly set to 0x0.
  9058. *
  9059. * The array index is the number of 20 MHz subbands utilized during TX/RX,
  9060. * and the counter value at that index is the number of times that subband
  9061. * count was used.
  9062. *
  9063. * The count is incremented once for each OTA PPDU transmitted / received.
  9064. */
  9065. A_UINT32 num_subbands_used_cnt[HTT_PUNCTURE_STATS_MAX_SUBBAND_COUNT];
  9066. } htt_stats_pdev_puncture_stats_tlv;
  9067. /* preserve old name alias for new name consistent with the tag name */
  9068. typedef htt_stats_pdev_puncture_stats_tlv htt_pdev_puncture_stats_tlv;
  9069. #define HTT_STATS_PDEV_PUNCTURE_STATS_MAC_ID_GET(word) ((word >> 0) & 0xff)
  9070. enum {
  9071. HTT_STATS_CAL_PROF_COLD_BOOT = 0,
  9072. HTT_STATS_CAL_PROF_FULL_CHAN_SWITCH = 1,
  9073. HTT_STATS_CAL_PROF_SCAN_CHAN_SWITCH = 2,
  9074. HTT_STATS_CAL_PROF_DPD_SPLIT_CAL = 3,
  9075. HTT_STATS_MAX_PROF_CAL = 4,
  9076. };
  9077. #define HTT_STATS_MAX_CAL_IDX_CNT 8
  9078. typedef struct { /* DEPRECATED */
  9079. htt_tlv_hdr_t tlv_hdr;
  9080. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  9081. /** To verify whether prof cal is enabled or not */
  9082. A_UINT32 enable;
  9083. /** current pdev_id */
  9084. A_UINT32 pdev_id;
  9085. /** The cnt is incremented when each time the calindex takes place */
  9086. A_UINT32 cnt[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9087. /** Minimum time taken to complete the calibration - in us */
  9088. A_UINT32 min[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9089. /** Maximum time taken to complete the calibration -in us */
  9090. A_UINT32 max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9091. /** Time taken by the cal for its final time execution - in us */
  9092. A_UINT32 last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9093. /** Total time taken - in us */
  9094. A_UINT32 tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9095. /** hist_intvl - by default will be set to 2000 us */
  9096. A_UINT32 hist_intvl[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9097. /**
  9098. * If last is less than hist_intvl, then hist[0]++,
  9099. * If last is less than hist_intvl << 1, then hist[1]++,
  9100. * otherwise hist[2]++.
  9101. */
  9102. A_UINT32 hist[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT][HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  9103. /** Pf_last will log the current no of page faults */
  9104. A_UINT32 pf_last[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9105. /** Sum of all page faults happened */
  9106. A_UINT32 pf_tot[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9107. /** If pf_last > pf_max then pf_max = pf_last */
  9108. A_UINT32 pf_max[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9109. /**
  9110. * For each cal profile, only certain no of cal indices were invoked,
  9111. * this member will store what all the indices got invoked per each
  9112. * cal profile
  9113. */
  9114. A_UINT32 enabledCalIdx[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9115. /** No of indices invoked per each cal profile */
  9116. A_UINT32 CalCnt[HTT_STATS_MAX_PROF_CAL];
  9117. } htt_stats_latency_prof_cal_stats_tlv; /* DEPRECATED */
  9118. /* preserve old name alias for new name consistent with the tag name */
  9119. typedef htt_stats_latency_prof_cal_stats_tlv htt_latency_prof_cal_stats_tlv; /* DEPRECATED */
  9120. typedef struct {
  9121. /** The cnt is incremented when each time the calindex takes place */
  9122. A_UINT32 cnt;
  9123. /** Minimum time taken to complete the calibration - in us */
  9124. A_UINT32 min;
  9125. /** Maximum time taken to complete the calibration -in us */
  9126. A_UINT32 max;
  9127. /** Time taken by the cal for its final time execution - in us */
  9128. A_UINT32 last;
  9129. /** Total time taken - in us */
  9130. A_UINT32 tot;
  9131. /** hist_intvl - in us, by default will be set to 2000 us */
  9132. A_UINT32 hist_intvl;
  9133. /**
  9134. * If last is less than hist_intvl, then hist[0]++,
  9135. * If last is less than hist_intvl << 1, then hist[1]++,
  9136. * otherwise hist[2]++.
  9137. */
  9138. A_UINT32 hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  9139. /** pf_last will log the current no of page faults */
  9140. A_UINT32 pf_last;
  9141. /** Sum of all page faults happened */
  9142. A_UINT32 pf_tot;
  9143. /** If pf_last > pf_max then pf_max = pf_last */
  9144. A_UINT32 pf_max;
  9145. /**
  9146. * For each cal profile, only certain no of cal indices were invoked,
  9147. * this member will store what all the indices got invoked per each
  9148. * cal profile
  9149. */
  9150. A_UINT32 enabled_cal_idx;
  9151. /*
  9152. * NOTE: due to backwards-compatibility requirements,
  9153. * no fields can be added to this struct.
  9154. */
  9155. } htt_stats_latency_prof_cal_data;
  9156. typedef struct {
  9157. htt_tlv_hdr_t tlv_hdr;
  9158. /** To verify whether prof cal is enabled or not */
  9159. A_UINT32 enable;
  9160. /** current pdev_id */
  9161. A_UINT32 pdev_id;
  9162. /** No of indices invoked per each cal profile */
  9163. A_UINT32 cal_cnt[HTT_STATS_MAX_PROF_CAL];
  9164. /** Latency Cal Profile name */
  9165. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  9166. /** Latency Cal data */
  9167. htt_stats_latency_prof_cal_data latency_data[HTT_STATS_MAX_PROF_CAL][HTT_STATS_MAX_CAL_IDX_CNT];
  9168. } htt_stats_latency_prof_cal_data_tlv;
  9169. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M 0x0000003F
  9170. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S 0
  9171. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M 0x00000FC0
  9172. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S 6
  9173. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M 0x0FFFF000
  9174. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S 12
  9175. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var) \
  9176. (((_var) & HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M) >> \
  9177. HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)
  9178. /* provide properly-named macro */
  9179. #define HTT_STATS_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var) \
  9180. HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_GET(_var)
  9181. #define HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_SET(_var, _val) \
  9182. do { \
  9183. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD, _val); \
  9184. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_M)); \
  9185. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_PEER_ASSOC_IPC_RECVD_S)); \
  9186. } while (0)
  9187. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var) \
  9188. (((_var) & HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M) >> \
  9189. HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)
  9190. /* provide properly-named macro */
  9191. #define HTT_STATS_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var) \
  9192. HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_GET(_var)
  9193. #define HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_SET(_var, _val) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD, _val); \
  9196. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_M)); \
  9197. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_SCHED_PEER_DELETE_RECVD_S)); \
  9198. } while (0)
  9199. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var) \
  9200. (((_var) & HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M) >> \
  9201. HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)
  9202. /* provide properly-named macro */
  9203. #define HTT_STATS_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var) \
  9204. HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_GET(_var)
  9205. #define HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_SET(_var, _val) \
  9206. do { \
  9207. HTT_CHECK_SET_VAL(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX, _val); \
  9208. ((_var) &= ~(HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_M)); \
  9209. ((_var) |= ((_val) << HTT_ML_PEER_EXT_DETAILS_MLD_AST_INDEX_S)); \
  9210. } while (0)
  9211. typedef struct {
  9212. htt_tlv_hdr_t tlv_hdr;
  9213. union {
  9214. struct {
  9215. A_UINT32 peer_assoc_ipc_recvd : 6,
  9216. sched_peer_delete_recvd : 6,
  9217. mld_ast_index : 16,
  9218. reserved : 4;
  9219. };
  9220. A_UINT32 msg_dword_1;
  9221. };
  9222. } htt_stats_ml_peer_ext_details_tlv;
  9223. /* preserve old name alias for new name consistent with the tag name */
  9224. typedef htt_stats_ml_peer_ext_details_tlv htt_ml_peer_ext_details_tlv;
  9225. #define HTT_ML_LINK_INFO_VALID_M 0x00000001
  9226. #define HTT_ML_LINK_INFO_VALID_S 0
  9227. #define HTT_ML_LINK_INFO_ACTIVE_M 0x00000002
  9228. #define HTT_ML_LINK_INFO_ACTIVE_S 1
  9229. #define HTT_ML_LINK_INFO_PRIMARY_M 0x00000004
  9230. #define HTT_ML_LINK_INFO_PRIMARY_S 2
  9231. #define HTT_ML_LINK_INFO_ASSOC_LINK_M 0x00000008
  9232. #define HTT_ML_LINK_INFO_ASSOC_LINK_S 3
  9233. #define HTT_ML_LINK_INFO_CHIP_ID_M 0x00000070
  9234. #define HTT_ML_LINK_INFO_CHIP_ID_S 4
  9235. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_M 0x00007F80
  9236. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_S 7
  9237. #define HTT_ML_LINK_INFO_HW_LINK_ID_M 0x00038000
  9238. #define HTT_ML_LINK_INFO_HW_LINK_ID_S 15
  9239. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M 0x000C0000
  9240. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S 18
  9241. #define HTT_ML_LINK_INFO_MASTER_LINK_M 0x00100000
  9242. #define HTT_ML_LINK_INFO_MASTER_LINK_S 20
  9243. #define HTT_ML_LINK_INFO_ANCHOR_LINK_M 0x00200000
  9244. #define HTT_ML_LINK_INFO_ANCHOR_LINK_S 21
  9245. #define HTT_ML_LINK_INFO_INITIALIZED_M 0x00400000
  9246. #define HTT_ML_LINK_INFO_INITIALIZED_S 22
  9247. #define HTT_ML_LINK_INFO_SW_PEER_ID_M 0x0000ffff
  9248. #define HTT_ML_LINK_INFO_SW_PEER_ID_S 0
  9249. #define HTT_ML_LINK_INFO_VDEV_ID_M 0x00ff0000
  9250. #define HTT_ML_LINK_INFO_VDEV_ID_S 16
  9251. #define HTT_ML_LINK_INFO_VALID_GET(_var) \
  9252. (((_var) & HTT_ML_LINK_INFO_VALID_M) >> \
  9253. HTT_ML_LINK_INFO_VALID_S)
  9254. /* provide properly-named macro */
  9255. #define HTT_STATS_ML_LINK_INFO_DETAILS_VALID_GET(_var) \
  9256. HTT_ML_LINK_INFO_VALID_GET(_var)
  9257. #define HTT_ML_LINK_INFO_VALID_SET(_var, _val) \
  9258. do { \
  9259. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VALID, _val); \
  9260. ((_var) &= ~(HTT_ML_LINK_INFO_VALID_M)); \
  9261. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VALID_S)); \
  9262. } while (0)
  9263. #define HTT_ML_LINK_INFO_ACTIVE_GET(_var) \
  9264. (((_var) & HTT_ML_LINK_INFO_ACTIVE_M) >> \
  9265. HTT_ML_LINK_INFO_ACTIVE_S)
  9266. /* provide properly-named macro */
  9267. #define HTT_STATS_ML_LINK_INFO_DETAILS_ACTIVE_GET(_var) \
  9268. HTT_ML_LINK_INFO_ACTIVE_GET(_var)
  9269. #define HTT_ML_LINK_INFO_ACTIVE_SET(_var, _val) \
  9270. do { \
  9271. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ACTIVE, _val); \
  9272. ((_var) &= ~(HTT_ML_LINK_INFO_ACTIVE_M)); \
  9273. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ACTIVE_S)); \
  9274. } while (0)
  9275. #define HTT_ML_LINK_INFO_PRIMARY_GET(_var) \
  9276. (((_var) & HTT_ML_LINK_INFO_PRIMARY_M) >> \
  9277. HTT_ML_LINK_INFO_PRIMARY_S)
  9278. /* provide properly-named macro */
  9279. #define HTT_STATS_ML_LINK_INFO_DETAILS_PRIMARY_GET(_var) \
  9280. HTT_ML_LINK_INFO_PRIMARY_GET(_var)
  9281. #define HTT_ML_LINK_INFO_PRIMARY_SET(_var, _val) \
  9282. do { \
  9283. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_PRIMARY, _val); \
  9284. ((_var) &= ~(HTT_ML_LINK_INFO_PRIMARY_M)); \
  9285. ((_var) |= ((_val) << HTT_ML_LINK_INFO_PRIMARY_S)); \
  9286. } while (0)
  9287. #define HTT_ML_LINK_INFO_ASSOC_LINK_GET(_var) \
  9288. (((_var) & HTT_ML_LINK_INFO_ASSOC_LINK_M) >> \
  9289. HTT_ML_LINK_INFO_ASSOC_LINK_S)
  9290. /* provide properly-named macro */
  9291. #define HTT_STATS_ML_LINK_INFO_DETAILS_ASSOC_LINK_GET(_var) \
  9292. HTT_ML_LINK_INFO_ASSOC_LINK_GET(_var)
  9293. #define HTT_ML_LINK_INFO_ASSOC_LINK_SET(_var, _val) \
  9294. do { \
  9295. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ASSOC_LINK, _val); \
  9296. ((_var) &= ~(HTT_ML_LINK_INFO_ASSOC_LINK_M)); \
  9297. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ASSOC_LINK_S)); \
  9298. } while (0)
  9299. #define HTT_ML_LINK_INFO_CHIP_ID_GET(_var) \
  9300. (((_var) & HTT_ML_LINK_INFO_CHIP_ID_M) >> \
  9301. HTT_ML_LINK_INFO_CHIP_ID_S)
  9302. /* provide properly-named macro */
  9303. #define HTT_STATS_ML_LINK_INFO_DETAILS_CHIP_ID_GET(_var) \
  9304. HTT_ML_LINK_INFO_CHIP_ID_GET(_var)
  9305. #define HTT_ML_LINK_INFO_CHIP_ID_SET(_var, _val) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_CHIP_ID, _val); \
  9308. ((_var) &= ~(HTT_ML_LINK_INFO_CHIP_ID_M)); \
  9309. ((_var) |= ((_val) << HTT_ML_LINK_INFO_CHIP_ID_S)); \
  9310. } while (0)
  9311. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_GET(_var) \
  9312. (((_var) & HTT_ML_LINK_INFO_IEEE_LINK_ID_M) >> \
  9313. HTT_ML_LINK_INFO_IEEE_LINK_ID_S)
  9314. /* provide properly-named macro */
  9315. #define HTT_STATS_ML_LINK_INFO_DETAILS_IEEE_LINK_ID_GET(_var) \
  9316. HTT_ML_LINK_INFO_IEEE_LINK_ID_GET(_var)
  9317. #define HTT_ML_LINK_INFO_IEEE_LINK_ID_SET(_var, _val) \
  9318. do { \
  9319. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_IEEE_LINK_ID, _val); \
  9320. ((_var) &= ~(HTT_ML_LINK_INFO_IEEE_LINK_ID_M)); \
  9321. ((_var) |= ((_val) << HTT_ML_LINK_INFO_IEEE_LINK_ID_S)); \
  9322. } while (0)
  9323. #define HTT_ML_LINK_INFO_HW_LINK_ID_GET(_var) \
  9324. (((_var) & HTT_ML_LINK_INFO_HW_LINK_ID_M) >> \
  9325. HTT_ML_LINK_INFO_HW_LINK_ID_S)
  9326. /* provide properly-named macro */
  9327. #define HTT_STATS_ML_LINK_INFO_DETAILS_HW_LINK_ID_GET(_var) \
  9328. HTT_ML_LINK_INFO_HW_LINK_ID_GET(_var)
  9329. #define HTT_ML_LINK_INFO_HW_LINK_ID_SET(_var, _val) \
  9330. do { \
  9331. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_HW_LINK_ID, _val); \
  9332. ((_var) &= ~(HTT_ML_LINK_INFO_HW_LINK_ID_M)); \
  9333. ((_var) |= ((_val) << HTT_ML_LINK_INFO_HW_LINK_ID_S)); \
  9334. } while (0)
  9335. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_GET(_var) \
  9336. (((_var) & HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M) >> \
  9337. HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)
  9338. /* provide properly-named macro */
  9339. #define HTT_STATS_ML_LINK_INFO_DETAILS_LOGICAL_LINK_ID_GET(_var) \
  9340. HTT_ML_LINK_INFO_LOGICAL_LINK_ID_GET(_var)
  9341. #define HTT_ML_LINK_INFO_LOGICAL_LINK_ID_SET(_var, _val) \
  9342. do { \
  9343. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_LOGICAL_LINK_ID, _val); \
  9344. ((_var) &= ~(HTT_ML_LINK_INFO_LOGICAL_LINK_ID_M)); \
  9345. ((_var) |= ((_val) << HTT_ML_LINK_INFO_LOGICAL_LINK_ID_S)); \
  9346. } while (0)
  9347. #define HTT_ML_LINK_INFO_MASTER_LINK_GET(_var) \
  9348. (((_var) & HTT_ML_LINK_INFO_MASTER_LINK_M) >> \
  9349. HTT_ML_LINK_INFO_MASTER_LINK_S)
  9350. /* provide properly-named macro */
  9351. #define HTT_STATS_ML_LINK_INFO_DETAILS_MASTER_LINK_GET(_var) \
  9352. HTT_ML_LINK_INFO_MASTER_LINK_GET(_var)
  9353. #define HTT_ML_LINK_INFO_MASTER_LINK_SET(_var, _val) \
  9354. do { \
  9355. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_MASTER_LINK, _val); \
  9356. ((_var) &= ~(HTT_ML_LINK_INFO_MASTER_LINK_M)); \
  9357. ((_var) |= ((_val) << HTT_ML_LINK_INFO_MASTER_LINK_S)); \
  9358. } while (0)
  9359. #define HTT_ML_LINK_INFO_ANCHOR_LINK_GET(_var) \
  9360. (((_var) & HTT_ML_LINK_INFO_ANCHOR_LINK_M) >> \
  9361. HTT_ML_LINK_INFO_ANCHOR_LINK_S)
  9362. /* provide properly-named macro */
  9363. #define HTT_STATS_ML_LINK_INFO_DETAILS_ANCHOR_LINK_GET(_var) \
  9364. HTT_ML_LINK_INFO_ANCHOR_LINK_GET(_var)
  9365. #define HTT_ML_LINK_INFO_ANCHOR_LINK_SET(_var, _val) \
  9366. do { \
  9367. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_ANCHOR_LINK, _val); \
  9368. ((_var) &= ~(HTT_ML_LINK_INFO_ANCHOR_LINK_M)); \
  9369. ((_var) |= ((_val) << HTT_ML_LINK_INFO_ANCHOR_LINK_S)); \
  9370. } while (0)
  9371. #define HTT_ML_LINK_INFO_INITIALIZED_GET(_var) \
  9372. (((_var) & HTT_ML_LINK_INFO_INITIALIZED_M) >> \
  9373. HTT_ML_LINK_INFO_INITIALIZED_S)
  9374. /* provide properly-named macro */
  9375. #define HTT_STATS_ML_LINK_INFO_DETAILS_INITIALIZED_GET(_var) \
  9376. HTT_ML_LINK_INFO_INITIALIZED_GET(_var)
  9377. #define HTT_ML_LINK_INFO_INITIALIZED_SET(_var, _val) \
  9378. do { \
  9379. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_INITIALIZED, _val); \
  9380. ((_var) &= ~(HTT_ML_LINK_INFO_INITIALIZED_M)); \
  9381. ((_var) |= ((_val) << HTT_ML_LINK_INFO_INITIALIZED_S)); \
  9382. } while (0)
  9383. #define HTT_ML_LINK_INFO_SW_PEER_ID_GET(_var) \
  9384. (((_var) & HTT_ML_LINK_INFO_SW_PEER_ID_M) >> \
  9385. HTT_ML_LINK_INFO_SW_PEER_ID_S)
  9386. /* provide properly-named macro */
  9387. #define HTT_STATS_ML_LINK_INFO_DETAILS_SW_PEER_ID_GET(_var) \
  9388. HTT_ML_LINK_INFO_SW_PEER_ID_GET(_var)
  9389. #define HTT_ML_LINK_INFO_SW_PEER_ID_SET(_var, _val) \
  9390. do { \
  9391. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_SW_PEER_ID, _val); \
  9392. ((_var) &= ~(HTT_ML_LINK_INFO_SW_PEER_ID_M)); \
  9393. ((_var) |= ((_val) << HTT_ML_LINK_INFO_SW_PEER_ID_S)); \
  9394. } while (0)
  9395. #define HTT_ML_LINK_INFO_VDEV_ID_GET(_var) \
  9396. (((_var) & HTT_ML_LINK_INFO_VDEV_ID_M) >> \
  9397. HTT_ML_LINK_INFO_VDEV_ID_S)
  9398. /* provide properly-named macro */
  9399. #define HTT_STATS_ML_LINK_INFO_DETAILS_VDEV_ID_GET(_var) \
  9400. HTT_ML_LINK_INFO_VDEV_ID_GET(_var)
  9401. #define HTT_ML_LINK_INFO_VDEV_ID_SET(_var, _val) \
  9402. do { \
  9403. HTT_CHECK_SET_VAL(HTT_ML_LINK_INFO_VDEV_ID, _val); \
  9404. ((_var) &= ~(HTT_ML_LINK_INFO_VDEV_ID_M)); \
  9405. ((_var) |= ((_val) << HTT_ML_LINK_INFO_VDEV_ID_S)); \
  9406. } while (0)
  9407. typedef struct {
  9408. htt_tlv_hdr_t tlv_hdr;
  9409. union {
  9410. struct {
  9411. A_UINT32 valid : 1,
  9412. active : 1,
  9413. primary : 1,
  9414. assoc_link : 1,
  9415. chip_id : 3,
  9416. ieee_link_id : 8,
  9417. hw_link_id : 3,
  9418. logical_link_id : 2,
  9419. master_link : 1,
  9420. anchor_link : 1,
  9421. initialized : 1,
  9422. reserved : 9;
  9423. };
  9424. A_UINT32 msg_dword_1;
  9425. };
  9426. union {
  9427. struct {
  9428. A_UINT32 sw_peer_id : 16,
  9429. vdev_id : 8,
  9430. reserved1 : 8;
  9431. };
  9432. A_UINT32 msg_dword_2;
  9433. };
  9434. A_UINT32 primary_tid_mask;
  9435. } htt_stats_ml_link_info_details_tlv;
  9436. /* preserve old name alias for new name consistent with the tag name */
  9437. typedef htt_stats_ml_link_info_details_tlv htt_ml_link_info_tlv;
  9438. #define HTT_ML_PEER_DETAILS_NUM_LINKS_M 0x00000003
  9439. #define HTT_ML_PEER_DETAILS_NUM_LINKS_S 0
  9440. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_M 0x00003FFC
  9441. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_S 2
  9442. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M 0x0001C000
  9443. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S 14
  9444. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M 0x00060000
  9445. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S 17
  9446. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M 0x00380000
  9447. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S 19
  9448. #define HTT_ML_PEER_DETAILS_NON_STR_M 0x00400000
  9449. #define HTT_ML_PEER_DETAILS_NON_STR_S 22
  9450. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M 0x00800000
  9451. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S 23
  9452. /* for backwards compatibility, retain the old EMLSR name of the bitfield */
  9453. #define HTT_ML_PEER_DETAILS_EMLSR_M HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M
  9454. #define HTT_ML_PEER_DETAILS_EMLSR_S HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S
  9455. #define HTT_ML_PEER_DETAILS_IS_STA_KO_M 0x01000000
  9456. #define HTT_ML_PEER_DETAILS_IS_STA_KO_S 24
  9457. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M 0x06000000
  9458. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S 25
  9459. #define HTT_ML_PEER_DETAILS_ALLOCATED_M 0x08000000
  9460. #define HTT_ML_PEER_DETAILS_ALLOCATED_S 27
  9461. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M 0x10000000
  9462. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S 28
  9463. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M 0x000000ff
  9464. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S 0
  9465. #define HTT_ML_PEER_DETAILS_NUM_LINKS_GET(_var) \
  9466. (((_var) & HTT_ML_PEER_DETAILS_NUM_LINKS_M) >> \
  9467. HTT_ML_PEER_DETAILS_NUM_LINKS_S)
  9468. /* provide properly-named macro */
  9469. #define HTT_STATS_ML_PEER_DETAILS_NUM_LINKS_GET(_var) \
  9470. HTT_ML_PEER_DETAILS_NUM_LINKS_GET(_var)
  9471. #define HTT_ML_PEER_DETAILS_NUM_LINKS_SET(_var, _val) \
  9472. do { \
  9473. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LINKS, _val); \
  9474. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LINKS_M)); \
  9475. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LINKS_S)); \
  9476. } while (0)
  9477. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_GET(_var) \
  9478. (((_var) & HTT_ML_PEER_DETAILS_ML_PEER_ID_M) >> \
  9479. HTT_ML_PEER_DETAILS_ML_PEER_ID_S)
  9480. /* provide properly-named macro */
  9481. #define HTT_STATS_ML_PEER_DETAILS_ML_PEER_ID_GET(_var) \
  9482. HTT_ML_PEER_DETAILS_ML_PEER_ID_GET(_var)
  9483. #define HTT_ML_PEER_DETAILS_ML_PEER_ID_SET(_var, _val) \
  9484. do { \
  9485. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ML_PEER_ID, _val); \
  9486. ((_var) &= ~(HTT_ML_PEER_DETAILS_ML_PEER_ID_M)); \
  9487. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ML_PEER_ID_S)); \
  9488. } while (0)
  9489. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var) \
  9490. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M) >> \
  9491. HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)
  9492. /* provide properly-named macro */
  9493. #define HTT_STATS_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var) \
  9494. HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_GET(_var)
  9495. #define HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_SET(_var, _val) \
  9496. do { \
  9497. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX, _val); \
  9498. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_M)); \
  9499. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_LINK_IDX_S)); \
  9500. } while (0)
  9501. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var) \
  9502. (((_var) & HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M) >> \
  9503. HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)
  9504. /* provide properly-named macro */
  9505. #define HTT_STATS_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var) \
  9506. HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_GET(_var)
  9507. #define HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_SET(_var, _val) \
  9508. do { \
  9509. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID, _val); \
  9510. ((_var) &= ~(HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_M)); \
  9511. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PRIMARY_CHIP_ID_S)); \
  9512. } while (0)
  9513. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var) \
  9514. (((_var) & HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M) >> \
  9515. HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)
  9516. /* provide properly-named macro */
  9517. #define HTT_STATS_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var) \
  9518. HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_GET(_var)
  9519. #define HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_SET(_var, _val) \
  9520. do { \
  9521. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT, _val); \
  9522. ((_var) &= ~(HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_M)); \
  9523. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_LINK_INIT_COUNT_S)); \
  9524. } while (0)
  9525. #define HTT_ML_PEER_DETAILS_NON_STR_GET(_var) \
  9526. (((_var) & HTT_ML_PEER_DETAILS_NON_STR_M) >> \
  9527. HTT_ML_PEER_DETAILS_NON_STR_S)
  9528. /* provide properly-named macro */
  9529. #define HTT_STATS_ML_PEER_DETAILS_NON_STR_GET(_var) \
  9530. HTT_ML_PEER_DETAILS_NON_STR_GET(_var)
  9531. #define HTT_ML_PEER_DETAILS_NON_STR_SET(_var, _val) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NON_STR, _val); \
  9534. ((_var) &= ~(HTT_ML_PEER_DETAILS_NON_STR_M)); \
  9535. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NON_STR_S)); \
  9536. } while (0)
  9537. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var) \
  9538. (((_var) & HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M) >> \
  9539. HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S)
  9540. /* provide properly-named macro */
  9541. #define HTT_STATS_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var) \
  9542. HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_GET(_var)
  9543. #define HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_SET(_var, _val) \
  9544. do { \
  9545. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE, _val); \
  9546. ((_var) &= ~(HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_M)); \
  9547. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_IS_EMLSR_ACTIVE_S)); \
  9548. } while (0)
  9549. /* start deprecated:
  9550. * For backwards compatibility, retain a macro definition that uses
  9551. * the old EMLSR name of the bitfield
  9552. */
  9553. #define HTT_ML_PEER_DETAILS_EMLSR_GET(_var) \
  9554. (((_var) & HTT_ML_PEER_DETAILS_EMLSR_M) >> \
  9555. HTT_ML_PEER_DETAILS_EMLSR_S)
  9556. #define HTT_ML_PEER_DETAILS_EMLSR_SET(_var, _val) \
  9557. do { \
  9558. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_EMLSR, _val); \
  9559. ((_var) &= ~(HTT_ML_PEER_DETAILS_EMLSR_M)); \
  9560. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_EMLSR_S)); \
  9561. } while (0)
  9562. /* end deprecated */
  9563. #define HTT_ML_PEER_DETAILS_IS_STA_KO_GET(_var) \
  9564. (((_var) & HTT_ML_PEER_DETAILS_IS_STA_KO_M) >> \
  9565. HTT_ML_PEER_DETAILS_IS_STA_KO_S)
  9566. /* provide properly-named macro */
  9567. #define HTT_STATS_ML_PEER_DETAILS_IS_STA_KO_GET(_var) \
  9568. HTT_ML_PEER_DETAILS_IS_STA_KO_GET(_var)
  9569. #define HTT_ML_PEER_DETAILS_IS_STA_KO_SET(_var, _val) \
  9570. do { \
  9571. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_IS_STA_KO, _val); \
  9572. ((_var) &= ~(HTT_ML_PEER_DETAILS_IS_STA_KO_M)); \
  9573. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_IS_STA_KO_S)); \
  9574. } while (0)
  9575. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var) \
  9576. (((_var) & HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M) >> \
  9577. HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)
  9578. /* provide properly-named macro */
  9579. #define HTT_STATS_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var) \
  9580. HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_GET(_var)
  9581. #define HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_SET(_var, _val) \
  9582. do { \
  9583. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS, _val); \
  9584. ((_var) &= ~(HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_M)); \
  9585. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_NUM_LOCAL_LINKS_S)); \
  9586. } while (0)
  9587. #define HTT_ML_PEER_DETAILS_ALLOCATED_GET(_var) \
  9588. (((_var) & HTT_ML_PEER_DETAILS_ALLOCATED_M) >> \
  9589. HTT_ML_PEER_DETAILS_ALLOCATED_S)
  9590. /* provide properly-named macro */
  9591. #define HTT_STATS_ML_PEER_DETAILS_ALLOCATED_GET(_var) \
  9592. HTT_ML_PEER_DETAILS_ALLOCATED_GET(_var)
  9593. #define HTT_ML_PEER_DETAILS_ALLOCATED_SET(_var, _val) \
  9594. do { \
  9595. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_ALLOCATED, _val); \
  9596. ((_var) &= ~(HTT_ML_PEER_DETAILS_ALLOCATED_M)); \
  9597. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_ALLOCATED_S)); \
  9598. } while (0)
  9599. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var) \
  9600. (((_var) & HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M) >> \
  9601. HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S)
  9602. /* provide properly-named macro */
  9603. #define HTT_STATS_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var) \
  9604. HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_GET(_var)
  9605. #define HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_SET(_var, _val) \
  9606. do { \
  9607. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_EMLSR_SUPPORT, _val); \
  9608. ((_var) &= ~(HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_M)); \
  9609. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_EMLSR_SUPPORT_S)); \
  9610. } while (0)
  9611. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var) \
  9612. (((_var) & HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M) >> \
  9613. HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)
  9614. /* provide properly-named macro */
  9615. #define HTT_STATS_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var) \
  9616. HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_GET(_var)
  9617. #define HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_SET(_var, _val) \
  9618. do { \
  9619. HTT_CHECK_SET_VAL(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP, _val); \
  9620. ((_var) &= ~(HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_M)); \
  9621. ((_var) |= ((_val) << HTT_ML_PEER_DETAILS_PARTICIPATING_CHIPS_BITMAP_S)); \
  9622. } while (0)
  9623. typedef struct {
  9624. htt_tlv_hdr_t tlv_hdr;
  9625. htt_mac_addr remote_mld_mac_addr;
  9626. union {
  9627. struct {
  9628. A_UINT32 num_links : 2,
  9629. ml_peer_id : 12,
  9630. primary_link_idx : 3,
  9631. primary_chip_id : 2,
  9632. link_init_count : 3,
  9633. non_str : 1,
  9634. is_emlsr_active : 1,
  9635. is_sta_ko : 1,
  9636. num_local_links : 2,
  9637. allocated : 1,
  9638. emlsr_support : 1,
  9639. reserved : 3;
  9640. };
  9641. struct {
  9642. /*
  9643. * For backwards compatibility, use a dummy union element to
  9644. * retain the old "emlsr" name for the "is_emlsr_active" bitfield.
  9645. */
  9646. A_UINT32 dummy1 : 23,
  9647. emlsr : 1,
  9648. dummy2 : 8;
  9649. };
  9650. A_UINT32 msg_dword_1;
  9651. };
  9652. union {
  9653. struct {
  9654. A_UINT32 participating_chips_bitmap : 8,
  9655. reserved1 : 24;
  9656. };
  9657. A_UINT32 msg_dword_2;
  9658. };
  9659. /*
  9660. * ml_peer_flags is an opaque field that cannot be interpreted by
  9661. * the host; it is only for off-line debug.
  9662. */
  9663. A_UINT32 ml_peer_flags;
  9664. } htt_stats_ml_peer_details_tlv;
  9665. /* preserve old name alias for new name consistent with the tag name */
  9666. typedef htt_stats_ml_peer_details_tlv htt_ml_peer_details_tlv;
  9667. /* STATS_TYPE : HTT_DBG_EXT_STATS_ML_PEERS_INFO
  9668. * TLV_TAGS:
  9669. * - HTT_STATS_ML_PEER_DETAILS_TAG
  9670. * - HTT_STATS_ML_LINK_INFO_DETAILS_TAG
  9671. * - HTT_STATS_ML_PEER_EXT_DETAILS_TAG (multiple)
  9672. */
  9673. /* NOTE:
  9674. * This structure is for documentation, and cannot be safely used directly.
  9675. * Instead, use the constituent TLV structures to fill/parse.
  9676. */
  9677. #ifdef ATH_TARGET
  9678. typedef struct _htt_ml_peer_stats {
  9679. htt_stats_ml_peer_details_tlv ml_peer_details;
  9680. htt_stats_ml_peer_ext_details_tlv ml_peer_ext_details;
  9681. htt_stats_ml_link_info_details_tlv ml_link_info[1];
  9682. } htt_ml_peer_stats_t;
  9683. #endif /* ATH_TARGET */
  9684. /*
  9685. * ODD Mandatory Stats are grouped together from all the existing different
  9686. * stats, to form a set of stats that will be used by the ODD application to
  9687. * post the stats to the cloud instead of polling for the individual stats.
  9688. * This is done to avoid non-mandatory stats to be polled as the data will not
  9689. * be required in the recipes derivation.
  9690. * Rather than the host simply printing the ODD stats, the ODD application
  9691. * will take the buffer and map it to the odd_mandatory_stats data structure.
  9692. */
  9693. typedef struct {
  9694. htt_tlv_hdr_t tlv_hdr;
  9695. A_UINT32 hw_queued;
  9696. A_UINT32 hw_reaped;
  9697. A_UINT32 hw_paused;
  9698. A_UINT32 hw_filt;
  9699. A_UINT32 seq_posted;
  9700. A_UINT32 seq_completed;
  9701. A_UINT32 underrun;
  9702. A_UINT32 hw_flush;
  9703. A_UINT32 next_seq_posted_dsr;
  9704. A_UINT32 seq_posted_isr;
  9705. A_UINT32 mpdu_cnt_fcs_ok;
  9706. A_UINT32 mpdu_cnt_fcs_err;
  9707. A_UINT32 msdu_count_tqm;
  9708. A_UINT32 mpdu_count_tqm;
  9709. A_UINT32 mpdus_ack_failed;
  9710. A_UINT32 num_data_ppdus_tried_ota;
  9711. A_UINT32 ppdu_ok;
  9712. A_UINT32 num_total_ppdus_tried_ota;
  9713. A_UINT32 thermal_suspend_cnt;
  9714. A_UINT32 dfs_suspend_cnt;
  9715. A_UINT32 tx_abort_suspend_cnt;
  9716. A_UINT32 suspended_txq_mask;
  9717. A_UINT32 last_suspend_reason;
  9718. A_UINT32 seq_failed_queueing;
  9719. A_UINT32 seq_restarted;
  9720. A_UINT32 seq_txop_repost_stop;
  9721. A_UINT32 next_seq_cancel;
  9722. A_UINT32 seq_min_msdu_repost_stop;
  9723. A_UINT32 total_phy_err_cnt;
  9724. A_UINT32 ppdu_recvd;
  9725. A_UINT32 tcp_msdu_cnt;
  9726. A_UINT32 tcp_ack_msdu_cnt;
  9727. A_UINT32 udp_msdu_cnt;
  9728. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  9729. A_UINT32 fw_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  9730. A_UINT32 fw_ring_mpdu_err[HTT_RX_STATS_RXDMA_MAX_ERR];
  9731. A_UINT32 urrn_stats[HTT_TX_PDEV_MAX_URRN_STATS];
  9732. A_UINT32 sifs_status[HTT_TX_PDEV_MAX_SIFS_BURST_STATS];
  9733. A_UINT32 sifs_hist_status[HTT_TX_PDEV_SIFS_BURST_HIST_STATS];
  9734. A_UINT32 rx_suspend_cnt;
  9735. A_UINT32 rx_suspend_fail_cnt;
  9736. A_UINT32 rx_resume_cnt;
  9737. A_UINT32 rx_resume_fail_cnt;
  9738. A_UINT32 hwq_beacon_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9739. A_UINT32 hwq_voice_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9740. A_UINT32 hwq_video_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9741. A_UINT32 hwq_best_effort_cmd_result[HTT_TX_HWQ_MAX_CMD_RESULT_STATS];
  9742. A_UINT32 hwq_beacon_mpdu_tried_cnt;
  9743. A_UINT32 hwq_voice_mpdu_tried_cnt;
  9744. A_UINT32 hwq_video_mpdu_tried_cnt;
  9745. A_UINT32 hwq_best_effort_mpdu_tried_cnt;
  9746. A_UINT32 hwq_beacon_mpdu_queued_cnt;
  9747. A_UINT32 hwq_voice_mpdu_queued_cnt;
  9748. A_UINT32 hwq_video_mpdu_queued_cnt;
  9749. A_UINT32 hwq_best_effort_mpdu_queued_cnt;
  9750. A_UINT32 hwq_beacon_mpdu_ack_fail_cnt;
  9751. A_UINT32 hwq_voice_mpdu_ack_fail_cnt;
  9752. A_UINT32 hwq_video_mpdu_ack_fail_cnt;
  9753. A_UINT32 hwq_best_effort_mpdu_ack_fail_cnt;
  9754. A_UINT32 pdev_resets;
  9755. A_UINT32 phy_warm_reset;
  9756. A_UINT32 hwsch_reset_count;
  9757. A_UINT32 phy_warm_reset_ucode_trig;
  9758. A_UINT32 mac_cold_reset;
  9759. A_UINT32 mac_warm_reset;
  9760. A_UINT32 mac_warm_reset_restore_cal;
  9761. A_UINT32 phy_warm_reset_m3_ssr;
  9762. A_UINT32 fw_rx_rings_reset;
  9763. A_UINT32 tx_flush;
  9764. A_UINT32 hwsch_dev_reset_war;
  9765. A_UINT32 mac_cold_reset_restore_cal;
  9766. A_UINT32 mac_only_reset;
  9767. A_UINT32 mac_sfm_reset;
  9768. A_UINT32 tx_ldpc; /* Number of tx PPDUs with LDPC coding */
  9769. A_UINT32 rx_ldpc; /* Number of rx PPDUs with LDPC coding */
  9770. A_UINT32 gen_mpdu_end_reason[HTT_TX_TQM_MAX_GEN_MPDU_END_REASON];
  9771. A_UINT32 list_mpdu_end_reason[HTT_TX_TQM_MAX_LIST_MPDU_END_REASON];
  9772. 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];
  9773. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9774. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9775. A_UINT32 half_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9776. A_UINT32 quarter_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9777. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  9778. 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];
  9779. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9780. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  9781. 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];
  9782. A_UINT32 rts_cnt;
  9783. A_UINT32 rts_success;
  9784. } htt_stats_odd_pdev_mandatory_tlv;
  9785. /* preserve old name alias for new name consistent with the tag name */
  9786. typedef htt_stats_odd_pdev_mandatory_tlv htt_odd_mandatory_pdev_stats_tlv;
  9787. typedef struct _htt_odd_mandatory_mumimo_pdev_stats_tlv {
  9788. htt_tlv_hdr_t tlv_hdr;
  9789. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9790. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9791. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9792. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9793. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  9794. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  9795. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  9796. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  9797. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  9798. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9799. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9800. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9801. } htt_dbg_odd_mandatory_mumimo_tlv;
  9802. /* preserve old name alias for new name consistent with the tag name */
  9803. typedef htt_dbg_odd_mandatory_mumimo_tlv
  9804. htt_odd_mandatory_mumimo_pdev_stats_tlv;
  9805. typedef struct _htt_odd_mandatory_muofdma_pdev_stats_tlv {
  9806. htt_tlv_hdr_t tlv_hdr;
  9807. A_UINT32 mu_ofdma_seq_posted;
  9808. A_UINT32 ul_mu_ofdma_seq_posted;
  9809. 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];
  9810. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9811. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9812. A_UINT32 ofdma_tx_ldpc;
  9813. A_UINT32 ul_ofdma_rx_ldpc;
  9814. 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];
  9815. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  9816. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  9817. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9818. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9819. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  9820. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  9821. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  9822. A_UINT32 ofdma_tx_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  9823. A_UINT32 ofdma_ba_ru_size[HTT_TX_PDEV_STATS_NUM_AX_RU_SIZE_COUNTERS];
  9824. } htt_dbg_odd_mandatory_muofdma_tlv;
  9825. /* preserve old name alias for new name consistent with the tag name */
  9826. typedef htt_dbg_odd_mandatory_muofdma_tlv
  9827. htt_odd_mandatory_muofdma_pdev_stats_tlv;
  9828. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M 0x000000ff
  9829. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S 0
  9830. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_GET(_var) \
  9831. (((_var) & HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_M) >> \
  9832. HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)
  9833. #define HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_SET(_var, _val) \
  9834. do { \
  9835. HTT_CHECK_SET_VAL(HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID, _val); \
  9836. ((_var) |= ((_val) << HTT_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_S)); \
  9837. } while (0)
  9838. typedef enum {
  9839. HTT_STATS_SCHED_OFDMA_TXBF = 0, /* 0 */
  9840. HTT_STATS_SCHED_OFDMA_TXBF_IS_SANITY_FAILED, /* 1 */
  9841. HTT_STATS_SCHED_OFDMA_TXBF_IS_EBF_ALLOWED_FAILIED, /* 2 */
  9842. HTT_STATS_SCHED_OFDMA_TXBF_RU_ALLOC_BW_DROP_COUNT, /* 3 */
  9843. HTT_STATS_SCHED_OFDMA_TXBF_INVALID_CV_QUERY_COUNT, /* 4 */
  9844. HTT_STATS_SCHED_OFDMA_TXBF_AVG_TXTIME_LESS_THAN_TXBF_SND_THERHOLD, /* 5 */
  9845. HTT_STATS_SCHED_OFDMA_TXBF_IS_CANDIDATE_KICKED_OUT, /* 6 */
  9846. HTT_STATS_SCHED_OFDMA_TXBF_CV_IMAGE_BUF_INVALID, /* 7 */
  9847. HTT_STATS_SCHED_OFDMA_TXBF_INELIGIBILITY_MAX,
  9848. } htt_stats_sched_ofdma_txbf_ineligibility_t;
  9849. #define HTT_MAX_NUM_CHAN_ACC_LAT_INTR 9
  9850. typedef struct {
  9851. htt_tlv_hdr_t tlv_hdr;
  9852. /**
  9853. * BIT [ 7 : 0] :- mac_id
  9854. * BIT [31 : 8] :- reserved
  9855. */
  9856. union {
  9857. struct {
  9858. A_UINT32 mac_id: 8,
  9859. reserved: 24;
  9860. };
  9861. A_UINT32 mac_id__word;
  9862. };
  9863. /** Num of instances where rate based DL OFDMA status = ENABLED */
  9864. A_UINT32 rate_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  9865. /** Num of instances where rate based DL OFDMA status = DISABLED */
  9866. A_UINT32 rate_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  9867. /** Num of instances where rate based DL OFDMA status = PROBING */
  9868. A_UINT32 rate_based_dlofdma_probing_count[HTT_NUM_AC_WMM];
  9869. /** Num of instances where rate based DL OFDMA status = MONITORING */
  9870. A_UINT32 rate_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  9871. /** Num of instances where avg. channel access latency based DL OFDMA status = ENABLED */
  9872. A_UINT32 chan_acc_lat_based_dlofdma_enabled_count[HTT_NUM_AC_WMM];
  9873. /** Num of instances where avg. channel access latency based DL OFDMA status = DISABLED */
  9874. A_UINT32 chan_acc_lat_based_dlofdma_disabled_count[HTT_NUM_AC_WMM];
  9875. /** Num of instances where avg. channel access latency based DL OFDMA status = MONITORING */
  9876. A_UINT32 chan_acc_lat_based_dlofdma_monitoring_count[HTT_NUM_AC_WMM];
  9877. /** Num of instances where dl ofdma is disabled due to ru allocation failure */
  9878. A_UINT32 downgrade_to_dl_su_ru_alloc_fail[HTT_NUM_AC_WMM];
  9879. /** Num of instances where dl ofdma is disabled because we have only one user in candidate list */
  9880. A_UINT32 candidate_list_single_user_disable_ofdma[HTT_NUM_AC_WMM];
  9881. /** Num of instances where ul is chosen over dl based on qos weight not specific to OFDMA */
  9882. A_UINT32 dl_cand_list_dropped_high_ul_qos_weight[HTT_NUM_AC_WMM];
  9883. /** Num of instances where dl ofdma is disabled due to pipelining */
  9884. A_UINT32 ax_dlofdma_disabled_due_to_pipelining[HTT_NUM_AC_WMM];
  9885. /** Num of instances where dl ofdma is disabled as the tid is su only eligible */
  9886. A_UINT32 dlofdma_disabled_su_only_eligible[HTT_NUM_AC_WMM];
  9887. /** Num of instances where dl ofdma is disabled because there are no mpdus tried consecutively */
  9888. A_UINT32 dlofdma_disabled_consec_no_mpdus_tried[HTT_NUM_AC_WMM];
  9889. /** Num of instances where dl ofdma is disabled because there are consecutive mpdu failure */
  9890. A_UINT32 dlofdma_disabled_consec_no_mpdus_success[HTT_NUM_AC_WMM];
  9891. A_UINT32 txbf_ofdma_ineligibility_stat[HTT_STATS_SCHED_OFDMA_TXBF_INELIGIBILITY_MAX];
  9892. /** Average channel access latency histogram stats
  9893. *
  9894. * avg_chan_acc_lat_hist[0]: channel access latency is < 100 us
  9895. * avg_chan_acc_lat_hist[1]: 100 us <= channel access latency < 200 us
  9896. * avg_chan_acc_lat_hist[2]: 200 us <= channel access latency < 300 us
  9897. * avg_chan_acc_lat_hist[3]: 300 us <= channel access latency < 400 us
  9898. * avg_chan_acc_lat_hist[4]: 400 us <= channel access latency < 500 us
  9899. * avg_chan_acc_lat_hist[5]: 500 us <= channel access latency < 1000 us
  9900. * avg_chan_acc_lat_hist[6]: 1000 us <= channel access latency < 1500 us
  9901. * avg_chan_acc_lat_hist[7]: 1500 us <= channel access latency < 2000 us
  9902. * avg_chan_acc_lat_hist[8]: channel access latency is >= 2000 us
  9903. */
  9904. A_UINT32 avg_chan_acc_lat_hist[HTT_MAX_NUM_CHAN_ACC_LAT_INTR];
  9905. } htt_stats_pdev_sched_algo_ofdma_stats_tlv;
  9906. /* preserve old name alias for new name consistent with the tag name */
  9907. typedef htt_stats_pdev_sched_algo_ofdma_stats_tlv
  9908. htt_pdev_sched_algo_ofdma_stats_tlv;
  9909. #define HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_MAC_ID_GET(word) ((word >> 0) & 0xff)
  9910. typedef struct {
  9911. htt_tlv_hdr_t tlv_hdr;
  9912. /** mac_id__word:
  9913. * BIT [ 7 : 0] :- mac_id
  9914. * Use the HTT_STATS_CMN_MAC_ID_GET,_SET macros to
  9915. * read/write this bitfield.
  9916. * BIT [31 : 8] :- reserved
  9917. */
  9918. A_UINT32 mac_id__word;
  9919. A_UINT32 basic_trigger_across_bss;
  9920. A_UINT32 basic_trigger_within_bss;
  9921. A_UINT32 bsr_trigger_across_bss;
  9922. A_UINT32 bsr_trigger_within_bss;
  9923. A_UINT32 mu_rts_across_bss;
  9924. A_UINT32 mu_rts_within_bss;
  9925. A_UINT32 ul_mumimo_trigger_across_bss;
  9926. A_UINT32 ul_mumimo_trigger_within_bss;
  9927. } htt_stats_pdev_mbssid_ctrl_frame_stats_tlv;
  9928. /* preserve old name alias for new name consistent with the tag name */
  9929. typedef htt_stats_pdev_mbssid_ctrl_frame_stats_tlv
  9930. htt_pdev_mbssid_ctrl_frame_stats_tlv;
  9931. typedef struct {
  9932. htt_tlv_hdr_t tlv_hdr;
  9933. /**
  9934. * BIT [ 7 : 0] :- mac_id
  9935. * Use the HTT_STATS_TDMA_MAC_ID_GET macro to extract
  9936. * this bitfield.
  9937. * BIT [31 : 8] :- reserved
  9938. */
  9939. union {
  9940. struct {
  9941. A_UINT32 mac_id: 8,
  9942. reserved: 24;
  9943. };
  9944. A_UINT32 mac_id__word;
  9945. };
  9946. /** Num of Active TDMA schedules */
  9947. A_UINT32 num_tdma_active_schedules;
  9948. /** Num of Reserved TDMA schedules */
  9949. A_UINT32 num_tdma_reserved_schedules;
  9950. /** Num of Restricted TDMA schedules */
  9951. A_UINT32 num_tdma_restricted_schedules;
  9952. /** Num of Unconfigured TDMA schedules */
  9953. A_UINT32 num_tdma_unconfigured_schedules;
  9954. /** Num of TDMA slot switches */
  9955. A_UINT32 num_tdma_slot_switches;
  9956. /** Num of TDMA EDCA switches */
  9957. A_UINT32 num_tdma_edca_switches;
  9958. } htt_stats_pdev_tdma_tlv;
  9959. /* preserve old name alias for new name consistent with the tag name */
  9960. typedef htt_stats_pdev_tdma_tlv htt_pdev_tdma_stats_tlv;
  9961. #define HTT_STATS_TDMA_MAC_ID_M 0x000000ff
  9962. #define HTT_STATS_TDMA_MAC_ID_S 0
  9963. #define HTT_STATS_TDMA_MAC_ID_GET(_var) \
  9964. (((_var) & HTT_STATS_TDMA_MAC_ID_M) >> \
  9965. HTT_STATS_TDMA_MAC_ID_S)
  9966. /* provide properly-named macro */
  9967. #define HTT_STATS_PDEV_TDMA_MAC_ID_GET(_var) \
  9968. HTT_STATS_TDMA_MAC_ID_GET(_var)
  9969. /*======= Bandwidth Manager stats ====================*/
  9970. #define HTT_BW_MGR_STATS_MAC_ID_M 0x000000ff
  9971. #define HTT_BW_MGR_STATS_MAC_ID_S 0
  9972. #define HTT_BW_MGR_STATS_PRI20_IDX_M 0x0000ff00
  9973. #define HTT_BW_MGR_STATS_PRI20_IDX_S 8
  9974. #define HTT_BW_MGR_STATS_PRI20_FREQ_M 0xffff0000
  9975. #define HTT_BW_MGR_STATS_PRI20_FREQ_S 16
  9976. #define HTT_BW_MGR_STATS_CENTER_FREQ1_M 0x0000ffff
  9977. #define HTT_BW_MGR_STATS_CENTER_FREQ1_S 0
  9978. #define HTT_BW_MGR_STATS_CENTER_FREQ2_M 0xffff0000
  9979. #define HTT_BW_MGR_STATS_CENTER_FREQ2_S 16
  9980. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_M 0x000000ff
  9981. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_S 0
  9982. #define HTT_BW_MGR_STATS_STATIC_PATTERN_M 0x00ffff00
  9983. #define HTT_BW_MGR_STATS_STATIC_PATTERN_S 8
  9984. #define HTT_BW_MGR_STATS_MAC_ID_GET(_var) \
  9985. (((_var) & HTT_BW_MGR_STATS_MAC_ID_M) >> \
  9986. HTT_BW_MGR_STATS_MAC_ID_S)
  9987. #define HTT_BW_MGR_STATS_MAC_ID_SET(_var, _val) \
  9988. do { \
  9989. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_MAC_ID, _val); \
  9990. ((_var) |= ((_val) << HTT_BW_MGR_STATS_MAC_ID_S)); \
  9991. } while (0)
  9992. #define HTT_BW_MGR_STATS_PRI20_IDX_GET(_var) \
  9993. (((_var) & HTT_BW_MGR_STATS_PRI20_IDX_M) >> \
  9994. HTT_BW_MGR_STATS_PRI20_IDX_S)
  9995. #define HTT_BW_MGR_STATS_PRI20_IDX_SET(_var, _val) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_PRI20_IDX, _val); \
  9998. ((_var) |= ((_val) << HTT_BW_MGR_STATS_PRI20_IDX_S)); \
  9999. } while (0)
  10000. #define HTT_BW_MGR_STATS_PRI20_FREQ_GET(_var) \
  10001. (((_var) & HTT_BW_MGR_STATS_PRI20_FREQ_M) >> \
  10002. HTT_BW_MGR_STATS_PRI20_FREQ_S)
  10003. #define HTT_BW_MGR_STATS_PRI20_FREQ_SET(_var, _val) \
  10004. do { \
  10005. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_PRI20_FREQ, _val); \
  10006. ((_var) |= ((_val) << HTT_BW_MGR_STATS_PRI20_FREQ_S)); \
  10007. } while (0)
  10008. #define HTT_BW_MGR_STATS_CENTER_FREQ1_GET(_var) \
  10009. (((_var) & HTT_BW_MGR_STATS_CENTER_FREQ1_M) >> \
  10010. HTT_BW_MGR_STATS_CENTER_FREQ1_S)
  10011. #define HTT_BW_MGR_STATS_CENTER_FREQ1_SET(_var, _val) \
  10012. do { \
  10013. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CENTER_FREQ1, _val); \
  10014. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CENTER_FREQ1_S)); \
  10015. } while (0)
  10016. #define HTT_BW_MGR_STATS_CENTER_FREQ2_GET(_var) \
  10017. (((_var) & HTT_BW_MGR_STATS_CENTER_FREQ2_M) >> \
  10018. HTT_BW_MGR_STATS_CENTER_FREQ2_S)
  10019. #define HTT_BW_MGR_STATS_CENTER_FREQ2_SET(_var, _val) \
  10020. do { \
  10021. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CENTER_FREQ2, _val); \
  10022. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CENTER_FREQ2_S)); \
  10023. } while (0)
  10024. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_GET(_var) \
  10025. (((_var) & HTT_BW_MGR_STATS_CHAN_PHY_MODE_M) >> \
  10026. HTT_BW_MGR_STATS_CHAN_PHY_MODE_S)
  10027. #define HTT_BW_MGR_STATS_CHAN_PHY_MODE_SET(_var, _val) \
  10028. do { \
  10029. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_CHAN_PHY_MODE, _val); \
  10030. ((_var) |= ((_val) << HTT_BW_MGR_STATS_CHAN_PHY_MODE_S)); \
  10031. } while (0)
  10032. #define HTT_BW_MGR_STATS_STATIC_PATTERN_GET(_var) \
  10033. (((_var) & HTT_BW_MGR_STATS_STATIC_PATTERN_M) >> \
  10034. HTT_BW_MGR_STATS_STATIC_PATTERN_S)
  10035. #define HTT_BW_MGR_STATS_STATIC_PATTERN_SET(_var, _val) \
  10036. do { \
  10037. HTT_CHECK_SET_VAL(HTT_BW_MGR_STATS_STATIC_PATTERN, _val); \
  10038. ((_var) |= ((_val) << HTT_BW_MGR_STATS_STATIC_PATTERN_S)); \
  10039. } while (0)
  10040. typedef struct {
  10041. htt_tlv_hdr_t tlv_hdr;
  10042. /* BIT [ 7 : 0] :- mac_id
  10043. * BIT [ 15 : 8] :- pri20_index
  10044. * BIT [ 31 : 16] :- pri20_freq in Mhz
  10045. */
  10046. A_UINT32 mac_id__pri20_idx__freq;
  10047. /* BIT [ 15 : 0] :- centre_freq1
  10048. * BIT [ 31 : 16] :- centre_freq2
  10049. */
  10050. A_UINT32 centre_freq1__freq2;
  10051. /* BIT [ 7 : 0] :- channel_phy_mode
  10052. * BIT [ 23 : 8] :- static_pattern
  10053. */
  10054. A_UINT32 phy_mode__static_pattern;
  10055. } htt_stats_pdev_bw_mgr_stats_tlv;
  10056. /* preserve old name alias for new name consistent with the tag name */
  10057. typedef htt_stats_pdev_bw_mgr_stats_tlv htt_pdev_bw_mgr_stats_tlv;
  10058. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_BW_MGR
  10059. * TLV_TAGS:
  10060. * - HTT_STATS_PDEV_BW_MGR_STATS_TAG
  10061. */
  10062. /* NOTE:
  10063. * This structure is for documentation, and cannot be safely used directly.
  10064. * Instead, use the constituent TLV structures to fill/parse.
  10065. */
  10066. #ifdef ATH_TARGET
  10067. typedef struct {
  10068. htt_stats_pdev_bw_mgr_stats_tlv bw_mgr_tlv;
  10069. } htt_pdev_bw_mgr_stats_t;
  10070. #endif /* ATH_TARGET */
  10071. /*============= start MLO UMAC SSR stats ============= { */
  10072. typedef enum {
  10073. HTT_MLO_UMAC_SSR_DBG_POINT_INVALID = 0,
  10074. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_DISABLE_RXDMA_PREFETCH,
  10075. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_PMACS_HWMLOS,
  10076. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_GLOBAL_WSI,
  10077. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_PMACS_DMAC,
  10078. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_TCL,
  10079. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_TQM,
  10080. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_WBM,
  10081. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_REO,
  10082. HTT_MLO_UMAC_SSR_DBG_POINT_PRE_RESET_HOST,
  10083. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_PREREQUISITES,
  10084. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_PRE_RING_RESET,
  10085. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_APPLY_SOFT_RESET,
  10086. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_POST_RING_RESET,
  10087. HTT_MLO_UMAC_SSR_DBG_POINT_RESET_FW_TQM_CMDQS,
  10088. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_HOST,
  10089. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_UMAC_INTERRUPTS,
  10090. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_WBM,
  10091. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_REO,
  10092. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TQM,
  10093. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_PMACS_DMAC,
  10094. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TQM_SYNC_CMD,
  10095. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_GLOBAL_WSI,
  10096. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_PMACS_HWMLOS,
  10097. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_ENABLE_RXDMA_PREFETCH,
  10098. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_TCL,
  10099. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_HOST_ENQ,
  10100. HTT_MLO_UMAC_SSR_DBG_POINT_POST_RESET_VERIFY_UMAC_RECOVERED,
  10101. /* The below debug point values are reserved for future expansion. */
  10102. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED28,
  10103. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED29,
  10104. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED30,
  10105. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED31,
  10106. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED32,
  10107. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED33,
  10108. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED34,
  10109. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED35,
  10110. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED36,
  10111. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED37,
  10112. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED38,
  10113. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED39,
  10114. HTT_MLO_UMAC_SSR_DBG_POINT_RESERVED40,
  10115. /*
  10116. * Due to backwards compatibility requirements, no futher DBG_POINT values
  10117. * can be added (but the above reserved values can be repurposed).
  10118. */
  10119. HTT_MLO_UMAC_SSR_DBG_POINT_MAX,
  10120. } HTT_MLO_UMAC_SSR_DBG_POINTS;
  10121. typedef enum {
  10122. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_INVALID = 0,
  10123. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_PRE_RESET,
  10124. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_POST_RESET_START,
  10125. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_DO_POST_RESET_COMPLETE,
  10126. /* The below recovery handshake values are reserved for future expansion. */
  10127. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED4,
  10128. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED5,
  10129. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED6,
  10130. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED7,
  10131. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_RESERVED8,
  10132. /*
  10133. * Due to backwards compatibility requirements, no futher
  10134. * RECOVERY_HANDSHAKE values can be added (but the above
  10135. * reserved values can be repurposed).
  10136. */
  10137. HTT_MLO_UMAC_RECOVERY_HANDSHAKE_COUNT,
  10138. } HTT_MLO_UMAC_RECOVERY_HANDSHAKES;
  10139. typedef struct {
  10140. htt_tlv_hdr_t tlv_hdr;
  10141. A_UINT32 start_ms;
  10142. A_UINT32 end_ms;
  10143. A_UINT32 delta_ms;
  10144. A_UINT32 reserved;
  10145. A_UINT32 footprint; /* holds a HTT_MLO_UMAC_SSR_DBG_POINTS value */
  10146. A_UINT32 tqm_hw_tstamp;
  10147. } htt_stats_mlo_umac_ssr_dbg_tlv;
  10148. /* preserve old name alias for new name consistent with the tag name */
  10149. typedef htt_stats_mlo_umac_ssr_dbg_tlv htt_mlo_umac_ssr_dbg_tlv;
  10150. typedef struct {
  10151. A_UINT32 last_mlo_htt_handshake_delta_ms;
  10152. A_UINT32 max_mlo_htt_handshake_delta_ms;
  10153. union {
  10154. A_UINT32 umac_recovery_done_mask;
  10155. struct {
  10156. A_UINT32 pre_reset_disable_rxdma_prefetch : 1,
  10157. pre_reset_pmacs_hwmlos : 1,
  10158. pre_reset_global_wsi : 1,
  10159. pre_reset_pmacs_dmac : 1,
  10160. pre_reset_tcl : 1,
  10161. pre_reset_tqm : 1,
  10162. pre_reset_wbm : 1,
  10163. pre_reset_reo : 1,
  10164. pre_reset_host : 1,
  10165. reset_prerequisites : 1,
  10166. reset_pre_ring_reset : 1,
  10167. reset_apply_soft_reset : 1,
  10168. reset_post_ring_reset : 1,
  10169. reset_fw_tqm_cmdqs : 1,
  10170. post_reset_host : 1,
  10171. post_reset_umac_interrupts : 1,
  10172. post_reset_wbm : 1,
  10173. post_reset_reo : 1,
  10174. post_reset_tqm : 1,
  10175. post_reset_pmacs_dmac : 1,
  10176. post_reset_tqm_sync_cmd : 1,
  10177. post_reset_global_wsi : 1,
  10178. post_reset_pmacs_hwmlos : 1,
  10179. post_reset_enable_rxdma_prefetch : 1,
  10180. post_reset_tcl : 1,
  10181. post_reset_host_enq : 1,
  10182. post_reset_verify_umac_recovered : 1,
  10183. reserved : 5;
  10184. } done_mask;
  10185. };
  10186. } htt_mlo_umac_ssr_mlo_stats_t;
  10187. typedef struct {
  10188. htt_tlv_hdr_t tlv_hdr;
  10189. htt_mlo_umac_ssr_mlo_stats_t mlo;
  10190. } htt_stats_mlo_umac_ssr_mlo_tlv;
  10191. /* preserve old name alias for new name consistent with the tag name */
  10192. typedef htt_stats_mlo_umac_ssr_mlo_tlv htt_mlo_umac_ssr_mlo_stats_tlv;
  10193. /* dword0 - b'0 - PRE_RESET_DISABLE_RXDMA_PREFETCH */
  10194. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_M 0x1
  10195. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S 0
  10196. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word0) \
  10197. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_M) >> \
  10198. HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S)
  10199. /* provide properly-named macro */
  10200. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word) \
  10201. HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_GET(word)
  10202. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_SET(word0, _val) \
  10203. do { \
  10204. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH, _val); \
  10205. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_DISABLE_RXDMA_PREFETCH_S));\
  10206. } while (0)
  10207. /* dword0 - b'1 - PRE_RESET_PMACS_HWMLOS */
  10208. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_M 0x2
  10209. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S 1
  10210. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_GET(word0) \
  10211. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_M) >> \
  10212. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S)
  10213. /* provide properly-named macro */
  10214. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_PMACS_HWMLOS_GET(word) \
  10215. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_GET(word)
  10216. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_SET(word0, _val) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS, _val); \
  10219. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_HWMLOS_S));\
  10220. } while (0)
  10221. /* dword0 - b'2 - PRE_RESET_GLOBAL_WSI */
  10222. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_M 0x4
  10223. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S 2
  10224. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_GET(word0) \
  10225. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_M) >> \
  10226. HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S)
  10227. /* provide properly-named macro */
  10228. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_GLOBAL_WSI_GET(word) \
  10229. HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_GET(word)
  10230. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_SET(word0, _val) \
  10231. do { \
  10232. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI, _val); \
  10233. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_GLOBAL_WSI_S));\
  10234. } while (0)
  10235. /* dword0 - b'3 - PRE_RESET_PMACS_DMAC */
  10236. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_M 0x8
  10237. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S 3
  10238. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_GET(word0) \
  10239. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_M) >> \
  10240. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S)
  10241. /* provide properly-named macro */
  10242. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_PMACS_DMAC_GET(word) \
  10243. HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_GET(word)
  10244. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_SET(word0, _val) \
  10245. do { \
  10246. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC, _val); \
  10247. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_PMACS_DMAC_S));\
  10248. } while (0)
  10249. /* dword0 - b'4 - PRE_RESET_TCL */
  10250. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_M 0x10
  10251. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S 4
  10252. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_GET(word0) \
  10253. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_M) >> \
  10254. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S)
  10255. /* provide properly-named macro */
  10256. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_TCL_GET(word) \
  10257. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_GET(word)
  10258. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_SET(word0, _val) \
  10259. do { \
  10260. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL, _val); \
  10261. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_TCL_S));\
  10262. } while (0)
  10263. /* dword0 - b'5 - PRE_RESET_TQM */
  10264. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_M 0x20
  10265. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S 5
  10266. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_GET(word0) \
  10267. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_M) >> \
  10268. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S)
  10269. /* provide properly-named macro */
  10270. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_TQM_GET(word) \
  10271. HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_GET(word)
  10272. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_SET(word0, _val) \
  10273. do { \
  10274. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM, _val); \
  10275. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_TQM_S));\
  10276. } while (0)
  10277. /* dword0 - b'6 - PRE_RESET_WBM */
  10278. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_M 0x40
  10279. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S 6
  10280. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_GET(word0) \
  10281. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_M) >> \
  10282. HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S)
  10283. /* provide properly-named macro */
  10284. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_WBM_GET(word) \
  10285. HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_GET(word)
  10286. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_SET(word0, _val) \
  10287. do { \
  10288. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM, _val); \
  10289. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_WBM_S));\
  10290. } while (0)
  10291. /* dword0 - b'7 - PRE_RESET_REO */
  10292. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_M 0x80
  10293. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S 7
  10294. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_GET(word0) \
  10295. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_M) >> \
  10296. HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S)
  10297. /* provide properly-named macro */
  10298. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_REO_GET(word) \
  10299. HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_GET(word)
  10300. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_SET(word0, _val) \
  10301. do { \
  10302. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO, _val); \
  10303. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_REO_S));\
  10304. } while (0)
  10305. /* dword0 - b'8 - PRE_RESET_HOST */
  10306. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_M 0x100
  10307. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S 8
  10308. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_GET(word0) \
  10309. (((word0) & HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_M) >> \
  10310. HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S)
  10311. /* provide properly-named macro */
  10312. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_PRE_RESET_HOST_GET(word) \
  10313. HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_GET(word)
  10314. #define HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_SET(word0, _val) \
  10315. do { \
  10316. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST, _val); \
  10317. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_PRE_RESET_HOST_S));\
  10318. } while (0)
  10319. /* dword0 - b'9 - RESET_PREREQUISITES */
  10320. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_M 0x200
  10321. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S 9
  10322. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_GET(word0) \
  10323. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_M) >> \
  10324. HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S)
  10325. /* provide properly-named macro */
  10326. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_PREREQUISITES_GET(word) \
  10327. HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_GET(word)
  10328. #define HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_SET(word0, _val) \
  10329. do { \
  10330. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES, _val); \
  10331. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_PREREQUISITES_S));\
  10332. } while (0)
  10333. /* dword0 - b'10 - RESET_PRE_RING_RESET */
  10334. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_M 0x400
  10335. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S 10
  10336. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_GET(word0) \
  10337. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_M) >> \
  10338. HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S)
  10339. /* provide properly-named macro */
  10340. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_PRE_RING_RESET_GET(word) \
  10341. HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_GET(word)
  10342. #define HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_SET(word0, _val) \
  10343. do { \
  10344. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET, _val); \
  10345. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_PRE_RING_RESET_S));\
  10346. } while (0)
  10347. /* dword0 - b'11 - RESET_APPLY_SOFT_RESET */
  10348. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_M 0x800
  10349. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S 11
  10350. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_GET(word0) \
  10351. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_M) >> \
  10352. HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S)
  10353. /* provide properly-named macro */
  10354. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_APPLY_SOFT_RESET_GET(word) \
  10355. HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_GET(word)
  10356. #define HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_SET(word0, _val) \
  10357. do { \
  10358. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET, _val); \
  10359. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_APPLY_SOFT_RESET_S));\
  10360. } while (0)
  10361. /* dword0 - b'12 - RESET_POST_RING_RESET */
  10362. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_M 0x1000
  10363. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S 12
  10364. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_GET(word0) \
  10365. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_M) >> \
  10366. HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S)
  10367. /* provide properly-named macro */
  10368. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_POST_RING_RESET_GET(word) \
  10369. HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_GET(word)
  10370. #define HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_SET(word0, _val) \
  10371. do { \
  10372. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET, _val); \
  10373. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_POST_RING_RESET_S));\
  10374. } while (0)
  10375. /* dword0 - b'13 - RESET_FW_TQM_CMDQS */
  10376. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_M 0x2000
  10377. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S 13
  10378. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_GET(word0) \
  10379. (((word0) & HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_M) >> \
  10380. HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S)
  10381. /* provide properly-named macro */
  10382. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_RESET_FW_TQM_CMDQS_GET(word) \
  10383. HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_GET(word)
  10384. #define HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_SET(word0, _val) \
  10385. do { \
  10386. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS, _val); \
  10387. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_RESET_FW_TQM_CMDQS_S));\
  10388. } while (0)
  10389. /* dword0 - b'14 - POST_RESET_HOST */
  10390. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_M 0x4000
  10391. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S 14
  10392. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_GET(word0) \
  10393. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_M) >> \
  10394. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S)
  10395. /* provide properly-named macro */
  10396. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_HOST_GET(word) \
  10397. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_GET(word)
  10398. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_SET(word0, _val) \
  10399. do { \
  10400. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST, _val); \
  10401. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_S));\
  10402. } while (0)
  10403. /* dword0 - b'15 - POST_RESET_UMAC_INTERRUPTS */
  10404. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_M 0x8000
  10405. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S 15
  10406. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_GET(word0) \
  10407. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_M) >> \
  10408. HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S)
  10409. /* provide properly-named macro */
  10410. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_UMAC_INTERRUPTS_GET(word) \
  10411. HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_GET(word)
  10412. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_SET(word0, _val) \
  10413. do { \
  10414. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS, _val); \
  10415. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_UMAC_INTERRUPTS_S));\
  10416. } while (0)
  10417. /* dword0 - b'16 - POST_RESET_WBM */
  10418. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_M 0x10000
  10419. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S 16
  10420. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_GET(word0) \
  10421. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_M) >> \
  10422. HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S)
  10423. /* provide properly-named macro */
  10424. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_WBM_GET(word) \
  10425. HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_GET(word)
  10426. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_SET(word0, _val) \
  10427. do { \
  10428. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM, _val); \
  10429. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_WBM_S));\
  10430. } while (0)
  10431. /* dword0 - b'17 - POST_RESET_REO */
  10432. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_M 0x20000
  10433. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S 17
  10434. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_GET(word0) \
  10435. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_M) >> \
  10436. HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S)
  10437. /* provide properly-named macro */
  10438. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_REO_GET(word) \
  10439. HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_GET(word)
  10440. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_SET(word0, _val) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_REO, _val); \
  10443. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_REO_S));\
  10444. } while (0)
  10445. /* dword0 - b'18 - POST_RESET_TQM */
  10446. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_M 0x40000
  10447. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S 18
  10448. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_GET(word0) \
  10449. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_M) >> \
  10450. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S)
  10451. /* provide properly-named macro */
  10452. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TQM_GET(word) \
  10453. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_GET(word)
  10454. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SET(word0, _val) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM, _val); \
  10457. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_S));\
  10458. } while (0)
  10459. /* dword0 - b'19 - POST_RESET_PMACS_DMAC */
  10460. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_M 0x80000
  10461. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S 19
  10462. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_GET(word0) \
  10463. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_M) >> \
  10464. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S)
  10465. /* provide properly-named macro */
  10466. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_PMACS_DMAC_GET(word) \
  10467. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_GET(word)
  10468. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_SET(word0, _val) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC, _val); \
  10471. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_DMAC_S));\
  10472. } while (0)
  10473. /* dword0 - b'20 - POST_RESET_TQM_SYNC_CMD */
  10474. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_M 0x100000
  10475. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S 20
  10476. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_GET(word0) \
  10477. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_M) >> \
  10478. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S)
  10479. /* provide properly-named macro */
  10480. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TQM_SYNC_CMD_GET(word) \
  10481. HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_GET(word)
  10482. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_SET(word0, _val) \
  10483. do { \
  10484. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD, _val); \
  10485. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TQM_SYNC_CMD_S));\
  10486. } while (0)
  10487. /* dword0 - b'21 - POST_RESET_GLOBAL_WSI */
  10488. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_M 0x200000
  10489. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S 21
  10490. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_GET(word0) \
  10491. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_M) >> \
  10492. HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S)
  10493. /* provide properly-named macro */
  10494. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_GLOBAL_WSI_GET(word) \
  10495. HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_GET(word)
  10496. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_SET(word0, _val) \
  10497. do { \
  10498. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI, _val); \
  10499. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_GLOBAL_WSI_S));\
  10500. } while (0)
  10501. /* dword0 - b'22 - POST_RESET_PMACS_HWMLOS */
  10502. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_M 0x400000
  10503. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S 22
  10504. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_GET(word0) \
  10505. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_M) >> \
  10506. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S)
  10507. /* provide properly-named macro */
  10508. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_PMACS_HWMLOS_GET(word) \
  10509. HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_GET(word)
  10510. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_SET(word0, _val) \
  10511. do { \
  10512. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS, _val); \
  10513. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_PMACS_HWMLOS_S));\
  10514. } while (0)
  10515. /* dword0 - b'23 - POST_RESET_ENABLE_RXDMA_PREFETCH */
  10516. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_M 0x800000
  10517. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S 23
  10518. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word0) \
  10519. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_M) >> \
  10520. HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S)
  10521. /* provide properly-named macro */
  10522. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word) \
  10523. HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_GET(word)
  10524. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_SET(word0, _val) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH, _val); \
  10527. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_ENABLE_RXDMA_PREFETCH_S));\
  10528. } while (0)
  10529. /* dword0 - b'24 - POST_RESET_TCL */
  10530. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_M 0x1000000
  10531. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S 24
  10532. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_GET(word0) \
  10533. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_M) >> \
  10534. HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S)
  10535. /* provide properly-named macro */
  10536. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_TCL_GET(word) \
  10537. HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_GET(word)
  10538. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_SET(word0, _val) \
  10539. do { \
  10540. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL, _val); \
  10541. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_TCL_S));\
  10542. } while (0)
  10543. /* dword0 - b'25 - POST_RESET_HOST_ENQ */
  10544. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_M 0x2000000
  10545. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S 25
  10546. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_GET(word0) \
  10547. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_M) >> \
  10548. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S)
  10549. /* provide properly-named macro */
  10550. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_HOST_ENQ_GET(word) \
  10551. HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_GET(word)
  10552. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_SET(word0, _val) \
  10553. do { \
  10554. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ, _val); \
  10555. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_HOST_ENQ_S));\
  10556. } while (0)
  10557. /* dword0 - b'26 - POST_RESET_VERIFY_UMAC_RECOVERED */
  10558. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_M 0x4000000
  10559. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S 26
  10560. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word0) \
  10561. (((word0) & HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_M) >> \
  10562. HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S)
  10563. /* provide properly-named macro */
  10564. #define HTT_STATS_MLO_UMAC_SSR_MLO_MLO_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word) \
  10565. HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_GET(word)
  10566. #define HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_SET(word0, _val) \
  10567. do { \
  10568. HTT_CHECK_SET_VAL(HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED, _val); \
  10569. ((word0) |= ((_val) << HTT_UMAC_RECOVERY_DONE_POST_RESET_VERIFY_UMAC_RECOVERED_S));\
  10570. } while (0)
  10571. typedef struct {
  10572. htt_tlv_hdr_t tlv_hdr;
  10573. A_UINT32 last_trigger_request_ms;
  10574. A_UINT32 last_start_ms;
  10575. A_UINT32 last_start_disengage_umac_ms;
  10576. A_UINT32 last_enter_ssr_platform_thread_ms;
  10577. A_UINT32 last_exit_ssr_platform_thread_ms;
  10578. A_UINT32 last_start_engage_umac_ms;
  10579. A_UINT32 last_done_successful_ms;
  10580. A_UINT32 post_reset_tqm_sync_cmd_completion_ms;
  10581. A_UINT32 htt_sync_mlo_initiate_umac_recovery_ms;
  10582. A_UINT32 htt_sync_do_pre_reset_ms;
  10583. A_UINT32 htt_sync_do_post_reset_start_ms;
  10584. A_UINT32 htt_sync_do_post_reset_complete_ms;
  10585. } htt_stats_mlo_umac_ssr_kpi_tstmp_tlv;
  10586. /* preserve old name alias for new name consistent with the tag name */
  10587. typedef htt_stats_mlo_umac_ssr_kpi_tstmp_tlv
  10588. htt_mlo_umac_ssr_kpi_tstamp_stats_tlv;
  10589. typedef struct {
  10590. htt_tlv_hdr_t tlv_hdr;
  10591. A_UINT32 htt_sync_start_ms;
  10592. A_UINT32 htt_sync_delta_ms;
  10593. A_UINT32 post_t2h_start_ms;
  10594. A_UINT32 post_t2h_delta_ms;
  10595. A_UINT32 post_t2h_msg_read_shmem_ms;
  10596. A_UINT32 post_t2h_msg_write_shmem_ms;
  10597. A_UINT32 post_t2h_msg_send_msg_to_host_ms;
  10598. } htt_stats_mlo_umac_ssr_handshake_tlv;
  10599. /* preserve old name alias for new name consistent with the tag name */
  10600. typedef htt_stats_mlo_umac_ssr_handshake_tlv
  10601. htt_mlo_umac_htt_handshake_stats_tlv;
  10602. #ifdef ATH_TARGET
  10603. typedef struct {
  10604. /*
  10605. * Note that the host cannot use this struct directly, but instead needs
  10606. * to use the TLV header within each element of each of the arrays in
  10607. * this struct to determine where the subsequent item resides.
  10608. */
  10609. htt_stats_mlo_umac_ssr_dbg_tlv dbg_point[HTT_MLO_UMAC_SSR_DBG_POINT_MAX];
  10610. htt_stats_mlo_umac_ssr_handshake_tlv htt_handshakes[HTT_MLO_UMAC_RECOVERY_HANDSHAKE_COUNT];
  10611. } htt_mlo_umac_ssr_kpi_delta_stats_t;
  10612. #endif /* ATH_TARGET */
  10613. #ifdef ATH_TARGET
  10614. typedef struct {
  10615. /*
  10616. * Since each item within htt_mlo_umac_ssr_kpi_delta_stats_t has its own
  10617. * TLV header, and since no additional fields are added in this struct
  10618. * beyond the htt_mlo_umac_ssr_kpi_delta_stats_t info, no additional
  10619. * TLV header is needed.
  10620. *
  10621. * Note that the host cannot use this struct directly, but instead needs
  10622. * to use the TLV header within each item inside the
  10623. * htt_mlo_umac_ssr_kpi_delta_stats_t to determine where the subsequent
  10624. * item resides.
  10625. */
  10626. htt_mlo_umac_ssr_kpi_delta_stats_t kpi_delta;
  10627. } htt_mlo_umac_ssr_kpi_delta_stats_tlv;
  10628. #endif /* ATH_TARGET */
  10629. typedef struct {
  10630. A_UINT32 last_e2e_delta_ms;
  10631. A_UINT32 max_e2e_delta_ms;
  10632. A_UINT32 per_handshake_max_allowed_delta_ms;
  10633. /* Total done count */
  10634. A_UINT32 total_success_runs_cnt;
  10635. A_UINT32 umac_recovery_in_progress;
  10636. /* Count of Disengaged in Pre reset */
  10637. A_UINT32 umac_disengaged_count;
  10638. /* Count of UMAC Soft/Control Reset */
  10639. A_UINT32 umac_soft_reset_count;
  10640. /* Count of Engaged in Post reset */
  10641. A_UINT32 umac_engaged_count;
  10642. } htt_mlo_umac_ssr_common_stats_t;
  10643. typedef struct {
  10644. htt_tlv_hdr_t tlv_hdr;
  10645. htt_mlo_umac_ssr_common_stats_t cmn;
  10646. } htt_stats_mlo_umac_ssr_cmn_tlv;
  10647. /* preserve old name alias for new name consistent with the tag name */
  10648. typedef htt_stats_mlo_umac_ssr_cmn_tlv htt_mlo_umac_ssr_common_stats_tlv;
  10649. typedef struct {
  10650. A_UINT32 trigger_requests_count;
  10651. A_UINT32 trigger_count_for_umac_hang;
  10652. A_UINT32 trigger_count_for_mlo_target_recovery_mode1;
  10653. A_UINT32 trigger_count_for_unknown_signature;
  10654. A_UINT32 total_trig_dropped;
  10655. A_UINT32 trigger_count_for_unit_test_direct_trigger;
  10656. A_UINT32 trigger_count_for_tx_de_wdg_dummy_frame_tout;
  10657. A_UINT32 trigger_count_for_peer_delete_wdg_dummy_frame_tout;
  10658. A_UINT32 trigger_count_for_reo_hang;
  10659. A_UINT32 trigger_count_for_tqm_hang;
  10660. A_UINT32 trigger_count_for_tcl_hang;
  10661. A_UINT32 trigger_count_for_wbm_hang;
  10662. } htt_mlo_umac_ssr_trigger_stats_t;
  10663. typedef struct {
  10664. htt_tlv_hdr_t tlv_hdr;
  10665. htt_mlo_umac_ssr_trigger_stats_t trigger;
  10666. } htt_stats_mlo_umac_ssr_trigger_tlv;
  10667. /* preserve old name alias for new name consistent with the tag name */
  10668. typedef htt_stats_mlo_umac_ssr_trigger_tlv htt_mlo_umac_ssr_trigger_stats_tlv;
  10669. #ifdef ATH_TARGET
  10670. typedef struct {
  10671. /*
  10672. * Note that the host cannot use this struct directly, but instead needs
  10673. * to use the TLV header within each element to determine where the
  10674. * subsequent element resides.
  10675. */
  10676. htt_mlo_umac_ssr_kpi_delta_stats_tlv kpi_delta_tlv;
  10677. htt_stats_mlo_umac_ssr_kpi_tstmp_tlv kpi_tstamp_tlv;
  10678. } htt_mlo_umac_ssr_kpi_stats_t;
  10679. #endif /* ATH_TARGET */
  10680. #ifdef ATH_TARGET
  10681. typedef struct {
  10682. /*
  10683. * Since the embedded sub-struct within htt_mlo_umac_ssr_kpi_stats_tlv
  10684. * has its own TLV header, and since no additional fields are added in
  10685. * this struct beyond the htt_mlo_umac_ssr_kpi_stats_t info, no additional
  10686. * TLV header is needed.
  10687. *
  10688. * Note that the host cannot use this struct directly, but instead needs
  10689. * to use the TLV header within the htt_mlo_umac_ssr_kpi_stats_t sub-struct
  10690. * to determine how much data is present for this struct.
  10691. */
  10692. htt_mlo_umac_ssr_kpi_stats_t kpi;
  10693. } htt_mlo_umac_ssr_kpi_stats_tlv;
  10694. #endif /* ATH_TARGET */
  10695. #ifdef ATH_TARGET
  10696. typedef struct {
  10697. /*
  10698. * Note that the host cannot use this struct directly, but instead needs
  10699. * to use the TLV header within each element to determine where the
  10700. * subsequent element resides.
  10701. */
  10702. htt_stats_mlo_umac_ssr_trigger_tlv trigger_tlv;
  10703. htt_mlo_umac_ssr_kpi_stats_tlv kpi_tlv;
  10704. htt_stats_mlo_umac_ssr_mlo_tlv mlo_tlv;
  10705. htt_stats_mlo_umac_ssr_cmn_tlv cmn_tlv;
  10706. } htt_mlo_umac_ssr_stats_tlv;
  10707. #endif /* ATH_TARGET */
  10708. /*============= end MLO UMAC SSR stats ============= } */
  10709. typedef struct {
  10710. A_UINT32 total_done;
  10711. A_UINT32 trigger_requests_count;
  10712. A_UINT32 total_trig_dropped;
  10713. A_UINT32 umac_disengaged_count;
  10714. A_UINT32 umac_soft_reset_count;
  10715. A_UINT32 umac_engaged_count;
  10716. A_UINT32 last_trigger_request_ms;
  10717. A_UINT32 last_start_ms;
  10718. A_UINT32 last_start_disengage_umac_ms;
  10719. A_UINT32 last_enter_ssr_platform_thread_ms;
  10720. A_UINT32 last_exit_ssr_platform_thread_ms;
  10721. A_UINT32 last_start_engage_umac_ms;
  10722. A_UINT32 last_done_successful_ms;
  10723. A_UINT32 last_e2e_delta_ms;
  10724. A_UINT32 max_e2e_delta_ms;
  10725. A_UINT32 trigger_count_for_umac_hang;
  10726. A_UINT32 trigger_count_for_mlo_quick_ssr;
  10727. A_UINT32 trigger_count_for_unknown_signature;
  10728. A_UINT32 post_reset_tqm_sync_cmd_completion_ms;
  10729. A_UINT32 htt_sync_mlo_initiate_umac_recovery_ms;
  10730. A_UINT32 htt_sync_do_pre_reset_ms;
  10731. A_UINT32 htt_sync_do_post_reset_start_ms;
  10732. A_UINT32 htt_sync_do_post_reset_complete_ms;
  10733. } htt_umac_ssr_stats_t;
  10734. typedef struct {
  10735. htt_tlv_hdr_t tlv_hdr;
  10736. htt_umac_ssr_stats_t stats;
  10737. } htt_stats_umac_ssr_tlv;
  10738. /* preserve old name alias for new name consistent with the tag name */
  10739. typedef htt_stats_umac_ssr_tlv htt_umac_ssr_stats_tlv;
  10740. typedef struct {
  10741. htt_tlv_hdr_t tlv_hdr;
  10742. A_UINT32 svc_class_id;
  10743. /* codel_drops:
  10744. * How many times have MSDU queues belonging to this service class
  10745. * dropped their head MSDU due to the queue's latency being above
  10746. * the CoDel latency limit specified for the service class throughout
  10747. * the full CoDel latency statistics collection window.
  10748. */
  10749. A_UINT32 codel_drops;
  10750. /* codel_no_drops:
  10751. * How many times have MSDU queues belonging to this service class
  10752. * completed a CoDel latency statistics collection window and
  10753. * concluded that no head MSDU drop is needed, due to the MSDU queue's
  10754. * latency being under the limit specified for the service class at
  10755. * some point during the window.
  10756. */
  10757. A_UINT32 codel_no_drops;
  10758. } htt_stats_codel_svc_class_tlv;
  10759. /* preserve old name alias for new name consistent with the tag name */
  10760. typedef htt_stats_codel_svc_class_tlv htt_codel_svc_class_stats_tlv;
  10761. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_M 0x0000FFFF
  10762. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S 0
  10763. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_GET(_var) \
  10764. (((_var) & HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_M) >> \
  10765. HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S)
  10766. #define HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_SET(_var, _val) \
  10767. do { \
  10768. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM, _val); \
  10769. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_TX_FLOW_NUM_S)); \
  10770. } while (0)
  10771. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_M 0x00FF0000
  10772. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S 16
  10773. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_GET(_var) \
  10774. (((_var) & HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_M) >> \
  10775. HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S)
  10776. #define HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_SET(_var, _val) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID, _val); \
  10779. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_SVC_CLASS_ID_S)); \
  10780. } while (0)
  10781. #define HTT_CODEL_MSDUQ_STATS_DROPS_M 0x0000FFFF
  10782. #define HTT_CODEL_MSDUQ_STATS_DROPS_S 0
  10783. #define HTT_CODEL_MSDUQ_STATS_DROPS_GET(_var) \
  10784. (((_var) & HTT_CODEL_MSDUQ_STATS_DROPS_M) >> \
  10785. HTT_CODEL_MSDUQ_STATS_DROPS_S)
  10786. #define HTT_CODEL_MSDUQ_STATS_DROPS_SET(_var, _val) \
  10787. do { \
  10788. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_DROPS, _val); \
  10789. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_DROPS_S)); \
  10790. } while (0)
  10791. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_M 0xFFFF0000
  10792. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_S 16
  10793. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_GET(_var) \
  10794. (((_var) & HTT_CODEL_MSDUQ_STATS_NO_DROPS_M) >> \
  10795. HTT_CODEL_MSDUQ_STATS_NO_DROPS_S)
  10796. #define HTT_CODEL_MSDUQ_STATS_NO_DROPS_SET(_var, _val) \
  10797. do { \
  10798. HTT_CHECK_SET_VAL(HTT_CODEL_MSDUQ_STATS_NO_DROPS, _val); \
  10799. ((_var) |= ((_val) << HTT_CODEL_MSDUQ_STATS_NO_DROPS_S)); \
  10800. } while (0)
  10801. typedef struct {
  10802. htt_tlv_hdr_t tlv_hdr;
  10803. union {
  10804. A_UINT32 id__word;
  10805. struct {
  10806. A_UINT32 tx_flow_num: 16, /* FW's MSDU queue ID */
  10807. svc_class_id: 8,
  10808. reserved: 8;
  10809. };
  10810. };
  10811. union {
  10812. A_UINT32 stats__word;
  10813. struct {
  10814. A_UINT32
  10815. codel_drops: 16,
  10816. codel_no_drops: 16;
  10817. };
  10818. };
  10819. } htt_stats_codel_msduq_tlv;
  10820. /* preserve old name alias for new name consistent with the tag name */
  10821. typedef htt_stats_codel_msduq_tlv htt_codel_msduq_stats_tlv;
  10822. /*===================== start MLO stats ====================*/
  10823. typedef struct {
  10824. htt_tlv_hdr_t tlv_hdr;
  10825. A_UINT32 pref_link_num_sec_link_sched;
  10826. A_UINT32 pref_link_num_pref_link_timeout;
  10827. A_UINT32 pref_link_num_pref_link_sch_delay_ipc;
  10828. A_UINT32 pref_link_num_pref_link_timeout_ipc;
  10829. } htt_stats_mlo_sched_stats_tlv;
  10830. /* preserve old name alias for new name consistent with the tag name */
  10831. typedef htt_stats_mlo_sched_stats_tlv htt_mlo_sched_stats_tlv;
  10832. /* STATS_TYPE : HTT_DBG_MLO_SCHED_STATS
  10833. * TLV_TAGS:
  10834. * - HTT_STATS_MLO_SCHED_STATS_TAG
  10835. */
  10836. /* NOTE:
  10837. * This structure is for documentation, and cannot be safely used directly.
  10838. * Instead, use the constituent TLV structures to fill/parse.
  10839. */
  10840. #ifdef ATH_TARGET
  10841. typedef struct _htt_mlo_sched_stats {
  10842. htt_stats_mlo_sched_stats_tlv preferred_link_stats;
  10843. } htt_mlo_sched_stats_t;
  10844. #endif /* ATH_TARGET */
  10845. #define HTT_STATS_HWMLO_MAX_LINKS 6
  10846. #define HTT_STATS_MLO_MAX_IPC_RINGS 7
  10847. typedef struct {
  10848. htt_tlv_hdr_t tlv_hdr;
  10849. A_UINT32 mlo_ipc_ring_full_cnt[HTT_STATS_HWMLO_MAX_LINKS][HTT_STATS_MLO_MAX_IPC_RINGS];
  10850. } htt_stats_pdev_mlo_ipc_stats_tlv;
  10851. /* preserve old name alias for new name consistent with the tag name */
  10852. typedef htt_stats_pdev_mlo_ipc_stats_tlv htt_pdev_mlo_ipc_stats_tlv;
  10853. /* STATS_TYPE : HTT_DBG_MLO_IPC_STATS
  10854. * TLV_TAGS:
  10855. * - HTT_STATS_PDEV_MLO_IPC_STATS_TAG
  10856. */
  10857. /* NOTE:
  10858. * This structure is for documentation, and cannot be safely used directly.
  10859. * Instead, use the constituent TLV structures to fill/parse.
  10860. */
  10861. #ifdef ATH_TARGET
  10862. typedef struct _htt_mlo_ipc_stats {
  10863. htt_stats_pdev_mlo_ipc_stats_tlv mlo_ipc_stats;
  10864. } htt_pdev_mlo_ipc_stats_t;
  10865. #endif /* ATH_TARGET */
  10866. /*===================== end MLO stats ======================*/
  10867. typedef enum {
  10868. HTT_CTRL_PATH_STATS_CAL_TYPE_ADC = 0x0,
  10869. HTT_CTRL_PATH_STATS_CAL_TYPE_DAC = 0x1,
  10870. HTT_CTRL_PATH_STATS_CAL_TYPE_PROCESS = 0x2,
  10871. HTT_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR = 0x3,
  10872. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO = 0x4,
  10873. HTT_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ = 0x5,
  10874. HTT_CTRL_PATH_STATS_CAL_TYPE_TXLO = 0x6,
  10875. HTT_CTRL_PATH_STATS_CAL_TYPE_TXIQ = 0x7,
  10876. HTT_CTRL_PATH_STATS_CAL_TYPE_RXIQ = 0x8,
  10877. HTT_CTRL_PATH_STATS_CAL_TYPE_IM2 = 0x9,
  10878. HTT_CTRL_PATH_STATS_CAL_TYPE_LNA = 0xa,
  10879. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO = 0xb,
  10880. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ = 0xc,
  10881. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS = 0xd,
  10882. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY = 0xe,
  10883. HTT_CTRL_PATH_STATS_CAL_TYPE_IBF = 0xf,
  10884. HTT_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL = 0x10,
  10885. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ = 0x11,
  10886. HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM = 0x12,
  10887. HTT_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL = 0x13,
  10888. HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ = 0x14,
  10889. HTT_CTRL_PATH_STATS_CAL_TYPE_BWFILTER = 0x15,
  10890. HTT_CTRL_PATH_STATS_CAL_TYPE_PEF = 0x16,
  10891. HTT_CTRL_PATH_STATS_CAL_TYPE_PADROOP = 0x17,
  10892. HTT_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC = 0x18,
  10893. HTT_CTRL_PATH_STATS_CAL_TYPE_RXSPUR = 0x19,
  10894. /* add new cal types above this line */
  10895. HTT_CTRL_PATH_STATS_CAL_TYPE_INVALID = 0xFF
  10896. } htt_ctrl_path_stats_cal_type_ids;
  10897. #define HTT_RETURN_STRING(str) case ((str)): return (A_UINT8 *)(# str);
  10898. #define HTT_GET_BITS(_val, _index, _num_bits) \
  10899. (((_val) >> (_index)) & ((1 << (_num_bits)) - 1))
  10900. #define HTT_CTRL_PATH_CALIBRATION_STATS_CAL_TYPE_GET(cal_info) \
  10901. HTT_GET_BITS(cal_info, 0, 8)
  10902. /*
  10903. * Used by some hosts to print names of cal type, based on
  10904. * htt_ctrl_path_cal_type_ids values specified in
  10905. * htt_ctrl_path_calibration_stats_struct in ctrl_path_stats event msg.
  10906. */
  10907. #ifdef HTT_CTRL_PATH_STATS_CAL_TYPE_STRINGS
  10908. static INLINE A_UINT8 *htt_ctrl_path_cal_type_id_to_name(A_UINT32 cal_type_id)
  10909. {
  10910. switch (cal_type_id)
  10911. {
  10912. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_ADC);
  10913. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DAC);
  10914. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PROCESS);
  10915. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_NOISE_FLOOR);
  10916. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO);
  10917. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_COMB_TXLO_TXIQ_RXIQ);
  10918. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TXLO);
  10919. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TXIQ);
  10920. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXIQ);
  10921. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_IM2);
  10922. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_LNA);
  10923. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXDCO);
  10924. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_LP_RXIQ);
  10925. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORYLESS);
  10926. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_MEMORY);
  10927. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_IBF);
  10928. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PDET_AND_PAL);
  10929. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_IQ);
  10930. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXDCO_DTIM);
  10931. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_TPC_CAL);
  10932. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_DPD_TIMEREQ);
  10933. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_BWFILTER);
  10934. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PEF);
  10935. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_PADROOP);
  10936. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_SELFCALTPC);
  10937. HTT_RETURN_STRING(HTT_CTRL_PATH_STATS_CAL_TYPE_RXSPUR);
  10938. }
  10939. return (A_UINT8 *) "HTT_CTRL_PATH_STATS_CAL_TYPE_UNKNOWN";
  10940. }
  10941. #endif /* HTT_CTRL_PATH_STATS_CAL_TYPE_STRINGS */
  10942. /*===================== Start GTX stats ====================*/
  10943. #define HTT_NUM_MCS_PER_NSS 16
  10944. typedef struct {
  10945. htt_tlv_hdr_t tlv_hdr;
  10946. A_UINT32 gtx_enabled; /* shows whether Green Tx feature is enabled */
  10947. A_INT32 mcs_tpc_min[HTT_NUM_MCS_PER_NSS]; /* shows current MCS's minimum TPC in 0.25dBm units */
  10948. A_INT32 mcs_tpc_max[HTT_NUM_MCS_PER_NSS]; /* shows current MCS's maximum TPC in 0.25dBm units */
  10949. A_UINT32 mcs_tpc_diff[HTT_NUM_MCS_PER_NSS]; /* shows current MCS's difference between maximum and minimum TPC in 0.25dB unit*/
  10950. } htt_stats_gtx_tlv;
  10951. /*===================== End GTX stats ====================*/
  10952. #endif /* __HTT_STATS_H__ */