cdp_txrx_stats_struct.h 64 KB

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