htt_ppdu_stats.h 92 KB

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