htt_stats.h 199 KB

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