htt_ppdu_stats.h 91 KB

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