htt_stats.h 166 KB

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