htt_stats.h 199 KB

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