cdp_txrx_stats_struct.h 70 KB

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