cdp_txrx_stats_struct.h 90 KB

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