htt_stats.h 134 KB

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