cdp_txrx_stats_struct.h 88 KB

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