htt_stats.h 145 KB

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