htt_ppdu_stats.h 122 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * @file htt_ppdu_stats.h
  21. *
  22. * @details the public header file of HTT STATS
  23. */
  24. #ifndef __HTT_PPDU_STATS_H__
  25. #define __HTT_PPDU_STATS_H__
  26. #include <htt.h>
  27. #include <htt_stats.h>
  28. #include <htt_common.h> /* HTT_STATS_MAX_CHAINS */
  29. #define HTT_STATS_NUM_SUPPORTED_BW_SMART_ANTENNA 4 /* 20, 40, 80, 160 MHz */
  30. #define HTT_BA_64_BIT_MAP_SIZE_DWORDS 2
  31. #define HTT_BA_256_BIT_MAP_SIZE_DWORDS 8
  32. #define HTT_BA_1024_BIT_MAP_SIZE_DWORDS 32
  33. enum htt_ppdu_stats_tlv_tag {
  34. HTT_PPDU_STATS_COMMON_TLV, /* htt_ppdu_stats_common_tlv */
  35. HTT_PPDU_STATS_USR_COMMON_TLV, /* htt_ppdu_stats_user_common_tlv */
  36. HTT_PPDU_STATS_USR_RATE_TLV, /* htt_ppdu_stats_user_rate_tlv */
  37. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_64_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_64_tlv */
  38. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_256_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_256_tlv */
  39. HTT_PPDU_STATS_SCH_CMD_STATUS_TLV, /* htt_ppdu_stats_sch_cmd_tlv_v */
  40. HTT_PPDU_STATS_USR_COMPLTN_COMMON_TLV, /* htt_ppdu_stats_user_compltn_common_tlv */
  41. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_64_TLV, /* htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv */
  42. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_256_TLV, /* htt_ppdu_stats_user_cmpltn_ba_bitmap_256_tlv */
  43. HTT_PPDU_STATS_USR_COMPLTN_ACK_BA_STATUS_TLV, /* htt_ppdu_stats_user_cmpltn_ack_ba_status_tlv */
  44. HTT_PPDU_STATS_USR_COMPLTN_FLUSH_TLV, /* htt_ppdu_stats_flush_tlv */
  45. HTT_PPDU_STATS_USR_COMMON_ARRAY_TLV, /* htt_ppdu_stats_usr_common_array_tlv_v */
  46. HTT_PPDU_STATS_INFO_TLV, /* htt_ppdu_stats_info */
  47. HTT_PPDU_STATS_TX_MGMTCTRL_PAYLOAD_TLV, /* htt_ppdu_stats_tx_mgmtctrl_payload_tlv */
  48. HTT_PPDU_STATS_USERS_INFO_TLV, /* htt_ppdu_stats_users_info_tlv */
  49. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_1024_TLV, /* htt_ppdu_stats_enq_mpdu_bitmap_1024_tlv */
  50. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_1024_TLV,/* htt_ppdu_stats_user_compltn_ba_bitmap_1024_tlv */
  51. HTT_PPDU_STATS_RX_MGMTCTRL_PAYLOAD_TLV, /* htt_ppdu_stats_rx_mgmtctrl_payload_tlv */
  52. HTT_PPDU_STATS_FOR_SMU_TLV, /* htt_ppdu_stats_for_smu_tlv */
  53. HTT_PPDU_STATS_MLO_TX_RESP_TLV, /* htt_ppdu_stats_mlo_tx_resp_tlv */
  54. HTT_PPDU_STATS_MLO_TX_NOTIFICATION_TLV, /* htt_ppdu_stats_mlo_tx_notification_tlv */
  55. /* New TLV's are added above to this line */
  56. HTT_PPDU_STATS_MAX_TAG,
  57. };
  58. typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t;
  59. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M 0x000000ff
  60. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S 0
  61. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_GET(_var) \
  62. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M) >> \
  63. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)
  64. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_SET(_var, _val) \
  65. do { \
  66. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE, _val); \
  67. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)); \
  68. } while (0)
  69. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M 0x00000100
  70. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S 8
  71. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_GET(_var) \
  72. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M) >> \
  73. HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)
  74. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_SET(_var, _val) \
  75. do { \
  76. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU, _val); \
  77. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)); \
  78. } while (0)
  79. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M 0x00000600
  80. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S 9
  81. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_GET(_var) \
  82. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M) >> \
  83. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)
  84. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_SET(_var, _val) \
  85. do { \
  86. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED, _val); \
  87. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)); \
  88. } while (0)
  89. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M 0x00003800
  90. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S 11
  91. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_GET(_var) \
  92. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M) >> \
  93. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)
  94. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_SET(_var, _val) \
  95. do { \
  96. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW, _val); \
  97. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)); \
  98. } while (0)
  99. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M 0x00004000
  100. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S 14
  101. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_GET(_var) \
  102. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M) >> \
  103. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)
  104. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_SET(_var, _val) \
  105. do { \
  106. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI, _val); \
  107. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \
  108. } while (0)
  109. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000
  110. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15
  111. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \
  112. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \
  113. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)
  114. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \
  115. do { \
  116. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \
  117. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \
  118. } while (0)
  119. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000
  120. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16
  121. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_GET(_var) \
  122. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M) >> \
  123. HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)
  124. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_SET(_var, _val) \
  125. do { \
  126. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID, _val); \
  127. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)); \
  128. } while (0)
  129. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M 0x0000ffff
  130. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S 0
  131. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_GET(_var) \
  132. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M) >> \
  133. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)
  134. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_SET(_var, _val) \
  135. do { \
  136. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS, _val); \
  137. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)); \
  138. } while (0)
  139. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M 0xffff0000
  140. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S 16
  141. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_GET(_var) \
  142. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M) >> \
  143. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)
  144. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_SET(_var, _val) \
  145. do { \
  146. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS, _val); \
  147. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)); \
  148. } while (0)
  149. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M 0x0000ffff
  150. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S 0
  151. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_GET(_var) \
  152. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M) >> \
  153. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)
  154. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_SET(_var, _val) \
  155. do { \
  156. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS, _val); \
  157. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)); \
  158. } while (0)
  159. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M 0xffff0000
  160. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S 16
  161. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_GET(_var) \
  162. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M) >> \
  163. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)
  164. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_SET(_var, _val) \
  165. do { \
  166. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR, _val); \
  167. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)); \
  168. } while (0)
  169. PREPACK struct htt_tx_ppdu_stats_info {
  170. htt_tlv_hdr_t tlv_hdr;
  171. A_UINT32 tx_success_bytes;
  172. A_UINT32 tx_retry_bytes;
  173. A_UINT32 tx_failed_bytes;
  174. A_UINT32 tx_ratecode: 8,
  175. is_ampdu: 1,
  176. ba_ack_failed: 2,
  177. /* bw
  178. * 0: 20 MHz
  179. * 1: 40 MHz
  180. * 2: 80 MHz
  181. * 3: 160 MHz or 80+80 MHz
  182. * 4: 320 MHz
  183. */
  184. bw: 3,
  185. sgi: 1,
  186. skipped_rate_ctrl: 1,
  187. peer_id: 16;
  188. A_UINT32 tx_success_msdus: 16,
  189. tx_retry_msdus: 16;
  190. A_UINT32 tx_failed_msdus: 16,
  191. /* united in us */
  192. tx_duration: 16;
  193. /*
  194. * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid.
  195. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits
  196. * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid.
  197. * If bit 1 is set, tx_success_bytes is valid
  198. * If bit 2 is set, tx_retry_bytes is valid
  199. * ...
  200. * If bit 14 is set, tx_duration is valid
  201. * If bit 15 is set, all of ack_rssi_chain are valid,
  202. * for each validation of chain, need to check value in field
  203. * If bit 16 is set, tx_timestamp is valid
  204. * If bit 16 is set, sa_ant_matrix is valid
  205. * If bit 17 is set, tid is valid
  206. */
  207. A_UINT32 valid_bitmap;
  208. A_UINT32 ext_valid_bitmap; /* reserved for future extension valid bitmap */
  209. /* ack rssi for each chain */
  210. 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.*/
  211. ack_rssi_chain1: 8, /* same as above */
  212. ack_rssi_chain2: 8, /* same as above */
  213. ack_rssi_chain3: 8; /* same as above */
  214. A_UINT32 ack_rssi_chain4: 8, /* same as above */
  215. ack_rssi_chain5: 8, /* same as above */
  216. ack_rssi_chain6: 8, /* same as above */
  217. ack_rssi_chain7: 8; /* same as above */
  218. A_UINT32 tx_timestamp; /* HW assigned timestamp with microsecond unit */
  219. A_UINT32 sa_ant_matrix: 8, /* This sa_ant_matrix provides a bitmask of the antennas used while frame transmit */
  220. tid: 8,
  221. reserved_1: 16;
  222. } POSTPACK;
  223. typedef struct {
  224. htt_tlv_hdr_t tlv_hdr;
  225. A_UINT32 number_of_ppdu_stats;
  226. /*
  227. * tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
  228. * elements.
  229. * tx_ppdu_stats_info is variable length, with length =
  230. * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
  231. */
  232. struct htt_tx_ppdu_stats_info tx_ppdu_stats_info[1/*number_of_ppdu_stats*/];
  233. } htt_ppdu_stats_usr_common_array_tlv_v;
  234. typedef struct {
  235. htt_tlv_hdr_t tlv_hdr;
  236. union {
  237. /* DEPRECATED (target_type)
  238. * The target_type field is not actually present in the HTT messages
  239. * produced by the FW. However, it cannot be removed (yet), due to
  240. * FW code that refers to this field.
  241. * As a workaround, this target_type field is being moved into a
  242. * union with the "hw" field that actually is present in the message.
  243. * This makes the message definitions become consistent with the
  244. * actual message contents, while not breaking the compilation of
  245. * code that refers to the target_type field.
  246. * Overlaying the memory for "target_type" and "hw" does not cause
  247. * problems, because the FW code that refers to target_type first
  248. * writes a value into the target_type field, then writes data into
  249. * the hw field.
  250. * Once all FW references to the target_type field have been removed,
  251. * the target_type field def and the encapsulating anonymous union
  252. * will be removed from this htt_ppdu_stats_sch_cmd_tlv_v struct def.
  253. */
  254. A_UINT32 target_type;
  255. /*
  256. * The hw portion of this struct contains a scheduler_command_status
  257. * struct, whose definition is different for different target HW types.
  258. */
  259. A_UINT32 hw[1];
  260. };
  261. } htt_ppdu_stats_sch_cmd_tlv_v;
  262. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff
  263. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S 0
  264. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_GET(_var) \
  265. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M) >> \
  266. HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)
  267. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_SET(_var, _val) \
  268. do { \
  269. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID, _val); \
  270. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)); \
  271. } while (0)
  272. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_M 0x00ff0000
  273. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_S 16
  274. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_GET(_var) \
  275. (((_var) & HTT_PPDU_STATS_COMMON_TLV_RING_ID_M) >> \
  276. HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)
  277. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_SET(_var, _val) \
  278. do { \
  279. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_RING_ID, _val); \
  280. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)); \
  281. } while (0)
  282. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M 0xff000000
  283. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S 24
  284. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_GET(_var) \
  285. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M) >> \
  286. HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)
  287. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_SET(_var, _val) \
  288. do { \
  289. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_USERS, _val); \
  290. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)); \
  291. } while (0)
  292. /* HW queue type */
  293. enum HTT_TX_QUEUE_TYPE {
  294. HTT_TX_QUEUE_INACTIVE,
  295. HTT_TX_QUEUE_DATA,
  296. HTT_TX_QUEUE_BEACON,
  297. HTT_TX_QUEUE_PSPOLL,
  298. HTT_TX_QUEUE_CAB,
  299. HTT_TX_QUEUE_HALPHY,
  300. HTT_TX_QUEUE_QBOOST_RESP,
  301. HTT_TX_QUEUE_NAN_BEACON,
  302. HTT_TX_QUEUE_NAN_MGMT,
  303. HTT_TX_QUEUE_UL_DATA,
  304. HTT_TX_QUEUE_UL_BSR_RESP,
  305. HTT_TX_QUEUE_MGMT,
  306. HTT_TX_QUEUE_MAX,
  307. };
  308. typedef enum HTT_TX_QUEUE_TYPE HTT_TX_QUEUE_TYPE;
  309. /* frame_type */
  310. enum HTT_STATS_FTYPE {
  311. HTT_STATS_FTYPE_SGEN_NDPA = 0,
  312. HTT_STATS_FTYPE_SGEN_NDP,
  313. HTT_STATS_FTYPE_SGEN_BRP,
  314. HTT_STATS_FTYPE_SGEN_BAR,
  315. HTT_STATS_FTYPE_SGEN_RTS,
  316. HTT_STATS_FTYPE_SGEN_CTS,
  317. HTT_STATS_FTYPE_SGEN_CFEND,
  318. HTT_STATS_FTYPE_SGEN_AX_NDPA,
  319. HTT_STATS_FTYPE_SGEN_AX_NDP,
  320. HTT_STATS_FTYPE_SGEN_MU_TRIG,
  321. HTT_STATS_FTYPE_SGEN_MU_BAR,
  322. HTT_STATS_FTYPE_SGEN_MU_BRP,
  323. HTT_STATS_FTYPE_SGEN_MU_RTS,
  324. HTT_STATS_FTYPE_SGEN_MU_BSR,
  325. HTT_STATS_FTYPE_SGEN_UL_BSR,
  326. HTT_STATS_FTYPE_SGEN_UL_BSR_TRIGGER = HTT_STATS_FTYPE_SGEN_UL_BSR, /*alias*/
  327. HTT_STATS_FTYPE_TIDQ_DATA_SU,
  328. HTT_STATS_FTYPE_TIDQ_DATA_MU,
  329. HTT_STATS_FTYPE_SGEN_UL_BSR_RESP,
  330. HTT_STATS_FTYPE_SGEN_QOS_NULL,
  331. HTT_STATS_FTYPE_SGEN_BE_NDPA,
  332. HTT_STATS_FTYPE_SGEN_BE_NDP,
  333. HTT_STATS_FTYPE_SGEN_BE_MU_TRIG,
  334. HTT_STATS_FTYPE_SGEN_BE_MU_BAR,
  335. HTT_STATS_FTYPE_SGEN_BE_MU_BRP,
  336. HTT_STATS_FTYPE_SGEN_BE_MU_RTS,
  337. HTT_STATS_FTYPE_SGEN_BE_MU_BSRP,
  338. HTT_STATS_FTYPE_MAX,
  339. };
  340. typedef enum HTT_STATS_FTYPE HTT_STATS_FTYPE;
  341. /* FRM_TYPE defined in HTT_STATS_FTYPE */
  342. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M 0x000000ff
  343. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S 0
  344. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(_var) \
  345. (((_var) & HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M) >> \
  346. HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)
  347. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_SET(_var, _val) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE, _val); \
  350. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)); \
  351. } while (0)
  352. /* QTYPE defined in HTT_TX_QUEUE_TYPE */
  353. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_M 0x0000ff00
  354. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_S 8
  355. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_GET(_var) \
  356. (((_var) & HTT_PPDU_STATS_COMMON_TLV_QTYPE_M) >> \
  357. HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)
  358. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_SET(_var, _val) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_QTYPE, _val); \
  361. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)); \
  362. } while (0)
  363. enum HTT_PPDU_STATS_BW {
  364. HTT_PPDU_STATS_BANDWIDTH_5MHZ = 0,
  365. HTT_PPDU_STATS_BANDWIDTH_10MHZ = 1,
  366. HTT_PPDU_STATS_BANDWIDTH_20MHZ = 2,
  367. HTT_PPDU_STATS_BANDWIDTH_40MHZ = 3,
  368. HTT_PPDU_STATS_BANDWIDTH_80MHZ = 4,
  369. HTT_PPDU_STATS_BANDWIDTH_160MHZ = 5, /* includes 80+80 */
  370. HTT_PPDU_STATS_BANDWIDTH_DYN = 6,
  371. HTT_PPDU_STATS_BANDWIDTH_DYN_PATTERNS = 7,
  372. HTT_PPDU_STATS_BANDWIDTH_320MHZ = 8,
  373. };
  374. typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW;
  375. #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000
  376. #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16
  377. #define HTT_PPDU_STATS_COMMON_TLV_BW_GET(_var) \
  378. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BW_M) >> \
  379. HTT_PPDU_STATS_COMMON_TLV_BW_S)
  380. #define HTT_PPDU_STATS_COMMON_TLV_BW_SET(_var, _val) \
  381. do { \
  382. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BW, _val); \
  383. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  384. } while (0)
  385. enum HTT_PPDU_STATS_SEQ_TYPE {
  386. HTT_SEQTYPE_UNSPECIFIED = 0,
  387. HTT_SEQTYPE_SU = 1,
  388. HTT_SEQTYPE_AC_MU_MIMO = 2,
  389. HTT_SEQTYPE_AX_MU_MIMO = 3,
  390. HTT_SEQTYPE_MU_OFDMA = 4,
  391. HTT_SEQTYPE_UL_MU_OFDMA_TRIG = 5, /* new name - use this */
  392. HTT_SEQTYPE_UL_TRIG = 5, /* deprecated old name */
  393. HTT_SEQTYPE_BURST_BCN = 6,
  394. HTT_SEQTYPE_UL_BSR_RESP = 7,
  395. HTT_SEQTYPE_UL_BSR_TRIG = 8,
  396. HTT_SEQTYPE_UL_RESP = 9,
  397. HTT_SEQTYPE_UL_MU_MIMO_TRIG = 10,
  398. HTT_SEQTYPE_BE_MU_MIMO = 11,
  399. HTT_SEQTYPE_BE_MU_OFDMA = 12,
  400. HTT_SEQTYPE_BE_UL_MU_OFDMA_TRIG = 13,
  401. HTT_SEQTYPE_BE_UL_MU_MIMO_TRIG = 14,
  402. HTT_SEQTYPE_BE_UL_BSR_TRIG = 15,
  403. };
  404. typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE;
  405. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x0ff00000
  406. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 20
  407. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \
  408. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \
  409. HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)
  410. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \
  411. do { \
  412. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \
  413. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \
  414. } while (0)
  415. /*
  416. * MPROT_TYPE enum values: refer to enum
  417. * pcu_ppdu_setup_init__medium_prot_type__e
  418. * defined in tlv_enum.h
  419. */
  420. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_M 0xf0000000
  421. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_S 28
  422. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_GET(_var) \
  423. (((_var) & HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_M) >> \
  424. HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_S)
  425. #define HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE_SET(_var, _val) \
  426. do { \
  427. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_MPROT_TYPE, _val); \
  428. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  429. } while (0)
  430. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M 0x0000ffff
  431. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S 0
  432. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(_var) \
  433. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M) >> \
  434. HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)
  435. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_SET(_var, _val) \
  436. do { \
  437. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_MODE, _val); \
  438. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)); \
  439. } while (0)
  440. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M 0xffff0000
  441. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S 16
  442. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_GET(_var) \
  443. (((_var) & HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M) >> \
  444. HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)
  445. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_SET(_var, _val) \
  446. do { \
  447. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ, _val); \
  448. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)); \
  449. } while (0)
  450. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_M 0x0000ffff
  451. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S 0
  452. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_GET(_var) \
  453. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_M) >> \
  454. HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S )
  455. #define HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_SET(_var, _val) \
  456. do { \
  457. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US, _val); \
  458. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_PPDU_TX_TIME_US_S)); \
  459. } while (0)
  460. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_M 0x00ff0000
  461. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S 16
  462. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_GET(_var) \
  463. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_M) >> \
  464. HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S)
  465. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_SET(_var, _val) \
  466. do { \
  467. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS, _val); \
  468. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_UL_EXPECTED_USERS_S)); \
  469. } while(0);
  470. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_M 0x01000000
  471. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S 24
  472. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_GET(_var) \
  473. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_M) >> \
  474. HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S)
  475. #define HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_SET(_var, _val) \
  476. do { \
  477. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE, _val); \
  478. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BEAM_CHANGE_S)); \
  479. } while (0)
  480. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_M 0x02000000
  481. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S 25
  482. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_GET(_var) \
  483. (((_var) & HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_M) >> \
  484. HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S)
  485. #define HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_SET(_var, _val) \
  486. do { \
  487. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION, _val); \
  488. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_DOPPLER_INDICATION_S)); \
  489. } while (0)
  490. enum HTT_PPDU_STATS_SPATIAL_REUSE {
  491. HTT_SRP_DISALLOW = 0,
  492. /* values 1-12 are reserved */
  493. HTT_SR_RESTRICTED = 13,
  494. HTT_SR_DELAY = 14,
  495. HTT_SRP_AND_NON_SRG_OBSS_PD_PROHIBITED = 15,
  496. };
  497. typedef enum HTT_PPDU_STATS_SPATIAL_REUSE HTT_PPDU_STATS_SPATIAL_REUSE;
  498. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_M 0x3c000000
  499. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S 26
  500. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_GET(_var) \
  501. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_M) >> \
  502. HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S)
  503. #define HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_SET(_var, _val) \
  504. do { \
  505. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE, _val); \
  506. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SPATIAL_REUSE_S)); \
  507. } while (0)
  508. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_M 0x0000003f
  509. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S 0
  510. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_GET(_var) \
  511. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_M) >> \
  512. HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S)
  513. #define HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_SET(_var, _val) \
  514. do { \
  515. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID, _val); \
  516. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BSS_COLOR_ID_S)); \
  517. } while (0)
  518. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_M 0x00020000
  519. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_S 17
  520. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_GET(_var) \
  521. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_M) >> \
  522. HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_S)
  523. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_SET(_var, _val) \
  524. do { \
  525. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID, _val); \
  526. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_VALID_S)); \
  527. } while (0)
  528. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_M 0x000c0000
  529. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_S 18
  530. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_GET(_var) \
  531. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_M) >> \
  532. HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_S)
  533. #define HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_SET(_var, _val) \
  534. do { \
  535. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_AC_VALID, _val); \
  536. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BACKOFF_AC_S)); \
  537. } while (0)
  538. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_M 0x00100000
  539. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_S 20
  540. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_GET(_var) \
  541. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_M) >> \
  542. HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_S)
  543. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_SET(_var, _val) \
  544. do { \
  545. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID, _val); \
  546. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID_S)); \
  547. } while (0)
  548. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_M 0x1fe00000
  549. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_S 21
  550. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_GET(_var) \
  551. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_M) >> \
  552. HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_S)
  553. #define HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_SET(_var, _val) \
  554. do { \
  555. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_VALID, _val); \
  556. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_UL_USER_RESPONSES_S)); \
  557. } while (0)
  558. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_M 0x0000ffff
  559. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_S 0
  560. #define HTT_PPDU_STATS_COMMON_TRIG_COOKIE_GET(_val) \
  561. (((_val) & HTT_PPDU_STATS_COMMON_TRIG_COOKIE_M) >> \
  562. HTT_PPDU_STATS_COMMON_TRIG_COOKIE_S)
  563. enum HTT_SEQ_TYPE {
  564. WAL_PPDU_SEQ_TYPE = 0,
  565. HTT_PPDU_SEQ_TYPE = 1,
  566. };
  567. typedef struct {
  568. htt_tlv_hdr_t tlv_hdr;
  569. A_UINT32 ppdu_id;
  570. /* BIT [ 15 : 0] :- sched_cmdid
  571. * BIT [ 23 : 16] :- ring_id
  572. * BIT [ 31 : 24] :- num_users
  573. */
  574. union {
  575. A_UINT32 ring_id__sched_cmdid;
  576. struct {
  577. A_UINT32 sched_cmdid: 16,
  578. ring_id: 8,
  579. num_users: 8;
  580. };
  581. };
  582. /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE
  583. * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE
  584. * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW
  585. * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE
  586. * BIT [ 31: 28] :- mprot_type
  587. */
  588. union {
  589. A_UINT32 bw__queue_type__frame_type;
  590. A_UINT32 ppdu_seq_type__bw__queue_type__frame_type;
  591. A_UINT32 mprot_type__ppdu_seq_type__bw__queue_type__frame_type;
  592. struct {
  593. A_UINT32 frame_type: 8,
  594. queue_type: 8,
  595. bw: 4,
  596. ppdu_seq_type: 8,
  597. mprot_type: 4;
  598. };
  599. };
  600. A_UINT32 chain_mask;
  601. A_UINT32 fes_duration_us; /* frame exchange sequence */
  602. A_UINT32 ppdu_sch_eval_start_tstmp_us;
  603. A_UINT32 ppdu_sch_end_tstmp_us;
  604. A_UINT32 ppdu_start_tstmp_us;
  605. /* BIT [15 : 0] - phy mode (WLAN_PHY_MODE) with which ppdu was transmitted
  606. * BIT [31 : 16] - bandwidth (in MHz) with which ppdu was transmitted
  607. */
  608. union {
  609. A_UINT32 chan_mhz__phy_mode;
  610. struct {
  611. A_UINT32 phy_mode: 16,
  612. chan_mhz: 16;
  613. };
  614. };
  615. /*
  616. * The cca_delta_time_us reports the time the tx PPDU in question
  617. * was waiting in the HW tx queue for the clear channel assessment
  618. * to indicate that the transmission could start.
  619. * If this CCA delta time is zero or small, this indicates that the
  620. * air interface was unused prior to the transmission, and thus it's
  621. * improbable that there was a collision with some other transceiver's
  622. * transmission.
  623. * In contrast, a large CCA delta time means that this transceiver had
  624. * to wait a long time for the air interface to be available; it's
  625. * possible that other transceivers were also waiting for the air
  626. * interface to become available, and if the other waiting transceiver's
  627. * CW backoff aligned with this one, to have a transmit collision.
  628. */
  629. A_UINT32 cca_delta_time_us;
  630. /*
  631. * The rxfrm_delta_time_us reports the time the tx PPDU in question
  632. * was waiting in the HW tx queue while there was an ongoing rx,
  633. * either because the rx was already ongoing at the time the tx PPDU
  634. * was enqueued, or because the rx (i.e. the peer's tx) won the air
  635. * interface contention over the local vdev's tx.
  636. */
  637. A_UINT32 rxfrm_delta_time_us;
  638. /*
  639. * The txfrm_delta_time_us reports the time from when the tx PPDU
  640. * in question was enqueued into the HW tx queue until the time the
  641. * tx completion interrupt for the PPDU occurred.
  642. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU
  643. * had to wait for the air interface to become available, the PPDU
  644. * duration, the block ack reception, and the tx completion interrupt
  645. * latency.
  646. */
  647. A_UINT32 txfrm_delta_time_us;
  648. /*
  649. * The phy_ppdu_tx_time_us reports the time it took to transmit
  650. * a PPDU by itself
  651. * BIT [15 : 0] - phy_ppdu_tx_time_us reports the time it took to
  652. * transmit by itself (not including response time)
  653. * BIT [23 : 16] - num_ul_expected_users reports the number of users
  654. * that are expected to respond to this transmission
  655. * BIT [24 : 24] - beam_change reports the beam forming pattern
  656. * between non-HE and HE portion.
  657. * If we apply TxBF starting from legacy preamble,
  658. * then beam_change = 0.
  659. * If we apply TxBF only starting from HE portion,
  660. * then beam_change = 1.
  661. * BIT [25 : 25] - doppler_indication
  662. * BIT [29 : 26] - spatial_reuse for HE_SU,HE_MU and HE_EXT_SU format PPDU
  663. * HTT_PPDU_STATS_SPATIAL_REUSE
  664. * BIT [31 : 30] - reserved
  665. */
  666. union {
  667. A_UINT32 reserved__ppdu_tx_time_us;
  668. A_UINT32 reserved__num_ul_expected_users__ppdu_tx_time_us;
  669. A_UINT32 reserved__spatial_reuse__doppler_indication__beam_change__num_ul_expected_users__ppdu_tx_time_us;
  670. struct {
  671. A_UINT32 phy_ppdu_tx_time_us: 16,
  672. num_ul_expected_users: 8,
  673. beam_change: 1,
  674. doppler_indication: 1,
  675. spatial_reuse: 4,
  676. reserved1: 2;
  677. };
  678. };
  679. /* ppdu_start_tstmp_u32_us:
  680. * Upper 32 bits of the PPDU start timestamp.
  681. * This field can be combined with the ppdu_start_tstmp_us field's
  682. * lower 32 bits of the PPDU start timestamp to form a 64-bit timestamp.
  683. */
  684. A_UINT32 ppdu_start_tstmp_u32_us;
  685. /*
  686. * BIT [5 : 0] - bss_color_id indicates he_bss_color which is an identifier
  687. * of the BSS and is used to assist a receiving STA in
  688. * identifying the BSS from which a PPDU originates.
  689. * Value in the range 0 to 63
  690. * BIT [6 : 6] - PPDU transmitted using Non-SRG opportunity
  691. * BIT [7 : 7] - PPDU transmitted using SRG opportunity
  692. * BIT [15: 8] - RSSI of the aborted OBSS frame (in dB w.r.t. noise floor)
  693. * by which SRG/Non-SRG based spatial reuse opportunity
  694. * was created.
  695. * BIT [16:16] - PPDU transmitted using PSR opportunity
  696. * BIT [17:17] - backoff_ac_valid
  697. * BIT [19:18] - backoff_ac: WMM ACI Value of the backoff engine used for
  698. * this transmission. Only valid if backoff_ac_valid is set
  699. * to 1. Typically this would match the default tid
  700. * number -> AC mapping. For frames in the middle of a SIFS
  701. * burst, the backoff_ac_valid will be 0.
  702. * BIT [20:20] - num_ul_user_responses_valid
  703. * BIT [21:28] - num_ul_user_responses: The number of user responses
  704. * detected by the MAC layer. This value can be compared with
  705. * the "num_ul_expected_users" field to see whether this frame
  706. * had a complete or partial response failure. Only valid if
  707. * num_ul_user_responses_valid is set to 1.
  708. * BIT [31:29] - reserved
  709. */
  710. union {
  711. A_UINT32 reserved__num_ul_user_responses__num_ul_user_responses_valid__backoff_ac__backoff_ac_valid__psr_tx__aborted_obss_rssi__srg_tx__non_srg_tx__bss_color_id;
  712. A_UINT32 reserved__psr_tx__aborted_obss_rssi__srg_tx__non_srg_tx___bss_color_id;
  713. A_UINT32 reserved__aborted_obss_rssi__srg_tx__non_srg_tx___bss_color_id;
  714. A_UINT32 reserved__bss_color_id;
  715. struct {
  716. A_UINT32 bss_color_id: 6,
  717. non_srg_tx: 1,
  718. srg_tx: 1,
  719. aborted_obss_rssi: 8,
  720. psr_tx: 1,
  721. backoff_ac_valid: 1,
  722. backoff_ac: 2,
  723. num_ul_user_responses_valid: 1,
  724. num_ul_user_responses: 8,
  725. reserved2: 3;
  726. };
  727. };
  728. /* Note: This is for tracking a UL OFDMA packet */
  729. union {
  730. A_UINT32 trig_cookie_info;
  731. struct {
  732. A_UINT32 trig_cookie: 16,
  733. trig_cookie_rsvd: 15,
  734. trig_cookie_valid: 1;
  735. };
  736. };
  737. /*
  738. * BIT [0 : 0] - htt_seq_type field is added for backward compatibility
  739. * with pktlog decoder, host driver or any third party tool
  740. * interpreting ppdu sequence type. If field 'htt_seq_type'
  741. * is not present or is present but set to WAL_PPDU_SEQ_TYPE,
  742. * decoder should interpret the seq type as
  743. * WAL_TXSEND_PPDU_SEQUENCE.
  744. * If the new field htt_seq_type is present and is set to
  745. * HTT_PPDU_SEQ_TYPE then decoder should interpret the
  746. * seq type as HTT_PPDU_STATS_SEQ_TYPE.
  747. * htt_seq_type field will be set to HTT_PPDU_SEQ_TYPE in
  748. * firmware versions where this field is defined.
  749. * BIT [31: 1] - reserved
  750. */
  751. union {
  752. A_UINT32 reserved__htt_seq_type;
  753. struct {
  754. A_UINT32 htt_seq_type: 1,
  755. reserved3: 31;
  756. };
  757. };
  758. /* is_manual_ulofdma_trigger:
  759. * Flag to indicate if a given UL OFDMA trigger is manually triggered
  760. * from the Host
  761. */
  762. A_UINT32 is_manual_ulofdma_trigger;
  763. /* is_combined_ul_bsrp_trigger:
  764. * Flag to indicate if a given UL BSRP trigger is sent combined as
  765. * part of existing DL/UL data sequence
  766. */
  767. A_UINT32 is_combined_ul_bsrp_trigger;
  768. } htt_ppdu_stats_common_tlv;
  769. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff
  770. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S 0
  771. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_GET(_var) \
  772. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M) >> \
  773. HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)
  774. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_SET(_var, _val) \
  775. do { \
  776. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM, _val); \
  777. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)); \
  778. } while (0)
  779. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M 0x0000ff00
  780. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S 8
  781. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_GET(_var) \
  782. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M) >> \
  783. HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)
  784. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_SET(_var, _val) \
  785. do { \
  786. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID, _val); \
  787. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)); \
  788. } while (0)
  789. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  790. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S 16
  791. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_GET(_var) \
  792. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M) >> \
  793. HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)
  794. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  795. do { \
  796. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID, _val); \
  797. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)); \
  798. } while (0)
  799. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M 0x00000001
  800. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S 0
  801. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_GET(_var) \
  802. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M) >> \
  803. HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)
  804. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_SET(_var, _val) \
  805. do { \
  806. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MCAST, _val); \
  807. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)); \
  808. } while (0)
  809. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M 0x000003fe
  810. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S 1
  811. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_GET(_var) \
  812. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M) >> \
  813. HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)
  814. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_SET(_var, _val) \
  815. do { \
  816. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED, _val); \
  817. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)); \
  818. } while (0)
  819. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_M 0x00003c00
  820. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_S 10
  821. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_GET(_var) \
  822. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_BW_M) >> \
  823. HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)
  824. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_SET(_var, _val) \
  825. do { \
  826. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_BW, _val); \
  827. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)); \
  828. } while (0)
  829. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M 0x00004000
  830. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S 14
  831. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_GET(_var) \
  832. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M) >> \
  833. HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)
  834. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_SET(_var, _val) \
  835. do { \
  836. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA, _val); \
  837. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)); \
  838. } while (0)
  839. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_M 0x00008000
  840. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S 15
  841. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_GET(_var) \
  842. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_M) >> \
  843. HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S)
  844. #define HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_SET(_var, _val) \
  845. do { \
  846. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER, _val); \
  847. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_IS_SQNUM_VALID_IN_BUFFER_S)); \
  848. } while (0)
  849. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_M 0xffff0000
  850. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S 16
  851. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_GET(_var) \
  852. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_M) >> \
  853. HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S)
  854. #define HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_SET(_var, _val) \
  855. do { \
  856. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES, _val); \
  857. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_NUM_FRAMES_S)); \
  858. } while (0)
  859. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M 0x0000ffff
  860. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S 0
  861. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_GET(_var) \
  862. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M) >> \
  863. HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)
  864. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_SET(_var, _val) \
  865. do { \
  866. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL, _val); \
  867. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)); \
  868. } while (0)
  869. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M 0xffff0000
  870. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S 16
  871. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_GET(_var) \
  872. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M) >> \
  873. HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)
  874. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_SET(_var, _val) \
  875. do { \
  876. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL, _val); \
  877. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)); \
  878. } while (0)
  879. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_M 0x000000ff
  880. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S 0
  881. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_GET(_var) \
  882. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_M) >> \
  883. HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S)
  884. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_SET(_var, _val) \
  885. do { \
  886. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER, _val); \
  887. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MULTIPLIER_S)); \
  888. } while (0)
  889. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_M 0x0000ff00
  890. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S 8
  891. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_GET(_var) \
  892. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_M) >> \
  893. HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S)
  894. #define HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_SET(_var, _val) \
  895. do { \
  896. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS, _val); \
  897. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_CHAIN_ENABLE_BITS_S)); \
  898. } while (0)
  899. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32 4
  900. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK 0x000000ff
  901. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_GET(tlv, chain_idx) \
  902. ((A_INT8) ((tlv)->tx_pwr[(chain_idx)/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] >> \
  903. ((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK)
  904. #define HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_SET(tlv, chain_idx, value) \
  905. (tlv)->tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] = \
  906. (tlv)->tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] & \
  907. ~(0xff << (((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8)) | \
  908. (((value)<<((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8))
  909. #define HTT_PPDU_STATS_USER_COMMON_TLV_ALT_TX_PWR_GET(tlv, chain_idx) \
  910. ((A_INT8) ((tlv)->alt_tx_pwr[(chain_idx)/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] >> \
  911. ((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8) & HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_MASK)
  912. #define HTT_PPDU_STATS_USER_COMMON_TLV_ALT_TX_PWR_SET(tlv, chain_idx, value) \
  913. (tlv)->alt_tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] = \
  914. (tlv)->alt_tx_pwr[chain_idx/HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32] & \
  915. ~(0xff << (((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8)) | \
  916. (((value)<<((chain_idx)%HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32)*8))
  917. typedef struct {
  918. htt_tlv_hdr_t tlv_hdr;
  919. /* BIT [ 7 : 0] :- tid_num
  920. * BIT [ 15: 8] :- vap_id
  921. * BIT [ 31: 16] :- sw_peer_id
  922. */
  923. union {
  924. A_UINT32 sw_peer_id__vapid__tid_num;
  925. struct {
  926. A_UINT32 tid_num: 8,
  927. vap_id: 8,
  928. sw_peer_id: 16;
  929. };
  930. };
  931. /* BIT [ 0 : 0] :- mcast
  932. * BIT [ 9 : 1] :- mpdus_tried
  933. * BIT [ 13: 10] :- bw - HTT_PPDU_STATS_BW
  934. * BIT [ 14: 14] :- delayed_ba
  935. * BIT [ 15: 15] :- rsvd
  936. * BIT [ 31: 16] :- num_frames - num of MSDUs + num of MPDUs
  937. */
  938. union {
  939. A_UINT32 bw__mpdus_tried__mcast;
  940. struct {
  941. A_UINT32 mcast: 1,
  942. mpdus_tried: 9,
  943. bw: 4,
  944. delayed_ba: 1,
  945. is_sqno_valid_in_buffer: 1,
  946. num_frames: 16;
  947. };
  948. };
  949. /* BIT [ 15: 0] :- frame_ctrl
  950. * BIT [ 31: 16] :- qos_ctrl
  951. */
  952. union {
  953. A_UINT32 qos_ctrl_frame_ctrl;
  954. struct {
  955. A_UINT32 frame_ctrl: 16,
  956. qos_ctrl: 16;
  957. };
  958. };
  959. /*
  960. * Data fields containing the physical address info of a MSDU buffer
  961. * as well as the owner and a SW cookie info that can be used by the host
  962. * to look up the virtual address of the MSDU buffer.
  963. * These fields are only valid if is_buffer_addr_info_valid is set to 1.
  964. */
  965. A_UINT32 buffer_paddr_31_0 : 32;
  966. A_UINT32 buffer_paddr_39_32 : 8,
  967. return_buffer_manager : 3,
  968. sw_buffer_cookie : 21;
  969. /*
  970. * host_opaque_cookie : Host can send upto 2 bytes of opaque
  971. * cookie in TCL_DATA_CMD and FW will replay this back in
  972. * HTT PPDU stats. Valid only if sent to FW through
  973. * exception mechanism.
  974. *
  975. * is_standalone : This msdu was sent as a single MSDU/MPDU
  976. * PPDU as indicated by host via TCL_DATA_CMD using
  977. * the send_as_standalone bit.
  978. *
  979. * is_buffer_addr_info_valid : This will be set whenever a MSDU is sent as
  980. * a singleton (single-MSDU PPDU) for FW use-cases or as indicated by host
  981. * via send_as_standalone in TCL_DATA_CMD.
  982. *
  983. * The fields is_sw_rts_enabled, is_hw_rts_enabled, is_sfm_war_enabled
  984. * indicate whether SW RTS, HW RTS, SFM WAR are enabled for the
  985. * current Tx-sequence respectively.
  986. */
  987. A_UINT32 host_opaque_cookie: 16,
  988. is_host_opaque_valid: 1,
  989. is_standalone: 1,
  990. is_buffer_addr_info_valid: 1,
  991. is_sw_rts_enabled: 1,
  992. is_hw_rts_enabled: 1,
  993. is_sfm_war_enabled: 1,
  994. reserved1: 10;
  995. /* qdepth bytes : Contains Number of bytes of TIDQ depth */
  996. A_UINT32 qdepth_bytes;
  997. A_UINT32 full_aid : 12,
  998. reserved : 20;
  999. /* data_frm_ppdu_id:
  1000. * Note - this is valid in case delayed BA processing specifically for
  1001. * BAR frames*/
  1002. A_UINT32 data_frm_ppdu_id;
  1003. /* sw_rts_prot_dur_us:
  1004. * SW RTS protection duration in micro sec.
  1005. * Note - this is valid if SW RTS was used instead of HW RTS.
  1006. */
  1007. A_UINT32 sw_rts_prot_dur_us;
  1008. /* Data fields related to Transmit power */
  1009. /* tx_pwr_multiplier:
  1010. * Hawkeye now supports power accuracy in 0.25 dBm steps,
  1011. * so all powers are x4.
  1012. * This is needed to resolve compatibility issues with previous
  1013. * generation chipsets.
  1014. * API in halphy phyrf_bdf_GetMaxRatePwrMultiplier, used to find out
  1015. * what the multiplier and use that to correctly report the TPC value
  1016. * to host.
  1017. *
  1018. * chain_enable_bits:
  1019. * Indicates the valid tx_pwr values in the tx_pwr field.
  1020. * Default value: 1
  1021. * tx_pwr[0] value is used for all chains if chain_enable_bits field
  1022. * is set to 1.
  1023. */
  1024. A_UINT32 tx_pwr_multiplier : 8,
  1025. chain_enable_bits : 8,
  1026. reserved2 : 16;
  1027. /*
  1028. * Transmit powers (signed values packed into unsigned bitfields)
  1029. * in units of 0.25 dBm per chain.
  1030. * To report the tx_pwr value in dBm units, stored value has to be
  1031. * divided with tx_pwr_multiplier field.
  1032. * Per chain tx_pwr configuration is not available for all chipsets.
  1033. * Use tx_pwr[0] value for all chains if chain_enable_bits field
  1034. * is set to 1.
  1035. * Each chain uses 1 byte to store the transmit power.
  1036. * The bytes within a A_UINT32 use little-endian order,
  1037. * i.e. bits 7:0 of tx_pwr[0] store the tx pwr for chain 0,
  1038. * bits 15:8 of tx_pwr[0] store the tx pwr for chain 1, etc.
  1039. * Since HTT_STATS_MAX_CHAINS is a multiple of 4, no rounding is needed
  1040. * to determine the number of A_UINT32 array elements.
  1041. * Any bytes that exceed the number of chains with valid
  1042. * tx_pwr data will be filled with 0x00.
  1043. * When packing the 1-byte tx_pwr values into the A_UINT32,
  1044. * masking is needed to keep the sign bits from clobbering
  1045. * the higher bytes.
  1046. * When extracting the 1-byte tx_pwr values from the A_UINT32,
  1047. * sign-extension is needed if the variable holding the extracted
  1048. * value is larger than A_INT8.
  1049. */
  1050. A_UINT32 tx_pwr[HTT_STATS_MAX_CHAINS / HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32];
  1051. /*
  1052. * Transmit powers for the alternate transmit descriptor used for BT COEX
  1053. * (signed values packed into unsigned bitfields) in units of
  1054. * 0.25 dBm per chain.
  1055. * Not used by the host currently.
  1056. * To report the alt_tx_pwr value in dBm units, stored value has to be
  1057. * divided with tx_pwr_multiplier field.
  1058. * Per chain alt_tx_pwr configuration is not available for all chipsets.
  1059. * Use alt_tx_pwr[0] value for all chains if chain_enable_bits field
  1060. * is set to 1.
  1061. * Each chain uses 1 byte to store the alternate transmit power.
  1062. * The bytes within a A_UINT32 use little-endian order,
  1063. * i.e. bits 7:0 of alt_tx_pwr[0] store the alt tx pwr for chain 0,
  1064. * bits 15:8 of alt_tx_pwr[0] store the alt tx pwr for chain 1, etc.
  1065. * Since HTT_STATS_MAX_CHAINS is a multiple of 4, no rounding is needed
  1066. * to determine the number of A_UINT32 array elements.
  1067. * Any bytes that exceed the number of chains with valid
  1068. * alt_tx_pwr data will be filled with 0x00.
  1069. * When packing the 1-byte alt_tx_pwr values into the A_UINT32,
  1070. * masking is needed to keep the sign bits from clobbering
  1071. * the higher bytes.
  1072. * When extracting the 1-byte alt_tx_pwr values from the A_UINT32,
  1073. * sign-extension is needed if the variable holding the extracted
  1074. * value is larger than A_INT8.
  1075. */
  1076. A_UINT32 alt_tx_pwr[HTT_STATS_MAX_CHAINS / HTT_PPDU_STATS_USER_COMMON_TLV_TX_PWR_CHAINS_PER_U32];
  1077. /*
  1078. * A bitmap indicating the MSDUQs that the scheduler is attempting to
  1079. * transmit in this PPDU. Note that in some cases, the scheduler's notion
  1080. * of what MSDUQs are being transmitted from may not be fully accurate,
  1081. * such as when MPDUs are retried, or when some previously generated MPDUs
  1082. * that were not attempted OTA yet are tried.
  1083. *
  1084. * The valid bit indices for this bitmap are defined by the HTT_MSDUQ_INDEX
  1085. * enum (in htt.h). For example, (1 << HTT_MSDUQ_INDEX_UDP) would
  1086. * correspond to the default UDP msduq.
  1087. */
  1088. A_UINT32 msduq_bitmap;
  1089. } htt_ppdu_stats_user_common_tlv;
  1090. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M 0x000000ff
  1091. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S 0
  1092. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_GET(_var) \
  1093. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M) >> \
  1094. HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)
  1095. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_SET(_var, _val) \
  1096. do { \
  1097. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM, _val); \
  1098. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)); \
  1099. } while (0)
  1100. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_M 0x0000ff00
  1101. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_S 8
  1102. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M 0xffff0000
  1103. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S 16
  1104. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_GET(_var) \
  1105. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M) >> \
  1106. HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)
  1107. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_SET(_var, _val) \
  1108. do { \
  1109. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID, _val); \
  1110. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)); \
  1111. } while (0)
  1112. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M 0x0000000f
  1113. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S 0
  1114. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_GET(_var) \
  1115. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M) >> \
  1116. HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)
  1117. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_SET(_var, _val) \
  1118. do { \
  1119. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_USER_POS, _val); \
  1120. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)); \
  1121. } while (0)
  1122. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M 0x00000ff0
  1123. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S 4
  1124. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_GET(_var) \
  1125. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M) >> \
  1126. HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)
  1127. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_SET(_var, _val) \
  1128. do { \
  1129. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID, _val); \
  1130. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)); \
  1131. } while (0)
  1132. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  1133. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  1134. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  1135. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  1136. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  1137. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  1138. do { \
  1139. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  1140. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  1141. } while (0)
  1142. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  1143. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  1144. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  1145. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  1146. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  1147. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  1148. do { \
  1149. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  1150. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  1151. } while (0)
  1152. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M 0x00000001
  1153. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S 0
  1154. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_GET(_var) \
  1155. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M) >> \
  1156. HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)
  1157. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_SET(_var, _val) \
  1158. do { \
  1159. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID, _val); \
  1160. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)); \
  1161. } while (0)
  1162. #define HTT_PPDU_STATS_BUF_ADDR_39_32_M 0x000000ff
  1163. #define HTT_PPDU_STATS_BUF_ADDR_39_32_S 0
  1164. #define HTT_PPDU_STATS_BUF_ADDR_39_32__GET(_var) \
  1165. (((_var) & HTT_PPDU_STATS_BUF_ADDR_39_32_M) >> \
  1166. HTT_PPDU_STATS_BUF_ADDR_39_32_S)
  1167. #define HTT_PPDU_STATS_BUF_ADDR_39_32_SET(_var, _val) \
  1168. do { \
  1169. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_BUF_ADDR_39_32, _val); \
  1170. ((_var) |= ((_val) << HTT_PPDU_STATS_BUF_ADDR_39_32_S)); \
  1171. } while (0)
  1172. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_M 0x00000700
  1173. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_S 8
  1174. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_GET(_var) \
  1175. (((_var) & HTT_PPDU_STATS_RETURN_BUF_MANAGER_M) >> \
  1176. HTT_PPDU_STATS_RETURN_BUF_MANAGER_S)
  1177. #define HTT_PPDU_STATS_RETURN_BUF_MANAGER_SET(_var, _val) \
  1178. do { \
  1179. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_RETURN_BUF_MANAGER, _val); \
  1180. ((_var) |= ((_val) << HTT_PPDU_STATS_RETURN_BUF_MANAGER_S)); \
  1181. } while (0)
  1182. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_M 0xfffff800
  1183. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_S 11
  1184. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_GET(_var) \
  1185. (((_var) & HTT_PPDU_STATS_SW_BUFFER_COOKIE_M) >> \
  1186. HTT_PPDU_STATS_SW_BUFFER_COOKIE_S)
  1187. #define HTT_PPDU_STATS_SW_BUFFER_COOKIE_SET(_var, _val) \
  1188. do { \
  1189. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_SW_BUFFER_COOKIE, _val); \
  1190. ((_var) |= ((_val) << HTT_PPDU_STATS_SW_BUFFER_COOKIE_S)); \
  1191. } while (0)
  1192. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1193. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S 0
  1194. #define HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_GET(_var) \
  1195. (((_var) & HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_M) >> \
  1196. HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S)
  1197. #define HTT_PPDU_STAT_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  1198. do { \
  1199. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_HOST_OPAQUE_COOKIE, _val); \
  1200. ((_var) |= ((_val) << HTT_PPDU_STATS_HOST_OPAQUE_COOKIE_S)); \
  1201. } while (0)
  1202. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_M 0x00010000
  1203. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_S 16
  1204. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_GET(_var) \
  1205. (((_var) & HTT_PPDU_STATS_IS_OPAQUE_VALID_M) >> \
  1206. HTT_PPDU_STATS_IS_OPAQUE_VALID_S)
  1207. #define HTT_PPDU_STATS_IS_OPAQUE_VALID_SET(_var, _val) \
  1208. do { \
  1209. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_OPAQUE_VALID, _val); \
  1210. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_OPAQUE_VALID_S)); \
  1211. } while (0)
  1212. #define HTT_PPDU_STATS_IS_STANDALONE_M 0x00020000
  1213. #define HTT_PPDU_STATS_IS_STANDALONE_S 17
  1214. #define HTT_PPDU_STATS_IS_STANDALONE_GET(_var) \
  1215. (((_var) & HTT_PPDU_STATS_IS_STANDALONE_M) >> \
  1216. HTT_PPDU_STATS_IS_OPAQUE_VALID_S)
  1217. #define HTT_PPDU_STATS_IS_STANDALONE_SET(_var, _val) \
  1218. do { \
  1219. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_STANDALONE, _val); \
  1220. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_STANDALONE_S)); \
  1221. } while (0)
  1222. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_M 0x000400000
  1223. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S 18
  1224. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_GET(_var) \
  1225. (((_var) & HTT_PPDU_STATS_IS_BUFF_INFO_VALID_M) >> \
  1226. HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S)
  1227. #define HTT_PPDU_STATS_IS_BUFF_INFO_VALID_SET(_var, _val) \
  1228. do { \
  1229. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_IS_BUFF_INFO_VALID, _val); \
  1230. ((_var) |= ((_val) << HTT_PPDU_STATS_IS_BUFF_INFO_VALID_S)); \
  1231. } while (0)
  1232. enum HTT_PPDU_STATS_PPDU_TYPE {
  1233. HTT_PPDU_STATS_PPDU_TYPE_SU,
  1234. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO,
  1235. HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA,
  1236. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA,
  1237. HTT_PPDU_STATS_PPDU_TYPE_UL_TRIG,
  1238. HTT_PPDU_STATS_PPDU_TYPE_BURST_BCN,
  1239. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP,
  1240. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG,
  1241. HTT_PPDU_STATS_PPDU_TYPE_UL_RESP,
  1242. HTT_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  1243. };
  1244. typedef enum HTT_PPDU_STATS_PPDU_TYPE HTT_PPDU_STATS_PPDU_TYPE;
  1245. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M 0x0000003E
  1246. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S 1
  1247. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_GET(_var) \
  1248. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M) >> \
  1249. HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)
  1250. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE, _val); \
  1253. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)); \
  1254. } while (0)
  1255. enum HTT_PPDU_STATS_TXBF_TYPE {
  1256. HTT_PPDU_STATS_TXBF_OPEN_LOOP,
  1257. HTT_PPDU_STATS_TXBF_IMPLICIT,
  1258. HTT_PPDU_STATS_TXBF_EXPLICIT,
  1259. HTT_PPDU_STATS_TXBF_MAX,
  1260. };
  1261. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M 0x00000003
  1262. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S 0
  1263. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_GET(_var) \
  1264. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M) >> \
  1265. HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)
  1266. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_SET(_var, _val) \
  1267. do { \
  1268. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE, _val); \
  1269. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)); \
  1270. } while (0)
  1271. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_M 0x00000004
  1272. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_S 2
  1273. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_GET(_var) \
  1274. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_STBC_M) >> \
  1275. HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)
  1276. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_SET(_var, _val) \
  1277. do { \
  1278. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_STBC, _val); \
  1279. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)); \
  1280. } while (0)
  1281. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M 0x00000008
  1282. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S 3
  1283. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_GET(_var) \
  1284. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M) >> \
  1285. HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)
  1286. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_HE_RE, _val); \
  1289. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)); \
  1290. } while (0)
  1291. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M 0x000000f0
  1292. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S 4
  1293. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_GET(_var) \
  1294. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M) >> \
  1295. HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)
  1296. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TXBF, _val); \
  1299. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)); \
  1300. } while (0)
  1301. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_M 0x00000f00
  1302. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_S 8
  1303. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(_var) \
  1304. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_BW_M) >> \
  1305. HTT_PPDU_STATS_USER_RATE_TLV_BW_S)
  1306. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_BW, _val); \
  1309. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_BW_S)); \
  1310. } while (0)
  1311. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_M 0x0000f000
  1312. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_S 12
  1313. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(_var) \
  1314. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_NSS_M) >> \
  1315. HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)
  1316. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_NSS, _val); \
  1319. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)); \
  1320. } while (0)
  1321. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_M 0x000f0000
  1322. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_S 16
  1323. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(_var) \
  1324. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MCS_M) >> \
  1325. HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)
  1326. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_SET(_var, _val) \
  1327. do { \
  1328. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MCS, _val); \
  1329. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)); \
  1330. } while (0)
  1331. /* Refer HTT_STATS_PREAM_TYPE */
  1332. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M 0x00f00000
  1333. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S 20
  1334. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(_var) \
  1335. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M) >> \
  1336. HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)
  1337. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE, _val); \
  1340. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)); \
  1341. } while (0)
  1342. /* Guard Intervals */
  1343. enum HTT_PPDU_STATS_GI {
  1344. HTT_PPDU_STATS_GI_800,
  1345. HTT_PPDU_STATS_GI_400,
  1346. HTT_PPDU_STATS_GI_1600,
  1347. HTT_PPDU_STATS_GI_3200,
  1348. HTT_PPDU_STATS_GI_CNT,
  1349. };
  1350. typedef enum HTT_PPDU_STATS_GI HTT_PPDU_STATS_GI;
  1351. /* Refer HTT_PPDU_STATS_GI */
  1352. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_M 0x0f000000
  1353. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_S 24
  1354. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_GET(_var) \
  1355. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_GI_M) >> \
  1356. HTT_PPDU_STATS_USER_RATE_TLV_GI_S)
  1357. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_SET(_var, _val) \
  1358. do { \
  1359. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_GI, _val); \
  1360. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_GI_S)); \
  1361. } while (0)
  1362. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_M 0x10000000
  1363. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_S 28
  1364. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_GET(_var) \
  1365. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_DCM_M) >> \
  1366. HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)
  1367. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_SET(_var, _val) \
  1368. do { \
  1369. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_DCM, _val); \
  1370. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)); \
  1371. } while (0)
  1372. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M 0x20000000
  1373. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S 29
  1374. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_GET(_var) \
  1375. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M) >> \
  1376. HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)
  1377. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_SET(_var, _val) \
  1378. do { \
  1379. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LDPC, _val); \
  1380. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)); \
  1381. } while (0)
  1382. enum HTT_PPDU_STATS_RESP_PPDU_TYPE {
  1383. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_MIMO_UL,
  1384. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_OFDMA_UL,
  1385. };
  1386. typedef enum HTT_PPDU_STATS_RESP_PPDU_TYPE HTT_PPDU_STATS_RESP_PPDU_TYPE;
  1387. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M 0xC0000000
  1388. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S 30
  1389. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_GET(_var) \
  1390. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M) >> \
  1391. HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)
  1392. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_SET(_var, _val) \
  1393. do { \
  1394. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE, _val); \
  1395. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)); \
  1396. } while (0)
  1397. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_M 0x0000f000
  1398. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S 12
  1399. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_GET(_var) \
  1400. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_M) >> \
  1401. HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S)
  1402. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_SET(_var, _val) \
  1403. do { \
  1404. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT, _val); \
  1405. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_FORMAT_S)); \
  1406. } while (0)
  1407. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  1408. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  1409. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  1410. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  1411. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  1412. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  1413. do { \
  1414. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  1415. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  1416. } while (0)
  1417. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  1418. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  1419. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  1420. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  1421. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  1422. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  1423. do { \
  1424. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  1425. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  1426. } while (0)
  1427. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_M 0x0000ffff
  1428. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S 0
  1429. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_GET(_var) \
  1430. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_M) >> \
  1431. HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S)
  1432. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_SET(_var, _val) \
  1433. do { \
  1434. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX, _val); \
  1435. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_INDEX_S)); \
  1436. } while (0)
  1437. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_M 0xffff0000
  1438. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S 16
  1439. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_GET(_var) \
  1440. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_M) >> \
  1441. HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S)
  1442. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_SET(_var, _val) \
  1443. do { \
  1444. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE, _val); \
  1445. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_SIZE_S)); \
  1446. } while (0)
  1447. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_M 0x0000ffff
  1448. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S 0
  1449. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_GET(_var) \
  1450. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_M) >> \
  1451. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S)
  1452. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_SET(_var, _val) \
  1453. do { \
  1454. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END, _val); \
  1455. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_END_S)); \
  1456. } while (0)
  1457. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_M 0xffff0000
  1458. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S 16
  1459. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_GET(_var) \
  1460. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_M) >> \
  1461. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S)
  1462. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_SET(_var, _val) \
  1463. do { \
  1464. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START, _val); \
  1465. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_START_S)); \
  1466. } while (0)
  1467. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_M 0x0000ffff
  1468. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S 0
  1469. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_GET(_var) \
  1470. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_M) >> \
  1471. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S)
  1472. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_SET(_var, _val) \
  1473. do { \
  1474. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX, _val); \
  1475. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_INDEX_S)); \
  1476. } while (0)
  1477. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_M 0xffff0000
  1478. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S 16
  1479. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_GET(_var) \
  1480. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_M) >> \
  1481. HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S)
  1482. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_SET(_var, _val) \
  1483. do { \
  1484. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE, _val); \
  1485. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_RU_SIZE_S)); \
  1486. } while (0)
  1487. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_M 0x0000ffff
  1488. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S 0
  1489. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_GET(_var) \
  1490. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_M) >> \
  1491. HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S)
  1492. #define HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_SET (_var , _val) \
  1493. do { \
  1494. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP, _val); \
  1495. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PUNC_PATTERN_BITMAP_S)); \
  1496. } while (0)
  1497. #define HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_M 0x00010000
  1498. #define HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_S 16
  1499. #define HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_GET(_var) \
  1500. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_M) >> \
  1501. HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_S)
  1502. #define HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_SET (_var , _val) \
  1503. do { \
  1504. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF, _val); \
  1505. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_EXTRA_EHT_LTF_S)); \
  1506. } while (0)
  1507. typedef enum HTT_PPDU_STATS_RU_SIZE {
  1508. HTT_PPDU_STATS_RU_26,
  1509. HTT_PPDU_STATS_RU_52,
  1510. HTT_PPDU_STATS_RU_52_26,
  1511. HTT_PPDU_STATS_RU_106,
  1512. HTT_PPDU_STATS_RU_106_26,
  1513. HTT_PPDU_STATS_RU_242,
  1514. HTT_PPDU_STATS_RU_484,
  1515. HTT_PPDU_STATS_RU_484_242,
  1516. HTT_PPDU_STATS_RU_996,
  1517. HTT_PPDU_STATS_RU_996_484,
  1518. HTT_PPDU_STATS_RU_996_484_242,
  1519. HTT_PPDU_STATS_RU_996x2,
  1520. HTT_PPDU_STATS_RU_996x2_484,
  1521. HTT_PPDU_STATS_RU_996x3,
  1522. HTT_PPDU_STATS_RU_996x3_484,
  1523. HTT_PPDU_STATS_RU_996x4,
  1524. } HTT_PPDU_STATS_RU_SIZE;
  1525. typedef struct {
  1526. htt_tlv_hdr_t tlv_hdr;
  1527. /* BIT [ 7 : 0] :- tid_num
  1528. * BIT [ 15: 8] :- reserved0
  1529. * BIT [ 31: 16] :- sw_peer_id
  1530. */
  1531. union {
  1532. A_UINT32 sw_peer_id__tid_num;
  1533. struct {
  1534. A_UINT32 tid_num: 8,
  1535. reserved0: 8,
  1536. sw_peer_id: 16;
  1537. };
  1538. };
  1539. /* BIT [ 3 : 0] :- user_pos
  1540. * BIT [ 11: 4] :- mu_group_id
  1541. * BIT [ 15: 12] :- ru_format
  1542. * BIT [ 31: 16] :- reserved1
  1543. */
  1544. union {
  1545. A_UINT32 mu_group_id__user_pos;
  1546. struct {
  1547. A_UINT32 user_pos: 4,
  1548. mu_group_id: 8,
  1549. ru_format: 4,
  1550. reserved1: 16;
  1551. };
  1552. };
  1553. /* BIT [ 15 : 0] :- ru_end or ru_index
  1554. * BIT [ 31 : 16] :- ru_start or ru_size
  1555. *
  1556. * Discriminant is field ru_format:
  1557. * - ru_format = 0: ru_end, ru_start
  1558. * - ru_format = 1: ru_index, ru_size
  1559. * - ru_format = other: reserved for future expansion
  1560. *
  1561. * ru_start and ru_end are RU 26 indices
  1562. *
  1563. * ru_size is an HTT_PPDU_STATS_RU_SIZE, ru_index is a size
  1564. * specific index for the given ru_size.
  1565. */
  1566. union {
  1567. A_UINT32 ru_start__ru_end;
  1568. A_UINT32 ru_size__ru_index;
  1569. struct {
  1570. A_UINT32 ru_end: 16,
  1571. ru_start: 16;
  1572. };
  1573. struct {
  1574. A_UINT32 ru_index: 16,
  1575. ru_size: 16;
  1576. };
  1577. };
  1578. /* BIT [ 15 : 0] :- resp_ru_end or resp_ru_index
  1579. * BIT [ 31 : 16] :- resp_ru_start or resp_ru_size
  1580. *
  1581. * Discriminant is field ru_format:
  1582. * - ru_format = 0: resp_ru_end, resp_ru_start
  1583. * - ru_format = 1: resp_ru_index, resp_ru_size
  1584. * - ru_format = other: reserved for future expansion
  1585. *
  1586. * resp_ru_start and resp_ru_end are RU 26 indices
  1587. *
  1588. * resp_ru_size is an HTT_PPDU_STATS_RU_SIZE, resp_ru_index
  1589. * is a size specific index for the given ru_size.
  1590. */
  1591. union {
  1592. A_UINT32 resp_ru_start__ru_end;
  1593. A_UINT32 resp_ru_size__ru_index;
  1594. struct {
  1595. A_UINT32 resp_ru_end: 16,
  1596. resp_ru_start: 16;
  1597. };
  1598. struct {
  1599. A_UINT32 resp_ru_index: 16,
  1600. resp_ru_size: 16;
  1601. };
  1602. };
  1603. /* BIT [ 0 : 0 ] :- resp_type_valid
  1604. * BIT [ 5 : 1 ] :- ppdu_type - HTT_PPDU_STAT_PPDU_TYPE
  1605. * BIT [ 31: 6 ] :- reserved2
  1606. */
  1607. union {
  1608. A_UINT32 resp_type_vld_ppdu_type;
  1609. struct {
  1610. A_UINT32 resp_type_vld: 1,
  1611. ppdu_type: 5,
  1612. reserved2: 26;
  1613. };
  1614. };
  1615. /* BIT [ 1 : 0 ] :- ltf_size
  1616. * BIT [ 2 : 2 ] :- stbc
  1617. * BIT [ 3 : 3 ] :- he_re (range extension)
  1618. * BIT [ 7 : 4 ] :- txbf
  1619. * BIT [ 11: 8 ] :- bw
  1620. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  1621. * BIT [ 19: 16] :- mcs
  1622. * BIT [ 23: 20] :- preamble
  1623. * BIT [ 27: 24] :- gi - HTT_PPDU_STATS_GI
  1624. * BIT [ 28: 28] :- dcm
  1625. * BIT [ 29: 29] :- ldpc
  1626. * BIT [ 30: 30] :- valid_skipped_rate_ctrl
  1627. * This flag indicates whether the skipped_rate_ctrl
  1628. * flag should be ignored, or if it holds valid data.
  1629. * BIT [ 31: 31] :- skipped_rate_ctrl
  1630. */
  1631. union {
  1632. A_UINT32 rate_info;
  1633. struct {
  1634. A_UINT32 ltf_size: 2,
  1635. stbc: 1,
  1636. he_re: 1,
  1637. txbf: 4,
  1638. bw: 4,
  1639. nss: 4,
  1640. mcs: 4,
  1641. preamble: 4,
  1642. gi: 4,
  1643. dcm: 1,
  1644. ldpc: 1,
  1645. valid_skipped_rate_ctrl: 1,
  1646. skipped_rate_ctrl: 1;
  1647. };
  1648. };
  1649. /* Note: resp_rate_info is only valid for if resp_type is UL
  1650. * BIT [ 1 : 0 ] :- ltf_size
  1651. * BIT [ 2 : 2 ] :- stbc
  1652. * BIT [ 3 : 3 ] :- he_re (range extension)
  1653. * BIT [ 7 : 4 ] :- reserved3
  1654. * BIT [ 11: 8 ] :- bw
  1655. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  1656. * BIT [ 19: 16] :- mcs
  1657. * BIT [ 23: 20] :- preamble
  1658. * BIT [ 27: 24] :- gi
  1659. * BIT [ 28: 28] :- dcm
  1660. * BIT [ 29: 29] :- ldpc
  1661. * BIT [ 31: 30] :- resp_ppdu_type - HTT_PPDU_STATS_RESP_PPDU_TYPE
  1662. */
  1663. union {
  1664. A_UINT32 resp_rate_info;
  1665. struct {
  1666. A_UINT32 resp_ltf_size: 2,
  1667. resp_stbc: 1,
  1668. resp_he_re: 1,
  1669. reserved3: 4,
  1670. resp_bw: 4,
  1671. resp_nss: 4,
  1672. resp_mcs: 4,
  1673. resp_preamble: 4,
  1674. resp_gi: 4,
  1675. resp_dcm: 1,
  1676. resp_ldpc: 1,
  1677. resp_ppdu_type: 2;
  1678. };
  1679. };
  1680. /*
  1681. * BIT [15:0] :- Punctured BW bitmap pattern to indicate which BWs are
  1682. * punctured.
  1683. * BIT 16 :- flag showing whether EHT extra LTF is applied
  1684. * for current PPDU
  1685. */
  1686. A_UINT32 punc_pattern_bitmap: 16,
  1687. extra_eht_ltf: 1,
  1688. reserved4: 15;
  1689. } htt_ppdu_stats_user_rate_tlv;
  1690. #define HTT_PPDU_STATS_USR_RATE_VALID_M 0x80000000
  1691. #define HTT_PPDU_STATS_USR_RATE_VALID_S 31
  1692. #define HTT_PPDU_STATS_USR_RATE_VALID_GET(_val) \
  1693. (((_val) & HTT_PPDU_STATS_USR_RATE_VALID_M) >> \
  1694. HTT_PPDU_STATS_USR_RATE_VALID_S)
  1695. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_M 0x000000ff
  1696. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S 0
  1697. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_GET(_var) \
  1698. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  1699. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)
  1700. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  1701. do { \
  1702. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM, _val); \
  1703. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)); \
  1704. } while (0)
  1705. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_M 0x0000ff00
  1706. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_S 8
  1707. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  1708. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S 16
  1709. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  1710. (((_var) & HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M) >> \
  1711. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)
  1712. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  1713. do { \
  1714. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID, _val); \
  1715. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)); \
  1716. } while (0)
  1717. typedef struct {
  1718. htt_tlv_hdr_t tlv_hdr;
  1719. /* BIT [ 7 : 0] :- tid_num
  1720. * BIT [ 15: 8] :- reserved0
  1721. * BIT [ 31: 16] :- sw_peer_id
  1722. */
  1723. union {
  1724. A_UINT32 sw_peer_id__tid_num;
  1725. struct {
  1726. A_UINT32 tid_num: 8,
  1727. reserved0: 8,
  1728. sw_peer_id: 16;
  1729. };
  1730. };
  1731. A_UINT32 start_seq;
  1732. A_UINT32 enq_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  1733. } htt_ppdu_stats_enq_mpdu_bitmap_64_tlv;
  1734. typedef struct {
  1735. htt_tlv_hdr_t tlv_hdr;
  1736. /* BIT [ 7 : 0] :- tid_num
  1737. * BIT [ 15: 8] :- reserved0
  1738. * BIT [ 31: 16] :- sw_peer_id
  1739. */
  1740. union {
  1741. A_UINT32 sw_peer_id__tid_num;
  1742. struct {
  1743. A_UINT32 tid_num: 8,
  1744. reserved0: 8,
  1745. sw_peer_id: 16;
  1746. };
  1747. };
  1748. A_UINT32 start_seq;
  1749. A_UINT32 enq_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  1750. } htt_ppdu_stats_enq_mpdu_bitmap_256_tlv;
  1751. typedef struct {
  1752. htt_tlv_hdr_t tlv_hdr;
  1753. /* BIT [ 7 : 0] :- tid_num
  1754. * BIT [ 15: 8] :- reserved0
  1755. * BIT [ 31: 16] :- sw_peer_id
  1756. */
  1757. union {
  1758. A_UINT32 sw_peer_id__tid_num;
  1759. struct {
  1760. A_UINT32 tid_num: 8,
  1761. reserved0: 8,
  1762. sw_peer_id: 16;
  1763. };
  1764. };
  1765. A_UINT32 start_seq;
  1766. A_UINT32 enq_bitmap[HTT_BA_1024_BIT_MAP_SIZE_DWORDS];
  1767. } htt_ppdu_stats_enq_mpdu_bitmap_1024_tlv;
  1768. /* COMPLETION_STATUS defined in HTT_PPDU_STATS_USER_COMPLETION_STATUS */
  1769. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M 0x000000ff
  1770. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S 0
  1771. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_GET(_var) \
  1772. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M) >> \
  1773. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)
  1774. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_SET(_var, _val) \
  1775. do { \
  1776. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS, _val); \
  1777. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)); \
  1778. } while (0)
  1779. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M 0x0000ff00
  1780. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S 8
  1781. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_GET(_var) \
  1782. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M) >> \
  1783. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)
  1784. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_SET(_var, _val) \
  1785. do { \
  1786. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM, _val); \
  1787. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)); \
  1788. } while (0)
  1789. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  1790. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S 16
  1791. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_GET(_var) \
  1792. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M) >> \
  1793. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)
  1794. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  1795. do { \
  1796. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID, _val); \
  1797. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)); \
  1798. } while (0)
  1799. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M 0x0000ffff
  1800. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S 0
  1801. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_GET(_var) \
  1802. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M) >> \
  1803. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)
  1804. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_SET(_var, _val) \
  1805. do { \
  1806. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED, _val); \
  1807. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)); \
  1808. } while (0)
  1809. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M 0xffff0000
  1810. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S 16
  1811. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_GET(_var) \
  1812. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M) >> \
  1813. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)
  1814. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_SET(_var, _val) \
  1815. do { \
  1816. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS, _val); \
  1817. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)); \
  1818. } while (0)
  1819. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M 0x0000000f
  1820. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S 0
  1821. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_GET(_var) \
  1822. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M) >> \
  1823. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)
  1824. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_SET(_var, _val) \
  1825. do { \
  1826. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY, _val); \
  1827. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)); \
  1828. } while (0)
  1829. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M 0x000000f0
  1830. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S 4
  1831. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_GET(_var) \
  1832. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M) >> \
  1833. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)
  1834. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_SET(_var, _val) \
  1835. do { \
  1836. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY, _val); \
  1837. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)); \
  1838. } while (0)
  1839. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M 0x00000100
  1840. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S 8
  1841. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_GET(_var) \
  1842. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M) >> \
  1843. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)
  1844. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU, _val); \
  1847. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)); \
  1848. } while (0)
  1849. enum HTT_PPDU_STATS_RESP_TYPE {
  1850. HTT_PPDU_STATS_NO_RESPONSE_EXPECTED_E = 0,
  1851. HTT_PPDU_STATS_ACK_EXPECTED_E = 1,
  1852. HTT_PPDU_STATS_BA_BITMAP_EXPECTED_E = 2,
  1853. HTT_PPDU_STATS_UL_MU_BA_EXPECTED_E = 3,
  1854. HTT_PPDU_STATS_UL_MU_BA_AND_DATA_EXPECTED_E = 4,
  1855. HTT_PPDU_STATS_CTS_EXPECTED_E = 5,
  1856. HTT_PPDU_STATS_MU_CBF_EXPECTED_E = 6,
  1857. };
  1858. typedef enum HTT_PPDU_STATS_RESP_TYPE HTT_PPDU_STATS_RESP_TYPE;
  1859. /* Refer HTT_PPDU_STATS_RESP_TYPE */
  1860. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M 0x00001e00
  1861. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S 9
  1862. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_GET(_var) \
  1863. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M) >> \
  1864. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)
  1865. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_SET(_var, _val) \
  1866. do { \
  1867. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE, _val); \
  1868. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)); \
  1869. } while (0)
  1870. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_M 0x0000e000
  1871. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S 13
  1872. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_GET(_var) \
  1873. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_M) >> \
  1874. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S)
  1875. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_SET (_var , _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE, _val); \
  1878. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPROT_TYPE_S)); \
  1879. } while (0)
  1880. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_M 0x00010000
  1881. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S 16
  1882. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_GET(_var) \
  1883. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_M) >> \
  1884. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S)
  1885. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_SET (_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS, _val); \
  1888. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_SUCCESS_S)); \
  1889. } while (0)
  1890. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_M 0x00020000
  1891. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S 17
  1892. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_GET(_var) \
  1893. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_M) >> \
  1894. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S)
  1895. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_SET (_var , _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE, _val); \
  1898. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RTS_FAILURE_S)); \
  1899. } while (0)
  1900. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M 0x00040000
  1901. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S 18
  1902. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_GET(_var) \
  1903. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_M) >> \
  1904. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S)
  1905. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_SET (_var , _val) \
  1906. do { \
  1907. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX, _val); \
  1908. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PREAM_PUNC_TX_S)); \
  1909. } while (0)
  1910. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_M 0xffffffff
  1911. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S 0
  1912. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_GET(_var) \
  1913. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_M) >> \
  1914. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S)
  1915. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI, _val); \
  1918. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CHAIN_RSSI_S)); \
  1919. } while (0)
  1920. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_M 0xffffffff
  1921. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S 0
  1922. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_GET(_var) \
  1923. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_M) >> \
  1924. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S)
  1925. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK, _val); \
  1928. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TX_ANTENNA_MASK_S)); \
  1929. } while (0)
  1930. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_M 0x00010000
  1931. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S 16
  1932. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_GET(_var) \
  1933. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_M) >> \
  1934. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S)
  1935. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING, _val); \
  1938. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_TRAINING_S)); \
  1939. } while (0)
  1940. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_M 0x0000ffff
  1941. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S 0
  1942. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_GET(_var) \
  1943. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_M) >> \
  1944. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S)
  1945. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_SET(_var, _val) \
  1946. do { \
  1947. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS, _val); \
  1948. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_PENDING_TRAINING_PKTS_S)); \
  1949. } while (0)
  1950. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_M 0xffffffff
  1951. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S 0
  1952. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_GET(_var) \
  1953. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_M) >> \
  1954. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S)
  1955. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_SET(_var, _val) \
  1956. do { \
  1957. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES, _val); \
  1958. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_S)); \
  1959. } while (0)
  1960. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_M 0xffffffff
  1961. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S 0
  1962. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_GET(_var) \
  1963. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_M) >> \
  1964. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S)
  1965. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER, _val); \
  1968. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_S)); \
  1969. } while (0)
  1970. enum HTT_PPDU_STATS_USER_COMPLETION_STATUS {
  1971. HTT_PPDU_STATS_USER_STATUS_OK,
  1972. HTT_PPDU_STATS_USER_STATUS_FILTERED,
  1973. HTT_PPDU_STATS_USER_STATUS_RESP_TIMEOUT,
  1974. HTT_PPDU_STATS_USER_STATUS_RESP_MISMATCH,
  1975. HTT_PPDU_STATS_USER_STATUS_ABORT,
  1976. };
  1977. typedef enum HTT_PPDU_STATS_USER_COMPLETION_STATUS HTT_PPDU_STATS_USER_COMPLETION_STATUS;
  1978. typedef struct {
  1979. htt_tlv_hdr_t tlv_hdr;
  1980. /* BIT [ 7 : 0] :- completion_status
  1981. * BIT [ 15: 8] :- tid_num
  1982. * BIT [ 31: 16] :- sw_peer_id
  1983. */
  1984. union {
  1985. A_UINT32 sw_peer_id__tid_num__completion_status;
  1986. struct {
  1987. A_UINT32 completion_status: 8,
  1988. tid_num: 8,
  1989. sw_peer_id: 16;
  1990. };
  1991. };
  1992. /* RSSI value of last ack packet (units = dB above noise floor) */
  1993. A_UINT32 ack_rssi;
  1994. /* BIT [ 15 : 0] :- mpdu_tried
  1995. * BIT [ 31 : 16] :- mpdu_success
  1996. */
  1997. union {
  1998. A_UINT32 mpdu_tried__mpdu_success;
  1999. struct {
  2000. A_UINT32 mpdu_tried: 16,
  2001. mpdu_success: 16;
  2002. };
  2003. };
  2004. /* BIT [ 3 : 0] :- long_retries
  2005. * BIT [ 7 : 4] :- short_retries
  2006. * BIT [ 8 : 8] :- is_ampdu
  2007. * BIT [ 12: 9] :- resp_type
  2008. * BIT [ 15: 13] :- medium protection type
  2009. * BIT [ 16: 16] :- rts_success (HW RTS)
  2010. * BIT [ 17: 17] :- rts_failure (HW RTS)
  2011. * BIT [ 18: 18] :- pream_punc_tx
  2012. * BIT [ 31: 19] :- reserved
  2013. */
  2014. union {
  2015. /* older names */
  2016. A_UINT32 resp_type_is_ampdu__short_retry__long_retry;
  2017. A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure;
  2018. /* newest name */
  2019. A_UINT32 resp_type__is_ampdu__short_retry__long_retry__mprot_type__rts_success__rts_failure__pream_punc_tx;
  2020. struct { /* bitfield names */
  2021. A_UINT32 long_retries: 4,
  2022. short_retries: 4,
  2023. is_ampdu: 1,
  2024. resp_type: 4,
  2025. mprot_type: 3,
  2026. rts_success: 1,
  2027. rts_failure: 1,
  2028. pream_punc_tx: 1,
  2029. reserved0: 13;
  2030. };
  2031. };
  2032. /*
  2033. * ack RSSI per chain for last transmission to the peer-TID
  2034. * (value in dB w.r.t noise floor)
  2035. */
  2036. A_UINT32 chain_rssi[HTT_STATS_MAX_CHAINS];
  2037. /* Tx Antenna mask for last packet transmission */
  2038. A_UINT32 tx_antenna_mask;
  2039. /* For SmartAntenna
  2040. * BIT [15:0] :- pending_training_pkts
  2041. * Holds number of pending training packets during training.
  2042. * BIT [16] :- is_training
  2043. * This flag indicates if peer is under training.
  2044. * BIT [31:17] :- reserved1
  2045. */
  2046. A_UINT32 pending_training_pkts:16,
  2047. is_training:1,
  2048. reserved1:15;
  2049. /*
  2050. * Max rates configured per BW:
  2051. * for BW supported by Smart Antenna - 20MHZ, 40MHZ, 80MHZ and 160MHZ
  2052. * (Note: 160 MHz is currently not supported by Smart Antenna)
  2053. */
  2054. A_UINT32 max_rates[HTT_STATS_NUM_SUPPORTED_BW_SMART_ANTENNA];
  2055. /* PER of the last transmission to the peer-TID (in percent) */
  2056. A_UINT32 current_rate_per;
  2057. /*
  2058. * For SW RTS
  2059. * BIT [0] :- Whether SW RTS successfully sent OTA.
  2060. * BIT [1] :- Whether SW RTS successful completion.
  2061. * BIT [2] :- Whether SW RTS failed completion.
  2062. * BIT [3] :- Whether SW RTS response with different BW.
  2063. * BIT [31:4] :- reserved2
  2064. */
  2065. A_UINT32 sw_rts_tried: 1,
  2066. sw_rts_success: 1,
  2067. sw_rts_failure: 1,
  2068. cts_rcvd_diff_bw: 1,
  2069. reserved2: 28;
  2070. /*
  2071. * Max rates configured per BW:
  2072. * for BW supported by Smart Antenna - 320 MHZ
  2073. */
  2074. A_UINT32 max_rates_ext;
  2075. } htt_ppdu_stats_user_cmpltn_common_tlv;
  2076. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_M 0x000000ff
  2077. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S 0
  2078. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_GET(_var) \
  2079. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  2080. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)
  2081. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM, _val); \
  2084. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)); \
  2085. } while (0)
  2086. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_M 0x0000ff00
  2087. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_S 8
  2088. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  2089. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S 16
  2090. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  2091. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M) >> \
  2092. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)
  2093. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID, _val); \
  2096. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)); \
  2097. } while (0)
  2098. typedef struct {
  2099. htt_tlv_hdr_t tlv_hdr;
  2100. /* BIT [ 7 : 0] :- tid_num
  2101. * BIT [ 15: 8] :- reserved0
  2102. * BIT [ 31: 16] :- sw_peer_id
  2103. */
  2104. union {
  2105. A_UINT32 sw_peer_id__tid_num;
  2106. struct {
  2107. A_UINT32 tid_num: 8,
  2108. reserved0: 8,
  2109. sw_peer_id: 16;
  2110. };
  2111. };
  2112. A_UINT32 ba_seq_no;
  2113. A_UINT32 ba_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  2114. } htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv;
  2115. typedef struct {
  2116. htt_tlv_hdr_t tlv_hdr;
  2117. /* BIT [ 7 : 0] :- tid_num
  2118. * BIT [ 15: 8] :- reserved0
  2119. * BIT [ 31: 16] :- sw_peer_id
  2120. */
  2121. union {
  2122. A_UINT32 sw_peer_id__tid_num;
  2123. struct {
  2124. A_UINT32 tid_num: 8,
  2125. reserved0: 8,
  2126. sw_peer_id: 16;
  2127. };
  2128. };
  2129. A_UINT32 ba_seq_no;
  2130. A_UINT32 ba_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  2131. } htt_ppdu_stats_user_compltn_ba_bitmap_256_tlv;
  2132. typedef struct {
  2133. htt_tlv_hdr_t tlv_hdr;
  2134. /* BIT [ 7 : 0] :- tid_num
  2135. * BIT [ 15: 8] :- reserved0
  2136. * BIT [ 31: 16] :- sw_peer_id
  2137. */
  2138. union {
  2139. A_UINT32 sw_peer_id__tid_num;
  2140. struct {
  2141. A_UINT32 tid_num: 8,
  2142. reserved0: 8,
  2143. sw_peer_id: 16;
  2144. };
  2145. };
  2146. A_UINT32 ba_seq_no;
  2147. A_UINT32 ba_bitmap[HTT_BA_1024_BIT_MAP_SIZE_DWORDS];
  2148. } htt_ppdu_stats_user_compltn_ba_bitmap_1024_tlv;
  2149. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M 0x0000ffff
  2150. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S 0
  2151. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_GET(_var) \
  2152. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M) >> \
  2153. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)
  2154. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID, _val); \
  2157. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)); \
  2158. } while (0)
  2159. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M 0x000001ff
  2160. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S 0
  2161. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_GET(_var) \
  2162. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M) >> \
  2163. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)
  2164. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_SET(_var, _val) \
  2165. do { \
  2166. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU, _val); \
  2167. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)); \
  2168. } while (0)
  2169. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M 0x01fffe00
  2170. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S 9
  2171. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_GET(_var) \
  2172. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M) >> \
  2173. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)
  2174. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU, _val); \
  2177. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)); \
  2178. } while (0)
  2179. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M 0xfe000000
  2180. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S 25
  2181. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_GET(_var) \
  2182. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M) >> \
  2183. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)
  2184. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM, _val); \
  2187. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)); \
  2188. } while (0)
  2189. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M 0x0000ffff
  2190. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S 0
  2191. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_GET(_var) \
  2192. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M) >> \
  2193. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)
  2194. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_SET(_var, _val) \
  2195. do { \
  2196. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ, _val); \
  2197. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)); \
  2198. } while (0)
  2199. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M 0xffff0000
  2200. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S 16
  2201. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_GET(_var) \
  2202. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M) >> \
  2203. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)
  2204. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_SET(_var, _val) \
  2205. do { \
  2206. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ, _val); \
  2207. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)); \
  2208. } while (0)
  2209. typedef struct {
  2210. htt_tlv_hdr_t tlv_hdr;
  2211. A_UINT32 ppdu_id;
  2212. /* BIT [ 15 : 0] :- sw_peer_id
  2213. * BIT [ 31 : 16] :- reserved0
  2214. */
  2215. union {
  2216. A_UINT32 rsvd_sw_peer_id;
  2217. struct {
  2218. A_UINT32 sw_peer_id: 16,
  2219. reserved0: 16;
  2220. };
  2221. };
  2222. /* BIT [ 8 : 0] :- num_mpdu
  2223. * BIT [ 24 : 9] :- num_msdu
  2224. * BIT [ 31 : 25] :- tid_num
  2225. */
  2226. union {
  2227. A_UINT32 tid_num__num_msdu__num_mpdu;
  2228. struct {
  2229. A_UINT32 num_mpdu: 9,
  2230. num_msdu: 16,
  2231. tid_num: 7;
  2232. };
  2233. };
  2234. /* BIT [ 15 : 0] :- current_seq
  2235. * BIT [ 31 : 16] :- start_seq
  2236. */
  2237. union {
  2238. A_UINT32 start_seq__current_seq;
  2239. struct {
  2240. A_UINT32 current_seq: 16,
  2241. start_seq: 16;
  2242. };
  2243. };
  2244. A_UINT32 success_bytes;
  2245. } htt_ppdu_stats_user_compltn_ack_ba_status_tlv;
  2246. /* FLOW_TYPE defined in HTT_TX_FLOW_TYPE */
  2247. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M 0x000000ff
  2248. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S 0
  2249. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_GET(_var) \
  2250. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M) >> \
  2251. HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)
  2252. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_SET(_var, _val) \
  2253. do { \
  2254. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE, _val); \
  2255. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)); \
  2256. } while (0)
  2257. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M 0x0001ff00
  2258. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S 8
  2259. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_GET(_var) \
  2260. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M) >> \
  2261. HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)
  2262. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU, _val); \
  2265. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)); \
  2266. } while (0)
  2267. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M 0x7ffe0000
  2268. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S 17
  2269. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_GET(_var) \
  2270. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M) >> \
  2271. HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)
  2272. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU, _val); \
  2275. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)); \
  2276. } while (0)
  2277. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M 0x000000ff
  2278. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S 0
  2279. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_GET(_var) \
  2280. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M) >> \
  2281. HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)
  2282. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_TID_NUM, _val); \
  2285. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)); \
  2286. } while (0)
  2287. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M 0x0000ff00
  2288. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S 8
  2289. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_GET(_var) \
  2290. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M) >> \
  2291. HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)
  2292. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_SET(_var, _val) \
  2293. do { \
  2294. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE, _val); \
  2295. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)); \
  2296. } while (0)
  2297. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M 0xffff0000
  2298. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S 16
  2299. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_GET(_var) \
  2300. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M) >> \
  2301. HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)
  2302. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_SET(_var, _val) \
  2303. do { \
  2304. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID, _val); \
  2305. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)); \
  2306. } while (0)
  2307. enum HTT_TX_FLOW_TYPE {
  2308. HTT_TX_TID_FRAMEQ,
  2309. HTT_TX_TQM_MSDUQ,
  2310. HTT_TQM_MPDUQ,
  2311. };
  2312. enum HTT_FLUSH_STATUS_DROP_REASON {
  2313. HTT_FLUSH_PEER_DELETE,
  2314. HTT_FLUSH_TID_DELETE,
  2315. HTT_FLUSH_TTL_EXCEEDED,
  2316. HTT_FLUSH_EXCESS_RETRIES,
  2317. HTT_FLUSH_REINJECT,
  2318. };
  2319. typedef struct {
  2320. htt_tlv_hdr_t tlv_hdr;
  2321. A_UINT32 drop_reason;
  2322. /* BIT [ 7 : 0] :- flow_type
  2323. * BIT [ 16: 8] :- num_mpdu
  2324. * BIT [ 30: 17] :- num_msdu
  2325. * BIT [ 31: 31] :- reserved0
  2326. */
  2327. union {
  2328. A_UINT32 num_msdu__num_mpdu__flow_type;
  2329. struct {
  2330. A_UINT32 flow_type: 8,
  2331. num_mpdu: 9,
  2332. num_msdu: 14,
  2333. reserved0: 1;
  2334. };
  2335. };
  2336. /* BIT [ 7 : 0] :- tid_num
  2337. * BIT [ 15 : 8] :- queue_type
  2338. * BIT [ 31 : 16] :- sw_peer_id
  2339. */
  2340. union {
  2341. A_UINT32 sw_peer_id__queue_type__tid_num;
  2342. struct {
  2343. A_UINT32 tid_num: 8,
  2344. queue_type: 8,
  2345. sw_peer_id: 16;
  2346. };
  2347. };
  2348. } htt_ppdu_stats_flush_tlv;
  2349. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_M 0x0000ffff
  2350. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S 0
  2351. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_GET(_var) \
  2352. (((_var) & HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_M) >> \
  2353. HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S)
  2354. #define HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH, _val); \
  2357. ((_var) |= ((_val) << HTT_PPDU_STATS_TX_MGMTCTRL_TLV_FRAME_LENGTH_S)); \
  2358. } while (0)
  2359. typedef struct {
  2360. htt_tlv_hdr_t tlv_hdr;
  2361. /*
  2362. * BIT [ 15 : 0] :- frame_length
  2363. * BIT [ 31 : 16] :- reserved1
  2364. */
  2365. union {
  2366. A_UINT32 rsvd__frame_length;
  2367. struct {
  2368. A_UINT32 frame_length: 16,
  2369. reserved1: 16; /* set to 0x0 */
  2370. };
  2371. };
  2372. /* Future purpose */
  2373. A_UINT32 reserved2; /* set to 0x0 */
  2374. A_UINT32 reserved3; /* set to 0x0 */
  2375. /* mgmt/ctrl frame payload
  2376. * The size of the actual mgmt payload (in bytes) can be obtained from
  2377. * the frame_length field.
  2378. * The size of entire payload including the padding for alignment
  2379. * (in bytes) can be derived from the length in tlv parameters,
  2380. * minus the 12 bytes of the above fields.
  2381. */
  2382. A_UINT32 payload[1];
  2383. } htt_ppdu_stats_tx_mgmtctrl_payload_tlv;
  2384. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_M 0x0000ffff
  2385. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S 0
  2386. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_GET(_var) \
  2387. (((_var) & HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_M) >> \
  2388. HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S)
  2389. #define HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_SET(_var, _val) \
  2390. do { \
  2391. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH, _val); \
  2392. ((_var) |= ((_val) << HTT_PPDU_STATS_RX_MGMTCTRL_TLV_FRAME_LENGTH_S)); \
  2393. } while (0)
  2394. typedef struct {
  2395. htt_tlv_hdr_t tlv_hdr;
  2396. /*
  2397. * BIT [ 15 : 0] :- frame_length (in bytes)
  2398. * BIT [ 31 : 16] :- reserved1
  2399. */
  2400. union {
  2401. A_UINT32 rsvd__frame_length;
  2402. struct {
  2403. A_UINT32 frame_length: 16,
  2404. reserved1: 16; /* set to 0x0 */
  2405. };
  2406. };
  2407. /* Future purpose */
  2408. A_UINT32 reserved2; /* set to 0x0 */
  2409. A_UINT32 reserved3; /* set to 0x0 */
  2410. /* mgmt/ctrl frame payload
  2411. * The size of the actual mgmt payload (in bytes) can be obtained from
  2412. * the frame_length field.
  2413. * The size of entire payload including the padding for alignment
  2414. * (in bytes) can be derived from the length in tlv parameters,
  2415. * minus the 12 bytes of the above fields.
  2416. */
  2417. A_UINT32 payload[1];
  2418. } htt_ppdu_stats_rx_mgmtctrl_payload_tlv;
  2419. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_M 0x000000ff
  2420. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S 0
  2421. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_GET(_var) \
  2422. (((_var) & HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_M) >> \
  2423. HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S)
  2424. #define HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS, _val); \
  2427. ((_var) |= ((_val) << HTT_PPDU_STATS_USERS_INFO_TLV_MAX_USERS_S)); \
  2428. } while (0)
  2429. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_M 0x0000ff00
  2430. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S 8
  2431. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_GET(_var) \
  2432. (((_var) & HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_M) >> \
  2433. HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S)
  2434. #define HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_SET(_var, _val) \
  2435. do { \
  2436. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE, _val); \
  2437. ((_var) |= ((_val) << HTT_PPDU_STATS_USERS_INFO_TLV_FRAME_TYPE_S)); \
  2438. } while (0)
  2439. typedef struct {
  2440. htt_tlv_hdr_t tlv_hdr;
  2441. /*
  2442. * BIT [ 7 : 0] :- max_users
  2443. * BIT [ 15 : 8] :- frame_type (HTT_STATS_FTYPE)
  2444. * BIT [ 31 : 16] :- reserved1
  2445. */
  2446. union {
  2447. A_UINT32 rsvd__frame_type__max_users;
  2448. struct {
  2449. A_UINT32 max_users: 8,
  2450. frame_type: 8,
  2451. reserved1: 16;
  2452. };
  2453. };
  2454. } htt_ppdu_stats_users_info_tlv;
  2455. typedef struct {
  2456. htt_tlv_hdr_t tlv_hdr;
  2457. A_UINT32 ppdu_id;
  2458. A_UINT32 tid_num : 8,
  2459. reserved1 :24;
  2460. A_UINT32 start_seq :16, /* [15: 0] */
  2461. /* ba_enabled:
  2462. * To know if block ack established or not.
  2463. * If block ack is not enabled, start_seq represents
  2464. * the seq number of the current MPDU/PPDU.
  2465. */
  2466. ba_enabled : 1,
  2467. nss : 4,
  2468. /* win_size:
  2469. * Block ack window size in multiples of 32 bits.
  2470. * For example: For a 64-bit block ack, win_size will be 2.
  2471. */
  2472. win_size : 8,
  2473. reserved2 : 3;
  2474. /* The number of elements in the ba_bitmap array depends on win_size. */
  2475. A_UINT32 ba_bitmap[1];
  2476. } htt_ppdu_stats_for_smu_tlv;
  2477. typedef struct {
  2478. htt_tlv_hdr_t tlv_hdr;
  2479. /*
  2480. * BIT [ 2 : 0] :- response_reason
  2481. * BIT [ 6 : 3] :- mlo_change_t1_cts2self
  2482. * BIT [ 10 : 7] :- mlo_change_t1_ppdu
  2483. * BIT [ 14 : 11] :- mlo_change_t2_response
  2484. * BIT [ 18 : 15] :- mlo_change_t3_r2r
  2485. * BIT [ 19 : 19] :- partner_link_info_valid
  2486. * BIT [ 22 : 20] :- partner_link_id
  2487. * BIT [ 27 : 23] :- partner_link_cmd_ring_id
  2488. * BIT [ 28 : 28] :- dot11ax_trigger_frame_embedded
  2489. * BIT [ 31 : 29] :- reserved_0a
  2490. */
  2491. A_UINT32 response_reason : 3,
  2492. mlo_change_t1_cts2self : 4,
  2493. mlo_change_t1_ppdu : 4,
  2494. mlo_change_t2_response : 4,
  2495. mlo_change_t3_r2r : 4,
  2496. partner_link_info_valid : 1,
  2497. partner_link_id : 3,
  2498. partner_link_cmd_ring_id : 5,
  2499. dot11ax_trigger_frame_embedded : 1,
  2500. reserved_0a : 3;
  2501. /*
  2502. * BIT [ 15 : 0] :- partner_link_schedule_id
  2503. * BIT [ 31 : 16] :- tx_rx_overlap_duration (microsecond units)
  2504. */
  2505. A_UINT32 partner_link_schedule_id : 16,
  2506. tx_rx_overlap_duration_us : 16;
  2507. /*
  2508. * BIT [ 15 : 0] :- cts2self_duration (microsecond units)
  2509. * BIT [ 31 : 16] :- ppdu_duration (microsecond units)
  2510. */
  2511. A_UINT32 cts2self_duration_us : 16,
  2512. ppdu_duration_us : 16;
  2513. /*
  2514. * BIT [ 15 : 0] :- response_duration (microsecond units)
  2515. * BIT [ 31 : 16] :- response_to_response_duration (microsecond units)
  2516. */
  2517. A_UINT32 response_duration_us : 16,
  2518. response_to_response_duration_us : 16;
  2519. /*
  2520. * BIT [ 15 : 0] :- self_link_schedule_id
  2521. * BIT [ 31 : 16] :- hls_branch_debug_code
  2522. */
  2523. A_UINT32 self_link_schedule_id : 16,
  2524. hls_branch_debug_code : 16;
  2525. /*
  2526. * BIT [ 31 : 0] :- hls_decision_debug_info
  2527. */
  2528. A_UINT32 hls_decision_debug_info : 32;
  2529. } htt_ppdu_stats_mlo_tx_resp_tlv;
  2530. typedef struct {
  2531. htt_tlv_hdr_t tlv_hdr;
  2532. /*
  2533. * BIT [ 2 : 0] :- notification_reason
  2534. * BIT [ 3 : 3] :- ml_decision
  2535. * BIT [ 4 : 4] :- cts2self_padding
  2536. * BIT [ 5 : 5] :- initiated_by_truncated_backoff
  2537. * BIT [ 8 : 6] :- transmit_start_reason
  2538. * BIT [ 14 : 9] :- num_users
  2539. * BIT [ 24 : 15] :- nstr_mlo_sta_id
  2540. * BIT [ 25 : 25] :- block_self_ml_sync
  2541. * BIT [ 26 : 26] :- block_partner_ml_sync
  2542. * BIT [ 27 : 27] :- nstr_mlo_sta_id_valid
  2543. * BIT [ 31 : 28] :- reserved_0a
  2544. */
  2545. A_UINT32 notification_reason : 3,
  2546. ml_decision : 1,
  2547. cts2self_padding : 1,
  2548. initiated_by_truncated_backoff : 1,
  2549. transmit_start_reason : 3,
  2550. num_users : 6,
  2551. nstr_mlo_sta_id : 10,
  2552. block_self_ml_sync : 1,
  2553. block_partner_ml_sync : 1,
  2554. nstr_mlo_sta_id_valid : 1,
  2555. reserved_0a : 4;
  2556. /*
  2557. * BIT [ 15 : 0] :- pdg_ppdu_duration_adjust_value (microsecond units)
  2558. * BIT [ 31 : 16] :- mlo_ppdu_duration_adjust_value (microsecond units)
  2559. */
  2560. A_UINT32 pdg_ppdu_duration_adjust_value_us : 16,
  2561. mlo_ppdu_duration_adjust_value_us : 16;
  2562. /*
  2563. * BIT [ 15 : 0] :- response_duration (microsecond units)
  2564. * BIT [ 31 : 16] :- response_to_response_duration (microsecond units)
  2565. */
  2566. A_UINT32 response_duration_us : 16,
  2567. response_to_response_duration_us : 16;
  2568. /*
  2569. * BIT [ 15 : 0] :- schedule_id
  2570. * BIT [ 20 : 16] :- cmd_ring_id
  2571. * BIT [ 31 : 21] :- reserved_1a
  2572. */
  2573. A_UINT32 schedule_id : 16,
  2574. cmd_ring_id : 5,
  2575. reserved_1a : 11;
  2576. /*
  2577. * BIT [ 31 : 0] :- mlo_reference_timestamp (microsecond units)
  2578. */
  2579. A_UINT32 mlo_reference_timestamp_us : 32;
  2580. /*
  2581. * BIT [ 15 : 0] :- cts2self_duration (microsecond units)
  2582. * BIT [ 31 : 16] :- ppdu_duration (microsecond units)
  2583. */
  2584. A_UINT32 cts2self_duration_us : 16,
  2585. ppdu_duration_us : 16;
  2586. } htt_ppdu_stats_mlo_tx_notification_tlv;
  2587. #endif //__HTT_PPDU_STATS_H__