htt_stats.h 237 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file htt_stats.h
  20. *
  21. * @details the public header file of HTT STATS
  22. */
  23. #ifndef __HTT_STATS_H__
  24. #define __HTT_STATS_H__
  25. #include <htt_deps.h> /* A_UINT32 */
  26. #include <htt_common.h>
  27. #include <htt.h> /* HTT stats TLV struct def and tag defs */
  28. /*
  29. * htt_dbg_ext_stats_type -
  30. * The base structure for each of the stats_type is only for reference
  31. * Host should use this information to know the type of TLVs to expect
  32. * for a particular stats type.
  33. *
  34. * Max supported stats :- 256.
  35. */
  36. enum htt_dbg_ext_stats_type {
  37. /* HTT_DBG_EXT_STATS_RESET
  38. * PARAM:
  39. * - config_param0 : start_offset (stats type)
  40. * - config_param1 : stats bmask from start offset
  41. * - config_param2 : stats bmask from start offset + 32
  42. * - config_param3 : stats bmask from start offset + 64
  43. * RESP MSG:
  44. * - No response sent.
  45. */
  46. HTT_DBG_EXT_STATS_RESET = 0,
  47. /* HTT_DBG_EXT_STATS_PDEV_TX
  48. * PARAMS:
  49. * - No Params
  50. * RESP MSG:
  51. * - htt_tx_pdev_stats_t
  52. */
  53. HTT_DBG_EXT_STATS_PDEV_TX = 1,
  54. /* HTT_DBG_EXT_STATS_PDEV_RX
  55. * PARAMS:
  56. * - No Params
  57. * RESP MSG:
  58. * - htt_rx_pdev_stats_t
  59. */
  60. HTT_DBG_EXT_STATS_PDEV_RX = 2,
  61. /* HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  62. * PARAMS:
  63. * - config_param0: [Bit31: Bit0] HWQ mask
  64. * RESP MSG:
  65. * - htt_tx_hwq_stats_t
  66. */
  67. HTT_DBG_EXT_STATS_PDEV_TX_HWQ = 3,
  68. /* HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  69. * PARAMS:
  70. * - config_param0: [Bit31: Bit0] TXQ mask
  71. * RESP MSG:
  72. * - htt_stats_tx_sched_t
  73. */
  74. HTT_DBG_EXT_STATS_PDEV_TX_SCHED = 4,
  75. /* HTT_DBG_EXT_STATS_PDEV_ERROR
  76. * PARAMS:
  77. * - No Params
  78. * RESP MSG:
  79. * - htt_hw_err_stats_t
  80. */
  81. HTT_DBG_EXT_STATS_PDEV_ERROR = 5,
  82. /* HTT_DBG_EXT_STATS_PDEV_TQM
  83. * PARAMS:
  84. * - No Params
  85. * RESP MSG:
  86. * - htt_tx_tqm_pdev_stats_t
  87. */
  88. HTT_DBG_EXT_STATS_PDEV_TQM = 6,
  89. /* HTT_DBG_EXT_STATS_TQM_CMDQ
  90. * PARAMS:
  91. * - config_param0:
  92. * [Bit15: Bit0 ] cmdq id :if 0xFFFF print all cmdq's
  93. * [Bit31: Bit16] reserved
  94. * RESP MSG:
  95. * - htt_tx_tqm_cmdq_stats_t
  96. */
  97. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  98. /* HTT_DBG_EXT_STATS_TX_DE_INFO
  99. * PARAMS:
  100. * - No Params
  101. * RESP MSG:
  102. * - htt_tx_de_stats_t
  103. */
  104. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  105. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE
  106. * PARAMS:
  107. * - No Params
  108. * RESP MSG:
  109. * - htt_tx_pdev_rate_stats_t
  110. */
  111. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  112. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE
  113. * PARAMS:
  114. * - No Params
  115. * RESP MSG:
  116. * - htt_rx_pdev_rate_stats_t
  117. */
  118. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  119. /* HTT_DBG_EXT_STATS_PEER_INFO
  120. * PARAMS:
  121. * - config_param0:
  122. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  123. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  124. * [Bit31 : Bit16] sw_peer_id
  125. * config_param1:
  126. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  127. * 0 bit htt_peer_stats_cmn_tlv
  128. * 1 bit htt_peer_details_tlv
  129. * 2 bit htt_tx_peer_rate_stats_tlv
  130. * 3 bit htt_rx_peer_rate_stats_tlv
  131. * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv
  132. * 5 bit htt_rx_tid_stats_tlv
  133. * 6 bit htt_msdu_flow_stats_tlv
  134. * 7 bit htt_peer_sched_stats_tlv
  135. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  136. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  137. * [Bit 16] If this bit is set, reset per peer stats
  138. * of corresponding tlv indicated by config
  139. * param 1.
  140. * HTT_DBG_EXT_PEER_STATS_RESET_GET will be
  141. * used to get this bit position.
  142. * WMI_SERVICE_PER_PEER_HTT_STATS_RESET
  143. * indicates that FW supports per peer HTT
  144. * stats reset.
  145. * [Bit31 : Bit17] reserved
  146. * RESP MSG:
  147. * - htt_peer_stats_t
  148. */
  149. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  150. /* HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  151. * PARAMS:
  152. * - No Params
  153. * RESP MSG:
  154. * - htt_tx_pdev_selfgen_stats_t
  155. */
  156. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  157. /* HTT_DBG_EXT_STATS_TX_MU_HWQ
  158. * PARAMS:
  159. * - config_param0: [Bit31: Bit0] HWQ mask
  160. * RESP MSG:
  161. * - htt_tx_hwq_mu_mimo_stats_t
  162. */
  163. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  164. /* HTT_DBG_EXT_STATS_RING_IF_INFO
  165. * PARAMS:
  166. * - config_param0:
  167. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  168. * [Bit31: Bit16] reserved
  169. * RESP MSG:
  170. * - htt_ring_if_stats_t
  171. */
  172. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  173. /* HTT_DBG_EXT_STATS_SRNG_INFO
  174. * PARAMS:
  175. * - config_param0:
  176. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  177. * [Bit31: Bit16] reserved
  178. * - No Params
  179. * RESP MSG:
  180. * - htt_sring_stats_t
  181. */
  182. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  183. /* HTT_DBG_EXT_STATS_SFM_INFO
  184. * PARAMS:
  185. * - No Params
  186. * RESP MSG:
  187. * - htt_sfm_stats_t
  188. */
  189. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  190. /* HTT_DBG_EXT_STATS_PDEV_TX_MU
  191. * PARAMS:
  192. * - No Params
  193. * RESP MSG:
  194. * - htt_tx_pdev_mu_mimo_stats_t
  195. */
  196. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  197. /* HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  198. * PARAMS:
  199. * - config_param0:
  200. * [Bit7 : Bit0] vdev_id:8
  201. * note:0xFF to get all active peers based on pdev_mask.
  202. * [Bit31 : Bit8] rsvd:24
  203. * RESP MSG:
  204. * - htt_active_peer_details_list_t
  205. */
  206. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  207. /* HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  208. * PARAMS:
  209. * - config_param0:
  210. * [Bit0] - Clear bit0 to read 1sec,100ms & cumulative CCA stats.
  211. * Set bit0 to 1 to read 1sec interval histogram.
  212. * [Bit1] - 100ms interval histogram
  213. * [Bit3] - Cumulative CCA stats
  214. * RESP MSG:
  215. * - htt_pdev_cca_stats_t
  216. */
  217. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  218. /* HTT_DBG_EXT_STATS_TWT_SESSIONS
  219. * PARAMS:
  220. * - config_param0:
  221. * No params
  222. * RESP MSG:
  223. * - htt_pdev_twt_sessions_stats_t
  224. */
  225. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  226. /* HTT_DBG_EXT_STATS_REO_CNTS
  227. * PARAMS:
  228. * - config_param0:
  229. * No params
  230. * RESP MSG:
  231. * - htt_soc_reo_resource_stats_t
  232. */
  233. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  234. /* HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  235. * PARAMS:
  236. * - config_param0:
  237. * [Bit0] vdev_id_set:1
  238. * set to 1 if vdev_id is set and vdev stats are requested.
  239. * set to 0 if pdev_stats sounding stats are requested.
  240. * [Bit8 : Bit1] vdev_id:8
  241. * note:0xFF to get all active vdevs based on pdev_mask.
  242. * [Bit31 : Bit9] rsvd:22
  243. *
  244. * RESP MSG:
  245. * - htt_tx_sounding_stats_t
  246. */
  247. HTT_DBG_EXT_STATS_TX_SOUNDING_INFO = 22,
  248. /* HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS
  249. * PARAMS:
  250. * - config_param0:
  251. * No params
  252. * RESP MSG:
  253. * - htt_pdev_obss_pd_stats_t
  254. */
  255. HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
  256. /* HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS
  257. * PARAMS:
  258. * - config_param0:
  259. * No params
  260. * RESP MSG:
  261. * - htt_stats_ring_backpressure_stats_t
  262. */
  263. HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
  264. /* HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  265. * PARAMS:
  266. *
  267. * RESP MSG:
  268. * - htt_soc_latency_prof_t
  269. */
  270. HTT_DBG_EXT_STATS_LATENCY_PROF_STATS = 25,
  271. /* HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  272. * PARAMS:
  273. * - No Params
  274. * RESP MSG:
  275. * - htt_rx_pdev_ul_trig_stats_t
  276. */
  277. HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS = 26,
  278. /* HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27
  279. * PARAMS:
  280. * - No Params
  281. * RESP MSG:
  282. * - htt_rx_pdev_ul_mumimo_trig_stats_t
  283. */
  284. HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27,
  285. /* HTT_DBG_EXT_STATS_FSE_RX
  286. * PARAMS:
  287. * - No Params
  288. * RESP MSG:
  289. * - htt_rx_fse_stats_t
  290. */
  291. HTT_DBG_EXT_STATS_FSE_RX = 28,
  292. /* HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  293. * PARAMS:
  294. * - config_param0: [Bit0] : [1] for mac_addr based request
  295. * - config_param1: [Bit31 : Bit0] mac_addr31to0
  296. * - config_param2: [Bit15 : Bit0] mac_addr47to32
  297. * RESP MSG:
  298. * - htt_ctrl_path_txrx_stats_t
  299. */
  300. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS = 29,
  301. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  302. * PARAMS:
  303. * - No Params
  304. * RESP MSG:
  305. * - htt_rx_pdev_rate_ext_stats_t
  306. */
  307. HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT = 30,
  308. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF
  309. * PARAMS:
  310. * - No Params
  311. * RESP MSG:
  312. * - htt_tx_pdev_txbf_rate_stats_t
  313. */
  314. HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF = 31,
  315. /* HTT_DBG_EXT_STATS_TXBF_OFDMA
  316. */
  317. HTT_DBG_EXT_STATS_TXBF_OFDMA = 32,
  318. /* HTT_DBG_EXT_STA_11AX_UL_STATS
  319. * PARAMS:
  320. * - No Params
  321. * RESP MSG:
  322. * - htt_sta_11ax_ul_stats
  323. */
  324. HTT_DBG_EXT_STA_11AX_UL_STATS = 33,
  325. /* HTT_DBG_EXT_VDEV_RTT_RESP_STATS
  326. * PARAMS:
  327. * - config_param0:
  328. * [Bit7 : Bit0] vdev_id:8
  329. * [Bit31 : Bit8] rsvd:24
  330. * RESP MSG:
  331. * -
  332. */
  333. HTT_DBG_EXT_VDEV_RTT_RESP_STATS = 34,
  334. /* HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  335. * PARAMS:
  336. * - No Params
  337. * RESP MSG:
  338. * - htt_pktlog_and_htt_ring_stats_t
  339. */
  340. HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS = 35,
  341. /* HTT_DBG_EXT_STATS_DLPAGER_STATS
  342. * PARAMS:
  343. *
  344. * RESP MSG:
  345. * - htt_dlpager_stats_t
  346. */
  347. HTT_DBG_EXT_STATS_DLPAGER_STATS = 36,
  348. /* HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  349. * PARAMS:
  350. * - No Params
  351. * RESP MSG:
  352. * - htt_phy_counters_and_phy_stats_t
  353. */
  354. HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
  355. /* HTT_DBG_EXT_VDEVS_TXRX_STATS
  356. * PARAMS:
  357. * - No Params
  358. * RESP MSG:
  359. * - htt_vdevs_txrx_stats_t
  360. */
  361. HTT_DBG_EXT_VDEVS_TXRX_STATS = 38,
  362. HTT_DBG_EXT_VDEV_RTT_INITIATOR_STATS = 39,
  363. /* HTT_DBG_EXT_PDEV_PER_STATS
  364. * PARAMS:
  365. * - No Params
  366. * RESP MSG:
  367. * - htt_tx_pdev_per_stats_t
  368. */
  369. HTT_DBG_EXT_PDEV_PER_STATS = 40,
  370. HTT_DBG_EXT_AST_ENTRIES = 41,
  371. /* keep this last */
  372. HTT_DBG_NUM_EXT_STATS = 256,
  373. };
  374. /*
  375. * Macros to get/set the bit field in config param[3] that indicates to
  376. * clear corresponding per peer stats specified by config param 1
  377. */
  378. #define HTT_DBG_EXT_PEER_STATS_RESET_M 0x00010000
  379. #define HTT_DBG_EXT_PEER_STATS_RESET_S 16
  380. #define HTT_DBG_EXT_PEER_STATS_RESET_GET(_var) \
  381. (((_var) & HTT_DBG_EXT_PEER_STATS_RESET_M) >> \
  382. HTT_DBG_EXT_PEER_STATS_RESET_S)
  383. #define HTT_DBG_EXT_PEER_STATS_RESET_SET(_var, _val) \
  384. do { \
  385. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_STATS_RESET, _val); \
  386. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_STATS_RESET_S)); \
  387. } while (0)
  388. #define HTT_STATS_SUBTYPE_MAX 16
  389. /* htt_mu_stats_upload_t
  390. * Enumerations for specifying whether to upload all MU stats in response to
  391. * HTT_DBG_EXT_STATS_PDEV_TX_MU, or if not all, then which subset.
  392. */
  393. typedef enum {
  394. /* HTT_UPLOAD_MU_STATS: upload all MU stats:
  395. * UL MU-MIMO + DL MU-MIMO + UL MU-OFDMA + DL MU-OFDMA
  396. * (note: included OFDMA stats are limited to 11ax)
  397. */
  398. HTT_UPLOAD_MU_STATS,
  399. /* HTT_UPLOAD_MU_MIMO_STATS: upload UL MU-MIMO + DL MU-MIMO stats */
  400. HTT_UPLOAD_MU_MIMO_STATS,
  401. /* HTT_UPLOAD_MU_OFDMA_STATS:
  402. * upload UL MU-OFDMA + DL MU-OFDMA stats (note: 11ax only stats)
  403. */
  404. HTT_UPLOAD_MU_OFDMA_STATS,
  405. HTT_UPLOAD_DL_MU_MIMO_STATS,
  406. HTT_UPLOAD_UL_MU_MIMO_STATS,
  407. /* HTT_UPLOAD_DL_MU_OFDMA_STATS:
  408. * upload DL MU-OFDMA stats (note: 11ax only stats)
  409. */
  410. HTT_UPLOAD_DL_MU_OFDMA_STATS,
  411. /* HTT_UPLOAD_UL_MU_OFDMA_STATS:
  412. * upload UL MU-OFDMA stats (note: 11ax only stats)
  413. */
  414. HTT_UPLOAD_UL_MU_OFDMA_STATS,
  415. /*
  416. * Upload BE UL MU-OFDMA + BE DL MU-OFDMA stats,
  417. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv and
  418. * htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  419. */
  420. HTT_UPLOAD_BE_MU_OFDMA_STATS,
  421. /*
  422. * Upload BE DL MU-OFDMA
  423. * TLV: htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv
  424. */
  425. HTT_UPLOAD_BE_DL_MU_OFDMA_STATS,
  426. /*
  427. * Upload BE UL MU-OFDMA
  428. * TLV: htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv
  429. */
  430. HTT_UPLOAD_BE_UL_MU_OFDMA_STATS,
  431. } htt_mu_stats_upload_t;
  432. /* htt_tx_rate_stats_upload_t
  433. * Enumerations for specifying which stats to upload in response to
  434. * HTT_DBG_EXT_STATS_PDEV_TX_RATE.
  435. */
  436. typedef enum {
  437. /* 11abgn, 11ac, and 11ax TX stats, and a few 11be SU stats
  438. *
  439. * TLV: htt_tx_pdev_rate_stats_tlv
  440. */
  441. HTT_TX_RATE_STATS_DEFAULT,
  442. /*
  443. * Upload 11be OFDMA TX stats
  444. *
  445. * TLV: htt_tx_pdev_rate_stats_be_ofdma_tlv
  446. */
  447. HTT_TX_RATE_STATS_UPLOAD_11BE_OFDMA,
  448. } htt_tx_rate_stats_upload_t;
  449. #define HTT_STATS_MAX_STRING_SZ32 4
  450. #define HTT_STATS_MACID_INVALID 0xff
  451. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  452. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  453. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  454. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  455. typedef enum {
  456. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  457. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  458. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  459. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  460. } htt_tx_pdev_underrun_enum;
  461. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 150
  462. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  463. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  464. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  465. /* HTT_TX_PDEV_SCHED_TX_MODE_MAX:
  466. * DEPRECATED - num sched tx mode max is 8
  467. */
  468. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  469. #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  470. #define HTT_RX_STATS_REFILL_MAX_RING 4
  471. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  472. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  473. /* Bytes stored in little endian order */
  474. /* Length should be multiple of DWORD */
  475. typedef struct {
  476. htt_tlv_hdr_t tlv_hdr;
  477. A_UINT32 data[1]; /* Can be variable length */
  478. } htt_stats_string_tlv;
  479. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  480. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  481. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  482. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  483. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  484. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  485. do { \
  486. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  487. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  488. } while (0)
  489. /* == TX PDEV STATS == */
  490. typedef struct {
  491. htt_tlv_hdr_t tlv_hdr;
  492. /* BIT [ 7 : 0] :- mac_id
  493. * BIT [31 : 8] :- reserved
  494. */
  495. A_UINT32 mac_id__word;
  496. /* Num queued to HW */
  497. A_UINT32 hw_queued;
  498. /* Num PPDU reaped from HW */
  499. A_UINT32 hw_reaped;
  500. /* Num underruns */
  501. A_UINT32 underrun;
  502. /* Num HW Paused counter. */
  503. A_UINT32 hw_paused;
  504. /* Num HW flush counter. */
  505. A_UINT32 hw_flush;
  506. /* Num HW filtered counter. */
  507. A_UINT32 hw_filt;
  508. /* Num PPDUs cleaned up in TX abort */
  509. A_UINT32 tx_abort;
  510. /* Num MPDUs requed by SW */
  511. A_UINT32 mpdu_requed;
  512. /* excessive retries */
  513. A_UINT32 tx_xretry;
  514. /* Last used data hw rate code */
  515. A_UINT32 data_rc;
  516. /* frames dropped due to excessive sw retries */
  517. A_UINT32 mpdu_dropped_xretry;
  518. /* illegal rate phy errors */
  519. A_UINT32 illgl_rate_phy_err;
  520. /* wal pdev continous xretry */
  521. A_UINT32 cont_xretry;
  522. /* wal pdev tx timeout */
  523. A_UINT32 tx_timeout;
  524. /* wal pdev resets */
  525. A_UINT32 pdev_resets;
  526. /* PhY/BB underrun */
  527. A_UINT32 phy_underrun;
  528. /* MPDU is more than txop limit */
  529. A_UINT32 txop_ovf;
  530. /* Number of Sequences posted */
  531. A_UINT32 seq_posted;
  532. /* Number of Sequences failed queueing */
  533. A_UINT32 seq_failed_queueing;
  534. /* Number of Sequences completed */
  535. A_UINT32 seq_completed;
  536. /* Number of Sequences restarted */
  537. A_UINT32 seq_restarted;
  538. /* Number of MU Sequences posted */
  539. A_UINT32 mu_seq_posted;
  540. /* Number of time HW ring is paused between seq switch within ISR */
  541. A_UINT32 seq_switch_hw_paused;
  542. /* Number of times seq continuation in DSR */
  543. A_UINT32 next_seq_posted_dsr;
  544. /* Number of times seq continuation in ISR */
  545. A_UINT32 seq_posted_isr;
  546. /* Number of seq_ctrl cached. */
  547. A_UINT32 seq_ctrl_cached;
  548. /* Number of MPDUs successfully transmitted */
  549. A_UINT32 mpdu_count_tqm;
  550. /* Number of MSDUs successfully transmitted */
  551. A_UINT32 msdu_count_tqm;
  552. /* Number of MPDUs dropped */
  553. A_UINT32 mpdu_removed_tqm;
  554. /* Number of MSDUs dropped */
  555. A_UINT32 msdu_removed_tqm;
  556. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  557. A_UINT32 mpdus_sw_flush;
  558. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  559. A_UINT32 mpdus_hw_filter;
  560. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  561. A_UINT32 mpdus_truncated;
  562. /* Num MPDUs that was tried but didn't receive ACK or BA */
  563. A_UINT32 mpdus_ack_failed;
  564. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  565. A_UINT32 mpdus_expired;
  566. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  567. A_UINT32 mpdus_seq_hw_retry;
  568. /* Num of TQM acked cmds processed */
  569. A_UINT32 ack_tlv_proc;
  570. /* coex_abort_mpdu_cnt valid. */
  571. A_UINT32 coex_abort_mpdu_cnt_valid;
  572. /* coex_abort_mpdu_cnt from TX FES stats. */
  573. A_UINT32 coex_abort_mpdu_cnt;
  574. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  575. A_UINT32 num_total_ppdus_tried_ota;
  576. /* Number of data PPDUs tried over the air (OTA) */
  577. A_UINT32 num_data_ppdus_tried_ota;
  578. /* Num Local control/mgmt frames (MSDUs) queued */
  579. A_UINT32 local_ctrl_mgmt_enqued;
  580. /* local_ctrl_mgmt_freed:
  581. * Num Local control/mgmt frames (MSDUs) done
  582. * It includes all local ctrl/mgmt completions
  583. * (acked, no ack, flush, TTL, etc)
  584. */
  585. A_UINT32 local_ctrl_mgmt_freed;
  586. /* Num Local data frames (MSDUs) queued */
  587. A_UINT32 local_data_enqued;
  588. /* local_data_freed:
  589. * Num Local data frames (MSDUs) done
  590. * It includes all local data completions
  591. * (acked, no ack, flush, TTL, etc)
  592. */
  593. A_UINT32 local_data_freed;
  594. /* Num MPDUs tried by SW */
  595. A_UINT32 mpdu_tried;
  596. /* Num of waiting seq posted in isr completion handler */
  597. A_UINT32 isr_wait_seq_posted;
  598. A_UINT32 tx_active_dur_us_low;
  599. A_UINT32 tx_active_dur_us_high;
  600. /* Number of MPDUs dropped after max retries */
  601. A_UINT32 remove_mpdus_max_retries;
  602. /* Num HTT cookies dispatched */
  603. A_UINT32 comp_delivered;
  604. /* successful ppdu transmissions */
  605. A_UINT32 ppdu_ok;
  606. /* Scheduler self triggers */
  607. A_UINT32 self_triggers;
  608. /* FES duration of last tx data PPDU in us (sch_eval_end - ppdu_start) */
  609. A_UINT32 tx_time_dur_data;
  610. /* Num of times sequence terminated due to ppdu duration < burst limit */
  611. A_UINT32 seq_qdepth_repost_stop;
  612. /* Num of times MU sequence terminated due to MSDUs reaching threshold */
  613. A_UINT32 mu_seq_min_msdu_repost_stop;
  614. /* Num of times SU sequence terminated due to MSDUs reaching threshold */
  615. A_UINT32 seq_min_msdu_repost_stop;
  616. /* Num of times sequence terminated due to no TXOP available */
  617. A_UINT32 seq_txop_repost_stop;
  618. /* Num of times the next sequence got cancelled */
  619. A_UINT32 next_seq_cancel;
  620. /* Num of times fes offset was misaligned */
  621. A_UINT32 fes_offsets_err_cnt;
  622. /* Num of times peer denylisted for MU-MIMO transmission */
  623. A_UINT32 num_mu_peer_blacklisted;
  624. /* Num of times mu_ofdma seq posted */
  625. A_UINT32 mu_ofdma_seq_posted;
  626. /* Num of times UL MU MIMO seq posted */
  627. A_UINT32 ul_mumimo_seq_posted;
  628. /* Num of times UL OFDMA seq posted */
  629. A_UINT32 ul_ofdma_seq_posted;
  630. /* Num of times Thermal module suspended scheduler */
  631. A_UINT32 thermal_suspend_cnt;
  632. /* Num of times DFS module suspended scheduler */
  633. A_UINT32 dfs_suspend_cnt;
  634. /* Num of times TX abort module suspended scheduler */
  635. A_UINT32 tx_abort_suspend_cnt;
  636. /* tgt_specific_opaque_txq_suspend_info:
  637. * This field is a target-specifc bit mask of suspended PPDU tx queues.
  638. * Since the bit mask definition is different for different targets,
  639. * this field is not meant for general use, but rather for debugging use.
  640. */
  641. A_UINT32 tgt_specific_opaque_txq_suspend_info;
  642. /* Last SCHEDULER suspend reason
  643. * 1 -> Thermal Module
  644. * 2 -> DFS Module
  645. * 3 -> Tx Abort Module
  646. */
  647. A_UINT32 last_suspend_reason;
  648. /* Num of dynamic mimo ps dlmumimo sequences posted */
  649. A_UINT32 num_dyn_mimo_ps_dlmumimo_sequences;
  650. /* Num of times su bf sequences are denylisted */
  651. A_UINT32 num_su_txbf_denylisted;
  652. } htt_tx_pdev_stats_cmn_tlv;
  653. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  654. /* NOTE: Variable length TLV, use length spec to infer array size */
  655. typedef struct {
  656. htt_tlv_hdr_t tlv_hdr;
  657. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  658. } htt_tx_pdev_stats_urrn_tlv_v;
  659. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  660. /* NOTE: Variable length TLV, use length spec to infer array size */
  661. typedef struct {
  662. htt_tlv_hdr_t tlv_hdr;
  663. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  664. } htt_tx_pdev_stats_flush_tlv_v;
  665. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  666. /* NOTE: Variable length TLV, use length spec to infer array size */
  667. typedef struct {
  668. htt_tlv_hdr_t tlv_hdr;
  669. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  670. } htt_tx_pdev_stats_sifs_tlv_v;
  671. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  672. /* NOTE: Variable length TLV, use length spec to infer array size */
  673. typedef struct {
  674. htt_tlv_hdr_t tlv_hdr;
  675. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  676. } htt_tx_pdev_stats_phy_err_tlv_v;
  677. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  678. /* NOTE: Variable length TLV, use length spec to infer array size */
  679. typedef struct {
  680. htt_tlv_hdr_t tlv_hdr;
  681. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  682. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  683. typedef struct {
  684. htt_tlv_hdr_t tlv_hdr;
  685. A_UINT32 num_data_ppdus_legacy_su;
  686. A_UINT32 num_data_ppdus_ac_su;
  687. A_UINT32 num_data_ppdus_ax_su;
  688. A_UINT32 num_data_ppdus_ac_su_txbf;
  689. A_UINT32 num_data_ppdus_ax_su_txbf;
  690. } htt_tx_pdev_stats_tx_ppdu_stats_tlv_v;
  691. typedef enum {
  692. HTT_TX_WAL_ISR_SCHED_SUCCESS,
  693. HTT_TX_WAL_ISR_SCHED_FILTER,
  694. HTT_TX_WAL_ISR_SCHED_RESP_TIMEOUT,
  695. HTT_TX_WAL_ISR_SCHED_RATES_EXHAUSTED,
  696. HTT_TX_WAL_ISR_SCHED_DATA_EXHAUSTED,
  697. HTT_TX_WAL_ISR_SCHED_SEQ_ABORT,
  698. HTT_TX_WAL_ISR_SCHED_NOTIFY_FRAME_ENCOUNTERED,
  699. HTT_TX_WAL_ISR_SCHED_COMPLETION,
  700. HTT_TX_WAL_ISR_SCHED_IN_PROGRESS,
  701. } htt_tx_wal_tx_isr_sched_status;
  702. /* [0]- nr4 , [1]- nr8 */
  703. #define HTT_STATS_NUM_NR_BINS 2
  704. /* Termination status stated in htt_tx_wal_tx_isr_sched_status */
  705. #define HTT_STATS_MAX_NUM_SCHED_STATUS 9
  706. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST 10
  707. #define HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS \
  708. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_SCHED_STATUS)
  709. #define HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS \
  710. (HTT_STATS_NUM_NR_BINS * HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST)
  711. typedef enum {
  712. HTT_STATS_HWMODE_AC = 0,
  713. HTT_STATS_HWMODE_AX = 1,
  714. HTT_STATS_HWMODE_BE = 2,
  715. } htt_stats_hw_mode;
  716. typedef struct {
  717. htt_tlv_hdr_t tlv_hdr;
  718. A_UINT32 hw_mode; /* HTT_STATS_HWMODE_xx */
  719. A_UINT32 mu_mimo_num_seq_term_status[HTT_STATS_MAX_NUM_SCHED_STATUS_WORDS];
  720. A_UINT32 mu_mimo_num_ppdu_completed_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  721. A_UINT32 mu_mimo_num_seq_posted[HTT_STATS_NUM_NR_BINS];
  722. A_UINT32 mu_mimo_num_ppdu_posted_per_burst[HTT_STATS_MAX_NUM_MU_PPDU_PER_BURST_WORDS];
  723. } htt_pdev_mu_ppdu_dist_tlv_v;
  724. #define HTT_TX_PDEV_STATS_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  725. /* NOTE: Variable length TLV, use length spec to infer array size .
  726. *
  727. * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
  728. * The tries here is the count of the MPDUS within a PPDU that the
  729. * HW had attempted to transmit on air, for the HWSCH Schedule
  730. * command submitted by FW.It is not the retry attempts.
  731. * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
  732. * 10 bins in this histogram. They are defined in FW using the
  733. * following macros
  734. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  735. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  736. *
  737. */
  738. typedef struct {
  739. htt_tlv_hdr_t tlv_hdr;
  740. A_UINT32 hist_bin_size;
  741. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
  742. } htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v;
  743. typedef struct {
  744. htt_tlv_hdr_t tlv_hdr;
  745. /* Num MGMT MPDU transmitted by the target */
  746. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  747. } htt_pdev_ctrl_path_tx_stats_tlv_v;
  748. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  749. * TLV_TAGS:
  750. * - HTT_STATS_TX_PDEV_CMN_TAG
  751. * - HTT_STATS_TX_PDEV_URRN_TAG
  752. * - HTT_STATS_TX_PDEV_SIFS_TAG
  753. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  754. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  755. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  756. * - HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG
  757. * - HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG
  758. * - HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG
  759. * - HTT_STATS_MU_PPDU_DIST_TAG
  760. */
  761. /* NOTE:
  762. * This structure is for documentation, and cannot be safely used directly.
  763. * Instead, use the constituent TLV structures to fill/parse.
  764. */
  765. typedef struct _htt_tx_pdev_stats {
  766. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  767. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  768. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  769. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  770. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  771. htt_tx_pdev_stats_sifs_hist_tlv_v sifs_hist_tlv;
  772. htt_tx_pdev_stats_tx_ppdu_stats_tlv_v tx_su_tlv;
  773. htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v tried_mpdu_cnt_hist_tlv;
  774. htt_pdev_ctrl_path_tx_stats_tlv_v ctrl_path_tx_tlv;
  775. htt_pdev_mu_ppdu_dist_tlv_v mu_ppdu_dist_tlv;
  776. } htt_tx_pdev_stats_t;
  777. /* == SOC ERROR STATS == */
  778. /* =============== PDEV ERROR STATS ============== */
  779. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  780. typedef struct {
  781. htt_tlv_hdr_t tlv_hdr;
  782. /* Stored as little endian */
  783. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  784. A_UINT32 mask;
  785. A_UINT32 count;
  786. } htt_hw_stats_intr_misc_tlv;
  787. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  788. typedef struct {
  789. htt_tlv_hdr_t tlv_hdr;
  790. /* Stored as little endian */
  791. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  792. A_UINT32 count;
  793. } htt_hw_stats_wd_timeout_tlv;
  794. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  795. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  796. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  797. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  798. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  799. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  800. do { \
  801. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  802. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  803. } while (0)
  804. typedef struct {
  805. htt_tlv_hdr_t tlv_hdr;
  806. /* BIT [ 7 : 0] :- mac_id
  807. * BIT [31 : 8] :- reserved
  808. */
  809. A_UINT32 mac_id__word;
  810. A_UINT32 tx_abort;
  811. A_UINT32 tx_abort_fail_count;
  812. A_UINT32 rx_abort;
  813. A_UINT32 rx_abort_fail_count;
  814. A_UINT32 warm_reset;
  815. A_UINT32 cold_reset;
  816. A_UINT32 tx_flush;
  817. A_UINT32 tx_glb_reset;
  818. A_UINT32 tx_txq_reset;
  819. A_UINT32 rx_timeout_reset;
  820. A_UINT32 mac_cold_reset_restore_cal;
  821. A_UINT32 mac_cold_reset;
  822. A_UINT32 mac_warm_reset;
  823. A_UINT32 mac_only_reset;
  824. A_UINT32 phy_warm_reset;
  825. A_UINT32 phy_warm_reset_ucode_trig;
  826. A_UINT32 mac_warm_reset_restore_cal;
  827. A_UINT32 mac_sfm_reset;
  828. A_UINT32 phy_warm_reset_m3_ssr;
  829. A_UINT32 phy_warm_reset_reason_phy_m3;
  830. A_UINT32 phy_warm_reset_reason_tx_hw_stuck;
  831. A_UINT32 phy_warm_reset_reason_num_cca_rx_frame_stuck;
  832. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_rx_busy;
  833. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_mac_hang;
  834. A_UINT32 phy_warm_reset_reason_mac_reset_converted_phy_reset;
  835. A_UINT32 wal_rx_recovery_rst_mac_hang_count;
  836. A_UINT32 wal_rx_recovery_rst_known_sig_count;
  837. A_UINT32 wal_rx_recovery_rst_no_rx_count;
  838. A_UINT32 wal_rx_recovery_rst_no_rx_consecutive_count;
  839. A_UINT32 wal_rx_recovery_rst_rx_busy_count;
  840. A_UINT32 wal_rx_recovery_rst_phy_mac_hang_count;
  841. A_UINT32 rx_flush_cnt; /* Num rx flush issued */
  842. A_UINT32 phy_warm_reset_reason_tx_lifetime_expiry_cca_stuck;
  843. A_UINT32 phy_warm_reset_reason_tx_consecutive_flush9_war;
  844. A_UINT32 phy_warm_reset_reason_tx_hwsch_reset_war;
  845. A_UINT32 phy_warm_reset_reason_hwsch_wdog_or_cca_wdog_war;
  846. A_UINT32 fw_rx_rings_reset;
  847. } htt_hw_stats_pdev_errs_tlv;
  848. typedef struct {
  849. htt_tlv_hdr_t tlv_hdr;
  850. /* BIT [ 7 : 0] :- mac_id
  851. * BIT [31 : 8] :- reserved
  852. */
  853. A_UINT32 mac_id__word;
  854. A_UINT32 last_unpause_ppdu_id;
  855. A_UINT32 hwsch_unpause_wait_tqm_write;
  856. A_UINT32 hwsch_dummy_tlv_skipped;
  857. A_UINT32 hwsch_misaligned_offset_received;
  858. A_UINT32 hwsch_reset_count;
  859. A_UINT32 hwsch_dev_reset_war;
  860. A_UINT32 hwsch_delayed_pause;
  861. A_UINT32 hwsch_long_delayed_pause;
  862. A_UINT32 sch_rx_ppdu_no_response;
  863. A_UINT32 sch_selfgen_response;
  864. A_UINT32 sch_rx_sifs_resp_trigger;
  865. } htt_hw_stats_whal_tx_tlv;
  866. typedef struct {
  867. htt_tlv_hdr_t tlv_hdr;
  868. /* BIT [ 7 : 0] :- mac_id
  869. * BIT [31 : 8] :- reserved
  870. */
  871. union {
  872. struct {
  873. A_UINT32 mac_id: 8,
  874. reserved: 24;
  875. };
  876. A_UINT32 mac_id__word;
  877. };
  878. /*
  879. * hw_wars is a variable-length array, with each element counting
  880. * the number of occurrences of the corresponding type of HW WAR.
  881. * That is, hw_wars[0] indicates how many times HW WAR 0 occurred,
  882. * hw_wars[1] indicates how many times HW WAR 1 occurred, etc.
  883. * The target has an internal HW WAR mapping that it uses to keep
  884. * track of which HW WAR is WAR 0, which HW WAR is WAR 1, etc.
  885. */
  886. A_UINT32 hw_wars[1/*or more*/];
  887. } htt_hw_war_stats_tlv;
  888. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  889. * TLV_TAGS:
  890. * - HTT_STATS_HW_PDEV_ERRS_TAG
  891. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  892. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  893. * - HTT_STATS_WHAL_TX_TAG
  894. * - HTT_STATS_HW_WAR_TAG
  895. */
  896. /* NOTE:
  897. * This structure is for documentation, and cannot be safely used directly.
  898. * Instead, use the constituent TLV structures to fill/parse.
  899. */
  900. typedef struct _htt_pdev_err_stats {
  901. htt_hw_stats_pdev_errs_tlv pdev_errs;
  902. htt_hw_stats_intr_misc_tlv misc_stats[1];
  903. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  904. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  905. htt_hw_war_stats_tlv hw_war;
  906. } htt_hw_err_stats_t;
  907. /* ============ PEER STATS ============ */
  908. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  909. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  910. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  911. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  912. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  913. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  914. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  915. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  916. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  917. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  918. do { \
  919. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  920. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  921. } while (0)
  922. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  923. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  924. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  925. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  926. do { \
  927. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  928. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  929. } while (0)
  930. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  931. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  932. HTT_MSDU_FLOW_STATS_DROP_S)
  933. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  934. do { \
  935. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  936. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  937. } while (0)
  938. typedef struct _htt_msdu_flow_stats_tlv {
  939. htt_tlv_hdr_t tlv_hdr;
  940. A_UINT32 last_update_timestamp;
  941. A_UINT32 last_add_timestamp;
  942. A_UINT32 last_remove_timestamp;
  943. A_UINT32 total_processed_msdu_count;
  944. A_UINT32 cur_msdu_count_in_flowq;
  945. A_UINT32 sw_peer_id; /* This will help to find which peer_id is stuck state */
  946. /* BIT [15 : 0] :- tx_flow_number
  947. * BIT [19 : 16] :- tid_num
  948. * BIT [20 : 20] :- drop_rule
  949. * BIT [31 : 21] :- reserved
  950. */
  951. A_UINT32 tx_flow_no__tid_num__drop_rule;
  952. A_UINT32 last_cycle_enqueue_count;
  953. A_UINT32 last_cycle_dequeue_count;
  954. A_UINT32 last_cycle_drop_count;
  955. /* BIT [15 : 0] :- current_drop_th
  956. * BIT [31 : 16] :- reserved
  957. */
  958. A_UINT32 current_drop_th;
  959. } htt_msdu_flow_stats_tlv;
  960. #define MAX_HTT_TID_NAME 8
  961. /* DWORD sw_peer_id__tid_num */
  962. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  963. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  964. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  965. #define HTT_TX_TID_STATS_TID_NUM_S 16
  966. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  967. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  968. HTT_TX_TID_STATS_SW_PEER_ID_S)
  969. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  970. do { \
  971. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  972. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  973. } while (0)
  974. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  975. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  976. HTT_TX_TID_STATS_TID_NUM_S)
  977. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  978. do { \
  979. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  980. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  981. } while (0)
  982. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  983. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  984. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  985. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  986. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  987. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  988. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  989. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  990. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  991. do { \
  992. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  993. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  994. } while (0)
  995. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  996. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  997. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  998. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  999. do { \
  1000. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  1001. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  1002. } while (0)
  1003. /* Tidq stats */
  1004. typedef struct _htt_tx_tid_stats_tlv {
  1005. htt_tlv_hdr_t tlv_hdr;
  1006. /* Stored as little endian */
  1007. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1008. /* BIT [15 : 0] :- sw_peer_id
  1009. * BIT [31 : 16] :- tid_num
  1010. */
  1011. A_UINT32 sw_peer_id__tid_num;
  1012. /* BIT [ 7 : 0] :- num_sched_pending
  1013. * BIT [15 : 8] :- num_ppdu_in_hwq
  1014. * BIT [31 : 16] :- reserved
  1015. */
  1016. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1017. A_UINT32 tid_flags;
  1018. /* per tid # of hw_queued ppdu.*/
  1019. A_UINT32 hw_queued;
  1020. /* number of per tid successful PPDU. */
  1021. A_UINT32 hw_reaped;
  1022. /* per tid Num MPDUs filtered by HW */
  1023. A_UINT32 mpdus_hw_filter;
  1024. A_UINT32 qdepth_bytes;
  1025. A_UINT32 qdepth_num_msdu;
  1026. A_UINT32 qdepth_num_mpdu;
  1027. A_UINT32 last_scheduled_tsmp;
  1028. A_UINT32 pause_module_id;
  1029. A_UINT32 block_module_id;
  1030. /* tid tx airtime in sec */
  1031. A_UINT32 tid_tx_airtime;
  1032. } htt_tx_tid_stats_tlv;
  1033. /* Tidq stats */
  1034. typedef struct _htt_tx_tid_stats_v1_tlv {
  1035. htt_tlv_hdr_t tlv_hdr;
  1036. /* Stored as little endian */
  1037. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1038. /* BIT [15 : 0] :- sw_peer_id
  1039. * BIT [31 : 16] :- tid_num
  1040. */
  1041. A_UINT32 sw_peer_id__tid_num;
  1042. /* BIT [ 7 : 0] :- num_sched_pending
  1043. * BIT [15 : 8] :- num_ppdu_in_hwq
  1044. * BIT [31 : 16] :- reserved
  1045. */
  1046. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1047. A_UINT32 tid_flags;
  1048. /* Max qdepth in bytes reached by this tid*/
  1049. A_UINT32 max_qdepth_bytes;
  1050. /* number of msdus qdepth reached max */
  1051. A_UINT32 max_qdepth_n_msdus;
  1052. /* Made reserved this field */
  1053. A_UINT32 rsvd;
  1054. A_UINT32 qdepth_bytes;
  1055. A_UINT32 qdepth_num_msdu;
  1056. A_UINT32 qdepth_num_mpdu;
  1057. A_UINT32 last_scheduled_tsmp;
  1058. A_UINT32 pause_module_id;
  1059. A_UINT32 block_module_id;
  1060. /* tid tx airtime in sec */
  1061. A_UINT32 tid_tx_airtime;
  1062. A_UINT32 allow_n_flags;
  1063. /* BIT [15 : 0] :- sendn_frms_allowed
  1064. * BIT [31 : 16] :- reserved
  1065. */
  1066. A_UINT32 sendn_frms_allowed;
  1067. } htt_tx_tid_stats_v1_tlv;
  1068. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1069. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  1070. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  1071. #define HTT_RX_TID_STATS_TID_NUM_S 16
  1072. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  1073. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  1074. HTT_RX_TID_STATS_SW_PEER_ID_S)
  1075. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1076. do { \
  1077. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  1078. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  1079. } while (0)
  1080. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  1081. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  1082. HTT_RX_TID_STATS_TID_NUM_S)
  1083. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  1084. do { \
  1085. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  1086. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  1087. } while (0)
  1088. typedef struct _htt_rx_tid_stats_tlv {
  1089. htt_tlv_hdr_t tlv_hdr;
  1090. /* BIT [15 : 0] : sw_peer_id
  1091. * BIT [31 : 16] : tid_num
  1092. */
  1093. A_UINT32 sw_peer_id__tid_num;
  1094. /* Stored as little endian */
  1095. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1096. /* dup_in_reorder not collected per tid for now,
  1097. as there is no wal_peer back ptr in data rx peer. */
  1098. A_UINT32 dup_in_reorder;
  1099. A_UINT32 dup_past_outside_window;
  1100. A_UINT32 dup_past_within_window;
  1101. /* Number of per tid MSDUs with flag of decrypt_err */
  1102. A_UINT32 rxdesc_err_decrypt;
  1103. /* tid rx airtime in sec */
  1104. A_UINT32 tid_rx_airtime;
  1105. } htt_rx_tid_stats_tlv;
  1106. #define HTT_MAX_COUNTER_NAME 8
  1107. typedef struct {
  1108. htt_tlv_hdr_t tlv_hdr;
  1109. /* Stored as little endian */
  1110. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  1111. A_UINT32 count;
  1112. } htt_counter_tlv;
  1113. typedef struct {
  1114. htt_tlv_hdr_t tlv_hdr;
  1115. /* Number of rx ppdu. */
  1116. A_UINT32 ppdu_cnt;
  1117. /* Number of rx mpdu. */
  1118. A_UINT32 mpdu_cnt;
  1119. /* Number of rx msdu */
  1120. A_UINT32 msdu_cnt;
  1121. /* Pause bitmap */
  1122. A_UINT32 pause_bitmap;
  1123. /* Block bitmap */
  1124. A_UINT32 block_bitmap;
  1125. /* Current timestamp */
  1126. A_UINT32 current_timestamp;
  1127. /* Peer cumulative tx airtime in sec */
  1128. A_UINT32 peer_tx_airtime;
  1129. /* Peer cumulative rx airtime in sec */
  1130. A_UINT32 peer_rx_airtime;
  1131. /* Peer current rssi in dBm */
  1132. A_INT32 rssi;
  1133. /* Total enqueued, dequeued and dropped msdu's for peer */
  1134. A_UINT32 peer_enqueued_count_low;
  1135. A_UINT32 peer_enqueued_count_high;
  1136. A_UINT32 peer_dequeued_count_low;
  1137. A_UINT32 peer_dequeued_count_high;
  1138. A_UINT32 peer_dropped_count_low;
  1139. A_UINT32 peer_dropped_count_high;
  1140. /* Total ppdu transmitted bytes for peer: includes MAC header overhead */
  1141. A_UINT32 ppdu_transmitted_bytes_low;
  1142. A_UINT32 ppdu_transmitted_bytes_high;
  1143. A_UINT32 peer_ttl_removed_count;
  1144. /* inactive_time
  1145. * Running duration of the time since last tx/rx activity by this peer,
  1146. * units = seconds.
  1147. * If the peer is currently active, this inactive_time will be 0x0.
  1148. */
  1149. A_UINT32 inactive_time;
  1150. /* Number of MPDUs dropped after max retries */
  1151. A_UINT32 remove_mpdus_max_retries;
  1152. } htt_peer_stats_cmn_tlv;
  1153. typedef struct {
  1154. htt_tlv_hdr_t tlv_hdr;
  1155. /* This enum type of HTT_PEER_TYPE */
  1156. A_UINT32 peer_type;
  1157. A_UINT32 sw_peer_id;
  1158. /* BIT [7 : 0] :- vdev_id
  1159. * BIT [15 : 8] :- pdev_id
  1160. * BIT [31 : 16] :- ast_indx
  1161. */
  1162. A_UINT32 vdev_pdev_ast_idx;
  1163. htt_mac_addr mac_addr;
  1164. A_UINT32 peer_flags;
  1165. A_UINT32 qpeer_flags;
  1166. } htt_peer_details_tlv;
  1167. typedef struct {
  1168. htt_tlv_hdr_t tlv_hdr;
  1169. A_UINT32 sw_peer_id;
  1170. A_UINT32 ast_index;
  1171. htt_mac_addr mac_addr;
  1172. A_UINT32
  1173. pdev_id : 2,
  1174. vdev_id : 8,
  1175. next_hop : 1,
  1176. mcast : 1,
  1177. monitor_direct : 1,
  1178. mesh_sta : 1,
  1179. mec : 1,
  1180. intra_bss : 1,
  1181. reserved : 16;
  1182. } htt_ast_entry_tlv;
  1183. typedef enum {
  1184. HTT_STATS_PREAM_OFDM,
  1185. HTT_STATS_PREAM_CCK,
  1186. HTT_STATS_PREAM_HT,
  1187. HTT_STATS_PREAM_VHT,
  1188. HTT_STATS_PREAM_HE,
  1189. HTT_STATS_PREAM_EHT,
  1190. HTT_STATS_PREAM_RSVD1,
  1191. HTT_STATS_PREAM_COUNT,
  1192. } HTT_STATS_PREAM_TYPE;
  1193. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1194. #define HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1195. /* HTT_TX_PEER_STATS_NUM_GI_COUNTERS:
  1196. * GI Index 0: WHAL_GI_800
  1197. * GI Index 1: WHAL_GI_400
  1198. * GI Index 2: WHAL_GI_1600
  1199. * GI Index 3: WHAL_GI_3200
  1200. */
  1201. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  1202. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  1203. /* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
  1204. * bw index 0: rssi_pri20_chain0
  1205. * bw index 1: rssi_ext20_chain0
  1206. * bw index 2: rssi_ext40_low20_chain0
  1207. * bw index 3: rssi_ext40_high20_chain0
  1208. */
  1209. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  1210. /* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
  1211. * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
  1212. * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
  1213. * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
  1214. * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
  1215. */
  1216. #define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
  1217. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS 4
  1218. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1219. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1220. #define HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1221. typedef struct _htt_tx_peer_rate_stats_tlv {
  1222. htt_tlv_hdr_t tlv_hdr;
  1223. /* Number of tx ldpc packets */
  1224. A_UINT32 tx_ldpc;
  1225. /* Number of tx rts packets */
  1226. A_UINT32 rts_cnt;
  1227. /* RSSI value of last ack packet (units = dB above noise floor) */
  1228. A_UINT32 ack_rssi;
  1229. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1230. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1231. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1232. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1233. A_UINT32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  1234. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1235. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1236. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  1237. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1238. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  1239. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  1240. /* Stats for MCS 12/13 */
  1241. A_UINT32 tx_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1242. A_UINT32 tx_su_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1243. A_UINT32 tx_mu_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1244. A_UINT32 tx_stbc_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1245. A_UINT32 tx_gi_ext[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1246. A_UINT32 reduced_tx_bw[HTT_TX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PEER_STATS_NUM_BW_COUNTERS];
  1247. } htt_tx_peer_rate_stats_tlv;
  1248. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1249. #define HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1250. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  1251. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  1252. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  1253. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1254. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1255. #define HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  1256. typedef struct _htt_rx_peer_rate_stats_tlv {
  1257. htt_tlv_hdr_t tlv_hdr;
  1258. A_UINT32 nsts;
  1259. /* Number of rx ldpc packets */
  1260. A_UINT32 rx_ldpc;
  1261. /* Number of rx rts packets */
  1262. A_UINT32 rts_cnt;
  1263. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  1264. A_UINT32 rssi_data; /* units = dB above noise floor */
  1265. A_UINT32 rssi_comb; /* units = dB above noise floor */
  1266. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1267. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1268. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  1269. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1270. A_UINT32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  1271. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1272. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  1273. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  1274. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1275. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  1276. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  1277. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  1278. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  1279. A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* dBm unit */
  1280. /* per_chain_rssi_pkt_type:
  1281. * This field shows what type of rx frame the per-chain RSSI was computed
  1282. * on, by recording the frame type and sub-type as bit-fields within this
  1283. * field:
  1284. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  1285. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  1286. * BIT [31 : 8] :- Reserved
  1287. */
  1288. A_UINT32 per_chain_rssi_pkt_type;
  1289. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1290. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  1291. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  1292. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  1293. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  1294. A_UINT8 rssi_chain_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS]; /* units = dB above noise floor */
  1295. /* Stats for MCS 12/13 */
  1296. A_UINT32 rx_mcs_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1297. A_UINT32 rx_stbc_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1298. A_UINT32 rx_gi_ext[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1299. A_UINT32 reduced_rx_bw[HTT_RX_PEER_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1300. A_INT8 rx_per_chain_rssi_in_dbm_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS];
  1301. } htt_rx_peer_rate_stats_tlv;
  1302. typedef enum {
  1303. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  1304. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  1305. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  1306. } htt_peer_stats_req_mode_t;
  1307. typedef enum {
  1308. HTT_PEER_STATS_CMN_TLV = 0,
  1309. HTT_PEER_DETAILS_TLV = 1,
  1310. HTT_TX_PEER_RATE_STATS_TLV = 2,
  1311. HTT_RX_PEER_RATE_STATS_TLV = 3,
  1312. HTT_TX_TID_STATS_TLV = 4,
  1313. HTT_RX_TID_STATS_TLV = 5,
  1314. HTT_MSDU_FLOW_STATS_TLV = 6,
  1315. HTT_PEER_SCHED_STATS_TLV = 7,
  1316. HTT_PEER_STATS_MAX_TLV = 31,
  1317. } htt_peer_stats_tlv_enum;
  1318. typedef struct {
  1319. htt_tlv_hdr_t tlv_hdr;
  1320. A_UINT32 peer_id;
  1321. /* Num of DL schedules for peer */
  1322. A_UINT32 num_sched_dl;
  1323. /* Num od UL schedules for peer */
  1324. A_UINT32 num_sched_ul;
  1325. /* Peer TX time */
  1326. A_UINT32 peer_tx_active_dur_us_low;
  1327. A_UINT32 peer_tx_active_dur_us_high;
  1328. /* Peer RX time */
  1329. A_UINT32 peer_rx_active_dur_us_low;
  1330. A_UINT32 peer_rx_active_dur_us_high;
  1331. A_UINT32 peer_curr_rate_kbps;
  1332. } htt_peer_sched_stats_tlv;
  1333. /* config_param0 */
  1334. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M 0x00000001
  1335. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S 0
  1336. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_GET(_var) \
  1337. (((_var) & HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M) >> \
  1338. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)
  1339. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_SET(_var, _val) \
  1340. do { \
  1341. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR, _val); \
  1342. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)); \
  1343. } while (0)
  1344. /* DEPRECATED
  1345. * The old IS_peer_MAC_ADDR_SET macro name is being retained for now,
  1346. * as an alias for the corrected macro name.
  1347. * If/when all references to the old name are removed, the definition of
  1348. * the old name will also be removed.
  1349. */
  1350. #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
  1351. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  1352. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  1353. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  1354. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  1355. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  1356. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  1357. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  1360. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  1361. } while (0)
  1362. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  1363. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  1364. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  1365. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  1366. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  1367. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  1368. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  1369. do { \
  1370. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  1371. } while (0)
  1372. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  1373. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  1374. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  1375. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  1376. do { \
  1377. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  1378. } while (0)
  1379. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  1380. * TLV_TAGS:
  1381. * - HTT_STATS_PEER_STATS_CMN_TAG
  1382. * - HTT_STATS_PEER_DETAILS_TAG
  1383. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  1384. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  1385. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  1386. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  1387. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  1388. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  1389. * - HTT_STATS_PEER_SCHED_STATS_TAG
  1390. */
  1391. /* NOTE:
  1392. * This structure is for documentation, and cannot be safely used directly.
  1393. * Instead, use the constituent TLV structures to fill/parse.
  1394. */
  1395. typedef struct _htt_peer_stats {
  1396. htt_peer_stats_cmn_tlv cmn_tlv;
  1397. htt_peer_details_tlv peer_details;
  1398. /* from g_rate_info_stats */
  1399. htt_tx_peer_rate_stats_tlv tx_rate;
  1400. htt_rx_peer_rate_stats_tlv rx_rate;
  1401. htt_tx_tid_stats_tlv tx_tid_stats[1];
  1402. htt_rx_tid_stats_tlv rx_tid_stats[1];
  1403. htt_msdu_flow_stats_tlv msdu_flowq[1];
  1404. htt_tx_tid_stats_v1_tlv tx_tid_stats_v1[1];
  1405. htt_peer_sched_stats_tlv peer_sched_stats;
  1406. } htt_peer_stats_t;
  1407. /* =========== ACTIVE PEER LIST ========== */
  1408. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  1409. * TLV_TAGS:
  1410. * - HTT_STATS_PEER_DETAILS_TAG
  1411. */
  1412. /* NOTE:
  1413. * This structure is for documentation, and cannot be safely used directly.
  1414. * Instead, use the constituent TLV structures to fill/parse.
  1415. */
  1416. typedef struct {
  1417. htt_peer_details_tlv peer_details[1];
  1418. } htt_active_peer_details_list_t;
  1419. /* =========== MUMIMO HWQ stats =========== */
  1420. /* MU MIMO stats per hwQ */
  1421. typedef struct {
  1422. htt_tlv_hdr_t tlv_hdr;
  1423. A_UINT32 mu_mimo_sch_posted; /* number of MU MIMO schedules posted to HW */
  1424. A_UINT32 mu_mimo_sch_failed; /* number of MU MIMO schedules failed to post */
  1425. A_UINT32 mu_mimo_ppdu_posted; /* number of MU MIMO PPDUs posted to HW */
  1426. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  1427. typedef struct {
  1428. htt_tlv_hdr_t tlv_hdr;
  1429. A_UINT32 mu_mimo_mpdus_queued_usr; /* 11AC DL MU MIMO number of mpdus queued to HW, per user */
  1430. A_UINT32 mu_mimo_mpdus_tried_usr; /* 11AC DL MU MIMO number of mpdus tried over the air, per user */
  1431. A_UINT32 mu_mimo_mpdus_failed_usr; /* 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  1432. A_UINT32 mu_mimo_mpdus_requeued_usr; /* 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  1433. A_UINT32 mu_mimo_err_no_ba_usr; /* 11AC DL MU MIMO BA not receieved, per user */
  1434. A_UINT32 mu_mimo_mpdu_underrun_usr; /* 11AC DL MU MIMO mpdu underrun encountered, per user */
  1435. A_UINT32 mu_mimo_ampdu_underrun_usr; /* 11AC DL MU MIMO ampdu underrun encountered, per user */
  1436. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  1437. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  1438. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  1439. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  1440. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  1441. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  1442. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  1443. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  1444. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  1445. do { \
  1446. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  1447. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  1448. } while (0)
  1449. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  1450. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  1451. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  1452. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  1453. do { \
  1454. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  1455. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  1456. } while (0)
  1457. typedef struct {
  1458. htt_tlv_hdr_t tlv_hdr;
  1459. /* BIT [ 7 : 0] :- mac_id
  1460. * BIT [15 : 8] :- hwq_id
  1461. * BIT [31 : 16] :- reserved
  1462. */
  1463. A_UINT32 mac_id__hwq_id__word;
  1464. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  1465. /* NOTE:
  1466. * This structure is for documentation, and cannot be safely used directly.
  1467. * Instead, use the constituent TLV structures to fill/parse.
  1468. */
  1469. typedef struct {
  1470. struct _hwq_mu_mimo_stats {
  1471. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  1472. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1473. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_TX_MAX_NUM_USERS */
  1474. } hwq[1];
  1475. } htt_tx_hwq_mu_mimo_stats_t;
  1476. /* == TX HWQ STATS == */
  1477. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  1478. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  1479. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  1480. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  1481. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  1482. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  1483. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  1484. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  1485. do { \
  1486. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  1487. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  1488. } while (0)
  1489. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  1490. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  1491. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  1492. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  1493. do { \
  1494. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  1495. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  1496. } while (0)
  1497. typedef struct {
  1498. htt_tlv_hdr_t tlv_hdr;
  1499. /* BIT [ 7 : 0] :- mac_id
  1500. * BIT [15 : 8] :- hwq_id
  1501. * BIT [31 : 16] :- reserved
  1502. */
  1503. A_UINT32 mac_id__hwq_id__word;
  1504. /* PPDU level stats */
  1505. A_UINT32 xretry; /* Number of times ack is failed for the PPDU scheduled on this txQ */
  1506. A_UINT32 underrun_cnt; /* Number of times sched cmd status reported mpdu underrun */
  1507. A_UINT32 flush_cnt; /* Number of times sched cmd is flushed */
  1508. A_UINT32 filt_cnt; /* Number of times sched cmd is filtered */
  1509. A_UINT32 null_mpdu_bmap; /* Number of times HWSCH uploaded null mpdu bitmap */
  1510. A_UINT32 user_ack_failure; /* Number of time user ack or ba tlv is not seen on FES ring where it is expected to be */
  1511. A_UINT32 ack_tlv_proc; /* Number of times TQM processed ack tlv received from HWSCH */
  1512. A_UINT32 sched_id_proc; /* Cache latest processed scheduler ID received from ack ba tlv */
  1513. A_UINT32 null_mpdu_tx_count; /* Number of times TxPCU reported mpdus transmitted for a user is zero */
  1514. A_UINT32 mpdu_bmap_not_recvd; /* Number of times SW did not see any mpdu info bitmap tlv on FES status ring */
  1515. /* Selfgen stats per hwQ */
  1516. A_UINT32 num_bar; /* Number of SU/MU BAR frames posted to hwQ */
  1517. A_UINT32 rts; /* Number of RTS frames posted to hwQ */
  1518. A_UINT32 cts2self; /* Number of cts2self frames posted to hwQ */
  1519. A_UINT32 qos_null; /* Number of qos null frames posted to hwQ */
  1520. /* MPDU level stats */
  1521. A_UINT32 mpdu_tried_cnt; /* mpdus tried Tx by HWSCH/TQM */
  1522. A_UINT32 mpdu_queued_cnt; /* mpdus queued to HWSCH */
  1523. A_UINT32 mpdu_ack_fail_cnt; /* mpdus tried but ack was not received */
  1524. A_UINT32 mpdu_filt_cnt; /* This will include sched cmd flush and time based discard */
  1525. A_UINT32 false_mpdu_ack_count; /* Number of MPDUs for which ACK was sucessful but no Tx happened */
  1526. A_UINT32 txq_timeout; /* Number of times txq timeout happened */
  1527. } htt_tx_hwq_stats_cmn_tlv;
  1528. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) + /* hist_intvl */ \
  1529. (sizeof(A_UINT32) * (_num_elems)))
  1530. /* NOTE: Variable length TLV, use length spec to infer array size */
  1531. typedef struct {
  1532. htt_tlv_hdr_t tlv_hdr;
  1533. A_UINT32 hist_intvl;
  1534. /* histogram of ppdu post to hwsch - > cmd status received */
  1535. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1536. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1537. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1538. /* NOTE: Variable length TLV, use length spec to infer array size */
  1539. typedef struct {
  1540. htt_tlv_hdr_t tlv_hdr;
  1541. /* Histogram of sched cmd result */
  1542. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1543. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1544. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1545. /* NOTE: Variable length TLV, use length spec to infer array size */
  1546. typedef struct {
  1547. htt_tlv_hdr_t tlv_hdr;
  1548. /* Histogram of various pause conitions */
  1549. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1550. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1551. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1552. /* NOTE: Variable length TLV, use length spec to infer array size */
  1553. typedef struct {
  1554. htt_tlv_hdr_t tlv_hdr;
  1555. /* Histogram of number of user fes result */
  1556. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1557. } htt_tx_hwq_fes_result_stats_tlv_v;
  1558. #define HTT_TX_HWQ_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1559. /* NOTE: Variable length TLV, use length spec to infer array size
  1560. *
  1561. * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
  1562. * The tries here is the count of the MPDUS within a PPDU that the HW
  1563. * had attempted to transmit on air, for the HWSCH Schedule command
  1564. * submitted by FW in this HWQ .It is not the retry attempts. The
  1565. * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
  1566. * in this histogram.
  1567. * they are defined in FW using the following macros
  1568. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  1569. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  1570. *
  1571. * */
  1572. typedef struct {
  1573. htt_tlv_hdr_t tlv_hdr;
  1574. A_UINT32 hist_bin_size;
  1575. /* Histogram of number of mpdus on tried mpdu */
  1576. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_HWQ_TRIED_MPDU_CNT_HIST */
  1577. } htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v;
  1578. #define HTT_TX_HWQ_TXOP_USED_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1579. /* NOTE: Variable length TLV, use length spec to infer array size
  1580. *
  1581. * The txop_used_cnt_hist is the histogram of txop per burst. After
  1582. * completing the burst, we identify the txop used in the burst and
  1583. * incr the corresponding bin.
  1584. * Each bin represents 1ms & we have 10 bins in this histogram.
  1585. * they are deined in FW using the following macros
  1586. * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
  1587. * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
  1588. *
  1589. * */
  1590. typedef struct {
  1591. htt_tlv_hdr_t tlv_hdr;
  1592. /* Histogram of txop used cnt */
  1593. A_UINT32 txop_used_cnt_hist[1]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
  1594. } htt_tx_hwq_txop_used_cnt_hist_tlv_v;
  1595. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1596. * TLV_TAGS:
  1597. * - HTT_STATS_STRING_TAG
  1598. * - HTT_STATS_TX_HWQ_CMN_TAG
  1599. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1600. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1601. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1602. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1603. * - HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG
  1604. * - HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG
  1605. */
  1606. /* NOTE:
  1607. * This structure is for documentation, and cannot be safely used directly.
  1608. * Instead, use the constituent TLV structures to fill/parse.
  1609. * General HWQ stats Mechanism:
  1610. * Once the host request for the stats, FW fill all the HWQ TAGS in a buffer
  1611. * for all the HWQ requested. & the FW send the buffer to host. In the
  1612. * buffer the HWQ ID is filled in mac_id__hwq_id, thus identifying each
  1613. * HWQ distinctly.
  1614. */
  1615. typedef struct _htt_tx_hwq_stats {
  1616. htt_stats_string_tlv hwq_str_tlv;
  1617. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1618. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1619. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1620. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1621. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1622. htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v tried_mpdu_tlv;
  1623. htt_tx_hwq_txop_used_cnt_hist_tlv_v txop_used_tlv;
  1624. } htt_tx_hwq_stats_t;
  1625. /* == TX SELFGEN STATS == */
  1626. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1627. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1628. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1629. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1630. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1631. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1635. } while (0)
  1636. typedef enum {
  1637. HTT_TXERR_NONE,
  1638. HTT_TXERR_RESP, /* response timeout, mismatch,
  1639. * BW mismatch, mimo ctrl mismatch,
  1640. * CRC error.. */
  1641. HTT_TXERR_FILT, /* blocked by tx filtering */
  1642. HTT_TXERR_FIFO, /* fifo, misc errors in HW */
  1643. HTT_TXERR_SWABORT, /* software initialted abort (TX_ABORT) */
  1644. HTT_TXERR_RESERVED1,
  1645. HTT_TXERR_RESERVED2,
  1646. HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS = 7,
  1647. HTT_TXERR_INVALID = 0xff,
  1648. } htt_tx_err_status_t;
  1649. /* Matching enum for htt_tx_selfgen_sch_tsflag_error_stats */
  1650. typedef enum {
  1651. HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR,
  1652. HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR,
  1653. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR,
  1654. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR,
  1655. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR,
  1656. HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR,
  1657. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR,
  1658. HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR,
  1659. HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS = 8,
  1660. HTT_TX_SELFGEN_SCH_TSFLAG_ERROR_STATS_VALID = 8
  1661. } htt_tx_selfgen_sch_tsflag_error_stats;
  1662. typedef enum {
  1663. HTT_TX_MUMIMO_GRP_VALID,
  1664. HTT_TX_MUMIMO_GRP_INVALID_NUM_MU_USERS_EXCEEDED_MU_MAX_USERS,
  1665. HTT_TX_MUMIMO_GRP_INVALID_SCHED_ALGO_NOT_MU_COMPATIBLE_GID,
  1666. HTT_TX_MUMIMO_GRP_INVALID_NON_PRIMARY_GRP,
  1667. HTT_TX_MUMIMO_GRP_INVALID_ZERO_CANDIDATES,
  1668. HTT_TX_MUMIMO_GRP_INVALID_MORE_CANDIDATES,
  1669. HTT_TX_MUMIMO_GRP_INVALID_GROUP_SIZE_EXCEED_NSS,
  1670. HTT_TX_MUMIMO_GRP_INVALID_GROUP_INELIGIBLE,
  1671. HTT_TX_MUMIMO_GRP_INVALID,
  1672. HTT_TX_MUMIMO_GRP_INVALID_GROUP_EFF_MU_TPUT_OMBPS,
  1673. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE,
  1674. } htt_tx_mumimo_grp_invalid_reason_code_stats;
  1675. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  1676. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  1677. #define HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS 8
  1678. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  1679. #define HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS 8
  1680. #define HTT_STATS_MAX_MUMIMO_GRP_SZ 8
  1681. /*
  1682. * Each bin represents a 300 mbps throughput
  1683. * [0] - 0-300mbps; [1] - 300-600mbps [2] - 600-900mbps; [3] - 900-1200mbps; [4] - 1200-1500mbps
  1684. * [5] - 1500-1800mbps; [6] - 1800-2100mbps; [7] - 2100-2400mbps; [8] - 2400-2700mbps; [9] - >=2700mbps
  1685. */
  1686. #define HTT_STATS_MUMIMO_TPUT_NUM_BINS 10
  1687. #define HTT_STATS_MAX_INVALID_REASON_CODE \
  1688. HTT_TX_MUMIMO_GRP_INVALID_MAX_REASON_CODE
  1689. /* Reasons stated in htt_tx_mumimo_grp_invalid_reason_code_stats */
  1690. #define HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS \
  1691. (HTT_STATS_MAX_MUMIMO_GRP_SZ * HTT_STATS_MAX_INVALID_REASON_CODE)
  1692. typedef struct {
  1693. htt_tlv_hdr_t tlv_hdr;
  1694. /* BIT [ 7 : 0] :- mac_id
  1695. * BIT [31 : 8] :- reserved
  1696. */
  1697. A_UINT32 mac_id__word;
  1698. A_UINT32 su_bar; /* BAR sent out for SU transmission */
  1699. A_UINT32 rts; /* SW generated RTS frame sent */
  1700. A_UINT32 cts2self; /* SW generated CTS-to-self frame sent */
  1701. A_UINT32 qos_null; /* SW generated QOS NULL frame sent */
  1702. A_UINT32 delayed_bar_1; /* BAR sent for MU user 1 */
  1703. A_UINT32 delayed_bar_2; /* BAR sent for MU user 2 */
  1704. A_UINT32 delayed_bar_3; /* BAR sent for MU user 3 */
  1705. A_UINT32 delayed_bar_4; /* BAR sent for MU user 4 */
  1706. A_UINT32 delayed_bar_5; /* BAR sent for MU user 5 */
  1707. A_UINT32 delayed_bar_6; /* BAR sent for MU user 6 */
  1708. A_UINT32 delayed_bar_7; /* BAR sent for MU user 7 */
  1709. A_UINT32 bar_with_tqm_head_seq_num;
  1710. A_UINT32 bar_with_tid_seq_num;
  1711. A_UINT32 su_sw_rts_queued; /* SW generated RTS frame queued to the HW */
  1712. A_UINT32 su_sw_rts_tried; /* SW generated RTS frame sent over the air */
  1713. A_UINT32 su_sw_rts_err; /* SW generated RTS frame completed with error */
  1714. A_UINT32 su_sw_rts_flushed; /* SW generated RTS frame flushed */
  1715. A_UINT32 su_sw_rts_rcvd_cts_diff_bw; /* CTS (RTS response) received in different BW */
  1716. } htt_tx_selfgen_cmn_stats_tlv;
  1717. typedef struct {
  1718. htt_tlv_hdr_t tlv_hdr;
  1719. A_UINT32 ac_su_ndpa; /* 11AC VHT SU NDPA frame sent over the air */
  1720. A_UINT32 ac_su_ndp; /* 11AC VHT SU NDP frame sent over the air */
  1721. A_UINT32 ac_mu_mimo_ndpa; /* 11AC VHT MU MIMO NDPA frame sent over the air */
  1722. A_UINT32 ac_mu_mimo_ndp; /* 11AC VHT MU MIMO NDP frame sent over the air */
  1723. A_UINT32 ac_mu_mimo_brpoll_1; /* 11AC VHT MU MIMO BR-POLL for user 1 sent over the air */
  1724. A_UINT32 ac_mu_mimo_brpoll_2; /* 11AC VHT MU MIMO BR-POLL for user 2 sent over the air */
  1725. A_UINT32 ac_mu_mimo_brpoll_3; /* 11AC VHT MU MIMO BR-POLL for user 3 sent over the air */
  1726. A_UINT32 ac_su_ndpa_queued; /* 11AC VHT SU NDPA frame queued to the HW */
  1727. A_UINT32 ac_su_ndp_queued; /* 11AC VHT SU NDP frame queued to the HW */
  1728. A_UINT32 ac_mu_mimo_ndpa_queued; /* 11AC VHT MU MIMO NDPA frame queued to the HW */
  1729. A_UINT32 ac_mu_mimo_ndp_queued; /* 11AC VHT MU MIMO NDP frame queued to the HW */
  1730. A_UINT32 ac_mu_mimo_brpoll_1_queued; /* 11AC VHT MU MIMO BR-POLL for user 1 frame queued to the HW */
  1731. A_UINT32 ac_mu_mimo_brpoll_2_queued; /* 11AC VHT MU MIMO BR-POLL for user 2 frame queued to the HW */
  1732. A_UINT32 ac_mu_mimo_brpoll_3_queued; /* 11AC VHT MU MIMO BR-POLL for user 3 frame queued to the HW */
  1733. } htt_tx_selfgen_ac_stats_tlv;
  1734. typedef struct {
  1735. htt_tlv_hdr_t tlv_hdr;
  1736. A_UINT32 ax_su_ndpa; /* 11AX HE SU NDPA frame sent over the air */
  1737. A_UINT32 ax_su_ndp; /* 11AX HE NDP frame sent over the air */
  1738. A_UINT32 ax_mu_mimo_ndpa; /* 11AX HE MU MIMO NDPA frame sent over the air */
  1739. A_UINT32 ax_mu_mimo_ndp; /* 11AX HE MU MIMO NDP frame sent over the air */
  1740. union {
  1741. struct {
  1742. /* deprecated old names */
  1743. A_UINT32 ax_mu_mimo_brpoll_1;
  1744. A_UINT32 ax_mu_mimo_brpoll_2;
  1745. A_UINT32 ax_mu_mimo_brpoll_3;
  1746. A_UINT32 ax_mu_mimo_brpoll_4;
  1747. A_UINT32 ax_mu_mimo_brpoll_5;
  1748. A_UINT32 ax_mu_mimo_brpoll_6;
  1749. A_UINT32 ax_mu_mimo_brpoll_7;
  1750. };
  1751. /* 11AX HE MU BR-POLL frame for users 1 - 7 sent over the air */
  1752. A_UINT32 ax_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1753. };
  1754. A_UINT32 ax_basic_trigger; /* 11AX HE MU Basic Trigger frame sent over the air */
  1755. A_UINT32 ax_bsr_trigger; /* 11AX HE MU BSRP Trigger frame sent over the air */
  1756. A_UINT32 ax_mu_bar_trigger; /* 11AX HE MU BAR Trigger frame sent over the air */
  1757. A_UINT32 ax_mu_rts_trigger; /* 11AX HE MU RTS Trigger frame sent over the air */
  1758. A_UINT32 ax_ulmumimo_trigger; /* 11AX HE MU UL-MUMIMO Trigger frame sent over the air */
  1759. A_UINT32 ax_su_ndpa_queued; /* 11AX HE SU NDPA frame queued to the HW */
  1760. A_UINT32 ax_su_ndp_queued; /* 11AX HE SU NDP frame queued to the HW */
  1761. A_UINT32 ax_mu_mimo_ndpa_queued; /* 11AX HE MU MIMO NDPA frame queued to the HW */
  1762. A_UINT32 ax_mu_mimo_ndp_queued; /* 11AX HE MU MIMO NDP frame queued to the HW */
  1763. /* 11AX HE MU BR-POLL frame for users 1 - 7 queued to the HW */
  1764. A_UINT32 ax_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1765. /* 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 successfully sent over the air */
  1766. A_UINT32 ax_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1767. } htt_tx_selfgen_ax_stats_tlv;
  1768. typedef struct {
  1769. htt_tlv_hdr_t tlv_hdr;
  1770. A_UINT32 be_su_ndpa; /* 11be EHT SU NDPA frame sent over the air */
  1771. A_UINT32 be_su_ndp; /* 11be EHT NDP frame sent over the air */
  1772. A_UINT32 be_mu_mimo_ndpa; /* 11be EHT MU MIMO NDPA frame sent over the air */
  1773. A_UINT32 be_mu_mimo_ndp; /* 11be EHT MU MIMO NDP frame sent over theT air */
  1774. /* 11be EHT MU BR-POLL frame for users 1 - 7 sent over the air */
  1775. A_UINT32 be_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  1776. A_UINT32 be_basic_trigger; /* 11be EHT MU Basic Trigger frame sent over the air */
  1777. A_UINT32 be_bsr_trigger; /* 11be EHT MU BSRP Trigger frame sent over the air */
  1778. A_UINT32 be_mu_bar_trigger; /* 11be EHT MU BAR Trigger frame sent over the air */
  1779. A_UINT32 be_mu_rts_trigger; /* 11be EHT MU RTS Trigger frame sent over the air */
  1780. A_UINT32 be_ulmumimo_trigger; /* 11be EHT MU UL-MUMIMO Trigger frame sent over the air */
  1781. A_UINT32 be_su_ndpa_queued; /* 11be EHT SU NDPA frame queued to the HW */
  1782. A_UINT32 be_su_ndp_queued; /* 11be EHT SU NDP frame queued to the HW */
  1783. A_UINT32 be_mu_mimo_ndpa_queued; /* 11be EHT MU MIMO NDPA frame queued to the HW */
  1784. A_UINT32 be_mu_mimo_ndp_queued; /* 11be EHT MU MIMO NDP frame queued to the HW */
  1785. /* 11be EHT MU BR-POLL frame for users 1 - 7 queued to the HW */
  1786. A_UINT32 be_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  1787. /* 11be EHT UL-MUMIMO Trigger frame for users 0 - 7 successfully sent over the air */
  1788. A_UINT32 be_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  1789. } htt_tx_selfgen_be_stats_tlv;
  1790. typedef struct {
  1791. htt_tlv_hdr_t tlv_hdr;
  1792. /* 11AX HE OFDMA NDPA frame queued to the HW */
  1793. A_UINT32 ax_ofdma_ndpa_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1794. /* 11AX HE OFDMA NDPA frame sent over the air */
  1795. A_UINT32 ax_ofdma_ndpa_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1796. /* 11AX HE OFDMA NDPA frame flushed by HW */
  1797. A_UINT32 ax_ofdma_ndpa_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1798. /* 11AX HE OFDMA NDPA frame completed with error(s) */
  1799. A_UINT32 ax_ofdma_ndpa_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1800. } htt_txbf_ofdma_ndpa_stats_tlv;
  1801. typedef struct {
  1802. htt_tlv_hdr_t tlv_hdr;
  1803. /* 11AX HE OFDMA NDP frame queued to the HW */
  1804. A_UINT32 ax_ofdma_ndp_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1805. /* 11AX HE OFDMA NDPA frame sent over the air */
  1806. A_UINT32 ax_ofdma_ndp_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1807. /* 11AX HE OFDMA NDPA frame flushed by HW */
  1808. A_UINT32 ax_ofdma_ndp_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1809. /* 11AX HE OFDMA NDPA frame completed with error(s) */
  1810. A_UINT32 ax_ofdma_ndp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1811. } htt_txbf_ofdma_ndp_stats_tlv;
  1812. typedef struct {
  1813. htt_tlv_hdr_t tlv_hdr;
  1814. /* 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  1815. A_UINT32 ax_ofdma_brpoll_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1816. /* 11AX HE OFDMA MU BRPOLL frame sent over the air */
  1817. A_UINT32 ax_ofdma_brpoll_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1818. /* 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  1819. A_UINT32 ax_ofdma_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1820. /* 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  1821. A_UINT32 ax_ofdma_brp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1822. /* Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  1823. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS+1];
  1824. } htt_txbf_ofdma_brp_stats_tlv;
  1825. typedef struct {
  1826. htt_tlv_hdr_t tlv_hdr;
  1827. /* 11AX HE OFDMA PPDUs that were sent over the air with steering (TXBF + OFDMA) */
  1828. A_UINT32 ax_ofdma_num_ppdu_steer[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1829. /* 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  1830. A_UINT32 ax_ofdma_num_ppdu_ol[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1831. /* 11AX HE OFDMA number of users for which CBF prefetch was initiated to PHY HW during TX */
  1832. A_UINT32 ax_ofdma_num_usrs_prefetch[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1833. /* 11AX HE OFDMA number of users for which sounding was initiated during TX */
  1834. A_UINT32 ax_ofdma_num_usrs_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1835. /* 11AX HE OFDMA number of users for which sounding was forced during TX */
  1836. A_UINT32 ax_ofdma_num_usrs_force_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1837. } htt_txbf_ofdma_steer_stats_tlv;
  1838. /* STATS_TYPE : HTT_DBG_EXT_STATS_TXBF_OFDMA
  1839. * TLV_TAGS:
  1840. * - HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG
  1841. * - HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG
  1842. * - HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG
  1843. * - HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG
  1844. */
  1845. /* NOTE:
  1846. * This structure is for documentation, and cannot be safely used directly.
  1847. * Instead, use the constituent TLV structures to fill/parse.
  1848. */
  1849. typedef struct {
  1850. htt_txbf_ofdma_ndpa_stats_tlv ofdma_ndpa_tlv;
  1851. htt_txbf_ofdma_ndp_stats_tlv ofdma_ndp_tlv;
  1852. htt_txbf_ofdma_brp_stats_tlv ofdma_brp_tlv;
  1853. htt_txbf_ofdma_steer_stats_tlv ofdma_steer_tlv;
  1854. } htt_tx_pdev_txbf_ofdma_stats_t;
  1855. typedef struct {
  1856. htt_tlv_hdr_t tlv_hdr;
  1857. A_UINT32 ac_su_ndp_err; /* 11AC VHT SU NDP frame completed with error(s) */
  1858. A_UINT32 ac_su_ndpa_err; /* 11AC VHT SU NDPA frame completed with error(s) */
  1859. A_UINT32 ac_mu_mimo_ndpa_err; /* 11AC VHT MU MIMO NDPA frame completed with error(s) */
  1860. A_UINT32 ac_mu_mimo_ndp_err; /* 11AC VHT MU MIMO NDP frame completed with error(s) */
  1861. A_UINT32 ac_mu_mimo_brp1_err; /* 11AC VHT MU MIMO BRPOLL for user 1 frame completed with error(s) */
  1862. A_UINT32 ac_mu_mimo_brp2_err; /* 11AC VHT MU MIMO BRPOLL for user 2 frame completed with error(s) */
  1863. A_UINT32 ac_mu_mimo_brp3_err; /* 11AC VHT MU MIMO BRPOLL for user 3 frame completed with error(s) */
  1864. A_UINT32 ac_su_ndpa_flushed; /* 11AC VHT SU NDPA frame flushed by HW */
  1865. A_UINT32 ac_su_ndp_flushed; /* 11AC VHT SU NDP frame flushed by HW */
  1866. A_UINT32 ac_mu_mimo_ndpa_flushed; /* 11AC VHT MU MIMO NDPA frame flushed by HW */
  1867. A_UINT32 ac_mu_mimo_ndp_flushed; /* 11AC VHT MU MIMO NDP frame flushed by HW */
  1868. A_UINT32 ac_mu_mimo_brpoll1_flushed; /* 11AC VHT MU MIMO BRPOLL for user 1 frame flushed by HW */
  1869. A_UINT32 ac_mu_mimo_brpoll2_flushed; /* 11AC VHT MU MIMO BRPOLL for user 2 frame flushed by HW */
  1870. A_UINT32 ac_mu_mimo_brpoll3_flushed; /* 11AC VHT MU MIMO BRPOLL for user 3 frame flushed by HW */
  1871. } htt_tx_selfgen_ac_err_stats_tlv;
  1872. typedef struct {
  1873. htt_tlv_hdr_t tlv_hdr;
  1874. A_UINT32 ax_su_ndp_err; /* 11AX HE SU NDP frame completed with error(s) */
  1875. A_UINT32 ax_su_ndpa_err; /* 11AX HE SU NDPA frame completed with error(s) */
  1876. A_UINT32 ax_mu_mimo_ndpa_err; /* 11AX HE MU MIMO NDPA frame completed with error(s) */
  1877. A_UINT32 ax_mu_mimo_ndp_err; /* 11AX HE MU MIMO NDP frame completed with error(s) */
  1878. union {
  1879. struct {
  1880. /* deprecated old names */
  1881. A_UINT32 ax_mu_mimo_brp1_err;
  1882. A_UINT32 ax_mu_mimo_brp2_err;
  1883. A_UINT32 ax_mu_mimo_brp3_err;
  1884. A_UINT32 ax_mu_mimo_brp4_err;
  1885. A_UINT32 ax_mu_mimo_brp5_err;
  1886. A_UINT32 ax_mu_mimo_brp6_err;
  1887. A_UINT32 ax_mu_mimo_brp7_err;
  1888. };
  1889. /* 11AX HE MU BR-POLL frame for 1 - 7 users completed with error(s) */
  1890. A_UINT32 ax_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1891. };
  1892. A_UINT32 ax_basic_trigger_err; /* 11AX HE MU Basic Trigger frame completed with error(s) */
  1893. A_UINT32 ax_bsr_trigger_err; /* 11AX HE MU BSRP Trigger frame completed with error(s) */
  1894. A_UINT32 ax_mu_bar_trigger_err; /* 11AX HE MU BAR Trigger frame completed with error(s) */
  1895. A_UINT32 ax_mu_rts_trigger_err; /* 11AX HE MU RTS Trigger frame completed with error(s) */
  1896. A_UINT32 ax_ulmumimo_trigger_err; /* 11AX HE MU ULMUMIMO Trigger frame completed with error(s) */
  1897. /* Number of CBF(s) received when 11AX HE MU MIMO BRPOLL frame completed with error(s) */
  1898. A_UINT32 ax_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1899. A_UINT32 ax_su_ndpa_flushed; /* 11AX HE SU NDPA frame flushed by HW */
  1900. A_UINT32 ax_su_ndp_flushed; /* 11AX HE SU NDP frame flushed by HW */
  1901. A_UINT32 ax_mu_mimo_ndpa_flushed; /* 11AX HE MU MIMO NDPA frame flushed by HW */
  1902. A_UINT32 ax_mu_mimo_ndp_flushed; /* 11AX HE MU MIMO NDP frame flushed by HW */
  1903. /* 11AX HE MU BR-POLL frame for users 1 - 7 flushed by HW */
  1904. A_UINT32 ax_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1905. /* 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s) */
  1906. A_UINT32 ax_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1907. } htt_tx_selfgen_ax_err_stats_tlv;
  1908. typedef struct {
  1909. htt_tlv_hdr_t tlv_hdr;
  1910. A_UINT32 be_su_ndp_err; /* 11BE EHT SU NDP frame completed with error(s) */
  1911. A_UINT32 be_su_ndpa_err; /* 11BE EHT SU NDPA frame completed with error(s) */
  1912. A_UINT32 be_mu_mimo_ndpa_err; /* 11BE EHT MU MIMO NDPA frame completed with error(s) */
  1913. A_UINT32 be_mu_mimo_ndp_err; /* 11BE EHT MU MIMO NDP frame completed with error(s) */
  1914. /* 11BE EHT MU BR-POLL frame for 1 - 7 users completed with error(s) */
  1915. A_UINT32 be_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  1916. A_UINT32 be_basic_trigger_err; /* 11BE EHT MU Basic Trigger frame completed with error(s) */
  1917. A_UINT32 be_bsr_trigger_err; /* 11BE EHT MU BSRP Trigger frame completed with error(s) */
  1918. A_UINT32 be_mu_bar_trigger_err; /* 11BE EHT MU BAR Trigger frame completed with error(s) */
  1919. A_UINT32 be_mu_rts_trigger_err; /* 11BE EHT MU RTS Trigger frame completed with error(s) */
  1920. A_UINT32 be_ulmumimo_trigger_err; /* 11BE EHT MU ULMUMIMO Trigger frame completed with error(s) */
  1921. /* Number of CBF(s) received when 11BE EHT MU MIMO BRPOLL frame completed with error(s) */
  1922. A_UINT32 be_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  1923. A_UINT32 be_su_ndpa_flushed; /* 11BE EHT SU NDPA frame flushed by HW */
  1924. A_UINT32 be_su_ndp_flushed; /* 11BE EHT SU NDP frame flushed by HW */
  1925. A_UINT32 be_mu_mimo_ndpa_flushed; /* 11BE EHT MU MIMO NDPA frame flushed by HW */
  1926. A_UINT32 be_mu_mimo_ndp_flushed; /* 11BE HT MU MIMO NDP frame flushed by HW */
  1927. /* 11BE EHT MU BR-POLL frame for users 1 - 7 flushed by HW */
  1928. A_UINT32 be_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS - 1];
  1929. /* 11BE EHT UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s) */
  1930. A_UINT32 be_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  1931. } htt_tx_selfgen_be_err_stats_tlv;
  1932. /*
  1933. * Scheduler completion status reason code.
  1934. * (0) HTT_TXERR_NONE - No error (Success).
  1935. * (1) HTT_TXERR_RESP - Response timeout, response mismatch, BW mismatch,
  1936. * MIMO control mismatch, CRC error etc.
  1937. * (2) HTT_TXERR_FILT - Blocked by HW tx filtering.
  1938. * (3) HTT_TXERR_FIFO - FIFO, misc. errors in HW.
  1939. * (4) HTT_TXERR_SWABORT - Software initialted abort (TX_ABORT).
  1940. * (5) HTT_TXERR_RESERVED1 - Currently reserved.
  1941. * (6) HTT_TXERR_RESERVED2 - Currently reserved.
  1942. */
  1943. /* Scheduler error code.
  1944. * (0) HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR - Flush received from HW.
  1945. * (1) HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR - Scheduler command was
  1946. * filtered by HW.
  1947. * (2) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR - Response frame mismatch
  1948. * error.
  1949. * (3) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR - CBF
  1950. * received with MIMO control mismatch.
  1951. * (4) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR - CBF received with
  1952. * BW mismatch.
  1953. * (5) HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR - Error in transmitting
  1954. * frame even after maximum retries.
  1955. * (6) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR - Response frame
  1956. * received outside RX window.
  1957. * (7) HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR - No frame
  1958. * received by HW for queuing within SIFS interval.
  1959. */
  1960. typedef struct {
  1961. htt_tlv_hdr_t tlv_hdr;
  1962. /* 11AC VHT SU NDPA scheduler completion status reason code */
  1963. A_UINT32 ac_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1964. /* 11AC VHT SU NDP scheduler completion status reason code */
  1965. A_UINT32 ac_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1966. /* 11AC VHT SU NDP scheduler error code */
  1967. A_UINT32 ac_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1968. /* 11AC VHT MU MIMO NDPA scheduler completion status reason code */
  1969. A_UINT32 ac_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1970. /* 11AC VHT MU MIMO NDP scheduler completion status reason code */
  1971. A_UINT32 ac_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1972. /* 11AC VHT MU MIMO NDP scheduler error code */
  1973. A_UINT32 ac_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1974. /* 11AC VHT MU MIMO BRPOLL scheduler completion status reason code */
  1975. A_UINT32 ac_mu_mimo_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1976. /* 11AC VHT MU MIMO BRPOLL scheduler error code */
  1977. A_UINT32 ac_mu_mimo_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1978. } htt_tx_selfgen_ac_sched_status_stats_tlv;
  1979. typedef struct {
  1980. htt_tlv_hdr_t tlv_hdr;
  1981. /* 11AX HE SU NDPA scheduler completion status reason code */
  1982. A_UINT32 ax_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1983. /* 11AX SU NDP scheduler completion status reason code */
  1984. A_UINT32 ax_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1985. /* 11AX HE SU NDP scheduler error code */
  1986. A_UINT32 ax_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1987. /* 11AX HE MU MIMO NDPA scheduler completion status reason code */
  1988. A_UINT32 ax_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1989. /* 11AX HE MU MIMO NDP scheduler completion status reason code */
  1990. A_UINT32 ax_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1991. /* 11AX HE MU MIMO NDP scheduler error code */
  1992. A_UINT32 ax_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1993. /* 11AX HE MU MIMO MU BRPOLL scheduler completion status reason code */
  1994. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1995. /* 11AX HE MU MIMO MU BRPOLL scheduler error code */
  1996. A_UINT32 ax_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1997. /* 11AX HE MU BAR scheduler completion status reason code */
  1998. A_UINT32 ax_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1999. /* 11AX HE MU BAR scheduler error code */
  2000. A_UINT32 ax_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2001. /* 11AX HE UL OFDMA Basic Trigger scheduler completion status reason code */
  2002. A_UINT32 ax_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2003. /* 11AX HE UL OFDMA Basic Trigger scheduler error code */
  2004. A_UINT32 ax_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2005. /* 11AX HE UL MUMIMO Basic Trigger scheduler completion status reason code */
  2006. A_UINT32 ax_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2007. /* 11AX HE UL MUMIMO Basic Trigger scheduler error code */
  2008. A_UINT32 ax_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2009. } htt_tx_selfgen_ax_sched_status_stats_tlv;
  2010. typedef struct {
  2011. htt_tlv_hdr_t tlv_hdr;
  2012. /* 11BE EHT SU NDPA scheduler completion status reason code */
  2013. A_UINT32 be_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2014. /* 11BE SU NDP scheduler completion status reason code */
  2015. A_UINT32 be_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2016. /* 11BE EHT SU NDP scheduler error code */
  2017. A_UINT32 be_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2018. /* 11BE EHT MU MIMO NDPA scheduler completion status reason code */
  2019. A_UINT32 be_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2020. /* 11BE EHT MU MIMO NDP scheduler completion status reason code */
  2021. A_UINT32 be_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2022. /* 11BE EHT MU MIMO NDP scheduler error code */
  2023. A_UINT32 be_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2024. /* 11BE EHT MU MIMO MU BRPOLL scheduler completion status reason code */
  2025. A_UINT32 be_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2026. /* 11BE EHT MU MIMO MU BRPOLL scheduler error code */
  2027. A_UINT32 be_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2028. /* 11BE EHT MU BAR scheduler completion status reason code */
  2029. A_UINT32 be_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2030. /* 11BE EHT MU BAR scheduler error code */
  2031. A_UINT32 be_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2032. /* 11BE EHT UL OFDMA Basic Trigger scheduler completion status reason code */
  2033. A_UINT32 be_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2034. /* 11BE EHT UL OFDMA Basic Trigger scheduler error code */
  2035. A_UINT32 be_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2036. /* 11BE EHT UL MUMIMO Basic Trigger scheduler completion status reason code */
  2037. A_UINT32 be_ulmumimo_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  2038. /* 11BE EHT UL MUMIMO Basic Trigger scheduler error code */
  2039. A_UINT32 be_ulmumimo_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  2040. } htt_tx_selfgen_be_sched_status_stats_tlv;
  2041. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  2042. * TLV_TAGS:
  2043. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  2044. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  2045. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  2046. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  2047. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  2048. * - HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG
  2049. * - HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG
  2050. * - HTT_STATS_TX_SELFGEN_BE_STATS_TAG
  2051. * - HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG
  2052. * - HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG
  2053. */
  2054. /* NOTE:
  2055. * This structure is for documentation, and cannot be safely used directly.
  2056. * Instead, use the constituent TLV structures to fill/parse.
  2057. */
  2058. typedef struct {
  2059. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  2060. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  2061. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  2062. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  2063. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  2064. htt_tx_selfgen_ac_sched_status_stats_tlv ac_sched_status_tlv;
  2065. htt_tx_selfgen_ax_sched_status_stats_tlv ax_sched_status_tlv;
  2066. htt_tx_selfgen_be_stats_tlv be_tlv;
  2067. htt_tx_selfgen_be_err_stats_tlv be_err_tlv;
  2068. htt_tx_selfgen_be_sched_status_stats_tlv be_sched_status_tlv;
  2069. } htt_tx_pdev_selfgen_stats_t;
  2070. /* == TX MU STATS == */
  2071. typedef struct {
  2072. htt_tlv_hdr_t tlv_hdr;
  2073. A_UINT32 mu_mimo_sch_posted; /* Number of MU MIMO schedules posted to HW */
  2074. A_UINT32 mu_mimo_sch_failed; /* Number of MU MIMO schedules failed to post */
  2075. A_UINT32 mu_mimo_ppdu_posted; /* Number of MU MIMO PPDUs posted to HW */
  2076. /*
  2077. * This is the common description for the below sch stats.
  2078. * Counts the number of transmissions of each number of MU users
  2079. * in each TX mode.
  2080. * The array index is the "number of users - 1".
  2081. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  2082. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  2083. * TX PPDUs and so on.
  2084. * The same is applicable for the other TX mode stats.
  2085. */
  2086. /* Represents the count for 11AC DL MU MIMO sequences */
  2087. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2088. /* Represents the count for 11AX DL MU MIMO sequences */
  2089. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2090. /* Represents the count for 11AX DL MU OFDMA sequences */
  2091. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2092. /* Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers */
  2093. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2094. /* Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  2095. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2096. /* Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  2097. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2098. /* Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  2099. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2100. /* Represents the count for 11AX UL MU MIMO sequences with Basic Triggers */
  2101. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2102. /* Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  2103. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2104. /* Number of 11AC DL MU MIMO schedules posted per group size */
  2105. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2106. /* Number of 11AX DL MU MIMO schedules posted per group size */
  2107. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2108. /* Represents the count for 11BE DL MU MIMO sequences */
  2109. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2110. /* Number of 11BE DL MU MIMO schedules posted per group size */
  2111. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2112. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  2113. typedef struct {
  2114. htt_tlv_hdr_t tlv_hdr;
  2115. A_UINT32 dl_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2116. A_UINT32 dl_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2117. A_UINT32 dl_mumimo_grp_eligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2118. A_UINT32 dl_mumimo_grp_ineligible[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2119. A_UINT32 dl_mumimo_grp_invalid[HTT_TX_NUM_MUMIMO_GRP_INVALID_WORDS];
  2120. A_UINT32 dl_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  2121. A_UINT32 ul_mumimo_grp_best_grp_size[HTT_STATS_MAX_MUMIMO_GRP_SZ];
  2122. A_UINT32 ul_mumimo_grp_best_num_usrs[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2123. A_UINT32 ul_mumimo_grp_tputs[HTT_STATS_MUMIMO_TPUT_NUM_BINS];
  2124. } htt_tx_pdev_mumimo_grp_stats_tlv;
  2125. typedef struct {
  2126. htt_tlv_hdr_t tlv_hdr;
  2127. A_UINT32 mu_mimo_sch_posted; /* Number of MU MIMO schedules posted to HW */
  2128. A_UINT32 mu_mimo_sch_failed; /* Number of MU MIMO schedules failed to post */
  2129. A_UINT32 mu_mimo_ppdu_posted; /* Number of MU MIMO PPDUs posted to HW */
  2130. /*
  2131. * This is the common description for the below sch stats.
  2132. * Counts the number of transmissions of each number of MU users
  2133. * in each TX mode.
  2134. * The array index is the "number of users - 1".
  2135. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  2136. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  2137. * TX PPDUs and so on.
  2138. * The same is applicable for the other TX mode stats.
  2139. */
  2140. /* Represents the count for 11AC DL MU MIMO sequences */
  2141. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2142. /* Represents the count for 11AX DL MU MIMO sequences */
  2143. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2144. /* Number of 11AC DL MU MIMO schedules posted per group size */
  2145. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2146. /* Number of 11AX DL MU MIMO schedules posted per group size */
  2147. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2148. /* Represents the count for 11BE DL MU MIMO sequences */
  2149. A_UINT32 be_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2150. /* Number of 11BE DL MU MIMO schedules posted per group size */
  2151. A_UINT32 be_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  2152. } htt_tx_pdev_dl_mu_mimo_sch_stats_tlv;
  2153. typedef struct {
  2154. htt_tlv_hdr_t tlv_hdr;
  2155. /* Represents the count for 11AX DL MU OFDMA sequences */
  2156. A_UINT32 ax_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2157. } htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv;
  2158. typedef struct {
  2159. htt_tlv_hdr_t tlv_hdr;
  2160. /* Represents the count for 11BE DL MU OFDMA sequences */
  2161. A_UINT32 be_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2162. } htt_tx_pdev_be_dl_mu_ofdma_sch_stats_tlv;
  2163. typedef struct {
  2164. htt_tlv_hdr_t tlv_hdr;
  2165. /* Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers */
  2166. A_UINT32 ax_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2167. /* Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  2168. A_UINT32 ax_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2169. /* Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  2170. A_UINT32 ax_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2171. /* Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  2172. A_UINT32 ax_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2173. } htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv;
  2174. typedef struct {
  2175. htt_tlv_hdr_t tlv_hdr;
  2176. /* Represents the count for 11BE UL MU OFDMA sequences with Basic Triggers */
  2177. A_UINT32 be_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2178. /* Represents the count for 11BE UL MU OFDMA sequences with BSRP Triggers */
  2179. A_UINT32 be_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2180. /* Represents the count for 11BE UL MU OFDMA sequences with BAR Triggers */
  2181. A_UINT32 be_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2182. /* Represents the count for 11BE UL MU OFDMA sequences with BRP Triggers */
  2183. A_UINT32 be_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2184. } htt_tx_pdev_be_ul_mu_ofdma_sch_stats_tlv;
  2185. typedef struct {
  2186. htt_tlv_hdr_t tlv_hdr;
  2187. /* Represents the count for 11AX UL MU MIMO sequences with Basic Triggers */
  2188. A_UINT32 ax_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2189. /* Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  2190. A_UINT32 ax_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2191. } htt_tx_pdev_ul_mu_mimo_sch_stats_tlv;
  2192. typedef struct {
  2193. htt_tlv_hdr_t tlv_hdr;
  2194. A_UINT32 mu_mimo_mpdus_queued_usr; /* 11AC DL MU MIMO number of mpdus queued to HW, per user */
  2195. A_UINT32 mu_mimo_mpdus_tried_usr; /* 11AC DL MU MIMO number of mpdus tried over the air, per user */
  2196. A_UINT32 mu_mimo_mpdus_failed_usr; /* 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  2197. A_UINT32 mu_mimo_mpdus_requeued_usr; /* 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  2198. A_UINT32 mu_mimo_err_no_ba_usr; /* 11AC DL MU MIMO BA not receieved, per user */
  2199. A_UINT32 mu_mimo_mpdu_underrun_usr; /* 11AC DL MU MIMO mpdu underrun encountered, per user */
  2200. A_UINT32 mu_mimo_ampdu_underrun_usr; /* 11AC DL MU MIMO ampdu underrun encountered, per user */
  2201. A_UINT32 ax_mu_mimo_mpdus_queued_usr; /* 11AX MU MIMO number of mpdus queued to HW, per user */
  2202. A_UINT32 ax_mu_mimo_mpdus_tried_usr; /* 11AX MU MIMO number of mpdus tried over the air, per user */
  2203. A_UINT32 ax_mu_mimo_mpdus_failed_usr; /* 11AX DL MU MIMO number of mpdus failed acknowledgement, per user */
  2204. A_UINT32 ax_mu_mimo_mpdus_requeued_usr; /* 11AX DL MU MIMO number of mpdus re-queued to HW, per user */
  2205. A_UINT32 ax_mu_mimo_err_no_ba_usr; /* 11AX DL MU MIMO BA not receieved, per user */
  2206. A_UINT32 ax_mu_mimo_mpdu_underrun_usr; /* 11AX DL MU MIMO mpdu underrun encountered, per user */
  2207. A_UINT32 ax_mu_mimo_ampdu_underrun_usr; /* 11AX DL MU MIMO ampdu underrun encountered, per user */
  2208. A_UINT32 ax_ofdma_mpdus_queued_usr; /* 11AX MU OFDMA number of mpdus queued to HW, per user */
  2209. A_UINT32 ax_ofdma_mpdus_tried_usr; /* 11AX MU OFDMA number of mpdus tried over the air, per user */
  2210. A_UINT32 ax_ofdma_mpdus_failed_usr; /* 11AX MU OFDMA number of mpdus failed acknowledgement, per user */
  2211. A_UINT32 ax_ofdma_mpdus_requeued_usr; /* 11AX MU OFDMA number of mpdus re-queued to HW, per user */
  2212. A_UINT32 ax_ofdma_err_no_ba_usr; /* 11AX MU OFDMA BA not receieved, per user */
  2213. A_UINT32 ax_ofdma_mpdu_underrun_usr; /* 11AX MU OFDMA mpdu underrun encountered, per user */
  2214. A_UINT32 ax_ofdma_ampdu_underrun_usr; /* 11AX MU OFDMA ampdu underrun encountered, per user */
  2215. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  2216. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  2217. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  2218. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  2219. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_BE 4 /* SCHED_TX_MODE_MU_OFDMA_BE */
  2220. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_BE 5 /* SCHED_TX_MODE_MU_MIMO_BE */
  2221. typedef struct {
  2222. htt_tlv_hdr_t tlv_hdr;
  2223. /* mpdu level stats */
  2224. A_UINT32 mpdus_queued_usr;
  2225. A_UINT32 mpdus_tried_usr;
  2226. A_UINT32 mpdus_failed_usr;
  2227. A_UINT32 mpdus_requeued_usr;
  2228. A_UINT32 err_no_ba_usr;
  2229. A_UINT32 mpdu_underrun_usr;
  2230. A_UINT32 ampdu_underrun_usr;
  2231. A_UINT32 user_index;
  2232. A_UINT32 tx_sched_mode; /* HTT_STATS_TX_SCHED_MODE_xxx */
  2233. } htt_tx_pdev_mpdu_stats_tlv;
  2234. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  2235. * TLV_TAGS:
  2236. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  2237. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  2238. */
  2239. /* NOTE:
  2240. * This structure is for documentation, and cannot be safely used directly.
  2241. * Instead, use the constituent TLV structures to fill/parse.
  2242. */
  2243. typedef struct {
  2244. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  2245. htt_tx_pdev_dl_mu_mimo_sch_stats_tlv dl_mu_mimo_sch_stats_tlv[1];
  2246. htt_tx_pdev_ul_mu_mimo_sch_stats_tlv ul_mu_mimo_sch_stats_tlv[1];
  2247. htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv dl_mu_ofdma_sch_stats_tlv[1];
  2248. htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv ul_mu_ofdma_sch_stats_tlv[1];
  2249. /*
  2250. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  2251. * it can also hold MU-OFDMA stats.
  2252. */
  2253. htt_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  2254. htt_tx_pdev_mumimo_grp_stats_tlv mumimo_grp_stats_tlv;
  2255. } htt_tx_pdev_mu_mimo_stats_t;
  2256. /* == TX SCHED STATS == */
  2257. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2258. /* NOTE: Variable length TLV, use length spec to infer array size */
  2259. typedef struct {
  2260. htt_tlv_hdr_t tlv_hdr;
  2261. /* Scheduler command posted per tx_mode */
  2262. A_UINT32 sched_cmd_posted[1/* length = num tx modes */];
  2263. } htt_sched_txq_cmd_posted_tlv_v;
  2264. #define HTT_SCHED_TXQ_CMD_REAPED_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. /* Scheduler command reaped per tx_mode */
  2269. A_UINT32 sched_cmd_reaped[1/* length = num tx modes */];
  2270. } htt_sched_txq_cmd_reaped_tlv_v;
  2271. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2272. /* NOTE: Variable length TLV, use length spec to infer array size */
  2273. typedef struct {
  2274. htt_tlv_hdr_t tlv_hdr;
  2275. /*
  2276. * sched_order_su contains the peer IDs of peers chosen in the last
  2277. * NUM_SCHED_ORDER_LOG scheduler instances.
  2278. * The array is circular; it's unspecified which array element corresponds
  2279. * to the most recent scheduler invocation, and which corresponds to
  2280. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  2281. */
  2282. A_UINT32 sched_order_su[1]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
  2283. } htt_sched_txq_sched_order_su_tlv_v;
  2284. typedef struct {
  2285. htt_tlv_hdr_t tlv_hdr;
  2286. A_UINT32 htt_stats_type;
  2287. } htt_stats_error_tlv_v;
  2288. typedef enum {
  2289. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  2290. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  2291. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  2292. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  2293. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  2294. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  2295. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  2296. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  2297. HTT_SCHED_TID_SKIP_NO_DATA, /* Skip tid without data */
  2298. HTT_SCHED_TID_SKIP_NO_ENQ = HTT_SCHED_TID_SKIP_NO_DATA, /* deprecated old name */
  2299. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  2300. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  2301. HTT_SCHED_TID_SKIP_UL_RESP, /* skip UL response tid */
  2302. HTT_SCHED_TID_SKIP_UL = HTT_SCHED_TID_SKIP_UL_RESP, /* deprecated old name */
  2303. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  2304. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  2305. HTT_SCHED_TID_REMOVE_UL_RESP, /* Remove tid UL response */
  2306. HTT_SCHED_TID_REMOVE_UL = HTT_SCHED_TID_REMOVE_UL_RESP, /* deprecated old name */
  2307. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  2308. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  2309. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  2310. HTT_SCHED_TID_SKIP_EXCEPT_EAPOL, /* skip tid except eapol */
  2311. HTT_SCHED_TID_SU_LOW_PRI_ONLY, /* su low priority tid only */
  2312. HTT_SCHED_TID_SKIP_SOUND_IN_PROGRESS, /* skip tid sound in progress */
  2313. HTT_SCHED_TID_SKIP_NO_UL_DATA, /* skip ul tid when no ul data */
  2314. HTT_SCHED_TID_REMOVE_UL_NOT_CAPABLE, /* Remove tid that are not UL capable */
  2315. HTT_SCHED_TID_UL_ELIGIBLE, /* Tid is eligible for UL scheduling */
  2316. HTT_SCHED_TID_FALLBACK_TO_PREV_DECISION, /* Fall back to previous decision */
  2317. HTT_SCHED_TID_SKIP_PEER_ALREADY_IN_TXQ, /* skip tid, peer is already available in the txq */
  2318. HTT_SCHED_TID_SKIP_DELAY_UL_SCHED, /* skip tid delay UL schedule */
  2319. HTT_SCHED_INELIGIBILITY_MAX,
  2320. } htt_sched_txq_sched_ineligibility_tlv_enum;
  2321. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2322. /* NOTE: Variable length TLV, use length spec to infer array size */
  2323. typedef struct {
  2324. htt_tlv_hdr_t tlv_hdr;
  2325. /* sched_ineligibility counts the number of occurrences of different reasons for tid ineligibility during eligibility checks per txq in scheduling */
  2326. A_UINT32 sched_ineligibility[1]; /* indexed by htt_sched_txq_sched_ineligibility_tlv_enum */
  2327. } htt_sched_txq_sched_ineligibility_tlv_v;
  2328. typedef enum {
  2329. HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0, /* Supercycle not triggerd */
  2330. HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED, /* forced supercycle trigger */
  2331. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES, /* Num tidq entries is less than max_client threshold */
  2332. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS, /* Num active tids is less than max_client threshold */
  2333. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED, /* max sched iteration reached */
  2334. HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED, /* duration threshold reached */
  2335. HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER, /* TWT supercycle trigger */
  2336. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  2337. } htt_sched_txq_supercycle_triggers_tlv_enum;
  2338. #define HTT_SCHED_TXQ_SUPERCYCLE_TRIGGERS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2339. /* NOTE: Variable length TLV, use length spec to infer array size */
  2340. typedef struct {
  2341. htt_tlv_hdr_t tlv_hdr;
  2342. /*
  2343. * supercycle_triggers[] is a histogram that counts the number of
  2344. * occurrences of each different reason for a transmit scheduler
  2345. * supercycle to be triggered.
  2346. * The htt_sched_txq_supercycle_triggers_tlv_enum is used to index
  2347. * supercycle_triggers[], e.g. supercycle_triggers[1] holds the number
  2348. * of times a supercycle has been forced.
  2349. * These supercycle trigger counts are not automatically reset, but
  2350. * are reset upon request.
  2351. */
  2352. A_UINT32 supercycle_triggers[1/*HTT_SCHED_SUPERCYCLE_TRIGGER_MAX*/];
  2353. } htt_sched_txq_supercycle_triggers_tlv_v;
  2354. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  2355. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  2356. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  2357. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  2358. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  2359. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  2360. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  2361. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  2365. } while (0)
  2366. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  2367. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  2368. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  2369. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  2370. do { \
  2371. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  2372. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  2373. } while (0)
  2374. typedef struct {
  2375. htt_tlv_hdr_t tlv_hdr;
  2376. /* BIT [ 7 : 0] :- mac_id
  2377. * BIT [15 : 8] :- txq_id
  2378. * BIT [31 : 16] :- reserved
  2379. */
  2380. A_UINT32 mac_id__txq_id__word;
  2381. /* Scheduler policy ised for this TxQ */
  2382. A_UINT32 sched_policy;
  2383. /* Timestamp of last scheduler command posted */
  2384. A_UINT32 last_sched_cmd_posted_timestamp;
  2385. /* Timestamp of last scheduler command completed */
  2386. A_UINT32 last_sched_cmd_compl_timestamp;
  2387. /* Num of Sched2TAC ring hit Low Water Mark condition */
  2388. A_UINT32 sched_2_tac_lwm_count;
  2389. /* Num of Sched2TAC ring full condition */
  2390. A_UINT32 sched_2_tac_ring_full;
  2391. /* Num of scheduler command post failures that includes su/mu mimo/mu ofdma sequence type */
  2392. A_UINT32 sched_cmd_post_failure;
  2393. /* Num of active tids for this TxQ at current instance */
  2394. A_UINT32 num_active_tids;
  2395. /* Num of powersave schedules */
  2396. A_UINT32 num_ps_schedules;
  2397. /* Num of scheduler commands pending for this TxQ */
  2398. A_UINT32 sched_cmds_pending;
  2399. /* Num of tidq registration for this TxQ */
  2400. A_UINT32 num_tid_register;
  2401. /* Num of tidq de-registration for this TxQ */
  2402. A_UINT32 num_tid_unregister;
  2403. /* Num of iterations msduq stats was updated */
  2404. A_UINT32 num_qstats_queried;
  2405. /* qstats query update status */
  2406. A_UINT32 qstats_update_pending;
  2407. /* Timestamp of Last query stats made */
  2408. A_UINT32 last_qstats_query_timestamp;
  2409. /* Num of sched2tqm command queue full condition */
  2410. A_UINT32 num_tqm_cmdq_full;
  2411. /* Num of scheduler trigger from DE Module */
  2412. A_UINT32 num_de_sched_algo_trigger;
  2413. /* Num of scheduler trigger from RT Module */
  2414. A_UINT32 num_rt_sched_algo_trigger;
  2415. /* Num of scheduler trigger from TQM Module */
  2416. A_UINT32 num_tqm_sched_algo_trigger;
  2417. /* Num of schedules for notify frame */
  2418. A_UINT32 notify_sched;
  2419. /* Duration based sendn termination */
  2420. A_UINT32 dur_based_sendn_term;
  2421. /* scheduled via NOTIFY2 */
  2422. A_UINT32 su_notify2_sched;
  2423. /* schedule if queued packets are greater than avg MSDUs in PPDU */
  2424. A_UINT32 su_optimal_queued_msdus_sched;
  2425. /* schedule due to timeout */
  2426. A_UINT32 su_delay_timeout_sched;
  2427. /* delay if txtime is less than 500us */
  2428. A_UINT32 su_min_txtime_sched_delay;
  2429. /* scheduled via no delay */
  2430. A_UINT32 su_no_delay;
  2431. /* Num of supercycles for this TxQ */
  2432. A_UINT32 num_supercycles;
  2433. /* Num of subcycles with sort for this TxQ */
  2434. A_UINT32 num_subcycles_with_sort;
  2435. /* Num of subcycles without sort for this Txq */
  2436. A_UINT32 num_subcycles_no_sort;
  2437. } htt_tx_pdev_stats_sched_per_txq_tlv;
  2438. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  2439. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  2440. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  2441. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  2442. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  2443. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  2446. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  2447. } while (0)
  2448. typedef struct {
  2449. htt_tlv_hdr_t tlv_hdr;
  2450. /* BIT [ 7 : 0] :- mac_id
  2451. * BIT [31 : 8] :- reserved
  2452. */
  2453. A_UINT32 mac_id__word;
  2454. /* Current timestamp */
  2455. A_UINT32 current_timestamp;
  2456. } htt_stats_tx_sched_cmn_tlv;
  2457. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  2458. * TLV_TAGS:
  2459. * - HTT_STATS_TX_SCHED_CMN_TAG
  2460. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  2461. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  2462. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  2463. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  2464. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  2465. * - HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG
  2466. */
  2467. /* NOTE:
  2468. * This structure is for documentation, and cannot be safely used directly.
  2469. * Instead, use the constituent TLV structures to fill/parse.
  2470. */
  2471. typedef struct {
  2472. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  2473. struct _txq_tx_sched_stats {
  2474. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  2475. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  2476. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  2477. htt_sched_txq_sched_order_su_tlv_v sched_order_su_tlv;
  2478. htt_sched_txq_sched_ineligibility_tlv_v sched_ineligibility_tlv;
  2479. htt_sched_txq_supercycle_triggers_tlv_v sched_supercycle_trigger_tlv;
  2480. } txq[1];
  2481. } htt_stats_tx_sched_t;
  2482. /* == TQM STATS == */
  2483. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
  2484. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  2485. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  2486. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2487. /* NOTE: Variable length TLV, use length spec to infer array size */
  2488. typedef struct {
  2489. htt_tlv_hdr_t tlv_hdr;
  2490. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  2491. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  2492. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2493. /* NOTE: Variable length TLV, use length spec to infer array size */
  2494. typedef struct {
  2495. htt_tlv_hdr_t tlv_hdr;
  2496. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  2497. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  2498. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2499. /* NOTE: Variable length TLV, use length spec to infer array size */
  2500. typedef struct {
  2501. htt_tlv_hdr_t tlv_hdr;
  2502. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  2503. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  2504. typedef struct {
  2505. htt_tlv_hdr_t tlv_hdr;
  2506. A_UINT32 msdu_count;
  2507. A_UINT32 mpdu_count;
  2508. A_UINT32 remove_msdu;
  2509. A_UINT32 remove_mpdu;
  2510. A_UINT32 remove_msdu_ttl;
  2511. A_UINT32 send_bar;
  2512. A_UINT32 bar_sync;
  2513. A_UINT32 notify_mpdu;
  2514. A_UINT32 sync_cmd;
  2515. A_UINT32 write_cmd;
  2516. A_UINT32 hwsch_trigger;
  2517. A_UINT32 ack_tlv_proc;
  2518. A_UINT32 gen_mpdu_cmd;
  2519. A_UINT32 gen_list_cmd;
  2520. A_UINT32 remove_mpdu_cmd;
  2521. A_UINT32 remove_mpdu_tried_cmd;
  2522. A_UINT32 mpdu_queue_stats_cmd;
  2523. A_UINT32 mpdu_head_info_cmd;
  2524. A_UINT32 msdu_flow_stats_cmd;
  2525. A_UINT32 remove_msdu_cmd;
  2526. A_UINT32 remove_msdu_ttl_cmd;
  2527. A_UINT32 flush_cache_cmd;
  2528. A_UINT32 update_mpduq_cmd;
  2529. A_UINT32 enqueue;
  2530. A_UINT32 enqueue_notify;
  2531. A_UINT32 notify_mpdu_at_head;
  2532. A_UINT32 notify_mpdu_state_valid;
  2533. /*
  2534. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  2535. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  2536. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  2537. * for non-UDP MSDUs.
  2538. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  2539. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  2540. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  2541. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  2542. *
  2543. * Notify signifies that we trigger the scheduler.
  2544. */
  2545. A_UINT32 sched_udp_notify1;
  2546. A_UINT32 sched_udp_notify2;
  2547. A_UINT32 sched_nonudp_notify1;
  2548. A_UINT32 sched_nonudp_notify2;
  2549. } htt_tx_tqm_pdev_stats_tlv_v;
  2550. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  2551. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  2552. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  2553. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  2554. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  2555. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  2556. do { \
  2557. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  2558. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  2559. } while (0)
  2560. typedef struct {
  2561. htt_tlv_hdr_t tlv_hdr;
  2562. /* BIT [ 7 : 0] :- mac_id
  2563. * BIT [31 : 8] :- reserved
  2564. */
  2565. A_UINT32 mac_id__word;
  2566. A_UINT32 max_cmdq_id;
  2567. A_UINT32 list_mpdu_cnt_hist_intvl;
  2568. /* Global stats */
  2569. A_UINT32 add_msdu;
  2570. A_UINT32 q_empty;
  2571. A_UINT32 q_not_empty;
  2572. A_UINT32 drop_notification;
  2573. A_UINT32 desc_threshold;
  2574. A_UINT32 hwsch_tqm_invalid_status;
  2575. A_UINT32 missed_tqm_gen_mpdus;
  2576. A_UINT32 tqm_active_tids;
  2577. A_UINT32 tqm_inactive_tids;
  2578. A_UINT32 tqm_active_msduq_flows;
  2579. } htt_tx_tqm_cmn_stats_tlv;
  2580. typedef struct {
  2581. htt_tlv_hdr_t tlv_hdr;
  2582. /* Error stats */
  2583. A_UINT32 q_empty_failure;
  2584. A_UINT32 q_not_empty_failure;
  2585. A_UINT32 add_msdu_failure;
  2586. /* TQM reset debug stats */
  2587. A_UINT32 tqm_cache_ctl_err;
  2588. A_UINT32 tqm_soft_reset;
  2589. A_UINT32 tqm_reset_total_num_in_use_link_descs;
  2590. A_UINT32 tqm_reset_worst_case_num_lost_link_descs;
  2591. A_UINT32 tqm_reset_worst_case_num_lost_host_tx_bufs_count;
  2592. A_UINT32 tqm_reset_num_in_use_link_descs_internal_tqm;
  2593. A_UINT32 tqm_reset_num_in_use_link_descs_wbm_idle_link_ring;
  2594. A_UINT32 tqm_reset_time_to_tqm_hang_delta_ms;
  2595. A_UINT32 tqm_reset_recovery_time_ms;
  2596. A_UINT32 tqm_reset_num_peers_hdl;
  2597. A_UINT32 tqm_reset_cumm_dirty_hw_mpduq_proc_cnt;
  2598. A_UINT32 tqm_reset_cumm_dirty_hw_msduq_proc;
  2599. A_UINT32 tqm_reset_flush_cache_cmd_su_cnt;
  2600. A_UINT32 tqm_reset_flush_cache_cmd_other_cnt;
  2601. A_UINT32 tqm_reset_flush_cache_cmd_trig_type;
  2602. A_UINT32 tqm_reset_flush_cache_cmd_trig_cfg;
  2603. A_UINT32 tqm_reset_flush_cache_cmd_skip_cmd_status_null;
  2604. } htt_tx_tqm_error_stats_tlv;
  2605. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  2606. * TLV_TAGS:
  2607. * - HTT_STATS_TX_TQM_CMN_TAG
  2608. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  2609. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  2610. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  2611. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  2612. * - HTT_STATS_TX_TQM_PDEV_TAG
  2613. */
  2614. /* NOTE:
  2615. * This structure is for documentation, and cannot be safely used directly.
  2616. * Instead, use the constituent TLV structures to fill/parse.
  2617. */
  2618. typedef struct {
  2619. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  2620. htt_tx_tqm_error_stats_tlv err_tlv;
  2621. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  2622. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  2623. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  2624. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  2625. } htt_tx_tqm_pdev_stats_t;
  2626. /* == TQM CMDQ stats == */
  2627. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  2628. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  2629. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  2630. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  2631. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  2632. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  2633. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  2634. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  2635. do { \
  2636. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  2637. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  2638. } while (0)
  2639. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  2640. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  2641. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  2642. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  2643. do { \
  2644. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  2645. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  2646. } while (0)
  2647. typedef struct {
  2648. htt_tlv_hdr_t tlv_hdr;
  2649. /* BIT [ 7 : 0] :- mac_id
  2650. * BIT [15 : 8] :- cmdq_id
  2651. * BIT [31 : 16] :- reserved
  2652. */
  2653. A_UINT32 mac_id__cmdq_id__word;
  2654. A_UINT32 sync_cmd;
  2655. A_UINT32 write_cmd;
  2656. A_UINT32 gen_mpdu_cmd;
  2657. A_UINT32 mpdu_queue_stats_cmd;
  2658. A_UINT32 mpdu_head_info_cmd;
  2659. A_UINT32 msdu_flow_stats_cmd;
  2660. A_UINT32 remove_mpdu_cmd;
  2661. A_UINT32 remove_msdu_cmd;
  2662. A_UINT32 flush_cache_cmd;
  2663. A_UINT32 update_mpduq_cmd;
  2664. A_UINT32 update_msduq_cmd;
  2665. } htt_tx_tqm_cmdq_status_tlv;
  2666. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  2667. * TLV_TAGS:
  2668. * - HTT_STATS_STRING_TAG
  2669. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  2670. */
  2671. /* NOTE:
  2672. * This structure is for documentation, and cannot be safely used directly.
  2673. * Instead, use the constituent TLV structures to fill/parse.
  2674. */
  2675. typedef struct {
  2676. struct _cmdq_stats {
  2677. htt_stats_string_tlv cmdq_str_tlv;
  2678. htt_tx_tqm_cmdq_status_tlv status_tlv;
  2679. } q[1];
  2680. } htt_tx_tqm_cmdq_stats_t;
  2681. /* == TX-DE STATS == */
  2682. /* Structures for tx de stats */
  2683. typedef struct {
  2684. htt_tlv_hdr_t tlv_hdr;
  2685. A_UINT32 m1_packets;
  2686. A_UINT32 m2_packets;
  2687. A_UINT32 m3_packets;
  2688. A_UINT32 m4_packets;
  2689. A_UINT32 g1_packets;
  2690. A_UINT32 g2_packets;
  2691. A_UINT32 rc4_packets;
  2692. A_UINT32 eap_packets;
  2693. A_UINT32 eapol_start_packets;
  2694. A_UINT32 eapol_logoff_packets;
  2695. A_UINT32 eapol_encap_asf_packets;
  2696. } htt_tx_de_eapol_packets_stats_tlv;
  2697. typedef struct {
  2698. htt_tlv_hdr_t tlv_hdr;
  2699. A_UINT32 ap_bss_peer_not_found;
  2700. A_UINT32 ap_bcast_mcast_no_peer;
  2701. A_UINT32 sta_delete_in_progress;
  2702. A_UINT32 ibss_no_bss_peer;
  2703. A_UINT32 invaild_vdev_type;
  2704. A_UINT32 invalid_ast_peer_entry;
  2705. A_UINT32 peer_entry_invalid;
  2706. A_UINT32 ethertype_not_ip;
  2707. A_UINT32 eapol_lookup_failed;
  2708. A_UINT32 qpeer_not_allow_data;
  2709. A_UINT32 fse_tid_override;
  2710. A_UINT32 ipv6_jumbogram_zero_length;
  2711. A_UINT32 qos_to_non_qos_in_prog;
  2712. A_UINT32 ap_bcast_mcast_eapol;
  2713. A_UINT32 unicast_on_ap_bss_peer;
  2714. A_UINT32 ap_vdev_invalid;
  2715. A_UINT32 incomplete_llc;
  2716. A_UINT32 eapol_duplicate_m3;
  2717. A_UINT32 eapol_duplicate_m4;
  2718. } htt_tx_de_classify_failed_stats_tlv;
  2719. typedef struct {
  2720. htt_tlv_hdr_t tlv_hdr;
  2721. A_UINT32 arp_packets;
  2722. A_UINT32 igmp_packets;
  2723. A_UINT32 dhcp_packets;
  2724. A_UINT32 host_inspected;
  2725. A_UINT32 htt_included;
  2726. A_UINT32 htt_valid_mcs;
  2727. A_UINT32 htt_valid_nss;
  2728. A_UINT32 htt_valid_preamble_type;
  2729. A_UINT32 htt_valid_chainmask;
  2730. A_UINT32 htt_valid_guard_interval;
  2731. A_UINT32 htt_valid_retries;
  2732. A_UINT32 htt_valid_bw_info;
  2733. A_UINT32 htt_valid_power;
  2734. A_UINT32 htt_valid_key_flags;
  2735. A_UINT32 htt_valid_no_encryption;
  2736. A_UINT32 fse_entry_count;
  2737. A_UINT32 fse_priority_be;
  2738. A_UINT32 fse_priority_high;
  2739. A_UINT32 fse_priority_low;
  2740. A_UINT32 fse_traffic_ptrn_be;
  2741. A_UINT32 fse_traffic_ptrn_over_sub;
  2742. A_UINT32 fse_traffic_ptrn_bursty;
  2743. A_UINT32 fse_traffic_ptrn_interactive;
  2744. A_UINT32 fse_traffic_ptrn_periodic;
  2745. A_UINT32 fse_hwqueue_alloc;
  2746. A_UINT32 fse_hwqueue_created;
  2747. A_UINT32 fse_hwqueue_send_to_host;
  2748. A_UINT32 mcast_entry;
  2749. A_UINT32 bcast_entry;
  2750. A_UINT32 htt_update_peer_cache;
  2751. A_UINT32 htt_learning_frame;
  2752. A_UINT32 fse_invalid_peer;
  2753. /*
  2754. * mec_notify is HTT TX WBM multicast echo check notification
  2755. * from firmware to host. FW sends SA addresses to host for all
  2756. * multicast/broadcast packets received on STA side.
  2757. */
  2758. A_UINT32 mec_notify;
  2759. } htt_tx_de_classify_stats_tlv;
  2760. typedef struct {
  2761. htt_tlv_hdr_t tlv_hdr;
  2762. A_UINT32 eok;
  2763. A_UINT32 classify_done;
  2764. A_UINT32 lookup_failed;
  2765. A_UINT32 send_host_dhcp;
  2766. A_UINT32 send_host_mcast;
  2767. A_UINT32 send_host_unknown_dest;
  2768. A_UINT32 send_host;
  2769. A_UINT32 status_invalid;
  2770. } htt_tx_de_classify_status_stats_tlv;
  2771. typedef struct {
  2772. htt_tlv_hdr_t tlv_hdr;
  2773. A_UINT32 enqueued_pkts;
  2774. A_UINT32 to_tqm;
  2775. A_UINT32 to_tqm_bypass;
  2776. } htt_tx_de_enqueue_packets_stats_tlv;
  2777. typedef struct {
  2778. htt_tlv_hdr_t tlv_hdr;
  2779. A_UINT32 discarded_pkts;
  2780. A_UINT32 local_frames;
  2781. A_UINT32 is_ext_msdu;
  2782. } htt_tx_de_enqueue_discard_stats_tlv;
  2783. typedef struct {
  2784. htt_tlv_hdr_t tlv_hdr;
  2785. A_UINT32 tcl_dummy_frame;
  2786. A_UINT32 tqm_dummy_frame;
  2787. A_UINT32 tqm_notify_frame;
  2788. A_UINT32 fw2wbm_enq;
  2789. A_UINT32 tqm_bypass_frame;
  2790. } htt_tx_de_compl_stats_tlv;
  2791. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  2792. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  2793. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  2794. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  2795. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  2796. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  2797. do { \
  2798. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  2799. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  2800. } while (0)
  2801. /*
  2802. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  2803. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  2804. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  2805. * 200us & again request for it. This is a histogram of time we wait, with
  2806. * bin of 200ms & there are 10 bin (2 seconds max)
  2807. * They are defined by the following macros in FW
  2808. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  2809. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  2810. * ENTRIES_PER_BIN_COUNT)
  2811. */
  2812. typedef struct {
  2813. htt_tlv_hdr_t tlv_hdr;
  2814. A_UINT32 fw2wbm_ring_full_hist[1];
  2815. } htt_tx_de_fw2wbm_ring_full_hist_tlv;
  2816. typedef struct {
  2817. htt_tlv_hdr_t tlv_hdr;
  2818. /* BIT [ 7 : 0] :- mac_id
  2819. * BIT [31 : 8] :- reserved
  2820. */
  2821. A_UINT32 mac_id__word;
  2822. /* Global Stats */
  2823. A_UINT32 tcl2fw_entry_count;
  2824. A_UINT32 not_to_fw;
  2825. A_UINT32 invalid_pdev_vdev_peer;
  2826. A_UINT32 tcl_res_invalid_addrx;
  2827. A_UINT32 wbm2fw_entry_count;
  2828. A_UINT32 invalid_pdev;
  2829. A_UINT32 tcl_res_addrx_timeout;
  2830. A_UINT32 invalid_vdev;
  2831. A_UINT32 invalid_tcl_exp_frame_desc;
  2832. A_UINT32 vdev_id_mismatch_cnt;
  2833. } htt_tx_de_cmn_stats_tlv;
  2834. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  2835. * TLV_TAGS:
  2836. * - HTT_STATS_TX_DE_CMN_TAG
  2837. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  2838. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  2839. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  2840. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  2841. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  2842. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  2843. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  2844. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  2845. */
  2846. /* NOTE:
  2847. * This structure is for documentation, and cannot be safely used directly.
  2848. * Instead, use the constituent TLV structures to fill/parse.
  2849. */
  2850. typedef struct {
  2851. htt_tx_de_cmn_stats_tlv cmn_tlv;
  2852. htt_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  2853. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  2854. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  2855. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  2856. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  2857. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  2858. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  2859. htt_tx_de_compl_stats_tlv comp_status_tlv;
  2860. } htt_tx_de_stats_t;
  2861. /* == RING-IF STATS == */
  2862. /* DWORD num_elems__prefetch_tail_idx */
  2863. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  2864. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  2865. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  2866. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  2867. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  2868. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  2869. HTT_RING_IF_STATS_NUM_ELEMS_S)
  2870. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  2873. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  2874. } while (0)
  2875. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  2876. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  2877. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  2878. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  2881. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  2882. } while (0)
  2883. /* DWORD head_idx__tail_idx */
  2884. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  2885. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  2886. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  2887. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  2888. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  2889. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  2890. HTT_RING_IF_STATS_HEAD_IDX_S)
  2891. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  2892. do { \
  2893. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  2894. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  2895. } while (0)
  2896. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  2897. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  2898. HTT_RING_IF_STATS_TAIL_IDX_S)
  2899. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  2900. do { \
  2901. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  2902. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  2903. } while (0)
  2904. /* DWORD shadow_head_idx__shadow_tail_idx */
  2905. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  2906. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  2907. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  2908. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  2909. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  2910. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  2911. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  2912. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  2913. do { \
  2914. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  2915. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  2916. } while (0)
  2917. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  2918. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  2919. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  2920. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  2921. do { \
  2922. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  2923. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  2924. } while (0)
  2925. /* DWORD lwm_thresh__hwm_thresh */
  2926. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  2927. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  2928. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  2929. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  2930. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  2931. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  2932. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  2933. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  2936. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  2937. } while (0)
  2938. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  2939. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  2940. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  2941. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  2944. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  2945. } while (0)
  2946. #define HTT_STATS_LOW_WM_BINS 5
  2947. #define HTT_STATS_HIGH_WM_BINS 5
  2948. typedef struct {
  2949. A_UINT32 base_addr; /* DWORD aligned base memory address of the ring */
  2950. A_UINT32 elem_size; /* size of each ring element */
  2951. /* BIT [15 : 0] :- num_elems
  2952. * BIT [31 : 16] :- prefetch_tail_idx
  2953. */
  2954. A_UINT32 num_elems__prefetch_tail_idx;
  2955. /* BIT [15 : 0] :- head_idx
  2956. * BIT [31 : 16] :- tail_idx
  2957. */
  2958. A_UINT32 head_idx__tail_idx;
  2959. /* BIT [15 : 0] :- shadow_head_idx
  2960. * BIT [31 : 16] :- shadow_tail_idx
  2961. */
  2962. A_UINT32 shadow_head_idx__shadow_tail_idx;
  2963. A_UINT32 num_tail_incr;
  2964. /* BIT [15 : 0] :- lwm_thresh
  2965. * BIT [31 : 16] :- hwm_thresh
  2966. */
  2967. A_UINT32 lwm_thresh__hwm_thresh;
  2968. A_UINT32 overrun_hit_count;
  2969. A_UINT32 underrun_hit_count;
  2970. A_UINT32 prod_blockwait_count;
  2971. A_UINT32 cons_blockwait_count;
  2972. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2973. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2974. } htt_ring_if_stats_tlv;
  2975. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  2976. #define HTT_RING_IF_CMN_MAC_ID_S 0
  2977. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  2978. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  2979. HTT_RING_IF_CMN_MAC_ID_S)
  2980. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  2983. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  2984. } while (0)
  2985. typedef struct {
  2986. htt_tlv_hdr_t tlv_hdr;
  2987. /* BIT [ 7 : 0] :- mac_id
  2988. * BIT [31 : 8] :- reserved
  2989. */
  2990. A_UINT32 mac_id__word;
  2991. A_UINT32 num_records;
  2992. } htt_ring_if_cmn_tlv;
  2993. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  2994. * TLV_TAGS:
  2995. * - HTT_STATS_RING_IF_CMN_TAG
  2996. * - HTT_STATS_STRING_TAG
  2997. * - HTT_STATS_RING_IF_TAG
  2998. */
  2999. /* NOTE:
  3000. * This structure is for documentation, and cannot be safely used directly.
  3001. * Instead, use the constituent TLV structures to fill/parse.
  3002. */
  3003. typedef struct {
  3004. htt_ring_if_cmn_tlv cmn_tlv;
  3005. /* Variable based on the Number of records. */
  3006. struct _ring_if {
  3007. htt_stats_string_tlv ring_str_tlv;
  3008. htt_ring_if_stats_tlv ring_tlv;
  3009. } r[1];
  3010. } htt_ring_if_stats_t;
  3011. /* == SFM STATS == */
  3012. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3013. /* NOTE: Variable length TLV, use length spec to infer array size */
  3014. typedef struct {
  3015. htt_tlv_hdr_t tlv_hdr;
  3016. /* Number of DWORDS used per user and per client */
  3017. A_UINT32 dwords_used_by_user_n[1];
  3018. } htt_sfm_client_user_tlv_v;
  3019. typedef struct {
  3020. htt_tlv_hdr_t tlv_hdr;
  3021. /* Client ID */
  3022. A_UINT32 client_id;
  3023. /* Minimum number of buffers */
  3024. A_UINT32 buf_min;
  3025. /* Maximum number of buffers */
  3026. A_UINT32 buf_max;
  3027. /* Number of Busy buffers */
  3028. A_UINT32 buf_busy;
  3029. /* Number of Allocated buffers */
  3030. A_UINT32 buf_alloc;
  3031. /* Number of Available/Usable buffers */
  3032. A_UINT32 buf_avail;
  3033. /* Number of users */
  3034. A_UINT32 num_users;
  3035. } htt_sfm_client_tlv;
  3036. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  3037. #define HTT_SFM_CMN_MAC_ID_S 0
  3038. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  3039. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  3040. HTT_SFM_CMN_MAC_ID_S)
  3041. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  3044. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  3045. } while (0)
  3046. typedef struct {
  3047. htt_tlv_hdr_t tlv_hdr;
  3048. /* BIT [ 7 : 0] :- mac_id
  3049. * BIT [31 : 8] :- reserved
  3050. */
  3051. A_UINT32 mac_id__word;
  3052. /* Indicates the total number of 128 byte buffers in the CMEM that are available for buffer sharing */
  3053. A_UINT32 buf_total;
  3054. /* Indicates for certain client or all the clients there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY */
  3055. A_UINT32 mem_empty;
  3056. /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  3057. A_UINT32 deallocate_bufs;
  3058. /* Number of Records */
  3059. A_UINT32 num_records;
  3060. } htt_sfm_cmn_tlv;
  3061. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  3062. * TLV_TAGS:
  3063. * - HTT_STATS_SFM_CMN_TAG
  3064. * - HTT_STATS_STRING_TAG
  3065. * - HTT_STATS_SFM_CLIENT_TAG
  3066. * - HTT_STATS_SFM_CLIENT_USER_TAG
  3067. */
  3068. /* NOTE:
  3069. * This structure is for documentation, and cannot be safely used directly.
  3070. * Instead, use the constituent TLV structures to fill/parse.
  3071. */
  3072. typedef struct {
  3073. htt_sfm_cmn_tlv cmn_tlv;
  3074. /* Variable based on the Number of records. */
  3075. struct _sfm_client {
  3076. htt_stats_string_tlv client_str_tlv;
  3077. htt_sfm_client_tlv client_tlv;
  3078. htt_sfm_client_user_tlv_v user_tlv;
  3079. } r[1];
  3080. } htt_sfm_stats_t;
  3081. /* == SRNG STATS == */
  3082. /* DWORD mac_id__ring_id__arena__ep */
  3083. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  3084. #define HTT_SRING_STATS_MAC_ID_S 0
  3085. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  3086. #define HTT_SRING_STATS_RING_ID_S 8
  3087. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  3088. #define HTT_SRING_STATS_ARENA_S 16
  3089. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  3090. #define HTT_SRING_STATS_EP_TYPE_S 24
  3091. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  3092. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  3093. HTT_SRING_STATS_MAC_ID_S)
  3094. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  3095. do { \
  3096. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  3097. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  3098. } while (0)
  3099. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  3100. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  3101. HTT_SRING_STATS_RING_ID_S)
  3102. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  3103. do { \
  3104. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  3105. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  3106. } while (0)
  3107. #define HTT_SRING_STATS_ARENA_GET(_var) \
  3108. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  3109. HTT_SRING_STATS_ARENA_S)
  3110. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  3111. do { \
  3112. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  3113. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  3114. } while (0)
  3115. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  3116. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  3117. HTT_SRING_STATS_EP_TYPE_S)
  3118. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  3119. do { \
  3120. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  3121. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  3122. } while (0)
  3123. /* DWORD num_avail_words__num_valid_words */
  3124. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  3125. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  3126. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  3127. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  3128. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  3129. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  3130. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  3131. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  3134. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  3135. } while (0)
  3136. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  3137. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  3138. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  3139. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  3142. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  3143. } while (0)
  3144. /* DWORD head_ptr__tail_ptr */
  3145. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  3146. #define HTT_SRING_STATS_HEAD_PTR_S 0
  3147. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  3148. #define HTT_SRING_STATS_TAIL_PTR_S 16
  3149. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  3150. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  3151. HTT_SRING_STATS_HEAD_PTR_S)
  3152. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  3153. do { \
  3154. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  3155. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  3156. } while (0)
  3157. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  3158. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  3159. HTT_SRING_STATS_TAIL_PTR_S)
  3160. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  3161. do { \
  3162. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  3163. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  3164. } while (0)
  3165. /* DWORD consumer_empty__producer_full */
  3166. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  3167. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  3168. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  3169. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  3170. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  3171. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  3172. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  3173. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  3176. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  3177. } while (0)
  3178. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  3179. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  3180. HTT_SRING_STATS_PRODUCER_FULL_S)
  3181. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  3182. do { \
  3183. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  3184. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  3185. } while (0)
  3186. /* DWORD prefetch_count__internal_tail_ptr */
  3187. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  3188. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  3189. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  3190. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  3191. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  3192. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  3193. HTT_SRING_STATS_PREFETCH_COUNT_S)
  3194. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  3195. do { \
  3196. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  3197. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  3198. } while (0)
  3199. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  3200. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  3201. HTT_SRING_STATS_INTERNAL_TP_S)
  3202. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  3203. do { \
  3204. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  3205. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  3206. } while (0)
  3207. typedef struct {
  3208. htt_tlv_hdr_t tlv_hdr;
  3209. /* BIT [ 7 : 0] :- mac_id
  3210. * BIT [15 : 8] :- ring_id
  3211. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  3212. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  3213. * BIT [31 : 25] :- reserved
  3214. */
  3215. A_UINT32 mac_id__ring_id__arena__ep;
  3216. A_UINT32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
  3217. A_UINT32 base_addr_msb;
  3218. A_UINT32 ring_size; /* size of ring */
  3219. A_UINT32 elem_size; /* size of each ring element */
  3220. /* Ring status */
  3221. /* BIT [15 : 0] :- num_avail_words
  3222. * BIT [31 : 16] :- num_valid_words
  3223. */
  3224. A_UINT32 num_avail_words__num_valid_words;
  3225. /* Index of head and tail */
  3226. /* BIT [15 : 0] :- head_ptr
  3227. * BIT [31 : 16] :- tail_ptr
  3228. */
  3229. A_UINT32 head_ptr__tail_ptr;
  3230. /* Empty or full counter of rings */
  3231. /* BIT [15 : 0] :- consumer_empty
  3232. * BIT [31 : 16] :- producer_full
  3233. */
  3234. A_UINT32 consumer_empty__producer_full;
  3235. /* Prefetch status of consumer ring */
  3236. /* BIT [15 : 0] :- prefetch_count
  3237. * BIT [31 : 16] :- internal_tail_ptr
  3238. */
  3239. A_UINT32 prefetch_count__internal_tail_ptr;
  3240. } htt_sring_stats_tlv;
  3241. typedef struct {
  3242. htt_tlv_hdr_t tlv_hdr;
  3243. A_UINT32 num_records;
  3244. } htt_sring_cmn_tlv;
  3245. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  3246. * TLV_TAGS:
  3247. * - HTT_STATS_SRING_CMN_TAG
  3248. * - HTT_STATS_STRING_TAG
  3249. * - HTT_STATS_SRING_STATS_TAG
  3250. */
  3251. /* NOTE:
  3252. * This structure is for documentation, and cannot be safely used directly.
  3253. * Instead, use the constituent TLV structures to fill/parse.
  3254. */
  3255. typedef struct {
  3256. htt_sring_cmn_tlv cmn_tlv;
  3257. /* Variable based on the Number of records. */
  3258. struct _sring_stats {
  3259. htt_stats_string_tlv sring_str_tlv;
  3260. htt_sring_stats_tlv sring_stats_tlv;
  3261. } r[1];
  3262. } htt_sring_stats_t;
  3263. /* == PDEV TX RATE CTRL STATS == */
  3264. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  3265. #define HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  3266. #define HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  3267. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  3268. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  3269. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  3270. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  3271. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  3272. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  3273. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  3274. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  3275. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  3276. #define HTT_TX_PDEV_STATS_NUM_11BE_TRIGGER_TYPES 6
  3277. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  3278. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  3279. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  3280. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  3281. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  3282. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  3283. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  3284. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  3285. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  3286. do { \
  3287. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  3288. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  3289. } while (0)
  3290. /*
  3291. * Introduce new TX counters to support 320MHz support and punctured modes
  3292. */
  3293. typedef enum {
  3294. HTT_TX_PDEV_STATS_PUNCTURED_NONE = 0,
  3295. HTT_TX_PDEV_STATS_PUNCTURED_20 = 1,
  3296. HTT_TX_PDEV_STATS_PUNCTURED_40 = 2,
  3297. HTT_TX_PDEV_STATS_PUNCTURED_80 = 3,
  3298. HTT_TX_PDEV_STATS_PUNCTURED_120 = 4,
  3299. HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  3300. } HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  3301. #define HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  3302. /* 11be related updates */
  3303. #define HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0...13,-2,-1 */
  3304. #define HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  3305. typedef struct {
  3306. htt_tlv_hdr_t tlv_hdr;
  3307. /* BIT [ 7 : 0] :- mac_id
  3308. * BIT [31 : 8] :- reserved
  3309. */
  3310. A_UINT32 mac_id__word;
  3311. /* Number of tx ldpc packets */
  3312. A_UINT32 tx_ldpc;
  3313. /* Number of tx rts packets */
  3314. A_UINT32 rts_cnt;
  3315. /* RSSI value of last ack packet (units = dB above noise floor) */
  3316. A_UINT32 ack_rssi;
  3317. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3318. /* tx_xx_mcs: currently unused */
  3319. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3320. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3321. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  3322. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  3323. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3324. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  3325. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  3326. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3327. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  3328. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  3329. /* Number of CTS-acknowledged RTS packets */
  3330. A_UINT32 rts_success;
  3331. /*
  3332. * Counters for legacy 11a and 11b transmissions.
  3333. *
  3334. * The index corresponds to:
  3335. *
  3336. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  3337. *
  3338. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  3339. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  3340. */
  3341. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  3342. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  3343. A_UINT32 ac_mu_mimo_tx_ldpc; /* 11AC VHT DL MU MIMO LDPC count */
  3344. A_UINT32 ax_mu_mimo_tx_ldpc; /* 11AX HE DL MU MIMO LDPC count */
  3345. A_UINT32 ofdma_tx_ldpc; /* 11AX HE DL MU OFDMA LDPC count */
  3346. /*
  3347. * Counters for 11ax HE LTF selection during TX.
  3348. *
  3349. * The index corresponds to:
  3350. *
  3351. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  3352. */
  3353. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  3354. /* 11AC VHT DL MU MIMO TX MCS stats */
  3355. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3356. /* 11AX HE DL MU MIMO TX MCS stats */
  3357. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3358. /* 11AX HE DL MU OFDMA TX MCS stats */
  3359. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3360. /* 11AC VHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  3361. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3362. /* 11AX HE DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  3363. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3364. /* 11AX HE DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  3365. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3366. /* 11AC VHT DL MU MIMO TX BW stats */
  3367. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3368. /* 11AX HE DL MU MIMO TX BW stats */
  3369. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3370. /* 11AX HE DL MU OFDMA TX BW stats */
  3371. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3372. /* 11AC VHT DL MU MIMO TX guard interval stats */
  3373. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3374. /* 11AX HE DL MU MIMO TX guard interval stats */
  3375. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3376. /* 11AX HE DL MU OFDMA TX guard interval stats */
  3377. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3378. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  3379. A_UINT32 tx_11ax_su_ext;
  3380. /* Stats for MCS 12/13 */
  3381. A_UINT32 tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3382. A_UINT32 tx_stbc_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3383. A_UINT32 tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3384. /* 11AX VHT DL MU MIMO extended TX MCS stats for MCS 12/13 */
  3385. A_UINT32 ax_mu_mimo_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3386. /* 11AX VHT DL MU OFDMA extended TX MCS stats for MCS 12/13 */
  3387. A_UINT32 ofdma_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3388. /* 11AX VHT DL MU MIMO extended TX guard interval stats for MCS 12/13 */
  3389. A_UINT32 ax_mu_mimo_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3390. /* 11AX VHT DL MU OFDMA extended TX guard interval stats for MCS 12/13 */
  3391. A_UINT32 ofdma_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3392. /* Stats for MCS 14/15 */
  3393. A_UINT32 tx_mcs_ext_2[HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  3394. A_UINT32 tx_bw_320mhz;
  3395. A_UINT32 tx_gi_ext_2[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  3396. A_UINT32 tx_su_punctured_mode[HTT_TX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  3397. A_UINT32 reduced_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3398. /* 11AC VHT DL MU MIMO TX BW stats at reduced channel config */
  3399. A_UINT32 reduced_ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3400. /* 11AX HE DL MU MIMO TX BW stats at reduced channel config */
  3401. A_UINT32 reduced_ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3402. /* 11AX HE DL MU OFDMA TX BW stats at reduced channel config */
  3403. A_UINT32 reduced_ax_mu_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3404. } htt_tx_pdev_rate_stats_tlv;
  3405. typedef struct {
  3406. /* 11be mode pdev rate stats; placed in a separate TLV to adhere to size restrictions */
  3407. htt_tlv_hdr_t tlv_hdr;
  3408. /* 11BE EHT DL MU MIMO TX MCS stats */
  3409. A_UINT32 be_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3410. /* 11BE EHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  3411. A_UINT32 be_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3412. /* 11BE EHT DL MU MIMO TX BW stats */
  3413. A_UINT32 be_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  3414. /* 11BE EHT DL MU MIMO TX guard interval stats */
  3415. A_UINT32 be_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3416. /* 11BE DL MU MIMO LDPC count */
  3417. A_UINT32 be_mu_mimo_tx_ldpc;
  3418. } htt_tx_pdev_rate_stats_be_tlv;
  3419. typedef struct {
  3420. htt_tlv_hdr_t tlv_hdr;
  3421. /* BIT [ 7 : 0] :- mac_id
  3422. * BIT [31 : 8] :- reserved
  3423. */
  3424. A_UINT32 mac_id__word;
  3425. A_UINT32 be_ofdma_tx_ldpc; /* 11BE EHT DL MU OFDMA LDPC count */
  3426. /* 11BE EHT DL MU OFDMA TX MCS stats */
  3427. A_UINT32 be_ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3428. /* 11BE EHT DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  3429. A_UINT32 be_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3430. /* 11BE EHT DL MU OFDMA TX BW stats */
  3431. A_UINT32 be_ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  3432. /* 11BE EHT DL MU OFDMA TX guard interval stats */
  3433. A_UINT32 be_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3434. } htt_tx_pdev_rate_stats_be_ofdma_tlv;
  3435. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  3436. * TLV_TAGS:
  3437. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  3438. */
  3439. /* NOTE:
  3440. * This structure is for documentation, and cannot be safely used directly.
  3441. * Instead, use the constituent TLV structures to fill/parse.
  3442. */
  3443. typedef struct {
  3444. htt_tx_pdev_rate_stats_tlv rate_tlv;
  3445. htt_tx_pdev_rate_stats_be_tlv rate_be_tlv;
  3446. } htt_tx_pdev_rate_stats_t;
  3447. /* == PDEV RX RATE CTRL STATS == */
  3448. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  3449. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  3450. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  3451. #define HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  3452. #define HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS 2 /* 14, 15 */
  3453. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14 /* 0-13 */
  3454. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  3455. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  3456. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  3457. #define HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS \
  3458. (HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS + HTT_RX_PDEV_STATS_NUM_BW_COUNTERS)
  3459. #define HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS 5 /* 20, 40, 80, 160, 320Mhz */
  3460. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  3461. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  3462. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  3463. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  3464. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  3465. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  3466. #define HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS 16 /* 0-13, -2, -1 */
  3467. #define HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS 5 /* 20,40,80,160,320 MHz */
  3468. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  3469. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  3470. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  3471. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  3472. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  3473. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  3474. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  3475. */
  3476. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  3477. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  3478. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  3479. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  3480. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  3481. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  3482. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  3483. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  3484. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  3485. */
  3486. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  3487. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  3488. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  3489. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  3490. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  3491. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  3492. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  3493. do { \
  3494. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  3495. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  3496. } while (0)
  3497. /* Introduce new RX counters to support 320MHZ support and punctured modes */
  3498. typedef enum {
  3499. HTT_RX_PDEV_STATS_PUNCTURED_NONE = 0,
  3500. HTT_RX_PDEV_STATS_PUNCTURED_20 = 1,
  3501. HTT_RX_PDEV_STATS_PUNCTURED_40 = 2,
  3502. HTT_RX_PDEV_STATS_PUNCTURED_80 = 3,
  3503. HTT_RX_PDEV_STATS_PUNCTURED_120 = 4,
  3504. HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS = 5
  3505. } HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_TYPE;
  3506. #define HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  3507. typedef struct {
  3508. htt_tlv_hdr_t tlv_hdr;
  3509. /* BIT [ 7 : 0] :- mac_id
  3510. * BIT [31 : 8] :- reserved
  3511. */
  3512. A_UINT32 mac_id__word;
  3513. A_UINT32 nsts;
  3514. /* Number of rx ldpc packets */
  3515. A_UINT32 rx_ldpc;
  3516. /* Number of rx rts packets */
  3517. A_UINT32 rts_cnt;
  3518. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  3519. A_UINT32 rssi_data; /* units = dB above noise floor */
  3520. A_UINT32 rssi_comb; /* units = dB above noise floor */
  3521. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3522. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  3523. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  3524. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3525. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  3526. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  3527. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  3528. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  3529. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3530. A_INT32 rssi_in_dbm; /* rx Signal Strength value in dBm unit */
  3531. A_UINT32 rx_11ax_su_ext;
  3532. A_UINT32 rx_11ac_mumimo;
  3533. A_UINT32 rx_11ax_mumimo;
  3534. A_UINT32 rx_11ax_ofdma;
  3535. A_UINT32 txbf;
  3536. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  3537. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  3538. A_UINT32 rx_active_dur_us_low;
  3539. A_UINT32 rx_active_dur_us_high;
  3540. /* number of times UL MU MIMO RX packets received */
  3541. A_UINT32 rx_11ax_ul_ofdma;
  3542. /* 11AX HE UL OFDMA RX TB PPDU MCS stats */
  3543. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3544. /* 11AX HE UL OFDMA RX TB PPDU GI stats */
  3545. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3546. /* 11AX HE UL OFDMA RX TB PPDU NSS stats (Increments the individual user NSS in the OFDMA PPDU received) */
  3547. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3548. /* 11AX HE UL OFDMA RX TB PPDU BW stats */
  3549. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3550. /* Number of times UL OFDMA TB PPDUs received with stbc */
  3551. A_UINT32 ul_ofdma_rx_stbc;
  3552. /* Number of times UL OFDMA TB PPDUs received with ldpc */
  3553. A_UINT32 ul_ofdma_rx_ldpc;
  3554. /* Number of non data PPDUs received for each degree (number of users) in UL OFDMA */
  3555. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3556. /* Number of data ppdus received for each degree (number of users) in UL OFDMA */
  3557. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3558. /* Number of mpdus passed for each degree (number of users) in UL OFDMA TB PPDU */
  3559. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3560. /* Number of mpdus failed for each degree (number of users) in UL OFDMA TB PPDU */
  3561. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3562. A_UINT32 nss_count;
  3563. A_UINT32 pilot_count;
  3564. /* RxEVM stats in dB */
  3565. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  3566. /* rx_pilot_evm_dB_mean:
  3567. * EVM mean across pilots, computed as
  3568. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  3569. */
  3570. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3571. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */
  3572. /* per_chain_rssi_pkt_type:
  3573. * This field shows what type of rx frame the per-chain RSSI was computed
  3574. * on, by recording the frame type and sub-type as bit-fields within this
  3575. * field:
  3576. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  3577. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  3578. * BIT [31 : 8] :- Reserved
  3579. */
  3580. A_UINT32 per_chain_rssi_pkt_type;
  3581. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3582. A_UINT32 rx_su_ndpa;
  3583. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3584. A_UINT32 rx_mu_ndpa;
  3585. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3586. A_UINT32 rx_br_poll;
  3587. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3588. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  3589. /* Number of non data ppdus received for each degree (number of users) with UL MUMIMO */
  3590. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3591. /* Number of data ppdus received for each degree (number of users) with UL MUMIMO */
  3592. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3593. /* Number of mpdus passed for each degree (number of users) with UL MUMIMO TB PPDU */
  3594. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3595. /* Number of mpdus failed for each degree (number of users) with UL MUMIMO TB PPDU */
  3596. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3597. /* Number of non data ppdus received for each degree (number of users) in UL OFDMA */
  3598. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3599. /* Number of data ppdus received for each degree (number of users) in UL OFDMA */
  3600. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3601. /*
  3602. * NOTE - this TLV is already large enough that it causes the HTT message
  3603. * carrying it to be nearly at the message size limit that applies to
  3604. * many targets/hosts.
  3605. * No further fields should be added to this TLV without very careful
  3606. * review to ensure the size increase is acceptable.
  3607. */
  3608. } htt_rx_pdev_rate_stats_tlv;
  3609. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  3610. * TLV_TAGS:
  3611. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  3612. */
  3613. /* NOTE:
  3614. * This structure is for documentation, and cannot be safely used directly.
  3615. * Instead, use the constituent TLV structures to fill/parse.
  3616. */
  3617. typedef struct {
  3618. htt_rx_pdev_rate_stats_tlv rate_tlv;
  3619. } htt_rx_pdev_rate_stats_t;
  3620. typedef struct {
  3621. htt_tlv_hdr_t tlv_hdr;
  3622. A_UINT8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS]; /* units = dB above noise floor */
  3623. A_INT8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  3624. A_INT32 rssi_mcast_in_dbm; /* rx mcast signal strength value in dBm unit */
  3625. A_INT32 rssi_mgmt_in_dbm; /* rx mgmt packet signal Strength value in dBm unit */
  3626. /*
  3627. * Stats for MCS 0-13 since rx_pdev_rate_stats_tlv cannot be updated,
  3628. * due to message size limitations.
  3629. */
  3630. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3631. A_UINT32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3632. A_UINT32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3633. A_UINT32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3634. A_UINT32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3635. A_UINT32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3636. A_UINT32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3637. A_UINT32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3638. /* MCS 14,15 */
  3639. A_UINT32 rx_mcs_ext_2[HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  3640. A_UINT32 rx_bw_ext[HTT_RX_PDEV_STATS_NUM_BW_EXT2_COUNTERS];
  3641. A_UINT32 rx_gi_ext_2[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA2_MCS_COUNTERS];
  3642. A_UINT32 rx_su_punctured_mode[HTT_RX_PDEV_STATS_NUM_PUNCTURED_MODE_COUNTERS];
  3643. A_UINT32 reduced_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3644. } htt_rx_pdev_rate_ext_stats_tlv;
  3645. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  3646. * TLV_TAGS:
  3647. * - HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG
  3648. */
  3649. /* NOTE:
  3650. * This structure is for documentation, and cannot be safely used directly.
  3651. * Instead, use the constituent TLV structures to fill/parse.
  3652. */
  3653. typedef struct {
  3654. htt_rx_pdev_rate_ext_stats_tlv rate_tlv;
  3655. } htt_rx_pdev_rate_ext_stats_t;
  3656. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  3657. #define HTT_STATS_CMN_MAC_ID_S 0
  3658. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  3659. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  3660. HTT_STATS_CMN_MAC_ID_S)
  3661. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  3664. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  3665. } while (0)
  3666. #define HTT_RX_UL_MAX_UPLINK_RSSI_TRACK 5
  3667. typedef struct {
  3668. htt_tlv_hdr_t tlv_hdr;
  3669. /* BIT [ 7 : 0] :- mac_id
  3670. * BIT [31 : 8] :- reserved
  3671. */
  3672. A_UINT32 mac_id__word;
  3673. A_UINT32 rx_11ax_ul_ofdma;
  3674. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3675. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3676. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3677. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3678. A_UINT32 ul_ofdma_rx_stbc;
  3679. A_UINT32 ul_ofdma_rx_ldpc;
  3680. /*
  3681. * These are arrays to hold the number of PPDUs that we received per RU.
  3682. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  3683. * array offset 0 and similarly RU52 will be incremented in array offset 1
  3684. */
  3685. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  3686. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  3687. /*
  3688. * These arrays hold Target RSSI (rx power the AP wants),
  3689. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  3690. * which can be identified by AIDs, during trigger based RX.
  3691. * Array acts a circular buffer and holds values for last 5 STAs
  3692. * in the same order as RX.
  3693. */
  3694. /* uplink_sta_aid:
  3695. * STA AID array for identifying which STA the
  3696. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  3697. */
  3698. A_UINT32 uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3699. /* uplink_sta_target_rssi:
  3700. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  3701. */
  3702. A_INT32 uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3703. /* uplink_sta_fd_rssi:
  3704. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  3705. */
  3706. A_INT32 uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3707. /* uplink_sta_power_headroom:
  3708. * Trig power headroom for STA AID in same idx - UNIT(dB)
  3709. */
  3710. A_UINT32 uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3711. A_UINT32 reduced_ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3712. } htt_rx_pdev_ul_trigger_stats_tlv;
  3713. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  3714. * TLV_TAGS:
  3715. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  3716. * NOTE:
  3717. * This structure is for documentation, and cannot be safely used directly.
  3718. * Instead, use the constituent TLV structures to fill/parse.
  3719. */
  3720. typedef struct {
  3721. htt_rx_pdev_ul_trigger_stats_tlv ul_trigger_tlv;
  3722. } htt_rx_pdev_ul_trigger_stats_t;
  3723. typedef struct {
  3724. htt_tlv_hdr_t tlv_hdr;
  3725. A_UINT32 user_index;
  3726. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  3727. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  3728. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  3729. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  3730. A_UINT32 rx_ulofdma_non_data_nusers;
  3731. A_UINT32 rx_ulofdma_data_nusers;
  3732. } htt_rx_pdev_ul_ofdma_user_stats_tlv;
  3733. typedef struct {
  3734. htt_tlv_hdr_t tlv_hdr;
  3735. A_UINT32 user_index;
  3736. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  3737. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  3738. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  3739. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  3740. } htt_rx_pdev_ul_mimo_user_stats_tlv;
  3741. /* == RX PDEV/SOC STATS == */
  3742. typedef struct {
  3743. htt_tlv_hdr_t tlv_hdr;
  3744. /*
  3745. * BIT [7:0] :- mac_id
  3746. * BIT [31:8] :- reserved
  3747. *
  3748. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  3749. */
  3750. A_UINT32 mac_id__word;
  3751. /* Number of times UL MUMIMO RX packets received */
  3752. A_UINT32 rx_11ax_ul_mumimo;
  3753. /* 11AX HE UL MU-MIMO RX TB PPDU MCS stats */
  3754. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3755. /*
  3756. * 11AX HE UL MU-MIMO RX GI & LTF stats.
  3757. * Index 0 indicates 1xLTF + 1.6 msec GI
  3758. * Index 1 indicates 2xLTF + 1.6 msec GI
  3759. * Index 2 indicates 4xLTF + 3.2 msec GI
  3760. */
  3761. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3762. /* 11AX HE UL MU-MIMO RX TB PPDU NSS stats (Increments the individual user NSS in the UL MU MIMO PPDU received) */
  3763. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3764. /* 11AX HE UL MU-MIMO RX TB PPDU BW stats */
  3765. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3766. /* Number of times UL MUMIMO TB PPDUs received with STBC */
  3767. A_UINT32 ul_mumimo_rx_stbc;
  3768. /* Number of times UL MUMIMO TB PPDUs received with LDPC */
  3769. A_UINT32 ul_mumimo_rx_ldpc;
  3770. /* Stats for MCS 12/13 */
  3771. A_UINT32 ul_mumimo_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3772. A_UINT32 ul_mumimo_rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3773. /* RSSI in dBm for Rx TB PPDUs */
  3774. A_INT8 rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS];
  3775. /* Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  3776. A_INT8 rx_ul_mumimo_target_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3777. /* FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  3778. A_INT8 rx_ul_mumimo_fd_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3779. /* Average pilot EVM measued for RX UL TB PPDU */
  3780. 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];
  3781. A_UINT32 reduced_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_REDUCED_CHAN_TYPES][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3782. } htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  3783. typedef struct {
  3784. htt_tlv_hdr_t tlv_hdr;
  3785. /*
  3786. * BIT [7:0] :- mac_id
  3787. * BIT [31:8] :- reserved
  3788. *
  3789. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  3790. */
  3791. A_UINT32 mac_id__word;
  3792. /* Number of times UL MUMIMO RX packets received */
  3793. A_UINT32 rx_11be_ul_mumimo;
  3794. /* 11BE EHT UL MU-MIMO RX TB PPDU MCS stats */
  3795. A_UINT32 be_ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3796. /*
  3797. * 11BE EHT UL MU-MIMO RX GI & LTF stats.
  3798. * Index 0 indicates 1xLTF + 1.6 msec GI
  3799. * Index 1 indicates 2xLTF + 1.6 msec GI
  3800. * Index 2 indicates 4xLTF + 3.2 msec GI
  3801. */
  3802. A_UINT32 be_ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_BE_MCS_COUNTERS];
  3803. /* 11BE EHT UL MU-MIMO RX TB PPDU NSS stats (Increments the individual user NSS in the UL MU MIMO PPDU received) */
  3804. A_UINT32 be_ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3805. /* 11BE EHT UL MU-MIMO RX TB PPDU BW stats */
  3806. A_UINT32 be_ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  3807. /* Number of times UL MUMIMO TB PPDUs received with STBC */
  3808. A_UINT32 be_ul_mumimo_rx_stbc;
  3809. /* Number of times UL MUMIMO TB PPDUs received with LDPC */
  3810. A_UINT32 be_ul_mumimo_rx_ldpc;
  3811. /* RSSI in dBm for Rx TB PPDUs */
  3812. 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];
  3813. /* Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  3814. A_INT8 be_rx_ul_mumimo_target_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_NUM_BE_BW_COUNTERS];
  3815. /* FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  3816. A_INT8 be_rx_ul_mumimo_fd_rssi[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3817. /* Average pilot EVM measued for RX UL TB PPDU */
  3818. A_INT8 be_rx_ulmumimo_pilot_evm_dB_mean[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3819. } htt_rx_pdev_ul_mumimo_trig_be_stats_tlv;
  3820. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  3821. * TLV_TAGS:
  3822. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  3823. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG
  3824. */
  3825. typedef struct {
  3826. htt_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  3827. htt_rx_pdev_ul_mumimo_trig_be_stats_tlv ul_mumimo_trig_be_tlv;
  3828. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  3829. typedef struct {
  3830. htt_tlv_hdr_t tlv_hdr;
  3831. /* Num Packets received on REO FW ring */
  3832. A_UINT32 fw_reo_ring_data_msdu;
  3833. /* Num bc/mc packets indicated from fw to host */
  3834. A_UINT32 fw_to_host_data_msdu_bcmc;
  3835. /* Num unicast packets indicated from fw to host */
  3836. A_UINT32 fw_to_host_data_msdu_uc;
  3837. /* Num remote buf recycle from offload */
  3838. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  3839. /* Num remote free buf given to offload */
  3840. A_UINT32 ofld_remote_free_buf_indication_cnt;
  3841. /* Num unicast packets from local path indicated to host */
  3842. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  3843. /* Num unicast packets from REO indicated to host */
  3844. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  3845. /* Num Packets received from WBM SW1 ring */
  3846. A_UINT32 wbm_sw_ring_reap;
  3847. /* Num packets from WBM forwarded from fw to host via WBM */
  3848. A_UINT32 wbm_forward_to_host_cnt;
  3849. /* Num packets from WBM recycled to target refill ring */
  3850. A_UINT32 wbm_target_recycle_cnt;
  3851. /* Total Num of recycled to refill ring, including packets from WBM and REO */
  3852. A_UINT32 target_refill_ring_recycle_cnt;
  3853. } htt_rx_soc_fw_stats_tlv;
  3854. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3855. /* NOTE: Variable length TLV, use length spec to infer array size */
  3856. typedef struct {
  3857. htt_tlv_hdr_t tlv_hdr;
  3858. /* Num ring empty encountered */
  3859. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  3860. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  3861. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3862. /* NOTE: Variable length TLV, use length spec to infer array size */
  3863. typedef struct {
  3864. htt_tlv_hdr_t tlv_hdr;
  3865. /* Num total buf refilled from refill ring */
  3866. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  3867. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  3868. /* RXDMA error code from WBM released packets */
  3869. typedef enum {
  3870. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  3871. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  3872. HTT_RX_RXDMA_FCS_ERR = 2,
  3873. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  3874. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  3875. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  3876. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  3877. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  3878. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  3879. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  3880. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  3881. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  3882. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  3883. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  3884. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  3885. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  3886. /*
  3887. * This MAX_ERR_CODE should not be used in any host/target messages,
  3888. * so that even though it is defined within a host/target interface
  3889. * definition header file, it isn't actually part of the host/target
  3890. * interface, and thus can be modified.
  3891. */
  3892. HTT_RX_RXDMA_MAX_ERR_CODE
  3893. } htt_rx_rxdma_error_code_enum;
  3894. /* NOTE: Variable length TLV, use length spec to infer array size */
  3895. typedef struct {
  3896. htt_tlv_hdr_t tlv_hdr;
  3897. /* NOTE:
  3898. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  3899. * It is expected but not required that the target will provide a rxdma_err element
  3900. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  3901. * MAX_ERR_CODE. The host should ignore any array elements whose
  3902. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3903. */
  3904. A_UINT32 rxdma_err[1]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
  3905. } htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  3906. /* REO error code from WBM released packets */
  3907. typedef enum {
  3908. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  3909. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  3910. HTT_RX_AMPDU_IN_NON_BA = 2,
  3911. HTT_RX_NON_BA_DUPLICATE = 3,
  3912. HTT_RX_BA_DUPLICATE = 4,
  3913. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  3914. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  3915. HTT_RX_REGULAR_FRAME_OOR = 7,
  3916. HTT_RX_BAR_FRAME_OOR = 8,
  3917. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  3918. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  3919. HTT_RX_PN_CHECK_FAILED = 11,
  3920. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  3921. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  3922. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  3923. HTT_RX_REO_ERR_CODE_RVSD = 15,
  3924. /*
  3925. * This MAX_ERR_CODE should not be used in any host/target messages,
  3926. * so that even though it is defined within a host/target interface
  3927. * definition header file, it isn't actually part of the host/target
  3928. * interface, and thus can be modified.
  3929. */
  3930. HTT_RX_REO_MAX_ERR_CODE
  3931. } htt_rx_reo_error_code_enum;
  3932. /* NOTE: Variable length TLV, use length spec to infer array size */
  3933. typedef struct {
  3934. htt_tlv_hdr_t tlv_hdr;
  3935. /* NOTE:
  3936. * The mapping of REO error types to reo_err array elements is HW dependent.
  3937. * It is expected but not required that the target will provide a rxdma_err element
  3938. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  3939. * MAX_ERR_CODE. The host should ignore any array elements whose
  3940. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3941. */
  3942. A_UINT32 reo_err[1]; /* HTT_RX_REO_MAX_ERR_CODE */
  3943. } htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  3944. /* NOTE:
  3945. * This structure is for documentation, and cannot be safely used directly.
  3946. * Instead, use the constituent TLV structures to fill/parse.
  3947. */
  3948. typedef struct {
  3949. htt_rx_soc_fw_stats_tlv fw_tlv;
  3950. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  3951. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  3952. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v fw_refill_ring_num_rxdma_err_tlv;
  3953. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v fw_refill_ring_num_reo_err_tlv;
  3954. } htt_rx_soc_stats_t;
  3955. /* == RX PDEV STATS == */
  3956. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  3957. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  3958. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  3959. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  3960. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  3961. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  3962. do { \
  3963. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  3964. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  3965. } while (0)
  3966. typedef struct {
  3967. htt_tlv_hdr_t tlv_hdr;
  3968. /* BIT [ 7 : 0] :- mac_id
  3969. * BIT [31 : 8] :- reserved
  3970. */
  3971. A_UINT32 mac_id__word;
  3972. /* Num PPDU status processed from HW */
  3973. A_UINT32 ppdu_recvd;
  3974. /* Num MPDU across PPDUs with FCS ok */
  3975. A_UINT32 mpdu_cnt_fcs_ok;
  3976. /* Num MPDU across PPDUs with FCS err */
  3977. A_UINT32 mpdu_cnt_fcs_err;
  3978. /* Num MSDU across PPDUs */
  3979. A_UINT32 tcp_msdu_cnt;
  3980. /* Num MSDU across PPDUs */
  3981. A_UINT32 tcp_ack_msdu_cnt;
  3982. /* Num MSDU across PPDUs */
  3983. A_UINT32 udp_msdu_cnt;
  3984. /* Num MSDU across PPDUs */
  3985. A_UINT32 other_msdu_cnt;
  3986. /* Num MPDU on FW ring indicated */
  3987. A_UINT32 fw_ring_mpdu_ind;
  3988. /* Num MGMT MPDU given to protocol */
  3989. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  3990. /* Num ctrl MPDU given to protocol */
  3991. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  3992. /* Num mcast data packet received */
  3993. A_UINT32 fw_ring_mcast_data_msdu;
  3994. /* Num broadcast data packet received */
  3995. A_UINT32 fw_ring_bcast_data_msdu;
  3996. /* Num unicat data packet received */
  3997. A_UINT32 fw_ring_ucast_data_msdu;
  3998. /* Num null data packet received */
  3999. A_UINT32 fw_ring_null_data_msdu;
  4000. /* Num MPDU on FW ring dropped */
  4001. A_UINT32 fw_ring_mpdu_drop;
  4002. /* Num buf indication to offload */
  4003. A_UINT32 ofld_local_data_ind_cnt;
  4004. /* Num buf recycle from offload */
  4005. A_UINT32 ofld_local_data_buf_recycle_cnt;
  4006. /* Num buf indication to data_rx */
  4007. A_UINT32 drx_local_data_ind_cnt;
  4008. /* Num buf recycle from data_rx */
  4009. A_UINT32 drx_local_data_buf_recycle_cnt;
  4010. /* Num buf indication to protocol */
  4011. A_UINT32 local_nondata_ind_cnt;
  4012. /* Num buf recycle from protocol */
  4013. A_UINT32 local_nondata_buf_recycle_cnt;
  4014. /* Num buf fed */
  4015. A_UINT32 fw_status_buf_ring_refill_cnt;
  4016. /* Num ring empty encountered */
  4017. A_UINT32 fw_status_buf_ring_empty_cnt;
  4018. /* Num buf fed */
  4019. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  4020. /* Num ring empty encountered */
  4021. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  4022. /* Num buf fed */
  4023. A_UINT32 fw_link_buf_ring_refill_cnt;
  4024. /* Num ring empty encountered */
  4025. A_UINT32 fw_link_buf_ring_empty_cnt;
  4026. /* Num buf fed */
  4027. A_UINT32 host_pkt_buf_ring_refill_cnt;
  4028. /* Num ring empty encountered */
  4029. A_UINT32 host_pkt_buf_ring_empty_cnt;
  4030. /* Num buf fed */
  4031. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  4032. /* Num ring empty encountered */
  4033. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  4034. /* Num buf fed */
  4035. A_UINT32 mon_status_buf_ring_refill_cnt;
  4036. /* Num ring empty encountered */
  4037. A_UINT32 mon_status_buf_ring_empty_cnt;
  4038. /* Num buf fed */
  4039. A_UINT32 mon_desc_buf_ring_refill_cnt;
  4040. /* Num ring empty encountered */
  4041. A_UINT32 mon_desc_buf_ring_empty_cnt;
  4042. /* Num buf fed */
  4043. A_UINT32 mon_dest_ring_update_cnt;
  4044. /* Num ring full encountered */
  4045. A_UINT32 mon_dest_ring_full_cnt;
  4046. /* Num rx suspend is attempted */
  4047. A_UINT32 rx_suspend_cnt;
  4048. /* Num rx suspend failed */
  4049. A_UINT32 rx_suspend_fail_cnt;
  4050. /* Num rx resume attempted */
  4051. A_UINT32 rx_resume_cnt;
  4052. /* Num rx resume failed */
  4053. A_UINT32 rx_resume_fail_cnt;
  4054. /* Num rx ring switch */
  4055. A_UINT32 rx_ring_switch_cnt;
  4056. /* Num rx ring restore */
  4057. A_UINT32 rx_ring_restore_cnt;
  4058. /* Num rx flush issued */
  4059. A_UINT32 rx_flush_cnt;
  4060. /* Num rx recovery */
  4061. A_UINT32 rx_recovery_reset_cnt;
  4062. } htt_rx_pdev_fw_stats_tlv;
  4063. typedef struct {
  4064. htt_tlv_hdr_t tlv_hdr;
  4065. /* peer mac address */
  4066. htt_mac_addr peer_mac_addr;
  4067. /* Num of tx mgmt frames with subtype on peer level */
  4068. A_UINT32 peer_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  4069. /* Num of rx mgmt frames with subtype on peer level */
  4070. A_UINT32 peer_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  4071. } htt_peer_ctrl_path_txrx_stats_tlv;
  4072. #define HTT_STATS_PHY_ERR_MAX 43
  4073. typedef struct {
  4074. htt_tlv_hdr_t tlv_hdr;
  4075. /* BIT [ 7 : 0] :- mac_id
  4076. * BIT [31 : 8] :- reserved
  4077. */
  4078. A_UINT32 mac_id__word;
  4079. /* Num of phy err */
  4080. A_UINT32 total_phy_err_cnt;
  4081. /* Counts of different types of phy errs
  4082. * The mapping of PHY error types to phy_err array elements is HW dependent.
  4083. * The only currently-supported mapping is shown below:
  4084. *
  4085. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  4086. * 1 phyrx_err_synth_off
  4087. * 2 phyrx_err_ofdma_timing
  4088. * 3 phyrx_err_ofdma_signal_parity
  4089. * 4 phyrx_err_ofdma_rate_illegal
  4090. * 5 phyrx_err_ofdma_length_illegal
  4091. * 6 phyrx_err_ofdma_restart
  4092. * 7 phyrx_err_ofdma_service
  4093. * 8 phyrx_err_ppdu_ofdma_power_drop
  4094. * 9 phyrx_err_cck_blokker
  4095. * 10 phyrx_err_cck_timing
  4096. * 11 phyrx_err_cck_header_crc
  4097. * 12 phyrx_err_cck_rate_illegal
  4098. * 13 phyrx_err_cck_length_illegal
  4099. * 14 phyrx_err_cck_restart
  4100. * 15 phyrx_err_cck_service
  4101. * 16 phyrx_err_cck_power_drop
  4102. * 17 phyrx_err_ht_crc_err
  4103. * 18 phyrx_err_ht_length_illegal
  4104. * 19 phyrx_err_ht_rate_illegal
  4105. * 20 phyrx_err_ht_zlf
  4106. * 21 phyrx_err_false_radar_ext
  4107. * 22 phyrx_err_green_field
  4108. * 23 phyrx_err_bw_gt_dyn_bw
  4109. * 24 phyrx_err_leg_ht_mismatch
  4110. * 25 phyrx_err_vht_crc_error
  4111. * 26 phyrx_err_vht_siga_unsupported
  4112. * 27 phyrx_err_vht_lsig_len_invalid
  4113. * 28 phyrx_err_vht_ndp_or_zlf
  4114. * 29 phyrx_err_vht_nsym_lt_zero
  4115. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  4116. * 31 phyrx_err_vht_rx_skip_group_id0
  4117. * 32 phyrx_err_vht_rx_skip_group_id1to62
  4118. * 33 phyrx_err_vht_rx_skip_group_id63
  4119. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  4120. * 35 phyrx_err_defer_nap
  4121. * 36 phyrx_err_fdomain_timeout
  4122. * 37 phyrx_err_lsig_rel_check
  4123. * 38 phyrx_err_bt_collision
  4124. * 39 phyrx_err_unsupported_mu_feedback
  4125. * 40 phyrx_err_ppdu_tx_interrupt_rx
  4126. * 41 phyrx_err_unsupported_cbf
  4127. * 42 phyrx_err_other
  4128. */
  4129. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  4130. } htt_rx_pdev_fw_stats_phy_err_tlv;
  4131. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  4132. /* NOTE: Variable length TLV, use length spec to infer array size */
  4133. typedef struct {
  4134. htt_tlv_hdr_t tlv_hdr;
  4135. /* Num error MPDU for each RxDMA error type */
  4136. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  4137. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  4138. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  4139. /* NOTE: Variable length TLV, use length spec to infer array size */
  4140. typedef struct {
  4141. htt_tlv_hdr_t tlv_hdr;
  4142. /* Num MPDU dropped */
  4143. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  4144. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  4145. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  4146. * TLV_TAGS:
  4147. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  4148. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  4149. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  4150. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  4151. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  4152. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  4153. */
  4154. /* NOTE:
  4155. * This structure is for documentation, and cannot be safely used directly.
  4156. * Instead, use the constituent TLV structures to fill/parse.
  4157. */
  4158. typedef struct {
  4159. htt_rx_soc_stats_t soc_stats;
  4160. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  4161. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  4162. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  4163. htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  4164. } htt_rx_pdev_stats_t;
  4165. /* STATS_TYPE : HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  4166. * TLV_TAGS:
  4167. * - HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG
  4168. *
  4169. */
  4170. typedef struct {
  4171. htt_peer_ctrl_path_txrx_stats_tlv peer_ctrl_path_txrx_stats_tlv;
  4172. } htt_ctrl_path_txrx_stats_t;
  4173. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  4174. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  4175. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  4176. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  4177. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  4178. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  4179. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  4180. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  4181. typedef struct {
  4182. htt_tlv_hdr_t tlv_hdr;
  4183. /* Below values are obtained from the HW Cycles counter registers */
  4184. A_UINT32 tx_frame_usec;
  4185. A_UINT32 rx_frame_usec;
  4186. A_UINT32 rx_clear_usec;
  4187. A_UINT32 my_rx_frame_usec;
  4188. A_UINT32 usec_cnt;
  4189. A_UINT32 med_rx_idle_usec;
  4190. A_UINT32 med_tx_idle_global_usec;
  4191. A_UINT32 cca_obss_usec;
  4192. } htt_pdev_stats_cca_counters_tlv;
  4193. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  4194. * due to lack of support in some host stats infrastructures for
  4195. * TLVs nested within TLVs.
  4196. */
  4197. typedef struct {
  4198. htt_tlv_hdr_t tlv_hdr;
  4199. /* The channel number on which these stats were collected */
  4200. A_UINT32 chan_num;
  4201. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  4202. A_UINT32 num_records;
  4203. /*
  4204. * Bit map of valid CCA counters
  4205. * Bit0 - tx_frame_usec
  4206. * Bit1 - rx_frame_usec
  4207. * Bit2 - rx_clear_usec
  4208. * Bit3 - my_rx_frame_usec
  4209. * bit4 - usec_cnt
  4210. * Bit5 - med_rx_idle_usec
  4211. * Bit6 - med_tx_idle_global_usec
  4212. * Bit7 - cca_obss_usec
  4213. *
  4214. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  4215. */
  4216. A_UINT32 valid_cca_counters_bitmap;
  4217. /* Indicates the stats collection interval
  4218. * Valid Values:
  4219. * 100 - For the 100ms interval CCA stats histogram
  4220. * 1000 - For 1sec interval CCA histogram
  4221. * 0xFFFFFFFF - For Cumulative CCA Stats
  4222. */
  4223. A_UINT32 collection_interval;
  4224. /**
  4225. * This will be followed by an array which contains the CCA stats
  4226. * collected in the last N intervals,
  4227. * if the indication is for last N intervals CCA stats.
  4228. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  4229. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  4230. */
  4231. htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  4232. } htt_pdev_cca_stats_hist_tlv;
  4233. typedef struct {
  4234. htt_tlv_hdr_t tlv_hdr;
  4235. /* The channel number on which these stats were collected */
  4236. A_UINT32 chan_num;
  4237. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  4238. A_UINT32 num_records;
  4239. /*
  4240. * Bit map of valid CCA counters
  4241. * Bit0 - tx_frame_usec
  4242. * Bit1 - rx_frame_usec
  4243. * Bit2 - rx_clear_usec
  4244. * Bit3 - my_rx_frame_usec
  4245. * bit4 - usec_cnt
  4246. * Bit5 - med_rx_idle_usec
  4247. * Bit6 - med_tx_idle_global_usec
  4248. * Bit7 - cca_obss_usec
  4249. *
  4250. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  4251. */
  4252. A_UINT32 valid_cca_counters_bitmap;
  4253. /* Indicates the stats collection interval
  4254. * Valid Values:
  4255. * 100 - For the 100ms interval CCA stats histogram
  4256. * 1000 - For 1sec interval CCA histogram
  4257. * 0xFFFFFFFF - For Cumulative CCA Stats
  4258. */
  4259. A_UINT32 collection_interval;
  4260. /**
  4261. * This will be followed by an array which contains the CCA stats
  4262. * collected in the last N intervals,
  4263. * if the indication is for last N intervals CCA stats.
  4264. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  4265. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  4266. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  4267. */
  4268. } htt_pdev_cca_stats_hist_v1_tlv;
  4269. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000ffff
  4270. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  4271. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  4272. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  4273. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  4274. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  4275. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  4276. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  4277. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  4278. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  4279. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  4280. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  4283. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  4284. } while (0)
  4285. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  4286. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  4287. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  4288. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  4289. do { \
  4290. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  4291. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  4292. } while (0)
  4293. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  4294. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  4295. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  4296. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  4297. do { \
  4298. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  4299. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  4300. } while (0)
  4301. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  4302. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  4303. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  4304. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  4307. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  4308. } while (0)
  4309. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  4310. typedef struct {
  4311. htt_tlv_hdr_t tlv_hdr;
  4312. A_UINT32 vdev_id;
  4313. htt_mac_addr peer_mac;
  4314. A_UINT32 flow_id_flags;
  4315. A_UINT32 dialog_id; /* TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is not initiated by host */
  4316. A_UINT32 wake_dura_us;
  4317. A_UINT32 wake_intvl_us;
  4318. A_UINT32 sp_offset_us;
  4319. } htt_pdev_stats_twt_session_tlv;
  4320. typedef struct {
  4321. htt_tlv_hdr_t tlv_hdr;
  4322. A_UINT32 pdev_id;
  4323. A_UINT32 num_sessions;
  4324. htt_pdev_stats_twt_session_tlv twt_session[1];
  4325. } htt_pdev_stats_twt_sessions_tlv;
  4326. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  4327. * TLV_TAGS:
  4328. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  4329. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  4330. */
  4331. /* NOTE:
  4332. * This structure is for documentation, and cannot be safely used directly.
  4333. * Instead, use the constituent TLV structures to fill/parse.
  4334. */
  4335. typedef struct {
  4336. htt_pdev_stats_twt_sessions_tlv twt_sessions[1];
  4337. } htt_pdev_twt_sessions_stats_t;
  4338. typedef enum {
  4339. /* Global link descriptor queued in REO */
  4340. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  4341. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  4342. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  4343. /*Number of queue descriptors of this aging group */
  4344. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  4345. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  4346. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  4347. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  4348. /* Total number of MSDUs buffered in AC */
  4349. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  4350. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  4351. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  4352. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  4353. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  4354. } htt_rx_reo_resource_sample_id_enum;
  4355. typedef struct {
  4356. htt_tlv_hdr_t tlv_hdr;
  4357. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  4358. /* htt_rx_reo_debug_sample_id_enum */
  4359. A_UINT32 sample_id;
  4360. /* Max value of all samples */
  4361. A_UINT32 total_max;
  4362. /* Average value of total samples */
  4363. A_UINT32 total_avg;
  4364. /* Num of samples including both zeros and non zeros ones*/
  4365. A_UINT32 total_sample;
  4366. /* Average value of all non zeros samples */
  4367. A_UINT32 non_zeros_avg;
  4368. /* Num of non zeros samples */
  4369. A_UINT32 non_zeros_sample;
  4370. /* Max value of last N non zero samples (N = last_non_zeros_sample) */
  4371. A_UINT32 last_non_zeros_max;
  4372. /* Min value of last N non zero samples (N = last_non_zeros_sample) */
  4373. A_UINT32 last_non_zeros_min;
  4374. /* Average value of last N non zero samples (N = last_non_zeros_sample) */
  4375. A_UINT32 last_non_zeros_avg;
  4376. /* Num of last non zero samples */
  4377. A_UINT32 last_non_zeros_sample;
  4378. } htt_rx_reo_resource_stats_tlv_v;
  4379. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  4380. * TLV_TAGS:
  4381. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  4382. */
  4383. /* NOTE:
  4384. * This structure is for documentation, and cannot be safely used directly.
  4385. * Instead, use the constituent TLV structures to fill/parse.
  4386. */
  4387. typedef struct {
  4388. htt_rx_reo_resource_stats_tlv_v reo_resource_stats;
  4389. } htt_soc_reo_resource_stats_t;
  4390. /* == TX SOUNDING STATS == */
  4391. /* config_param0 */
  4392. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  4393. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  4394. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  4395. typedef enum {
  4396. /* Implicit beamforming stats */
  4397. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  4398. /* Single user short inter frame sequence steer stats */
  4399. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  4400. /* Single user random back off steer stats */
  4401. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  4402. /* Multi user short inter frame sequence steer stats */
  4403. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  4404. /* Multi user random back off steer stats */
  4405. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  4406. /* For backward compatability new modes cannot be added */
  4407. HTT_TXBF_MAX_NUM_OF_MODES = 5
  4408. } htt_txbf_sound_steer_modes;
  4409. typedef enum {
  4410. HTT_TX_AC_SOUNDING_MODE = 0,
  4411. HTT_TX_AX_SOUNDING_MODE = 1,
  4412. HTT_TX_BE_SOUNDING_MODE = 2,
  4413. } htt_stats_sounding_tx_mode;
  4414. typedef struct {
  4415. htt_tlv_hdr_t tlv_hdr;
  4416. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  4417. /* Counts number of soundings for all steering modes in each bw */
  4418. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  4419. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  4420. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  4421. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  4422. /*
  4423. * The sounding array is a 2-D array stored as an 1-D array of
  4424. * A_UINT32. The stats for a particular user/bw combination is
  4425. * referenced with the following:
  4426. *
  4427. * sounding[(user* max_bw) + bw]
  4428. *
  4429. * ... where max_bw == 4 for 160mhz
  4430. */
  4431. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  4432. /* cv upload handler stats */
  4433. A_UINT32 cv_nc_mismatch_err;
  4434. A_UINT32 cv_fcs_err;
  4435. A_UINT32 cv_frag_idx_mismatch;
  4436. A_UINT32 cv_invalid_peer_id;
  4437. A_UINT32 cv_no_txbf_setup;
  4438. A_UINT32 cv_expiry_in_update;
  4439. A_UINT32 cv_pkt_bw_exceed;
  4440. A_UINT32 cv_dma_not_done_err;
  4441. A_UINT32 cv_update_failed;
  4442. /* cv query stats */
  4443. A_UINT32 cv_total_query;
  4444. A_UINT32 cv_total_pattern_query;
  4445. A_UINT32 cv_total_bw_query;
  4446. A_UINT32 cv_invalid_bw_coding;
  4447. A_UINT32 cv_forced_sounding;
  4448. A_UINT32 cv_standalone_sounding;
  4449. A_UINT32 cv_nc_mismatch;
  4450. A_UINT32 cv_fb_type_mismatch;
  4451. A_UINT32 cv_ofdma_bw_mismatch;
  4452. A_UINT32 cv_bw_mismatch;
  4453. A_UINT32 cv_pattern_mismatch;
  4454. A_UINT32 cv_preamble_mismatch;
  4455. A_UINT32 cv_nr_mismatch;
  4456. A_UINT32 cv_in_use_cnt_exceeded;
  4457. A_UINT32 cv_found;
  4458. A_UINT32 cv_not_found;
  4459. /* Sounding per user in 320MHz bandwidth */
  4460. A_UINT32 sounding_320[HTT_TX_PDEV_STATS_NUM_BE_MUMIMO_USER_STATS];
  4461. /* Counts number of soundings for all steering modes in 320MHz bandwidth */
  4462. A_UINT32 cbf_320[HTT_TXBF_MAX_NUM_OF_MODES];
  4463. } htt_tx_sounding_stats_tlv;
  4464. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  4465. * TLV_TAGS:
  4466. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  4467. */
  4468. /* NOTE:
  4469. * This structure is for documentation, and cannot be safely used directly.
  4470. * Instead, use the constituent TLV structures to fill/parse.
  4471. */
  4472. typedef struct {
  4473. htt_tx_sounding_stats_tlv sounding_tlv;
  4474. } htt_tx_sounding_stats_t;
  4475. typedef struct {
  4476. htt_tlv_hdr_t tlv_hdr;
  4477. A_UINT32 num_obss_tx_ppdu_success;
  4478. A_UINT32 num_obss_tx_ppdu_failure;
  4479. /* num_sr_tx_transmissions:
  4480. * Counter of TX done by aborting other BSS RX with spatial reuse
  4481. * (for cases where rx RSSI from other BSS is below the packet-detection
  4482. * threshold for doing spatial reuse)
  4483. */
  4484. union {
  4485. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  4486. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  4487. };
  4488. union {
  4489. /*
  4490. * Count the number of times the RSSI from an other-BSS signal
  4491. * is below the spatial reuse power threshold, thus providing an
  4492. * opportunity for spatial reuse since OBSS interference will be
  4493. * inconsequential.
  4494. */
  4495. A_UINT32 num_spatial_reuse_opportunities;
  4496. /* DEPRECATED: num_sr_rx_ge_pd_rssi_thr
  4497. * This old name has been deprecated because it does not
  4498. * clearly and accurately reflect the information stored within
  4499. * this field.
  4500. * Use the new name (num_spatial_reuse_opportunities) instead of
  4501. * the deprecated old name (num_sr_rx_ge_pd_rssi_thr).
  4502. */
  4503. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  4504. };
  4505. /*
  4506. * Count of number of times OBSS frames were aborted and non-SRG
  4507. * opportunities were created. Non-SRG opportunities are created when
  4508. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  4509. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  4510. * allow non-SRG TX.
  4511. */
  4512. A_UINT32 num_non_srg_opportunities;
  4513. /*
  4514. * Count of number of times TX PPDU were transmitted using non-SRG
  4515. * opportunities created. Incoming OBSS frame RSSI is compared with per
  4516. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  4517. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  4518. * tranmission happens.
  4519. */
  4520. A_UINT32 num_non_srg_ppdu_tried;
  4521. /*
  4522. * Count of number of times non-SRG based TX transmissions were successful
  4523. */
  4524. A_UINT32 num_non_srg_ppdu_success;
  4525. /*
  4526. * Count of number of times OBSS frames were aborted and SRG opportunities
  4527. * were created. Srg opportunities are created when incoming OBSS RSSI
  4528. * is less than the global configured SRG RSSI threshold and SRC OBSS
  4529. * color / SRG OBSS BSSID / SRG partial bssid / SRG BSS color bitmap
  4530. * registers allow SRG TX.
  4531. */
  4532. A_UINT32 num_srg_opportunities;
  4533. /*
  4534. * Count of number of times TX PPDU were transmitted using SRG
  4535. * opportunities created.
  4536. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  4537. * threshold configured in each PPDU.
  4538. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  4539. * then SRG tranmission happens.
  4540. */
  4541. A_UINT32 num_srg_ppdu_tried;
  4542. /*
  4543. * Count of number of times SRG based TX transmissions were successful
  4544. */
  4545. A_UINT32 num_srg_ppdu_success;
  4546. /*
  4547. * Count of number of times PSR opportunities were created by aborting
  4548. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  4549. * spatial reuse info in the OBSS trigger common field is set to allow PSR
  4550. * based spatial reuse.
  4551. */
  4552. A_UINT32 num_psr_opportunities;
  4553. /*
  4554. * Count of number of times TX PPDU were transmitted using PSR
  4555. * opportunities created.
  4556. */
  4557. A_UINT32 num_psr_ppdu_tried;
  4558. /*
  4559. * Count of number of times PSR based TX transmissions were successful.
  4560. */
  4561. A_UINT32 num_psr_ppdu_success;
  4562. } htt_pdev_obss_pd_stats_tlv;
  4563. /* NOTE:
  4564. * This structure is for documentation, and cannot be safely used directly.
  4565. * Instead, use the constituent TLV structures to fill/parse.
  4566. */
  4567. typedef struct {
  4568. htt_pdev_obss_pd_stats_tlv obss_pd_stat;
  4569. } htt_pdev_obss_pd_stats_t;
  4570. typedef struct {
  4571. htt_tlv_hdr_t tlv_hdr;
  4572. A_UINT32 pdev_id;
  4573. A_UINT32 current_head_idx;
  4574. A_UINT32 current_tail_idx;
  4575. A_UINT32 num_htt_msgs_sent;
  4576. /*
  4577. * Time in milliseconds for which the ring has been in
  4578. * its current backpressure condition
  4579. */
  4580. A_UINT32 backpressure_time_ms;
  4581. /* backpressure_hist - histogram showing how many times different degrees
  4582. * of backpressure duration occurred:
  4583. * Index 0 indicates the number of times ring was
  4584. * continously in backpressure state for 100 - 200ms.
  4585. * Index 1 indicates the number of times ring was
  4586. * continously in backpressure state for 200 - 300ms.
  4587. * Index 2 indicates the number of times ring was
  4588. * continously in backpressure state for 300 - 400ms.
  4589. * Index 3 indicates the number of times ring was
  4590. * continously in backpressure state for 400 - 500ms.
  4591. * Index 4 indicates the number of times ring was
  4592. * continously in backpressure state beyond 500ms.
  4593. */
  4594. A_UINT32 backpressure_hist[5];
  4595. } htt_ring_backpressure_stats_tlv;
  4596. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  4597. * TLV_TAGS:
  4598. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  4599. */
  4600. /* NOTE:
  4601. * This structure is for documentation, and cannot be safely used directly.
  4602. * Instead, use the constituent TLV structures to fill/parse.
  4603. */
  4604. typedef struct {
  4605. htt_sring_cmn_tlv cmn_tlv;
  4606. struct {
  4607. htt_stats_string_tlv sring_str_tlv;
  4608. htt_ring_backpressure_stats_tlv backpressure_stats_tlv;
  4609. } r[1]; /* variable-length array */
  4610. } htt_ring_backpressure_stats_t;
  4611. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  4612. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  4613. #define HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST 3
  4614. typedef struct {
  4615. htt_tlv_hdr_t tlv_hdr;
  4616. /* print_header:
  4617. * This field suggests whether the host should print a header when
  4618. * displaying the TLV (because this is the first latency_prof_stats
  4619. * TLV within a series), or if only the TLV contents should be displayed
  4620. * without a header (because this is not the first TLV within the series).
  4621. */
  4622. A_UINT32 print_header;
  4623. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  4624. A_UINT32 cnt; /* number of data values included in the tot sum */
  4625. A_UINT32 min; /* time in us */
  4626. A_UINT32 max; /* time in us */
  4627. A_UINT32 last;
  4628. A_UINT32 tot; /* time in us */
  4629. A_UINT32 avg; /* time in us */
  4630. /* hist_intvl:
  4631. * Histogram interval, i.e. the latency range covered by each
  4632. * bin of the histogram, in microsecond units.
  4633. * hist[0] counts how many latencies were between 0 to hist_intvl
  4634. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  4635. * hist[2] counts how many latencies were more than 2*hist_intvl
  4636. */
  4637. A_UINT32 hist_intvl;
  4638. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  4639. A_UINT32 page_fault_max; /* max page faults in any 1 sampling window */
  4640. A_UINT32 page_fault_total; /* summed over all sampling windows */
  4641. /* ignored_latency_count:
  4642. * ignore some of profile latency to avoid avg skewing
  4643. */
  4644. A_UINT32 ignored_latency_count;
  4645. /* interrupts_max: max interrupts within any single sampling window */
  4646. A_UINT32 interrupts_max;
  4647. /* interrupts_hist: histogram of interrupt rate
  4648. * bin0 contains the number of sampling windows that had 0 interrupts,
  4649. * bin1 contains the number of sampling windows that had 1-4 interrupts,
  4650. * bin2 contains the number of sampling windows that had > 4 interrupts
  4651. */
  4652. A_UINT32 interrupts_hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  4653. } htt_latency_prof_stats_tlv;
  4654. typedef struct {
  4655. htt_tlv_hdr_t tlv_hdr;
  4656. /* duration:
  4657. * Time period over which counts were gathered, units = microseconds.
  4658. */
  4659. A_UINT32 duration;
  4660. A_UINT32 tx_msdu_cnt;
  4661. A_UINT32 tx_mpdu_cnt;
  4662. A_UINT32 tx_ppdu_cnt;
  4663. A_UINT32 rx_msdu_cnt;
  4664. A_UINT32 rx_mpdu_cnt;
  4665. } htt_latency_prof_ctx_tlv;
  4666. typedef struct {
  4667. htt_tlv_hdr_t tlv_hdr;
  4668. A_UINT32 prof_enable_cnt; /* count of enabled profiles */
  4669. } htt_latency_prof_cnt_tlv;
  4670. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  4671. * TLV_TAGS:
  4672. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  4673. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  4674. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  4675. */
  4676. /* NOTE:
  4677. * This structure is for documentation, and cannot be safely used directly.
  4678. * Instead, use the constituent TLV structures to fill/parse.
  4679. */
  4680. typedef struct {
  4681. htt_latency_prof_stats_tlv latency_prof_stat;
  4682. htt_latency_prof_ctx_tlv latency_ctx_stat;
  4683. htt_latency_prof_cnt_tlv latency_cnt_stat;
  4684. } htt_soc_latency_stats_t;
  4685. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  4686. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  4687. #define HTT_RX_SQUARE_INDEX 6
  4688. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  4689. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  4690. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  4691. * TLV_TAGS:
  4692. * - HTT_STATS_RX_FSE_STATS_TAG
  4693. */
  4694. typedef struct {
  4695. htt_tlv_hdr_t tlv_hdr;
  4696. /*
  4697. * Number of times host requested for fse enable/disable
  4698. */
  4699. A_UINT32 fse_enable_cnt;
  4700. A_UINT32 fse_disable_cnt;
  4701. /*
  4702. * Number of times host requested for fse cache invalidation
  4703. * individual entries or full cache
  4704. */
  4705. A_UINT32 fse_cache_invalidate_entry_cnt;
  4706. A_UINT32 fse_full_cache_invalidate_cnt;
  4707. /*
  4708. * Cache hits count will increase if there is a matching flow in the cache
  4709. * There is no register for cache miss but the number of cache misses can
  4710. * be calculated as
  4711. * cache miss = (num_searches - cache_hits)
  4712. * Thus, there is no need to have a separate variable for cache misses.
  4713. * Num searches is flow search times done in the cache.
  4714. */
  4715. A_UINT32 fse_num_cache_hits_cnt;
  4716. A_UINT32 fse_num_searches_cnt;
  4717. /**
  4718. * Cache Occupancy holds 2 types of values: Peak and Current.
  4719. * 10 bins are used to keep track of peak occupancy.
  4720. * 8 of these bins represent ranges of values, while the first and last
  4721. * bins represent the extreme cases of the cache being completely empty
  4722. * or completely full.
  4723. * For the non-extreme bins, the number of cache occupancy values per
  4724. * bin is the maximum cache occupancy (128), divided by the number of
  4725. * non-extreme bins (8), so 128/8 = 16 values per bin.
  4726. * The range of values for each histogram bins is specified below:
  4727. * Bin0 = Counter increments when cache occupancy is empty
  4728. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  4729. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  4730. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  4731. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  4732. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  4733. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  4734. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  4735. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  4736. * Bin9 = Counter increments when cache occupancy is equal to 128
  4737. * The above histogram bin definitions apply to both the peak-occupancy
  4738. * histogram and the current-occupancy histogram.
  4739. *
  4740. * @fse_cache_occupancy_peak_cnt:
  4741. * Array records periodically PEAK cache occupancy values.
  4742. * Peak Occupancy will increment only if it is greater than current
  4743. * occupancy value.
  4744. *
  4745. * @fse_cache_occupancy_curr_cnt:
  4746. * Array records periodically current cache occupancy value.
  4747. * Current Cache occupancy always holds instant snapshot of
  4748. * current number of cache entries.
  4749. **/
  4750. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  4751. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  4752. /*
  4753. * Square stat is sum of squares of cache occupancy to better understand
  4754. * any variation/deviation within each cache set, over a given time-window.
  4755. *
  4756. * Square stat is calculated this way:
  4757. * Square = SUM(Squares of all Occupancy in a Set) / 8
  4758. * The cache has 16-way set associativity, so the occupancy of a
  4759. * set can vary from 0 to 16. There are 8 sets within the cache.
  4760. * Therefore, the minimum possible square value is 0, and the maximum
  4761. * possible square value is (8*16^2) / 8 = 256.
  4762. *
  4763. * 6 bins are used to keep track of square stats:
  4764. * Bin0 = increments when square of current cache occupancy is zero
  4765. * Bin1 = increments when square of current cache occupancy is within
  4766. * [1 to 50]
  4767. * Bin2 = increments when square of current cache occupancy is within
  4768. * [51 to 100]
  4769. * Bin3 = increments when square of current cache occupancy is within
  4770. * [101 to 200]
  4771. * Bin4 = increments when square of current cache occupancy is within
  4772. * [201 to 255]
  4773. * Bin5 = increments when square of current cache occupancy is 256
  4774. */
  4775. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  4776. /**
  4777. * Search stats has 2 types of values: Peak Pending and Number of
  4778. * Search Pending.
  4779. * GSE command ring for FSE can hold maximum of 5 Pending searches
  4780. * at any given time.
  4781. *
  4782. * 4 bins are used to keep track of search stats:
  4783. * Bin0 = Counter increments when there are NO pending searches
  4784. * (For peak, it will be number of pending searches greater
  4785. * than GSE command ring FIFO outstanding requests.
  4786. * For Search Pending, it will be number of pending search
  4787. * inside GSE command ring FIFO.)
  4788. * Bin1 = Counter increments when number of pending searches are within
  4789. * [1 to 2]
  4790. * Bin2 = Counter increments when number of pending searches are within
  4791. * [3 to 4]
  4792. * Bin3 = Counter increments when number of pending searches are
  4793. * greater/equal to [ >= 5]
  4794. */
  4795. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  4796. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  4797. } htt_rx_fse_stats_tlv;
  4798. /* NOTE:
  4799. * This structure is for documentation, and cannot be safely used directly.
  4800. * Instead, use the constituent TLV structures to fill/parse.
  4801. */
  4802. typedef struct {
  4803. htt_rx_fse_stats_tlv rx_fse_stats;
  4804. } htt_rx_fse_stats_t;
  4805. #define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
  4806. #define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5 /* 20, 40, 80, 160, 320 */
  4807. #define HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES 2/* 0: Half, 1: Quarter */
  4808. typedef struct {
  4809. htt_tlv_hdr_t tlv_hdr;
  4810. /* SU TxBF TX MCS stats */
  4811. A_UINT32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4812. /* Implicit BF TX MCS stats */
  4813. A_UINT32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4814. /* Open loop TX MCS stats */
  4815. A_UINT32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4816. /* SU TxBF TX NSS stats */
  4817. A_UINT32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4818. /* Implicit BF TX NSS stats */
  4819. A_UINT32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4820. /* Open loop TX NSS stats */
  4821. A_UINT32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4822. /* SU TxBF TX BW stats */
  4823. A_UINT32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4824. /* Implicit BF TX BW stats */
  4825. A_UINT32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4826. /* Open loop TX BW stats */
  4827. A_UINT32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4828. /* Legacy and OFDM TX rate stats */
  4829. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4830. /* SU TxBF TX BW stats */
  4831. A_UINT32 reduced_tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4832. /* Implicit BF TX BW stats */
  4833. A_UINT32 reduced_tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4834. /* Open loop TX BW stats */
  4835. A_UINT32 reduced_tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_REDUCED_CHAN_TYPES][HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4836. } htt_tx_pdev_txbf_rate_stats_tlv;
  4837. typedef enum {
  4838. HTT_STATS_RC_MODE_DLSU = 0,
  4839. HTT_STATS_RC_MODE_DLMUMIMO = 1,
  4840. } htt_stats_rc_mode;
  4841. typedef struct {
  4842. A_UINT32 ppdus_tried;
  4843. A_UINT32 ppdus_ack_failed;
  4844. A_UINT32 mpdus_tried;
  4845. A_UINT32 mpdus_failed;
  4846. } htt_tx_rate_stats_t;
  4847. typedef struct {
  4848. htt_tlv_hdr_t tlv_hdr;
  4849. A_UINT32 rc_mode; /* HTT_STATS_RC_MODE_XX */
  4850. A_UINT32 last_probed_mcs;
  4851. A_UINT32 last_probed_nss;
  4852. A_UINT32 last_probed_bw;
  4853. htt_tx_rate_stats_t per_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  4854. htt_tx_rate_stats_t per_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4855. htt_tx_rate_stats_t per_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4856. } htt_tx_rate_stats_per_tlv;
  4857. /* NOTE:
  4858. * This structure is for documentation, and cannot be safely used directly.
  4859. * Instead, use the constituent TLV structures to fill/parse.
  4860. */
  4861. typedef struct {
  4862. htt_tx_pdev_txbf_rate_stats_tlv txbf_rate_stats;
  4863. } htt_pdev_txbf_rate_stats_t;
  4864. typedef struct {
  4865. htt_tx_rate_stats_per_tlv per_stats;
  4866. } htt_tx_pdev_per_stats_t;
  4867. typedef enum {
  4868. HTT_ULTRIG_QBOOST_TRIGGER = 0,
  4869. HTT_ULTRIG_PSPOLL_TRIGGER,
  4870. HTT_ULTRIG_UAPSD_TRIGGER,
  4871. HTT_ULTRIG_11AX_TRIGGER,
  4872. HTT_ULTRIG_11AX_WILDCARD_TRIGGER,
  4873. HTT_ULTRIG_11AX_UNASSOC_WILDCARD_TRIGGER,
  4874. HTT_STA_UL_OFDMA_NUM_TRIG_TYPE,
  4875. } HTT_STA_UL_OFDMA_RX_TRIG_TYPE;
  4876. typedef enum {
  4877. HTT_11AX_TRIGGER_BASIC_E = 0,
  4878. HTT_11AX_TRIGGER_BRPOLL_E = 1,
  4879. HTT_11AX_TRIGGER_MU_BAR_E = 2,
  4880. HTT_11AX_TRIGGER_MU_RTS_E = 3,
  4881. HTT_11AX_TRIGGER_BUFFER_SIZE_E = 4,
  4882. HTT_11AX_TRIGGER_GCR_MU_BAR_E = 5,
  4883. HTT_11AX_TRIGGER_BQRP_E = 6,
  4884. HTT_11AX_TRIGGER_NDP_FB_REPORT_POLL_E = 7,
  4885. HTT_11AX_TRIGGER_RESERVED_8_E = 8,
  4886. HTT_11AX_TRIGGER_RESERVED_9_E = 9,
  4887. HTT_11AX_TRIGGER_RESERVED_10_E = 10,
  4888. HTT_11AX_TRIGGER_RESERVED_11_E = 11,
  4889. HTT_11AX_TRIGGER_RESERVED_12_E = 12,
  4890. HTT_11AX_TRIGGER_RESERVED_13_E = 13,
  4891. HTT_11AX_TRIGGER_RESERVED_14_E = 14,
  4892. HTT_11AX_TRIGGER_RESERVED_15_E = 15,
  4893. HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE,
  4894. } HTT_STA_UL_OFDMA_11AX_TRIG_TYPE;
  4895. /* UL RESP Queues 0 - HIPRI, 1 - LOPRI & 2 - BSR */
  4896. #define HTT_STA_UL_OFDMA_NUM_UL_QUEUES 3
  4897. /* Actual resp type sent by STA for trigger
  4898. * 0 - HE TB PPDU, 1 - NULL Delimiter */
  4899. #define HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE 2
  4900. /* Counter for MCS 0-13 */
  4901. #define HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS 14
  4902. /* Counters BW 20,40,80,160,320 */
  4903. #define HTT_STA_UL_OFDMA_NUM_BW_COUNTERS 5
  4904. #define HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES 2 /* 0 - Half, 1 - Quarter */
  4905. /* STATS_TYPE : HTT_DBG_EXT_STA_11AX_UL_STATS
  4906. * TLV_TAGS:
  4907. * - HTT_STATS_STA_UL_OFDMA_STATS_TAG
  4908. */
  4909. typedef struct {
  4910. htt_tlv_hdr_t tlv_hdr;
  4911. A_UINT32 pdev_id;
  4912. /* Trigger Type reported by HWSCH on RX reception
  4913. * Each index populate enum HTT_STA_UL_OFDMA_RX_TRIG_TYPE */
  4914. A_UINT32 rx_trigger_type[HTT_STA_UL_OFDMA_NUM_TRIG_TYPE];
  4915. /* 11AX Trigger Type on RX reception
  4916. * Each index populate enum HTT_STA_UL_OFDMA_11AX_TRIG_TYPE */
  4917. A_UINT32 ax_trigger_type[HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE];
  4918. /* Num data PPDUs/Delims responded to trigs. per HWQ for UL RESP */
  4919. A_UINT32 num_data_ppdu_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  4920. A_UINT32 num_null_delimiters_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  4921. /* Overall UL STA RESP Status 0 - HE TB PPDU, 1 - NULL Delimiter
  4922. * Super set of num_data_ppdu_responded_per_hwq, num_null_delimiters_responded_per_hwq */
  4923. A_UINT32 num_total_trig_responses[HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE];
  4924. /* Time interval between current time ms and last successful trigger RX
  4925. * 0xFFFFFFFF denotes no trig received / timestamp roll back */
  4926. A_UINT32 last_trig_rx_time_delta_ms;
  4927. /* Rate Statistics for UL OFDMA
  4928. * UL TB PPDU TX MCS, NSS, GI, BW from STA HWQ */
  4929. A_UINT32 ul_ofdma_tx_mcs[HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  4930. A_UINT32 ul_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4931. A_UINT32 ul_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  4932. A_UINT32 ul_ofdma_tx_ldpc;
  4933. A_UINT32 ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  4934. /* Trig based PPDU TX/ RBO based PPDU TX Count */
  4935. A_UINT32 trig_based_ppdu_tx;
  4936. A_UINT32 rbo_based_ppdu_tx;
  4937. /* Switch MU EDCA to SU EDCA Count */
  4938. A_UINT32 mu_edca_to_su_edca_switch_count;
  4939. /* Num MU EDCA applied Count */
  4940. A_UINT32 num_mu_edca_param_apply_count;
  4941. /* Current MU EDCA Parameters for WMM ACs
  4942. * Mode - 0 - SU EDCA, 1- MU EDCA */
  4943. A_UINT32 current_edca_hwq_mode[HTT_NUM_AC_WMM];
  4944. /* Contention Window minimum. Range: 1 - 10 */
  4945. A_UINT32 current_cw_min[HTT_NUM_AC_WMM];
  4946. /* Contention Window maximum. Range: 1 - 10 */
  4947. A_UINT32 current_cw_max[HTT_NUM_AC_WMM];
  4948. /* AIFS value - 0 -255 */
  4949. A_UINT32 current_aifs[HTT_NUM_AC_WMM];
  4950. A_UINT32 reduced_ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_REDUCED_CHAN_TYPES][HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  4951. } htt_sta_ul_ofdma_stats_tlv;
  4952. /* NOTE:
  4953. * This structure is for documentation, and cannot be safely used directly.
  4954. * Instead, use the constituent TLV structures to fill/parse.
  4955. */
  4956. typedef struct {
  4957. htt_sta_ul_ofdma_stats_tlv ul_ofdma_sta_stats;
  4958. } htt_sta_11ax_ul_stats_t;
  4959. typedef struct {
  4960. htt_tlv_hdr_t tlv_hdr;
  4961. /* No of Fine Timing Measurement frames transmitted successfully */
  4962. A_UINT32 tx_ftm_suc;
  4963. /* No of Fine Timing Measurement frames transmitted successfully after retry */
  4964. A_UINT32 tx_ftm_suc_retry;
  4965. /* No of Fine Timing Measurement frames not transmitted successfully */
  4966. A_UINT32 tx_ftm_fail;
  4967. /* No of Fine Timing Measurement Request frames received, including initial, non-initial, and duplicates */
  4968. A_UINT32 rx_ftmr_cnt;
  4969. /* No of duplicate Fine Timing Measurement Request frames received, including both initial and non-initial */
  4970. A_UINT32 rx_ftmr_dup_cnt;
  4971. /* No of initial Fine Timing Measurement Request frames received */
  4972. A_UINT32 rx_iftmr_cnt;
  4973. /* No of duplicate initial Fine Timing Measurement Request frames received */
  4974. A_UINT32 rx_iftmr_dup_cnt;
  4975. /* No of responder sessions rejected when initiator was active */
  4976. A_UINT32 initiator_active_responder_rejected_cnt;
  4977. /* Responder terminate count */
  4978. A_UINT32 responder_terminate_cnt;
  4979. A_UINT32 vdev_id;
  4980. } htt_vdev_rtt_resp_stats_tlv;
  4981. typedef struct {
  4982. htt_vdev_rtt_resp_stats_tlv vdev_rtt_resp_stats;
  4983. } htt_vdev_rtt_resp_stats_t;
  4984. typedef struct {
  4985. htt_tlv_hdr_t tlv_hdr;
  4986. A_UINT32 vdev_id;
  4987. /* No of Fine Timing Measurement request frames transmitted successfully */
  4988. A_UINT32 tx_ftmr_cnt;
  4989. /* No of Fine Timing Measurement request frames not transmitted successfully */
  4990. A_UINT32 tx_ftmr_fail;
  4991. /* No of Fine Timing Measurement request frames transmitted successfully after retry */
  4992. A_UINT32 tx_ftmr_suc_retry;
  4993. /* No of Fine Timing Measurement frames received, including initial, non-initial, and duplicates */
  4994. A_UINT32 rx_ftm_cnt;
  4995. /* Initiator Terminate count */
  4996. A_UINT32 initiator_terminate_cnt;
  4997. } htt_vdev_rtt_init_stats_tlv;
  4998. typedef struct {
  4999. htt_vdev_rtt_init_stats_tlv vdev_rtt_init_stats;
  5000. } htt_vdev_rtt_init_stats_t;
  5001. /* STATS_TYPE : HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  5002. * TLV_TAGS:
  5003. * - HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG
  5004. */
  5005. /* NOTE:
  5006. * This structure is for documentation, and cannot be safely used directly.
  5007. * Instead, use the constituent TLV structures to fill/parse.
  5008. */
  5009. typedef struct {
  5010. htt_tlv_hdr_t tlv_hdr;
  5011. /* No of pktlog payloads that were dropped in htt_ppdu_stats path */
  5012. A_UINT32 pktlog_lite_drop_cnt;
  5013. /* No of pktlog payloads that were dropped in TQM path */
  5014. A_UINT32 pktlog_tqm_drop_cnt;
  5015. /* No of pktlog ppdu stats payloads that were dropped */
  5016. A_UINT32 pktlog_ppdu_stats_drop_cnt;
  5017. /* No of pktlog ppdu ctrl payloads that were dropped */
  5018. A_UINT32 pktlog_ppdu_ctrl_drop_cnt;
  5019. /* No of pktlog sw events payloads that were dropped */
  5020. A_UINT32 pktlog_sw_events_drop_cnt;
  5021. } htt_pktlog_and_htt_ring_stats_tlv;
  5022. #define HTT_DLPAGER_STATS_MAX_HIST 10
  5023. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M 0x000000FF
  5024. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S 0
  5025. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M 0x0000FF00
  5026. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S 8
  5027. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_M 0x0000FFFF
  5028. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_S 0
  5029. #define HTT_DLPAGER_TOTAL_FREE_PAGES_M 0xFFFF0000
  5030. #define HTT_DLPAGER_TOTAL_FREE_PAGES_S 16
  5031. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M 0x0000FFFF
  5032. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S 0
  5033. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M 0xFFFF0000
  5034. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S 16
  5035. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var) \
  5036. (((_var) & HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M) >> \
  5037. HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)
  5038. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  5039. do { \
  5040. HTT_CHECK_SET_VAL(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT, _val); \
  5041. ((_var) &= ~(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M));\
  5042. ((_var) |= ((_val) << HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)); \
  5043. } while (0)
  5044. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var) \
  5045. (((_var) & HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M) >> \
  5046. HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)
  5047. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  5048. do { \
  5049. HTT_CHECK_SET_VAL(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT, _val); \
  5050. ((_var) &= ~(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M));\
  5051. ((_var) |= ((_val) << HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)); \
  5052. } while (0)
  5053. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var) \
  5054. (((_var) & HTT_DLPAGER_TOTAL_LOCKED_PAGES_M) >> \
  5055. HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)
  5056. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_SET(_var, _val) \
  5057. do { \
  5058. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_LOCKED_PAGES, _val); \
  5059. ((_var) &= ~(HTT_DLPAGER_TOTAL_LOCKED_PAGES_M)); \
  5060. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)); \
  5061. } while (0)
  5062. #define HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var) \
  5063. (((_var) & HTT_DLPAGER_TOTAL_FREE_PAGES_M) >> \
  5064. HTT_DLPAGER_TOTAL_FREE_PAGES_S)
  5065. #define HTT_DLPAGER_TOTAL_FREE_PAGES_SET(_var, _val) \
  5066. do { \
  5067. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_FREE_PAGES, _val); \
  5068. ((_var) &= ~(HTT_DLPAGER_TOTAL_FREE_PAGES_M)); \
  5069. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_FREE_PAGES_S)); \
  5070. } while (0)
  5071. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var) \
  5072. (((_var) & HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M) >> \
  5073. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)
  5074. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_SET(_var, _val) \
  5075. do { \
  5076. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX, _val); \
  5077. ((_var) &= ~(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M)); \
  5078. ((_var) |= ((_val) << HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)); \
  5079. } while (0)
  5080. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  5081. (((_var) & HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M) >> \
  5082. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)
  5083. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_SET(_var, _val) \
  5084. do { \
  5085. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX, _val); \
  5086. ((_var) &= ~(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M)); \
  5087. ((_var) |= ((_val) << HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)); \
  5088. } while (0)
  5089. enum {
  5090. HTT_STATS_PAGE_LOCKED = 0,
  5091. HTT_STATS_PAGE_UNLOCKED = 1,
  5092. HTT_STATS_NUM_PAGE_LOCK_STATES
  5093. };
  5094. /* dlPagerStats structure
  5095. * Number of lock/unlock pages with last 10 lock/unlock occurrences are recorded */
  5096. typedef struct{
  5097. /* msg_dword_1 bitfields:
  5098. * async_lock : 8,
  5099. * sync_lock : 8,
  5100. * reserved : 16;
  5101. */
  5102. A_UINT32 msg_dword_1;
  5103. /* mst_dword_2 bitfields:
  5104. * total_locked_pages : 16,
  5105. * total_free_pages : 16;
  5106. */
  5107. A_UINT32 msg_dword_2;
  5108. /* msg_dword_3 bitfields:
  5109. * last_locked_page_idx : 16,
  5110. * last_unlocked_page_idx : 16;
  5111. */
  5112. A_UINT32 msg_dword_3;
  5113. struct {
  5114. A_UINT32 page_num;
  5115. A_UINT32 num_of_pages;
  5116. /* timestamp is in microsecond units, from SoC timer clock */
  5117. A_UINT32 timestamp_lsbs;
  5118. A_UINT32 timestamp_msbs;
  5119. } last_pages_info[HTT_STATS_NUM_PAGE_LOCK_STATES][HTT_DLPAGER_STATS_MAX_HIST];
  5120. } htt_dl_pager_stats_tlv;
  5121. /* NOTE:
  5122. * This structure is for documentation, and cannot be safely used directly.
  5123. * Instead, use the constituent TLV structures to fill/parse.
  5124. * STATS_TYPE : HTT_DBG_EXT_STATS_DLPAGER_STATS
  5125. * TLV_TAGS:
  5126. * - HTT_STATS_DLPAGER_STATS_TAG
  5127. */
  5128. typedef struct {
  5129. htt_tlv_hdr_t tlv_hdr;
  5130. htt_dl_pager_stats_tlv dl_pager_stats;
  5131. } htt_dlpager_stats_t;
  5132. /*======= PHY STATS ====================*/
  5133. /*
  5134. * STATS TYPE : HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  5135. * TLV_TAGS:
  5136. * - HTT_STATS_PHY_COUNTERS_TAG
  5137. * - HTT_STATS_PHY_STATS_TAG
  5138. */
  5139. #define HTT_MAX_RX_PKT_CNT 8
  5140. #define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
  5141. #define HTT_MAX_PER_BLK_ERR_CNT 20
  5142. #define HTT_MAX_RX_OTA_ERR_CNT 14
  5143. typedef enum {
  5144. HTT_STATS_CHANNEL_HALF_RATE = 0x0001, /* Half rate */
  5145. HTT_STATS_CHANNEL_QUARTER_RATE = 0x0002, /* Quarter rate */
  5146. HTT_STATS_CHANNEL_DFS = 0x0004, /* Enable radar event reporting */
  5147. HTT_STATS_CHANNEL_HOME = 0x0008, /* Home channel */
  5148. HTT_STATS_CHANNEL_PASSIVE_SCAN = 0x0010, /*Passive Scan */
  5149. HTT_STATS_CHANNEL_DFS_SAP_NOT_UP = 0x0020, /* set when VDEV_START_REQUEST, clear when VDEV_UP */
  5150. HTT_STATS_CHANNEL_PASSIVE_SCAN_CAL = 0x0040, /* need to do passive scan calibration to avoid "spikes" */
  5151. HTT_STATS_CHANNEL_DFS_SAP_UP = 0x0080, /* DFS master */
  5152. HTT_STATS_CHANNEL_DFS_CFREQ2 = 0x0100, /* Enable radar event reporting for sec80 in VHT80p80 */
  5153. HTT_STATS_CHANNEL_DTIM_SYNTH = 0x0200, /* Enable DTIM */
  5154. HTT_STATS_CHANNEL_FORCE_GAIN = 0x0400, /* Force gain mmode (only used for FTM) */
  5155. HTT_STATS_CHANNEL_PERFORM_NF_CAL = 0x0800, /* Perform NF cal in channel change (only used for FTM) */
  5156. HTT_STATS_CHANNEL_165_MODE_0 = 0x1000, /* 165 MHz mode 0 */
  5157. HTT_STATS_CHANNEL_165_MODE_1 = 0x2000, /* 165 MHz mode 1 */
  5158. HTT_STATS_CHANNEL_165_MODE_2 = 0x3000, /* 165 MHz mode 2 */
  5159. HTT_STATS_CHANNEL_165_MODE_MASK = 0x3000, /* 165 MHz 2-bit mode mask */
  5160. } HTT_STATS_CHANNEL_FLAGS;
  5161. typedef enum {
  5162. HTT_STATS_RF_MODE_MIN = 0,
  5163. HTT_STATS_RF_MODE_PHYA_ONLY = 0, // only PHYA is active
  5164. HTT_STATS_RF_MODE_DBS = 1, // PHYA/5G and PHYB/2G
  5165. HTT_STATS_RF_MODE_SBS = 2, // PHYA/5G and PHYB/5G in HL/NPR; PHYA0/5G and PHYA1/5G in HK
  5166. HTT_STATS_RF_MODE_PHYB_ONLY = 3, // only PHYB is active
  5167. HTT_STATS_RF_MODE_DBS_SBS = 4, // PHYA0/5G, PHYA1/5G and PHYB/2G in HK (the 2 5G are in different channel)
  5168. HTT_STATS_RF_MODE_DBS_OR_SBS = 5, // PHYA0/5G, PHYA1/5G and PHYB/5G or 2G in HK
  5169. HTT_STATS_RF_MODE_INVALID = 0xff,
  5170. } HTT_STATS_RF_MODE;
  5171. typedef enum {
  5172. HTT_STATS_RESET_CAUSE_FIRST_RESET = 0x00000001, /* First reset by application */
  5173. HTT_STATS_RESET_CAUSE_ERROR = 0x00000002, /* Trigered due to error */
  5174. HTT_STATS_RESET_CAUSE_DEEP_SLEEP = 0x00000004, /* Reset after deep sleep */
  5175. HTT_STATS_RESET_CAUSE_FULL_RESET = 0x00000008, /* Full reset without any optimizations */
  5176. HTT_STATS_RESET_CAUSE_CHANNEL_CHANGE = 0x00000010, /* For normal channel change */
  5177. HTT_STATS_RESET_CAUSE_BAND_CHANGE = 0x00000020, /* Trigered due to band change */
  5178. HTT_STATS_RESET_CAUSE_DO_CAL = 0x00000040, /* Trigered due to calibrations */
  5179. HTT_STATS_RESET_CAUSE_MCI_ERROR = 0x00000080, /* Triggered due to MCI ERROR */
  5180. HTT_STATS_RESET_CAUSE_CHWIDTH_CHANGE = 0x00000100, /* Trigered due to channel width change */
  5181. HTT_STATS_RESET_CAUSE_WARM_RESTORE_CAL = 0x00000200, /* Trigered due to warm reset we want to just restore calibrations */
  5182. HTT_STATS_RESET_CAUSE_COLD_RESTORE_CAL = 0x00000400, /* Trigered due to cold reset we want to just restore calibrations */
  5183. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET = 0x00000800, /* Trigered due to phy warm reset we want to just restore calibrations */
  5184. HTT_STATS_RESET_CAUSE_M3_SSR = 0x00001000, /* Trigered due to SSR Restart */
  5185. HTT_STATS_RESET_CAUSE_FORCE_CAL = 0x00002000, /* Reset to force the calibration */
  5186. /* 0x00004000, 0x00008000 reserved */
  5187. HTT_STATS_NO_RESET_CHANNEL_CHANGE = 0x00010000, /* No reset, normal channel change */
  5188. HTT_STATS_NO_RESET_BAND_CHANGE = 0x00020000, /* No reset, channel change across band */
  5189. HTT_STATS_NO_RESET_CHWIDTH_CHANGE = 0x00040000, /* No reset, channel change across channel width */
  5190. HTT_STATS_NO_RESET_CHAINMASK_CHANGE = 0x00080000, /* No reset, chainmask change */
  5191. HTT_STATS_RESET_CAUSE_PHY_WARM_RESET_UCODE_TRIG = 0x00100000, /* Trigered due to phy warm reset we want to just restore calibrations */
  5192. HTT_STATS_RESET_CAUSE_PHY_OFF_TIMEOUT_RESET = 0x00200000, /* Reset ucode because phy off ack timeout*/
  5193. HTT_STATS_RESET_CAUSE_LMAC_RESET_UMAC_NOC_ERR = 0x00400000, /* LMAC reset trigered due to NOC Address/Slave error originating at LMAC */
  5194. HTT_STATS_NO_RESET_SCAN_BACK_TO_SAME_HOME_CHANNEL_CHANGE = 0x00800000, /* No reset, scan to home channel change */
  5195. } HTT_STATS_RESET_CAUSE;
  5196. typedef struct {
  5197. htt_tlv_hdr_t tlv_hdr;
  5198. /* number of RXTD OFDMA OTA error counts except power surge and drop */
  5199. A_UINT32 rx_ofdma_timing_err_cnt;
  5200. /* rx_cck_fail_cnt:
  5201. * number of cck error counts due to rx reception failure because of
  5202. * timing error in cck
  5203. */
  5204. A_UINT32 rx_cck_fail_cnt;
  5205. /* number of times tx abort initiated by mac */
  5206. A_UINT32 mactx_abort_cnt;
  5207. /* number of times rx abort initiated by mac */
  5208. A_UINT32 macrx_abort_cnt;
  5209. /* number of times tx abort initiated by phy */
  5210. A_UINT32 phytx_abort_cnt;
  5211. /* number of times rx abort initiated by phy */
  5212. A_UINT32 phyrx_abort_cnt;
  5213. /* number of rx defered count initiated by phy */
  5214. A_UINT32 phyrx_defer_abort_cnt;
  5215. /* number of sizing events generated at LSTF */
  5216. A_UINT32 rx_gain_adj_lstf_event_cnt; /* a.k.a sizing1 */
  5217. /* number of sizing events generated at non-legacy LTF */
  5218. A_UINT32 rx_gain_adj_non_legacy_cnt; /* a.k.a sizing2 */
  5219. /* rx_pkt_cnt -
  5220. * Received EOP (end-of-packet) count per packet type;
  5221. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  5222. * [6-7]=RSVD
  5223. */
  5224. A_UINT32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
  5225. /* rx_pkt_crc_pass_cnt -
  5226. * Received EOP (end-of-packet) count per packet type;
  5227. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  5228. * [6-7]=RSVD
  5229. */
  5230. A_UINT32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
  5231. /* per_blk_err_cnt -
  5232. * Error count per error source;
  5233. * [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
  5234. * [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
  5235. * [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
  5236. * [13-19]=RSVD
  5237. */
  5238. A_UINT32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
  5239. /* rx_ota_err_cnt -
  5240. * RXTD OTA (over-the-air) error count per error reason;
  5241. * [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
  5242. * [3] = cck fail; [4] = power surge; [5] = power drop;
  5243. * [6] = btcf timing timeout error; [7] = btcf packet detect error;
  5244. * [8] = coarse timing timeout error
  5245. * [9-13]=RSVD
  5246. */
  5247. A_UINT32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
  5248. } htt_phy_counters_tlv;
  5249. typedef struct {
  5250. htt_tlv_hdr_t tlv_hdr;
  5251. /* per chain hw noise floor values in dBm */
  5252. A_INT32 nf_chain[HTT_STATS_MAX_CHAINS];
  5253. /* number of false radars detected */
  5254. A_UINT32 false_radar_cnt;
  5255. /* number of channel switches happened due to radar detection */
  5256. A_UINT32 radar_cs_cnt;
  5257. /* ani_level -
  5258. * ANI level (noise interference) corresponds to the channel
  5259. * the desense levels range from -5 to 15 in dB units,
  5260. * higher values indicating more noise interference.
  5261. */
  5262. A_INT32 ani_level;
  5263. /* running time in minutes since FW boot */
  5264. A_UINT32 fw_run_time;
  5265. /* per chain runtime noise floor values in dBm */
  5266. A_INT32 runTime_nf_chain[HTT_STATS_MAX_CHAINS];
  5267. } htt_phy_stats_tlv;
  5268. typedef struct {
  5269. htt_tlv_hdr_t tlv_hdr;
  5270. /* current pdev_id */
  5271. A_UINT32 pdev_id;
  5272. /* current channel information */
  5273. A_UINT32 chan_mhz;
  5274. /* center_freq1, center_freq2 in mhz */
  5275. A_UINT32 chan_band_center_freq1;
  5276. A_UINT32 chan_band_center_freq2;
  5277. /* chan_phy_mode - WLAN_PHY_MODE enum type */
  5278. A_UINT32 chan_phy_mode;
  5279. /* chan_flags follows HTT_STATS_CHANNEL_FLAGS enum */
  5280. A_UINT32 chan_flags;
  5281. /* channel Num updated to virtual phybase */
  5282. A_UINT32 chan_num;
  5283. /* Cause for the phy reset - HTT_STATS_RESET_CAUSE */
  5284. A_UINT32 reset_cause;
  5285. /* Cause for the previous phy reset */
  5286. A_UINT32 prev_reset_cause;
  5287. /* source for the phywarm reset - HTT_STATS_RESET_CAUSE */
  5288. A_UINT32 phy_warm_reset_src;
  5289. /* rxGain Table selection mode - register settings
  5290. * 0 - Auto, 1/2 - Forced with and without BT override respectively
  5291. */
  5292. A_UINT32 rx_gain_tbl_mode;
  5293. /* current xbar value - perchain analog to digital idx mapping */
  5294. A_UINT32 xbar_val;
  5295. /* Flag to indicate forced calibration */
  5296. A_UINT32 force_calibration;
  5297. /* current RF mode (e.g. SBS/DBS) - follows HTT_STATS_RF_MODE enum */
  5298. A_UINT32 phyrf_mode;
  5299. /* PDL phyInput stats */
  5300. /* homechannel flag
  5301. * 1- Homechan, 0 - scan channel
  5302. */
  5303. A_UINT32 phy_homechan;
  5304. /* Tx and Rx chainmask */
  5305. A_UINT32 phy_tx_ch_mask;
  5306. A_UINT32 phy_rx_ch_mask;
  5307. /* INI masks - to decide the INI registers to be loaded on a reset */
  5308. A_UINT32 phybb_ini_mask;
  5309. A_UINT32 phyrf_ini_mask;
  5310. /* DFS,ADFS/Spectral scan enable masks */
  5311. A_UINT32 phy_dfs_en_mask;
  5312. A_UINT32 phy_sscan_en_mask;
  5313. A_UINT32 phy_synth_sel_mask;
  5314. A_UINT32 phy_adfs_freq;
  5315. /* CCK FIR settings
  5316. * register settings - filter coefficients for Iqs conversion
  5317. * [31:24] = FIR_COEFF_3_0
  5318. * [23:16] = FIR_COEFF_2_0
  5319. * [15:8] = FIR_COEFF_1_0
  5320. * [7:0] = FIR_COEFF_0_0
  5321. */
  5322. A_UINT32 cck_fir_settings;
  5323. /* dynamic primary channel index
  5324. * primary 20MHz channel index on the current channel BW
  5325. */
  5326. A_UINT32 phy_dyn_pri_chan;
  5327. /* Current CCA detection threshold
  5328. * dB above noisefloor req for CCA
  5329. * Register settings for all subbands
  5330. */
  5331. A_UINT32 cca_thresh;
  5332. /* status for dynamic CCA adjustment
  5333. * 0-disabled, 1-enabled
  5334. */
  5335. A_UINT32 dyn_cca_status;
  5336. /* RXDEAF Register value
  5337. * rxdesense_thresh_sw - VREG Register
  5338. * rxdesense_thresh_hw - PHY Register
  5339. */
  5340. A_UINT32 rxdesense_thresh_sw;
  5341. A_UINT32 rxdesense_thresh_hw;
  5342. } htt_phy_reset_stats_tlv;
  5343. typedef struct {
  5344. htt_tlv_hdr_t tlv_hdr;
  5345. /* current pdev_id */
  5346. A_UINT32 pdev_id;
  5347. /* ucode PHYOFF pass/failure count */
  5348. A_UINT32 cf_active_low_fail_cnt;
  5349. A_UINT32 cf_active_low_pass_cnt;
  5350. /* PHYOFF count attempted through ucode VREG */
  5351. A_UINT32 phy_off_through_vreg_cnt;
  5352. /* Force calibration count */
  5353. A_UINT32 force_calibration_cnt;
  5354. /* phyoff count during rfmode switch */
  5355. A_UINT32 rf_mode_switch_phy_off_cnt;
  5356. } htt_phy_reset_counters_tlv;
  5357. /* NOTE:
  5358. * This structure is for documentation, and cannot be safely used directly.
  5359. * Instead, use the constituent TLV structures to fill/parse.
  5360. */
  5361. typedef struct {
  5362. htt_phy_counters_tlv phy_counters;
  5363. htt_phy_stats_tlv phy_stats;
  5364. htt_phy_reset_counters_tlv phy_reset_counters;
  5365. htt_phy_reset_stats_tlv phy_reset_stats;
  5366. } htt_phy_counters_and_phy_stats_t;
  5367. /* NOTE:
  5368. * This structure is for documentation, and cannot be safely used directly.
  5369. * Instead, use the constituent TLV structures to fill/parse.
  5370. */
  5371. typedef struct {
  5372. htt_t2h_soc_txrx_stats_common_tlv soc_common_stats;
  5373. htt_t2h_vdev_txrx_stats_hw_stats_tlv vdev_hw_stats[1/*or more*/];
  5374. } htt_vdevs_txrx_stats_t;
  5375. #endif /* __HTT_STATS_H__ */