htt_stats.h 194 KB

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