cdp_txrx_stats_struct.h 64 KB

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