htt_ppdu_stats.h 90 KB

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