cdp_txrx_stats_struct.h 99 KB

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