htt_stats.h 120 KB

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