htt_ppdu_stats.h 59 KB

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