cdp_txrx_stats_struct.h 85 KB

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