htt_stats.h 137 KB

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