cdp_txrx_stats_struct.h 105 KB

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