cdp_txrx_stats_struct.h 71 KB

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