cdp_txrx_stats_struct.h 90 KB

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