htt_ppdu_stats.h 92 KB

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