htt_stats.h 127 KB

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