htt_stats.h 158 KB

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