cdp_txrx_stats_struct.h 59 KB

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