cdp_txrx_stats_struct.h 60 KB

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