htt_ppdu_stats.h 81 KB

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