cdp_txrx_stats_struct.h 64 KB

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