cdp_txrx_stats_struct.h 59 KB

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