htt_stats.h 161 KB

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