htt_stats.h 134 KB

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