htt_ppdu_stats.h 94 KB

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