cdp_txrx_stats_struct.h 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415
  1. /*
  2. * Copyright (c) 2016-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. * DOC: cdp_txrx_stats_struct.h
  21. * Define the host data path stats API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_STATS_STRUCT_H_
  25. #define _CDP_TXRX_STATS_STRUCT_H_
  26. #include <qdf_types.h>
  27. #include <cdp_txrx_hist_struct.h>
  28. #define TXRX_STATS_LEVEL_OFF 0
  29. #define TXRX_STATS_LEVEL_BASIC 1
  30. #define TXRX_STATS_LEVEL_FULL 2
  31. #define BSS_CHAN_INFO_READ 1
  32. #define BSS_CHAN_INFO_READ_AND_CLEAR 2
  33. #define TX_FRAME_TYPE_DATA 0
  34. #define TX_FRAME_TYPE_MGMT 1
  35. #define TX_FRAME_TYPE_BEACON 2
  36. #ifndef TXRX_STATS_LEVEL
  37. #define TXRX_STATS_LEVEL TXRX_STATS_LEVEL_BASIC
  38. #endif
  39. #define CDP_MU_MAX_USERS 37
  40. /* 1 additional MCS is for invalid values */
  41. #ifdef WLAN_FEATURE_11BE
  42. #define MAX_MCS (16 + 1)
  43. #define MAX_MCS_11BE 16
  44. #define MAX_PUNCTURED_MODE 5
  45. #else
  46. #define MAX_MCS (14 + 1)
  47. #endif
  48. #define MCS_INVALID_ARRAY_INDEX MAX_MCS
  49. #define MAX_MCS_11A 8
  50. #define MAX_MCS_11B 7
  51. #define MAX_MCS_11N 8
  52. #define MAX_MCS_11AC 12
  53. #define MAX_MCS_11AX 14
  54. /* 1 additional GI is for invalid values */
  55. #define MAX_GI (4 + 1)
  56. #define SS_COUNT 8
  57. #define MAX_BW 8
  58. #define MAX_RECEPTION_TYPES 4
  59. #define CDP_MAX_RX_DEST_RINGS 8
  60. #define CDP_MAX_TX_DATA_RINGS 5
  61. #define CDP_MAX_WIFI_INT_ERROR_REASONS 5
  62. /*
  63. * This header file is being accessed in userspace applications.
  64. * NR_CPUS is a linux kernel macro and cannot be accessible by user space apps.
  65. * Defining maximum possible cpu count locally.
  66. */
  67. #define CDP_NR_CPUS 8
  68. #define MAX_TRANSMIT_TYPES 9
  69. #define MAX_USER_POS 8
  70. #define MAX_MU_GROUP_ID 64
  71. #ifdef WLAN_FEATURE_11BE
  72. #define MAX_RU_LOCATIONS 16
  73. #else
  74. #define MAX_RU_LOCATIONS 6
  75. #endif
  76. #define RU_26 1
  77. #define RU_52 2
  78. #define RU_106 4
  79. #define RU_242 9
  80. #define RU_484 18
  81. #define RU_996 37
  82. #ifdef WLAN_FEATURE_11BE
  83. #define RU_2X996 74
  84. #define RU_3X996 111
  85. #define RU_4X996 148
  86. #define RU_52_26 RU_52 + RU_26
  87. #define RU_106_26 RU_106 + RU_26
  88. #define RU_484_242 RU_484 + RU_242
  89. #define RU_996_484 RU_996 + RU_484
  90. #define RU_996_484_242 RU_996 + RU_484_242
  91. #define RU_2X996_484 RU_2X996 + RU_484
  92. #define RU_3X996_484 RU_3X996 + RU_484
  93. #endif
  94. /* WME stream classes */
  95. #define WME_AC_BE 0 /* best effort */
  96. #define WME_AC_BK 1 /* background */
  97. #define WME_AC_VI 2 /* video */
  98. #define WME_AC_VO 3 /* voice */
  99. #define WME_AC_MAX 4 /* MAX AC Value */
  100. #define CDP_MAX_RX_RINGS 8 /* max rx rings */
  101. #define CDP_MAX_TX_COMP_RINGS 5 /* max tx/completion rings */
  102. #define CDP_MAX_TX_COMP_PPE_RING (CDP_MAX_TX_COMP_RINGS - 1)
  103. #define CDP_MAX_RX_WBM_RINGS 1 /* max rx wbm rings */
  104. #define CDP_MAX_TX_TQM_STATUS 9 /* max tx tqm completion status */
  105. #define CDP_MAX_TX_HTT_STATUS 7 /* max tx htt completion status */
  106. #define CDP_DMA_CODE_MAX 14 /* max rxdma error */
  107. #define CDP_REO_CODE_MAX 15 /* max reo error */
  108. #define CDP_MAX_LMACS 2 /* max lmacs */
  109. /*
  110. * Max of TxRx context
  111. */
  112. #define CDP_MAX_TXRX_CTX CDP_MAX_RX_RINGS
  113. /* TID level VoW stats macros
  114. * to add and get stats
  115. */
  116. #define PFLOW_TXRX_TIDQ_STATS_ADD(_peer, _tid, _var, _val) \
  117. (((_peer)->tidq_stats[_tid]).stats[_var]) += _val
  118. #define PFLOW_TXRX_TIDQ_STATS_GET(_peer, _tid, _var, _val) \
  119. ((_peer)->tidq_stats[_tid].stats[_var])
  120. /*
  121. * Video only stats
  122. */
  123. #define PFLOW_CTRL_PDEV_VIDEO_STATS_SET(_pdev, _var, _val) \
  124. (((_pdev)->vow.vistats[_var]).value) = _val
  125. #define PFLOW_CTRL_PDEV_VIDEO_STATS_GET(_pdev, _var) \
  126. ((_pdev)->vow.vistats[_var].value)
  127. #define PFLOW_CTRL_PDEV_VIDEO_STATS_ADD(_pdev, _var, _val) \
  128. (((_pdev)->vow.vistats[_var]).value) += _val
  129. /*
  130. * video delay stats
  131. */
  132. #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_SET(_pdev, _var, _val) \
  133. (((_pdev)->vow.delaystats[_var]).value) = _val
  134. #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_GET(_pdev, _var) \
  135. ((_pdev)->vow.delaystats[_var].value)
  136. #define PFLOW_CTRL_PDEV_DELAY_VIDEO_STATS_ADD(_pdev, _var, _val) \
  137. (((_pdev)->vow.delaystats[_var]).value) += _val
  138. /*
  139. * Number of TLVs sent by FW. Needs to reflect
  140. * HTT_PPDU_STATS_MAX_TAG declared in FW
  141. */
  142. #define CDP_PPDU_STATS_MAX_TAG 14
  143. #define CDP_MAX_DATA_TIDS 9
  144. #define CDP_MAX_VOW_TID 4
  145. #define CDP_VDEV_ALL 0xff
  146. #define CDP_MAX_TIDS 17
  147. #define CDP_MAX_PKT_PER_WIN 1000
  148. #define CDP_MAX_WIN_MOV_AVG 10
  149. #define CDP_WDI_NUM_EVENTS WDI_NUM_EVENTS
  150. #define CDP_FCTL_RETRY 0x0800
  151. #define CDP_FC_IS_RETRY_SET(_fc) \
  152. ((_fc) & qdf_cpu_to_le16(CDP_FCTL_RETRY))
  153. #define CDP_INVALID_SNR 255
  154. #define CDP_SNR_MULTIPLIER BIT(8)
  155. #define CDP_SNR_MUL(x, mul) ((x) * (mul))
  156. #define CDP_SNR_RND(x, mul) ((((x) % (mul)) >= ((mul) / 2)) ?\
  157. ((x) + ((mul) - 1)) / (mul) : (x) / (mul))
  158. #define CDP_SNR_OUT(x) (CDP_SNR_RND((x), CDP_SNR_MULTIPLIER))
  159. #define CDP_SNR_IN(x) (CDP_SNR_MUL((x), CDP_SNR_MULTIPLIER))
  160. #define CDP_SNR_AVG(x, y) ((((x) << 2) + (y) - (x)) >> 2)
  161. #define CDP_SNR_UPDATE_AVG(x, y) x = CDP_SNR_AVG((x), CDP_SNR_IN((y)))
  162. /*Max SU EVM count */
  163. #define DP_RX_MAX_SU_EVM_COUNT 32
  164. #define WDI_EVENT_BASE 0x100
  165. #define CDP_TXRX_RATECODE_MCS_MASK 0xF
  166. #define CDP_TXRX_RATECODE_NSS_MASK 0x3
  167. #define CDP_TXRX_RATECODE_NSS_LSB 4
  168. #define CDP_TXRX_RATECODE_PREM_MASK 0x3
  169. #define CDP_TXRX_RATECODE_PREM_LSB 6
  170. /* Below BW_GAIN should be added to the SNR value of every ppdu based on the
  171. * bandwidth. This table is obtained from HALPHY.
  172. * BW BW_Gain
  173. * 20 0
  174. * 40 3dBm
  175. * 80 6dBm
  176. * 160/80P80 9dBm
  177. * 320 12dBm
  178. */
  179. #define PKT_BW_GAIN_20MHZ 0
  180. #define PKT_BW_GAIN_40MHZ 3
  181. #define PKT_BW_GAIN_80MHZ 6
  182. #define PKT_BW_GAIN_160MHZ 9
  183. #ifdef WLAN_FEATURE_11BE
  184. #define PKT_BW_GAIN_320MHZ 12
  185. #endif
  186. /**
  187. * enum cdp_wifi_error_code - Code describing the type of WIFI error detected
  188. *
  189. * This enum is a direct replica of hal_rxdma_error_code enum.
  190. * New element addition to the enum need to make a entry in this enum too.
  191. *
  192. * @CDP_WIFI_ERR_OVERFLOW: MPDU frame is not complete due to overflow
  193. * @CDP_WIFI_ERR_MPDU_LENGTH: MPDU frame is not complete due to receiving
  194. * incomplete MPDU from the PHY
  195. * @CDP_WIFI_ERR_FCS: FCS check on the MPDU frame failed
  196. * @CDP_WIFI_ERR_DECRYPT: Decryption error
  197. * @CDP_WIFI_ERR_TKIP_MIC: TKIP MIC error
  198. * @CDP_WIFI_ERR_UNENCRYPTED: Received a frame that was expected to be
  199. * encrypted but wasn’t
  200. * @CDP_WIFI_ERR_MSDU_LEN: MSDU related length error
  201. * @CDP_WIFI_ERR_MSDU_LIMIT: Number of MSDUs in the MPDUs exceeded the max
  202. * allowed
  203. * @CDP_WIFI_ERR_WIFI_PARSE: Wifi parsing error
  204. * @CDP_WIFI_ERR_AMSDU_PARSE: Amsdu parsing error
  205. * @CDP_WIFI_ERR_SA_TIMEOUT: Source Address search timeout
  206. * @CDP_WIFI_ERR_DA_TIMEOUT: Destination Address search timeout
  207. * @CDP_WIFI_ERR_FLOW_TIMEOUT: Flow Search Timeout
  208. * @CDP_WIFI_ERR_FLUSH_REQUEST: Flush request error
  209. * @CDP_WIFI_ERR_AMSDU_FRAGMENT: Reported A-MSDU present along with a fragmented
  210. * MPDU
  211. * @CDP_WIFI_ERR_MULTICAST_ECHO: Reported a multicast echo error
  212. * @CDP_WIFI_ERR_DUMMY: Dummy errors
  213. * @CDP_WIFI_ERR_MAX: Maximum value
  214. */
  215. enum cdp_wifi_error_code {
  216. CDP_WIFI_ERR_OVERFLOW = 0,
  217. CDP_WIFI_ERR_MPDU_LENGTH,
  218. CDP_WIFI_ERR_FCS,
  219. CDP_WIFI_ERR_DECRYPT,
  220. CDP_WIFI_ERR_TKIP_MIC,
  221. CDP_WIFI_ERR_UNENCRYPTED,
  222. CDP_WIFI_ERR_MSDU_LEN,
  223. CDP_WIFI_ERR_MSDU_LIMIT,
  224. CDP_WIFI_ERR_WIFI_PARSE,
  225. CDP_WIFI_ERR_AMSDU_PARSE,
  226. CDP_WIFI_ERR_SA_TIMEOUT,
  227. CDP_WIFI_ERR_DA_TIMEOUT,
  228. CDP_WIFI_ERR_FLOW_TIMEOUT,
  229. CDP_WIFI_ERR_FLUSH_REQUEST,
  230. CDP_WIFI_ERR_AMSDU_FRAGMENT,
  231. CDP_WIFI_ERR_MULTICAST_ECHO,
  232. CDP_WIFI_ERR_DUMMY = 31,
  233. CDP_WIFI_ERR_MAX
  234. };
  235. /**
  236. * enum cdp_phy_rx_error_code - Error code describing the type of error detected
  237. *
  238. * This enum is a direct replica of hal_reo_error_code enum.
  239. * New element addition to the enum need to make a entry in this enum too.
  240. *
  241. * @CDP_RX_ERR_QUEUE_ADDR_0: Rx queue descriptor is set to 0
  242. * @CDP_RX_ERR_QUEUE_INVALID: Rx queue descriptor valid bit is NOT set
  243. * @CDP_RX_ERR_AMPDU_IN_NON_BA: AMPDU frame received without BA session having
  244. * been setup
  245. * @CDP_RX_ERR_NON_BA_DUPLICATE: Non-BA session, SN equal to SSN retry bit set
  246. * duplicate frame
  247. * @CDP_RX_ERR_BA_DUPLICATE: BA session, duplicate frame
  248. * @CDP_RX_ERR_REGULAR_FRAME_2K_JUMP: A normal management/data frame received
  249. * with 2K jump in SN
  250. * @CDP_RX_ERR_BAR_FRAME_2K_JUMP: A bar received with 2K jump in SSN
  251. * @CDP_RX_ERR_REGULAR_FRAME_OOR: A normal management/data frame received with
  252. * SN falling within the OOR window
  253. * @CDP_RX_ERR_BAR_FRAME_OOR: A bar received with SSN falling within the OOR
  254. * window
  255. * @CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION: A bar received without a BA session
  256. * @CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN: A bar received with SSN equal to SN
  257. * @CDP_RX_ERR_PN_CHECK_FAILED: PN Check Failed packet
  258. * @CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of
  259. * the Seq_2k_error_detected_flag been set in the REO Queue descriptor
  260. * @CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET: Frame is forwarded as a result of
  261. * the pn_error_detected_flag been set in the REO Queue descriptor
  262. * @CDP_RX_ERR_QUEUE_BLOCKED_SET: Frame is forwarded as a result of the queue
  263. * descriptor(address) being blocked as SW/FW seems to be currently in the
  264. * process of making updates to this descriptor
  265. * @CDP_RX_ERR_MAX: Maximum value
  266. */
  267. enum cdp_phy_rx_error_code {
  268. CDP_RX_ERR_QUEUE_ADDR_0 = 0,
  269. CDP_RX_ERR_QUEUE_INVALID,
  270. CDP_RX_ERR_AMPDU_IN_NON_BA,
  271. CDP_RX_ERR_NON_BA_DUPLICATE,
  272. CDP_RX_ERR_BA_DUPLICATE,
  273. CDP_RX_ERR_REGULAR_FRAME_2K_JUMP,
  274. CDP_RX_ERR_BAR_FRAME_2K_JUMP,
  275. CDP_RX_ERR_REGULAR_FRAME_OOR,
  276. CDP_RX_ERR_BAR_FRAME_OOR,
  277. CDP_RX_ERR_BAR_FRAME_NO_BA_SESSION,
  278. CDP_RX_ERR_BAR_FRAME_SN_EQUALS_SSN,
  279. CDP_RX_ERR_PN_CHECK_FAILED,
  280. CDP_RX_ERR_2K_ERROR_HANDLING_FLAG_SET,
  281. CDP_RX_ERR_PN_ERROR_HANDLING_FLAG_SET,
  282. CDP_RX_ERR_QUEUE_BLOCKED_SET,
  283. CDP_RX_ERR_MAX
  284. };
  285. /**
  286. * enum cdp_tx_transmit_type - Transmit type index
  287. * @SU: SU Transmit type index
  288. * @MU_MIMO: MU_MIMO Transmit type index
  289. * @MU_OFDMA: MU_OFDMA Transmit type index
  290. * @MU_MIMO_OFDMA: MU MIMO OFDMA Transmit type index
  291. */
  292. enum cdp_tx_transmit_type {
  293. SU = 0,
  294. MU_MIMO,
  295. MU_OFDMA,
  296. MU_MIMO_OFDMA,
  297. };
  298. /**
  299. * enum cdp_tx_mode_type - Uplink transmit mode type
  300. * @TX_MODE_TYPE_DL: DL TX mode
  301. * @TX_MODE_TYPE_UL: UL TX mode
  302. * @TX_MODE_TYPE_UNKNOWN: UL TX mode unknown
  303. */
  304. enum cdp_tx_mode_type {
  305. TX_MODE_TYPE_DL = 0,
  306. TX_MODE_TYPE_UL,
  307. TX_MODE_TYPE_UNKNOWN,
  308. };
  309. /**
  310. * enum cdp_tx_mode_dl - Downlink transmit mode index
  311. * @TX_MODE_DL_SU_DATA: SU Transmit type index
  312. * @TX_MODE_DL_OFDMA_DATA: OFDMA Transmit type index
  313. * @TX_MODE_DL_MUMIMO_DATA: MIMO Transmit type index
  314. * @TX_MODE_DL_MAX: Maximum value
  315. */
  316. enum cdp_tx_mode_dl {
  317. TX_MODE_DL_SU_DATA = 0,
  318. TX_MODE_DL_OFDMA_DATA,
  319. TX_MODE_DL_MUMIMO_DATA,
  320. TX_MODE_DL_MAX,
  321. };
  322. /**
  323. * enum cdp_tx_mode_ul - Uplink transmit mode index
  324. * @TX_MODE_UL_OFDMA_BASIC_TRIGGER_DATA: UL ofdma trigger index
  325. * @TX_MODE_UL_MUMIMO_BASIC_TRIGGER_DATA: UL mimo trigger index
  326. * @TX_MODE_UL_OFDMA_MU_BAR_TRIGGER: UL ofdma MU-BAR trigger index
  327. * @TX_MODE_UL_MAX: Maximum value
  328. */
  329. enum cdp_tx_mode_ul {
  330. TX_MODE_UL_OFDMA_BASIC_TRIGGER_DATA = 0,
  331. TX_MODE_UL_MUMIMO_BASIC_TRIGGER_DATA,
  332. TX_MODE_UL_OFDMA_MU_BAR_TRIGGER,
  333. TX_MODE_UL_MAX,
  334. };
  335. /**
  336. * enum cdp_msduq_index - TX msdu queue
  337. * @MSDUQ_INDEX_DEFAULT: TCP/UDP msduq index
  338. * @MSDUQ_INDEX_CUSTOM_PRIO_0: custom priority msduq index
  339. * @MSDUQ_INDEX_CUSTOM_PRIO_1: custom priority msduq index
  340. * @MSDUQ_INDEX_CUSTOM_EXT_PRIO_0: custom ext priority msduq index
  341. * @MSDUQ_INDEX_CUSTOM_EXT_PRIO_1: custom ext priority msduq index
  342. * @MSDUQ_INDEX_CUSTOM_EXT_PRIO_2: custom ext priority msduq index
  343. * @MSDUQ_INDEX_CUSTOM_EXT_PRIO_3: custom ext priority msduq index
  344. * @MSDUQ_INDEX_MAX: Maximum value
  345. */
  346. enum cdp_msduq_index {
  347. MSDUQ_INDEX_DEFAULT = 0,
  348. MSDUQ_INDEX_CUSTOM_PRIO_0,
  349. MSDUQ_INDEX_CUSTOM_PRIO_1,
  350. MSDUQ_INDEX_CUSTOM_EXT_PRIO_0,
  351. MSDUQ_INDEX_CUSTOM_EXT_PRIO_1,
  352. MSDUQ_INDEX_CUSTOM_EXT_PRIO_2,
  353. MSDUQ_INDEX_CUSTOM_EXT_PRIO_3,
  354. MSDUQ_INDEX_MAX,
  355. };
  356. /**
  357. * enum cdp_ul_trigger_tids - UL trigger tids
  358. * @CDP_UL_TRIG_BK_TID: Background tid
  359. * @CDP_UL_TRIG_BE_TID: Best effort tid
  360. * @CDP_UL_TRIG_VI_TID: Video tid
  361. * @CDP_UL_TRIG_VO_TID: Voice tid
  362. */
  363. enum cdp_ul_trigger_tids {
  364. CDP_UL_TRIG_BK_TID = 25,
  365. CDP_UL_TRIG_BE_TID,
  366. CDP_UL_TRIG_VI_TID,
  367. CDP_UL_TRIG_VO_TID,
  368. };
  369. #define UL_TRIGGER_TID_TO_DATA_TID(_tid) ( \
  370. (((_tid) == CDP_UL_TRIG_BE_TID)) ? 0 : \
  371. (((_tid) == CDP_UL_TRIG_BK_TID)) ? 1 : \
  372. (((_tid) == CDP_UL_TRIG_VI_TID)) ? 5 : \
  373. 6)
  374. #ifdef WLAN_FEATURE_11BE
  375. /**
  376. * enum cdp_ru_index - Different RU index
  377. * @RU_26_INDEX : 26-tone Resource Unit index
  378. * @RU_52_INDEX : 52-tone Resource Unit index
  379. * @RU_52_26_INDEX : 52_26-tone Resource Unit index
  380. * @RU_106_INDEX: 106-tone Resource Unit index
  381. * @RU_106_26_INDEX: 106_26-tone Resource Unit index
  382. * @RU_242_INDEX: 242-tone Resource Unit index
  383. * @RU_484_INDEX: 484-tone Resource Unit index
  384. * @RU_484_242_INDEX: 484_242-tone Resource Unit index
  385. * @RU_996_INDEX: 996-tone Resource Unit index
  386. * @RU_996_484_INDEX: 996_484-tone Resource Unit index
  387. * @RU_996_484_242_INDEX: 996_484_242-tone Resource Unit index
  388. * @RU_2X996_INDEX: 2X996-tone Resource Unit index
  389. * @RU_2X996_484_INDEX: 2X996_484-tone Resource Unit index
  390. * @RU_3X996_INDEX: 3X996-tone Resource Unit index
  391. * @RU_3X996_484_INDEX: 3X996_484-tone Resource Unit index
  392. * @RU_4X996_INDEX: 4X996-tone Resource Unit index
  393. * @RU_INDEX_MAX: Maximum value
  394. */
  395. enum cdp_ru_index {
  396. RU_26_INDEX = 0,
  397. RU_52_INDEX,
  398. RU_52_26_INDEX,
  399. RU_106_INDEX,
  400. RU_106_26_INDEX,
  401. RU_242_INDEX,
  402. RU_484_INDEX,
  403. RU_484_242_INDEX,
  404. RU_996_INDEX,
  405. RU_996_484_INDEX,
  406. RU_996_484_242_INDEX,
  407. RU_2X996_INDEX,
  408. RU_2X996_484_INDEX,
  409. RU_3X996_INDEX,
  410. RU_3X996_484_INDEX,
  411. RU_4X996_INDEX,
  412. RU_INDEX_MAX,
  413. };
  414. #else
  415. enum cdp_ru_index {
  416. RU_26_INDEX = 0,
  417. RU_52_INDEX,
  418. RU_106_INDEX,
  419. RU_242_INDEX,
  420. RU_484_INDEX,
  421. RU_996_INDEX,
  422. RU_INDEX_MAX,
  423. };
  424. #endif
  425. struct cdp_ru_debug {
  426. char *ru_type;
  427. };
  428. #ifdef WLAN_FEATURE_11BE
  429. static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = {
  430. { "RU_26" },
  431. { "RU_52" },
  432. { "RU_52_26" },
  433. { "RU_106" },
  434. { "RU_106_26" },
  435. { "RU_242" },
  436. { "RU_484" },
  437. { "RU_484_242" },
  438. { "RU_996" },
  439. { "RU_996_484" },
  440. { "RU_996_484_242" },
  441. { "RU_2x996" },
  442. { "RU_2x996_484" },
  443. { "RU_3x996" },
  444. { "RU_3x996_484" },
  445. { "RU_4x996" },
  446. };
  447. #else
  448. static const struct cdp_ru_debug cdp_ru_string[RU_INDEX_MAX] = {
  449. { "RU_26" },
  450. { "RU_52" },
  451. { "RU_106" },
  452. { "RU_242" },
  453. { "RU_484" },
  454. { "RU_996" }
  455. };
  456. #endif
  457. #ifdef FEATURE_TSO_STATS
  458. /* Number of TSO Packet Statistics captured */
  459. #define CDP_MAX_TSO_PACKETS 5
  460. /* Information for Number of Segments for a TSO Packet captured */
  461. #define CDP_MAX_TSO_SEGMENTS 2
  462. /* Information for Number of Fragments for a TSO Segment captured */
  463. #define CDP_MAX_TSO_FRAGMENTS 6
  464. #endif /* FEATURE_TSO_STATS */
  465. /* Different Packet Types */
  466. enum cdp_packet_type {
  467. DOT11_A = 0,
  468. DOT11_B = 1,
  469. DOT11_N = 2,
  470. DOT11_AC = 3,
  471. DOT11_AX = 4,
  472. #ifdef WLAN_FEATURE_11BE
  473. DOT11_BE = 5,
  474. #endif
  475. DOT11_MAX,
  476. };
  477. #define MCS_VALID 1
  478. #define MCS_INVALID 0
  479. #ifdef WLAN_FEATURE_11BE
  480. #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \
  481. (DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \
  482. DOT11_AX == (_pkt_type) || DOT11_BE == (_pkt_type))
  483. #else
  484. #define CDP_IS_PKT_TYPE_SUPPORT_NSS(_pkt_type) \
  485. (DOT11_N == (_pkt_type) || DOT11_AC == (_pkt_type) || \
  486. DOT11_AX == (_pkt_type))
  487. #endif /* WLAN_FEATURE_11BE */
  488. #define CDP_MAX_MCS_STRING_LEN 34
  489. /**
  490. * struct cdp_rate_debug - mcs rate debug record
  491. * @mcs_type: print string for a given mcs
  492. * @valid: valid mcs rate?
  493. */
  494. struct cdp_rate_debug {
  495. char mcs_type[CDP_MAX_MCS_STRING_LEN];
  496. uint8_t valid;
  497. };
  498. #ifdef WLAN_FEATURE_11BE
  499. static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = {
  500. {
  501. {"OFDM 48 Mbps", MCS_VALID},
  502. {"OFDM 24 Mbps", MCS_VALID},
  503. {"OFDM 12 Mbps", MCS_VALID},
  504. {"OFDM 6 Mbps ", MCS_VALID},
  505. {"OFDM 54 Mbps", MCS_VALID},
  506. {"OFDM 36 Mbps", MCS_VALID},
  507. {"OFDM 18 Mbps", MCS_VALID},
  508. {"OFDM 9 Mbps ", MCS_VALID},
  509. {"INVALID ", MCS_INVALID},
  510. {"INVALID ", MCS_INVALID},
  511. {"INVALID ", MCS_INVALID},
  512. {"INVALID ", MCS_INVALID},
  513. {"INVALID ", MCS_INVALID},
  514. {"INVALID ", MCS_INVALID},
  515. {"INVALID ", MCS_INVALID},
  516. {"INVALID ", MCS_INVALID},
  517. {"INVALID ", MCS_INVALID},
  518. },
  519. {
  520. {"CCK 11 Mbps Long ", MCS_VALID},
  521. {"CCK 5.5 Mbps Long ", MCS_VALID},
  522. {"CCK 2 Mbps Long ", MCS_VALID},
  523. {"CCK 1 Mbps Long ", MCS_VALID},
  524. {"CCK 11 Mbps Short ", MCS_VALID},
  525. {"CCK 5.5 Mbps Short", MCS_VALID},
  526. {"CCK 2 Mbps Short ", MCS_VALID},
  527. {"INVALID ", MCS_INVALID},
  528. {"INVALID ", MCS_INVALID},
  529. {"INVALID ", MCS_INVALID},
  530. {"INVALID ", MCS_INVALID},
  531. {"INVALID ", MCS_INVALID},
  532. {"INVALID ", MCS_INVALID},
  533. {"INVALID ", MCS_INVALID},
  534. {"INVALID ", MCS_INVALID},
  535. {"INVALID ", MCS_INVALID},
  536. {"INVALID ", MCS_INVALID},
  537. },
  538. {
  539. {"HT MCS 0 (BPSK 1/2) ", MCS_VALID},
  540. {"HT MCS 1 (QPSK 1/2) ", MCS_VALID},
  541. {"HT MCS 2 (QPSK 3/4) ", MCS_VALID},
  542. {"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
  543. {"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
  544. {"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
  545. {"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
  546. {"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
  547. {"INVALID ", MCS_INVALID},
  548. {"INVALID ", MCS_INVALID},
  549. {"INVALID ", MCS_INVALID},
  550. {"INVALID ", MCS_INVALID},
  551. {"INVALID ", MCS_INVALID},
  552. {"INVALID ", MCS_INVALID},
  553. {"INVALID ", MCS_INVALID},
  554. {"INVALID ", MCS_INVALID},
  555. {"INVALID ", MCS_INVALID},
  556. },
  557. {
  558. {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID},
  559. {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID},
  560. {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID},
  561. {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID},
  562. {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID},
  563. {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID},
  564. {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID},
  565. {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID},
  566. {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID},
  567. {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID},
  568. {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
  569. {"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
  570. {"INVALID ", MCS_INVALID},
  571. {"INVALID ", MCS_INVALID},
  572. {"INVALID ", MCS_INVALID},
  573. {"INVALID ", MCS_INVALID},
  574. },
  575. {
  576. {"HE MCS 0 (BPSK 1/2) ", MCS_VALID},
  577. {"HE MCS 1 (QPSK 1/2) ", MCS_VALID},
  578. {"HE MCS 2 (QPSK 3/4) ", MCS_VALID},
  579. {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID},
  580. {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID},
  581. {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID},
  582. {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID},
  583. {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID},
  584. {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID},
  585. {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID},
  586. {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
  587. {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
  588. {"HE MCS 12 (4096-QAM 3/4)", MCS_VALID},
  589. {"HE MCS 13 (4096-QAM 5/6)", MCS_VALID},
  590. {"INVALID ", MCS_INVALID},
  591. {"INVALID ", MCS_INVALID},
  592. {"INVALID ", MCS_INVALID},
  593. },
  594. {
  595. {"EHT MCS 0 (BPSK 1/2) ", MCS_VALID},
  596. {"EHT MCS 1 (QPSK 1/2) ", MCS_VALID},
  597. {"EHT MCS 2 (QPSK 3/4) ", MCS_VALID},
  598. {"EHT MCS 3 (16-QAM 1/2) ", MCS_VALID},
  599. {"EHT MCS 4 (16-QAM 3/4) ", MCS_VALID},
  600. {"EHT MCS 5 (64-QAM 2/3) ", MCS_VALID},
  601. {"EHT MCS 6 (64-QAM 3/4) ", MCS_VALID},
  602. {"EHT MCS 7 (64-QAM 5/6) ", MCS_VALID},
  603. {"EHT MCS 8 (256-QAM 3/4) ", MCS_VALID},
  604. {"EHT MCS 9 (256-QAM 5/6) ", MCS_VALID},
  605. {"EHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
  606. {"EHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
  607. {"EHT MCS 12 (4096-QAM 3/4)", MCS_VALID},
  608. {"EHT MCS 13 (4096-QAM 5/6)", MCS_VALID},
  609. {"EHT MCS 14 (BPSK-DCM 1/2)", MCS_VALID},
  610. {"EHT MCS 15 (BPSK-DCM 1/2)", MCS_VALID},
  611. {"INVALID ", MCS_INVALID},
  612. }
  613. };
  614. #else
  615. static const struct cdp_rate_debug cdp_rate_string[DOT11_MAX][MAX_MCS] = {
  616. {
  617. {"OFDM 48 Mbps", MCS_VALID},
  618. {"OFDM 24 Mbps", MCS_VALID},
  619. {"OFDM 12 Mbps", MCS_VALID},
  620. {"OFDM 6 Mbps ", MCS_VALID},
  621. {"OFDM 54 Mbps", MCS_VALID},
  622. {"OFDM 36 Mbps", MCS_VALID},
  623. {"OFDM 18 Mbps", MCS_VALID},
  624. {"OFDM 9 Mbps ", MCS_VALID},
  625. {"INVALID ", MCS_INVALID},
  626. {"INVALID ", MCS_INVALID},
  627. {"INVALID ", MCS_INVALID},
  628. {"INVALID ", MCS_INVALID},
  629. {"INVALID ", MCS_INVALID},
  630. },
  631. {
  632. {"CCK 11 Mbps Long ", MCS_VALID},
  633. {"CCK 5.5 Mbps Long ", MCS_VALID},
  634. {"CCK 2 Mbps Long ", MCS_VALID},
  635. {"CCK 1 Mbps Long ", MCS_VALID},
  636. {"CCK 11 Mbps Short ", MCS_VALID},
  637. {"CCK 5.5 Mbps Short", MCS_VALID},
  638. {"CCK 2 Mbps Short ", MCS_VALID},
  639. {"INVALID ", MCS_INVALID},
  640. {"INVALID ", MCS_INVALID},
  641. {"INVALID ", MCS_INVALID},
  642. {"INVALID ", MCS_INVALID},
  643. {"INVALID ", MCS_INVALID},
  644. {"INVALID ", MCS_INVALID},
  645. },
  646. {
  647. {"HT MCS 0 (BPSK 1/2) ", MCS_VALID},
  648. {"HT MCS 1 (QPSK 1/2) ", MCS_VALID},
  649. {"HT MCS 2 (QPSK 3/4) ", MCS_VALID},
  650. {"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
  651. {"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
  652. {"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
  653. {"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
  654. {"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
  655. {"INVALID ", MCS_INVALID},
  656. {"INVALID ", MCS_INVALID},
  657. {"INVALID ", MCS_INVALID},
  658. {"INVALID ", MCS_INVALID},
  659. {"INVALID ", MCS_INVALID},
  660. },
  661. {
  662. {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID},
  663. {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID},
  664. {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID},
  665. {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID},
  666. {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID},
  667. {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID},
  668. {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID},
  669. {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID},
  670. {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID},
  671. {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID},
  672. {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
  673. {"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
  674. {"INVALID ", MCS_INVALID},
  675. },
  676. {
  677. {"HE MCS 0 (BPSK 1/2) ", MCS_VALID},
  678. {"HE MCS 1 (QPSK 1/2) ", MCS_VALID},
  679. {"HE MCS 2 (QPSK 3/4) ", MCS_VALID},
  680. {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID},
  681. {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID},
  682. {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID},
  683. {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID},
  684. {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID},
  685. {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID},
  686. {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID},
  687. {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
  688. {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
  689. {"HE MCS 12 (4096-QAM 3/4)", MCS_VALID},
  690. {"HE MCS 13 (4096-QAM 5/6)", MCS_VALID},
  691. {"INVALID ", MCS_INVALID},
  692. }
  693. };
  694. #endif
  695. /**
  696. * enum cdp_mu_packet_type - MU type index
  697. * @TXRX_TYPE_MU_MIMO: MU MIMO type index
  698. * @TXRX_TYPE_MU_OFDMA: MU OFDMA type index
  699. * @TXRX_TYPE_MU_MAX: MU MAX type index
  700. */
  701. enum cdp_mu_packet_type {
  702. TXRX_TYPE_MU_MIMO = 0,
  703. TXRX_TYPE_MU_OFDMA = 1,
  704. TXRX_TYPE_MU_MAX = 2,
  705. };
  706. /**
  707. * enum peer_stats_type peer stats type
  708. * @PEER_TX_STATS: stats type for tx
  709. * @PEER_RX_STATS: stats type for rx
  710. */
  711. enum peer_stats_type {
  712. PEER_TX_STATS,
  713. PEER_RX_STATS,
  714. };
  715. enum WDI_EVENT {
  716. WDI_EVENT_TX_STATUS = WDI_EVENT_BASE,
  717. WDI_EVENT_OFFLOAD_ALL,
  718. WDI_EVENT_RX_DESC_REMOTE,
  719. WDI_EVENT_RX_PEER_INVALID,
  720. WDI_EVENT_DBG_PRINT, /* NEED to integrate pktlog changes*/
  721. WDI_EVENT_RX_CBF_REMOTE,
  722. WDI_EVENT_RATE_FIND,
  723. WDI_EVENT_RATE_UPDATE,
  724. WDI_EVENT_SW_EVENT,
  725. WDI_EVENT_RX_DESC,
  726. WDI_EVENT_LITE_T2H,
  727. WDI_EVENT_LITE_RX,
  728. WDI_EVENT_RX_PPDU_DESC,
  729. WDI_EVENT_TX_PPDU_DESC,
  730. WDI_EVENT_TX_MSDU_DESC,
  731. WDI_EVENT_TX_DATA,
  732. WDI_EVENT_RX_DATA,
  733. WDI_EVENT_TX_MGMT_CTRL,
  734. WDI_EVENT_TX_PKT_CAPTURE,
  735. WDI_EVENT_HTT_STATS,
  736. WDI_EVENT_TX_BEACON,
  737. WDI_EVENT_PEER_STATS,
  738. WDI_EVENT_TX_SOJOURN_STAT,
  739. WDI_EVENT_UPDATE_DP_STATS,
  740. WDI_EVENT_RX_MGMT_CTRL,
  741. WDI_EVENT_PEER_CREATE,
  742. WDI_EVENT_PEER_DESTROY,
  743. WDI_EVENT_PEER_FLUSH_RATE_STATS,
  744. WDI_EVENT_FLUSH_RATE_STATS_REQ,
  745. WDI_EVENT_RX_MPDU,
  746. WDI_EVENT_HMWDS_AST_ADD_STATUS,
  747. WDI_EVENT_PEER_QOS_STATS,
  748. WDI_EVENT_PKT_CAPTURE_TX_DATA,
  749. WDI_EVENT_PKT_CAPTURE_RX_DATA,
  750. WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER,
  751. WDI_EVENT_PKT_CAPTURE_OFFLOAD_TX_DATA,
  752. WDI_EVENT_RX_CBF,
  753. WDI_EVENT_PKT_CAPTURE_PPDU_STATS,
  754. WDI_EVENT_HOST_SW_EVENT,
  755. WDI_EVENT_HYBRID_TX,
  756. #ifdef WLAN_FEATURE_11BE_MLO
  757. WDI_EVENT_MLO_TSTMP,
  758. #endif
  759. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  760. WDI_EVENT_RX_PPDU_DESC_UNDECODED_METADATA,
  761. #endif
  762. WDI_EVENT_LITE_MON_RX,
  763. WDI_EVENT_LITE_MON_TX,
  764. WDI_EVENT_TXRX_PEER_CREATE,
  765. WDI_EVENT_PEER_UNMAP,
  766. WDI_EVENT_PEER_DELETE,
  767. WDI_EVENT_PEER_PRIMARY_UMAC_UPDATE,
  768. WDI_EVENT_MCAST_PRIMARY_UPDATE,
  769. WDI_EVENT_STA_PRIMARY_UMAC_UPDATE,
  770. /* End of new event items */
  771. WDI_EVENT_LAST
  772. };
  773. #define WDI_NUM_EVENTS WDI_EVENT_LAST - WDI_EVENT_BASE
  774. struct cdp_stats_extd {
  775. };
  776. /* TID level Tx/Rx stats
  777. *
  778. */
  779. enum cdp_txrx_tidq_stats {
  780. /* Tx Counters */
  781. TX_MSDU_TOTAL_LINUX_SUBSYSTEM,
  782. TX_MSDU_TOTAL_FROM_OSIF,
  783. TX_MSDU_TX_COMP_PKT_CNT,
  784. /* Rx Counters */
  785. RX_MSDU_TOTAL_FROM_FW,
  786. RX_MSDU_MCAST_FROM_FW,
  787. RX_TID_MISMATCH_FROM_FW,
  788. RX_MSDU_MISC_PKTS,
  789. RX_MSDU_IS_ARP,
  790. RX_MSDU_IS_EAP,
  791. RX_MSDU_IS_DHCP,
  792. RX_AGGREGATE_10,
  793. RX_AGGREGATE_20,
  794. RX_AGGREGATE_30,
  795. RX_AGGREGATE_40,
  796. RX_AGGREGATE_50,
  797. RX_AGGREGATE_60,
  798. RX_AGGREGATE_MORE,
  799. RX_AMSDU_1,
  800. RX_AMSDU_2,
  801. RX_AMSDU_3,
  802. RX_AMSDU_4,
  803. RX_AMSDU_MORE,
  804. RX_MSDU_CHAINED_FROM_FW,
  805. RX_MSDU_REORDER_FAILED_FROM_FW,
  806. RX_MSDU_REORDER_FLUSHED_FROM_FW,
  807. RX_MSDU_DISCARD_FROM_FW,
  808. RX_MSDU_DUPLICATE_FROM_FW,
  809. RX_MSDU_DELIVERED_TO_STACK,
  810. TIDQ_STATS_MAX,
  811. };
  812. struct cdp_tidq_stats {
  813. uint32_t stats[TIDQ_STATS_MAX];
  814. };
  815. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  816. /**
  817. * struct cdp_rx_ppdu_cfr_info - struct for storing ppdu info extracted from HW
  818. * TLVs, this will be used for CFR correlation
  819. *
  820. * @bb_captured_channel : Set by RXPCU when MACRX_FREEZE_CAPTURE_CHANNEL TLV is
  821. * sent to PHY, SW checks it to correlate current PPDU TLVs with uploaded
  822. * channel information.
  823. *
  824. * @bb_captured_timeout : Set by RxPCU to indicate channel capture condition is
  825. * met, but MACRX_FREEZE_CAPTURE_CHANNEL is not sent to PHY due to AST delay,
  826. * which means the rx_frame_falling edge to FREEZE TLV ready time exceeds
  827. * the threshold time defined by RXPCU register FREEZE_TLV_DELAY_CNT_THRESH.
  828. * Bb_captured_reason is still valid in this case.
  829. *
  830. * @bb_captured_reason : Copy capture_reason of MACRX_FREEZE_CAPTURE_CHANNEL
  831. * TLV to here for FW usage. Valid when bb_captured_channel or
  832. * bb_captured_timeout is set.
  833. * <enum 0 freeze_reason_TM>
  834. * <enum 1 freeze_reason_FTM>
  835. * <enum 2 freeze_reason_ACK_resp_to_TM_FTM>
  836. * <enum 3 freeze_reason_TA_RA_TYPE_FILTER>
  837. * <enum 4 freeze_reason_NDPA_NDP>
  838. * <enum 5 freeze_reason_ALL_PACKET>
  839. * <legal 0-5>
  840. *
  841. * @rx_location_info_valid: Indicates whether CFR DMA address in the PPDU TLV
  842. * is valid
  843. * <enum 0 rx_location_info_is_not_valid>
  844. * <enum 1 rx_location_info_is_valid>
  845. * <legal all>
  846. *
  847. * @chan_capture_status : capture status reported by ucode
  848. * a. CAPTURE_IDLE: FW has disabled "REPETITIVE_CHE_CAPTURE_CTRL"
  849. * b. CAPTURE_BUSY: previous PPDU’s channel capture upload DMA ongoing. (Note
  850. * that this upload is triggered after receiving freeze_channel_capture TLV
  851. * after last PPDU is rx)
  852. * c. CAPTURE_ACTIVE: channel capture is enabled and no previous channel
  853. * capture ongoing
  854. * d. CAPTURE_NO_BUFFER: next buffer in IPC ring not available
  855. *
  856. * @rtt_che_buffer_pointer_high8 : The high 8 bits of the 40 bits pointer to
  857. * external RTT channel information buffer
  858. *
  859. * @rtt_che_buffer_pointer_low32 : The low 32 bits of the 40 bits pointer to
  860. * external RTT channel information buffer
  861. *
  862. * @rtt_cfo_measurement : raw cfo data extracted from hardware, which is 14 bit
  863. * signed number. The first bit used for sign representation and 13 bits for
  864. * fractional part.
  865. *
  866. * @agc_gain_info0: Chain 0 & chain 1 agc gain information reported by PHY
  867. *
  868. * @agc_gain_info1: Chain 2 & chain 3 agc gain information reported by PHY
  869. *
  870. * @agc_gain_info2: Chain 4 & chain 5 agc gain information reported by PHY
  871. *
  872. * @agc_gain_info3: Chain 6 & chain 7 agc gain information reported by PHY
  873. *
  874. * @rx_start_ts: Rx packet timestamp, the time the first L-STF ADC sample
  875. * arrived at Rx antenna.
  876. *
  877. * @mcs_rate: Indicates the mcs/rate in which packet is received.
  878. * If HT,
  879. * 0-7: MCS0-MCS7
  880. * If VHT,
  881. * 0-9: MCS0 to MCS9
  882. * If HE,
  883. * 0-11: MCS0 to MCS11,
  884. * 12-13: 4096QAM,
  885. * 14-15: reserved
  886. * If Legacy,
  887. * 0: 48 Mbps
  888. * 1: 24 Mbps
  889. * 2: 12 Mbps
  890. * 3: 6 Mbps
  891. * 4: 54 Mbps
  892. * 5: 36 Mbps
  893. * 6: 18 Mbps
  894. * 7: 9 Mbps
  895. *
  896. * @gi_type: Indicates the guard interval.
  897. * 0: 0.8 us
  898. * 1: 0.4 us
  899. * 2: 1.6 us
  900. * 3: 3.2 us
  901. */
  902. struct cdp_rx_ppdu_cfr_info {
  903. bool bb_captured_channel;
  904. bool bb_captured_timeout;
  905. uint8_t bb_captured_reason;
  906. bool rx_location_info_valid;
  907. uint8_t chan_capture_status;
  908. uint8_t rtt_che_buffer_pointer_high8;
  909. uint32_t rtt_che_buffer_pointer_low32;
  910. int16_t rtt_cfo_measurement;
  911. uint32_t agc_gain_info0;
  912. uint32_t agc_gain_info1;
  913. uint32_t agc_gain_info2;
  914. uint32_t agc_gain_info3;
  915. uint32_t rx_start_ts;
  916. uint32_t mcs_rate;
  917. uint32_t gi_type;
  918. };
  919. #endif
  920. /**
  921. * struct cdp_rx_su_evm_info - Rx evm info
  922. * @number_of_symbols: number of symbols
  923. * @nss_count: number of spatial streams
  924. * @pilot_count: number of pilot count
  925. * @pilot_evm:
  926. */
  927. struct cdp_rx_su_evm_info {
  928. uint16_t number_of_symbols;
  929. uint8_t nss_count;
  930. uint8_t pilot_count;
  931. uint32_t pilot_evm[DP_RX_MAX_SU_EVM_COUNT];
  932. };
  933. /**
  934. * enum cdp_delay_stats_mode - Different types of delay statistics
  935. *
  936. * @CDP_DELAY_STATS_SW_ENQ: Stack to hw enqueue delay
  937. * @CDP_DELAY_STATS_TX_INTERFRAME: Interframe delay at radio entry point
  938. * @CDP_DELAY_STATS_FW_HW_TRANSMIT: Hw enqueue to tx completion delay
  939. * @CDP_DELAY_STATS_REAP_STACK: Delay in ring reap to indicating network stack
  940. * @CDP_DELAY_STATS_RX_INTERFRAME: Rx inteframe delay
  941. * @CDP_DELAY_STATS_MODE_MAX: Maximum delay mode
  942. */
  943. enum cdp_delay_stats_mode {
  944. CDP_DELAY_STATS_SW_ENQ,
  945. CDP_DELAY_STATS_TX_INTERFRAME,
  946. CDP_DELAY_STATS_FW_HW_TRANSMIT,
  947. CDP_DELAY_STATS_REAP_STACK,
  948. CDP_DELAY_STATS_RX_INTERFRAME,
  949. CDP_DELAY_STATS_MODE_MAX,
  950. };
  951. /*
  952. * cdp_delay_bucket_index
  953. * Index to be used for all delay stats
  954. */
  955. enum cdp_delay_bucket_index {
  956. CDP_DELAY_BUCKET_0,
  957. CDP_DELAY_BUCKET_1,
  958. CDP_DELAY_BUCKET_2,
  959. CDP_DELAY_BUCKET_3,
  960. CDP_DELAY_BUCKET_4,
  961. CDP_DELAY_BUCKET_5,
  962. CDP_DELAY_BUCKET_6,
  963. CDP_DELAY_BUCKET_7,
  964. CDP_DELAY_BUCKET_8,
  965. CDP_DELAY_BUCKET_9,
  966. CDP_DELAY_BUCKET_10,
  967. CDP_DELAY_BUCKET_11,
  968. CDP_DELAY_BUCKET_12,
  969. CDP_DELAY_BUCKET_MAX,
  970. };
  971. /**
  972. * enum cdp_tx_sw_drop - packet drop due to following reasons.
  973. * @TX_DESC_ERR:
  974. * @TX_HAL_RING_ACCESS_ERR:
  975. * @TX_DMA_MAP_ERR:
  976. * @TX_HW_ENQUEUE:
  977. * @TX_SW_ENQUEUE:
  978. * @TX_MAX_DROP:
  979. */
  980. enum cdp_tx_sw_drop {
  981. TX_DESC_ERR,
  982. TX_HAL_RING_ACCESS_ERR,
  983. TX_DMA_MAP_ERR,
  984. TX_HW_ENQUEUE,
  985. TX_SW_ENQUEUE,
  986. TX_MAX_DROP,
  987. };
  988. /**
  989. * enum cdp_rx_sw_drop - packet drop due to following reasons.
  990. * @INTRABSS_DROP:
  991. * @MSDU_DONE_FAILURE:
  992. * @INVALID_PEER_VDEV:
  993. * @POLICY_CHECK_DROP:
  994. * @MEC_DROP:
  995. * @NAWDS_MCAST_DROP:
  996. * @MESH_FILTER_DROP:
  997. * @ENQUEUE_DROP:
  998. * @RX_MAX_DROP:
  999. */
  1000. enum cdp_rx_sw_drop {
  1001. INTRABSS_DROP,
  1002. MSDU_DONE_FAILURE,
  1003. INVALID_PEER_VDEV,
  1004. POLICY_CHECK_DROP,
  1005. MEC_DROP,
  1006. NAWDS_MCAST_DROP,
  1007. MESH_FILTER_DROP,
  1008. ENQUEUE_DROP,
  1009. RX_MAX_DROP,
  1010. };
  1011. /**
  1012. * struct cdp_delay_stats - delay statistics
  1013. * @delay_bucket: division of buckets as per latency
  1014. * @min_delay: minimum delay
  1015. * @max_delay: maximum delay
  1016. * @avg_delay: average delay
  1017. */
  1018. struct cdp_delay_stats {
  1019. uint64_t delay_bucket[CDP_DELAY_BUCKET_MAX];
  1020. uint32_t min_delay;
  1021. uint32_t max_delay;
  1022. uint32_t avg_delay;
  1023. };
  1024. /**
  1025. * struct cdp_tid_tx_stats - per-TID statistics
  1026. * @swq_delay: delay between wifi driver entry point and enqueue to HW in tx
  1027. * @hwtx_delay: delay between wifi driver exit (enqueue to HW) and tx completion
  1028. * @intfrm_delay: interframe delay
  1029. * @success_cnt: total successful transmit count
  1030. * @comp_fail_cnt: firmware drop found in tx completion path
  1031. * @swdrop_cnt: software drop in tx path
  1032. * @tqm_status_cnt: TQM completion status count
  1033. * @htt_status_cnt: HTT completion status count
  1034. */
  1035. struct cdp_tid_tx_stats {
  1036. struct cdp_delay_stats swq_delay;
  1037. struct cdp_delay_stats hwtx_delay;
  1038. struct cdp_delay_stats intfrm_delay;
  1039. uint64_t success_cnt;
  1040. uint64_t comp_fail_cnt;
  1041. uint64_t swdrop_cnt[TX_MAX_DROP];
  1042. uint64_t tqm_status_cnt[CDP_MAX_TX_TQM_STATUS];
  1043. uint64_t htt_status_cnt[CDP_MAX_TX_HTT_STATUS];
  1044. };
  1045. /**
  1046. * struct cdp_reo_error_stats - REO error statistics
  1047. * @err_src_reo_code_inv: Wireless Buffer Manager source receive reorder ring
  1048. * reason unknown
  1049. * @err_reo_codes: Receive reorder error codes
  1050. */
  1051. struct cdp_reo_error_stats {
  1052. uint64_t err_src_reo_code_inv;
  1053. uint64_t err_reo_codes[CDP_REO_CODE_MAX];
  1054. };
  1055. /**
  1056. * struct cdp_rxdma_error_stats - RxDMA error statistics
  1057. * @err_src_rxdma_code_inv: DMA reason unknown count
  1058. * @err_dma_codes: DMA error codes count
  1059. */
  1060. struct cdp_rxdma_error_stats {
  1061. uint64_t err_src_rxdma_code_inv;
  1062. uint64_t err_dma_codes[CDP_DMA_CODE_MAX];
  1063. };
  1064. /**
  1065. * struct cdp_tid_rx_stats - per-TID Rx statistics
  1066. * @to_stack_delay: Time taken between ring reap to indication to network stack
  1067. * @intfrm_delay: Interframe rx delay
  1068. * @delivered_to_stack: Total packets indicated to stack
  1069. * @intrabss_cnt: Rx total intraBSS frames
  1070. * @msdu_cnt: number of msdu received from HW
  1071. * @mcast_msdu_cnt: Num Mcast Msdus received from HW in Rx
  1072. * @bcast_msdu_cnt: Num Bcast Msdus received from HW in Rx
  1073. * @fail_cnt: Rx deliver drop counters
  1074. * @reo_err: V3 reo error statistics
  1075. * @rxdma_err: V3 rxdma error statistics
  1076. */
  1077. struct cdp_tid_rx_stats {
  1078. struct cdp_delay_stats to_stack_delay;
  1079. struct cdp_delay_stats intfrm_delay;
  1080. uint64_t delivered_to_stack;
  1081. uint64_t intrabss_cnt;
  1082. uint64_t msdu_cnt;
  1083. uint64_t mcast_msdu_cnt;
  1084. uint64_t bcast_msdu_cnt;
  1085. uint64_t fail_cnt[RX_MAX_DROP];
  1086. struct cdp_reo_error_stats reo_err;
  1087. struct cdp_rxdma_error_stats rxdma_err;
  1088. };
  1089. /**
  1090. * struct cdp_tid_stats - composite TID statistics
  1091. * @ingress_stack: Total packets received from linux stack
  1092. * @osif_drop: drops in osif layer
  1093. * @tid_tx_stats: transmit counters per tid
  1094. * @tid_rx_stats: receive counters per tid
  1095. * @tid_rx_wbm_stats: WBM receive counters per tid
  1096. */
  1097. struct cdp_tid_stats {
  1098. uint64_t ingress_stack;
  1099. uint64_t osif_drop;
  1100. struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS]
  1101. [CDP_MAX_DATA_TIDS];
  1102. struct cdp_tid_rx_stats tid_rx_stats[CDP_MAX_RX_RINGS]
  1103. [CDP_MAX_DATA_TIDS];
  1104. struct cdp_tid_rx_stats tid_rx_wbm_stats[CDP_MAX_RX_WBM_RINGS]
  1105. [CDP_MAX_DATA_TIDS];
  1106. };
  1107. /**
  1108. * struct cdp_tid_stats_intf - network interface TID statistics
  1109. * @ingress_stack: Total packets received from linux stack
  1110. * @osif_drop: drops in osif layer
  1111. * @tx_total: total of per ring transmit counters per tid
  1112. * @rx_total: total of per ring receive counters per tid
  1113. */
  1114. struct cdp_tid_stats_intf {
  1115. uint64_t ingress_stack;
  1116. uint64_t osif_drop;
  1117. struct cdp_tid_tx_stats tx_total[CDP_MAX_DATA_TIDS];
  1118. struct cdp_tid_rx_stats rx_total[CDP_MAX_DATA_TIDS];
  1119. };
  1120. /**
  1121. * struct cdp_delay_tx_stats - Tx delay stats
  1122. * @tx_swq_delay: software enqueue delay
  1123. * @hwtx_delay: HW enqueue to completion delay
  1124. * @nwdelay_avg: Network delay average
  1125. * @swdelay_avg: Wifi SW Delay Average
  1126. * @hwdelay_avg: Wifi HW delay Average
  1127. * @nw_delay_win_avg: average NW delay for each window
  1128. * @sw_delay_win_avg: average Wifi SW delay for each window
  1129. * @hw_delay_win_avg: average Wifi HW delay for each window
  1130. * @cur_win_num_pkts: number of packets processed in current window
  1131. * @curr_win_idx: current windows index
  1132. */
  1133. struct cdp_delay_tx_stats {
  1134. struct cdp_hist_stats tx_swq_delay;
  1135. struct cdp_hist_stats hwtx_delay;
  1136. #ifdef CONFIG_SAWF
  1137. uint32_t nwdelay_avg;
  1138. uint32_t swdelay_avg;
  1139. uint32_t hwdelay_avg;
  1140. uint64_t nw_delay_win_avg[CDP_MAX_WIN_MOV_AVG];
  1141. uint64_t sw_delay_win_avg[CDP_MAX_WIN_MOV_AVG];
  1142. uint64_t hw_delay_win_avg[CDP_MAX_WIN_MOV_AVG];
  1143. uint32_t cur_win_num_pkts;
  1144. uint32_t curr_win_idx;
  1145. #endif
  1146. };
  1147. /**
  1148. * struct cdp_delay_rx_stats - Rx delay stats
  1149. * @to_stack_delay: To stack delay
  1150. */
  1151. struct cdp_delay_rx_stats {
  1152. struct cdp_hist_stats to_stack_delay;
  1153. };
  1154. /**
  1155. * struct cdp_delay_tid_stats - Delay tid stats
  1156. * @tx_delay: Tx delay related stats
  1157. * @rx_delay: Rx delay related stats
  1158. */
  1159. struct cdp_delay_tid_stats {
  1160. struct cdp_delay_tx_stats tx_delay;
  1161. struct cdp_delay_rx_stats rx_delay;
  1162. };
  1163. /**
  1164. * struct cdp_pkt_info - packet info
  1165. * @num: no of packets
  1166. * @bytes: total no of bytes
  1167. */
  1168. struct cdp_pkt_info {
  1169. uint32_t num;
  1170. uint64_t bytes;
  1171. };
  1172. /**
  1173. * struct cdp_pkt_type - packet type
  1174. * @mcs_count: Counter array for each MCS index
  1175. */
  1176. struct cdp_pkt_type {
  1177. uint32_t mcs_count[MAX_MCS];
  1178. };
  1179. /**
  1180. * struct cdp_rx_mu - Rx MU Stats
  1181. * @ppdu_nss: Packet Count in spatial streams
  1182. * @mpdu_cnt_fcs_ok: Rx success mpdu count
  1183. * @mpdu_cnt_fcs_err: Rx fail mpdu count
  1184. * @ppdu: counter array for each MCS index
  1185. */
  1186. struct cdp_rx_mu {
  1187. uint32_t ppdu_nss[SS_COUNT];
  1188. uint32_t mpdu_cnt_fcs_ok;
  1189. uint32_t mpdu_cnt_fcs_err;
  1190. struct cdp_pkt_type ppdu;
  1191. };
  1192. /**
  1193. * struct cdp_tx_pkt_info - tx packet info
  1194. * @num_msdu: successful msdu
  1195. * @num_mpdu: successful mpdu from compltn common
  1196. * @mpdu_tried: mpdu tried
  1197. *
  1198. * tx packet info counter field for mpdu success/tried and msdu
  1199. */
  1200. struct cdp_tx_pkt_info {
  1201. uint32_t num_msdu;
  1202. uint32_t num_mpdu;
  1203. uint32_t mpdu_tried;
  1204. };
  1205. #ifdef FEATURE_TSO_STATS
  1206. /**
  1207. * struct cdp_tso_seg_histogram - Segment histogram for TCP Packets
  1208. * @segs_1: packets with single segments
  1209. * @segs_2_5: packets with 2-5 segments
  1210. * @segs_6_10: packets with 6-10 segments
  1211. * @segs_11_15: packets with 11-15 segments
  1212. * @segs_16_20: packets with 16-20 segments
  1213. * @segs_20_plus: packets with 20 plus segments
  1214. */
  1215. struct cdp_tso_seg_histogram {
  1216. uint64_t segs_1;
  1217. uint64_t segs_2_5;
  1218. uint64_t segs_6_10;
  1219. uint64_t segs_11_15;
  1220. uint64_t segs_16_20;
  1221. uint64_t segs_20_plus;
  1222. };
  1223. /**
  1224. * struct cdp_tso_packet_info - Stats for TSO segments within a TSO packet
  1225. * @tso_seg: TSO Segment information
  1226. * @num_seg: Number of segments
  1227. * @tso_packet_len: Size of the tso packet
  1228. * @tso_seg_idx: segment number
  1229. */
  1230. struct cdp_tso_packet_info {
  1231. struct qdf_tso_seg_t tso_seg[CDP_MAX_TSO_SEGMENTS];
  1232. uint8_t num_seg;
  1233. size_t tso_packet_len;
  1234. uint32_t tso_seg_idx;
  1235. };
  1236. /**
  1237. * struct cdp_tso_info - stats for tso packets
  1238. * @tso_packet_info: TSO packet information
  1239. */
  1240. struct cdp_tso_info {
  1241. struct cdp_tso_packet_info tso_packet_info[CDP_MAX_TSO_PACKETS];
  1242. };
  1243. #endif /* FEATURE_TSO_STATS */
  1244. /**
  1245. * struct cdp_tso_stats - TSO stats information
  1246. * @num_tso_pkts: Total number of TSO Packets
  1247. * @tso_comp: Total tso packet completions
  1248. * @dropped_host: TSO packets dropped by host
  1249. * @tso_no_mem_dropped: TSO packets dropped by host due to descriptor
  1250. * unavailablity
  1251. * @dropped_target: TSO packets_dropped by target
  1252. * @tso_info: Per TSO packet counters
  1253. * @seg_histogram: TSO histogram stats
  1254. */
  1255. struct cdp_tso_stats {
  1256. struct cdp_pkt_info num_tso_pkts;
  1257. uint32_t tso_comp;
  1258. struct cdp_pkt_info dropped_host;
  1259. struct cdp_pkt_info tso_no_mem_dropped;
  1260. uint32_t dropped_target;
  1261. #ifdef FEATURE_TSO_STATS
  1262. struct cdp_tso_info tso_info;
  1263. struct cdp_tso_seg_histogram seg_histogram;
  1264. #endif /* FEATURE_TSO_STATS */
  1265. };
  1266. #define CDP_PEER_STATS_START 0
  1267. enum cdp_peer_stats_type {
  1268. cdp_peer_stats_min = CDP_PEER_STATS_START,
  1269. /* Peer per pkt stats */
  1270. cdp_peer_per_pkt_stats_min = cdp_peer_stats_min,
  1271. cdp_peer_tx_ucast = cdp_peer_per_pkt_stats_min,
  1272. cdp_peer_tx_mcast,
  1273. cdp_peer_tx_inactive_time,
  1274. cdp_peer_rx_ucast,
  1275. /* Add enum for peer per pkt stats before this */
  1276. cdp_peer_per_pkt_stats_max,
  1277. /* Peer extd stats */
  1278. cdp_peer_extd_stats_min,
  1279. cdp_peer_tx_rate = cdp_peer_extd_stats_min,
  1280. cdp_peer_tx_last_tx_rate,
  1281. cdp_peer_tx_ratecode,
  1282. cdp_peer_tx_flags,
  1283. cdp_peer_tx_power,
  1284. cdp_peer_rx_rate,
  1285. cdp_peer_rx_last_rx_rate,
  1286. cdp_peer_rx_ratecode,
  1287. cdp_peer_rx_flags,
  1288. cdp_peer_rx_avg_snr,
  1289. cdp_peer_rx_snr,
  1290. /* Add enum for peer extd stats before this */
  1291. cdp_peer_extd_stats_max,
  1292. cdp_peer_stats_max = cdp_peer_extd_stats_max,
  1293. };
  1294. /*
  1295. * The max size of cdp_peer_stats_param_t is limited to 16 bytes.
  1296. * If the buffer size is exceeding this size limit,
  1297. * dp_txrx_get_peer_stats is to be used instead.
  1298. */
  1299. typedef union cdp_peer_stats_buf {
  1300. /* Tx types */
  1301. struct cdp_pkt_info tx_ucast;
  1302. struct cdp_pkt_info tx_mcast;
  1303. uint32_t tx_rate;
  1304. uint32_t last_tx_rate;
  1305. uint32_t tx_inactive_time;
  1306. uint32_t tx_flags;
  1307. uint32_t tx_power;
  1308. uint16_t tx_ratecode;
  1309. /* Rx types */
  1310. struct cdp_pkt_info rx_ucast;
  1311. uint32_t rx_rate;
  1312. uint32_t last_rx_rate;
  1313. uint32_t rx_ratecode;
  1314. uint32_t rx_flags;
  1315. uint32_t rx_avg_snr;
  1316. uint32_t rx_snr;
  1317. } cdp_peer_stats_param_t; /* Max union size 16 bytes */
  1318. /**
  1319. * enum cdp_protocol_trace - Protocols supported by per-peer protocol trace
  1320. * @CDP_TRACE_ICMP: ICMP packets
  1321. * @CDP_TRACE_EAP: EAPOL packets
  1322. * @CDP_TRACE_ARP: ARP packets
  1323. * @CDP_TRACE_MAX: MAX enumeration
  1324. *
  1325. * Enumeration of all protocols supported by per-peer protocol trace feature
  1326. */
  1327. enum cdp_protocol_trace {
  1328. CDP_TRACE_ICMP,
  1329. CDP_TRACE_EAP,
  1330. CDP_TRACE_ARP,
  1331. CDP_TRACE_MAX
  1332. };
  1333. /**
  1334. * struct protocol_trace_count - type of count on per-peer protocol trace
  1335. * @egress_cnt: how many packets go out of host driver
  1336. * @ingress_cnt: how many packets come into the host driver
  1337. *
  1338. * Type of count on per-peer protocol trace
  1339. */
  1340. struct protocol_trace_count {
  1341. uint16_t egress_cnt;
  1342. uint16_t ingress_cnt;
  1343. };
  1344. /**
  1345. * struct cdp_tx_stats - tx stats
  1346. * @comp_pkt: Pkt Info for which completions were received
  1347. * @ucast: Unicast Packet Count
  1348. * @mcast: Multicast Packet Count
  1349. * @bcast: Broadcast Packet Count
  1350. * @nawds_mcast: NAWDS Multicast Packet Count
  1351. * @tx_success: Successful Tx Packets
  1352. * @nawds_mcast_drop: NAWDS Multicast Drop Count
  1353. * @protocol_trace_cnt: per-peer protocol counter
  1354. * @tx_failed: Total Tx failure
  1355. * @ofdma: Total Packets as ofdma
  1356. * @stbc: Packets in STBC
  1357. * @ldpc: Packets in LDPC
  1358. * @retries: Packet retries
  1359. * @retries_mpdu: mpdu number of successfully transmitted after retries
  1360. * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation
  1361. * @amsdu_cnt: Number of MSDUs part of AMSDU
  1362. * @tx_rate: Tx Rate
  1363. * @last_tx_rate: Last tx rate for unicast packets
  1364. * @last_tx_rate_mcs: Tx rate mcs for unicast packets
  1365. * @mcast_last_tx_rate: Last tx rate for multicast packets
  1366. * @mcast_last_tx_rate_mcs: Last tx rate mcs for multicast
  1367. * @last_per: Tx Per
  1368. * @rnd_avg_tx_rate: Rounded average tx rate
  1369. * @avg_tx_rate: Average TX rate
  1370. * @last_ack_rssi: RSSI of last acked packet
  1371. * @tx_bytes_success_last: last Tx success bytes
  1372. * @tx_data_success_last: last Tx success data
  1373. * @tx_byte_rate: Bytes Trasmitted in last one sec
  1374. * @tx_data_rate: Data Transmitted in last one sec
  1375. * @tx_data_ucast_last:
  1376. * @tx_data_ucast_rate:
  1377. * @pkt_type:
  1378. * @sgi_count: SGI count
  1379. * @pream_punct_cnt: Preamble Punctured count
  1380. * @nss: Packet count for different num_spatial_stream values
  1381. * @bw: Packet Count for different bandwidths
  1382. * @wme_ac_type: Wireless Multimedia type Count
  1383. * @excess_retries_per_ac: Wireless Multimedia type Count
  1384. * @dot11_tx_pkts: dot11 tx packets
  1385. * @dropped: dropped packet counters
  1386. * @dropped.fw_rem: Discarded by firmware
  1387. * @dropped.fw_rem_notx: firmware_discard_untransmitted
  1388. * @dropped.fw_rem_tx: firmware_discard_transmitted
  1389. * @dropped.age_out: aged out in mpdu/msdu queues
  1390. * @dropped.fw_reason1: discarded by firmware reason 1
  1391. * @dropped.fw_reason2: discarded by firmware reason 2
  1392. * @dropped.fw_reason3: discarded by firmware reason 3
  1393. * @dropped.fw_rem_queue_disable: dropped due to queue disable
  1394. * @dropped.fw_rem_no_match: dropped due to fw no match command
  1395. * @dropped.drop_threshold: dropped due to HW threshold
  1396. * @dropped.drop_link_desc_na: dropped due resource not available in HW
  1397. * @dropped.invalid_drop: Invalid msdu drop
  1398. * @dropped.mcast_vdev_drop: MCAST drop configured for VDEV in HW
  1399. * @dropped.invalid_rr: Invalid TQM release reason
  1400. * @fw_tx_cnt:
  1401. * @fw_tx_bytes:
  1402. * @fw_txcount:
  1403. * @fw_max4msframelen:
  1404. * @fw_ratecount:
  1405. * @ac_nobufs:
  1406. * @rssi_chain: rssi chain
  1407. * @inactive_time: inactive time in secs
  1408. * @tx_flags: tx flags
  1409. * @tx_power: Tx power latest
  1410. * @is_tx_no_ack: no ack received
  1411. * @tx_ratecode: Tx rate code of last frame
  1412. * @ampdu_cnt: completion of aggregation
  1413. * @non_ampdu_cnt: tx completion not aggregated
  1414. * @failed_retry_count: packets failed due to retry above 802.11 retry limit
  1415. * @retry_count: packets successfully send after one or more retry
  1416. * @multiple_retry_count: packets successfully sent after more than one retry
  1417. * @last_tx_rate_used:
  1418. * @tx_ppdus: ppdus in tx
  1419. * @tx_mpdus_success: mpdus successful in tx
  1420. * @tx_mpdus_tried: mpdus tried in tx
  1421. * @transmit_type: pkt info for tx transmit type
  1422. * @mu_group_id: mumimo mu group id
  1423. * @ru_start: RU start index
  1424. * @ru_tones: RU tones size
  1425. * @ru_loc: pkt info for RU location 26/ 52/ 106/ 242/ 484 counter
  1426. * @num_ppdu_cookie_valid : Number of comp received with valid ppdu cookie
  1427. * @no_ack_count:
  1428. * @tx_success_twt: Successful Tx Packets in TWT session
  1429. * @nss_info: NSS 1,2, ...8
  1430. * @mcs_info: MCS index
  1431. * @bw_info: Bandwidth
  1432. * <enum 0 bw_20_MHz>
  1433. * <enum 1 bw_40_MHz>
  1434. * <enum 2 bw_80_MHz>
  1435. * <enum 3 bw_160_MHz>
  1436. * @gi_info: <enum 0 0_8_us_sgi > Legacy normal GI
  1437. * <enum 1 0_4_us_sgi > Legacy short GI
  1438. * <enum 2 1_6_us_sgi > HE related GI
  1439. * <enum 3 3_2_us_sgi > HE
  1440. * @preamble_info: preamble
  1441. * @mpdu_success_with_retries: mpdu retry count in case of successful
  1442. * transmission
  1443. * @last_tx_ts: last timestamp in jiffies when tx comp occurred
  1444. * @su_be_ppdu_cnt: SU Tx packet count
  1445. * @mu_be_ppdu_cnt: MU Tx packet count
  1446. * @punc_bw: MSDU count for punctured BW
  1447. * @release_src_not_tqm: Counter to keep track of release source is not TQM
  1448. * in TX completion status processing
  1449. * @per: Packet error ratio
  1450. * @rts_success: RTS success count
  1451. * @rts_failure: RTS failure count
  1452. * @bar_cnt: Block ACK Request frame count
  1453. * @ndpa_cnt: NDP announcement frame count
  1454. * @wme_ac_type_bytes: Wireless Multimedia Type Bytes Count
  1455. * @tx_ucast_total: Total tx unicast count
  1456. * @tx_ucast_success: Total tx unicast success count
  1457. */
  1458. struct cdp_tx_stats {
  1459. struct cdp_pkt_info comp_pkt;
  1460. struct cdp_pkt_info ucast;
  1461. struct cdp_pkt_info mcast;
  1462. struct cdp_pkt_info bcast;
  1463. struct cdp_pkt_info nawds_mcast;
  1464. #ifdef VDEV_PEER_PROTOCOL_COUNT
  1465. struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX];
  1466. #endif
  1467. struct cdp_pkt_info tx_success;
  1468. uint32_t nawds_mcast_drop;
  1469. uint32_t tx_failed;
  1470. uint32_t ofdma;
  1471. uint32_t stbc;
  1472. uint32_t ldpc;
  1473. uint32_t retries;
  1474. uint32_t retries_mpdu;
  1475. uint32_t non_amsdu_cnt;
  1476. uint32_t amsdu_cnt;
  1477. uint32_t tx_rate;
  1478. uint32_t last_tx_rate;
  1479. uint32_t last_tx_rate_mcs;
  1480. uint32_t mcast_last_tx_rate;
  1481. uint32_t mcast_last_tx_rate_mcs;
  1482. uint32_t last_per;
  1483. uint64_t rnd_avg_tx_rate;
  1484. uint64_t avg_tx_rate;
  1485. uint32_t last_ack_rssi;
  1486. uint32_t tx_bytes_success_last;
  1487. uint32_t tx_data_success_last;
  1488. uint32_t tx_byte_rate;
  1489. uint32_t tx_data_rate;
  1490. uint32_t tx_data_ucast_last;
  1491. uint32_t tx_data_ucast_rate;
  1492. struct cdp_pkt_type pkt_type[DOT11_MAX];
  1493. uint32_t sgi_count[MAX_GI];
  1494. uint32_t pream_punct_cnt;
  1495. uint32_t nss[SS_COUNT];
  1496. uint32_t bw[MAX_BW];
  1497. uint32_t wme_ac_type[WME_AC_MAX];
  1498. uint32_t excess_retries_per_ac[WME_AC_MAX];
  1499. struct cdp_pkt_info dot11_tx_pkts;
  1500. struct {
  1501. struct cdp_pkt_info fw_rem;
  1502. uint32_t fw_rem_notx;
  1503. uint32_t fw_rem_tx;
  1504. uint32_t age_out;
  1505. uint32_t fw_reason1;
  1506. uint32_t fw_reason2;
  1507. uint32_t fw_reason3;
  1508. uint32_t fw_rem_queue_disable;
  1509. uint32_t fw_rem_no_match;
  1510. uint32_t drop_threshold;
  1511. uint32_t drop_link_desc_na;
  1512. uint32_t invalid_drop;
  1513. uint32_t mcast_vdev_drop;
  1514. uint32_t invalid_rr;
  1515. } dropped;
  1516. uint32_t fw_tx_cnt;
  1517. uint32_t fw_tx_bytes;
  1518. uint32_t fw_txcount;
  1519. uint32_t fw_max4msframelen;
  1520. uint32_t fw_ratecount;
  1521. uint32_t ac_nobufs[WME_AC_MAX];
  1522. int32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1523. uint32_t inactive_time;
  1524. uint32_t tx_flags;
  1525. uint32_t tx_power;
  1526. /* MSDUs which the target sent but couldn't get an ack for */
  1527. struct cdp_pkt_info is_tx_no_ack;
  1528. uint16_t tx_ratecode;
  1529. /*add for peer and updated from ppdu*/
  1530. uint32_t ampdu_cnt;
  1531. uint32_t non_ampdu_cnt;
  1532. uint32_t failed_retry_count;
  1533. uint32_t retry_count;
  1534. uint32_t multiple_retry_count;
  1535. uint32_t last_tx_rate_used;
  1536. uint32_t tx_ppdus;
  1537. uint32_t tx_mpdus_success;
  1538. uint32_t tx_mpdus_tried;
  1539. struct cdp_tx_pkt_info transmit_type[MAX_TRANSMIT_TYPES];
  1540. uint32_t mu_group_id[MAX_MU_GROUP_ID];
  1541. uint32_t ru_start;
  1542. uint32_t ru_tones;
  1543. struct cdp_tx_pkt_info ru_loc[MAX_RU_LOCATIONS];
  1544. uint32_t num_ppdu_cookie_valid;
  1545. uint32_t no_ack_count[QDF_PROTO_SUBTYPE_MAX];
  1546. struct cdp_pkt_info tx_success_twt;
  1547. uint32_t nss_info:4,
  1548. mcs_info:4,
  1549. bw_info:4,
  1550. gi_info:4,
  1551. preamble_info:4;
  1552. uint32_t mpdu_success_with_retries;
  1553. unsigned long last_tx_ts;
  1554. #ifdef WLAN_FEATURE_11BE
  1555. struct cdp_pkt_type su_be_ppdu_cnt;
  1556. struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX];
  1557. uint32_t punc_bw[MAX_PUNCTURED_MODE];
  1558. #endif
  1559. uint32_t release_src_not_tqm;
  1560. uint32_t per;
  1561. uint32_t rts_success;
  1562. uint32_t rts_failure;
  1563. uint32_t bar_cnt;
  1564. uint32_t ndpa_cnt;
  1565. uint64_t wme_ac_type_bytes[WME_AC_MAX];
  1566. struct cdp_pkt_info tx_ucast_total;
  1567. struct cdp_pkt_info tx_ucast_success;
  1568. };
  1569. /**
  1570. * struct cdp_rx_stats - rx Level Stats
  1571. * @to_stack: Total packets sent up the stack
  1572. * @rcvd_reo: Packets received on the reo ring
  1573. * @rx_lmac: Packets received on which lmac
  1574. * @unicast: Total unicast packets
  1575. * @multicast: Total multicast packets
  1576. * @bcast: Broadcast Packet Count
  1577. * @raw: Raw Pakets received
  1578. * @nawds_mcast_drop: Total multicast packets
  1579. * @mec_drop: Total MEC packets dropped
  1580. * @last_rx_ts: last timestamp in jiffies when RX happened
  1581. * @intra_bss: Intra-bss statistics
  1582. * @intra_bss.pkts: Intra BSS packets received
  1583. * @intra_bss.fail: Intra BSS packets failed
  1584. * @intra_bss.mdns_no_fwd: Intra BSS MDNS packets not forwarded
  1585. * @protocol_trace_cnt: per-peer protocol counters
  1586. * @err: error countersa
  1587. * @err.mic_err: Rx MIC errors CCMP
  1588. * @err.decrypt_err: Rx Decryption Errors CRC
  1589. * @err.fcserr: rx MIC check failed (CCMP)
  1590. * @err.pn_err: pn check failed
  1591. * @err.oor_err: Rx OOR errors
  1592. * @err.jump_2k_err: 2k jump errors
  1593. * @err.rxdma_wifi_parse_err: rxdma wifi parse errors
  1594. * @wme_ac_type: Wireless Multimedia type Count
  1595. * @reception_type: Reception type os packets
  1596. * @pkt_type:
  1597. * @mcs_count: mcs count
  1598. * @sgi_count: sgi count
  1599. * @nss: packet count in spatial Streams
  1600. * @ppdu_nss: PPDU packet count in spatial streams
  1601. * @mpdu_cnt_fcs_ok: SU Rx success mpdu count
  1602. * @mpdu_cnt_fcs_err: SU Rx fail mpdu count
  1603. * @su_ax_ppdu_cnt: SU Rx packet count
  1604. * @ppdu_cnt: PPDU packet count in reception type
  1605. * @rx_mu: Rx MU stats
  1606. * @bw: Packet Count in different bandwidths
  1607. * @non_ampdu_cnt: Number of MSDUs with no MPDU level aggregation
  1608. * @ampdu_cnt: Number of MSDUs part of AMSPU
  1609. * @non_amsdu_cnt: Number of MSDUs with no MSDU level aggregation
  1610. * @amsdu_cnt: Number of MSDUs part of AMSDU
  1611. * @bar_recv_cnt: Number of bar received
  1612. * @avg_snr: Average snr
  1613. * @rx_rate: Rx rate
  1614. * @last_rx_rate: Previous rx rate
  1615. * @rnd_avg_rx_rate: Rounded average rx rate
  1616. * @avg_rx_rate: Average Rx rate
  1617. * @dot11_rx_pkts: dot11 rx packets
  1618. * @rx_bytes_success_last: last Rx success bytes
  1619. * @rx_data_success_last: last rx success data
  1620. * @rx_byte_rate: bytes received in last one sec
  1621. * @rx_data_rate: data received in last one sec
  1622. * @rx_retries: retries of packet in rx
  1623. * @rx_mpdus: mpdu in rx
  1624. * @rx_ppdus: ppdu in rx
  1625. * @rx_aggr: aggregation on rx
  1626. * @rx_discard: packets discard in rx
  1627. * @rx_ratecode: Rx rate code of last frame
  1628. * @rx_flags: rx flags
  1629. * @rx_snr_measured_time: Time at which snr is measured
  1630. * @snr: SNR of received signal
  1631. * @last_snr: Previous snr
  1632. * @multipass_rx_pkt_drop: Dropped multipass rx pkt
  1633. * @peer_unauth_rx_pkt_drop: Unauth rx packet drops
  1634. * @policy_check_drop: policy check drops
  1635. * @rx_mpdu_cnt: rx mpdu count per MCS rate
  1636. * @nss_info: NSS 1,2, ...8
  1637. * @mcs_info: MCS index
  1638. * @bw_info: Bandwidth
  1639. * <enum 0 bw_20_MHz>
  1640. * <enum 1 bw_40_MHz>
  1641. * <enum 2 bw_80_MHz>
  1642. * <enum 3 bw_160_MHz>
  1643. * @gi_info: <enum 0 0_8_us_sgi > Legacy normal GI
  1644. * <enum 1 0_4_us_sgi > Legacy short GI
  1645. * <enum 2 1_6_us_sgi > HE related GI
  1646. * <enum 3 3_2_us_sgi > HE
  1647. * @preamble_info: preamble
  1648. * @to_stack_twt: Total packets sent up the stack in TWT session
  1649. * @mpdu_retry_cnt: retries of mpdu in rx
  1650. * @su_be_ppdu_cnt: SU Rx packet count for BE
  1651. * @mu_be_ppdu_cnt: MU rx packet count for BE
  1652. * @punc_bw: MSDU count for punctured BW
  1653. * @mcast_3addr_drop:
  1654. * @bar_cnt: Block ACK Request frame count
  1655. * @ndpa_cnt: NDP announcement frame count
  1656. * @wme_ac_type_bytes: Wireless Multimedia type Byte Count
  1657. * @rx_total: Total rx count
  1658. */
  1659. struct cdp_rx_stats {
  1660. struct cdp_pkt_info to_stack;
  1661. struct cdp_pkt_info rcvd_reo[CDP_MAX_RX_RINGS];
  1662. struct cdp_pkt_info rx_lmac[CDP_MAX_LMACS];
  1663. struct cdp_pkt_info unicast;
  1664. struct cdp_pkt_info multicast;
  1665. struct cdp_pkt_info bcast;
  1666. struct cdp_pkt_info raw;
  1667. uint32_t nawds_mcast_drop;
  1668. struct cdp_pkt_info mec_drop;
  1669. unsigned long last_rx_ts;
  1670. struct {
  1671. struct cdp_pkt_info pkts;
  1672. struct cdp_pkt_info fail;
  1673. uint32_t mdns_no_fwd;
  1674. } intra_bss;
  1675. #ifdef VDEV_PEER_PROTOCOL_COUNT
  1676. struct protocol_trace_count protocol_trace_cnt[CDP_TRACE_MAX];
  1677. #endif
  1678. struct {
  1679. uint32_t mic_err;
  1680. uint32_t decrypt_err;
  1681. uint32_t fcserr;
  1682. uint32_t pn_err;
  1683. uint32_t oor_err;
  1684. uint32_t jump_2k_err;
  1685. uint32_t rxdma_wifi_parse_err;
  1686. } err;
  1687. uint32_t wme_ac_type[WME_AC_MAX];
  1688. uint32_t reception_type[MAX_RECEPTION_TYPES];
  1689. struct cdp_pkt_type pkt_type[DOT11_MAX];
  1690. uint32_t sgi_count[MAX_GI];
  1691. uint32_t nss[SS_COUNT];
  1692. uint32_t ppdu_nss[SS_COUNT];
  1693. uint32_t mpdu_cnt_fcs_ok;
  1694. uint32_t mpdu_cnt_fcs_err;
  1695. struct cdp_pkt_type su_ax_ppdu_cnt;
  1696. uint32_t ppdu_cnt[MAX_RECEPTION_TYPES];
  1697. struct cdp_rx_mu rx_mu[TXRX_TYPE_MU_MAX];
  1698. uint32_t bw[MAX_BW];
  1699. uint32_t non_ampdu_cnt;
  1700. uint32_t ampdu_cnt;
  1701. uint32_t non_amsdu_cnt;
  1702. uint32_t amsdu_cnt;
  1703. uint32_t bar_recv_cnt;
  1704. uint32_t avg_snr;
  1705. uint32_t rx_rate;
  1706. uint32_t last_rx_rate;
  1707. uint32_t rnd_avg_rx_rate;
  1708. uint32_t avg_rx_rate;
  1709. struct cdp_pkt_info dot11_rx_pkts;
  1710. uint32_t rx_bytes_success_last;
  1711. uint32_t rx_data_success_last;
  1712. uint32_t rx_byte_rate;
  1713. uint32_t rx_data_rate;
  1714. uint32_t rx_retries;
  1715. uint32_t rx_mpdus;
  1716. uint32_t rx_ppdus;
  1717. /*add for peer updated for ppdu*/
  1718. uint32_t rx_aggr;
  1719. uint32_t rx_discard;
  1720. uint32_t rx_ratecode;
  1721. uint32_t rx_flags;
  1722. unsigned long rx_snr_measured_time;
  1723. uint8_t snr;
  1724. uint8_t last_snr;
  1725. uint32_t multipass_rx_pkt_drop;
  1726. uint32_t peer_unauth_rx_pkt_drop;
  1727. uint32_t policy_check_drop;
  1728. uint32_t rx_mpdu_cnt[MAX_MCS];
  1729. uint32_t nss_info:4,
  1730. mcs_info:4,
  1731. bw_info:4,
  1732. gi_info:4,
  1733. preamble_info:4;
  1734. struct cdp_pkt_info to_stack_twt;
  1735. uint32_t mpdu_retry_cnt;
  1736. #ifdef WLAN_FEATURE_11BE
  1737. struct cdp_pkt_type su_be_ppdu_cnt;
  1738. struct cdp_pkt_type mu_be_ppdu_cnt[TXRX_TYPE_MU_MAX];
  1739. uint32_t punc_bw[MAX_PUNCTURED_MODE];
  1740. #endif
  1741. uint32_t mcast_3addr_drop;
  1742. uint32_t bar_cnt;
  1743. uint32_t ndpa_cnt;
  1744. uint64_t wme_ac_type_bytes[WME_AC_MAX];
  1745. #ifdef IPA_OFFLOAD
  1746. struct cdp_pkt_info rx_total;
  1747. #endif
  1748. };
  1749. /**
  1750. * struct cdp_tx_ingress_stats - Tx ingress Stats
  1751. * @rcvd: Total packets received for transmission
  1752. * @rcvd_in_fast_xmit_flow:
  1753. * @rcvd_per_core:
  1754. * @processed: Tx packets processed
  1755. * @reinject_pkts: Total packets reinjected
  1756. * @inspect_pkts: Total packets passed to inspect handler
  1757. * @nawds_mcast: NAWDS Multicast Packet Count
  1758. * @bcast: Number of broadcast packets
  1759. * @raw: Raw packet info
  1760. * @raw.raw_pkt: Total Raw packets
  1761. * @raw.dma_map_error: DMA map error
  1762. * @raq.invalid_raw_pkt_datatype:
  1763. * @raw.num_frags_overflow_err: msdu's nbuf count exceeds num of segments
  1764. * @sg: Scatter Gather packet info
  1765. * @sg.sg_pkt: Total scatter gather packets
  1766. * @sg.non_sg_pkts: non SG packets
  1767. * @sg.dropped_host: SG packets dropped by host
  1768. * @sg.dropped_target: SG packets dropped by target
  1769. * @sg.dma_map_error: Dma map error
  1770. * @mcast_en: Multicast Enhancement packets info
  1771. * @mcast_en.mcast_pkt: total no of multicast conversion packets
  1772. * @mcast_en.dropped_map_error: packets dropped due to map error
  1773. * @mcast_en.dropped_self_mac: packets dropped due to self Mac address
  1774. * @mcast_en.dropped_send_fail: Packets dropped due to send fail
  1775. * @mcast_en.ucast: total unicast packets transmitted
  1776. * @mcast_en.fail_seg_alloc: Segment allocation failure
  1777. * @mcast_en.clone_fail: NBUF clone failure
  1778. * @igmp_mcast_en: IGMP Multicast Enhancement packets info
  1779. * @igmp_mcast_en.igmp_rcvd: igmp pkts received for conversion to ucast pkts
  1780. * @igmp_mcast_en.igmp_ucast_converted: unicast pkts sent as part of VoW IGMP
  1781. * improvements
  1782. * @dropped: Packets dropped on the Tx side
  1783. * @dropped.dropped_pkt: Total scatter gather packets
  1784. * @dropped.desc_na: Desc Not Available
  1785. * @dropped.desc_na_exc_alloc_fail:
  1786. * @dropped.desc_na_outstand:
  1787. * @dropped.exc_desc_na: Exception desc Not Available
  1788. * @dropped.ring_full: ring full
  1789. * @dropped.enqueue_fail: hw enqueue fail
  1790. * @dropped.dma_error: dma fail
  1791. * @dropped.res_full: Resource Full: Congestion Control
  1792. * @dropped.headroom_insufficient: headroom insufficient
  1793. * @dropped.fail_per_pkt_vdev_id_check: Per pkt vdev id check
  1794. * @dropped.drop_ingress: Packets dropped during Umac reset
  1795. * @dropped.invalid_peer_id_in_exc_path:
  1796. * @dropped.tx_mcast_drop:
  1797. * @mesh: mesh packet information
  1798. * @mesh.exception_fw: packets sent to fw
  1799. * @mesh.completion_fw: packets completions received from fw
  1800. * @cce_classified:Number of packets classified by CCE
  1801. * @cce_classified_raw:Number of raw packets classified by CCE
  1802. * @sniffer_rcvd: Number of packets received with ppdu cookie
  1803. * @tso_stats:
  1804. */
  1805. struct cdp_tx_ingress_stats {
  1806. struct cdp_pkt_info rcvd;
  1807. uint64_t rcvd_in_fast_xmit_flow;
  1808. uint32_t rcvd_per_core[CDP_MAX_TX_DATA_RINGS];
  1809. struct cdp_pkt_info processed;
  1810. struct cdp_pkt_info reinject_pkts;
  1811. struct cdp_pkt_info inspect_pkts;
  1812. struct cdp_pkt_info nawds_mcast;
  1813. struct cdp_pkt_info bcast;
  1814. struct {
  1815. struct cdp_pkt_info raw_pkt;
  1816. uint32_t dma_map_error;
  1817. uint32_t invalid_raw_pkt_datatype;
  1818. uint32_t num_frags_overflow_err;
  1819. } raw;
  1820. struct {
  1821. struct cdp_pkt_info sg_pkt;
  1822. struct cdp_pkt_info non_sg_pkts;
  1823. struct cdp_pkt_info dropped_host;
  1824. uint32_t dropped_target;
  1825. uint32_t dma_map_error;
  1826. } sg;
  1827. struct {
  1828. struct cdp_pkt_info mcast_pkt;
  1829. uint32_t dropped_map_error;
  1830. uint32_t dropped_self_mac;
  1831. uint32_t dropped_send_fail;
  1832. uint32_t ucast;
  1833. uint32_t fail_seg_alloc;
  1834. uint32_t clone_fail;
  1835. } mcast_en;
  1836. struct {
  1837. uint32_t igmp_rcvd;
  1838. uint32_t igmp_ucast_converted;
  1839. } igmp_mcast_en;
  1840. struct {
  1841. struct cdp_pkt_info dropped_pkt;
  1842. struct cdp_pkt_info desc_na;
  1843. struct cdp_pkt_info desc_na_exc_alloc_fail;
  1844. struct cdp_pkt_info desc_na_exc_outstand;
  1845. struct cdp_pkt_info exc_desc_na;
  1846. uint32_t ring_full;
  1847. uint32_t enqueue_fail;
  1848. uint32_t dma_error;
  1849. uint32_t res_full;
  1850. uint32_t headroom_insufficient;
  1851. uint32_t fail_per_pkt_vdev_id_check;
  1852. uint32_t drop_ingress;
  1853. uint32_t invalid_peer_id_in_exc_path;
  1854. uint32_t tx_mcast_drop;
  1855. uint32_t fw2wbm_tx_drop;
  1856. } dropped;
  1857. struct {
  1858. uint32_t exception_fw;
  1859. uint32_t completion_fw;
  1860. } mesh;
  1861. uint32_t cce_classified;
  1862. uint32_t cce_classified_raw;
  1863. struct cdp_pkt_info sniffer_rcvd;
  1864. struct cdp_tso_stats tso_stats;
  1865. };
  1866. /**
  1867. * struct cdp_rx_ingress_stats - rx ingress stats
  1868. * @reo_rcvd_pkt: packets received at REO block
  1869. * @null_q_desc_pkt: null queue desc pkt count
  1870. * @routed_eapol_pkt: routed eapol pkt count
  1871. */
  1872. struct cdp_rx_ingress_stats {
  1873. struct cdp_pkt_info reo_rcvd_pkt;
  1874. struct cdp_pkt_info null_q_desc_pkt;
  1875. struct cdp_pkt_info routed_eapol_pkt;
  1876. };
  1877. /**
  1878. * struct cdp_vdev_stats - vdev stats structure
  1879. * @tx_i: ingress tx stats
  1880. * @rx_i: ingress rx stats
  1881. * @tx: cdp tx stats
  1882. * @rx: cdp rx stats
  1883. * @tso_stats: tso stats
  1884. * @tid_tx_stats: tid tx stats
  1885. */
  1886. struct cdp_vdev_stats {
  1887. struct cdp_tx_ingress_stats tx_i;
  1888. struct cdp_rx_ingress_stats rx_i;
  1889. struct cdp_tx_stats tx;
  1890. struct cdp_rx_stats rx;
  1891. struct cdp_tso_stats tso_stats;
  1892. #ifdef HW_TX_DELAY_STATS_ENABLE
  1893. struct cdp_tid_tx_stats tid_tx_stats[CDP_MAX_TX_COMP_RINGS]
  1894. [CDP_MAX_DATA_TIDS];
  1895. #endif
  1896. };
  1897. /**
  1898. * struct cdp_calibr_stats - Calibrated stats
  1899. * @tx: Tx statistics
  1900. * @last_per: Tx last packet error rate
  1901. * @tx_bytes_success_last: last Tx success bytes
  1902. * @tx_data_success_last: last Tx success data
  1903. * @tx_byte_rate: Bytes Trasmitted in last one sec
  1904. * @tx_data_rate: Data Transmitted in last one sec
  1905. * @tx_data_ucast_last: last unicast Tx bytes
  1906. * @tx_data_ucast_rate: last unicast Tx data
  1907. * @inactive_time: inactive time in secs
  1908. * @rx: Rx statistics
  1909. * @rx_bytes_success_last: last Rx success bytes
  1910. * @rx_data_success_last: last Rx success data
  1911. * @rx_byte_rate: Bytes received in last one sec
  1912. * @rx_data_rate: Data received in last one sec
  1913. */
  1914. struct cdp_calibr_stats {
  1915. struct {
  1916. uint32_t last_per;
  1917. uint32_t tx_bytes_success_last;
  1918. uint32_t tx_data_success_last;
  1919. uint32_t tx_byte_rate;
  1920. uint32_t tx_data_rate;
  1921. uint32_t tx_data_ucast_last;
  1922. uint32_t tx_data_ucast_rate;
  1923. uint32_t inactive_time;
  1924. } tx;
  1925. struct {
  1926. uint32_t rx_bytes_success_last;
  1927. uint32_t rx_data_success_last;
  1928. uint32_t rx_byte_rate;
  1929. uint32_t rx_data_rate;
  1930. } rx;
  1931. };
  1932. /**
  1933. * struct cdp_calibr_stats_intf: Calibrated stats interface
  1934. * @to_stack: Total packets sent up the stack
  1935. * @tx_success: Successful Tx Packets
  1936. * @tx_ucast: Tx Unicast Packet Count
  1937. */
  1938. struct cdp_calibr_stats_intf {
  1939. struct cdp_pkt_info to_stack;
  1940. struct cdp_pkt_info tx_success;
  1941. struct cdp_pkt_info tx_ucast;
  1942. };
  1943. /**
  1944. * struct cdp_peer_stats - peer stats structure
  1945. * @tx: cdp tx stats
  1946. * @rx: cdp rx stats
  1947. */
  1948. struct cdp_peer_stats {
  1949. struct cdp_tx_stats tx;
  1950. struct cdp_rx_stats rx;
  1951. };
  1952. /**
  1953. * struct cdp_peer_tid_stats - Per peer and per TID stats
  1954. * @tx_prev_delay: tx previous delay
  1955. * @tx_avg_jitter: tx average jitter
  1956. * @tx_avg_delay: tx average delay
  1957. * @tx_avg_err: tx average error
  1958. * @tx_total_success: tx total success
  1959. * @tx_drop: tx drop
  1960. */
  1961. struct cdp_peer_tid_stats {
  1962. #ifdef WLAN_PEER_JITTER
  1963. uint32_t tx_prev_delay;
  1964. uint32_t tx_avg_jitter;
  1965. uint32_t tx_avg_delay;
  1966. uint64_t tx_avg_err;
  1967. uint64_t tx_total_success;
  1968. uint64_t tx_drop;
  1969. #endif
  1970. };
  1971. /**
  1972. * struct cdp_interface_peer_stats - interface structure for txrx peer stats
  1973. * @peer_mac: peer mac address
  1974. * @vdev_id : vdev_id for the peer
  1975. * @rssi_changed: denotes rssi is changed
  1976. * @last_peer_tx_rate: peer tx rate for last transmission
  1977. * @peer_tx_rate: tx rate for current transmission
  1978. * @peer_rssi: current rssi value of peer
  1979. * @tx_packet_count: tx packet count
  1980. * @rx_packet_count: rx packet count
  1981. * @tx_byte_count: tx byte count
  1982. * @rx_byte_count: rx byte count
  1983. * @per: per error rate
  1984. * @ack_rssi: RSSI of the last ack received
  1985. * @free_buff: free tx descriptor count
  1986. * @rx_avg_snr: Avg Rx SNR
  1987. */
  1988. struct cdp_interface_peer_stats {
  1989. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  1990. uint8_t vdev_id;
  1991. uint8_t rssi_changed;
  1992. uint32_t last_peer_tx_rate;
  1993. uint32_t peer_tx_rate;
  1994. uint32_t peer_rssi;
  1995. uint32_t tx_packet_count;
  1996. uint32_t rx_packet_count;
  1997. uint32_t tx_byte_count;
  1998. uint32_t rx_byte_count;
  1999. uint32_t per;
  2000. uint32_t ack_rssi;
  2001. uint32_t free_buff;
  2002. uint32_t rx_avg_snr;
  2003. };
  2004. /**
  2005. * struct cdp_interface_peer_qos_stats - interface structure for peer qos stats
  2006. * @peer_mac: peer mac address
  2007. * @frame_control: frame control field
  2008. * @qos_control: qos control field
  2009. * @frame_control_info_valid: frame_control valid
  2010. * @qos_control_info_valid: qos_control valid
  2011. * @vdev_id : vdev_id for the peer
  2012. */
  2013. struct cdp_interface_peer_qos_stats {
  2014. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  2015. uint16_t frame_control;
  2016. uint16_t qos_control;
  2017. uint8_t frame_control_info_valid;
  2018. uint8_t qos_control_info_valid;
  2019. uint8_t vdev_id;
  2020. };
  2021. /* Tx completions per interrupt */
  2022. struct cdp_hist_tx_comp {
  2023. uint32_t pkts_1;
  2024. uint32_t pkts_2_20;
  2025. uint32_t pkts_21_40;
  2026. uint32_t pkts_41_60;
  2027. uint32_t pkts_61_80;
  2028. uint32_t pkts_81_100;
  2029. uint32_t pkts_101_200;
  2030. uint32_t pkts_201_plus;
  2031. };
  2032. /* Rx ring descriptors reaped per interrupt */
  2033. struct cdp_hist_rx_ind {
  2034. uint32_t pkts_1;
  2035. uint32_t pkts_2_20;
  2036. uint32_t pkts_21_40;
  2037. uint32_t pkts_41_60;
  2038. uint32_t pkts_61_80;
  2039. uint32_t pkts_81_100;
  2040. uint32_t pkts_101_200;
  2041. uint32_t pkts_201_plus;
  2042. };
  2043. struct cdp_htt_tlv_hdr {
  2044. /* BIT [11 : 0] :- tag
  2045. * BIT [23 : 12] :- length
  2046. * BIT [31 : 24] :- reserved
  2047. */
  2048. uint32_t tag__length;
  2049. };
  2050. #define HTT_STATS_SUBTYPE_MAX 16
  2051. struct cdp_htt_rx_pdev_fw_stats_tlv {
  2052. struct cdp_htt_tlv_hdr tlv_hdr;
  2053. /* BIT [ 7 : 0] :- mac_id
  2054. * BIT [31 : 8] :- reserved
  2055. */
  2056. uint32_t mac_id__word;
  2057. /* Num PPDU status processed from HW */
  2058. uint32_t ppdu_recvd;
  2059. /* Num MPDU across PPDUs with FCS ok */
  2060. uint32_t mpdu_cnt_fcs_ok;
  2061. /* Num MPDU across PPDUs with FCS err */
  2062. uint32_t mpdu_cnt_fcs_err;
  2063. /* Num MSDU across PPDUs */
  2064. uint32_t tcp_msdu_cnt;
  2065. /* Num MSDU across PPDUs */
  2066. uint32_t tcp_ack_msdu_cnt;
  2067. /* Num MSDU across PPDUs */
  2068. uint32_t udp_msdu_cnt;
  2069. /* Num MSDU across PPDUs */
  2070. uint32_t other_msdu_cnt;
  2071. /* Num MPDU on FW ring indicated */
  2072. uint32_t fw_ring_mpdu_ind;
  2073. /* Num MGMT MPDU given to protocol */
  2074. uint32_t fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  2075. /* Num ctrl MPDU given to protocol */
  2076. uint32_t fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  2077. /* Num mcast data packet received */
  2078. uint32_t fw_ring_mcast_data_msdu;
  2079. /* Num broadcast data packet received */
  2080. uint32_t fw_ring_bcast_data_msdu;
  2081. /* Num unicat data packet received */
  2082. uint32_t fw_ring_ucast_data_msdu;
  2083. /* Num null data packet received */
  2084. uint32_t fw_ring_null_data_msdu;
  2085. /* Num MPDU on FW ring dropped */
  2086. uint32_t fw_ring_mpdu_drop;
  2087. /* Num buf indication to offload */
  2088. uint32_t ofld_local_data_ind_cnt;
  2089. /* Num buf recycle from offload */
  2090. uint32_t ofld_local_data_buf_recycle_cnt;
  2091. /* Num buf indication to data_rx */
  2092. uint32_t drx_local_data_ind_cnt;
  2093. /* Num buf recycle from data_rx */
  2094. uint32_t drx_local_data_buf_recycle_cnt;
  2095. /* Num buf indication to protocol */
  2096. uint32_t local_nondata_ind_cnt;
  2097. /* Num buf recycle from protocol */
  2098. uint32_t local_nondata_buf_recycle_cnt;
  2099. /* Num buf fed */
  2100. uint32_t fw_status_buf_ring_refill_cnt;
  2101. /* Num ring empty encountered */
  2102. uint32_t fw_status_buf_ring_empty_cnt;
  2103. /* Num buf fed */
  2104. uint32_t fw_pkt_buf_ring_refill_cnt;
  2105. /* Num ring empty encountered */
  2106. uint32_t fw_pkt_buf_ring_empty_cnt;
  2107. /* Num buf fed */
  2108. uint32_t fw_link_buf_ring_refill_cnt;
  2109. /* Num ring empty encountered */
  2110. uint32_t fw_link_buf_ring_empty_cnt;
  2111. /* Num buf fed */
  2112. uint32_t host_pkt_buf_ring_refill_cnt;
  2113. /* Num ring empty encountered */
  2114. uint32_t host_pkt_buf_ring_empty_cnt;
  2115. /* Num buf fed */
  2116. uint32_t mon_pkt_buf_ring_refill_cnt;
  2117. /* Num ring empty encountered */
  2118. uint32_t mon_pkt_buf_ring_empty_cnt;
  2119. /* Num buf fed */
  2120. uint32_t mon_status_buf_ring_refill_cnt;
  2121. /* Num ring empty encountered */
  2122. uint32_t mon_status_buf_ring_empty_cnt;
  2123. /* Num buf fed */
  2124. uint32_t mon_desc_buf_ring_refill_cnt;
  2125. /* Num ring empty encountered */
  2126. uint32_t mon_desc_buf_ring_empty_cnt;
  2127. /* Num buf fed */
  2128. uint32_t mon_dest_ring_update_cnt;
  2129. /* Num ring full encountered */
  2130. uint32_t mon_dest_ring_full_cnt;
  2131. /* Num rx suspend is attempted */
  2132. uint32_t rx_suspend_cnt;
  2133. /* Num rx suspend failed */
  2134. uint32_t rx_suspend_fail_cnt;
  2135. /* Num rx resume attempted */
  2136. uint32_t rx_resume_cnt;
  2137. /* Num rx resume failed */
  2138. uint32_t rx_resume_fail_cnt;
  2139. /* Num rx ring switch */
  2140. uint32_t rx_ring_switch_cnt;
  2141. /* Num rx ring restore */
  2142. uint32_t rx_ring_restore_cnt;
  2143. /* Num rx flush issued */
  2144. uint32_t rx_flush_cnt;
  2145. };
  2146. /* == TX PDEV STATS == */
  2147. struct cdp_htt_tx_pdev_stats_cmn_tlv {
  2148. struct cdp_htt_tlv_hdr tlv_hdr;
  2149. /* BIT [ 7 : 0] :- mac_id
  2150. * BIT [31 : 8] :- reserved
  2151. */
  2152. uint32_t mac_id__word;
  2153. /* Num queued to HW */
  2154. uint32_t hw_queued;
  2155. /* Num PPDU reaped from HW */
  2156. uint32_t hw_reaped;
  2157. /* Num underruns */
  2158. uint32_t underrun;
  2159. /* Num HW Paused counter. */
  2160. uint32_t hw_paused;
  2161. /* Num HW flush counter. */
  2162. uint32_t hw_flush;
  2163. /* Num HW filtered counter. */
  2164. uint32_t hw_filt;
  2165. /* Num PPDUs cleaned up in TX abort */
  2166. uint32_t tx_abort;
  2167. /* Num MPDUs requed by SW */
  2168. uint32_t mpdu_requed;
  2169. /* excessive retries */
  2170. uint32_t tx_xretry;
  2171. /* Last used data hw rate code */
  2172. uint32_t data_rc;
  2173. /* frames dropped due to excessive sw retries */
  2174. uint32_t mpdu_dropped_xretry;
  2175. /* illegal rate phy errors */
  2176. uint32_t illgl_rate_phy_err;
  2177. /* wal pdev continuous xretry */
  2178. uint32_t cont_xretry;
  2179. /* wal pdev continuous xretry */
  2180. uint32_t tx_timeout;
  2181. /* wal pdev resets */
  2182. uint32_t pdev_resets;
  2183. /* PhY/BB underrun */
  2184. uint32_t phy_underrun;
  2185. /* MPDU is more than txop limit */
  2186. uint32_t txop_ovf;
  2187. /* Number of Sequences posted */
  2188. uint32_t seq_posted;
  2189. /* Number of Sequences failed queueing */
  2190. uint32_t seq_failed_queueing;
  2191. /* Number of Sequences completed */
  2192. uint32_t seq_completed;
  2193. /* Number of Sequences restarted */
  2194. uint32_t seq_restarted;
  2195. /* Number of MU Sequences posted */
  2196. uint32_t mu_seq_posted;
  2197. /* Number of time HW ring is paused between seq switch within ISR */
  2198. uint32_t seq_switch_hw_paused;
  2199. /* Number of times seq continuation in DSR */
  2200. uint32_t next_seq_posted_dsr;
  2201. /* Number of times seq continuation in ISR */
  2202. uint32_t seq_posted_isr;
  2203. /* Number of seq_ctrl cached. */
  2204. uint32_t seq_ctrl_cached;
  2205. /* Number of MPDUs successfully transmitted */
  2206. uint32_t mpdu_count_tqm;
  2207. /* Number of MSDUs successfully transmitted */
  2208. uint32_t msdu_count_tqm;
  2209. /* Number of MPDUs dropped */
  2210. uint32_t mpdu_removed_tqm;
  2211. /* Number of MSDUs dropped */
  2212. uint32_t msdu_removed_tqm;
  2213. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  2214. uint32_t mpdus_sw_flush;
  2215. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  2216. uint32_t mpdus_hw_filter;
  2217. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  2218. uint32_t mpdus_truncated;
  2219. /* Num MPDUs that was tried but didn't receive ACK or BA */
  2220. uint32_t mpdus_ack_failed;
  2221. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  2222. uint32_t mpdus_expired;
  2223. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  2224. uint32_t mpdus_seq_hw_retry;
  2225. /* Num of TQM acked cmds processed */
  2226. uint32_t ack_tlv_proc;
  2227. /* coex_abort_mpdu_cnt valid. */
  2228. uint32_t coex_abort_mpdu_cnt_valid;
  2229. /* coex_abort_mpdu_cnt from TX FES stats. */
  2230. uint32_t coex_abort_mpdu_cnt;
  2231. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  2232. uint32_t num_total_ppdus_tried_ota;
  2233. /* Number of data PPDUs tried over the air (OTA) */
  2234. uint32_t num_data_ppdus_tried_ota;
  2235. /* Num Local control/mgmt frames (MSDUs) queued */
  2236. uint32_t local_ctrl_mgmt_enqued;
  2237. /* local_ctrl_mgmt_freed:
  2238. * Num Local control/mgmt frames (MSDUs) done
  2239. * It includes all local ctrl/mgmt completions
  2240. * (acked, no ack, flush, TTL, etc)
  2241. */
  2242. uint32_t local_ctrl_mgmt_freed;
  2243. /* Num Local data frames (MSDUs) queued */
  2244. uint32_t local_data_enqued;
  2245. /* local_data_freed:
  2246. * Num Local data frames (MSDUs) done
  2247. * It includes all local data completions
  2248. * (acked, no ack, flush, TTL, etc)
  2249. */
  2250. uint32_t local_data_freed;
  2251. /* Num MPDUs tried by SW */
  2252. uint32_t mpdu_tried;
  2253. /* Num of waiting seq posted in isr completion handler */
  2254. uint32_t isr_wait_seq_posted;
  2255. uint32_t tx_active_dur_us_low;
  2256. uint32_t tx_active_dur_us_high;
  2257. };
  2258. #define DP_NUM_AC_WMM 4
  2259. struct cdp_pdev_obss_pd_stats_tlv {
  2260. struct cdp_htt_tlv_hdr tlv_hdr;
  2261. uint32_t num_obss_tx_ppdu_success;
  2262. uint32_t num_obss_tx_ppdu_failure;
  2263. /** num_sr_tx_transmissions:
  2264. * Counter of TX done by aborting other BSS RX with spatial reuse
  2265. * (for cases where rx RSSI from other BSS is below the packet-detection
  2266. * threshold for doing spatial reuse)
  2267. */
  2268. uint32_t num_sr_tx_transmissions;
  2269. /**
  2270. * Count the number of times the RSSI from an other-BSS signal
  2271. * is below the spatial reuse power threshold, thus providing an
  2272. * opportunity for spatial reuse since OBSS interference will be
  2273. * inconsequential.
  2274. */
  2275. uint32_t num_spatial_reuse_opportunities;
  2276. /**
  2277. * Count of number of times OBSS frames were aborted and non-SRG
  2278. * opportunities were created. Non-SRG opportunities are created when
  2279. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  2280. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  2281. * allow non-SRG TX.
  2282. */
  2283. uint32_t num_non_srg_opportunities;
  2284. /**
  2285. * Count of number of times TX PPDU were transmitted using non-SRG
  2286. * opportunities created. Incoming OBSS frame RSSI is compared with per
  2287. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  2288. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  2289. * transmission happens.
  2290. */
  2291. uint32_t num_non_srg_ppdu_tried;
  2292. /**
  2293. * Count of number of times non-SRG based TX transmissions were
  2294. * successful
  2295. */
  2296. uint32_t num_non_srg_ppdu_success;
  2297. /**
  2298. * Count of number of times OBSS frames were aborted and SRG
  2299. * opportunities were created. Srg opportunities are created when
  2300. * incoming OBSS RSSI is less than the global configured SRG RSSI
  2301. * threshold and SRC OBSS color / SRG OBSS BSSID / SRG partial bssid /
  2302. * SRG BSS color bitmap registers allow SRG TX.
  2303. */
  2304. uint32_t num_srg_opportunities;
  2305. /**
  2306. * Count of number of times TX PPDU were transmitted using SRG
  2307. * opportunities created.
  2308. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  2309. * threshold configured in each PPDU.
  2310. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  2311. * then SRG transmission happens.
  2312. */
  2313. uint32_t num_srg_ppdu_tried;
  2314. /**
  2315. * Count of number of times SRG based TX transmissions were successful
  2316. */
  2317. uint32_t num_srg_ppdu_success;
  2318. /**
  2319. * Count of number of times PSR opportunities were created by aborting
  2320. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  2321. * spatial reuse info in the OBSS trigger common field is set to allow
  2322. * PSR based spatial reuse.
  2323. */
  2324. uint32_t num_psr_opportunities;
  2325. /**
  2326. * Count of number of times TX PPDU were transmitted using PSR
  2327. * opportunities created.
  2328. */
  2329. uint32_t num_psr_ppdu_tried;
  2330. /**
  2331. * Count of number of times PSR based TX transmissions were successful.
  2332. */
  2333. uint32_t num_psr_ppdu_success;
  2334. /**
  2335. * Count of number of times TX PPDU per access category were transmitted
  2336. * using non-SRG opportunities created.
  2337. */
  2338. uint32_t num_non_srg_ppdu_tried_per_ac[DP_NUM_AC_WMM];
  2339. /**
  2340. * Count of number of times non-SRG based TX transmissions per access
  2341. * category were successful
  2342. */
  2343. uint32_t num_non_srg_ppdu_success_per_ac[DP_NUM_AC_WMM];
  2344. /**
  2345. * Count of number of times TX PPDU per access category were transmitted
  2346. * using SRG opportunities created.
  2347. */
  2348. uint32_t num_srg_ppdu_tried_per_ac[DP_NUM_AC_WMM];
  2349. /**
  2350. * Count of number of times SRG based TX transmissions per access
  2351. * category were successful
  2352. */
  2353. uint32_t num_srg_ppdu_success_per_ac[DP_NUM_AC_WMM];
  2354. /**
  2355. * Count of number of times ppdu was flushed due to ongoing OBSS
  2356. * frame duration value lesser than minimum required frame duration.
  2357. */
  2358. uint32_t num_obss_min_duration_check_flush_cnt;
  2359. /**
  2360. * Count of number of times ppdu was flushed due to ppdu duration
  2361. * exceeding aborted OBSS frame duration
  2362. */
  2363. uint32_t num_sr_ppdu_abort_flush_cnt;
  2364. };
  2365. struct cdp_htt_tx_pdev_stats_urrn_tlv_v {
  2366. struct cdp_htt_tlv_hdr tlv_hdr;
  2367. uint32_t urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  2368. };
  2369. /* NOTE: Variable length TLV, use length spec to infer array size */
  2370. struct cdp_htt_tx_pdev_stats_flush_tlv_v {
  2371. struct cdp_htt_tlv_hdr tlv_hdr;
  2372. uint32_t flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  2373. };
  2374. /* NOTE: Variable length TLV, use length spec to infer array size */
  2375. struct cdp_htt_tx_pdev_stats_sifs_tlv_v {
  2376. struct cdp_htt_tlv_hdr tlv_hdr;
  2377. uint32_t sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  2378. };
  2379. /* NOTE: Variable length TLV, use length spec to infer array size */
  2380. struct cdp_htt_tx_pdev_stats_phy_err_tlv_v {
  2381. struct cdp_htt_tlv_hdr tlv_hdr;
  2382. uint32_t phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  2383. };
  2384. /* == RX PDEV/SOC STATS == */
  2385. /* HTT_STATS_RX_SOC_FW_STATS_TAG */
  2386. struct cdp_htt_rx_soc_fw_stats_tlv {
  2387. struct cdp_htt_tlv_hdr tlv_hdr;
  2388. /* Num Packets received on REO FW ring */
  2389. uint32_t fw_reo_ring_data_msdu;
  2390. /* Num bc/mc packets indicated from fw to host */
  2391. uint32_t fw_to_host_data_msdu_bcmc;
  2392. /* Num unicast packets indicated from fw to host */
  2393. uint32_t fw_to_host_data_msdu_uc;
  2394. /* Num remote buf recycle from offload */
  2395. uint32_t ofld_remote_data_buf_recycle_cnt;
  2396. /* Num remote free buf given to offload */
  2397. uint32_t ofld_remote_free_buf_indication_cnt;
  2398. };
  2399. struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v {
  2400. struct cdp_htt_tlv_hdr tlv_hdr;
  2401. /* Num total buf refilled from refill ring */
  2402. uint32_t refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2403. };
  2404. struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v {
  2405. struct cdp_htt_tlv_hdr tlv_hdr;
  2406. /* Num error MPDU for each RxDMA error type */
  2407. uint32_t fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  2408. };
  2409. struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v {
  2410. struct cdp_htt_tlv_hdr tlv_hdr;
  2411. /* Num MPDU dropped */
  2412. uint32_t fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  2413. };
  2414. #define HTT_STATS_PHY_ERR_MAX 43
  2415. struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv {
  2416. struct cdp_htt_tlv_hdr tlv_hdr;
  2417. /* BIT [ 7 : 0] :- mac_id
  2418. * BIT [31 : 8] :- reserved
  2419. */
  2420. uint32_t mac_id__word;
  2421. /* Num of phy err */
  2422. uint32_t total_phy_err_cnt;
  2423. /* Counts of different types of phy errs
  2424. * The mapping of PHY error types to phy_err array elements is HW dependent.
  2425. * The only currently-supported mapping is shown below:
  2426. *
  2427. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  2428. * 1 phyrx_err_synth_off
  2429. * 2 phyrx_err_ofdma_timing
  2430. * 3 phyrx_err_ofdma_signal_parity
  2431. * 4 phyrx_err_ofdma_rate_illegal
  2432. * 5 phyrx_err_ofdma_length_illegal
  2433. * 6 phyrx_err_ofdma_restart
  2434. * 7 phyrx_err_ofdma_service
  2435. * 8 phyrx_err_ppdu_ofdma_power_drop
  2436. * 9 phyrx_err_cck_blokker
  2437. * 10 phyrx_err_cck_timing
  2438. * 11 phyrx_err_cck_header_crc
  2439. * 12 phyrx_err_cck_rate_illegal
  2440. * 13 phyrx_err_cck_length_illegal
  2441. * 14 phyrx_err_cck_restart
  2442. * 15 phyrx_err_cck_service
  2443. * 16 phyrx_err_cck_power_drop
  2444. * 17 phyrx_err_ht_crc_err
  2445. * 18 phyrx_err_ht_length_illegal
  2446. * 19 phyrx_err_ht_rate_illegal
  2447. * 20 phyrx_err_ht_zlf
  2448. * 21 phyrx_err_false_radar_ext
  2449. * 22 phyrx_err_green_field
  2450. * 23 phyrx_err_bw_gt_dyn_bw
  2451. * 24 phyrx_err_leg_ht_mismatch
  2452. * 25 phyrx_err_vht_crc_error
  2453. * 26 phyrx_err_vht_siga_unsupported
  2454. * 27 phyrx_err_vht_lsig_len_invalid
  2455. * 28 phyrx_err_vht_ndp_or_zlf
  2456. * 29 phyrx_err_vht_nsym_lt_zero
  2457. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  2458. * 31 phyrx_err_vht_rx_skip_group_id0
  2459. * 32 phyrx_err_vht_rx_skip_group_id1to62
  2460. * 33 phyrx_err_vht_rx_skip_group_id63
  2461. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  2462. * 35 phyrx_err_defer_nap
  2463. * 36 phyrx_err_fdomain_timeout
  2464. * 37 phyrx_err_lsig_rel_check
  2465. * 38 phyrx_err_bt_collision
  2466. * 39 phyrx_err_unsupported_mu_feedback
  2467. * 40 phyrx_err_ppdu_tx_interrupt_rx
  2468. * 41 phyrx_err_unsupported_cbf
  2469. * 42 phyrx_err_other
  2470. */
  2471. uint32_t phy_err[HTT_STATS_PHY_ERR_MAX];
  2472. };
  2473. struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v {
  2474. struct cdp_htt_tlv_hdr tlv_hdr;
  2475. /* Num ring empty encountered */
  2476. uint32_t refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  2477. };
  2478. struct cdp_htt_tx_pdev_stats {
  2479. struct cdp_htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  2480. struct cdp_htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  2481. struct cdp_htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  2482. struct cdp_htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  2483. struct cdp_htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  2484. struct cdp_pdev_obss_pd_stats_tlv obss_pd_stats_tlv;
  2485. };
  2486. struct cdp_htt_rx_soc_stats_t {
  2487. struct cdp_htt_rx_soc_fw_stats_tlv fw_tlv;
  2488. struct cdp_htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  2489. struct cdp_htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  2490. };
  2491. struct cdp_htt_rx_pdev_stats {
  2492. struct cdp_htt_rx_soc_stats_t soc_stats;
  2493. struct cdp_htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  2494. struct cdp_htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  2495. struct cdp_htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  2496. struct cdp_htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  2497. };
  2498. #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  2499. /* Since protocol type enumeration value is passed as CCE metadata
  2500. * to firmware, add a constant offset before passing it to firmware
  2501. */
  2502. #define RX_PROTOCOL_TAG_START_OFFSET 128
  2503. /* This should align with packet type enumerations in ieee80211_ioctl.h
  2504. * and wmi_unified_param.h files
  2505. */
  2506. #define RX_PROTOCOL_TAG_MAX 24
  2507. /* Macro that should be used to dump the statistics counter for all
  2508. * protocol types
  2509. */
  2510. #define RX_PROTOCOL_TAG_ALL 0xff
  2511. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  2512. #ifdef WLAN_FEATURE_11BE
  2513. #define OFDMA_NUM_RU_SIZE 16
  2514. #else
  2515. #define OFDMA_NUM_RU_SIZE 7
  2516. #endif
  2517. #define OFDMA_NUM_USERS 37
  2518. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2519. /**
  2520. * enum mac_freeze_capture_reason - capture reason counters
  2521. * @FREEZE_REASON_TM: When m_directed_ftm is enabled, this CFR data is
  2522. * captured for a Timing Measurement (TM) frame.
  2523. * @FREEZE_REASON_FTM: When m_directed_ftm is enabled, this CFR data is
  2524. * captured for a Fine Timing Measurement (FTM) frame.
  2525. * @FREEZE_REASON_ACK_RESP_TO_TM_FTM: When m_all_ftm_ack is enabled, this CFR
  2526. * data is captured for an ACK received for the FTM/TM frame sent to a station.
  2527. * @FREEZE_REASON_TA_RA_TYPE_FILTER: When m_ta_ra_filter is enabled, this CFR
  2528. * data is captured for a PPDU received,since the CFR TA_RA filter is met.
  2529. * @FREEZE_REASON_NDPA_NDP: When m_ndpa_ndp_directed(or)m_ndpa_ndp_all is
  2530. * enabled, this CFR data is captured for an NDP frame received.
  2531. * @FREEZE_REASON_ALL_PACKET: When m_all_packet is enabled, this CFR data is
  2532. * captured for an incoming PPDU.
  2533. * @FREEZE_REASON_MAX: Maximum value
  2534. */
  2535. enum mac_freeze_capture_reason {
  2536. FREEZE_REASON_TM = 0,
  2537. FREEZE_REASON_FTM,
  2538. FREEZE_REASON_ACK_RESP_TO_TM_FTM,
  2539. FREEZE_REASON_TA_RA_TYPE_FILTER,
  2540. FREEZE_REASON_NDPA_NDP,
  2541. FREEZE_REASON_ALL_PACKET,
  2542. FREEZE_REASON_MAX,
  2543. };
  2544. /**
  2545. * enum chan_capture_status - capture status counters
  2546. * @CAPTURE_IDLE: CFR data is not captured, since VCSR setting for CFR/RCC is
  2547. * not enabled.
  2548. * @CAPTURE_BUSY: CFR data is not available, since previous channel
  2549. * upload is in progress
  2550. * @CAPTURE_ACTIVE: CFR data is captured in HW registers
  2551. * @CAPTURE_NO_BUFFER: CFR data is not captured, since no buffer is available
  2552. * in IPC ring to DMA CFR data
  2553. * @CAPTURE_MAX: Maximum value
  2554. */
  2555. enum chan_capture_status {
  2556. CAPTURE_IDLE = 0,
  2557. CAPTURE_BUSY,
  2558. CAPTURE_ACTIVE,
  2559. CAPTURE_NO_BUFFER,
  2560. CAPTURE_MAX,
  2561. };
  2562. /**
  2563. * struct cdp_cfr_rcc_stats - CFR RCC debug statistics
  2564. * @bb_captured_channel_cnt: No. of PPDUs for which MAC sent Freeze TLV to PHY
  2565. * @bb_captured_timeout_cnt: No. of PPDUs for which CFR filter criteria matched
  2566. * but MAC did not send Freeze TLV to PHY as time exceeded freeze tlv delay
  2567. * count threshold
  2568. * @rx_loc_info_valid_cnt: No. of PPDUs for which PHY could find a valid buffer
  2569. * in ucode IPC ring
  2570. * @chan_capture_status: capture status counters
  2571. * [0] - No. of PPDUs with capture status CAPTURE_IDLE
  2572. * [1] - No. of PPDUs with capture status CAPTURE_BUSY
  2573. * [2] - No. of PPDUs with capture status CAPTURE_ACTIVE
  2574. * [3] - No. of PPDUs with capture status CAPTURE_NO_BUFFER
  2575. * @reason_cnt: capture reason counters
  2576. * [0] - No. PPDUs filtered due to freeze_reason_TM
  2577. * [1] - No. PPDUs filtered due to freeze_reason_FTM
  2578. * [2] - No. PPDUs filtered due to freeze_reason_ACK_resp_to_TM_FTM
  2579. * [3] - No. PPDUs filtered due to freeze_reason_TA_RA_TYPE_FILTER
  2580. * [4] - No. PPDUs filtered due to freeze_reason_NDPA_NDP
  2581. * [5] - No. PPDUs filtered due to freeze_reason_ALL_PACKET
  2582. */
  2583. struct cdp_cfr_rcc_stats {
  2584. uint64_t bb_captured_channel_cnt;
  2585. uint64_t bb_captured_timeout_cnt;
  2586. uint64_t rx_loc_info_valid_cnt;
  2587. uint64_t chan_capture_status[CAPTURE_MAX];
  2588. uint64_t reason_cnt[FREEZE_REASON_MAX];
  2589. };
  2590. #else
  2591. struct cdp_cfr_rcc_stats {
  2592. };
  2593. #endif
  2594. /**
  2595. * struct cdp_per_cpu_packets - Per cpu packets
  2596. * @num_cpus: Number of cpus
  2597. * @pkts: packet count per core
  2598. */
  2599. struct cdp_per_cpu_packets {
  2600. uint8_t num_cpus;
  2601. uint64_t pkts[CDP_NR_CPUS][CDP_MAX_RX_DEST_RINGS];
  2602. };
  2603. /**
  2604. * struct cdp_soc_stats - soc stats
  2605. * @tx:
  2606. * @tx.egress: Total packets transmitted
  2607. * @tx.tx_invalid_peer: packets dropped on tx because of no peer
  2608. * @tx.tx_hw_enq: Enqueues per tx hw ring
  2609. * @tx.tx_hw_ring_full: descriptors in each tx hw ring
  2610. * @tx.desc_in_use: Descriptors in use at soc
  2611. * @tx.dropped_fw_removed: HW_release_reason == FW removed
  2612. * @tx.invalid_release_source: tx completion release_src != HW or FW
  2613. * @tx.invalid_tx_comp_desc: TX Desc from completion ring Desc is not valid
  2614. * @tx.wifi_internal_error: tx completion wifi_internal_error
  2615. * @tx.non_wifi_internal_err: tx completion non_wifi_internal_error
  2616. * @tx.tx_comp_loop_pkt_limit_hit: TX Comp loop packet limit hit
  2617. * @tx.hp_oos2: Head pointer Out of sync at the end of dp_tx_comp_handler
  2618. * @tx.tx_comp_exception: tx desc freed as part of vdev detach
  2619. * @rx:
  2620. * @rx.ingress: Total rx packets count
  2621. * @rx.err_ring_pkts: Total Packets in Rx Error ring
  2622. * @rx.rx_frags: No of Fragments
  2623. * @rx.rx_hw_reinject: No of reinjected packets
  2624. * @rx.bar_frame: Number of bar frames received
  2625. * @rx.rx_frag_err_len_error: Fragments dropped due to len errors in skb
  2626. * @rx.rx_frag_err_no_peer: Fragments dropped due to no peer found
  2627. * @rx.rx_frag_wait: No of incomplete fragments in waitlist
  2628. * @rx.rx_frag_err: Fragments dropped due to errors
  2629. * @rx.rx_frag_oor: Fragments received OOR causing sequence num mismatch
  2630. * @rx.reap_loop_pkt_limit_hit: Reap loop packet limit hit
  2631. * @rx.hp_oos2: Head pointer Out of sync at the end of dp_rx_process
  2632. * @rx.near_full: Rx ring near full
  2633. * @rx.msdu_scatter_wait_break: Break ring reaping as not all scattered msdu
  2634. * received
  2635. * @rx.rx_sw_route_drop: Number of frames routed from rx sw ring
  2636. * @rx.rx_hw_route_drop: Number of frames routed from rx hw ring
  2637. * @rx.rx_packets: packet count per core
  2638. * @rx.err.rx_rejected: RX msdu rejected count on delivery to vdev stack_fn
  2639. * @rx.err.raw_frm_drop: RX raw frame dropped count
  2640. * @rx.err.phy_ring_access_fail: phy ring access Fail error count
  2641. * @rx.err.phy_ring_access_full_fail: phy ring access full Fail error count
  2642. * @rx.err.phy_rx_error: phy rx order ERR Count
  2643. * @rx.err.phy_rx_dest_dup: phy rx order DEST Duplicate count
  2644. * @rx.err.phy_wifi_rel_dup: phy wifi RELEASE Duplicate count
  2645. * @rx.err.phy_rx_sw_err_dup: phy rx sw error Duplicate count
  2646. * @rx.err.invalid_rbm: Invalid RBM error count
  2647. * @rx.err.invalid_vdev: Invalid VDEV Error count
  2648. * @rx.err.invalid_pdev: Invalid PDEV error count
  2649. * @rx.err.pkt_delivered_no_peer: Pkts delivered to stack that no related peer
  2650. * @rx.err.defrag_peer_uninit: Defrag peer uninit error count
  2651. * @rx.err.invalid_sa_da_idx: Invalid sa_idx or da_idx
  2652. * @rx.err.msdu_done_fail: MSDU DONE failures
  2653. * @ex.err.rx_invalid_peer: Invalid PEER Error count
  2654. * @rx.err.rx_invalid_peer_id: Invalid PEER ID count
  2655. * @rx.err.rx_invalid_pkt_len: Invalid packet length count
  2656. * @rx.err.rx_sw_error: RX sw error count
  2657. * @rx.err.rx_desc_invalid_magic: RX DEST Desc Invalid Magic count
  2658. * @rx.err.rx_hw_error: rx hw Error count
  2659. * @rx.err.rx_hw_cmd_send_fail: Rx hw cmd send fail/requeue count
  2660. * @rx.err.rx_hw_cmd_send_drain: Rx hw cmd send drain count
  2661. * @rx.err.scatter_msdu: RX msdu drop count due to scatter
  2662. * @rx.err.invalid_cookie: RX msdu drop count due to invalid cookie
  2663. * @rx.err.stale_cookie: Count of stale cookie read in RX path
  2664. * @rx.err.rx_2k_jump_delba_sent: Delba sent count due to RX 2k jump
  2665. * @rx.err.rx_2k_jump_to_stack: RX 2k jump msdu indicated to stack count
  2666. * @rx.err.rx_2k_jump_drop: RX 2k jump msdu dropped count
  2667. * @rx.err.rx_hw_err_oor_drop: Rx HW OOR msdu drop count
  2668. * @rx.err.rx_hw_err_oor_to_stack: Rx HW OOR msdu indicated to stack count
  2669. * @rx.err.rx_hw_err_oor_sg_count: Rx HW OOR scattered msdu count
  2670. * @rx.err.msdu_count_mismatch: Incorrect msdu count in MPDU desc info
  2671. * @rx.err.invalid_link_cookie: Stale link desc cookie count
  2672. * @rx.err.nbuf_sanity_fail: Nbuf sanity failure
  2673. * @rx.err.dup_refill_link_desc: Duplicate link desc refilled
  2674. * @rx.err.msdu_continuation_err: Incorrect msdu continuation bit in MSDU desc
  2675. * @rx.err.ssn_update_count: Count of start sequence (ssn) updates
  2676. * @rx.err.bar_handle_fail_count: Count of bar handling fail
  2677. * @rx.err.intrabss_eapol_drop: EAPOL drop count in intrabss scenario
  2678. * @rx.err.pn_in_dest_check_fail: PN check failed for 2K-jump or OOR error
  2679. * @rx.err.msdu_len_err: MSDU len err count
  2680. * @rx.err.rx_flush_count: Rx flush count
  2681. * @ast:
  2682. * @ast.added: ast entry added count
  2683. * @ast.deleted: ast entry deleted count
  2684. * @ast.aged_out: ast entry aged out count
  2685. * @ast.map_err: ast entry mapping error count
  2686. * @ast.ast_mismatch: ast entry mismatch count
  2687. * @mec:
  2688. * @mec.added: Mec added count
  2689. * @mec.deleted: Mec deleted count
  2690. */
  2691. struct cdp_soc_stats {
  2692. struct {
  2693. struct cdp_pkt_info egress;
  2694. struct cdp_pkt_info tx_invalid_peer;
  2695. uint32_t tx_hw_enq[CDP_MAX_TX_DATA_RINGS];
  2696. uint32_t tx_hw_ring_full[CDP_MAX_TX_DATA_RINGS];
  2697. uint32_t desc_in_use;
  2698. uint32_t dropped_fw_removed;
  2699. uint32_t invalid_release_source;
  2700. uint32_t invalid_tx_comp_desc;
  2701. uint32_t wifi_internal_error[CDP_MAX_WIFI_INT_ERROR_REASONS];
  2702. uint32_t non_wifi_internal_err;
  2703. uint32_t tx_comp_loop_pkt_limit_hit;
  2704. uint32_t hp_oos2;
  2705. uint32_t tx_comp_exception;
  2706. } tx;
  2707. struct {
  2708. struct cdp_pkt_info ingress;
  2709. uint32_t err_ring_pkts;
  2710. uint32_t rx_frags;
  2711. uint32_t rx_hw_reinject;
  2712. uint32_t bar_frame;
  2713. uint32_t rx_frag_err_len_error;
  2714. uint32_t rx_frag_err_no_peer;
  2715. uint32_t rx_frag_wait;
  2716. uint32_t rx_frag_err;
  2717. uint32_t rx_frag_oor;
  2718. uint32_t reap_loop_pkt_limit_hit;
  2719. uint32_t hp_oos2;
  2720. uint32_t near_full;
  2721. uint32_t msdu_scatter_wait_break;
  2722. uint32_t rx_sw_route_drop;
  2723. uint32_t rx_hw_route_drop;
  2724. struct cdp_per_cpu_packets rx_packets;
  2725. struct {
  2726. uint32_t rx_rejected;
  2727. uint32_t rx_raw_frm_drop;
  2728. uint32_t phy_ring_access_fail;
  2729. uint32_t phy_ring_access_full_fail;
  2730. uint32_t phy_rx_hw_error[CDP_MAX_RX_DEST_RINGS];
  2731. uint32_t phy_rx_hw_dest_dup;
  2732. uint32_t phy_wifi_rel_dup;
  2733. uint32_t phy_rx_sw_err_dup;
  2734. uint32_t invalid_rbm;
  2735. uint32_t invalid_vdev;
  2736. uint32_t invalid_pdev;
  2737. uint32_t pkt_delivered_no_peer;
  2738. uint32_t defrag_peer_uninit;
  2739. uint32_t invalid_sa_da_idx;
  2740. uint32_t msdu_done_fail;
  2741. struct cdp_pkt_info rx_invalid_peer;
  2742. struct cdp_pkt_info rx_invalid_peer_id;
  2743. struct cdp_pkt_info rx_invalid_pkt_len;
  2744. uint32_t rx_sw_error[CDP_WIFI_ERR_MAX];
  2745. uint32_t rx_desc_invalid_magic;
  2746. uint32_t rx_hw_error[CDP_RX_ERR_MAX];
  2747. uint32_t rx_hw_cmd_send_fail;
  2748. uint32_t rx_hw_cmd_send_drain;
  2749. uint32_t scatter_msdu;
  2750. uint32_t invalid_cookie;
  2751. uint32_t stale_cookie;
  2752. uint32_t rx_2k_jump_delba_sent;
  2753. uint32_t rx_2k_jump_to_stack;
  2754. uint32_t rx_2k_jump_drop;
  2755. uint32_t rx_hw_err_msdu_buf_rcved;
  2756. uint32_t rx_hw_err_msdu_buf_invalid_cookie;
  2757. uint32_t rx_hw_err_oor_drop;
  2758. uint32_t rx_hw_err_raw_mpdu_drop;
  2759. uint32_t rx_hw_err_oor_to_stack;
  2760. uint32_t rx_hw_err_oor_sg_count;
  2761. uint32_t msdu_count_mismatch;
  2762. uint32_t invalid_link_cookie;
  2763. uint32_t nbuf_sanity_fail;
  2764. uint32_t dup_refill_link_desc;
  2765. uint32_t msdu_continuation_err;
  2766. uint32_t ssn_update_count;
  2767. uint32_t bar_handle_fail_count;
  2768. uint32_t intrabss_eapol_drop;
  2769. uint32_t pn_in_dest_check_fail;
  2770. uint32_t msdu_len_err;
  2771. uint32_t rx_flush_count;
  2772. } err;
  2773. } rx;
  2774. struct {
  2775. uint32_t added;
  2776. uint32_t deleted;
  2777. uint32_t aged_out;
  2778. uint32_t map_err;
  2779. uint32_t ast_mismatch;
  2780. } ast;
  2781. struct {
  2782. uint32_t added;
  2783. uint32_t deleted;
  2784. } mec;
  2785. };
  2786. #ifdef WLAN_TELEMETRY_STATS_SUPPORT
  2787. /**
  2788. * struct cdp_pdev_telemetry_stats- Structure to hold pdev telemetry stats
  2789. * @tx_mpdu_failed: Tx mpdu failed
  2790. * @tx_mpdu_total: Total tx mpdus
  2791. * @link_airtime: pdev airtime usage per ac per sec
  2792. */
  2793. struct cdp_pdev_telemetry_stats {
  2794. uint32_t tx_mpdu_failed[WME_AC_MAX];
  2795. uint32_t tx_mpdu_total[WME_AC_MAX];
  2796. uint32_t link_airtime[WME_AC_MAX];
  2797. };
  2798. /**
  2799. * struct cdp_peer_telemetry_stats- Structure to hold peer telemetry stats
  2800. * @tx_mpdu_retried: Tx mpdus retried
  2801. * @tx_mpdu_total: Total tx mpdus
  2802. * @rx_mpdu_retried: Rx mpdus retried
  2803. * @rx_mpdu_total: Total rx mpdus
  2804. * @tx_airtime_consumption: tx airtime consumption of that peer
  2805. * @rx_airtime_consumption: rx airtime consumption of that peer
  2806. * @snr: peer average snr
  2807. */
  2808. struct cdp_peer_telemetry_stats {
  2809. uint32_t tx_mpdu_retried;
  2810. uint32_t tx_mpdu_total;
  2811. uint32_t rx_mpdu_retried;
  2812. uint32_t rx_mpdu_total;
  2813. uint16_t tx_airtime_consumption[WME_AC_MAX];
  2814. uint16_t rx_airtime_consumption[WME_AC_MAX];
  2815. uint8_t snr;
  2816. };
  2817. /**
  2818. * struct cdp_peer_tx_dl_deter- Structure to hold peer DL deterministic stats
  2819. * @avg_rate: Average TX rate
  2820. * @mode_cnt: TX mode count
  2821. */
  2822. struct cdp_peer_tx_dl_deter {
  2823. uint64_t avg_rate;
  2824. uint32_t mode_cnt;
  2825. };
  2826. /**
  2827. * struct cdp_peer_tx_ul_deter- Structure to hold peer UL deterministic stats
  2828. * @avg_rate: Average TX rate
  2829. * @mode_cnt: TX mode count
  2830. * @trigger_success: Trigger frame received success
  2831. * @trigger_fail: Trigger frame received fail
  2832. */
  2833. struct cdp_peer_tx_ul_deter {
  2834. uint64_t avg_rate;
  2835. uint32_t mode_cnt;
  2836. uint32_t trigger_success;
  2837. uint32_t trigger_fail;
  2838. };
  2839. /**
  2840. * struct cdp_peer_rx_deter- Structure to hold peer rx deterministic stats
  2841. * @avg_rate: Average RX rate
  2842. * @mode_cnt: RX mode count
  2843. */
  2844. struct cdp_peer_rx_deter {
  2845. uint64_t avg_rate;
  2846. uint32_t mode_cnt;
  2847. };
  2848. /**
  2849. * struct cdp_peer_deter_stats- Structure to hold peer deterministic stats
  2850. * @dl_det: TX DL deterministic stats
  2851. * @ul_det: TX UL deterministic stats
  2852. * @rx_det: RX deterministic stats
  2853. */
  2854. struct cdp_peer_deter_stats {
  2855. struct cdp_peer_tx_dl_deter dl_det[MSDUQ_INDEX_MAX][TX_MODE_DL_MAX];
  2856. struct cdp_peer_tx_ul_deter ul_det[TX_MODE_UL_MAX];
  2857. struct cdp_peer_rx_deter rx_det;
  2858. };
  2859. /**
  2860. * struct cdp_pdev_chan_util_stats - pdev channel utilization stats
  2861. * @ap_chan_util: Channel utilization
  2862. * @ap_tx_util: TX utilization
  2863. * @ap_rx_util: RX utilization
  2864. */
  2865. struct cdp_pdev_chan_util_stats {
  2866. uint8_t ap_chan_util;
  2867. uint8_t ap_tx_util;
  2868. uint8_t ap_rx_util;
  2869. };
  2870. /**
  2871. * struct cdp_pdev_ul_trigger_status - Structure to hold UL trigger status
  2872. * @trigger_success: Trigger success
  2873. * @trigger_fail: Trigger fail
  2874. */
  2875. struct cdp_pdev_ul_trigger_status {
  2876. uint64_t trigger_success;
  2877. uint64_t trigger_fail;
  2878. };
  2879. /**
  2880. * struct cdp_pdev_deter_stats - Structure to hold pdev deterministic stats
  2881. * @dl_ofdma_usr: num_user counter for dl ofdma
  2882. * @ul_ofdma_usr: num_user counter for ul ofdma
  2883. * @dl_mimo_usr: num_user counter for dl mimo
  2884. * @ul_mimo_usr: num_user counter for ul mimo
  2885. * @dl_mode_cnt: DL tx mode counter
  2886. * @ul_mode_cnt: UL tx mode counter
  2887. * @rx_su_cnt: RX su counter
  2888. * @ch_access_delay:
  2889. * @ch_util: channel congestion stats
  2890. * @ts: trigger status for ul
  2891. */
  2892. struct cdp_pdev_deter_stats {
  2893. uint64_t dl_ofdma_usr[CDP_MU_MAX_USERS];
  2894. uint64_t ul_ofdma_usr[CDP_MU_MAX_USERS];
  2895. uint64_t dl_mimo_usr[CDP_MU_MAX_USERS];
  2896. uint64_t ul_mimo_usr[CDP_MU_MAX_USERS];
  2897. uint64_t dl_mode_cnt[TX_MODE_DL_MAX];
  2898. uint64_t ul_mode_cnt[TX_MODE_UL_MAX];
  2899. uint64_t rx_su_cnt;
  2900. uint32_t ch_access_delay[WME_AC_MAX];
  2901. struct cdp_pdev_chan_util_stats ch_util;
  2902. struct cdp_pdev_ul_trigger_status ts[TX_MODE_UL_MAX];
  2903. };
  2904. #endif
  2905. /**
  2906. * struct cdp_pdev_stats - pdev stats
  2907. * @dropped: dropped packet counters
  2908. * @dropped.msdu_not_done: packets dropped because msdu done bit not set
  2909. * @dropped.mec: Multicast Echo check
  2910. * @dropped.mesh_filter: Mesh Filtered packets
  2911. * @dropped.wifi_parse: rxdma errors due to wifi parse error
  2912. * @dropped.mon_rx_drop: packets dropped on monitor vap
  2913. * @dropped.mon_radiotap_update_err: not enough space to update radiotap
  2914. * @replenish: replenish counters
  2915. * @replenish.pkts: total packets replenished
  2916. * @replenish.rxdma_err: rxdma errors for replenished
  2917. * @replenish.nbuf_alloc_fail: nbuf alloc failed
  2918. * @replenish.frag_alloc_fail: frag alloc failed
  2919. * @replenish.map_err: Mapping failure
  2920. * @replenish.x86_fail: x86 failures
  2921. * @replenish.low_thresh_intrs: low threshold interrupts
  2922. * @replenish.free_list: RX descriptors moving back to free list
  2923. * @rx_raw_pkts: Rx Raw Packets
  2924. * @mesh_mem_alloc: Mesh Rx Stats Alloc fail
  2925. * @tso_desc_cnt: TSO descriptors
  2926. * @sg_desc_cnt: SG Descriptors
  2927. * @vlan_tag_stp_cnt: Vlan tagged Stp packets in wifi parse error
  2928. * @err: Rx errors
  2929. * @err.desc_alloc_fail: desc alloc failed errors
  2930. * @err.desc_lt_alloc_fail:
  2931. * @err.ip_csum_err: ip checksum errors
  2932. * @err.tcp_udp_csum_err: tcp/udp checksum errors
  2933. * @err.rxdma_error:
  2934. * @err.fw_reported_rxdma_error:
  2935. * @err.reo_error:
  2936. * @buf_freelist: buffers added back in freelist
  2937. * @tx_i: Tx Ingress stats
  2938. * @rx_i: Rx Ingress stats
  2939. * @tx:CDP Tx Stats
  2940. * @rx: CDP Rx Stats
  2941. * @tx_comp_histogram: Number of Tx completions per interrupt
  2942. * @rx_ind_histogram: Number of Rx ring descriptors reaped per interrupt
  2943. * @ppdu_stats_counter: ppdu stats counter
  2944. * @cdp_delayed_ba_not_recev: counter for delayed ba not received
  2945. * @htt_tx_pdev_stats: htt pdev stats for tx
  2946. * @htt_rx_pdev_stats: htt pdev stats for rx
  2947. * @wdi_event:
  2948. * @tid_stats:
  2949. * @ul_ofdma: UL OFDMA stats
  2950. * @ul_ofdma.data_rx_ru_size: UL ofdma data ru size counter array
  2951. * @ul_ofdma.nondata_rx_ru_size: UL ofdma non data ru size counter array
  2952. * @ul_ofdma.data_rx_ppdu: data rx ppdu counter
  2953. * @ul_ofdma.data_users: data user counter array
  2954. * @eap_drop_stats: EAPOL packet drop stats information
  2955. * @eap_drop_stats.tx_desc_error: Total number EAPOL packets dropped due to TX
  2956. * descriptor error
  2957. * @eap_drop_stats.tx_hal_ring_access_err: Total EAPOL packets dropped due to
  2958. * HAL ring access failure
  2959. * @eap_drop_stats.tx_dma_map_err: EAPOL packets dropped due to error in DMA map
  2960. * @eap_drop_stats.tx_hw_enqueue: EAPOL packets dropped by the host due to
  2961. * failure in HW enqueue
  2962. * @eap_drop_stats.tx_sw_enqueue: EAPOL packets dropped by the host due to
  2963. * failure in SW enqueue
  2964. * @tso_stats:
  2965. * @rcc:
  2966. * @tx_ppdu_proc: stats counter for tx ppdu processed
  2967. * @ack_ba_comes_twice: stats counter for ack_ba_comes twice
  2968. * @ppdu_drop: stats counter for ppdu_desc drop once threshold reached
  2969. * @ppdu_wrap_drop: stats counter for ppdu desc drop on wrap around
  2970. * @rx_buffer_pool:
  2971. * @rx_buffer_pool.num_bufs_consumed:
  2972. * @rx_buffer_pool.num_pool_bufs_replenish:
  2973. * @rx_buffer_pool.num_bufs_alloc_success:
  2974. * @rx_refill_buff_pool:
  2975. * @rx_refill_buff_pool.num_bufs_refilled:
  2976. * @rx_refill_buff_pool.num_bufs_allocated:
  2977. * @peer_unauth_rx_pkt_drop: stats counter for drops due to unauthorized peer
  2978. * @telemetry_stats: pdev telemetry stats
  2979. * @deter_stats:
  2980. */
  2981. struct cdp_pdev_stats {
  2982. struct {
  2983. uint32_t msdu_not_done;
  2984. uint32_t mec;
  2985. uint32_t mesh_filter;
  2986. uint32_t wifi_parse;
  2987. /* Monitor mode related */
  2988. uint32_t mon_rx_drop;
  2989. uint32_t mon_radiotap_update_err;
  2990. } dropped;
  2991. struct {
  2992. struct cdp_pkt_info pkts;
  2993. uint32_t rxdma_err;
  2994. uint32_t nbuf_alloc_fail;
  2995. uint32_t frag_alloc_fail;
  2996. uint32_t map_err;
  2997. uint32_t x86_fail;
  2998. uint32_t low_thresh_intrs;
  2999. int32_t free_list;
  3000. } replenish;
  3001. uint32_t rx_raw_pkts;
  3002. uint32_t mesh_mem_alloc;
  3003. uint32_t tso_desc_cnt;
  3004. uint32_t sg_desc_cnt;
  3005. uint32_t vlan_tag_stp_cnt;
  3006. /* Rx errors */
  3007. struct {
  3008. uint32_t desc_alloc_fail;
  3009. uint32_t desc_lt_alloc_fail;
  3010. uint32_t ip_csum_err;
  3011. uint32_t tcp_udp_csum_err;
  3012. uint32_t rxdma_error;
  3013. uint32_t fw_reported_rxdma_error;
  3014. uint32_t reo_error;
  3015. } err;
  3016. uint32_t buf_freelist;
  3017. struct cdp_tx_ingress_stats tx_i;
  3018. struct cdp_rx_ingress_stats rx_i;
  3019. struct cdp_tx_stats tx;
  3020. struct cdp_rx_stats rx;
  3021. struct cdp_hist_tx_comp tx_comp_histogram;
  3022. struct cdp_hist_rx_ind rx_ind_histogram;
  3023. uint64_t ppdu_stats_counter[CDP_PPDU_STATS_MAX_TAG];
  3024. uint32_t cdp_delayed_ba_not_recev;
  3025. struct cdp_htt_tx_pdev_stats htt_tx_pdev_stats;
  3026. struct cdp_htt_rx_pdev_stats htt_rx_pdev_stats;
  3027. /* Received wdi messages from fw */
  3028. uint32_t wdi_event[CDP_WDI_NUM_EVENTS];
  3029. struct cdp_tid_stats tid_stats;
  3030. /* numbers of data/nondata per RU sizes */
  3031. struct {
  3032. uint32_t data_rx_ru_size[OFDMA_NUM_RU_SIZE];
  3033. uint32_t nondata_rx_ru_size[OFDMA_NUM_RU_SIZE];
  3034. uint32_t data_rx_ppdu;
  3035. uint32_t data_users[OFDMA_NUM_USERS];
  3036. } ul_ofdma;
  3037. struct {
  3038. uint8_t tx_desc_err;
  3039. uint8_t tx_hal_ring_access_err;
  3040. uint8_t tx_dma_map_err;
  3041. uint8_t tx_hw_enqueue;
  3042. uint8_t tx_sw_enqueue;
  3043. } eap_drop_stats;
  3044. struct cdp_tso_stats tso_stats;
  3045. struct cdp_cfr_rcc_stats rcc;
  3046. uint64_t tx_ppdu_proc;
  3047. uint64_t ack_ba_comes_twice;
  3048. uint64_t ppdu_drop;
  3049. uint64_t ppdu_wrap_drop;
  3050. struct {
  3051. uint64_t num_bufs_consumed;
  3052. uint64_t num_pool_bufs_replenish;
  3053. uint64_t num_bufs_alloc_success;
  3054. } rx_buffer_pool;
  3055. struct {
  3056. uint64_t num_bufs_refilled;
  3057. uint64_t num_bufs_allocated;
  3058. } rx_refill_buff_pool;
  3059. uint32_t peer_unauth_rx_pkt_drop;
  3060. #ifdef WLAN_TELEMETRY_STATS_SUPPORT
  3061. struct cdp_pdev_telemetry_stats telemetry_stats;
  3062. struct cdp_pdev_deter_stats deter_stats;
  3063. #endif
  3064. };
  3065. /**
  3066. * struct cdp_peer_hmwds_ast_add_status - hmwds peer ast add status
  3067. * @vdev_id: vdev id
  3068. * @status: ast add status
  3069. * @peer_mac: peer mac address
  3070. * @ast_mac: ast node mac address
  3071. */
  3072. struct cdp_peer_hmwds_ast_add_status {
  3073. uint32_t vdev_id;
  3074. uint32_t status;
  3075. uint8_t peer_mac[QDF_MAC_ADDR_SIZE];
  3076. uint8_t ast_mac[QDF_MAC_ADDR_SIZE];
  3077. };
  3078. /**
  3079. * enum cdp_soc_param_t - Enumeration of cdp soc parameters
  3080. * @DP_SOC_PARAM_MSDU_EXCEPTION_DESC:
  3081. * @DP_SOC_PARAM_CMEM_FSE_SUPPORT:
  3082. * @DP_SOC_PARAM_MAX_AST_AGEOUT:
  3083. * @DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT: For sending EAPOL's over control port
  3084. * @DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT: For sending bulk AST delete
  3085. * @DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT: To set the rssi dbm support bit
  3086. * @DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT: Whether target supports UMAC HW reset
  3087. * @DP_SOC_PARAM_MAX:
  3088. */
  3089. enum cdp_soc_param_t {
  3090. DP_SOC_PARAM_MSDU_EXCEPTION_DESC,
  3091. DP_SOC_PARAM_CMEM_FSE_SUPPORT,
  3092. DP_SOC_PARAM_MAX_AST_AGEOUT,
  3093. DP_SOC_PARAM_EAPOL_OVER_CONTROL_PORT,
  3094. DP_SOC_PARAM_MULTI_PEER_GRP_CMD_SUPPORT,
  3095. DP_SOC_PARAM_RSSI_DBM_CONV_SUPPORT,
  3096. DP_SOC_PARAM_UMAC_HW_RESET_SUPPORT,
  3097. DP_SOC_PARAM_MAX,
  3098. };
  3099. #ifdef QCA_ENH_V3_STATS_SUPPORT
  3100. /*
  3101. * Enumeration of PDEV Configuration parameter
  3102. */
  3103. enum _dp_param_t {
  3104. DP_PARAM_MSDU_TTL,
  3105. DP_PARAM_TOTAL_Q_SIZE_RANGE0,
  3106. DP_PARAM_TOTAL_Q_SIZE_RANGE1,
  3107. DP_PARAM_TOTAL_Q_SIZE_RANGE2,
  3108. DP_PARAM_TOTAL_Q_SIZE_RANGE3,
  3109. DP_PARAM_VIDEO_DELAY_STATS_FC,
  3110. DP_PARAM_QFLUSHINTERVAL,
  3111. DP_PARAM_TOTAL_Q_SIZE,
  3112. DP_PARAM_MIN_THRESHOLD,
  3113. DP_PARAM_MAX_Q_LIMIT,
  3114. DP_PARAM_MIN_Q_LIMIT,
  3115. DP_PARAM_CONG_CTRL_TIMER_INTV,
  3116. DP_PARAM_STATS_TIMER_INTV,
  3117. DP_PARAM_ROTTING_TIMER_INTV,
  3118. DP_PARAM_LATENCY_PROFILE,
  3119. DP_PARAM_HOSTQ_DUMP,
  3120. DP_PARAM_TIDQ_MAP,
  3121. DP_PARAM_VIDEO_STATS_FC,
  3122. DP_PARAM_STATS_FC,
  3123. DP_PARAM_MAX,
  3124. };
  3125. #endif
  3126. /* Bitmasks for stats that can block */
  3127. #define EXT_TXRX_FW_STATS 0x0001
  3128. #define CDP_TX_CAP_HTT_MAX_FTYPE 19
  3129. #define CDP_FC0_TYPE_SHIFT 2
  3130. #define CDP_FC0_SUBTYPE_SHIFT 4
  3131. #define CDP_FC0_TYPE_DATA 0x08
  3132. #define CDP_FC0_SUBTYPE_MASK 0xf0
  3133. #define CDP_TXCAP_MAX_TYPE \
  3134. ((CDP_FC0_TYPE_DATA >> CDP_FC0_TYPE_SHIFT) + 1)
  3135. #define CDP_TXCAP_MAX_SUBTYPE \
  3136. ((CDP_FC0_SUBTYPE_MASK >> CDP_FC0_SUBTYPE_SHIFT) + 1)
  3137. enum CDP_PEER_MSDU_DESC {
  3138. PEER_MSDU_SUCC,
  3139. PEER_MSDU_ENQ,
  3140. PEER_MSDU_DEQ,
  3141. PEER_MSDU_FLUSH,
  3142. PEER_MSDU_DROP,
  3143. PEER_MSDU_XRETRY,
  3144. PEER_MSDU_DESC_MAX,
  3145. };
  3146. enum CDP_PEER_MPDU_DESC {
  3147. PEER_MPDU_TRI,
  3148. PEER_MPDU_SUCC,
  3149. PEER_MPDU_RESTITCH,
  3150. PEER_MPDU_ARR,
  3151. PEER_MPDU_CLONE,
  3152. PEER_MPDU_TO_STACK,
  3153. PEER_MPDU_DESC_MAX,
  3154. };
  3155. /**
  3156. * struct cdp_tid_q_len - Structure to hold consolidated queue length
  3157. * @defer_msdu_len: Deferred MSDU queue length
  3158. * @tasklet_msdu_len: MSDU complete queue length
  3159. * @pending_q_len: MSDU pending queue length
  3160. */
  3161. struct cdp_tid_q_len {
  3162. uint64_t defer_msdu_len;
  3163. uint64_t tasklet_msdu_len;
  3164. uint64_t pending_q_len;
  3165. };
  3166. /**
  3167. * struct cdp_peer_tx_capture_stats - Structure to hold peer tx capture stats
  3168. * @len_stats: Per TID deferred, pending and completed msdu queue length
  3169. * @mpdu: Mpdu success and restich count
  3170. * @msdu: Msdu success and restich count
  3171. */
  3172. struct cdp_peer_tx_capture_stats {
  3173. struct cdp_tid_q_len len_stats[CDP_MAX_TIDS];
  3174. #ifdef WLAN_TX_PKT_CAPTURE_ENH_DEBUG
  3175. uint32_t mpdu[PEER_MPDU_DESC_MAX];
  3176. uint32_t msdu[PEER_MSDU_DESC_MAX];
  3177. #endif
  3178. };
  3179. /**
  3180. * struct cdp_pdev_tx_capture_stats - Structure to hold pdev tx capture stats
  3181. * @peer_mismatch: Peer mismatched
  3182. * @last_rcv_ppdu: Last received PPDU stats in ms
  3183. * @ppdu_stats_queue_depth: PPDU stats queue depth
  3184. * @ppdu_stats_defer_queue_depth: PPDU stats deferred queue depth
  3185. * @ppdu_dropped: PPDU dropped count
  3186. * @pend_ppdu_dropped: Pending PPDU dropped count
  3187. * @ppdu_flush_count: PPDU flush count
  3188. * @msdu_threshold_drop: MSDU threshold drop count
  3189. * @ctl_mgmt_q_len: Control management queue length
  3190. * @retries_ctl_mgmt_q_len: Control management retries queue length
  3191. * @htt_frame_type: HTT frame type
  3192. * @len_stats: Consolidated msdu, ppdu and pending queue length
  3193. */
  3194. struct cdp_pdev_tx_capture_stats {
  3195. uint64_t peer_mismatch;
  3196. uint32_t last_rcv_ppdu;
  3197. uint32_t ppdu_stats_queue_depth;
  3198. uint32_t ppdu_stats_defer_queue_depth;
  3199. uint32_t ppdu_dropped;
  3200. uint32_t pend_ppdu_dropped;
  3201. uint32_t ppdu_flush_count;
  3202. uint32_t msdu_threshold_drop;
  3203. unsigned int ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE][CDP_TXCAP_MAX_SUBTYPE];
  3204. unsigned int retries_ctl_mgmt_q_len[CDP_TXCAP_MAX_TYPE]
  3205. [CDP_TXCAP_MAX_SUBTYPE];
  3206. uint32_t htt_frame_type[CDP_TX_CAP_HTT_MAX_FTYPE];
  3207. struct cdp_tid_q_len len_stats;
  3208. };
  3209. #endif