cdp_txrx_stats_struct.h 60 KB

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