htt_ppdu_stats.h 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * @file htt_ppdu_stats.h
  21. *
  22. * @details the public header file of HTT STATS
  23. */
  24. #ifndef __HTT_PPDU_STATS_H__
  25. #define __HTT_PPDU_STATS_H__
  26. #include <htt.h>
  27. #include <htt_stats.h>
  28. #include <htt_common.h> /* HTT_STATS_MAX_CHAINS */
  29. #define HTT_STATS_NUM_SUPPORTED_BW_SMART_ANTENNA 4 /* 20, 40, 80, 160 MHz */
  30. #define HTT_BA_64_BIT_MAP_SIZE_DWORDS 2
  31. #define HTT_BA_256_BIT_MAP_SIZE_DWORDS 8
  32. #define HTT_BA_1024_BIT_MAP_SIZE_DWORDS 32
  33. enum htt_ppdu_stats_tlv_tag {
  34. HTT_PPDU_STATS_COMMON_TLV, /* htt_ppdu_stats_common_tlv */
  35. HTT_PPDU_STATS_USR_COMMON_TLV, /* htt_ppdu_stats_user_common_tlv */
  36. HTT_PPDU_STATS_USR_RATE_TLV, /* htt_ppdu_stats_user_rate_tlv */
  37. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_64_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_64_tlv */
  38. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_256_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_256_tlv */
  39. HTT_PPDU_STATS_SCH_CMD_STATUS_TLV, /* htt_ppdu_stats_sch_cmd_tlv_v */
  40. HTT_PPDU_STATS_USR_COMPLTN_COMMON_TLV, /* htt_ppdu_stats_user_compltn_common_tlv */
  41. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_64_TLV, /* htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv */
  42. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_256_TLV, /* htt_ppdu_stats_user_cmpltn_ba_bitmap_256_tlv */
  43. HTT_PPDU_STATS_USR_COMPLTN_ACK_BA_STATUS_TLV, /* htt_ppdu_stats_user_cmpltn_ack_ba_status_tlv */
  44. HTT_PPDU_STATS_USR_COMPLTN_FLUSH_TLV, /* htt_ppdu_stats_flush_tlv */
  45. HTT_PPDU_STATS_USR_COMMON_ARRAY_TLV, /* htt_ppdu_stats_usr_common_array_tlv_v */
  46. HTT_PPDU_STATS_INFO_TLV, /* htt_ppdu_stats_info */
  47. HTT_PPDU_STATS_TX_MGMTCTRL_PAYLOAD_TLV, /* htt_ppdu_stats_tx_mgmtctrl_payload_tlv */
  48. HTT_PPDU_STATS_USERS_INFO_TLV, /* htt_ppdu_stats_users_info_tlv */
  49. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_1024_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_1024_tlv */
  50. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_1024_TLV,/* htt_ppdu_stats_user_compltn_ba_bitmap_1024_tlv */
  51. HTT_PPDU_STATS_RX_MGMTCTRL_PAYLOAD_TLV, /* htt_ppdu_stats_rx_mgmtctrl_payload_tlv */
  52. HTT_PPDU_STATS_FOR_SMU_TLV, /* htt_ppdu_stats_for_smu_tlv */
  53. HTT_PPDU_STATS_MLO_TX_RESP_TLV, /* htt_ppdu_stats_mlo_tx_resp_tlv */
  54. HTT_PPDU_STATS_MLO_TX_NOTIFICATION_TLV, /* htt_ppdu_stats_mlo_tx_notification_tlv */
  55. /* New TLV's are added above to this line */
  56. HTT_PPDU_STATS_MAX_TAG,
  57. };
  58. typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t;
  59. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M 0x000000ff
  60. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S 0
  61. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_GET(_var) \
  62. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M) >> \
  63. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)
  64. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_SET(_var, _val) \
  65. do { \
  66. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE, _val); \
  67. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)); \
  68. } while (0)
  69. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M 0x00000100
  70. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S 8
  71. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_GET(_var) \
  72. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M) >> \
  73. HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)
  74. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_SET(_var, _val) \
  75. do { \
  76. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU, _val); \
  77. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)); \
  78. } while (0)
  79. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M 0x00000600
  80. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S 9
  81. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_GET(_var) \
  82. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M) >> \
  83. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)
  84. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_SET(_var, _val) \
  85. do { \
  86. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED, _val); \
  87. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)); \
  88. } while (0)
  89. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M 0x00003800
  90. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S 11
  91. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_GET(_var) \
  92. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M) >> \
  93. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)
  94. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_SET(_var, _val) \
  95. do { \
  96. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW, _val); \
  97. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)); \
  98. } while (0)
  99. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M 0x00004000
  100. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S 14
  101. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_GET(_var) \
  102. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M) >> \
  103. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)
  104. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_SET(_var, _val) \
  105. do { \
  106. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI, _val); \
  107. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \
  108. } while (0)
  109. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000
  110. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15
  111. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \
  112. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \
  113. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)
  114. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \
  115. do { \
  116. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \
  117. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \
  118. } while (0)
  119. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000
  120. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16
  121. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_GET(_var) \
  122. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M) >> \
  123. HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)
  124. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_SET(_var, _val) \
  125. do { \
  126. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID, _val); \
  127. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)); \
  128. } while (0)
  129. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M 0x0000ffff
  130. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S 0
  131. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_GET(_var) \
  132. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M) >> \
  133. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)
  134. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_SET(_var, _val) \
  135. do { \
  136. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS, _val); \
  137. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)); \
  138. } while (0)
  139. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M 0xffff0000
  140. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S 16
  141. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_GET(_var) \
  142. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M) >> \
  143. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)
  144. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_SET(_var, _val) \
  145. do { \
  146. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS, _val); \
  147. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)); \
  148. } while (0)
  149. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M 0x0000ffff
  150. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S 0
  151. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_GET(_var) \
  152. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M) >> \
  153. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)
  154. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_SET(_var, _val) \
  155. do { \
  156. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS, _val); \
  157. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)); \
  158. } while (0)
  159. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M 0xffff0000
  160. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S 16
  161. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_GET(_var) \
  162. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M) >> \
  163. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)
  164. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_SET(_var, _val) \
  165. do { \
  166. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR, _val); \
  167. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)); \
  168. } while (0)
  169. PREPACK struct htt_tx_ppdu_stats_info {
  170. htt_tlv_hdr_t tlv_hdr;
  171. A_UINT32 tx_success_bytes;
  172. A_UINT32 tx_retry_bytes;
  173. A_UINT32 tx_failed_bytes;
  174. A_UINT32 tx_ratecode: 8,
  175. is_ampdu: 1,
  176. ba_ack_failed: 2,
  177. /* bw
  178. * 0: 20 MHz
  179. * 1: 40 MHz
  180. * 2: 80 MHz
  181. * 3: 160 MHz or 80+80 MHz
  182. * 4: 320 MHz
  183. */
  184. bw: 3,
  185. sgi: 1,
  186. skipped_rate_ctrl: 1,
  187. peer_id: 16;
  188. A_UINT32 tx_success_msdus: 16,
  189. tx_retry_msdus: 16;
  190. A_UINT32 tx_failed_msdus: 16,
  191. /* united in us */
  192. tx_duration: 16;
  193. /*
  194. * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid.
  195. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits
  196. * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid.
  197. * If bit 1 is set, tx_success_bytes is valid
  198. * If bit 2 is set, tx_retry_bytes is valid
  199. * ...
  200. * If bit 14 is set, tx_duration is valid
  201. * If bit 15 is set, all of ack_rssi_chain are valid,
  202. * for each validation of chain, need to check value in field
  203. * If bit 16 is set, tx_timestamp is valid
  204. * If bit 16 is set, sa_ant_matrix is valid
  205. * If bit 17 is set, tid is valid
  206. */
  207. A_UINT32 valid_bitmap;
  208. A_UINT32 ext_valid_bitmap; /* reserved for future extension valid bitmap */
  209. /* ack rssi for each chain */
  210. A_UINT32 ack_rssi_chain0: 8, /* Units: dB w.r.t noise floor, RSSI of Ack of all active chains. Value of 0x80 indicates invalid.*/
  211. ack_rssi_chain1: 8, /* same as above */
  212. ack_rssi_chain2: 8, /* same as above */
  213. ack_rssi_chain3: 8; /* same as above */
  214. A_UINT32 ack_rssi_chain4: 8, /* same as above */
  215. ack_rssi_chain5: 8, /* same as above */
  216. ack_rssi_chain6: 8, /* same as above */
  217. ack_rssi_chain7: 8; /* same as above */
  218. A_UINT32 tx_timestamp; /* HW assigned timestamp with microsecond unit */
  219. A_UINT32 sa_ant_matrix: 8, /* This sa_ant_matrix provides a bitmask of the antennas used while frame transmit */
  220. tid: 8,
  221. reserved_1: 16;
  222. } POSTPACK;
  223. typedef struct {
  224. htt_tlv_hdr_t tlv_hdr;
  225. A_UINT32 number_of_ppdu_stats;
  226. /*
  227. * tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
  228. * elements.
  229. * tx_ppdu_stats_info is variable length, with length =
  230. * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
  231. */
  232. struct htt_tx_ppdu_stats_info tx_ppdu_stats_info[1/*number_of_ppdu_stats*/];
  233. } htt_ppdu_stats_usr_common_array_tlv_v;
  234. typedef struct {
  235. htt_tlv_hdr_t tlv_hdr;
  236. union {
  237. /* DEPRECATED (target_type)
  238. * The target_type field is not actually present in the HTT messages
  239. * produced by the FW. However, it cannot be removed (yet), due to
  240. * FW code that refers to this field.
  241. * As a workaround, this target_type field is being moved into a
  242. * union with the "hw" field that actually is present in the message.
  243. * This makes the message definitions become consistent with the
  244. * actual message contents, while not breaking the compilation of
  245. * code that refers to the target_type field.
  246. * Overlaying the memory for "target_type" and "hw" does not cause
  247. * problems, because the FW code that refers to target_type first
  248. * writes a value into the target_type field, then writes data into
  249. * the hw field.
  250. * Once all FW references to the target_type field have been removed,
  251. * the target_type field def and the encapsulating anonymous union
  252. * will be removed from this htt_ppdu_stats_sch_cmd_tlv_v struct def.
  253. */
  254. A_UINT32 target_type;
  255. /*
  256. * The hw portion of this struct contains a scheduler_command_status
  257. * struct, whose definition is different for different target HW types.
  258. */
  259. A_UINT32 hw[1];
  260. };
  261. } htt_ppdu_stats_sch_cmd_tlv_v;
  262. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff
  263. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S 0
  264. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_GET(_var) \
  265. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M) >> \
  266. HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)
  267. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_SET(_var, _val) \
  268. do { \
  269. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID, _val); \
  270. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)); \
  271. } while (0)
  272. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_M 0x00ff0000
  273. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_S 16
  274. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_GET(_var) \
  275. (((_var) & HTT_PPDU_STATS_COMMON_TLV_RING_ID_M) >> \
  276. HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)
  277. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_SET(_var, _val) \
  278. do { \
  279. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_RING_ID, _val); \
  280. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)); \
  281. } while (0)
  282. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M 0xff000000
  283. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S 24
  284. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_GET(_var) \
  285. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M) >> \
  286. HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)
  287. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_SET(_var, _val) \
  288. do { \
  289. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_USERS, _val); \
  290. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)); \
  291. } while (0)
  292. /* HW queue type */
  293. enum HTT_TX_QUEUE_TYPE {
  294. HTT_TX_QUEUE_INACTIVE,
  295. HTT_TX_QUEUE_DATA,
  296. HTT_TX_QUEUE_BEACON,
  297. HTT_TX_QUEUE_PSPOLL,
  298. HTT_TX_QUEUE_CAB,
  299. HTT_TX_QUEUE_HALPHY,
  300. HTT_TX_QUEUE_QBOOST_RESP,
  301. HTT_TX_QUEUE_NAN_BEACON,
  302. HTT_TX_QUEUE_NAN_MGMT,
  303. HTT_TX_QUEUE_UL_DATA,
  304. HTT_TX_QUEUE_UL_BSR_RESP,
  305. HTT_TX_QUEUE_MGMT,
  306. HTT_TX_QUEUE_MAX,
  307. };
  308. typedef enum HTT_TX_QUEUE_TYPE HTT_TX_QUEUE_TYPE;
  309. /* frame_type */
  310. enum HTT_STATS_FTYPE {
  311. HTT_STATS_FTYPE_SGEN_NDPA = 0,
  312. HTT_STATS_FTYPE_SGEN_NDP,
  313. HTT_STATS_FTYPE_SGEN_BRP,
  314. HTT_STATS_FTYPE_SGEN_BAR,
  315. HTT_STATS_FTYPE_SGEN_RTS,
  316. HTT_STATS_FTYPE_SGEN_CTS,
  317. HTT_STATS_FTYPE_SGEN_CFEND,
  318. HTT_STATS_FTYPE_SGEN_AX_NDPA,
  319. HTT_STATS_FTYPE_SGEN_AX_NDP,
  320. HTT_STATS_FTYPE_SGEN_MU_TRIG,
  321. HTT_STATS_FTYPE_SGEN_MU_BAR,
  322. HTT_STATS_FTYPE_SGEN_MU_BRP,
  323. HTT_STATS_FTYPE_SGEN_MU_RTS,
  324. HTT_STATS_FTYPE_SGEN_MU_BSR,
  325. HTT_STATS_FTYPE_SGEN_UL_BSR,
  326. HTT_STATS_FTYPE_SGEN_UL_BSR_TRIGGER = HTT_STATS_FTYPE_SGEN_UL_BSR, /*alias*/
  327. HTT_STATS_FTYPE_TIDQ_DATA_SU,
  328. HTT_STATS_FTYPE_TIDQ_DATA_MU,
  329. HTT_STATS_FTYPE_SGEN_UL_BSR_RESP,
  330. HTT_STATS_FTYPE_SGEN_QOS_NULL,
  331. HTT_STATS_FTYPE_SGEN_BE_NDPA,
  332. HTT_STATS_FTYPE_SGEN_BE_NDP,
  333. HTT_STATS_FTYPE_SGEN_BE_MU_TRIG,
  334. HTT_STATS_FTYPE_SGEN_BE_MU_BAR,
  335. HTT_STATS_FTYPE_SGEN_BE_MU_BRP,
  336. HTT_STATS_FTYPE_SGEN_BE_MU_RTS,
  337. HTT_STATS_FTYPE_SGEN_BE_MU_BSRP,
  338. HTT_STATS_FTYPE_MAX,
  339. };
  340. typedef enum HTT_STATS_FTYPE HTT_STATS_FTYPE;
  341. /* FRM_TYPE defined in HTT_STATS_FTYPE */
  342. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M 0x000000ff
  343. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S 0
  344. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(_var) \
  345. (((_var) & HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M) >> \
  346. HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)
  347. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_SET(_var, _val) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE, _val); \
  350. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)); \
  351. } while (0)
  352. /* QTYPE defined in HTT_TX_QUEUE_TYPE */
  353. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_M 0x0000ff00
  354. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_S 8
  355. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_GET(_var) \
  356. (((_var) & HTT_PPDU_STATS_COMMON_TLV_QTYPE_M) >> \
  357. HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)
  358. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_SET(_var, _val) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_QTYPE, _val); \
  361. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)); \
  362. } while (0)
  363. enum HTT_PPDU_STATS_BW {
  364. HTT_PPDU_STATS_BANDWIDTH_5MHZ = 0,
  365. HTT_PPDU_STATS_BANDWIDTH_10MHZ = 1,
  366. HTT_PPDU_STATS_BANDWIDTH_20MHZ = 2,
  367. HTT_PPDU_STATS_BANDWIDTH_40MHZ = 3,
  368. HTT_PPDU_STATS_BANDWIDTH_80MHZ = 4,
  369. HTT_PPDU_STATS_BANDWIDTH_160MHZ = 5, /* includes 80+80 */
  370. HTT_PPDU_STATS_BANDWIDTH_DYN = 6,
  371. HTT_PPDU_STATS_BANDWIDTH_DYN_PATTERNS = 7,
  372. HTT_PPDU_STATS_BANDWIDTH_320MHZ = 8,
  373. };
  374. typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW;
  375. #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000
  376. #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16
  377. #define HTT_PPDU_STATS_COMMON_TLV_BW_GET(_var) \
  378. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BW_M) >> \
  379. HTT_PPDU_STATS_COMMON_TLV_BW_S)
  380. #define HTT_PPDU_STATS_COMMON_TLV_BW_SET(_var, _val) \
  381. do { \
  382. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BW, _val); \
  383. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  384. } while (0)
  385. enum HTT_PPDU_STATS_SEQ_TYPE {
  386. HTT_SEQTYPE_UNSPECIFIED = 0,
  387. HTT_SEQTYPE_SU = 1,
  388. HTT_SEQTYPE_AC_MU_MIMO = 2,
  389. HTT_SEQTYPE_AX_MU_MIMO = 3,
  390. HTT_SEQTYPE_MU_OFDMA = 4,
  391. HTT_SEQTYPE_UL_MU_OFDMA_TRIG = 5, /* new name - use this */
  392. HTT_SEQTYPE_UL_TRIG = 5, /* deprecated old name */
  393. HTT_SEQTYPE_BURST_BCN = 6,
  394. HTT_SEQTYPE_UL_BSR_RESP = 7,
  395. HTT_SEQTYPE_UL_BSR_TRIG = 8,
  396. HTT_SEQTYPE_UL_RESP = 9,
  397. HTT_SEQTYPE_UL_MU_MIMO_TRIG = 10,
  398. HTT_SEQTYPE_BE_MU_MIMO = 11,
  399. HTT_SEQTYPE_BE_MU_OFDMA = 12,
  400. HTT_SEQTYPE_BE_UL_MU_OFDMA_TRIG = 13,
  401. HTT_SEQTYPE_BE_UL_MU_MIMO_TRIG = 14,
  402. HTT_SEQTYPE_BE_UL_BSR_TRIG = 15,
  403. };
  404. typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE;
  405. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x0ff00000
  406. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 20
  407. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \
  408. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \
  409. HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)
  410. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \
  411. do { \
  412. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \
  413. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \
  414. } while (0)
  415. /*
  416. * MPROT_TYPE enum values: refer to enum
  417. * pcu_ppdu_setup_init__medium_prot_type__e
  418. * defined in tlv_enum.h
  419. */
  420. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_M 0xf0000000
  421. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_S 28
  422. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_GET(_var) \
  423. (((_var) & HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_M) >> \
  424. HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_S)
  425. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_SET(_var, _val) \
  426. do { \
  427. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE, _val); \
  428. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  429. } while (0)
  430. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M 0x0000ffff
  431. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S 0
  432. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(_var) \
  433. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M) >> \
  434. HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)
  435. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_SET(_var, _val) \
  436. do { \
  437. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_MODE, _val); \
  438. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)); \
  439. } while (0)
  440. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M 0xffff0000
  441. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S 16
  442. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_GET(_var) \
  443. (((_var) & HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M) >> \
  444. HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)
  445. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_SET(_var, _val) \
  446. do { \
  447. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ, _val); \
  448. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)); \
  449. } while (0)
  450. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_M 0x0000ffff
  451. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S 0
  452. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_GET(_var) \
  453. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_M) >> \
  454. HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S )
  455. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_SET(_var, _val) \
  456. do { \
  457. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US, _val); \
  458. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S)); \
  459. } while (0)
  460. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_M 0x00ff0000
  461. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S 16
  462. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_GET(_var) \
  463. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_M) >> \
  464. HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S)
  465. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_SET(_var, _val) \
  466. do { \
  467. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS, _val); \
  468. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S)); \
  469. } while(0);
  470. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_M 0x01000000
  471. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S 24
  472. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_GET(_var) \
  473. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_M) >> \
  474. HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S)
  475. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_SET(_var, _val) \
  476. do { \
  477. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE, _val); \
  478. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S)); \
  479. } while (0)
  480. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_M 0x02000000
  481. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S 25
  482. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_GET(_var) \
  483. (((_var) & HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_M) >> \
  484. HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S)
  485. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_SET(_var, _val) \
  486. do { \
  487. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION, _val); \
  488. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S)); \
  489. } while (0)
  490. enum HTT_PPDU_STATS_SPATIAL_REUSE {
  491. HTT_SRP_DISALLOW = 0,
  492. /* values 1-12 are reserved */
  493. HTT_SR_RESTRICTED = 13,
  494. HTT_SR_DELAY = 14,
  495. HTT_SRP_AND_NON_SRG_OBSS_PD_PROHIBITED = 15,
  496. };
  497. typedef enum HTT_PPDU_STATS_SPATIAL_REUSE HTT_PPDU_STATS_SPATIAL_REUSE;
  498. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_M 0x3c000000
  499. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S 26
  500. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_GET(_var) \
  501. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_M) >> \
  502. HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S)
  503. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_SET(_var, _val) \
  504. do { \
  505. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE, _val); \
  506. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S)); \
  507. } while (0)
  508. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_M 0x0000003f
  509. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S 0
  510. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_GET(_var) \
  511. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_M) >> \
  512. HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S)
  513. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_SET(_var, _val) \
  514. do { \
  515. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID, _val); \
  516. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S)); \
  517. } while (0)
  518. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_M 0x0000ffff
  519. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_S 0
  520. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_GET(_val) \
  521. (((_val) & HTT_PPDU_STATS_COMMON_TRIG_COOKIE_M) >> \
  522. HTT_PPDU_STATS_COMMON_TRIG_COOKIE_S)
  523. enum HTT_SEQ_TYPE {
  524. WAL_PPDU_SEQ_TYPE = 0,
  525. HTT_PPDU_SEQ_TYPE = 1,
  526. };
  527. typedef struct {
  528. htt_tlv_hdr_t tlv_hdr;
  529. A_UINT32 ppdu_id;
  530. /* BIT [ 15 : 0] :- sched_cmdid
  531. * BIT [ 23 : 16] :- ring_id
  532. * BIT [ 31 : 24] :- num_users
  533. */
  534. union {
  535. A_UINT32 ring_id__sched_cmdid;
  536. struct {
  537. A_UINT32 sched_cmdid: 16,
  538. ring_id: 8,
  539. num_users: 8;
  540. };
  541. };
  542. /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE
  543. * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE
  544. * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW
  545. * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE
  546. * BIT [ 31: 28] :- mprot_type
  547. */
  548. union {
  549. A_UINT32 bw__queue_type__frame_type;
  550. A_UINT32 ppdu_seq_type__bw__queue_type__frame_type;
  551. A_UINT32 mprot_type__ppdu_seq_type__bw__queue_type__frame_type;
  552. struct {
  553. A_UINT32 frame_type: 8,
  554. queue_type: 8,
  555. bw: 4,
  556. ppdu_seq_type: 8,
  557. mprot_type: 4;
  558. };
  559. };
  560. A_UINT32 chain_mask;
  561. A_UINT32 fes_duration_us; /* frame exchange sequence */
  562. A_UINT32 ppdu_sch_eval_start_tstmp_us;
  563. A_UINT32 ppdu_sch_end_tstmp_us;
  564. A_UINT32 ppdu_start_tstmp_us;
  565. /* BIT [15 : 0] - phy mode (WLAN_PHY_MODE) with which ppdu was transmitted
  566. * BIT [31 : 16] - bandwidth (in MHz) with which ppdu was transmitted
  567. */
  568. union {
  569. A_UINT32 chan_mhz__phy_mode;
  570. struct {
  571. A_UINT32 phy_mode: 16,
  572. chan_mhz: 16;
  573. };
  574. };
  575. /*
  576. * The cca_delta_time_us reports the time the tx PPDU in question
  577. * was waiting in the HW tx queue for the clear channel assessment
  578. * to indicate that the transmission could start.
  579. * If this CCA delta time is zero or small, this indicates that the
  580. * air interface was unused prior to the transmission, and thus it's
  581. * improbable that there was a collision with some other transceiver's
  582. * transmission.
  583. * In contrast, a large CCA delta time means that this transceiver had
  584. * to wait a long time for the air interface to be available; it's
  585. * possible that other transceivers were also waiting for the air
  586. * interface to become available, and if the other waiting transceiver's
  587. * CW backoff aligned with this one, to have a transmit collision.
  588. */
  589. A_UINT32 cca_delta_time_us;
  590. /*
  591. * The rxfrm_delta_time_us reports the time the tx PPDU in question
  592. * was waiting in the HW tx queue while there was an ongoing rx,
  593. * either because the rx was already ongoing at the time the tx PPDU
  594. * was enqueued, or because the rx (i.e. the peer's tx) won the air
  595. * interface contention over the local vdev's tx.
  596. */
  597. A_UINT32 rxfrm_delta_time_us;
  598. /*
  599. * The txfrm_delta_time_us reports the time from when the tx PPDU
  600. * in question was enqueued into the HW tx queue until the time the
  601. * tx completion interrupt for the PPDU occurred.
  602. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU
  603. * had to wait for the air interface to become available, the PPDU
  604. * duration, the block ack reception, and the tx completion interrupt
  605. * latency.
  606. */
  607. A_UINT32 txfrm_delta_time_us;
  608. /*
  609. * The phy_ppdu_tx_time_us reports the time it took to transmit
  610. * a PPDU by itself
  611. * BIT [15 : 0] - phy_ppdu_tx_time_us reports the time it took to
  612. * transmit by itself (not including response time)
  613. * BIT [23 : 16] - num_ul_expected_users reports the number of users
  614. * that are expected to respond to this transmission
  615. * BIT [24 : 24] - beam_change reports the beam forming pattern
  616. * between non-HE and HE portion.
  617. * If we apply TxBF starting from legacy preamble,
  618. * then beam_change = 0.
  619. * If we apply TxBF only starting from HE portion,
  620. * then beam_change = 1.
  621. * BIT [25 : 25] - doppler_indication
  622. * BIT [29 : 26] - spatial_reuse for HE_SU,HE_MU and HE_EXT_SU format PPDU
  623. * HTT_PPDU_STATS_SPATIAL_REUSE
  624. * BIT [31 : 30] - reserved
  625. */
  626. union {
  627. A_UINT32 reserved__ppdu_tx_time_us;
  628. A_UINT32 reserved__num_ul_expected_users__ppdu_tx_time_us;
  629. A_UINT32 reserved__spatial_reuse__doppler_indication__beam_change__num_ul_expected_users__ppdu_tx_time_us;
  630. struct {
  631. A_UINT32 phy_ppdu_tx_time_us: 16,
  632. num_ul_expected_users: 8,
  633. beam_change: 1,
  634. doppler_indication: 1,
  635. spatial_reuse: 4,
  636. reserved1: 2;
  637. };
  638. };
  639. /* ppdu_start_tstmp_u32_us:
  640. * Upper 32 bits of the PPDU start timestamp.
  641. * This field can be combined with the ppdu_start_tstmp_us field's
  642. * lower 32 bits of the PPDU start timestamp to form a 64-bit timestamp.
  643. */
  644. A_UINT32 ppdu_start_tstmp_u32_us;
  645. /*
  646. * BIT [5 : 0] - bss_color_id indicates he_bss_color which is an identifier
  647. * of the BSS and is used to assist a receiving STA in
  648. * identifying the BSS from which a PPDU originates.
  649. * Value in the range 0 to 63
  650. * BIT [6 : 6] - PPDU transmitted using Non-SRG opportunity
  651. * BIT [7 : 7] - PPDU transmitted using SRG opportunity
  652. * BIT [15: 8] - RSSI of the aborted OBSS frame (in dB w.r.t. noise floor)
  653. * by which SRG/Non-SRG based spatial reuse opportunity
  654. * was created.
  655. * BIT [16:16] - PPDU transmitted using PSR opportunity
  656. * BIT [31:17] - reserved
  657. */
  658. union {
  659. A_UINT32 reserved__psr_tx__aborted_obss_rssi__srg_tx__non_srg_tx___bss_color_id;
  660. A_UINT32 reserved__aborted_obss_rssi__srg_tx__non_srg_tx___bss_color_id;
  661. A_UINT32 reserved__bss_color_id;
  662. struct {
  663. A_UINT32 bss_color_id: 6,
  664. non_srg_tx: 1,
  665. srg_tx: 1,
  666. aborted_obss_rssi: 8,
  667. psr_tx: 1,
  668. reserved2: 15;
  669. };
  670. };
  671. /* Note: This is for tracking a UL OFDMA packet */
  672. union {
  673. A_UINT32 trig_cookie_info;
  674. struct {
  675. A_UINT32 trig_cookie: 16,
  676. trig_cookie_rsvd: 15,
  677. trig_cookie_valid: 1;
  678. };
  679. };
  680. /*
  681. * htt_seq_type field is added for backward compatibility with
  682. * pktlog decoder, host driver or any third party tool interpreting
  683. * ppdu sequence type. If field 'htt_seq_type'is not present or is
  684. * present but set to WAL_PPDU_SEQ_TYPE, decoder should interpret
  685. * the seq type as WAL_TXSEND_PPDU_SEQUENCE.
  686. * If the new field htt_seq_type is present and is set to
  687. * HTT_PPDU_SEQ_TYPE then decoder should interpret the seq type as
  688. * HTT_PPDU_STATS_SEQ_TYPE. htt_seq_type field will be set to
  689. * HTT_PPDU_SEQ_TYPE in firmware versions where this field is
  690. * defined.
  691. */
  692. union {
  693. A_UINT32 reserved__htt_seq_type;
  694. struct {
  695. A_UINT32 htt_seq_type: 1,
  696. reserved3: 31;
  697. };
  698. };
  699. } htt_ppdu_stats_common_tlv;
  700. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff
  701. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S 0
  702. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_GET(_var) \
  703. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M) >> \
  704. HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)
  705. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_SET(_var, _val) \
  706. do { \
  707. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM, _val); \
  708. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)); \
  709. } while (0)
  710. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M 0x0000ff00
  711. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S 8
  712. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_GET(_var) \
  713. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M) >> \
  714. HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)
  715. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_SET(_var, _val) \
  716. do { \
  717. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID, _val); \
  718. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)); \
  719. } while (0)
  720. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  721. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S 16
  722. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_GET(_var) \
  723. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M) >> \
  724. HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)
  725. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  726. do { \
  727. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID, _val); \
  728. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)); \
  729. } while (0)
  730. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M 0x00000001
  731. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S 0
  732. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_GET(_var) \
  733. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M) >> \
  734. HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)
  735. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_SET(_var, _val) \
  736. do { \
  737. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MCAST, _val); \
  738. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)); \
  739. } while (0)
  740. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M 0x000003fe
  741. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S 1
  742. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_GET(_var) \
  743. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M) >> \
  744. HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)
  745. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_SET(_var, _val) \
  746. do { \
  747. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED, _val); \
  748. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)); \
  749. } while (0)
  750. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_M 0x00003c00
  751. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_S 10
  752. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_GET(_var) \
  753. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_BW_M) >> \
  754. HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)
  755. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_SET(_var, _val) \
  756. do { \
  757. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_BW, _val); \
  758. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)); \
  759. } while (0)
  760. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M 0x00004000
  761. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S 14
  762. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_GET(_var) \
  763. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M) >> \
  764. HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)
  765. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_SET(_var, _val) \
  766. do { \
  767. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA, _val); \
  768. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)); \
  769. } while (0)
  770. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_M 0x00008000
  771. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S 15
  772. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_GET(_var) \
  773. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_M) >> \
  774. HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S)
  775. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_SET(_var, _val) \
  776. do { \
  777. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER, _val); \
  778. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S)); \
  779. } while (0)
  780. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_M 0xffff0000
  781. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S 16
  782. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_GET(_var) \
  783. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_M) >> \
  784. HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S)
  785. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_SET(_var, _val) \
  786. do { \
  787. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES, _val); \
  788. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S)); \
  789. } while (0)
  790. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M 0x0000ffff
  791. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S 0
  792. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_GET(_var) \
  793. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M) >> \
  794. HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)
  795. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_SET(_var, _val) \
  796. do { \
  797. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL, _val); \
  798. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)); \
  799. } while (0)
  800. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M 0xffff0000
  801. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S 16
  802. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_GET(_var) \
  803. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M) >> \
  804. HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)
  805. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_SET(_var, _val) \
  806. do { \
  807. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL, _val); \
  808. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)); \
  809. } while (0)
  810. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_M 0x000000ff
  811. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S 0
  812. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_GET(_var) \
  813. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_M) >> \
  814. HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S)
  815. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_SET(_var, _val) \
  816. do { \
  817. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER, _val); \
  818. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S)); \
  819. } while (0)
  820. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_M 0x0000ff00
  821. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S 8
  822. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_GET(_var) \
  823. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_M) >> \
  824. HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S)
  825. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_SET(_var, _val) \
  826. do { \
  827. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS, _val); \
  828. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S)); \
  829. } while (0)
  830. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32 4
  831. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK 0x000000ff
  832. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_GET(tlv, chain_idx) \
  833. ((A_INT8) ((tlv)->tx_pwr[(chain_idx)/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] >> \
  834. ((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK)
  835. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_SET(tlv, chain_idx, value) \
  836. (tlv)->tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] = \
  837. (tlv)->tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] & \
  838. ~(0xff << (((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8)) | \
  839. (((value)<<((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8))
  840. #define HTT_PPDU_STATS_USER_COMMON_TLV_ALT_TX_PWR_GET(tlv, chain_idx) \
  841. ((A_INT8) ((tlv)->alt_tx_pwr[(chain_idx)/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] >> \
  842. ((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK)
  843. #define HTT_PPDU_STATS_USER_COMMON_TLV_ALT_TX_PWR_SET(tlv, chain_idx, value) \
  844. (tlv)->alt_tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] = \
  845. (tlv)->alt_tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] & \
  846. ~(0xff << (((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8)) | \
  847. (((value)<<((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8))
  848. typedef struct {
  849. htt_tlv_hdr_t tlv_hdr;
  850. /* BIT [ 7 : 0] :- tid_num
  851. * BIT [ 15: 8] :- vap_id
  852. * BIT [ 31: 16] :- sw_peer_id
  853. */
  854. union {
  855. A_UINT32 sw_peer_id__vapid__tid_num;
  856. struct {
  857. A_UINT32 tid_num: 8,
  858. vap_id: 8,
  859. sw_peer_id: 16;
  860. };
  861. };
  862. /* BIT [ 0 : 0] :- mcast
  863. * BIT [ 9 : 1] :- mpdus_tried
  864. * BIT [ 13: 10] :- bw - HTT_PPDU_STATS_BW
  865. * BIT [ 14: 14] :- delayed_ba
  866. * BIT [ 15: 15] :- rsvd
  867. * BIT [ 31: 16] :- num_frames - num of MSDUs + num of MPDUs
  868. */
  869. union {
  870. A_UINT32 bw__mpdus_tried__mcast;
  871. struct {
  872. A_UINT32 mcast: 1,
  873. mpdus_tried: 9,
  874. bw: 4,
  875. delayed_ba: 1,
  876. is_sqno_valid_in_buffer: 1,
  877. num_frames: 16;
  878. };
  879. };
  880. /* BIT [ 15: 0] :- frame_ctrl
  881. * BIT [ 31: 16] :- qos_ctrl
  882. */
  883. union {
  884. A_UINT32 qos_ctrl_frame_ctrl;
  885. struct {
  886. A_UINT32 frame_ctrl: 16,
  887. qos_ctrl: 16;
  888. };
  889. };
  890. /*
  891. * Data fields containing the physical address info of a MSDU buffer
  892. * as well as the owner and a SW cookie info that can be used by the host
  893. * to look up the virtual address of the MSDU buffer.
  894. * These fields are only valid if is_buffer_addr_info_valid is set to 1.
  895. */
  896. A_UINT32 buffer_paddr_31_0 : 32;
  897. A_UINT32 buffer_paddr_39_32 : 8,
  898. return_buffer_manager : 3,
  899. sw_buffer_cookie : 21;
  900. /*
  901. * host_opaque_cookie : Host can send upto 2 bytes of opaque
  902. * cookie in TCL_DATA_CMD and FW will replay this back in
  903. * HTT PPDU stats. Valid only if sent to FW through
  904. * exception mechanism.
  905. *
  906. * is_standalone : This msdu was sent as a single MSDU/MPDU
  907. * PPDU as indicated by host via TCL_DATA_CMD using
  908. * the send_as_standalone bit.
  909. *
  910. * is_buffer_addr_info_valid : This will be set whenever a MSDU is sent as
  911. * a singleton (single-MSDU PPDU) for FW use-cases or as indicated by host
  912. * via send_as_standalone in TCL_DATA_CMD.
  913. *
  914. * The fields is_sw_rts_enabled, is_hw_rts_enabled, is_sfm_war_enabled
  915. * indicate whether SW RTS, HW RTS, SFM WAR are enabled for the
  916. * current Tx-sequence respectively.
  917. */
  918. A_UINT32 host_opaque_cookie: 16,
  919. is_host_opaque_valid: 1,
  920. is_standalone: 1,
  921. is_buffer_addr_info_valid: 1,
  922. is_sw_rts_enabled: 1,
  923. is_hw_rts_enabled: 1,
  924. is_sfm_war_enabled: 1,
  925. reserved1: 10;
  926. /* qdepth bytes : Contains Number of bytes of TIDQ depth */
  927. A_UINT32 qdepth_bytes;
  928. A_UINT32 full_aid : 12,
  929. reserved : 20;
  930. /* data_frm_ppdu_id:
  931. * Note - this is valid in case delayed BA processing specifically for
  932. * BAR frames*/
  933. A_UINT32 data_frm_ppdu_id;
  934. /* sw_rts_prot_dur_us:
  935. * SW RTS protection duration in micro sec.
  936. * Note - this is valid if SW RTS was used instead of HW RTS.
  937. */
  938. A_UINT32 sw_rts_prot_dur_us;
  939. /* Data fields related to Transmit power */
  940. /* tx_pwr_multiplier:
  941. * Hawkeye now supports power accuracy in 0.25 dBm steps,
  942. * so all powers are x4.
  943. * This is needed to resolve compatibility issues with previous
  944. * generation chipsets.
  945. * API in halphy phyrf_bdf_GetMaxRatePwrMultiplier, used to find out
  946. * what the multiplier and use that to correctly report the TPC value
  947. * to host.
  948. *
  949. * chain_enable_bits:
  950. * Indicates the valid tx_pwr values in the tx_pwr field.
  951. * Default value: 1
  952. * tx_pwr[0] value is used for all chains if chain_enable_bits field
  953. * is set to 1.
  954. */
  955. A_UINT32 tx_pwr_multiplier : 8,
  956. chain_enable_bits : 8,
  957. reserved2 : 16;
  958. /*
  959. * Transmit powers (signed values packed into unsigned bitfields)
  960. * in units of 0.25 dBm per chain.
  961. * To report the tx_pwr value in dBm units, stored value has to be
  962. * divided with tx_pwr_multiplier field.
  963. * Per chain tx_pwr configuration is not available for all chipsets.
  964. * Use tx_pwr[0] value for all chains if chain_enable_bits field
  965. * is set to 1.
  966. * Each chain uses 1 byte to store the transmit power.
  967. * The bytes within a A_UINT32 use little-endian order,
  968. * i.e. bits 7:0 of tx_pwr[0] store the tx pwr for chain 0,
  969. * bits 15:8 of tx_pwr[0] store the tx pwr for chain 1, etc.
  970. * Since HTT_STATS_MAX_CHAINS is a multiple of 4, no rounding is needed
  971. * to determine the number of A_UINT32 array elements.
  972. * Any bytes that exceed the number of chains with valid
  973. * tx_pwr data will be filled with 0x00.
  974. * When packing the 1-byte tx_pwr values into the A_UINT32,
  975. * masking is needed to keep the sign bits from clobbering
  976. * the higher bytes.
  977. * When extracting the 1-byte tx_pwr values from the A_UINT32,
  978. * sign-extension is needed if the variable holding the extracted
  979. * value is larger than A_INT8.
  980. */
  981. A_UINT32 tx_pwr[HTT_STATS_MAX_CHAINS / HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32];
  982. /*
  983. * Transmit powers for the alternate transmit descriptor used for BT COEX
  984. * (signed values packed into unsigned bitfields) in units of
  985. * 0.25 dBm per chain.
  986. * Not used by the host currently.
  987. * To report the alt_tx_pwr value in dBm units, stored value has to be
  988. * divided with tx_pwr_multiplier field.
  989. * Per chain alt_tx_pwr configuration is not available for all chipsets.
  990. * Use alt_tx_pwr[0] value for all chains if chain_enable_bits field
  991. * is set to 1.
  992. * Each chain uses 1 byte to store the alternate transmit power.
  993. * The bytes within a A_UINT32 use little-endian order,
  994. * i.e. bits 7:0 of alt_tx_pwr[0] store the alt tx pwr for chain 0,
  995. * bits 15:8 of alt_tx_pwr[0] store the alt tx pwr for chain 1, etc.
  996. * Since HTT_STATS_MAX_CHAINS is a multiple of 4, no rounding is needed
  997. * to determine the number of A_UINT32 array elements.
  998. * Any bytes that exceed the number of chains with valid
  999. * alt_tx_pwr data will be filled with 0x00.
  1000. * When packing the 1-byte alt_tx_pwr values into the A_UINT32,
  1001. * masking is needed to keep the sign bits from clobbering
  1002. * the higher bytes.
  1003. * When extracting the 1-byte alt_tx_pwr values from the A_UINT32,
  1004. * sign-extension is needed if the variable holding the extracted
  1005. * value is larger than A_INT8.
  1006. */
  1007. A_UINT32 alt_tx_pwr[HTT_STATS_MAX_CHAINS / HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32];
  1008. } htt_ppdu_stats_user_common_tlv;
  1009. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M 0x000000ff
  1010. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S 0
  1011. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_GET(_var) \
  1012. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M) >> \
  1013. HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)
  1014. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM, _val); \
  1017. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)); \
  1018. } while (0)
  1019. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_M 0x0000ff00
  1020. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_S 8
  1021. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M 0xffff0000
  1022. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S 16
  1023. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_GET(_var) \
  1024. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M) >> \
  1025. HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)
  1026. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_SET(_var, _val) \
  1027. do { \
  1028. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID, _val); \
  1029. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)); \
  1030. } while (0)
  1031. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M 0x0000000f
  1032. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S 0
  1033. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_GET(_var) \
  1034. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M) >> \
  1035. HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)
  1036. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_SET(_var, _val) \
  1037. do { \
  1038. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_USER_POS, _val); \
  1039. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)); \
  1040. } while (0)
  1041. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M 0x00000ff0
  1042. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S 4
  1043. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_GET(_var) \
  1044. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M) >> \
  1045. HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)
  1046. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_SET(_var, _val) \
  1047. do { \
  1048. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID, _val); \
  1049. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)); \
  1050. } while (0)
  1051. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  1052. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  1053. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  1054. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  1055. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  1056. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  1057. do { \
  1058. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  1059. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  1060. } while (0)
  1061. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  1062. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  1063. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  1064. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  1065. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  1066. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  1067. do { \
  1068. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  1069. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  1070. } while (0)
  1071. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M 0x00000001
  1072. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S 0
  1073. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_GET(_var) \
  1074. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M) >> \
  1075. HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)
  1076. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_SET(_var, _val) \
  1077. do { \
  1078. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID, _val); \
  1079. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)); \
  1080. } while (0)
  1081. #define HTT_PPDU_STATS_BUF_ADDR_39_32_M 0x000000ff
  1082. #define HTT_PPDU_STATS_BUF_ADDR_39_32_S 0
  1083. #define HTT_PPDU_STATS_BUF_ADDR_39_32__GET(_var) \
  1084. (((_var) & HTT_PPDU_STATS_BUF_ADDR_39_32_M) >> \
  1085. HTT_PPDU_STATS_BUF_ADDR_39_32_S)
  1086. #define HTT_PPDU_STATS_BUF_ADDR_39_32_SET(_var, _val) \
  1087. do { \
  1088. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_BUF_ADDR_39_32, _val); \
  1089. ((_var) |= ((_val) << HTT_PPDU_STATS_BUF_ADDR_39_32_S)); \
  1090. } while (0)
  1091. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_M 0x00000700
  1092. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_S 8
  1093. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_GET(_var) \
  1094. (((_var) & HTT_PPDU_STATS_RETURN_BUF_MANAGER_M) >> \
  1095. HTT_PPDU_STATS_RETURN_BUF_MANAGER_S)
  1096. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_SET(_var, _val) \
  1097. do { \
  1098. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_RETURN_BUF_MANAGER, _val); \
  1099. ((_var) |= ((_val) << HTT_PPDU_STATS_RETURN_BUF_MANAGER_S)); \
  1100. } while (0)
  1101. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_M 0xfffff800
  1102. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_S 11
  1103. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_GET(_var) \
  1104. (((_var) & HTT_PPDU_STATS_SW_BUFFER_COOKIE_M) >> \
  1105. HTT_PPDU_STATS_SW_BUFFER_COOKIE_S)
  1106. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_SET(_var, _val) \
  1107. do { \
  1108. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_SW_BUFFER_COOKIE, _val); \
  1109. ((_var) |= ((_val) << HTT_PPDU_STATS_SW_BUFFER_COOKIE_S)); \
  1110. } while (0)
  1111. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1112. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S 0
  1113. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_GET(_var) \
  1114. (((_var) & HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_M) >> \
  1115. HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S)
  1116. #define HTT_PPDU_STAT_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1117. do { \
  1118. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_HOST_OPAQUE_COOKIE, _val); \
  1119. ((_var) |= ((_val) << HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S)); \
  1120. } while (0)
  1121. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_M 0x00010000
  1122. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_S 16
  1123. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_GET(_var) \
  1124. (((_var) & HTT_PPDU_STATS_IS_OPAQUE_VALID_M) >> \
  1125. HTT_PPDU_STATS_IS_OPAQUE_VALID_S)
  1126. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_SET(_var, _val) \
  1127. do { \
  1128. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_OPAQUE_VALID, _val); \
  1129. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_OPAQUE_VALID_S)); \
  1130. } while (0)
  1131. #define HTT_PPDU_STATS_IS_STANDALONE_M 0x00020000
  1132. #define HTT_PPDU_STATS_IS_STANDALONE_S 17
  1133. #define HTT_PPDU_STATS_IS_STANDALONE_GET(_var) \
  1134. (((_var) & HTT_PPDU_STATS_IS_STANDALONE_M) >> \
  1135. HTT_PPDU_STATS_IS_OPAQUE_VALID_S)
  1136. #define HTT_PPDU_STATS_IS_STANDALONE_SET(_var, _val) \
  1137. do { \
  1138. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_STANDALONE, _val); \
  1139. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_STANDALONE_S)); \
  1140. } while (0)
  1141. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_M 0x000400000
  1142. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S 18
  1143. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_GET(_var) \
  1144. (((_var) & HTT_PPDU_STATS_IS_BUFF_INFO_VALID_M) >> \
  1145. HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S)
  1146. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_SET(_var, _val) \
  1147. do { \
  1148. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_BUFF_INFO_VALID, _val); \
  1149. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S)); \
  1150. } while (0)
  1151. enum HTT_PPDU_STATS_PPDU_TYPE {
  1152. HTT_PPDU_STATS_PPDU_TYPE_SU,
  1153. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO,
  1154. HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA,
  1155. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA,
  1156. HTT_PPDU_STATS_PPDU_TYPE_UL_TRIG,
  1157. HTT_PPDU_STATS_PPDU_TYPE_BURST_BCN,
  1158. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP,
  1159. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG,
  1160. HTT_PPDU_STATS_PPDU_TYPE_UL_RESP,
  1161. HTT_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  1162. };
  1163. typedef enum HTT_PPDU_STATS_PPDU_TYPE HTT_PPDU_STATS_PPDU_TYPE;
  1164. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M 0x0000003E
  1165. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S 1
  1166. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_GET(_var) \
  1167. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M) >> \
  1168. HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)
  1169. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_SET(_var, _val) \
  1170. do { \
  1171. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE, _val); \
  1172. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)); \
  1173. } while (0)
  1174. enum HTT_PPDU_STATS_TXBF_TYPE {
  1175. HTT_PPDU_STATS_TXBF_OPEN_LOOP,
  1176. HTT_PPDU_STATS_TXBF_IMPLICIT,
  1177. HTT_PPDU_STATS_TXBF_EXPLICIT,
  1178. HTT_PPDU_STATS_TXBF_MAX,
  1179. };
  1180. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M 0x00000003
  1181. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S 0
  1182. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_GET(_var) \
  1183. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M) >> \
  1184. HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)
  1185. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_SET(_var, _val) \
  1186. do { \
  1187. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE, _val); \
  1188. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)); \
  1189. } while (0)
  1190. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_M 0x00000004
  1191. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_S 2
  1192. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_GET(_var) \
  1193. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_STBC_M) >> \
  1194. HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)
  1195. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_SET(_var, _val) \
  1196. do { \
  1197. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_STBC, _val); \
  1198. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)); \
  1199. } while (0)
  1200. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M 0x00000008
  1201. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S 3
  1202. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_GET(_var) \
  1203. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M) >> \
  1204. HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)
  1205. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_SET(_var, _val) \
  1206. do { \
  1207. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_HE_RE, _val); \
  1208. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)); \
  1209. } while (0)
  1210. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M 0x000000f0
  1211. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S 4
  1212. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_GET(_var) \
  1213. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M) >> \
  1214. HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)
  1215. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TXBF, _val); \
  1218. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)); \
  1219. } while (0)
  1220. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_M 0x00000f00
  1221. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_S 8
  1222. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(_var) \
  1223. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_BW_M) >> \
  1224. HTT_PPDU_STATS_USER_RATE_TLV_BW_S)
  1225. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_SET(_var, _val) \
  1226. do { \
  1227. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_BW, _val); \
  1228. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_BW_S)); \
  1229. } while (0)
  1230. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_M 0x0000f000
  1231. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_S 12
  1232. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(_var) \
  1233. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_NSS_M) >> \
  1234. HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)
  1235. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_SET(_var, _val) \
  1236. do { \
  1237. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_NSS, _val); \
  1238. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)); \
  1239. } while (0)
  1240. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_M 0x000f0000
  1241. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_S 16
  1242. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(_var) \
  1243. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MCS_M) >> \
  1244. HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)
  1245. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_SET(_var, _val) \
  1246. do { \
  1247. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MCS, _val); \
  1248. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)); \
  1249. } while (0)
  1250. /* Refer HTT_STATS_PREAM_TYPE */
  1251. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M 0x00f00000
  1252. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S 20
  1253. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(_var) \
  1254. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M) >> \
  1255. HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)
  1256. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE, _val); \
  1259. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)); \
  1260. } while (0)
  1261. /* Guard Intervals */
  1262. enum HTT_PPDU_STATS_GI {
  1263. HTT_PPDU_STATS_GI_800,
  1264. HTT_PPDU_STATS_GI_400,
  1265. HTT_PPDU_STATS_GI_1600,
  1266. HTT_PPDU_STATS_GI_3200,
  1267. HTT_PPDU_STATS_GI_CNT,
  1268. };
  1269. typedef enum HTT_PPDU_STATS_GI HTT_PPDU_STATS_GI;
  1270. /* Refer HTT_PPDU_STATS_GI */
  1271. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_M 0x0f000000
  1272. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_S 24
  1273. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_GET(_var) \
  1274. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_GI_M) >> \
  1275. HTT_PPDU_STATS_USER_RATE_TLV_GI_S)
  1276. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_GI, _val); \
  1279. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_GI_S)); \
  1280. } while (0)
  1281. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_M 0x10000000
  1282. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_S 28
  1283. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_GET(_var) \
  1284. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_DCM_M) >> \
  1285. HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)
  1286. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_DCM, _val); \
  1289. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)); \
  1290. } while (0)
  1291. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M 0x20000000
  1292. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S 29
  1293. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_GET(_var) \
  1294. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M) >> \
  1295. HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)
  1296. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LDPC, _val); \
  1299. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)); \
  1300. } while (0)
  1301. enum HTT_PPDU_STATS_RESP_PPDU_TYPE {
  1302. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_MIMO_UL,
  1303. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_OFDMA_UL,
  1304. };
  1305. typedef enum HTT_PPDU_STATS_RESP_PPDU_TYPE HTT_PPDU_STATS_RESP_PPDU_TYPE;
  1306. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M 0xC0000000
  1307. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S 30
  1308. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_GET(_var) \
  1309. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M) >> \
  1310. HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)
  1311. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_SET(_var, _val) \
  1312. do { \
  1313. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE, _val); \
  1314. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)); \
  1315. } while (0)
  1316. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_M 0x0000f000
  1317. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S 12
  1318. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_GET(_var) \
  1319. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_M) >> \
  1320. HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S)
  1321. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_SET(_var, _val) \
  1322. do { \
  1323. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT, _val); \
  1324. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S)); \
  1325. } while (0)
  1326. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  1327. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  1328. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  1329. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  1330. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  1331. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  1334. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  1335. } while (0)
  1336. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  1337. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  1338. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  1339. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  1340. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  1341. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  1342. do { \
  1343. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  1344. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  1345. } while (0)
  1346. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_M 0x0000ffff
  1347. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S 0
  1348. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_GET(_var) \
  1349. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_M) >> \
  1350. HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S)
  1351. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_SET(_var, _val) \
  1352. do { \
  1353. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX, _val); \
  1354. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S)); \
  1355. } while (0)
  1356. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_M 0xffff0000
  1357. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S 16
  1358. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_GET(_var) \
  1359. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_M) >> \
  1360. HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S)
  1361. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_SET(_var, _val) \
  1362. do { \
  1363. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE, _val); \
  1364. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S)); \
  1365. } while (0)
  1366. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_M 0x0000ffff
  1367. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S 0
  1368. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_GET(_var) \
  1369. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_M) >> \
  1370. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S)
  1371. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_SET(_var, _val) \
  1372. do { \
  1373. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END, _val); \
  1374. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S)); \
  1375. } while (0)
  1376. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_M 0xffff0000
  1377. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S 16
  1378. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_GET(_var) \
  1379. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_M) >> \
  1380. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S)
  1381. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_SET(_var, _val) \
  1382. do { \
  1383. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START, _val); \
  1384. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S)); \
  1385. } while (0)
  1386. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_M 0x0000ffff
  1387. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S 0
  1388. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_GET(_var) \
  1389. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_M) >> \
  1390. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S)
  1391. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_SET(_var, _val) \
  1392. do { \
  1393. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX, _val); \
  1394. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S)); \
  1395. } while (0)
  1396. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_M 0xffff0000
  1397. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S 16
  1398. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_GET(_var) \
  1399. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_M) >> \
  1400. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S)
  1401. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_SET(_var, _val) \
  1402. do { \
  1403. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE, _val); \
  1404. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S)); \
  1405. } while (0)
  1406. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_M 0x0000ffff
  1407. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S 0
  1408. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_GET(_var) \
  1409. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_M) >> \
  1410. HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S)
  1411. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_SET (_var , _val) \
  1412. do { \
  1413. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP, _val); \
  1414. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S)); \
  1415. } while (0)
  1416. typedef enum HTT_PPDU_STATS_RU_SIZE {
  1417. HTT_PPDU_STATS_RU_26,
  1418. HTT_PPDU_STATS_RU_52,
  1419. HTT_PPDU_STATS_RU_52_26,
  1420. HTT_PPDU_STATS_RU_106,
  1421. HTT_PPDU_STATS_RU_106_26,
  1422. HTT_PPDU_STATS_RU_242,
  1423. HTT_PPDU_STATS_RU_484,
  1424. HTT_PPDU_STATS_RU_484_242,
  1425. HTT_PPDU_STATS_RU_996,
  1426. HTT_PPDU_STATS_RU_996_484,
  1427. HTT_PPDU_STATS_RU_996_484_242,
  1428. HTT_PPDU_STATS_RU_996x2,
  1429. HTT_PPDU_STATS_RU_996x2_484,
  1430. HTT_PPDU_STATS_RU_996x3,
  1431. HTT_PPDU_STATS_RU_996x3_484,
  1432. HTT_PPDU_STATS_RU_996x4,
  1433. } HTT_PPDU_STATS_RU_SIZE;
  1434. typedef struct {
  1435. htt_tlv_hdr_t tlv_hdr;
  1436. /* BIT [ 7 : 0] :- tid_num
  1437. * BIT [ 15: 8] :- reserved0
  1438. * BIT [ 31: 16] :- sw_peer_id
  1439. */
  1440. union {
  1441. A_UINT32 sw_peer_id__tid_num;
  1442. struct {
  1443. A_UINT32 tid_num: 8,
  1444. reserved0: 8,
  1445. sw_peer_id: 16;
  1446. };
  1447. };
  1448. /* BIT [ 3 : 0] :- user_pos
  1449. * BIT [ 11: 4] :- mu_group_id
  1450. * BIT [ 15: 12] :- ru_format
  1451. * BIT [ 31: 16] :- reserved1
  1452. */
  1453. union {
  1454. A_UINT32 mu_group_id__user_pos;
  1455. struct {
  1456. A_UINT32 user_pos: 4,
  1457. mu_group_id: 8,
  1458. ru_format: 4,
  1459. reserved1: 16;
  1460. };
  1461. };
  1462. /* BIT [ 15 : 0] :- ru_end or ru_index
  1463. * BIT [ 31 : 16] :- ru_start or ru_size
  1464. *
  1465. * Discriminant is field ru_format:
  1466. * - ru_format = 0: ru_end, ru_start
  1467. * - ru_format = 1: ru_index, ru_size
  1468. * - ru_format = other: reserved for future expansion
  1469. *
  1470. * ru_start and ru_end are RU 26 indices
  1471. *
  1472. * ru_size is an HTT_PPDU_STATS_RU_SIZE, ru_index is a size
  1473. * specific index for the given ru_size.
  1474. */
  1475. union {
  1476. A_UINT32 ru_start__ru_end;
  1477. A_UINT32 ru_size__ru_index;
  1478. struct {
  1479. A_UINT32 ru_end: 16,
  1480. ru_start: 16;
  1481. };
  1482. struct {
  1483. A_UINT32 ru_index: 16,
  1484. ru_size: 16;
  1485. };
  1486. };
  1487. /* BIT [ 15 : 0] :- resp_ru_end or resp_ru_index
  1488. * BIT [ 31 : 16] :- resp_ru_start or resp_ru_size
  1489. *
  1490. * Discriminant is field ru_format:
  1491. * - ru_format = 0: resp_ru_end, resp_ru_start
  1492. * - ru_format = 1: resp_ru_index, resp_ru_size
  1493. * - ru_format = other: reserved for future expansion
  1494. *
  1495. * resp_ru_start and resp_ru_end are RU 26 indices
  1496. *
  1497. * resp_ru_size is an HTT_PPDU_STATS_RU_SIZE, resp_ru_index
  1498. * is a size specific index for the given ru_size.
  1499. */
  1500. union {
  1501. A_UINT32 resp_ru_start__ru_end;
  1502. A_UINT32 resp_ru_size__ru_index;
  1503. struct {
  1504. A_UINT32 resp_ru_end: 16,
  1505. resp_ru_start: 16;
  1506. };
  1507. struct {
  1508. A_UINT32 resp_ru_index: 16,
  1509. resp_ru_size: 16;
  1510. };
  1511. };
  1512. /* BIT [ 0 : 0 ] :- resp_type_valid
  1513. * BIT [ 5 : 1 ] :- ppdu_type - HTT_PPDU_STAT_PPDU_TYPE
  1514. * BIT [ 31: 6 ] :- reserved2
  1515. */
  1516. union {
  1517. A_UINT32 resp_type_vld_ppdu_type;
  1518. struct {
  1519. A_UINT32 resp_type_vld: 1,
  1520. ppdu_type: 5,
  1521. reserved2: 26;
  1522. };
  1523. };
  1524. /* BIT [ 1 : 0 ] :- ltf_size
  1525. * BIT [ 2 : 2 ] :- stbc
  1526. * BIT [ 3 : 3 ] :- he_re (range extension)
  1527. * BIT [ 7 : 4 ] :- txbf
  1528. * BIT [ 11: 8 ] :- bw
  1529. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  1530. * BIT [ 19: 16] :- mcs
  1531. * BIT [ 23: 20] :- preamble
  1532. * BIT [ 27: 24] :- gi - HTT_PPDU_STATS_GI
  1533. * BIT [ 28: 28] :- dcm
  1534. * BIT [ 29: 29] :- ldpc
  1535. * BIT [ 30: 30] :- valid_skipped_rate_ctrl
  1536. * This flag indicates whether the skipped_rate_ctrl
  1537. * flag should be ignored, or if it holds valid data.
  1538. * BIT [ 31: 31] :- skipped_rate_ctrl
  1539. */
  1540. union {
  1541. A_UINT32 rate_info;
  1542. struct {
  1543. A_UINT32 ltf_size: 2,
  1544. stbc: 1,
  1545. he_re: 1,
  1546. txbf: 4,
  1547. bw: 4,
  1548. nss: 4,
  1549. mcs: 4,
  1550. preamble: 4,
  1551. gi: 4,
  1552. dcm: 1,
  1553. ldpc: 1,
  1554. valid_skipped_rate_ctrl: 1,
  1555. skipped_rate_ctrl: 1;
  1556. };
  1557. };
  1558. /* Note: resp_rate_info is only valid for if resp_type is UL
  1559. * BIT [ 1 : 0 ] :- ltf_size
  1560. * BIT [ 2 : 2 ] :- stbc
  1561. * BIT [ 3 : 3 ] :- he_re (range extension)
  1562. * BIT [ 7 : 4 ] :- reserved3
  1563. * BIT [ 11: 8 ] :- bw
  1564. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  1565. * BIT [ 19: 16] :- mcs
  1566. * BIT [ 23: 20] :- preamble
  1567. * BIT [ 27: 24] :- gi
  1568. * BIT [ 28: 28] :- dcm
  1569. * BIT [ 29: 29] :- ldpc
  1570. * BIT [ 31: 30] :- resp_ppdu_type - HTT_PPDU_STATS_RESP_PPDU_TYPE
  1571. */
  1572. union {
  1573. A_UINT32 resp_rate_info;
  1574. struct {
  1575. A_UINT32 resp_ltf_size: 2,
  1576. resp_stbc: 1,
  1577. resp_he_re: 1,
  1578. reserved3: 4,
  1579. resp_bw: 4,
  1580. resp_nss: 4,
  1581. resp_mcs: 4,
  1582. resp_preamble: 4,
  1583. resp_gi: 4,
  1584. resp_dcm: 1,
  1585. resp_ldpc: 1,
  1586. resp_ppdu_type: 2;
  1587. };
  1588. };
  1589. /*
  1590. * BIT [15:0] :- Punctured BW bitmap pattern to indicate which BWs are
  1591. * punctured.
  1592. */
  1593. A_UINT32 punc_pattern_bitmap: 16,
  1594. reserved4: 16;
  1595. } htt_ppdu_stats_user_rate_tlv;
  1596. #define HTT_PPDU_STATS_USR_RATE_VALID_M 0x80000000
  1597. #define HTT_PPDU_STATS_USR_RATE_VALID_S 31
  1598. #define HTT_PPDU_STATS_USR_RATE_VALID_GET(_val) \
  1599. (((_val) & HTT_PPDU_STATS_USR_RATE_VALID_M) >> \
  1600. HTT_PPDU_STATS_USR_RATE_VALID_S)
  1601. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_M 0x000000ff
  1602. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S 0
  1603. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_GET(_var) \
  1604. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  1605. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)
  1606. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM, _val); \
  1609. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)); \
  1610. } while (0)
  1611. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_M 0x0000ff00
  1612. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_S 8
  1613. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  1614. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S 16
  1615. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  1616. (((_var) & HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M) >> \
  1617. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)
  1618. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID, _val); \
  1621. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)); \
  1622. } while (0)
  1623. typedef struct {
  1624. htt_tlv_hdr_t tlv_hdr;
  1625. /* BIT [ 7 : 0] :- tid_num
  1626. * BIT [ 15: 8] :- reserved0
  1627. * BIT [ 31: 16] :- sw_peer_id
  1628. */
  1629. union {
  1630. A_UINT32 sw_peer_id__tid_num;
  1631. struct {
  1632. A_UINT32 tid_num: 8,
  1633. reserved0: 8,
  1634. sw_peer_id: 16;
  1635. };
  1636. };
  1637. A_UINT32 start_seq;
  1638. A_UINT32 enq_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  1639. } htt_ppdu_stats_enq_mpdu_bitmap_64_tlv;
  1640. typedef struct {
  1641. htt_tlv_hdr_t tlv_hdr;
  1642. /* BIT [ 7 : 0] :- tid_num
  1643. * BIT [ 15: 8] :- reserved0
  1644. * BIT [ 31: 16] :- sw_peer_id
  1645. */
  1646. union {
  1647. A_UINT32 sw_peer_id__tid_num;
  1648. struct {
  1649. A_UINT32 tid_num: 8,
  1650. reserved0: 8,
  1651. sw_peer_id: 16;
  1652. };
  1653. };
  1654. A_UINT32 start_seq;
  1655. A_UINT32 enq_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  1656. } htt_ppdu_stats_enq_mpdu_bitmap_256_tlv;
  1657. typedef struct {
  1658. htt_tlv_hdr_t tlv_hdr;
  1659. /* BIT [ 7 : 0] :- tid_num
  1660. * BIT [ 15: 8] :- reserved0
  1661. * BIT [ 31: 16] :- sw_peer_id
  1662. */
  1663. union {
  1664. A_UINT32 sw_peer_id__tid_num;
  1665. struct {
  1666. A_UINT32 tid_num: 8,
  1667. reserved0: 8,
  1668. sw_peer_id: 16;
  1669. };
  1670. };
  1671. A_UINT32 start_seq;
  1672. A_UINT32 enq_bitmap[HTT_BA_1024_BIT_MAP_SIZE_DWORDS];
  1673. } htt_ppdu_stats_enq_mpdu_bitmap_1024_tlv;
  1674. /* COMPLETION_STATUS defined in HTT_PPDU_STATS_USER_COMPLETION_STATUS */
  1675. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M 0x000000ff
  1676. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S 0
  1677. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_GET(_var) \
  1678. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M) >> \
  1679. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)
  1680. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS, _val); \
  1683. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)); \
  1684. } while (0)
  1685. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M 0x0000ff00
  1686. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S 8
  1687. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_GET(_var) \
  1688. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M) >> \
  1689. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)
  1690. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_SET(_var, _val) \
  1691. do { \
  1692. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM, _val); \
  1693. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)); \
  1694. } while (0)
  1695. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  1696. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S 16
  1697. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_GET(_var) \
  1698. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M) >> \
  1699. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)
  1700. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID, _val); \
  1703. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)); \
  1704. } while (0)
  1705. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M 0x0000ffff
  1706. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S 0
  1707. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_GET(_var) \
  1708. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M) >> \
  1709. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)
  1710. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_SET(_var, _val) \
  1711. do { \
  1712. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED, _val); \
  1713. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)); \
  1714. } while (0)
  1715. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M 0xffff0000
  1716. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S 16
  1717. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_GET(_var) \
  1718. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M) >> \
  1719. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)
  1720. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_SET(_var, _val) \
  1721. do { \
  1722. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS, _val); \
  1723. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)); \
  1724. } while (0)
  1725. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M 0x0000000f
  1726. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S 0
  1727. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_GET(_var) \
  1728. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M) >> \
  1729. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)
  1730. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_SET(_var, _val) \
  1731. do { \
  1732. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY, _val); \
  1733. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)); \
  1734. } while (0)
  1735. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M 0x000000f0
  1736. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S 4
  1737. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_GET(_var) \
  1738. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M) >> \
  1739. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)
  1740. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_SET(_var, _val) \
  1741. do { \
  1742. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY, _val); \
  1743. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)); \
  1744. } while (0)
  1745. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M 0x00000100
  1746. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S 8
  1747. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_GET(_var) \
  1748. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M) >> \
  1749. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)
  1750. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_SET(_var, _val) \
  1751. do { \
  1752. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU, _val); \
  1753. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)); \
  1754. } while (0)
  1755. enum HTT_PPDU_STATS_RESP_TYPE {
  1756. HTT_PPDU_STATS_NO_RESPONSE_EXPECTED_E = 0,
  1757. HTT_PPDU_STATS_ACK_EXPECTED_E = 1,
  1758. HTT_PPDU_STATS_BA_BITMAP_EXPECTED_E = 2,
  1759. HTT_PPDU_STATS_UL_MU_BA_EXPECTED_E = 3,
  1760. HTT_PPDU_STATS_UL_MU_BA_AND_DATA_EXPECTED_E = 4,
  1761. HTT_PPDU_STATS_CTS_EXPECTED_E = 5,
  1762. HTT_PPDU_STATS_MU_CBF_EXPECTED_E = 6,
  1763. };
  1764. typedef enum HTT_PPDU_STATS_RESP_TYPE HTT_PPDU_STATS_RESP_TYPE;
  1765. /* Refer HTT_PPDU_STATS_RESP_TYPE */
  1766. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M 0x00001e00
  1767. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S 9
  1768. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_GET(_var) \
  1769. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M) >> \
  1770. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)
  1771. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_SET(_var, _val) \
  1772. do { \
  1773. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE, _val); \
  1774. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)); \
  1775. } while (0)
  1776. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_M 0x0000e000
  1777. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S 13
  1778. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_GET(_var) \
  1779. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_M) >> \
  1780. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S)
  1781. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_SET (_var , _val) \
  1782. do { \
  1783. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE, _val); \
  1784. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S)); \
  1785. } while (0)
  1786. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_M 0x00010000
  1787. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S 16
  1788. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_GET(_var) \
  1789. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_M) >> \
  1790. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S)
  1791. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_SET (_var, _val) \
  1792. do { \
  1793. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS, _val); \
  1794. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S)); \
  1795. } while (0)
  1796. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_M 0x00020000
  1797. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S 17
  1798. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_GET(_var) \
  1799. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_M) >> \
  1800. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S)
  1801. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_SET (_var , _val) \
  1802. do { \
  1803. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE, _val); \
  1804. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S)); \
  1805. } while (0)
  1806. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M 0x00040000
  1807. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S 18
  1808. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_GET(_var) \
  1809. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M) >> \
  1810. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S)
  1811. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_SET (_var , _val) \
  1812. do { \
  1813. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX, _val); \
  1814. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S)); \
  1815. } while (0)
  1816. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_M 0xffffffff
  1817. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S 0
  1818. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_GET(_var) \
  1819. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_M) >> \
  1820. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S)
  1821. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_SET(_var, _val) \
  1822. do { \
  1823. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI, _val); \
  1824. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S)); \
  1825. } while (0)
  1826. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_M 0xffffffff
  1827. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S 0
  1828. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_GET(_var) \
  1829. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_M) >> \
  1830. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S)
  1831. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_SET(_var, _val) \
  1832. do { \
  1833. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK, _val); \
  1834. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S)); \
  1835. } while (0)
  1836. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_M 0x00010000
  1837. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S 16
  1838. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_GET(_var) \
  1839. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_M) >> \
  1840. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S)
  1841. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING, _val); \
  1844. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S)); \
  1845. } while (0)
  1846. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_M 0x0000ffff
  1847. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S 0
  1848. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_GET(_var) \
  1849. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_M) >> \
  1850. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S)
  1851. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_SET(_var, _val) \
  1852. do { \
  1853. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS, _val); \
  1854. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S)); \
  1855. } while (0)
  1856. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_M 0xffffffff
  1857. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S 0
  1858. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_GET(_var) \
  1859. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_M) >> \
  1860. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S)
  1861. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES, _val); \
  1864. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S)); \
  1865. } while (0)
  1866. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_M 0xffffffff
  1867. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S 0
  1868. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_GET(_var) \
  1869. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_M) >> \
  1870. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S)
  1871. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_SET(_var, _val) \
  1872. do { \
  1873. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER, _val); \
  1874. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S)); \
  1875. } while (0)
  1876. enum HTT_PPDU_STATS_USER_COMPLETION_STATUS {
  1877. HTT_PPDU_STATS_USER_STATUS_OK,
  1878. HTT_PPDU_STATS_USER_STATUS_FILTERED,
  1879. HTT_PPDU_STATS_USER_STATUS_RESP_TIMEOUT,
  1880. HTT_PPDU_STATS_USER_STATUS_RESP_MISMATCH,
  1881. HTT_PPDU_STATS_USER_STATUS_ABORT,
  1882. };
  1883. typedef enum HTT_PPDU_STATS_USER_COMPLETION_STATUS HTT_PPDU_STATS_USER_COMPLETION_STATUS;
  1884. typedef struct {
  1885. htt_tlv_hdr_t tlv_hdr;
  1886. /* BIT [ 7 : 0] :- completion_status
  1887. * BIT [ 15: 8] :- tid_num
  1888. * BIT [ 31: 16] :- sw_peer_id
  1889. */
  1890. union {
  1891. A_UINT32 sw_peer_id__tid_num__completion_status;
  1892. struct {
  1893. A_UINT32 completion_status: 8,
  1894. tid_num: 8,
  1895. sw_peer_id: 16;
  1896. };
  1897. };
  1898. /* RSSI value of last ack packet (units = dB above noise floor) */
  1899. A_UINT32 ack_rssi;
  1900. /* BIT [ 15 : 0] :- mpdu_tried
  1901. * BIT [ 31 : 16] :- mpdu_success
  1902. */
  1903. union {
  1904. A_UINT32 mpdu_tried__mpdu_success;
  1905. struct {
  1906. A_UINT32 mpdu_tried: 16,
  1907. mpdu_success: 16;
  1908. };
  1909. };
  1910. /* BIT [ 3 : 0] :- long_retries
  1911. * BIT [ 7 : 4] :- short_retries
  1912. * BIT [ 8 : 8] :- is_ampdu
  1913. * BIT [ 12: 9] :- resp_type
  1914. * BIT [ 15: 13] :- medium protection type
  1915. * BIT [ 16: 16] :- rts_success (HW RTS)
  1916. * BIT [ 17: 17] :- rts_failure (HW RTS)
  1917. * BIT [ 18: 18] :- pream_punc_tx
  1918. * BIT [ 31: 19] :- reserved
  1919. */
  1920. union {
  1921. /* older names */
  1922. A_UINT32 resp_type_is_ampdu__short_retry__long_retry;
  1923. A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure;
  1924. /* newest name */
  1925. A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure__pream_punc_tx;
  1926. struct { /* bitfield names */
  1927. A_UINT32 long_retries: 4,
  1928. short_retries: 4,
  1929. is_ampdu: 1,
  1930. resp_type: 4,
  1931. mprot_type: 3,
  1932. rts_success: 1,
  1933. rts_failure: 1,
  1934. pream_punc_tx: 1,
  1935. reserved0: 13;
  1936. };
  1937. };
  1938. /*
  1939. * ack RSSI per chain for last transmission to the peer-TID
  1940. * (value in dB w.r.t noise floor)
  1941. */
  1942. A_UINT32 chain_rssi[HTT_STATS_MAX_CHAINS];
  1943. /* Tx Antenna mask for last packet transmission */
  1944. A_UINT32 tx_antenna_mask;
  1945. /* For SmartAntenna
  1946. * BIT [15:0] :- pending_training_pkts
  1947. * Holds number of pending training packets during training.
  1948. * BIT [16] :- is_training
  1949. * This flag indicates if peer is under training.
  1950. * BIT [31:17] :- reserved1
  1951. */
  1952. A_UINT32 pending_training_pkts:16,
  1953. is_training:1,
  1954. reserved1:15;
  1955. /*
  1956. * Max rates configured per BW:
  1957. * for BW supported by Smart Antenna - 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1958. * (Note: 160 MHz is currently not supported by Smart Antenna)
  1959. */
  1960. A_UINT32 max_rates[HTT_STATS_NUM_SUPPORTED_BW_SMART_ANTENNA];
  1961. /* PER of the last transmission to the peer-TID (in percent) */
  1962. A_UINT32 current_rate_per;
  1963. /*
  1964. * For SW RTS
  1965. * BIT [0] :- Whether SW RTS successfully sent OTA.
  1966. * BIT [1] :- Whether SW RTS successful completion.
  1967. * BIT [2] :- Whether SW RTS failed completion.
  1968. * BIT [3] :- Whether SW RTS response with different BW.
  1969. * BIT [31:4] :- reserved2
  1970. */
  1971. A_UINT32 sw_rts_tried: 1,
  1972. sw_rts_success: 1,
  1973. sw_rts_failure: 1,
  1974. cts_rcvd_diff_bw: 1,
  1975. reserved2: 28;
  1976. } htt_ppdu_stats_user_cmpltn_common_tlv;
  1977. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_M 0x000000ff
  1978. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S 0
  1979. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_GET(_var) \
  1980. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  1981. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)
  1982. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  1983. do { \
  1984. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM, _val); \
  1985. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)); \
  1986. } while (0)
  1987. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_M 0x0000ff00
  1988. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_S 8
  1989. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  1990. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S 16
  1991. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  1992. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M) >> \
  1993. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)
  1994. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID, _val); \
  1997. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)); \
  1998. } while (0)
  1999. typedef struct {
  2000. htt_tlv_hdr_t tlv_hdr;
  2001. /* BIT [ 7 : 0] :- tid_num
  2002. * BIT [ 15: 8] :- reserved0
  2003. * BIT [ 31: 16] :- sw_peer_id
  2004. */
  2005. union {
  2006. A_UINT32 sw_peer_id__tid_num;
  2007. struct {
  2008. A_UINT32 tid_num: 8,
  2009. reserved0: 8,
  2010. sw_peer_id: 16;
  2011. };
  2012. };
  2013. A_UINT32 ba_seq_no;
  2014. A_UINT32 ba_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  2015. } htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv;
  2016. typedef struct {
  2017. htt_tlv_hdr_t tlv_hdr;
  2018. /* BIT [ 7 : 0] :- tid_num
  2019. * BIT [ 15: 8] :- reserved0
  2020. * BIT [ 31: 16] :- sw_peer_id
  2021. */
  2022. union {
  2023. A_UINT32 sw_peer_id__tid_num;
  2024. struct {
  2025. A_UINT32 tid_num: 8,
  2026. reserved0: 8,
  2027. sw_peer_id: 16;
  2028. };
  2029. };
  2030. A_UINT32 ba_seq_no;
  2031. A_UINT32 ba_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  2032. } htt_ppdu_stats_user_compltn_ba_bitmap_256_tlv;
  2033. typedef struct {
  2034. htt_tlv_hdr_t tlv_hdr;
  2035. /* BIT [ 7 : 0] :- tid_num
  2036. * BIT [ 15: 8] :- reserved0
  2037. * BIT [ 31: 16] :- sw_peer_id
  2038. */
  2039. union {
  2040. A_UINT32 sw_peer_id__tid_num;
  2041. struct {
  2042. A_UINT32 tid_num: 8,
  2043. reserved0: 8,
  2044. sw_peer_id: 16;
  2045. };
  2046. };
  2047. A_UINT32 ba_seq_no;
  2048. A_UINT32 ba_bitmap[HTT_BA_1024_BIT_MAP_SIZE_DWORDS];
  2049. } htt_ppdu_stats_user_compltn_ba_bitmap_1024_tlv;
  2050. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M 0x0000ffff
  2051. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S 0
  2052. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_GET(_var) \
  2053. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M) >> \
  2054. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)
  2055. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID, _val); \
  2058. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)); \
  2059. } while (0)
  2060. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M 0x000001ff
  2061. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S 0
  2062. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_GET(_var) \
  2063. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M) >> \
  2064. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)
  2065. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU, _val); \
  2068. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)); \
  2069. } while (0)
  2070. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M 0x01fffe00
  2071. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S 9
  2072. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_GET(_var) \
  2073. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M) >> \
  2074. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)
  2075. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU, _val); \
  2078. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)); \
  2079. } while (0)
  2080. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M 0xfe000000
  2081. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S 25
  2082. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_GET(_var) \
  2083. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M) >> \
  2084. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)
  2085. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM, _val); \
  2088. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)); \
  2089. } while (0)
  2090. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M 0x0000ffff
  2091. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S 0
  2092. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_GET(_var) \
  2093. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M) >> \
  2094. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)
  2095. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_SET(_var, _val) \
  2096. do { \
  2097. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ, _val); \
  2098. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)); \
  2099. } while (0)
  2100. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M 0xffff0000
  2101. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S 16
  2102. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_GET(_var) \
  2103. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M) >> \
  2104. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)
  2105. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ, _val); \
  2108. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)); \
  2109. } while (0)
  2110. typedef struct {
  2111. htt_tlv_hdr_t tlv_hdr;
  2112. A_UINT32 ppdu_id;
  2113. /* BIT [ 15 : 0] :- sw_peer_id
  2114. * BIT [ 31 : 16] :- reserved0
  2115. */
  2116. union {
  2117. A_UINT32 rsvd_sw_peer_id;
  2118. struct {
  2119. A_UINT32 sw_peer_id: 16,
  2120. reserved0: 16;
  2121. };
  2122. };
  2123. /* BIT [ 8 : 0] :- num_mpdu
  2124. * BIT [ 24 : 9] :- num_msdu
  2125. * BIT [ 31 : 25] :- tid_num
  2126. */
  2127. union {
  2128. A_UINT32 tid_num__num_msdu__num_mpdu;
  2129. struct {
  2130. A_UINT32 num_mpdu: 9,
  2131. num_msdu: 16,
  2132. tid_num: 7;
  2133. };
  2134. };
  2135. /* BIT [ 15 : 0] :- current_seq
  2136. * BIT [ 31 : 16] :- start_seq
  2137. */
  2138. union {
  2139. A_UINT32 start_seq__current_seq;
  2140. struct {
  2141. A_UINT32 current_seq: 16,
  2142. start_seq: 16;
  2143. };
  2144. };
  2145. A_UINT32 success_bytes;
  2146. } htt_ppdu_stats_user_compltn_ack_ba_status_tlv;
  2147. /* FLOW_TYPE defined in HTT_TX_FLOW_TYPE */
  2148. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M 0x000000ff
  2149. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S 0
  2150. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_GET(_var) \
  2151. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M) >> \
  2152. HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)
  2153. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_SET(_var, _val) \
  2154. do { \
  2155. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE, _val); \
  2156. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)); \
  2157. } while (0)
  2158. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M 0x0001ff00
  2159. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S 8
  2160. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_GET(_var) \
  2161. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M) >> \
  2162. HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)
  2163. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU, _val); \
  2166. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)); \
  2167. } while (0)
  2168. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M 0x7ffe0000
  2169. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S 17
  2170. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_GET(_var) \
  2171. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M) >> \
  2172. HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)
  2173. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU, _val); \
  2176. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)); \
  2177. } while (0)
  2178. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M 0x000000ff
  2179. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S 0
  2180. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_GET(_var) \
  2181. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M) >> \
  2182. HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)
  2183. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_SET(_var, _val) \
  2184. do { \
  2185. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_TID_NUM, _val); \
  2186. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)); \
  2187. } while (0)
  2188. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M 0x0000ff00
  2189. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S 8
  2190. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_GET(_var) \
  2191. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M) >> \
  2192. HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)
  2193. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_SET(_var, _val) \
  2194. do { \
  2195. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE, _val); \
  2196. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)); \
  2197. } while (0)
  2198. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M 0xffff0000
  2199. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S 16
  2200. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_GET(_var) \
  2201. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M) >> \
  2202. HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)
  2203. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID, _val); \
  2206. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)); \
  2207. } while (0)
  2208. enum HTT_TX_FLOW_TYPE {
  2209. HTT_TX_TID_FRAMEQ,
  2210. HTT_TX_TQM_MSDUQ,
  2211. HTT_TQM_MPDUQ,
  2212. };
  2213. enum HTT_FLUSH_STATUS_DROP_REASON {
  2214. HTT_FLUSH_PEER_DELETE,
  2215. HTT_FLUSH_TID_DELETE,
  2216. HTT_FLUSH_TTL_EXCEEDED,
  2217. HTT_FLUSH_EXCESS_RETRIES,
  2218. HTT_FLUSH_REINJECT,
  2219. };
  2220. typedef struct {
  2221. htt_tlv_hdr_t tlv_hdr;
  2222. A_UINT32 drop_reason;
  2223. /* BIT [ 7 : 0] :- flow_type
  2224. * BIT [ 16: 8] :- num_mpdu
  2225. * BIT [ 30: 17] :- num_msdu
  2226. * BIT [ 31: 31] :- reserved0
  2227. */
  2228. union {
  2229. A_UINT32 num_msdu__num_mpdu__flow_type;
  2230. struct {
  2231. A_UINT32 flow_type: 8,
  2232. num_mpdu: 9,
  2233. num_msdu: 14,
  2234. reserved0: 1;
  2235. };
  2236. };
  2237. /* BIT [ 7 : 0] :- tid_num
  2238. * BIT [ 15 : 8] :- queue_type
  2239. * BIT [ 31 : 16] :- sw_peer_id
  2240. */
  2241. union {
  2242. A_UINT32 sw_peer_id__queue_type__tid_num;
  2243. struct {
  2244. A_UINT32 tid_num: 8,
  2245. queue_type: 8,
  2246. sw_peer_id: 16;
  2247. };
  2248. };
  2249. } htt_ppdu_stats_flush_tlv;
  2250. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_M 0x0000ffff
  2251. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S 0
  2252. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_GET(_var) \
  2253. (((_var) & HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_M) >> \
  2254. HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S)
  2255. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_SET(_var, _val) \
  2256. do { \
  2257. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH, _val); \
  2258. ((_var) |= ((_val) << HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S)); \
  2259. } while (0)
  2260. typedef struct {
  2261. htt_tlv_hdr_t tlv_hdr;
  2262. /*
  2263. * BIT [ 15 : 0] :- frame_length
  2264. * BIT [ 31 : 16] :- reserved1
  2265. */
  2266. union {
  2267. A_UINT32 rsvd__frame_length;
  2268. struct {
  2269. A_UINT32 frame_length: 16,
  2270. reserved1: 16; /* set to 0x0 */
  2271. };
  2272. };
  2273. /* Future purpose */
  2274. A_UINT32 reserved2; /* set to 0x0 */
  2275. A_UINT32 reserved3; /* set to 0x0 */
  2276. /* mgmt/ctrl frame payload
  2277. * The size of the actual mgmt payload (in bytes) can be obtained from
  2278. * the frame_length field.
  2279. * The size of entire payload including the padding for alignment
  2280. * (in bytes) can be derived from the length in tlv parametes,
  2281. * minus the 12 bytes of the above fields.
  2282. */
  2283. A_UINT32 payload[1];
  2284. } htt_ppdu_stats_tx_mgmtctrl_payload_tlv;
  2285. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_M 0x0000ffff
  2286. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S 0
  2287. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_GET(_var) \
  2288. (((_var) & HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_M) >> \
  2289. HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S)
  2290. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH, _val); \
  2293. ((_var) |= ((_val) << HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S)); \
  2294. } while (0)
  2295. typedef struct {
  2296. htt_tlv_hdr_t tlv_hdr;
  2297. /*
  2298. * BIT [ 15 : 0] :- frame_length (in bytes)
  2299. * BIT [ 31 : 16] :- reserved1
  2300. */
  2301. union {
  2302. A_UINT32 rsvd__frame_length;
  2303. struct {
  2304. A_UINT32 frame_length: 16,
  2305. reserved1: 16; /* set to 0x0 */
  2306. };
  2307. };
  2308. /* Future purpose */
  2309. A_UINT32 reserved2; /* set to 0x0 */
  2310. A_UINT32 reserved3; /* set to 0x0 */
  2311. /* mgmt/ctrl frame payload
  2312. * The size of the actual mgmt payload (in bytes) can be obtained from
  2313. * the frame_length field.
  2314. * The size of entire payload including the padding for alignment
  2315. * (in bytes) can be derived from the length in tlv parametes,
  2316. * minus the 12 bytes of the above fields.
  2317. */
  2318. A_UINT32 payload[1];
  2319. } htt_ppdu_stats_rx_mgmtctrl_payload_tlv;
  2320. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_M 0x000000ff
  2321. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S 0
  2322. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_GET(_var) \
  2323. (((_var) & HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_M) >> \
  2324. HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S)
  2325. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_SET(_var, _val) \
  2326. do { \
  2327. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS, _val); \
  2328. ((_var) |= ((_val) << HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S)); \
  2329. } while (0)
  2330. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_M 0x0000ff00
  2331. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S 8
  2332. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_GET(_var) \
  2333. (((_var) & HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_M) >> \
  2334. HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S)
  2335. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_SET(_var, _val) \
  2336. do { \
  2337. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE, _val); \
  2338. ((_var) |= ((_val) << HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S)); \
  2339. } while (0)
  2340. typedef struct {
  2341. htt_tlv_hdr_t tlv_hdr;
  2342. /*
  2343. * BIT [ 7 : 0] :- max_users
  2344. * BIT [ 15 : 8] :- frame_type (HTT_STATS_FTYPE)
  2345. * BIT [ 31 : 16] :- reserved1
  2346. */
  2347. union {
  2348. A_UINT32 rsvd__frame_type__max_users;
  2349. struct {
  2350. A_UINT32 max_users: 8,
  2351. frame_type: 8,
  2352. reserved1: 16;
  2353. };
  2354. };
  2355. } htt_ppdu_stats_users_info_tlv;
  2356. typedef struct {
  2357. htt_tlv_hdr_t tlv_hdr;
  2358. A_UINT32 ppdu_id;
  2359. A_UINT32 tid_num : 8,
  2360. reserved1 :24;
  2361. A_UINT32 start_seq :16, /* [15: 0] */
  2362. /* ba_enabled:
  2363. * To know if block ack established or not.
  2364. * If block ack is not enabled, start_seq represents
  2365. * the seq number of the current MPDU/PPDU.
  2366. */
  2367. ba_enabled : 1,
  2368. nss : 4,
  2369. /* win_size:
  2370. * Block ack window size in multiples of 32 bits.
  2371. * For example: For a 64-bit block ack, win_size will be 2.
  2372. */
  2373. win_size : 8,
  2374. reserved2 : 3;
  2375. /* The number of elements in the ba_bitmap array depends on win_size. */
  2376. A_UINT32 ba_bitmap[1];
  2377. } htt_ppdu_stats_for_smu_tlv;
  2378. typedef struct {
  2379. htt_tlv_hdr_t tlv_hdr;
  2380. /*
  2381. * BIT [ 2 : 0] :- response_reason
  2382. * BIT [ 6 : 3] :- mlo_change_t1_cts2self
  2383. * BIT [ 10 : 7] :- mlo_change_t1_ppdu
  2384. * BIT [ 14 : 11] :- mlo_change_t2_response
  2385. * BIT [ 18 : 15] :- mlo_change_t3_r2r
  2386. * BIT [ 19 : 19] :- partner_link_info_valid
  2387. * BIT [ 22 : 20] :- partner_link_id
  2388. * BIT [ 27 : 23] :- partner_link_cmd_ring_id
  2389. * BIT [ 28 : 28] :- dot11ax_trigger_frame_embedded
  2390. * BIT [ 31 : 29] :- reserved_0a
  2391. */
  2392. A_UINT32 response_reason : 3,
  2393. mlo_change_t1_cts2self : 4,
  2394. mlo_change_t1_ppdu : 4,
  2395. mlo_change_t2_response : 4,
  2396. mlo_change_t3_r2r : 4,
  2397. partner_link_info_valid : 1,
  2398. partner_link_id : 3,
  2399. partner_link_cmd_ring_id : 5,
  2400. dot11ax_trigger_frame_embedded : 1,
  2401. reserved_0a : 3;
  2402. /*
  2403. * BIT [ 15 : 0] :- partner_link_schedule_id
  2404. * BIT [ 31 : 16] :- tx_rx_overlap_duration (microsecond units)
  2405. */
  2406. A_UINT32 partner_link_schedule_id : 16,
  2407. tx_rx_overlap_duration_us : 16;
  2408. /*
  2409. * BIT [ 15 : 0] :- cts2self_duration (microsecond units)
  2410. * BIT [ 31 : 16] :- ppdu_duration (microsecond units)
  2411. */
  2412. A_UINT32 cts2self_duration_us : 16,
  2413. ppdu_duration_us : 16;
  2414. /*
  2415. * BIT [ 15 : 0] :- response_duration (microsecond units)
  2416. * BIT [ 31 : 16] :- response_to_response_duration (microsecond units)
  2417. */
  2418. A_UINT32 response_duration_us : 16,
  2419. response_to_response_duration_us : 16;
  2420. /*
  2421. * BIT [ 15 : 0] :- self_link_schedule_id
  2422. * BIT [ 31 : 16] :- hls_branch_debug_code
  2423. */
  2424. A_UINT32 self_link_schedule_id : 16,
  2425. hls_branch_debug_code : 16;
  2426. /*
  2427. * BIT [ 31 : 0] :- hls_decision_debug_info
  2428. */
  2429. A_UINT32 hls_decision_debug_info : 32;
  2430. } htt_ppdu_stats_mlo_tx_resp_tlv;
  2431. typedef struct {
  2432. htt_tlv_hdr_t tlv_hdr;
  2433. /*
  2434. * BIT [ 2 : 0] :- notification_reason
  2435. * BIT [ 3 : 3] :- ml_decision
  2436. * BIT [ 4 : 4] :- cts2self_padding
  2437. * BIT [ 5 : 5] :- initiated_by_truncated_backoff
  2438. * BIT [ 8 : 6] :- transmit_start_reason
  2439. * BIT [ 14 : 9] :- num_users
  2440. * BIT [ 24 : 15] :- nstr_mlo_sta_id
  2441. * BIT [ 25 : 25] :- block_self_ml_sync
  2442. * BIT [ 26 : 26] :- block_partner_ml_sync
  2443. * BIT [ 27 : 27] :- nstr_mlo_sta_id_valid
  2444. * BIT [ 31 : 28] :- reserved_0a
  2445. */
  2446. A_UINT32 notification_reason : 3,
  2447. ml_decision : 1,
  2448. cts2self_padding : 1,
  2449. initiated_by_truncated_backoff : 1,
  2450. transmit_start_reason : 3,
  2451. num_users : 6,
  2452. nstr_mlo_sta_id : 10,
  2453. block_self_ml_sync : 1,
  2454. block_partner_ml_sync : 1,
  2455. nstr_mlo_sta_id_valid : 1,
  2456. reserved_0a : 4;
  2457. /*
  2458. * BIT [ 15 : 0] :- pdg_ppdu_duration_adjust_value (microsecond units)
  2459. * BIT [ 31 : 16] :- mlo_ppdu_duration_adjust_value (microsecond units)
  2460. */
  2461. A_UINT32 pdg_ppdu_duration_adjust_value_us : 16,
  2462. mlo_ppdu_duration_adjust_value_us : 16;
  2463. /*
  2464. * BIT [ 15 : 0] :- response_duration (microsecond units)
  2465. * BIT [ 31 : 16] :- response_to_response_duration (microsecond units)
  2466. */
  2467. A_UINT32 response_duration_us : 16,
  2468. response_to_response_duration_us : 16;
  2469. /*
  2470. * BIT [ 15 : 0] :- schedule_id
  2471. * BIT [ 20 : 16] :- cmd_ring_id
  2472. * BIT [ 31 : 21] :- reserved_1a
  2473. */
  2474. A_UINT32 schedule_id : 16,
  2475. cmd_ring_id : 5,
  2476. reserved_1a : 11;
  2477. /*
  2478. * BIT [ 31 : 0] :- mlo_reference_timestamp (microsecond units)
  2479. */
  2480. A_UINT32 mlo_reference_timestamp_us : 32;
  2481. /*
  2482. * BIT [ 15 : 0] :- cts2self_duration (microsecond units)
  2483. * BIT [ 31 : 16] :- ppdu_duration (microsecond units)
  2484. */
  2485. A_UINT32 cts2self_duration_us : 16,
  2486. ppdu_duration_us : 16;
  2487. } htt_ppdu_stats_mlo_tx_notification_tlv;
  2488. #endif //__HTT_PPDU_STATS_H__