htt_stats.h 150 KB

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