htt_stats.h 158 KB

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