cdp_txrx_stats_struct.h 87 KB

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