htt_stats.h 191 KB

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