cdp_txrx_stats_struct.h 90 KB

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