htt_stats.h 141 KB

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