cdp_txrx_stats_struct.h 104 KB

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