cdp_txrx_stats_struct.h 97 KB

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