cdp_txrx_stats_struct.h 61 KB

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