htt_ppdu_stats.h 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725
  1. /*
  2. * Copyright (c) 2017-2019 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. #define HTT_BA_64_BIT_MAP_SIZE_DWORDS 2
  28. #define HTT_BA_256_BIT_MAP_SIZE_DWORDS 8
  29. enum htt_ppdu_stats_tlv_tag {
  30. HTT_PPDU_STATS_COMMON_TLV,
  31. HTT_PPDU_STATS_USR_COMMON_TLV,
  32. HTT_PPDU_STATS_USR_RATE_TLV,
  33. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_64_TLV,
  34. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_256_TLV,
  35. HTT_PPDU_STATS_SCH_CMD_STATUS_TLV,
  36. HTT_PPDU_STATS_USR_COMPLTN_COMMON_TLV,
  37. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_64_TLV,
  38. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_256_TLV,
  39. HTT_PPDU_STATS_USR_COMPLTN_ACK_BA_STATUS_TLV,
  40. HTT_PPDU_STATS_USR_COMPLTN_FLUSH_TLV,
  41. HTT_PPDU_STATS_USR_COMMON_ARRAY_TLV,
  42. HTT_PPDU_STATS_INFO_TLV,
  43. HTT_PPDU_STATS_TX_MGMTCTRL_PAYLOAD_TLV,
  44. /* New TLV's are added above to this line */
  45. HTT_PPDU_STATS_MAX_TAG,
  46. };
  47. typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t;
  48. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M 0x000000ff
  49. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S 0
  50. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_GET(_var) \
  51. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M) >> \
  52. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)
  53. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_SET(_var, _val) \
  54. do { \
  55. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE, _val); \
  56. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)); \
  57. } while (0)
  58. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M 0x00000100
  59. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S 8
  60. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_GET(_var) \
  61. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M) >> \
  62. HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)
  63. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_SET(_var, _val) \
  64. do { \
  65. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU, _val); \
  66. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)); \
  67. } while (0)
  68. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M 0x00000600
  69. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S 9
  70. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_GET(_var) \
  71. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M) >> \
  72. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)
  73. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_SET(_var, _val) \
  74. do { \
  75. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED, _val); \
  76. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)); \
  77. } while (0)
  78. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M 0x00003800
  79. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S 11
  80. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_GET(_var) \
  81. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M) >> \
  82. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)
  83. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_SET(_var, _val) \
  84. do { \
  85. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW, _val); \
  86. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)); \
  87. } while (0)
  88. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M 0x00004000
  89. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S 14
  90. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_GET(_var) \
  91. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M) >> \
  92. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)
  93. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_SET(_var, _val) \
  94. do { \
  95. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI, _val); \
  96. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \
  97. } while (0)
  98. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000
  99. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15
  100. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \
  101. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \
  102. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)
  103. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \
  104. do { \
  105. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \
  106. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \
  107. } while (0)
  108. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000
  109. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16
  110. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_GET(_var) \
  111. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M) >> \
  112. HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)
  113. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_SET(_var, _val) \
  114. do { \
  115. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID, _val); \
  116. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)); \
  117. } while (0)
  118. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M 0x0000ffff
  119. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S 0
  120. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_GET(_var) \
  121. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M) >> \
  122. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)
  123. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_SET(_var, _val) \
  124. do { \
  125. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS, _val); \
  126. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)); \
  127. } while (0)
  128. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M 0xffff0000
  129. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S 16
  130. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_GET(_var) \
  131. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M) >> \
  132. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)
  133. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_SET(_var, _val) \
  134. do { \
  135. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS, _val); \
  136. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)); \
  137. } while (0)
  138. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M 0x0000ffff
  139. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S 0
  140. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_GET(_var) \
  141. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M) >> \
  142. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)
  143. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_SET(_var, _val) \
  144. do { \
  145. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS, _val); \
  146. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)); \
  147. } while (0)
  148. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M 0xffff0000
  149. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S 16
  150. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_GET(_var) \
  151. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M) >> \
  152. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)
  153. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_SET(_var, _val) \
  154. do { \
  155. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR, _val); \
  156. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)); \
  157. } while (0)
  158. PREPACK struct htt_tx_ppdu_stats_info {
  159. htt_tlv_hdr_t tlv_hdr;
  160. A_UINT32 tx_success_bytes;
  161. A_UINT32 tx_retry_bytes;
  162. A_UINT32 tx_failed_bytes;
  163. A_UINT32 tx_ratecode: 8,
  164. is_ampdu: 1,
  165. ba_ack_failed: 2,
  166. /* 0: 20 MHz
  167. 1: 40 MHz
  168. 2: 80 MHz
  169. 3: 160 MHz or 80+80 MHz */
  170. bw: 3,
  171. sgi: 1,
  172. skipped_rate_ctrl: 1,
  173. peer_id: 16;
  174. A_UINT32 tx_success_msdus: 16,
  175. tx_retry_msdus: 16;
  176. A_UINT32 tx_failed_msdus: 16,
  177. /* united in us */
  178. tx_duration: 16;
  179. /*
  180. * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid.
  181. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits
  182. * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid.
  183. * If bit 1 is set, tx_success_bytes is valid
  184. * If bit 2 is set, tx_retry_bytes is valid
  185. * ...
  186. * If bit 14 is set, tx_duration is valid
  187. */
  188. A_UINT32 valid_bitmap;
  189. } POSTPACK;
  190. typedef struct {
  191. htt_tlv_hdr_t tlv_hdr;
  192. A_UINT32 number_of_ppdu_stats;
  193. /*
  194. * tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
  195. * elements.
  196. * tx_ppdu_stats_info is variable length, with length =
  197. * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
  198. */
  199. struct htt_tx_ppdu_stats_info tx_ppdu_stats_info[1/*number_of_ppdu_stats*/];
  200. } htt_ppdu_stats_usr_common_array_tlv_v;
  201. #define HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT \
  202. struct { \
  203. htt_tlv_hdr_t tlv_hdr; \
  204. /* Refer bmi_msg.h */ \
  205. A_UINT32 target_type; \
  206. }
  207. typedef HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT htt_ppdu_stats_sch_cmd_tlv_hdr_t;
  208. typedef struct {
  209. /*
  210. * Use a union to allow the HW-independent header portion of this struct
  211. * to be accessed either within a hdr struct, or directly within the
  212. * htt_ppdu_stats_sch_cmd_tlv_v struct.
  213. * For example, the target_type field can be accessed either as
  214. * htt_ppdu_stats_sch_cmd_tlv_v.target_type
  215. * or
  216. * htt_ppdu_stats_sch_cmd_tlv_v.hdr.target_type
  217. */
  218. union {
  219. htt_ppdu_stats_sch_cmd_tlv_hdr_t hdr;
  220. HTT_PPDU_STATS_SCH_CMD_TLV_HDR_STRUCT;
  221. };
  222. /*
  223. * The hw portion of this struct contains a scheduler_command_status
  224. * struct, whose definition is different for different target HW types.
  225. * The target_type field within the header can, if set correctly,
  226. * clarify which definition of scheduler_command_status is being used.
  227. */
  228. A_UINT32 hw[1];
  229. } htt_ppdu_stats_sch_cmd_tlv_v;
  230. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff
  231. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S 0
  232. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_GET(_var) \
  233. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M) >> \
  234. HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)
  235. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_SET(_var, _val) \
  236. do { \
  237. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID, _val); \
  238. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)); \
  239. } while (0)
  240. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_M 0x00ff0000
  241. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_S 16
  242. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_GET(_var) \
  243. (((_var) & HTT_PPDU_STATS_COMMON_TLV_RING_ID_M) >> \
  244. HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)
  245. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_SET(_var, _val) \
  246. do { \
  247. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_RING_ID, _val); \
  248. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)); \
  249. } while (0)
  250. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M 0xff000000
  251. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S 24
  252. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_GET(_var) \
  253. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M) >> \
  254. HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)
  255. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_SET(_var, _val) \
  256. do { \
  257. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_USERS, _val); \
  258. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)); \
  259. } while (0)
  260. /* HW queue type */
  261. enum HTT_TX_QUEUE_TYPE {
  262. HTT_TX_QUEUE_INACTIVE,
  263. HTT_TX_QUEUE_DATA,
  264. HTT_TX_QUEUE_BEACON,
  265. HTT_TX_QUEUE_PSPOLL,
  266. HTT_TX_QUEUE_CAB,
  267. HTT_TX_QUEUE_HALPHY,
  268. HTT_TX_QUEUE_QBOOST_RESP,
  269. HTT_TX_QUEUE_NAN_BEACON,
  270. HTT_TX_QUEUE_NAN_MGMT,
  271. HTT_TX_QUEUE_UL_DATA,
  272. HTT_TX_QUEUE_UL_BSR_RESP,
  273. HTT_TX_QUEUE_MGMT,
  274. HTT_TX_QUEUE_MAX,
  275. };
  276. typedef enum HTT_TX_QUEUE_TYPE HTT_TX_QUEUE_TYPE;
  277. /* frame_type */
  278. enum HTT_STATS_FTYPE {
  279. HTT_STATS_FTYPE_SGEN_NDPA = 0,
  280. HTT_STATS_FTYPE_SGEN_NDP,
  281. HTT_STATS_FTYPE_SGEN_BRP,
  282. HTT_STATS_FTYPE_SGEN_BAR,
  283. HTT_STATS_FTYPE_SGEN_RTS,
  284. HTT_STATS_FTYPE_SGEN_CTS,
  285. HTT_STATS_FTYPE_SGEN_CFEND,
  286. HTT_STATS_FTYPE_SGEN_AX_NDPA,
  287. HTT_STATS_FTYPE_SGEN_AX_NDP,
  288. HTT_STATS_FTYPE_SGEN_MU_TRIG,
  289. HTT_STATS_FTYPE_SGEN_MU_BAR,
  290. HTT_STATS_FTYPE_SGEN_MU_BRP,
  291. HTT_STATS_FTYPE_SGEN_MU_RTS,
  292. HTT_STATS_FTYPE_SGEN_MU_BSR,
  293. HTT_STATS_FTYPE_SGEN_UL_BSR,
  294. HTT_STATS_FTYPE_SGEN_UL_BSR_TRIGGER = HTT_STATS_FTYPE_SGEN_UL_BSR, /*alias*/
  295. HTT_STATS_FTYPE_TIDQ_DATA_SU,
  296. HTT_STATS_FTYPE_TIDQ_DATA_MU,
  297. HTT_STATS_FTYPE_SGEN_UL_BSR_RESP,
  298. HTT_STATS_FTYPE_SGEN_QOS_NULL,
  299. HTT_STATS_FTYPE_MAX,
  300. };
  301. typedef enum HTT_STATS_FTYPE HTT_STATS_FTYPE;
  302. /* FRM_TYPE defined in HTT_STATS_FTYPE */
  303. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M 0x000000ff
  304. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S 0
  305. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(_var) \
  306. (((_var) & HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M) >> \
  307. HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)
  308. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_SET(_var, _val) \
  309. do { \
  310. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE, _val); \
  311. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)); \
  312. } while (0)
  313. /* QTYPE defined in HTT_TX_QUEUE_TYPE */
  314. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_M 0x0000ff00
  315. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_S 8
  316. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_GET(_var) \
  317. (((_var) & HTT_PPDU_STATS_COMMON_TLV_QTYPE_M) >> \
  318. HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)
  319. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_SET(_var, _val) \
  320. do { \
  321. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_QTYPE, _val); \
  322. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)); \
  323. } while (0)
  324. enum HTT_PPDU_STATS_BW {
  325. HTT_PPDU_STATS_BANDWIDTH_5MHZ = 0,
  326. HTT_PPDU_STATS_BANDWIDTH_10MHZ = 1,
  327. HTT_PPDU_STATS_BANDWIDTH_20MHZ = 2,
  328. HTT_PPDU_STATS_BANDWIDTH_40MHZ = 3,
  329. HTT_PPDU_STATS_BANDWIDTH_80MHZ = 4,
  330. HTT_PPDU_STATS_BANDWIDTH_160MHZ = 5, /* includes 80+80 */
  331. HTT_PPDU_STATS_BANDWIDTH_DYN = 6,
  332. };
  333. typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW;
  334. enum HTT_PPDU_STATS_SEQ_TYPE {
  335. HTT_SEQTYPE_UNSPECIFIED = 0,
  336. HTT_SEQTYPE_SU = 1,
  337. HTT_SEQTYPE_AC_MU_MIMO = 2,
  338. HTT_SEQTYPE_AX_MU_MIMO = 3,
  339. HTT_SEQTYPE_MU_OFDMA = 4,
  340. HTT_SEQTYPE_UL_TRIG = 5,
  341. HTT_SEQTYPE_BURST_BCN = 6,
  342. HTT_SEQTYPE_UL_BSR_RESP = 7,
  343. HTT_SEQTYPE_UL_BSR_TRIG = 8,
  344. HTT_SEQTYPE_UL_RESP = 9,
  345. };
  346. typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE;
  347. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x00ff0000
  348. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 16
  349. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \
  350. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \
  351. HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)
  352. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \
  353. do { \
  354. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \
  355. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \
  356. } while (0)
  357. #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000
  358. #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16
  359. #define HTT_PPDU_STATS_COMMON_TLV_BW_GET(_var) \
  360. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BW_M) >> \
  361. HTT_PPDU_STATS_COMMON_TLV_BW_S)
  362. #define HTT_PPDU_STATS_COMMON_TLV_BW_SET(_var, _val) \
  363. do { \
  364. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BW, _val); \
  365. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  366. } while (0)
  367. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M 0x0000ffff
  368. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S 0
  369. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(_var) \
  370. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M) >> \
  371. HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)
  372. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_SET(_var, _val) \
  373. do { \
  374. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_MODE, _val); \
  375. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)); \
  376. } while (0)
  377. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M 0xffff0000
  378. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S 16
  379. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_GET(_var) \
  380. (((_var) & HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M) >> \
  381. HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)
  382. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_SET(_var, _val) \
  383. do { \
  384. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ, _val); \
  385. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)); \
  386. } while (0)
  387. typedef struct {
  388. htt_tlv_hdr_t tlv_hdr;
  389. A_UINT32 ppdu_id;
  390. /* BIT [ 15 : 0] :- sched_cmdid
  391. * BIT [ 23 : 16] :- ring_id
  392. * BIT [ 31 : 24] :- num_users
  393. */
  394. union {
  395. A_UINT32 ring_id__sched_cmdid;
  396. struct {
  397. A_UINT32 sched_cmdid: 16,
  398. ring_id: 8,
  399. num_users: 8;
  400. };
  401. };
  402. /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE
  403. * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE
  404. * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW
  405. * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE
  406. * BIT [ 31: 28] :- reserved
  407. */
  408. union {
  409. A_UINT32 bw__queue_type__frame_type;
  410. A_UINT32 ppdu_seq_type__bw__queue_type__frame_type;
  411. struct {
  412. A_UINT32 frame_type: 8,
  413. queue_type: 8,
  414. bw: 4,
  415. ppdu_seq_type: 8,
  416. reserved0: 4;
  417. };
  418. };
  419. A_UINT32 chain_mask;
  420. A_UINT32 fes_duration_us; /* frame exchange sequence */
  421. A_UINT32 ppdu_sch_eval_start_tstmp_us;
  422. A_UINT32 ppdu_sch_end_tstmp_us;
  423. A_UINT32 ppdu_start_tstmp_us;
  424. /* BIT [15 : 0] - phy mode (WLAN_PHY_MODE) with which ppdu was transmitted
  425. * BIT [31 : 16] - bandwidth (in MHz) with which ppdu was transmitted
  426. */
  427. union {
  428. A_UINT32 chan_mhz__phy_mode;
  429. struct {
  430. A_UINT32 phy_mode: 16,
  431. chan_mhz: 16;
  432. };
  433. };
  434. /*
  435. * The cca_delta_time_us reports the time the tx PPDU in question
  436. * was waiting in the HW tx queue for the clear channel assessment
  437. * to indicate that the transmission could start.
  438. * If this CCA delta time is zero or small, this indicates that the
  439. * air interface was unused prior to the transmission, and thus it's
  440. * improbable that there was a collision with some other transceiver's
  441. * transmission.
  442. * In contrast, a large CCA delta time means that this transceiver had
  443. * to wait a long time for the air interface to be available; it's
  444. * possible that other transceivers were also waiting for the air
  445. * interface to become available, and if the other waiting transceiver's
  446. * CW backoff aligned with this one, to have a transmit collision.
  447. */
  448. A_UINT32 cca_delta_time_us;
  449. /*
  450. * The rxfrm_delta_time_us reports the time the tx PPDU in question
  451. * was waiting in the HW tx queue while there was an ongoing rx,
  452. * either because the rx was already ongoing at the time the tx PPDU
  453. * was enqueued, or because the rx (i.e. the peer's tx) won the air
  454. * interface contention over the local vdev's tx.
  455. */
  456. A_UINT32 rxfrm_delta_time_us;
  457. /*
  458. * The txfrm_delta_time_us reports the time from when the tx PPDU
  459. * in question was enqueued into the HW tx queue until the time the
  460. * tx completion interrupt for the PPDU occurred.
  461. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU
  462. * had to wait for the air interface to become available, the PPDU
  463. * duration, the block ack reception, and the tx completion interrupt
  464. * latency.
  465. */
  466. A_UINT32 txfrm_delta_time_us;
  467. } htt_ppdu_stats_common_tlv;
  468. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff
  469. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S 0
  470. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_GET(_var) \
  471. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M) >> \
  472. HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)
  473. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_SET(_var, _val) \
  474. do { \
  475. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM, _val); \
  476. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)); \
  477. } while (0)
  478. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M 0x0000ff00
  479. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S 8
  480. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_GET(_var) \
  481. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M) >> \
  482. HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)
  483. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_SET(_var, _val) \
  484. do { \
  485. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID, _val); \
  486. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)); \
  487. } while (0)
  488. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  489. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S 16
  490. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_GET(_var) \
  491. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M) >> \
  492. HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)
  493. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  494. do { \
  495. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID, _val); \
  496. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)); \
  497. } while (0)
  498. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M 0x00000001
  499. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S 0
  500. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_GET(_var) \
  501. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M) >> \
  502. HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)
  503. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_SET(_var, _val) \
  504. do { \
  505. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MCAST, _val); \
  506. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)); \
  507. } while (0)
  508. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M 0x000003fe
  509. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S 1
  510. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_GET(_var) \
  511. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M) >> \
  512. HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)
  513. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_SET(_var, _val) \
  514. do { \
  515. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED, _val); \
  516. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)); \
  517. } while (0)
  518. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_M 0x00003c00
  519. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_S 10
  520. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_GET(_var) \
  521. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_BW_M) >> \
  522. HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)
  523. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_SET(_var, _val) \
  524. do { \
  525. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_BW, _val); \
  526. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)); \
  527. } while (0)
  528. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M 0x00004000
  529. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S 14
  530. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_GET(_var) \
  531. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M) >> \
  532. HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)
  533. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_SET(_var, _val) \
  534. do { \
  535. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA, _val); \
  536. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)); \
  537. } while (0)
  538. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M 0x0000ffff
  539. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S 0
  540. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_GET(_var) \
  541. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M) >> \
  542. HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)
  543. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_SET(_var, _val) \
  544. do { \
  545. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL, _val); \
  546. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)); \
  547. } while (0)
  548. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M 0xffff0000
  549. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S 16
  550. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_GET(_var) \
  551. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M) >> \
  552. HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)
  553. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_SET(_var, _val) \
  554. do { \
  555. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL, _val); \
  556. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)); \
  557. } while (0)
  558. typedef struct {
  559. htt_tlv_hdr_t tlv_hdr;
  560. /* BIT [ 7 : 0] :- tid_num
  561. * BIT [ 15: 8] :- vap_id
  562. * BIT [ 31: 16] :- sw_peer_id
  563. */
  564. union {
  565. A_UINT32 sw_peer_id__vapid__tid_num;
  566. struct {
  567. A_UINT32 tid_num: 8,
  568. vap_id: 8,
  569. sw_peer_id: 16;
  570. };
  571. };
  572. /* BIT [ 0 : 0] :- mcast
  573. * BIT [ 9 : 1] :- mpdus_tried
  574. * BIT [ 13: 10] :- bw - HTT_PPDU_STATS_BW
  575. * BIT [ 14: 14] : - delayed_ba
  576. * BIT [ 31: 15] :- rsvd
  577. */
  578. union {
  579. A_UINT32 bw__mpdus_tried__mcast;
  580. struct {
  581. A_UINT32 mcast: 1,
  582. mpdus_tried: 9,
  583. bw: 4,
  584. delayed_ba: 1,
  585. reserved0: 17;
  586. };
  587. };
  588. /* BIT [ 15: 0] :- frame_ctrl
  589. * BIT [ 31: 16] :- qos_ctrl
  590. */
  591. union {
  592. A_UINT32 qos_ctrl_frame_ctrl;
  593. struct {
  594. A_UINT32 frame_ctrl: 16,
  595. qos_ctrl: 16;
  596. };
  597. };
  598. } htt_ppdu_stats_user_common_tlv;
  599. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M 0x000000ff
  600. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S 0
  601. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_GET(_var) \
  602. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M) >> \
  603. HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)
  604. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_SET(_var, _val) \
  605. do { \
  606. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM, _val); \
  607. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)); \
  608. } while (0)
  609. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_M 0x0000ff00
  610. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_S 8
  611. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M 0xffff0000
  612. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S 16
  613. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_GET(_var) \
  614. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M) >> \
  615. HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)
  616. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_SET(_var, _val) \
  617. do { \
  618. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID, _val); \
  619. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)); \
  620. } while (0)
  621. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M 0x0000000f
  622. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S 0
  623. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_GET(_var) \
  624. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M) >> \
  625. HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)
  626. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_SET(_var, _val) \
  627. do { \
  628. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_USER_POS, _val); \
  629. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)); \
  630. } while (0)
  631. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M 0x00000ff0
  632. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S 4
  633. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_GET(_var) \
  634. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M) >> \
  635. HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)
  636. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_SET(_var, _val) \
  637. do { \
  638. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID, _val); \
  639. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)); \
  640. } while (0)
  641. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  642. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  643. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  644. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  645. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  646. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  647. do { \
  648. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  649. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  650. } while (0)
  651. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  652. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  653. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  654. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  655. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  656. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  657. do { \
  658. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  659. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  660. } while (0)
  661. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M 0x00000001
  662. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S 0
  663. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_GET(_var) \
  664. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M) >> \
  665. HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)
  666. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_SET(_var, _val) \
  667. do { \
  668. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID, _val); \
  669. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)); \
  670. } while (0)
  671. enum HTT_PPDU_STATS_PPDU_TYPE {
  672. HTT_PPDU_STATS_PPDU_TYPE_SU,
  673. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO,
  674. HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA,
  675. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA,
  676. HTT_PPDU_STATS_PPDU_TYPE_UL_TRIG,
  677. HTT_PPDU_STATS_PPDU_TYPE_BURST_BCN,
  678. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP,
  679. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG,
  680. HTT_PPDU_STATS_PPDU_TYPE_UL_RESP,
  681. HTT_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  682. };
  683. typedef enum HTT_PPDU_STATS_PPDU_TYPE HTT_PPDU_STATS_PPDU_TYPE;
  684. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M 0x0000003E
  685. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S 1
  686. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_GET(_var) \
  687. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M) >> \
  688. HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)
  689. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_SET(_var, _val) \
  690. do { \
  691. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE, _val); \
  692. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)); \
  693. } while (0)
  694. enum HTT_PPDU_STATS_TXBF_TYPE {
  695. HTT_PPDU_STATS_TXBF_OPEN_LOOP,
  696. HTT_PPDU_STATS_TXBF_IMPLICIT,
  697. HTT_PPDU_STATS_TXBF_EXPLICIT,
  698. HTT_PPDU_STATS_TXBF_MAX,
  699. };
  700. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M 0x00000003
  701. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S 0
  702. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_GET(_var) \
  703. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M) >> \
  704. HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)
  705. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_SET(_var, _val) \
  706. do { \
  707. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE, _val); \
  708. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)); \
  709. } while (0)
  710. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_M 0x00000004
  711. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_S 2
  712. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_GET(_var) \
  713. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_STBC_M) >> \
  714. HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)
  715. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_SET(_var, _val) \
  716. do { \
  717. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_STBC, _val); \
  718. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)); \
  719. } while (0)
  720. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M 0x00000008
  721. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S 3
  722. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_GET(_var) \
  723. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M) >> \
  724. HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)
  725. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_SET(_var, _val) \
  726. do { \
  727. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_HE_RE, _val); \
  728. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)); \
  729. } while (0)
  730. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M 0x000000f0
  731. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S 4
  732. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_GET(_var) \
  733. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M) >> \
  734. HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)
  735. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_SET(_var, _val) \
  736. do { \
  737. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TXBF, _val); \
  738. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)); \
  739. } while (0)
  740. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_M 0x00000f00
  741. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_S 8
  742. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(_var) \
  743. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_BW_M) >> \
  744. HTT_PPDU_STATS_USER_RATE_TLV_BW_S)
  745. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_SET(_var, _val) \
  746. do { \
  747. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_BW, _val); \
  748. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_BW_S)); \
  749. } while (0)
  750. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_M 0x0000f000
  751. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_S 12
  752. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(_var) \
  753. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_NSS_M) >> \
  754. HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)
  755. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_SET(_var, _val) \
  756. do { \
  757. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_NSS, _val); \
  758. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)); \
  759. } while (0)
  760. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_M 0x000f0000
  761. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_S 16
  762. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(_var) \
  763. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MCS_M) >> \
  764. HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)
  765. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_SET(_var, _val) \
  766. do { \
  767. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MCS, _val); \
  768. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)); \
  769. } while (0)
  770. /* Refer HTT_STATS_PREAM_TYPE */
  771. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M 0x00f00000
  772. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S 20
  773. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(_var) \
  774. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M) >> \
  775. HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)
  776. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_SET(_var, _val) \
  777. do { \
  778. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE, _val); \
  779. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)); \
  780. } while (0)
  781. /* Guard Intervals */
  782. enum HTT_PPDU_STATS_GI {
  783. HTT_PPDU_STATS_GI_800,
  784. HTT_PPDU_STATS_GI_400,
  785. HTT_PPDU_STATS_GI_1600,
  786. HTT_PPDU_STATS_GI_3200,
  787. HTT_PPDU_STATS_GI_CNT,
  788. };
  789. typedef enum HTT_PPDU_STATS_GI HTT_PPDU_STATS_GI;
  790. /* Refer HTT_PPDU_STATS_GI */
  791. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_M 0x0f000000
  792. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_S 24
  793. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_GET(_var) \
  794. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_GI_M) >> \
  795. HTT_PPDU_STATS_USER_RATE_TLV_GI_S)
  796. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_SET(_var, _val) \
  797. do { \
  798. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_GI, _val); \
  799. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_GI_S)); \
  800. } while (0)
  801. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_M 0x10000000
  802. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_S 28
  803. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_GET(_var) \
  804. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_DCM_M) >> \
  805. HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)
  806. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_SET(_var, _val) \
  807. do { \
  808. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_DCM, _val); \
  809. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)); \
  810. } while (0)
  811. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M 0x20000000
  812. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S 29
  813. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_GET(_var) \
  814. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M) >> \
  815. HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)
  816. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_SET(_var, _val) \
  817. do { \
  818. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LDPC, _val); \
  819. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)); \
  820. } while (0)
  821. enum HTT_PPDU_STATS_RESP_PPDU_TYPE {
  822. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_MIMO_UL,
  823. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_OFDMA_UL,
  824. };
  825. typedef enum HTT_PPDU_STATS_RESP_PPDU_TYPE HTT_PPDU_STATS_RESP_PPDU_TYPE;
  826. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M 0xC0000000
  827. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S 30
  828. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_GET(_var) \
  829. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M) >> \
  830. HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)
  831. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_SET(_var, _val) \
  832. do { \
  833. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE, _val); \
  834. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)); \
  835. } while (0)
  836. typedef struct {
  837. htt_tlv_hdr_t tlv_hdr;
  838. /* BIT [ 7 : 0] :- tid_num
  839. * BIT [ 15: 8] :- reserved0
  840. * BIT [ 31: 16] :- sw_peer_id
  841. */
  842. union {
  843. A_UINT32 sw_peer_id__tid_num;
  844. struct {
  845. A_UINT32 tid_num: 8,
  846. reserved0: 8,
  847. sw_peer_id: 16;
  848. };
  849. };
  850. /* BIT [ 3 : 0] :- user_pos
  851. * BIT [ 11: 4] :- mu_group_id
  852. * BIT [ 31: 12] :- reserved1
  853. */
  854. union {
  855. A_UINT32 mu_group_id__user_pos;
  856. struct {
  857. A_UINT32 user_pos: 4,
  858. mu_group_id: 8,
  859. reserved1: 20;
  860. };
  861. };
  862. /* BIT [ 15 : 0] :- ru_end
  863. * BIT [ 31 : 16] :- ru_start
  864. */
  865. union {
  866. A_UINT32 ru_start__ru_end;
  867. struct {
  868. A_UINT32 ru_end: 16,
  869. ru_start: 16;
  870. };
  871. };
  872. /* BIT [ 15 : 0] :- ru_end
  873. * BIT [ 31 : 16] :- ru_start
  874. */
  875. union {
  876. A_UINT32 resp_ru_start__ru_end;
  877. struct {
  878. A_UINT32 resp_ru_end: 16,
  879. resp_ru_start: 16;
  880. };
  881. };
  882. /* BIT [ 0 : 0 ] :- resp_type_valid
  883. * BIT [ 5 : 1 ] :- ppdu_type - HTT_PPDU_STAT_PPDU_TYPE
  884. * BIT [ 31: 6 ] :- reserved2
  885. */
  886. union {
  887. A_UINT32 resp_type_vld_ppdu_type;
  888. struct {
  889. A_UINT32 resp_type_vld: 1,
  890. ppdu_type: 5,
  891. reserved2: 26;
  892. };
  893. };
  894. /* BIT [ 1 : 0 ] :- ltf_size
  895. * BIT [ 2 : 2 ] :- stbc
  896. * BIT [ 3 : 3 ] :- he_re (range extension)
  897. * BIT [ 7 : 4 ] :- txbf
  898. * BIT [ 11: 8 ] :- bw
  899. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  900. * BIT [ 19: 16] :- mcs
  901. * BIT [ 23: 20] :- preamble
  902. * BIT [ 27: 24] :- gi - HTT_PPDU_STATS_GI
  903. * BIT [ 28: 28] :- dcm
  904. * BIT [ 29: 29] :- ldpc
  905. * BIT [ 31: 30] :- reserved4
  906. */
  907. union {
  908. A_UINT32 rate_info;
  909. struct {
  910. A_UINT32 ltf_size: 2,
  911. stbc: 1,
  912. he_re: 1,
  913. txbf: 4,
  914. bw: 4,
  915. nss: 4,
  916. mcs: 4,
  917. preamble: 4,
  918. gi: 4,
  919. dcm: 1,
  920. ldpc: 1,
  921. reserved4: 2;
  922. };
  923. };
  924. /* Note: resp_rate_info is only valid for if resp_type is UL
  925. * BIT [ 1 : 0 ] :- ltf_size
  926. * BIT [ 2 : 2 ] :- stbc
  927. * BIT [ 3 : 3 ] :- he_re (range extension)
  928. * BIT [ 7 : 4 ] :- reserved3
  929. * BIT [ 11: 8 ] :- bw
  930. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  931. * BIT [ 19: 16] :- mcs
  932. * BIT [ 23: 20] :- preamble
  933. * BIT [ 27: 24] :- gi
  934. * BIT [ 28: 28] :- dcm
  935. * BIT [ 29: 29] :- ldpc
  936. * BIT [ 31: 30] :- resp_ppdu_type - HTT_PPDU_STATS_RESP_PPDU_TYPE
  937. */
  938. union {
  939. A_UINT32 resp_rate_info;
  940. struct {
  941. A_UINT32 resp_ltf_size: 2,
  942. resp_stbc: 1,
  943. resp_he_re: 1,
  944. reserved3: 4,
  945. resp_bw: 4,
  946. resp_nss: 4,
  947. resp_mcs: 4,
  948. resp_preamble: 4,
  949. resp_gi: 4,
  950. resp_dcm: 1,
  951. resp_ldpc: 1,
  952. resp_ppdu_type: 2;
  953. };
  954. };
  955. } htt_ppdu_stats_user_rate_tlv;
  956. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_M 0x000000ff
  957. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S 0
  958. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_GET(_var) \
  959. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  960. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)
  961. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  962. do { \
  963. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM, _val); \
  964. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)); \
  965. } while (0)
  966. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_M 0x0000ff00
  967. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_S 8
  968. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  969. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S 16
  970. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  971. (((_var) & HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M) >> \
  972. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)
  973. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  974. do { \
  975. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID, _val); \
  976. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)); \
  977. } while (0)
  978. typedef struct {
  979. htt_tlv_hdr_t tlv_hdr;
  980. /* BIT [ 7 : 0] :- tid_num
  981. * BIT [ 15: 8] :- reserved0
  982. * BIT [ 31: 16] :- sw_peer_id
  983. */
  984. union {
  985. A_UINT32 sw_peer_id__tid_num;
  986. struct {
  987. A_UINT32 tid_num: 8,
  988. reserved0: 8,
  989. sw_peer_id: 16;
  990. };
  991. };
  992. A_UINT32 start_seq;
  993. A_UINT32 enq_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  994. } htt_ppdu_stats_enq_mpdu_bitmap_64_tlv;
  995. typedef struct {
  996. htt_tlv_hdr_t tlv_hdr;
  997. /* BIT [ 7 : 0] :- tid_num
  998. * BIT [ 15: 8] :- reserved0
  999. * BIT [ 31: 16] :- sw_peer_id
  1000. */
  1001. union {
  1002. A_UINT32 sw_peer_id__tid_num;
  1003. struct {
  1004. A_UINT32 tid_num: 8,
  1005. reserved0: 8,
  1006. sw_peer_id: 16;
  1007. };
  1008. };
  1009. A_UINT32 start_seq;
  1010. A_UINT32 enq_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  1011. } htt_ppdu_stats_enq_mpdu_bitmap_256_tlv;
  1012. /* COMPLETION_STATUS defined in HTT_PPDU_STATS_USER_COMPLETION_STATUS */
  1013. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M 0x000000ff
  1014. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S 0
  1015. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_GET(_var) \
  1016. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M) >> \
  1017. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)
  1018. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_SET(_var, _val) \
  1019. do { \
  1020. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS, _val); \
  1021. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)); \
  1022. } while (0)
  1023. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M 0x0000ff00
  1024. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S 8
  1025. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_GET(_var) \
  1026. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M) >> \
  1027. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)
  1028. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM, _val); \
  1031. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)); \
  1032. } while (0)
  1033. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  1034. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S 16
  1035. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_GET(_var) \
  1036. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M) >> \
  1037. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)
  1038. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  1039. do { \
  1040. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID, _val); \
  1041. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)); \
  1042. } while (0)
  1043. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M 0x0000ffff
  1044. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S 0
  1045. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_GET(_var) \
  1046. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M) >> \
  1047. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)
  1048. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_SET(_var, _val) \
  1049. do { \
  1050. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED, _val); \
  1051. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)); \
  1052. } while (0)
  1053. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M 0xffff0000
  1054. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S 16
  1055. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_GET(_var) \
  1056. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M) >> \
  1057. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)
  1058. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_SET(_var, _val) \
  1059. do { \
  1060. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS, _val); \
  1061. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)); \
  1062. } while (0)
  1063. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M 0x0000000f
  1064. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S 0
  1065. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_GET(_var) \
  1066. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M) >> \
  1067. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)
  1068. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_SET(_var, _val) \
  1069. do { \
  1070. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY, _val); \
  1071. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)); \
  1072. } while (0)
  1073. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M 0x000000f0
  1074. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S 4
  1075. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_GET(_var) \
  1076. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M) >> \
  1077. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)
  1078. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_SET(_var, _val) \
  1079. do { \
  1080. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY, _val); \
  1081. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)); \
  1082. } while (0)
  1083. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M 0x00000100
  1084. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S 8
  1085. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_GET(_var) \
  1086. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M) >> \
  1087. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)
  1088. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_SET(_var, _val) \
  1089. do { \
  1090. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU, _val); \
  1091. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)); \
  1092. } while (0)
  1093. enum HTT_PPDU_STATS_RESP_TYPE {
  1094. HTT_PPDU_STATS_NO_RESPONSE_EXPECTED_E = 0,
  1095. HTT_PPDU_STATS_ACK_EXPECTED_E = 1,
  1096. HTT_PPDU_STATS_BA_BITMAP_EXPECTED_E = 2,
  1097. HTT_PPDU_STATS_UL_MU_BA_EXPECTED_E = 3,
  1098. HTT_PPDU_STATS_UL_MU_BA_AND_DATA_EXPECTED_E = 4,
  1099. HTT_PPDU_STATS_CTS_EXPECTED_E = 5,
  1100. HTT_PPDU_STATS_MU_CBF_EXPECTED_E = 6,
  1101. };
  1102. typedef enum HTT_PPDU_STATS_RESP_TYPE HTT_PPDU_STATS_RESP_TYPE;
  1103. /* Refer HTT_PPDU_STATS_RESP_TYPE */
  1104. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M 0x00001e00
  1105. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S 9
  1106. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_GET(_var) \
  1107. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M) >> \
  1108. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)
  1109. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_SET(_var, _val) \
  1110. do { \
  1111. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE, _val); \
  1112. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)); \
  1113. } while (0)
  1114. enum HTT_PPDU_STATS_USER_COMPLETION_STATUS {
  1115. HTT_PPDU_STATS_USER_STATUS_OK,
  1116. HTT_PPDU_STATS_USER_STATUS_FILTERED,
  1117. HTT_PPDU_STATS_USER_STATUS_RESP_TIMEOUT,
  1118. HTT_PPDU_STATS_USER_STATUS_RESP_MISMATCH,
  1119. HTT_PPDU_STATS_USER_STATUS_ABORT,
  1120. };
  1121. typedef enum HTT_PPDU_STATS_USER_COMPLETION_STATUS HTT_PPDU_STATS_USER_COMPLETION_STATUS;
  1122. typedef struct {
  1123. htt_tlv_hdr_t tlv_hdr;
  1124. /* BIT [ 7 : 0] :- completion_status
  1125. * BIT [ 15: 8] :- tid_num
  1126. * BIT [ 31: 16] :- sw_peer_id
  1127. */
  1128. union {
  1129. A_UINT32 sw_peer_id__tid_num__completion_status;
  1130. struct {
  1131. A_UINT32 completion_status: 8,
  1132. tid_num: 8,
  1133. sw_peer_id: 16;
  1134. };
  1135. };
  1136. /* RSSI value of last ack packet (units = dB above noise floor) */
  1137. A_UINT32 ack_rssi;
  1138. /* BIT [ 15 : 0] :- mpdu_tried
  1139. * BIT [ 31 : 16] :- mpdu_success
  1140. */
  1141. union {
  1142. A_UINT32 mpdu_tried__mpdu_success;
  1143. struct {
  1144. A_UINT32 mpdu_tried: 16,
  1145. mpdu_success: 16;
  1146. };
  1147. };
  1148. /* BIT [ 3 : 0] :- long_retries
  1149. * BIT [ 7 : 4] :- short_retries
  1150. * BIT [ 8 : 8] :- is_ampdu
  1151. * BIT [ 12: 9] :- resp_type
  1152. * BIT [ 31: 13] :- reserved0
  1153. */
  1154. union {
  1155. A_UINT32 resp_type_is_ampdu__short_retry__long_retry;
  1156. struct {
  1157. A_UINT32 long_retries: 4,
  1158. short_retries: 4,
  1159. is_ampdu: 1,
  1160. resp_type: 4,
  1161. reserved0: 19;
  1162. };
  1163. };
  1164. } htt_ppdu_stats_user_cmpltn_common_tlv;
  1165. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_M 0x000000ff
  1166. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S 0
  1167. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_GET(_var) \
  1168. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  1169. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)
  1170. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  1171. do { \
  1172. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM, _val); \
  1173. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)); \
  1174. } while (0)
  1175. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_M 0x0000ff00
  1176. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_S 8
  1177. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  1178. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S 16
  1179. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  1180. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M) >> \
  1181. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)
  1182. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  1183. do { \
  1184. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID, _val); \
  1185. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)); \
  1186. } while (0)
  1187. typedef struct {
  1188. htt_tlv_hdr_t tlv_hdr;
  1189. /* BIT [ 7 : 0] :- tid_num
  1190. * BIT [ 15: 8] :- reserved0
  1191. * BIT [ 31: 16] :- sw_peer_id
  1192. */
  1193. union {
  1194. A_UINT32 sw_peer_id__tid_num;
  1195. struct {
  1196. A_UINT32 tid_num: 8,
  1197. reserved0: 8,
  1198. sw_peer_id: 16;
  1199. };
  1200. };
  1201. A_UINT32 ba_seq_no;
  1202. A_UINT32 ba_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  1203. } htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv;
  1204. typedef struct {
  1205. htt_tlv_hdr_t tlv_hdr;
  1206. /* BIT [ 7 : 0] :- tid_num
  1207. * BIT [ 15: 8] :- reserved0
  1208. * BIT [ 31: 16] :- sw_peer_id
  1209. */
  1210. union {
  1211. A_UINT32 sw_peer_id__tid_num;
  1212. struct {
  1213. A_UINT32 tid_num: 8,
  1214. reserved0: 8,
  1215. sw_peer_id: 16;
  1216. };
  1217. };
  1218. A_UINT32 ba_seq_no;
  1219. A_UINT32 ba_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  1220. } htt_ppdu_stats_user_compltn_ba_bitmap_256_tlv;
  1221. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M 0x0000ffff
  1222. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S 0
  1223. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_GET(_var) \
  1224. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M) >> \
  1225. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)
  1226. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_SET(_var, _val) \
  1227. do { \
  1228. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID, _val); \
  1229. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)); \
  1230. } while (0)
  1231. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M 0x000001ff
  1232. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S 0
  1233. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_GET(_var) \
  1234. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M) >> \
  1235. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)
  1236. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU, _val); \
  1239. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)); \
  1240. } while (0)
  1241. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M 0x01fffe00
  1242. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S 9
  1243. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_GET(_var) \
  1244. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M) >> \
  1245. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)
  1246. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU, _val); \
  1249. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)); \
  1250. } while (0)
  1251. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M 0xfe000000
  1252. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S 25
  1253. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_GET(_var) \
  1254. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M) >> \
  1255. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)
  1256. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_SET(_var, _val) \
  1257. do { \
  1258. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM, _val); \
  1259. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)); \
  1260. } while (0)
  1261. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M 0x0000ffff
  1262. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S 0
  1263. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_GET(_var) \
  1264. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M) >> \
  1265. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)
  1266. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ, _val); \
  1269. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)); \
  1270. } while (0)
  1271. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M 0xffff0000
  1272. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S 16
  1273. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_GET(_var) \
  1274. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M) >> \
  1275. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)
  1276. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ, _val); \
  1279. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)); \
  1280. } while (0)
  1281. typedef struct {
  1282. htt_tlv_hdr_t tlv_hdr;
  1283. A_UINT32 ppdu_id;
  1284. /* BIT [ 15 : 0] :- sw_peer_id
  1285. * BIT [ 31 : 16] :- reserved0
  1286. */
  1287. union {
  1288. A_UINT32 rsvd_sw_peer_id;
  1289. struct {
  1290. A_UINT32 sw_peer_id: 16,
  1291. reserved0: 16;
  1292. };
  1293. };
  1294. /* BIT [ 8 : 0] :- num_mpdu
  1295. * BIT [ 24 : 9] :- num_msdu
  1296. * BIT [ 31 : 25] :- tid_num
  1297. */
  1298. union {
  1299. A_UINT32 tid_num__num_msdu__num_mpdu;
  1300. struct {
  1301. A_UINT32 num_mpdu: 9,
  1302. num_msdu: 16,
  1303. tid_num: 7;
  1304. };
  1305. };
  1306. /* BIT [ 15 : 0] :- current_seq
  1307. * BIT [ 31 : 16] :- start_seq
  1308. */
  1309. union {
  1310. A_UINT32 start_seq__current_seq;
  1311. struct {
  1312. A_UINT32 current_seq: 16,
  1313. start_seq: 16;
  1314. };
  1315. };
  1316. A_UINT32 success_bytes;
  1317. } htt_ppdu_stats_user_compltn_ack_ba_status_tlv;
  1318. /* FLOW_TYPE defined in HTT_TX_FLOW_TYPE */
  1319. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M 0x000000ff
  1320. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S 0
  1321. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_GET(_var) \
  1322. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M) >> \
  1323. HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)
  1324. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE, _val); \
  1327. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)); \
  1328. } while (0)
  1329. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M 0x0001ff00
  1330. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S 8
  1331. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_GET(_var) \
  1332. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M) >> \
  1333. HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)
  1334. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU, _val); \
  1337. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)); \
  1338. } while (0)
  1339. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M 0x7ffe0000
  1340. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S 17
  1341. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_GET(_var) \
  1342. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M) >> \
  1343. HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)
  1344. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU, _val); \
  1347. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)); \
  1348. } while (0)
  1349. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M 0x000000ff
  1350. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S 0
  1351. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_GET(_var) \
  1352. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M) >> \
  1353. HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)
  1354. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_SET(_var, _val) \
  1355. do { \
  1356. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_TID_NUM, _val); \
  1357. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)); \
  1358. } while (0)
  1359. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M 0x0000ff00
  1360. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S 8
  1361. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_GET(_var) \
  1362. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M) >> \
  1363. HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)
  1364. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_SET(_var, _val) \
  1365. do { \
  1366. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE, _val); \
  1367. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)); \
  1368. } while (0)
  1369. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M 0xffff0000
  1370. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S 16
  1371. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_GET(_var) \
  1372. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M) >> \
  1373. HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)
  1374. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_SET(_var, _val) \
  1375. do { \
  1376. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID, _val); \
  1377. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)); \
  1378. } while (0)
  1379. enum HTT_TX_FLOW_TYPE {
  1380. HTT_TX_TID_FRAMEQ,
  1381. HTT_TX_TQM_MSDUQ,
  1382. HTT_TQM_MPDUQ,
  1383. };
  1384. enum HTT_FLUSH_STATUS_DROP_REASON {
  1385. HTT_FLUSH_PEER_DELETE,
  1386. HTT_FLUSH_TID_DELETE,
  1387. HTT_FLUSH_TTL_EXCEEDED,
  1388. HTT_FLUSH_EXCESS_RETRIES,
  1389. HTT_FLUSH_REINJECT,
  1390. };
  1391. typedef struct {
  1392. htt_tlv_hdr_t tlv_hdr;
  1393. A_UINT32 drop_reason;
  1394. /* BIT [ 7 : 0] :- flow_type
  1395. * BIT [ 16: 8] :- num_mpdu
  1396. * BIT [ 30: 17] :- num_msdu
  1397. * BIT [ 31: 31] :- reserved0
  1398. */
  1399. union {
  1400. A_UINT32 num_msdu__num_mpdu__flow_type;
  1401. struct {
  1402. A_UINT32 flow_type: 8,
  1403. num_mpdu: 9,
  1404. num_msdu: 14,
  1405. reserved0: 1;
  1406. };
  1407. };
  1408. /* BIT [ 7 : 0] :- tid_num
  1409. * BIT [ 15 : 8] :- queue_type
  1410. * BIT [ 31 : 16] :- sw_peer_id
  1411. */
  1412. union {
  1413. A_UINT32 sw_peer_id__queue_type__tid_num;
  1414. struct {
  1415. A_UINT32 tid_num: 8,
  1416. queue_type: 8,
  1417. sw_peer_id: 16;
  1418. };
  1419. };
  1420. } htt_ppdu_stats_flush_tlv;
  1421. typedef struct {
  1422. htt_tlv_hdr_t tlv_hdr;
  1423. /* Future purpose */
  1424. A_UINT32 reserved1; /* set to 0x0 */
  1425. A_UINT32 reserved2; /* set to 0x0 */
  1426. A_UINT32 reserved3; /* set to 0x0 */
  1427. /* mgmt/ctrl frame payload
  1428. * The size of payload (in bytes) can be derived from the length in
  1429. * tlv parametes, minus the 12 bytes of the above fields.
  1430. */
  1431. A_UINT32 payload[1];
  1432. } htt_ppdu_stats_tx_mgmtctrl_payload_tlv;
  1433. #endif //__HTT_PPDU_STATS_H__