htt_ppdu_stats.h 95 KB

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