cdp_txrx_stats_struct.h 63 KB

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