cdp_txrx_stats_struct.h 88 KB

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