htt_stats.h 143 KB

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