cdp_txrx_cmn_struct.h 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_cmn_struct.h
  21. * Define the host data path converged API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_CMN_STRUCT_H_
  25. #define _CDP_TXRX_CMN_STRUCT_H_
  26. /*
  27. * For WIN legacy header compilation
  28. * Temporary add dummy definitions
  29. * should be removed properly WIN legacy code handle
  30. */
  31. #include "htc_api.h"
  32. #include "qdf_types.h"
  33. #include "qdf_nbuf.h"
  34. #include "qdf_atomic.h"
  35. #ifdef DP_MOB_DEFS
  36. #include <cdp_txrx_mob_def.h>
  37. #endif
  38. #include <cdp_txrx_handle.h>
  39. #include <cdp_txrx_stats_struct.h>
  40. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  41. #include "cdp_txrx_extd_struct.h"
  42. #endif
  43. #ifdef WLAN_FEATURE_TX_LATENCY_STATS
  44. #include "qdf_list.h"
  45. #endif
  46. #ifdef WLAN_MAX_CLIENTS_ALLOWED
  47. #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
  48. #endif
  49. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  50. /*
  51. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  52. * Clients will be assigned max 32 IDs.
  53. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  54. */
  55. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  56. #endif
  57. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  58. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  59. #define OL_TXRX_INVALID_PDEV_ID 0xff
  60. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  61. #define CDP_INVALID_VDEV_ID 0xff
  62. /* Max vdev_stats_id(48) is as per the max vdevs supported by HW */
  63. #define CDP_MAX_VDEV_STATS_ID 0x30
  64. /* Invalid vdev_stats_id */
  65. #define CDP_INVALID_VDEV_STATS_ID 0xFF
  66. /* METADATA used for wakeup triggers, specifically for Standby modes */
  67. #define CDP_STANDBY_METADATA 5588
  68. /* Options for Dump Statistics */
  69. #define CDP_HDD_STATS 0
  70. #define CDP_TXRX_PATH_STATS 1
  71. #define CDP_TXRX_HIST_STATS 2
  72. #define CDP_TXRX_TSO_STATS 3
  73. #define CDP_HDD_NETIF_OPER_HISTORY 4
  74. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  75. #define CDP_TXRX_DESC_STATS 6
  76. #define CDP_HIF_STATS 7
  77. #define CDP_LRO_STATS 8
  78. #define CDP_NAPI_STATS 9
  79. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  80. #define CDP_RX_RING_STATS 11
  81. #define CDP_DP_NAPI_STATS 12
  82. #define CDP_DP_RX_THREAD_STATS 13
  83. #define CDP_SCHEDULER_STATS 21
  84. #define CDP_TX_QUEUE_STATS 22
  85. #define CDP_BUNDLE_STATS 23
  86. #define CDP_CREDIT_STATS 24
  87. #define CDP_DISCONNECT_STATS 25
  88. #define CDP_DP_RX_FISA_STATS 26
  89. #define CDP_DP_SWLM_STATS 27
  90. #define CDP_DP_TX_HW_LATENCY_STATS 28
  91. #define WME_AC_TO_TID(_ac) ( \
  92. ((_ac) == WME_AC_VO) ? 6 : \
  93. ((_ac) == WME_AC_VI) ? 5 : \
  94. ((_ac) == WME_AC_BK) ? 1 : \
  95. 0)
  96. #define TID_TO_WME_AC(_tid) ( \
  97. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  98. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  99. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  100. WME_AC_VO)
  101. #define CDP_MU_MAX_USERS 37
  102. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  103. #define CDP_INVALID_PEER 0xffff
  104. #define CDP_INVALID_TID 31
  105. #define CDP_INVALID_TX_ENCAP_TYPE 6
  106. #define CDP_INVALID_SEC_TYPE 12
  107. #define CDP_DATA_TID_MAX 8
  108. #define CDP_DATA_NON_QOS_TID 16
  109. #define CDP_NUM_SA_BW 4
  110. /* Smart Antenna 320MHz BW Phy MAX Rate Code Index */
  111. #define CDP_SA_BW320_INX 4
  112. #define CDP_PERCENT_MACRO 100
  113. #define CDP_NUM_KB_IN_MB 1000
  114. /*
  115. * advance rx monitor filter
  116. */
  117. #define MON_FILTER_PASS 0x0001
  118. #define MON_FILTER_OTHER 0x0002
  119. #define MON_FILTER_ALL 0x0003
  120. #define FILTER_MGMT_ALL 0xFFFF
  121. #define FILTER_MGMT_ASSOC_REQ 0x0001
  122. #define FILTER_MGMT_ASSOC_RES 0x0002
  123. #define FILTER_MGMT_REASSOC_REQ 0x0004
  124. #define FILTER_MGMT_REASSOC_RES 0x0008
  125. #define FILTER_MGMT_PROBE_REQ 0x0010
  126. #define FILTER_MGMT_PROBE_RES 0x0020
  127. #define FILTER_MGMT_TIM_ADVT 0x0040
  128. #define FILTER_MGMT_RESERVED_7 0x0080
  129. #define FILTER_MGMT_BEACON 0x0100
  130. #define FILTER_MGMT_ATIM 0x0200
  131. #define FILTER_MGMT_DISASSOC 0x0400
  132. #define FILTER_MGMT_AUTH 0x0800
  133. #define FILTER_MGMT_DEAUTH 0x1000
  134. #define FILTER_MGMT_ACTION 0x2000
  135. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  136. #define FILTER_MGMT_RESERVED_15 0x8000
  137. #define FILTER_CTRL_ALL 0xFFFF
  138. #define FILTER_CTRL_RESERVED_1 0x0001
  139. #define FILTER_CTRL_RESERVED_2 0x0002
  140. #define FILTER_CTRL_TRIGGER 0x0004
  141. #define FILTER_CTRL_RESERVED_4 0x0008
  142. #define FILTER_CTRL_BF_REP_POLL 0x0010
  143. #define FILTER_CTRL_VHT_NDP 0x0020
  144. #define FILTER_CTRL_FRAME_EXT 0x0040
  145. #define FILTER_CTRL_CTRLWRAP 0x0080
  146. #define FILTER_CTRL_BA_REQ 0x0100
  147. #define FILTER_CTRL_BA 0x0200
  148. #define FILTER_CTRL_PSPOLL 0x0400
  149. #define FILTER_CTRL_RTS 0x0800
  150. #define FILTER_CTRL_CTS 0x1000
  151. #define FILTER_CTRL_ACK 0x2000
  152. #define FILTER_CTRL_CFEND 0x4000
  153. #define FILTER_CTRL_CFEND_CFACK 0x8000
  154. #define FILTER_DATA_ALL 0xFFFF
  155. #define FILTER_DATA_MCAST 0x4000
  156. #define FILTER_DATA_UCAST 0x8000
  157. #define FILTER_DATA_DATA 0x0001
  158. #define FILTER_DATA_NULL 0x0008
  159. /*
  160. * Multiply rate by 2 to avoid float point
  161. * and get rate in units of 500kbps
  162. */
  163. #define CDP_11B_RATE_0MCS (11 * 2)
  164. #define CDP_11B_RATE_1MCS (5.5 * 2)
  165. #define CDP_11B_RATE_2MCS (2 * 2)
  166. #define CDP_11B_RATE_3MCS (1 * 2)
  167. #define CDP_11B_RATE_4MCS (11 * 2)
  168. #define CDP_11B_RATE_5MCS (5.5 * 2)
  169. #define CDP_11B_RATE_6MCS (2 * 2)
  170. #define CDP_11A_RATE_0MCS (48 * 2)
  171. #define CDP_11A_RATE_1MCS (24 * 2)
  172. #define CDP_11A_RATE_2MCS (12 * 2)
  173. #define CDP_11A_RATE_3MCS (6 * 2)
  174. #define CDP_11A_RATE_4MCS (54 * 2)
  175. #define CDP_11A_RATE_5MCS (36 * 2)
  176. #define CDP_11A_RATE_6MCS (18 * 2)
  177. #define CDP_11A_RATE_7MCS (9 * 2)
  178. #define CDP_LEGACY_MCS0 0
  179. #define CDP_LEGACY_MCS1 1
  180. #define CDP_LEGACY_MCS2 2
  181. #define CDP_LEGACY_MCS3 3
  182. #define CDP_LEGACY_MCS4 4
  183. #define CDP_LEGACY_MCS5 5
  184. #define CDP_LEGACY_MCS6 6
  185. #define CDP_LEGACY_MCS7 7
  186. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  187. struct cdp_stats_cookie;
  188. /**
  189. * enum cdp_cfg_param_type - DP configuration parameters
  190. * @CDP_CFG_MAX_PEER_ID: Maximum peer id
  191. * @CDP_CFG_CCE_DISABLE: CCE disable
  192. * @CDP_CFG_MLD_NETDEV_MODE_AP: Ap's mld netdev model
  193. * @CDP_CFG_NUM_PARAMS: Total number of params
  194. */
  195. enum cdp_cfg_param_type {
  196. CDP_CFG_MAX_PEER_ID,
  197. CDP_CFG_CCE_DISABLE,
  198. CDP_CFG_MLD_NETDEV_MODE_AP,
  199. CDP_CFG_NUM_PARAMS
  200. };
  201. /**
  202. * enum CDP_PPDU_STATS_PPDU_TYPE - PPDU TYPE from FW
  203. * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
  204. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
  205. * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
  206. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
  207. * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
  208. * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
  209. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
  210. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
  211. * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
  212. * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN: unknown
  213. */
  214. enum CDP_PPDU_STATS_PPDU_TYPE {
  215. CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
  216. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
  217. CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
  218. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
  219. CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
  220. CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
  221. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
  222. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
  223. CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
  224. CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  225. };
  226. /**
  227. * enum htt_cmn_dbg_stats_type -
  228. * bit positions for each stats type within a stats type bitmask
  229. * The bitmask contains 24 bits.
  230. * @HTT_DBG_CMN_STATS_WAL_PDEV_TXRX:
  231. * @HTT_DBG_CMN_STATS_RX_REORDER:
  232. * @HTT_DBG_CMN_STATS_RX_RATE_INFO:
  233. * @HTT_DBG_CMN_STATS_TX_PPDU_LOG:
  234. * @HTT_DBG_CMN_STATS_TX_RATE_INFO:
  235. * @HTT_DBG_CMN_STATS_TIDQ:
  236. * @HTT_DBG_CMN_STATS_TXBF_INFO:
  237. * @HTT_DBG_CMN_STATS_SND_INFO:
  238. * @HTT_DBG_CMN_STATS_ERROR_INFO:
  239. * @HTT_DBG_CMN_STATS_TX_SELFGEN_INFO:
  240. * @HTT_DBG_CMN_STATS_TX_MU_INFO:
  241. * @HTT_DBG_CMN_STATS_SIFS_RESP_INFO:
  242. * @HTT_DBG_CMN_STATS_RESET_INFO:
  243. * @HTT_DBG_CMN_STATS_MAC_WDOG_INFO:
  244. * @HTT_DBG_CMN_STATS_TX_DESC_INFO:
  245. * @HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO:
  246. * @HTT_DBG_CMN_STATS_TX_PFSCHED_INFO:
  247. * @HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO:
  248. * @HTT_DBG_CMN_NUM_STATS:
  249. * @HTT_DBG_CMN_NUM_STATS_INVALID:
  250. */
  251. enum htt_cmn_dbg_stats_type {
  252. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  253. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  254. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  255. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  256. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  257. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  258. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  259. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  260. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  261. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  262. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  263. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  264. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  265. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  266. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  267. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  268. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  269. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  270. /* bits 18-23 currently reserved */
  271. /* keep this last */
  272. HTT_DBG_CMN_NUM_STATS,
  273. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  274. };
  275. /**
  276. * enum cdp_host_txrx_stats - Different types of host stats
  277. * @TXRX_HOST_STATS_INVALID: Invalid option
  278. * @TXRX_CLEAR_STATS: clear all host stats
  279. * @TXRX_RX_RATE_STATS: Rx rate info
  280. * @TXRX_TX_RATE_STATS: Tx rate info
  281. * @TXRX_TX_HOST_STATS: Print Tx stats
  282. * @TXRX_RX_HOST_STATS: Print host Rx stats
  283. * @TXRX_AST_STATS:
  284. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  285. * @TXRX_RX_MON_STATS: Print monitor mode stats
  286. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  287. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  288. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  289. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  290. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  291. * @TXRX_SOC_FSE_STATS:
  292. * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
  293. * @TXRX_SOC_REO_HW_DESC_DUMP: HW REO queue desc dump
  294. * @TXRX_SOC_WBM_IDLE_HPTP_DUMP: WBM idle link desc SRNG HP/TP dump
  295. * @TXRX_SRNG_USAGE_WM_STATS: SRNG usage watermark stats
  296. * @TXRX_PEER_STATS: Per link peer stats
  297. * @TXRX_HOST_STATS_MAX:
  298. */
  299. enum cdp_host_txrx_stats {
  300. TXRX_HOST_STATS_INVALID = -1,
  301. TXRX_CLEAR_STATS = 0,
  302. TXRX_RX_RATE_STATS = 1,
  303. TXRX_TX_RATE_STATS = 2,
  304. TXRX_TX_HOST_STATS = 3,
  305. TXRX_RX_HOST_STATS = 4,
  306. TXRX_AST_STATS = 5,
  307. TXRX_SRNG_PTR_STATS = 6,
  308. TXRX_RX_MON_STATS = 7,
  309. TXRX_REO_QUEUE_STATS = 8,
  310. TXRX_SOC_CFG_PARAMS = 9,
  311. TXRX_PDEV_CFG_PARAMS = 10,
  312. TXRX_NAPI_STATS = 11,
  313. TXRX_SOC_INTERRUPT_STATS = 12,
  314. TXRX_SOC_FSE_STATS = 13,
  315. TXRX_HAL_REG_WRITE_STATS = 14,
  316. TXRX_SOC_REO_HW_DESC_DUMP = 15,
  317. TXRX_SOC_WBM_IDLE_HPTP_DUMP = 16,
  318. TXRX_SRNG_USAGE_WM_STATS = 17,
  319. TXRX_PEER_STATS = 18,
  320. TXRX_HOST_STATS_MAX,
  321. };
  322. /**
  323. * enum cdp_ppdu_ftype - PPDU Frame Type
  324. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  325. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  326. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  327. * @CDP_PPDU_FTYPE_MAX: Max value
  328. */
  329. enum cdp_ppdu_ftype {
  330. CDP_PPDU_FTYPE_CTRL,
  331. CDP_PPDU_FTYPE_DATA,
  332. CDP_PPDU_FTYPE_BAR,
  333. CDP_PPDU_FTYPE_MAX
  334. };
  335. /**
  336. * enum htt_cmn_pkt_type - General specification of the tx frame contents
  337. * @htt_cmn_pkt_type_raw: raw
  338. * @htt_cmn_pkt_type_native_wifi: native wifi
  339. * @htt_cmn_pkt_type_ethernet: ethernet
  340. * @htt_cmn_pkt_type_mgmt: management
  341. * @htt_cmn_pkt_type_eth2: ethernet2
  342. * @htt_cmn_pkt_num_types: number of packet types
  343. *
  344. * for efficiency, the HTT packet type values correspond
  345. * to the bit positions of the WAL packet type values, so the
  346. * translation is a simple shift operation.
  347. */
  348. enum htt_cmn_pkt_type {
  349. htt_cmn_pkt_type_raw = 0,
  350. htt_cmn_pkt_type_native_wifi = 1,
  351. htt_cmn_pkt_type_ethernet = 2,
  352. htt_cmn_pkt_type_mgmt = 3,
  353. htt_cmn_pkt_type_eth2 = 4,
  354. /* keep this last */
  355. htt_cmn_pkt_num_types
  356. };
  357. /**
  358. * enum htt_cmn_rx_status - description of HTT received packets status
  359. * @htt_cmn_rx_status_unknown:
  360. * @htt_cmn_rx_status_ok:
  361. * @htt_cmn_rx_status_err_fcs:
  362. * @htt_cmn_rx_status_err_dup:
  363. * @htt_cmn_rx_status_err_replay:
  364. * @htt_cmn_rx_status_inv_peer:
  365. * @htt_cmn_rx_status_ctrl_mgmt_null:
  366. * @htt_cmn_rx_status_tkip_mic_err:
  367. * @htt_cmn_rx_status_decrypt_err:
  368. * @htt_cmn_rx_status_mpdu_length_err:
  369. * @htt_cmn_rx_status_err_misc:
  370. *
  371. * It is similar to htt_rx_status enum
  372. * but is added as a cdp enum can be freely used in OL_IF layer
  373. */
  374. enum htt_cmn_rx_status {
  375. htt_cmn_rx_status_unknown = 0x0,
  376. htt_cmn_rx_status_ok,
  377. htt_cmn_rx_status_err_fcs,
  378. htt_cmn_rx_status_err_dup,
  379. htt_cmn_rx_status_err_replay,
  380. htt_cmn_rx_status_inv_peer,
  381. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  382. htt_cmn_rx_status_tkip_mic_err = 0x09,
  383. htt_cmn_rx_status_decrypt_err = 0x0A,
  384. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  385. htt_cmn_rx_status_err_misc = 0xFF
  386. };
  387. enum cdp_host_reo_dest_ring {
  388. cdp_host_reo_dest_ring_unknown = 0,
  389. cdp_host_reo_dest_ring_1 = 1,
  390. cdp_host_reo_dest_ring_2 = 2,
  391. cdp_host_reo_dest_ring_3 = 3,
  392. cdp_host_reo_dest_ring_4 = 4,
  393. };
  394. enum htt_cmn_t2h_en_stats_type {
  395. /* keep this always first */
  396. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  397. /** ppdu_common_stats is the payload */
  398. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  399. /** ppdu_sant_stats is the payload */
  400. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  401. /** ppdu_common_stats_v2 is the payload */
  402. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  403. /* Keep this last */
  404. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  405. };
  406. enum htt_cmn_t2h_en_stats_status {
  407. /* Keep this first always */
  408. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  409. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  410. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  411. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  412. /* keep this always last */
  413. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  414. };
  415. /**
  416. * enum cdp_peer_type - Peer type
  417. * @CDP_INVALID_PEER_TYPE: invalid peer type
  418. * @CDP_LINK_PEER_TYPE: legacy peer or link peer for MLO connection
  419. * @CDP_MLD_PEER_TYPE: MLD peer for MLO connection
  420. * @CDP_WILD_PEER_TYPE: used to set peer type for same mld/link mac addr
  421. */
  422. enum cdp_peer_type {
  423. CDP_INVALID_PEER_TYPE,
  424. CDP_LINK_PEER_TYPE,
  425. CDP_MLD_PEER_TYPE,
  426. CDP_WILD_PEER_TYPE,
  427. };
  428. /**
  429. * struct cdp_peer_setup_info - MLO connection info for cdp_peer_setup()
  430. * @mld_peer_mac: mld peer mac address pointer
  431. * @is_first_link: set true for first MLO link peer
  432. * @is_primary_link: set true for MLO primary link peer
  433. * @primary_umac_id: primary umac_id
  434. * @num_links: number of links in MLO
  435. */
  436. struct cdp_peer_setup_info {
  437. uint8_t *mld_peer_mac;
  438. uint8_t is_first_link:1,
  439. is_primary_link:1;
  440. uint8_t primary_umac_id;
  441. uint8_t num_links;
  442. };
  443. /**
  444. * struct cdp_peer_info - peer info for dp hash find
  445. * @vdev_id: Vdev ID
  446. * @mac_addr: peer mac address to search
  447. * @mac_addr_is_aligned: true only if mac_addr type is
  448. * "union dp_align_mac_addr", otherwise set false always.
  449. * @peer_type: link or MLD peer type
  450. */
  451. struct cdp_peer_info {
  452. uint8_t vdev_id;
  453. uint8_t *mac_addr;
  454. bool mac_addr_is_aligned;
  455. enum cdp_peer_type peer_type;
  456. };
  457. /**
  458. * enum ol_txrx_peer_state - Peer state information
  459. * @OL_TXRX_PEER_STATE_INVALID: Invalid
  460. * @OL_TXRX_PEER_STATE_DISC: disconnected (initial state)
  461. * @OL_TXRX_PEER_STATE_CONN: authentication in progress
  462. * @OL_TXRX_PEER_STATE_AUTH: authentication successful
  463. */
  464. enum ol_txrx_peer_state {
  465. OL_TXRX_PEER_STATE_INVALID,
  466. OL_TXRX_PEER_STATE_DISC,
  467. OL_TXRX_PEER_STATE_CONN,
  468. OL_TXRX_PEER_STATE_AUTH,
  469. };
  470. /**
  471. * enum cdp_txrx_ast_entry_type - AST entry type information
  472. * @CDP_TXRX_AST_TYPE_NONE: static ast entry for connected peer
  473. * @CDP_TXRX_AST_TYPE_STATIC: static ast entry for connected peer
  474. * @CDP_TXRX_AST_TYPE_SELF: static ast entry for self peer (STA mode)
  475. * @CDP_TXRX_AST_TYPE_WDS: WDS peer ast entry type
  476. * @CDP_TXRX_AST_TYPE_WDS_HM: HM WDS entry
  477. * @CDP_TXRX_AST_TYPE_STA_BSS: BSS entry(STA mode)
  478. * @CDP_TXRX_AST_TYPE_DA: AST entry based on Destination address
  479. * @CDP_TXRX_AST_TYPE_WDS_HM_SEC: HM WDS entry for secondary radio
  480. * @CDP_TXRX_AST_TYPE_MLD: AST entry type for MLD peer
  481. * @CDP_TXRX_AST_TYPE_MAX:
  482. */
  483. enum cdp_txrx_ast_entry_type {
  484. CDP_TXRX_AST_TYPE_NONE,
  485. CDP_TXRX_AST_TYPE_STATIC,
  486. CDP_TXRX_AST_TYPE_SELF,
  487. CDP_TXRX_AST_TYPE_WDS,
  488. CDP_TXRX_AST_TYPE_WDS_HM,
  489. CDP_TXRX_AST_TYPE_STA_BSS,
  490. CDP_TXRX_AST_TYPE_DA,
  491. CDP_TXRX_AST_TYPE_WDS_HM_SEC,
  492. CDP_TXRX_AST_TYPE_MLD,
  493. CDP_TXRX_AST_TYPE_MAX
  494. };
  495. /**
  496. * enum cdp_ast_free_status - status passed to callback function before
  497. * freeing ast
  498. * @CDP_TXRX_AST_DELETED: AST is deleted from FW and delete response received
  499. * @CDP_TXRX_AST_DELETE_IN_PROGRESS: AST delete command sent to FW and host
  500. * is waiting for FW response
  501. */
  502. enum cdp_ast_free_status {
  503. CDP_TXRX_AST_DELETED,
  504. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  505. };
  506. /**
  507. * typedef txrx_ast_free_cb() - callback registered for ast free
  508. * @ctrl_soc: control path soc context
  509. * @cdp_soc: DP soc context
  510. * @cookie: cookie
  511. * @cdp_ast_free_status: ast free status
  512. */
  513. typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
  514. struct cdp_soc *cdp_soc,
  515. void *cookie,
  516. enum cdp_ast_free_status);
  517. /**
  518. * struct cdp_ast_entry_info - AST entry information
  519. * @peer_mac_addr: mac address of peer on which AST entry is added
  520. * @type: ast entry type
  521. * @vdev_id: vdev_id
  522. * @pdev_id: pdev_id
  523. * @peer_id: peer_id
  524. *
  525. * This structure holds the ast entry information
  526. *
  527. */
  528. struct cdp_ast_entry_info {
  529. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  530. enum cdp_txrx_ast_entry_type type;
  531. uint8_t vdev_id;
  532. uint8_t pdev_id;
  533. uint16_t peer_id;
  534. };
  535. #define MIC_SEQ_CTR_SIZE 6
  536. enum cdp_rx_frame_type {
  537. cdp_rx_frame_type_802_11,
  538. cdp_rx_frame_type_802_3,
  539. };
  540. /**
  541. * struct cdp_rx_mic_err_info - rx mic error information
  542. * @frame_type: frame type - 0 - 802.11 frame
  543. * - 1 - 802.3 frame
  544. * @data: 802.11 frame
  545. * @ta_mac_addr: transmitter mac address
  546. * @da_mac_addr: destination mac address
  547. * @tsc: sequence number
  548. * @key_id: Key ID
  549. * @multicast: flag for multicast
  550. * @vdev_id: vdev ID
  551. *
  552. * This structure holds rx mic error information
  553. *
  554. */
  555. struct cdp_rx_mic_err_info {
  556. uint8_t frame_type;
  557. uint8_t *data;
  558. struct qdf_mac_addr ta_mac_addr;
  559. struct qdf_mac_addr da_mac_addr;
  560. uint8_t tsc[MIC_SEQ_CTR_SIZE];
  561. uint8_t key_id;
  562. bool multicast;
  563. uint16_t vdev_id;
  564. };
  565. #ifdef WLAN_SUPPORT_MSCS
  566. /**
  567. * struct cdp_mscs_params - MSCS parameters obtained
  568. * from handshake
  569. * @user_pri_bitmap: User priority bitmap
  570. * @user_pri_limit: User priority limit
  571. * @classifier_type: TCLAS Classifier type
  572. * @classifier_mask: TCLAS Classifier mask
  573. */
  574. struct cdp_mscs_params {
  575. uint8_t user_pri_bitmap;
  576. uint8_t user_pri_limit;
  577. uint8_t classifier_type;
  578. uint8_t classifier_mask;
  579. };
  580. #endif
  581. /**
  582. * struct cdp_ds_vp_params - Direct Switch related params
  583. * @dev: Net device
  584. * @peer_id: peer id
  585. * @ppe_vp_profile_idx: VP profile index in be soc
  586. * @wds_ext_mode: flag to indicate wds ext.
  587. * @ppe_vp_type: VP type flag.
  588. */
  589. struct cdp_ds_vp_params {
  590. struct net_device *dev;
  591. uint32_t peer_id;
  592. int8_t ppe_vp_profile_idx;
  593. bool wds_ext_mode;
  594. unsigned long ppe_vp_type;
  595. };
  596. /**
  597. * enum cdp_sec_type - security type information
  598. * @cdp_sec_type_none:
  599. * @cdp_sec_type_wep128:
  600. * @cdp_sec_type_wep104:
  601. * @cdp_sec_type_wep40:
  602. * @cdp_sec_type_tkip:
  603. * @cdp_sec_type_tkip_nomic:
  604. * @cdp_sec_type_aes_ccmp:
  605. * @cdp_sec_type_wapi:
  606. * @cdp_sec_type_aes_ccmp_256:
  607. * @cdp_sec_type_aes_gcmp:
  608. * @cdp_sec_type_aes_gcmp_256:
  609. * @cdp_num_sec_types:
  610. */
  611. enum cdp_sec_type {
  612. cdp_sec_type_none,
  613. cdp_sec_type_wep128,
  614. cdp_sec_type_wep104,
  615. cdp_sec_type_wep40,
  616. cdp_sec_type_tkip,
  617. cdp_sec_type_tkip_nomic,
  618. cdp_sec_type_aes_ccmp,
  619. cdp_sec_type_wapi,
  620. cdp_sec_type_aes_ccmp_256,
  621. cdp_sec_type_aes_gcmp,
  622. cdp_sec_type_aes_gcmp_256,
  623. /* keep this last! */
  624. cdp_num_sec_types
  625. };
  626. /**
  627. * struct cdp_tx_exception_metadata - Exception path parameters
  628. * @peer_id: Peer id of the peer
  629. * @tid: Transmit Identifier
  630. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  631. * @sec_type: sec_type to be passed to HAL
  632. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  633. * @is_intrabss_fwd:
  634. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  635. * @is_wds_extended:
  636. * @is_mlo_mcast: Indicates if mlo_mcast enable or not
  637. *
  638. * This structure holds the parameters needed in the exception path of tx
  639. *
  640. */
  641. struct cdp_tx_exception_metadata {
  642. uint16_t peer_id;
  643. uint8_t tid;
  644. uint16_t tx_encap_type;
  645. enum cdp_sec_type sec_type;
  646. uint8_t is_tx_sniffer :1,
  647. is_intrabss_fwd :1;
  648. uint16_t ppdu_cookie;
  649. #ifdef QCA_SUPPORT_WDS_EXTENDED
  650. uint8_t is_wds_extended;
  651. #endif
  652. #ifdef WLAN_MCAST_MLO
  653. uint8_t is_mlo_mcast;
  654. #endif
  655. };
  656. /**
  657. * enum wlan_op_mode - Virtual device operation mode
  658. * @wlan_op_mode_unknown: Unknown mode
  659. * @wlan_op_mode_ap: AP mode
  660. * @wlan_op_mode_ibss: IBSS mode
  661. * @wlan_op_mode_sta: STA (client) mode
  662. * @wlan_op_mode_monitor: Monitor mode
  663. * @wlan_op_mode_ocb: OCB mode
  664. * @wlan_op_mode_ndi: NDI mode
  665. */
  666. enum wlan_op_mode {
  667. wlan_op_mode_unknown,
  668. wlan_op_mode_ap,
  669. wlan_op_mode_ibss,
  670. wlan_op_mode_sta,
  671. wlan_op_mode_monitor,
  672. wlan_op_mode_ocb,
  673. wlan_op_mode_ndi,
  674. };
  675. /**
  676. * enum wlan_op_subtype - Virtual device subtype
  677. * @wlan_op_subtype_none: Subtype not applicable
  678. * @wlan_op_subtype_p2p_device: P2P device
  679. * @wlan_op_subtype_p2p_cli: P2P Client
  680. * @wlan_op_subtype_p2p_go: P2P GO
  681. *
  682. * This enum lists the subtypes of a particular virtual
  683. * device.
  684. */
  685. enum wlan_op_subtype {
  686. wlan_op_subtype_none,
  687. wlan_op_subtype_p2p_device,
  688. wlan_op_subtype_p2p_cli,
  689. wlan_op_subtype_p2p_go,
  690. };
  691. /**
  692. * struct cdp_vdev_info - Vdev information
  693. * @vdev_mac_addr: mac address of the vdev
  694. * @vdev_id: ID of the vdev
  695. * @vdev_stats_id: Stats ID of the vdev
  696. * @op_mode: Operation mode of the vdev
  697. * @subtype: subtype of the vdev
  698. * @qdf_opmode: Operation mode of the vdev
  699. * @mld_mac_addr: MLD mac addr of the current vdev.
  700. * @is_bridge_vap: current vdev is bridge vap or not.
  701. */
  702. struct cdp_vdev_info {
  703. uint8_t *vdev_mac_addr;
  704. uint8_t vdev_id;
  705. uint8_t vdev_stats_id;
  706. enum wlan_op_mode op_mode;
  707. enum wlan_op_subtype subtype;
  708. enum QDF_OPMODE qdf_opmode;
  709. #ifdef WLAN_FEATURE_11BE_MLO
  710. uint8_t *mld_mac_addr;
  711. #ifdef WLAN_MLO_MULTI_CHIP
  712. bool is_bridge_vap;
  713. #endif
  714. #endif
  715. };
  716. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  717. /**
  718. * typedef ol_txrx_vdev_delete_cb ()- callback registered during vdev detach
  719. * @context:
  720. */
  721. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  722. /**
  723. * typedef ol_txrx_peer_unmap_sync_cb() - callback registered during peer
  724. * detach sync
  725. * @vdev_id:
  726. * @peer_id_cnt:
  727. * @peer_id_list:
  728. */
  729. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  730. uint32_t peer_id_cnt,
  731. uint16_t *peer_id_list);
  732. /**
  733. * enum txrx_direction - Packet Direction
  734. * @rx_direction: rx path packet
  735. * @tx_direction: tx path packet
  736. */
  737. enum txrx_direction {
  738. rx_direction = 1,
  739. tx_direction = 0,
  740. };
  741. /**
  742. * enum cdp_capabilities- DP capabilities
  743. * @CDP_CFG_DP_TSO: TSO capability
  744. * @CDP_CFG_DP_LRO: LRO capability
  745. * @CDP_CFG_DP_SG: Scatter Gather capability
  746. * @CDP_CFG_DP_GRO: GRO capability
  747. * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability
  748. * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability
  749. * @CDP_CFG_DP_RAWMODE: RAW mode capability
  750. * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability
  751. * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability
  752. */
  753. enum cdp_capabilities {
  754. CDP_CFG_DP_TSO,
  755. CDP_CFG_DP_LRO,
  756. CDP_CFG_DP_SG,
  757. CDP_CFG_DP_GRO,
  758. CDP_CFG_DP_OL_TX_CSUM,
  759. CDP_CFG_DP_OL_RX_CSUM,
  760. CDP_CFG_DP_RAWMODE,
  761. CDP_CFG_DP_PEER_FLOW_CTRL,
  762. CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT,
  763. };
  764. /**
  765. * struct ol_txrx_nbuf_classify - Packet classification object
  766. * @peer_id: unique peer identifier from fw
  767. * @tid: traffic identifier(could be overridden)
  768. * @pkt_tid: traffic identifier(cannot be overridden)
  769. * @pkt_tos: ip header tos value
  770. * @pkt_dscp: ip header dscp value
  771. * @tos: index value in map
  772. * @dscp: DSCP_TID map index
  773. * @is_mcast: multicast pkt check
  774. * @is_eap: eapol pkt check
  775. * @is_arp: arp pkt check
  776. * @is_tcp: tcp pkt check
  777. * @is_dhcp: dhcp pkt check
  778. * @is_igmp: igmp pkt check
  779. * @is_ipv4: ip version 4 pkt check
  780. * @is_ipv6: ip version 6 pkt check
  781. */
  782. struct ol_txrx_nbuf_classify {
  783. uint16_t peer_id;
  784. uint8_t tid;
  785. uint8_t pkt_tid;
  786. uint8_t pkt_tos;
  787. uint8_t pkt_dscp;
  788. uint8_t tos;
  789. uint8_t dscp;
  790. uint8_t is_mcast;
  791. uint8_t is_eap;
  792. uint8_t is_arp;
  793. uint8_t is_tcp;
  794. uint8_t is_dhcp;
  795. uint8_t is_igmp;
  796. uint8_t is_ipv4;
  797. uint8_t is_ipv6;
  798. };
  799. /*
  800. * typedef ol_osif_vdev_handle - opaque handle for OS shim virtual
  801. * device object
  802. */
  803. struct ol_osif_vdev_t;
  804. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  805. #ifdef QCA_SUPPORT_WDS_EXTENDED
  806. struct ol_osif_peer_t;
  807. typedef struct ol_osif_peer_t *ol_osif_peer_handle;
  808. #endif
  809. /**
  810. * enum connectivity_stats_pkt_status - data pkt type
  811. * @PKT_TYPE_REQ: Request packet
  812. * @PKT_TYPE_RSP: Response packet
  813. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  814. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  815. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  816. * @PKT_TYPE_RX_REFUSED: RX packet refused
  817. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  818. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  819. * @PKT_TYPE_NONE: Invalid packet
  820. */
  821. enum connectivity_stats_pkt_status {
  822. PKT_TYPE_REQ,
  823. PKT_TYPE_RSP,
  824. PKT_TYPE_TX_DROPPED,
  825. PKT_TYPE_RX_DROPPED,
  826. PKT_TYPE_RX_DELIVERED,
  827. PKT_TYPE_RX_REFUSED,
  828. PKT_TYPE_TX_HOST_FW_SENT,
  829. PKT_TYPE_TX_ACK_CNT,
  830. PKT_TYPE_NONE,
  831. };
  832. /**
  833. * typedef ol_txrx_mgmt_tx_cb() - tx management delivery notification
  834. * callback function
  835. * @ctxt:
  836. * @tx_mgmt_frm:
  837. * @had_error:
  838. */
  839. typedef void
  840. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  841. /**
  842. * typedef ol_txrx_data_tx_cb() - Function registered with the data path
  843. * that is called when tx frames marked as "no free" are
  844. * done being transmitted
  845. * @ctxt:
  846. * @tx_frm:
  847. * @had_error:
  848. */
  849. typedef void
  850. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  851. /**
  852. * typedef ol_txrx_tx_fp() - top-level transmit function
  853. * @soc: dp soc handle
  854. * @vdev_id: handle to the virtual device object
  855. * @msdu_list: list of network buffers
  856. */
  857. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  858. qdf_nbuf_t msdu_list);
  859. /**
  860. * typedef ol_txrx_tx_fast_fp() - top-level fast transmit function
  861. * @soc: dp soc handle
  862. * @vdev_id: handle to the virtual device object
  863. * @msdu_list: list of network buffers
  864. */
  865. typedef qdf_nbuf_t (*ol_txrx_tx_fast_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  866. qdf_nbuf_t msdu_list);
  867. /**
  868. * typedef ol_txrx_tx_exc_fp() - top-level transmit function on exception path
  869. * @soc: dp soc handle
  870. * @vdev_id: handle to the virtual device object
  871. * @msdu_list: list of network buffers
  872. * @tx_exc_metadata: structure that holds parameters to exception path
  873. */
  874. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  875. qdf_nbuf_t msdu_list,
  876. struct cdp_tx_exception_metadata
  877. *tx_exc_metadata);
  878. /**
  879. * typedef ol_txrx_completion_fp() - top-level transmit function
  880. * for tx completion
  881. * @skb: skb data
  882. * @osif_dev: the virtual device's OS shim object
  883. * @flag: flag
  884. */
  885. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  886. void *osif_dev, uint16_t flag);
  887. /**
  888. * typedef ol_txrx_classify_critical_pkt_fp() - classification cb for critical
  889. * frames
  890. * @osif_dev: the virtual device's OS shim object
  891. * @skb: skb data
  892. */
  893. typedef void (*ol_txrx_classify_critical_pkt_fp)(void *osif_dev,
  894. qdf_nbuf_t skb);
  895. /**
  896. * typedef ol_txrx_tx_flow_control_fp() - tx flow control notification
  897. * function from txrx to OS shim
  898. * @osif_dev: the virtual device's OS shim object
  899. * @tx_resume: tx os q should be resumed or not
  900. */
  901. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  902. bool tx_resume);
  903. /**
  904. * typedef ol_txrx_tx_flow_control_is_pause_fp() - is tx paused by flow control
  905. * function from txrx to OS shim
  906. * @osif_dev: the virtual device's OS shim object
  907. *
  908. * Return: true if tx is paused by flow control
  909. */
  910. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  911. /**
  912. * typedef ol_txrx_rx_fp() - receive function to hand batches of data
  913. * frames from txrx to OS shim
  914. * @osif_dev: handle to the OSIF virtual device object
  915. * @msdu_list: list of network buffers
  916. */
  917. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  918. typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
  919. void *dp_vdev,
  920. qdf_nbuf_t msdu_list);
  921. typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
  922. /**
  923. * typedef ol_txrx_rx_flush_fp() - receive function to hand batches of
  924. * data frames from txrx to OS shim
  925. * @osif_dev: handle to the OSIF virtual device object
  926. * @vdev_id: vdev_if of the packets to be flushed
  927. */
  928. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  929. /**
  930. * typedef ol_txrx_rx_gro_flush_ind_fp() - function to send GRO flush
  931. * indication to stack for a given
  932. * RX Context Id.
  933. * @osif_dev: handle to the OSIF virtual device object
  934. * @rx_ctx_id: Rx context Id for which gro flush should happen
  935. */
  936. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  937. int rx_ctx_id);
  938. /**
  939. * typedef ol_txrx_stats_rx_fp() - receive function to hand batches of
  940. * data frames from txrx to OS shim
  941. * @skb: skb data
  942. * @osif_dev: the virtual device's OS shim object
  943. * @action: data packet type
  944. * @pkt_type: packet data type
  945. */
  946. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  947. void *osif_dev, enum connectivity_stats_pkt_status action,
  948. uint8_t *pkt_type);
  949. /**
  950. * typedef ol_txrx_get_key_fp() - function to gey key based on keyix
  951. * and peer mac address
  952. * @osif_dev: the virtual device's OS shim object
  953. * @key_buf: pointer to store key
  954. * @mac_addr: pointer to mac address
  955. * @keyix: key id
  956. */
  957. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf,
  958. uint8_t *mac_addr, uint8_t keyix);
  959. /**
  960. * typedef ol_txrx_rsim_rx_decap_fp() - raw mode simulation function
  961. * to decap the packets in
  962. * receive path.
  963. * @osif_dev: the virtual device's OS shim object
  964. * @list_head: pointer to head of receive packet queue to decap
  965. * @list_tail: pointer to tail of receive packet queue to decap
  966. * @peer_mac: mac address of peer handler
  967. */
  968. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  969. qdf_nbuf_t *list_head,
  970. qdf_nbuf_t *list_tail);
  971. /**
  972. * typedef ol_txrx_tx_free_ext_fp() - external tx free function to
  973. * read per packet stats and free
  974. * tx buffer externally
  975. * @netbuf: tx network buffer
  976. */
  977. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  978. /**
  979. * typedef ol_txrx_rx_check_wai_fp() - OSIF WAPI receive function
  980. * @vdev:
  981. * @mpdu_head:
  982. * @mpdu_tail:
  983. */
  984. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  985. qdf_nbuf_t mpdu_head,
  986. qdf_nbuf_t mpdu_tail);
  987. /**
  988. * typedef ol_txrx_rx_mon_fp() - OSIF monitor mode receive function for single
  989. * MPDU (802.11 format)
  990. * @vdev:
  991. * @mpdu:
  992. * @rx_status:
  993. */
  994. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  995. qdf_nbuf_t mpdu,
  996. void *rx_status);
  997. /**
  998. * typedef ol_txrx_proxy_arp_fp() - proxy arp function pointer
  999. * @vdev:
  1000. * @netbuf:
  1001. */
  1002. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  1003. qdf_nbuf_t netbuf);
  1004. /**
  1005. * typedef ol_txrx_mcast_me_fp() - function pointer for multicast enhancement
  1006. * @vdev:
  1007. * @netbuf:
  1008. */
  1009. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  1010. qdf_nbuf_t netbuf);
  1011. /**
  1012. * typedef ol_txrx_stats_callback() - statistics notify callback
  1013. * @ctxt:
  1014. * @type:
  1015. * @buf:
  1016. * @bytes:
  1017. */
  1018. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  1019. enum htt_cmn_dbg_stats_type type,
  1020. uint8_t *buf, int bytes);
  1021. /**
  1022. * typedef ol_txrx_pktdump_cb() - callback for packet dump feature
  1023. * @soc:
  1024. * @pdev_id:
  1025. * @vdev_id:
  1026. * @netbuf:
  1027. * @status:
  1028. * @type:
  1029. */
  1030. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  1031. uint8_t pdev_id,
  1032. uint8_t vdev_id,
  1033. qdf_nbuf_t netbuf,
  1034. enum qdf_dp_tx_rx_status status,
  1035. enum qdf_pkt_type type);
  1036. /**
  1037. * typedef ol_txrx_get_tsf_time() - callback to get tsf time
  1038. * @osif_dev:
  1039. * @input_time:
  1040. * @tsf_time:
  1041. */
  1042. typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time,
  1043. uint64_t *tsf_time);
  1044. /**
  1045. * struct ol_txrx_ops - (pointers to) the functions used for tx and rx
  1046. * data xfer
  1047. *
  1048. * There are two portions of these txrx operations.
  1049. * The rx portion is filled in by OSIF SW before calling
  1050. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  1051. * the txrx SW stores a copy of these rx function pointers, to use
  1052. * as it delivers rx data frames to the OSIF SW.
  1053. * The tx portion is filled in by the txrx SW inside
  1054. * ol_txrx_osif_vdev_register; when the function call returns,
  1055. * the OSIF SW stores a copy of these tx functions to use as it
  1056. * delivers tx data frames to the txrx SW.
  1057. *
  1058. * @tx: tx function pointers - specified by txrx, stored by OS shim
  1059. * @tx.std: the tx function pointer for standard data
  1060. * frames This function pointer is set by the txrx SW
  1061. * perform host-side transmit operations based on
  1062. * whether a HL or LL host/target interface is in use.
  1063. * @tx.flow_control_cb: the transmit flow control
  1064. * function that is registered by the
  1065. * OSIF which is called from txrx to
  1066. * indicate whether the transmit OS
  1067. * queues should be paused/resumed
  1068. * @rx: rx function pointers - specified by OS shim, stored by txrx
  1069. * @rx.rx: the OS shim rx function to deliver rx data
  1070. * frames to. This can have different values for
  1071. * different virtual devices, e.g. so one virtual
  1072. * device's OS shim directly hands rx frames to the OS,
  1073. * but another virtual device's OS shim filters out P2P
  1074. * messages before sending the rx frames to the OS. The
  1075. * netbufs delivered to the osif_rx function are in the
  1076. * format specified by the OS to use for tx and rx
  1077. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  1078. * are given to the thread, instead of the stack via this pointer.
  1079. * @rx.rx_eapol: This rx function pointer used to receive only eapol frames
  1080. * @rx.stack: function to give packets to the stack. Differs from @rx.rx.
  1081. * In case RX Threads are enabled, this pointer holds the callback to give
  1082. * packets to the stack.
  1083. * @rx.rx_gro_flush: GRO flush indication to stack for a given RX CTX ID
  1084. * @rx.wai_check: the tx function pointer for WAPI frames
  1085. * @rx.mon: the OS shim rx monitor function to deliver
  1086. * monitor data to Though in practice, it is probable
  1087. * that the same function will be used for delivering
  1088. * rx monitor data for all virtual devices, in theory
  1089. * each different virtual device can have a different
  1090. * OS shim function for accepting rx monitor data. The
  1091. * netbufs delivered to the osif_rx_mon function are in
  1092. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  1093. * an 802.11 MSDU. Depending on compile-time
  1094. * configuration, each netbuf may also have a
  1095. * monitor-mode encapsulation header such as a radiotap
  1096. * header added before the MPDU contents.
  1097. * @rx.std: the OS shim rx function to deliver rx data
  1098. * @proxy_arp: proxy arp function pointer - specified by
  1099. * OS shim, stored by txrx
  1100. * @me_convert:
  1101. * @get_key: function pointer to get key of the peer with
  1102. * specific key index
  1103. * @get_tsf_time: function pointer to get TSF
  1104. */
  1105. struct ol_txrx_ops {
  1106. struct {
  1107. ol_txrx_tx_fp tx;
  1108. ol_txrx_tx_fast_fp tx_fast;
  1109. ol_txrx_tx_exc_fp tx_exception;
  1110. ol_txrx_tx_free_ext_fp tx_free_ext;
  1111. ol_txrx_completion_fp tx_comp;
  1112. ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb;
  1113. } tx;
  1114. struct {
  1115. ol_txrx_rx_fp rx;
  1116. #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT
  1117. ol_txrx_rx_fp rx_eapol;
  1118. #endif
  1119. ol_txrx_rx_fp rx_stack;
  1120. ol_txrx_rx_flush_fp rx_flush;
  1121. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  1122. ol_txrx_rx_check_wai_fp wai_check;
  1123. ol_txrx_rx_mon_fp mon;
  1124. ol_txrx_stats_rx_fp stats_rx;
  1125. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  1126. ol_txrx_fisa_rx_fp osif_fisa_rx;
  1127. ol_txrx_fisa_flush_fp osif_fisa_flush;
  1128. } rx;
  1129. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  1130. ol_txrx_proxy_arp_fp proxy_arp;
  1131. ol_txrx_mcast_me_fp me_convert;
  1132. ol_txrx_get_key_fp get_key;
  1133. ol_txrx_get_tsf_time get_tsf_time;
  1134. };
  1135. /**
  1136. * struct ol_txrx_hardtart_ctxt - handlers for dp tx path
  1137. * @tx: normal tx function
  1138. * @tx_fast: fast tx function
  1139. * @tx_exception: exception tx function
  1140. */
  1141. struct ol_txrx_hardtart_ctxt {
  1142. ol_txrx_tx_fp tx;
  1143. ol_txrx_tx_fast_fp tx_fast;
  1144. ol_txrx_tx_exc_fp tx_exception;
  1145. };
  1146. /**
  1147. * struct ol_txrx_stats_req - specifications of the requested
  1148. * statistics
  1149. * @stats_type_upload_mask: which stats to upload
  1150. * @stats_type_reset_mask: which stats to reset
  1151. * @print: control to print uploaded stats. stats will be printed if
  1152. * either print element is set
  1153. * @print.verbose: verbose stats printout
  1154. * @print.concise: concise stats printout (takes precedence)
  1155. * @callback: callback context
  1156. * @callback.fp: function pointer to call. stats notify callback will
  1157. * be invoked if fp is non-NULL
  1158. * @callback.ctxt: opaque context to pass to callback function
  1159. * @copy: copy context
  1160. * @copy.buf: stats will be copied into the specified buffer if buf is
  1161. * non-NULL
  1162. * @byte_limit: don't copy more than this
  1163. * @wait: wait context
  1164. * @wait.blocking: If true, the caller will take the specified
  1165. * semaphore to wait for the stats to be uploaded, and
  1166. * the driver will release the semaphore when the
  1167. * stats are done being uploaded.
  1168. * @wait.sem_ptr: Semaphore to use for blocking
  1169. */
  1170. struct ol_txrx_stats_req {
  1171. uint32_t stats_type_upload_mask;
  1172. uint32_t stats_type_reset_mask;
  1173. struct {
  1174. int verbose;
  1175. int concise;
  1176. } print;
  1177. struct {
  1178. ol_txrx_stats_callback fp;
  1179. void *ctxt;
  1180. } callback;
  1181. struct {
  1182. uint8_t *buf;
  1183. int byte_limit;
  1184. } copy;
  1185. struct {
  1186. int blocking;
  1187. qdf_semaphore_t *sem_ptr;
  1188. } wait;
  1189. };
  1190. /* DP soc struct definition */
  1191. struct cdp_soc_t {
  1192. struct cdp_ops *ops;
  1193. struct ol_if_ops *ol_ops;
  1194. };
  1195. /**
  1196. * enum cdp_peer_param_type - different types of parameters
  1197. * to set values in peer
  1198. * @CDP_CONFIG_NAWDS: Enable nawds mode
  1199. * @CDP_CONFIG_NAC: Enable nac
  1200. * @CDP_CONFIG_ISOLATION: Enable isolation
  1201. * @CDP_CONFIG_IN_TWT: In TWT session or not
  1202. * @CDP_CONFIG_MLD_PEER_VDEV: Change MLD peer's vdev
  1203. * @CDP_CONFIG_PEER_FREQ: Set peer frequency
  1204. */
  1205. enum cdp_peer_param_type {
  1206. CDP_CONFIG_NAWDS,
  1207. CDP_CONFIG_NAC,
  1208. CDP_CONFIG_ISOLATION,
  1209. CDP_CONFIG_IN_TWT,
  1210. CDP_CONFIG_MLD_PEER_VDEV,
  1211. CDP_CONFIG_PEER_FREQ,
  1212. };
  1213. /**
  1214. * enum cdp_pdev_param_type - different types of parameters
  1215. * to set values in pdev
  1216. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  1217. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  1218. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  1219. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  1220. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  1221. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  1222. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  1223. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  1224. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  1225. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  1226. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  1227. * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
  1228. * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
  1229. * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
  1230. * @CDP_CONFIG_TX_CAPTURE: set tx capture
  1231. * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
  1232. * @CDP_CONFIG_VOW: set/get vow config
  1233. * @CDP_TIDQ_OVERRIDE: set/get tid queue override
  1234. * @CDP_TIDMAP_PRTY: set/get tid map prty
  1235. * @CDP_TX_PENDING: get tx pending
  1236. * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
  1237. * @CDP_FILTER_UCAST_DATA: filter unicast data
  1238. * @CDP_FILTER_MCAST_DATA: filter multicast data
  1239. * @CDP_FILTER_NO_DATA: filter no data
  1240. * @CDP_MONITOR_CHANNEL: monitor channel
  1241. * @CDP_MONITOR_FREQUENCY: monitor frequency
  1242. * @CDP_CONFIG_BSS_COLOR: configure bss color
  1243. * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
  1244. * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
  1245. * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
  1246. * @CDP_CONFIG_ENHANCED_STATS_ENABLE:
  1247. * @CDP_ISOLATION: set isolation flag
  1248. * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture
  1249. * @CDP_CONFIG_RXDMA_BUF_RING_SIZE: RXDMA buffer ring size configure
  1250. * @CDP_CONFIG_DELAY_STATS: set/get delay stats
  1251. */
  1252. enum cdp_pdev_param_type {
  1253. CDP_CONFIG_DEBUG_SNIFFER,
  1254. CDP_CONFIG_BPR_ENABLE,
  1255. CDP_CONFIG_PRIMARY_RADIO,
  1256. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  1257. CDP_CONFIG_IGMPMLD_OVERRIDE,
  1258. CDP_CONFIG_IGMPMLD_TID,
  1259. CDP_CONFIG_ARP_DBG_CONF,
  1260. CDP_CONFIG_CAPTURE_LATENCY,
  1261. CDP_INGRESS_STATS,
  1262. CDP_OSIF_DROP,
  1263. CDP_CONFIG_ENH_RX_CAPTURE,
  1264. CDP_CONFIG_ENH_TX_CAPTURE,
  1265. CDP_CONFIG_HMMC_TID_OVERRIDE,
  1266. CDP_CONFIG_HMMC_TID_VALUE,
  1267. CDP_CONFIG_TX_CAPTURE,
  1268. CDP_CHAN_NOISE_FLOOR,
  1269. CDP_CONFIG_VOW,
  1270. CDP_TIDQ_OVERRIDE,
  1271. CDP_TIDMAP_PRTY,
  1272. CDP_TX_PENDING,
  1273. CDP_FILTER_NEIGH_PEERS,
  1274. CDP_FILTER_UCAST_DATA,
  1275. CDP_FILTER_MCAST_DATA,
  1276. CDP_FILTER_NO_DATA,
  1277. CDP_MONITOR_CHANNEL,
  1278. CDP_MONITOR_FREQUENCY,
  1279. CDP_CONFIG_BSS_COLOR,
  1280. CDP_SET_ATF_STATS_ENABLE,
  1281. CDP_CONFIG_SPECIAL_VAP,
  1282. CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
  1283. CDP_CONFIG_ENHANCED_STATS_ENABLE,
  1284. CDP_ISOLATION,
  1285. CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE,
  1286. CDP_CONFIG_RXDMA_BUF_RING_SIZE,
  1287. CDP_CONFIG_DELAY_STATS,
  1288. };
  1289. /**
  1290. * typedef cdp_config_param_type - union of different types of parameters
  1291. * to set values into dp handles.
  1292. *
  1293. * @cdp_peer_param_nawds: Enable nawds mode
  1294. * @cdp_peer_param_isolation: Enable isolation
  1295. * @cdp_peer_param_in_twt: in TWT session or not
  1296. * @cdp_peer_param_nac: Enable nac
  1297. * @cdp_peer_param_freq: Peer frequency
  1298. *
  1299. * @cdp_vdev_param_nawds: set nawds enable/disable
  1300. * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
  1301. * @cdp_vdev_param_wds: wds sta
  1302. * @cdp_vdev_param_mec: MEC enable flags
  1303. * @cdp_vdev_param_proxysta: proxy sta
  1304. * @cdp_vdev_param_tdls_flags: tdls link flags
  1305. * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
  1306. * @cdp_vdev_param_cipher_en: set cipher type based on security
  1307. * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
  1308. * @cdp_vdev_param_tx_encap: tx encap type
  1309. * @cdp_vdev_param_rx_decap: rx decap type
  1310. * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
  1311. * @cdp_vdev_param_tidmap_prty: set tid vdev prty
  1312. * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
  1313. * @cdp_vdev_param_mesh_mode: set mesh mode
  1314. * @cdp_vdev_param_safe_mode: set safe mode
  1315. * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
  1316. * @cdp_vdev_param_hlos_tid_override: set hlos tid override
  1317. * @cdp_vdev_param_peer_authorize: set peer authorize
  1318. * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
  1319. * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
  1320. * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id
  1321. * @cdp_vdev_param_mcast_vdev: set mcast vdev params
  1322. * @cdp_vdev_param_wrap: qwrap ap vap
  1323. *
  1324. * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
  1325. * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
  1326. * @cdp_pdev_param_primary_radio: Configure radio as primary
  1327. * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
  1328. * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
  1329. * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
  1330. * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
  1331. * @cdp_pdev_param_cptr_latcy: Capture time latency
  1332. * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
  1333. * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
  1334. * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
  1335. * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
  1336. * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
  1337. * @cdp_pdev_param_hmmc_tid: set hmmc tid value
  1338. * @cdp_pdev_param_tx_capture: set tx capture
  1339. * @cdp_pdev_param_chn_noise_flr: set channel noise floor
  1340. * @cdp_pdev_param_cfg_vow: set/get vow config
  1341. * @cdp_pdev_param_cfg_delay_stats: set/get delayed stats
  1342. * @cdp_pdev_param_tidq_override: set/get tid queue override
  1343. * @cdp_pdev_param_mon_freq: set monitor frequency
  1344. * @cdp_pdev_param_bss_color: configure bss color
  1345. * @cdp_pdev_param_tidmap_prty: set/get tid map prty
  1346. * @cdp_pdev_param_tx_pending: get tx pending
  1347. * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
  1348. * @cdp_pdev_param_fltr_ucast: filter unicast data
  1349. * @cdp_pdev_param_fltr_mcast: filter multicast data
  1350. * @cdp_pdev_param_fltr_none: filter no data
  1351. * @cdp_pdev_param_monitor_chan: monitor channel
  1352. * @cdp_pdev_param_atf_stats_enable: ATF stats enable
  1353. * @cdp_pdev_param_config_special_vap: Configure Special vap
  1354. * @cdp_pdev_param_isolation : set isolation mode
  1355. *
  1356. * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  1357. * @cdp_psoc_param_en_nss_cfg: set nss cfg
  1358. * @cdp_ipa_enabled : set ipa mode
  1359. * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
  1360. * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable
  1361. * @cdp_sawf_enabled: SAWF enable/disable
  1362. * @cdp_sawf_stats: SAWF stats config
  1363. * @cdp_vdev_param_traffic_end_ind: Traffic end indication enable/disable
  1364. * @cdp_skel_enable : Enable/Disable skeleton code for Umac reset debug
  1365. * @cdp_drop_tx_mcast: Enable/Disable tx mcast drop
  1366. * @cdp_vdev_tx_to_fw: Set to_fw bit for all tx packets for the vdev
  1367. * @cdp_peer_metadata_ver: DP rx peer metadata version configuration
  1368. * @hal_soc_hdl: DP HAL soc handle
  1369. * @cdp_tx_desc_num: DP TX desc number config
  1370. * @cdp_tx_ext_desc_num: number of TX EXT desc config
  1371. * @cdp_tx_ring_size: TX ring size config
  1372. * @cdp_tx_comp_ring_size: TX completion ring size config
  1373. * @cdp_rx_sw_desc_num: RX SW descriptor number config
  1374. * @cdp_reo_dst_ring_size: REO destination ring size config
  1375. * @cdp_rxdma_refill_ring_size: RXDMA refill ring size config
  1376. * @cdp_rx_refill_buf_pool_size: RX refill ring size config
  1377. * @cdp_rxdma_buf_ring_size: RXDMA buf ring size config
  1378. * @mac_addr: vdev mac address
  1379. * @new_vdev_id: New vdev id to which MLD peer is to be moved
  1380. * @fisa_params.fisa_fst_size: FISA table size
  1381. * @fisa_params.rx_flow_max_search: max FST entries
  1382. * @fisa_params.rx_toeplitz_hash_key: RX hash key
  1383. * @rx_pkt_tlv_size: RX packet TLV size
  1384. * @cdp_ast_indication_disable: AST indication disable
  1385. * @cdp_psoc_param_mlo_oper_mode: mlo operation mode
  1386. */
  1387. typedef union cdp_config_param_t {
  1388. /* peer params */
  1389. bool cdp_peer_param_nawds;
  1390. bool cdp_peer_param_isolation;
  1391. uint8_t cdp_peer_param_nac;
  1392. bool cdp_peer_param_in_twt;
  1393. uint32_t cdp_peer_param_freq;
  1394. /* vdev params */
  1395. bool cdp_vdev_param_wds;
  1396. bool cdp_vdev_param_mec;
  1397. bool cdp_vdev_param_nawds;
  1398. bool cdp_vdev_param_proxysta;
  1399. bool cdp_vdev_param_tdls_flags;
  1400. bool cdp_vdev_param_ap_brdg_en;
  1401. bool cdp_vdev_param_qwrap_isolation;
  1402. bool cdp_vdev_param_update_multipass;
  1403. uint8_t cdp_vdev_param_da_war;
  1404. uint8_t cdp_vdev_param_mcast_en;
  1405. uint8_t cdp_vdev_param_igmp_mcast_en;
  1406. uint8_t cdp_vdev_param_tidmap_prty;
  1407. uint8_t cdp_vdev_param_tidmap_tbl_id;
  1408. uint32_t cdp_vdev_param_aging_tmr;
  1409. uint32_t cdp_vdev_param_cipher_en;
  1410. uint32_t cdp_vdev_param_tx_encap;
  1411. uint32_t cdp_vdev_param_rx_decap;
  1412. uint32_t cdp_vdev_param_mesh_rx_filter;
  1413. uint32_t cdp_vdev_param_mesh_mode;
  1414. uint32_t cdp_vdev_param_safe_mode;
  1415. uint32_t cdp_vdev_param_drop_unenc;
  1416. uint8_t cdp_vdev_param_hlos_tid_override;
  1417. bool cdp_vdev_param_wds_ext;
  1418. uint8_t cdp_vdev_param_peer_authorize;
  1419. uint8_t cdp_vdev_param_peer_tid_latency_enable;
  1420. uint8_t cdp_vdev_param_mesh_tid;
  1421. uint8_t cdp_vdev_param_dscp_tid_map_id;
  1422. bool cdp_vdev_param_mcast_vdev;
  1423. bool cdp_vdev_param_wrap;
  1424. /* pdev params */
  1425. bool cdp_pdev_param_cptr_latcy;
  1426. bool cdp_pdev_param_hmmc_tid_ovrd;
  1427. bool cdp_pdev_param_fltr_neigh_peers;
  1428. bool cdp_pdev_param_cfg_vow;
  1429. bool cdp_pdev_param_cfg_delay_stats;
  1430. bool cdp_pdev_param_fltr_mcast;
  1431. bool cdp_pdev_param_fltr_none;
  1432. bool cdp_pdev_param_fltr_ucast;
  1433. uint8_t cdp_pdev_param_primary_radio;
  1434. uint8_t cdp_pdev_param_en_rx_cap;
  1435. uint8_t cdp_pdev_param_en_tx_cap;
  1436. uint8_t cdp_pdev_param_tx_capture;
  1437. uint8_t cdp_pdev_param_hmmc_tid;
  1438. uint8_t cdp_pdev_param_tidmap_prty;
  1439. uint8_t cdp_pdev_param_igmpmld_override;
  1440. uint8_t cdp_pdev_param_igmpmld_tid;
  1441. uint8_t cdp_pdev_param_arp_dbg_conf;
  1442. uint8_t cdp_pdev_param_tidq_override;
  1443. uint8_t cdp_pdev_param_bss_color;
  1444. uint16_t cdp_pdev_param_chn_noise_flr;
  1445. qdf_freq_t cdp_pdev_param_mon_freq;
  1446. int cdp_pdev_param_dbg_snf;
  1447. int cdp_pdev_param_bpr_enable;
  1448. int cdp_pdev_param_monitor_chan;
  1449. uint32_t cdp_pdev_param_ingrs_stats;
  1450. uint32_t cdp_pdev_param_osif_drop;
  1451. uint32_t cdp_pdev_param_en_perpkt_txstats;
  1452. uint32_t cdp_pdev_param_tx_pending;
  1453. bool cdp_pdev_param_atf_stats_enable;
  1454. bool cdp_pdev_param_config_special_vap;
  1455. bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
  1456. bool cdp_pdev_param_enhanced_stats_enable;
  1457. bool cdp_pdev_param_isolation;
  1458. /* psoc params */
  1459. bool cdp_psoc_param_en_rate_stats;
  1460. int cdp_psoc_param_en_nss_cfg;
  1461. int cdp_psoc_param_preferred_hw_mode;
  1462. bool cdp_psoc_param_pext_stats;
  1463. bool cdp_psoc_param_jitter_stats;
  1464. bool cdp_psoc_param_dp_debug_log;
  1465. bool cdp_skip_bar_update;
  1466. bool cdp_ipa_enabled;
  1467. bool cdp_psoc_param_vdev_stats_hw_offload;
  1468. bool cdp_pdev_param_undecoded_metadata_enable;
  1469. bool cdp_sawf_enabled;
  1470. uint8_t cdp_sawf_stats;
  1471. bool cdp_drop_3addr_mcast;
  1472. bool cdp_vdev_param_traffic_end_ind;
  1473. bool cdp_umac_rst_skel;
  1474. bool cdp_drop_tx_mcast;
  1475. bool cdp_vdev_tx_to_fw;
  1476. uint8_t cdp_peer_metadata_ver;
  1477. void *hal_soc_hdl;
  1478. int cdp_tx_desc_num;
  1479. int cdp_tx_ext_desc_num;
  1480. int cdp_tx_ring_size;
  1481. int cdp_tx_comp_ring_size;
  1482. int cdp_rx_sw_desc_num;
  1483. int cdp_reo_dst_ring_size;
  1484. int cdp_rxdma_refill_ring_size;
  1485. int cdp_rx_refill_buf_pool_size;
  1486. int cdp_rxdma_buf_ring_size;
  1487. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  1488. uint8_t new_vdev_id;
  1489. struct {
  1490. uint32_t fisa_fst_size;
  1491. uint16_t rx_flow_max_search;
  1492. uint8_t *rx_toeplitz_hash_key;
  1493. } fisa_params;
  1494. uint16_t rx_pkt_tlv_size;
  1495. bool cdp_ast_indication_disable;
  1496. uint8_t cdp_psoc_param_mlo_oper_mode;
  1497. } cdp_config_param_type;
  1498. /**
  1499. * enum cdp_rx_enh_capture_mode - Rx enhanced capture modes
  1500. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  1501. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  1502. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  1503. */
  1504. enum cdp_rx_enh_capture_mode {
  1505. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  1506. CDP_RX_ENH_CAPTURE_MPDU,
  1507. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  1508. };
  1509. /**
  1510. * enum cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  1511. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  1512. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  1513. */
  1514. enum cdp_rx_enh_capture_peer {
  1515. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  1516. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  1517. };
  1518. /**
  1519. * enum cdp_tx_enh_capture_mode - Tx enhanced capture modes
  1520. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  1521. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  1522. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  1523. * @CDP_TX_ENH_CAPTURE_MAX: Max value
  1524. */
  1525. enum cdp_tx_enh_capture_mode {
  1526. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  1527. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  1528. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  1529. CDP_TX_ENH_CAPTURE_MAX,
  1530. };
  1531. /**
  1532. * enum cdp_pdev_bpr_param - different types of parameters
  1533. * to set value in pdev
  1534. * @CDP_BPR_DISABLE: Set bpr to disable state
  1535. * @CDP_BPR_ENABLE: set bpr to enable state
  1536. *
  1537. * Enum indicating bpr state to enable/disable.
  1538. */
  1539. enum cdp_pdev_bpr_param {
  1540. CDP_BPR_DISABLE,
  1541. CDP_BPR_ENABLE,
  1542. };
  1543. /**
  1544. * enum cdp_vdev_param_type - different types of parameters
  1545. * to set values in vdev
  1546. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  1547. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  1548. * @CDP_ENABLE_WDS: wds sta
  1549. * @CDP_ENABLE_MEC: MEC enable flags
  1550. * @CDP_ENABLE_DA_WAR:
  1551. * @CDP_ENABLE_PROXYSTA: proxy sta
  1552. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  1553. * @CDP_CFG_WDS_AGING_TIMER: modify/stop wds aging timer
  1554. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  1555. * @CDP_ENABLE_CIPHER: set cipher type based on security
  1556. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  1557. * @CDP_UPDATE_MULTIPASS: enable/disable multipass
  1558. * @CDP_TX_ENCAP_TYPE: tx encap type
  1559. * @CDP_RX_DECAP_TYPE: rx decap type
  1560. * @CDP_MESH_RX_FILTER: set mesh rx filter
  1561. * @CDP_TID_VDEV_PRTY: set tid vdev prty
  1562. * @CDP_TIDMAP_TBL_ID: set tidmap table id
  1563. * @CDP_MESH_MODE: set mesh mode
  1564. * @CDP_SAFEMODE: set safe mode
  1565. * @CDP_DROP_UNENC: set drop unencrypted flag
  1566. * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
  1567. * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
  1568. * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
  1569. * @CDP_DROP_TX_MCAST: enable/disable tx mcast drop
  1570. * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
  1571. * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
  1572. * @CDP_SET_VAP_MESH_TID: Set latency tid in vap
  1573. * @CDP_SKIP_BAR_UPDATE_AP: enable/disable bar
  1574. * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
  1575. * @CDP_SET_MCAST_VDEV: Set primary mcast vdev
  1576. * @CDP_RESET_MLO_MCAST_VDEV: Reset mlo mcast vdev settings
  1577. * @CDP_SET_MCAST_VDEV_HW_UPDATE: Not in use
  1578. * @CDP_DROP_3ADDR_MCAST: enable/disable drop 3addr multicast flag
  1579. * @CDP_ENABLE_WRAP: qwrap ap
  1580. * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
  1581. * @CDP_VDEV_TX_TO_FW: Set to_fw bit for tx packets for the vdev
  1582. * @CDP_VDEV_SET_MAC_ADDR: Set mac address for vdev
  1583. */
  1584. enum cdp_vdev_param_type {
  1585. CDP_ENABLE_NAWDS,
  1586. CDP_ENABLE_MCAST_EN,
  1587. CDP_ENABLE_WDS,
  1588. CDP_ENABLE_MEC,
  1589. CDP_ENABLE_DA_WAR,
  1590. CDP_ENABLE_PROXYSTA,
  1591. CDP_UPDATE_TDLS_FLAGS,
  1592. CDP_CFG_WDS_AGING_TIMER,
  1593. CDP_ENABLE_AP_BRIDGE,
  1594. CDP_ENABLE_CIPHER,
  1595. CDP_ENABLE_QWRAP_ISOLATION,
  1596. CDP_UPDATE_MULTIPASS,
  1597. CDP_TX_ENCAP_TYPE,
  1598. CDP_RX_DECAP_TYPE,
  1599. CDP_MESH_RX_FILTER,
  1600. CDP_TID_VDEV_PRTY,
  1601. CDP_TIDMAP_TBL_ID,
  1602. #ifdef MESH_MODE_SUPPORT
  1603. CDP_MESH_MODE,
  1604. #endif
  1605. CDP_SAFEMODE,
  1606. CDP_DROP_UNENC,
  1607. CDP_ENABLE_IGMP_MCAST_EN,
  1608. CDP_ENABLE_HLOS_TID_OVERRIDE,
  1609. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1610. CDP_CFG_WDS_EXT,
  1611. CDP_DROP_TX_MCAST,
  1612. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1613. CDP_ENABLE_PEER_AUTHORIZE,
  1614. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1615. CDP_ENABLE_PEER_TID_LATENCY,
  1616. CDP_SET_VAP_MESH_TID,
  1617. #endif
  1618. #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
  1619. CDP_SKIP_BAR_UPDATE_AP,
  1620. #endif
  1621. CDP_UPDATE_DSCP_TO_TID_MAP,
  1622. CDP_SET_MCAST_VDEV,
  1623. CDP_RESET_MLO_MCAST_VDEV,
  1624. CDP_SET_MCAST_VDEV_HW_UPDATE,
  1625. CDP_DROP_3ADDR_MCAST,
  1626. CDP_ENABLE_WRAP,
  1627. #ifdef DP_TRAFFIC_END_INDICATION
  1628. CDP_ENABLE_TRAFFIC_END_INDICATION,
  1629. #endif
  1630. #ifdef FEATURE_DIRECT_LINK
  1631. CDP_VDEV_TX_TO_FW,
  1632. #endif
  1633. CDP_VDEV_SET_MAC_ADDR,
  1634. };
  1635. /**
  1636. * enum cdp_psoc_param_type - different types of parameters
  1637. * to set values in psoc
  1638. * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
  1639. * @CDP_SET_NSS_CFG: set nss cfg
  1640. * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  1641. * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  1642. * @CDP_IPA_ENABLE : set IPA enable mode.
  1643. * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
  1644. * @CDP_SAWF_ENABLE:
  1645. * @CDP_UMAC_RST_SKEL_ENABLE: Enable Umac reset skeleton code for debug
  1646. * @CDP_SAWF_STATS: set SAWF stats config
  1647. * @CDP_UMAC_RESET_STATS: UMAC reset stats
  1648. * @CDP_CFG_RX_PEER_METADATA_VER: RX peer metadata configuration
  1649. * @CDP_TXRX_HAL_SOC_HDL: HAL soc handle
  1650. * @CDP_CFG_TX_DESC_NUM: number of TX descriptors config
  1651. * @CDP_CFG_TX_EXT_DESC_NUM: number of TX EXT descriptors config
  1652. * @CDP_CFG_TX_RING_SIZE: TX ring size config param
  1653. * @CDP_CFG_TX_COMPL_RING_SIZE: TX completion ring size param
  1654. * @CDP_CFG_RX_SW_DESC_NUM: RX SW descriptor number
  1655. * @CDP_CFG_REO_DST_RING_SIZE: REO destination ring size config
  1656. * @CDP_CFG_RXDMA_REFILL_RING_SIZE: RXDMA refill ring size config
  1657. * @CDP_CFG_RX_REFILL_POOL_NUM: RX refill pool size config param
  1658. * @CDP_CFG_FISA_PARAMS: FISA params
  1659. * @CDP_RX_PKT_TLV_SIZE: RX pkt tlv size
  1660. * @CDP_CFG_AST_INDICATION_DISABLE: AST indication disable
  1661. * @CDP_CFG_GET_MLO_OPER_MODE: Get MLO operation mode
  1662. * @CDP_CFG_PEER_JITTER_STATS: Peer Jitter Stats
  1663. * @CDP_CONFIG_DP_DEBUG_LOG: set/get dp debug logging
  1664. */
  1665. enum cdp_psoc_param_type {
  1666. CDP_ENABLE_RATE_STATS,
  1667. CDP_SET_NSS_CFG,
  1668. CDP_SET_PREFERRED_HW_MODE,
  1669. CDP_CFG_PEER_EXT_STATS,
  1670. CDP_IPA_ENABLE,
  1671. CDP_CFG_VDEV_STATS_HW_OFFLOAD,
  1672. CDP_SAWF_ENABLE,
  1673. CDP_UMAC_RST_SKEL_ENABLE,
  1674. CDP_SAWF_STATS,
  1675. CDP_UMAC_RESET_STATS,
  1676. CDP_CFG_RX_PEER_METADATA_VER,
  1677. CDP_TXRX_HAL_SOC_HDL,
  1678. CDP_CFG_TX_DESC_NUM,
  1679. CDP_CFG_TX_EXT_DESC_NUM,
  1680. CDP_CFG_TX_RING_SIZE,
  1681. CDP_CFG_TX_COMPL_RING_SIZE,
  1682. CDP_CFG_RX_SW_DESC_NUM,
  1683. CDP_CFG_REO_DST_RING_SIZE,
  1684. CDP_CFG_RXDMA_REFILL_RING_SIZE,
  1685. #ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL
  1686. CDP_CFG_RX_REFILL_POOL_NUM,
  1687. #endif
  1688. CDP_CFG_FISA_PARAMS,
  1689. CDP_RX_PKT_TLV_SIZE,
  1690. CDP_CFG_AST_INDICATION_DISABLE,
  1691. CDP_CFG_GET_MLO_OPER_MODE,
  1692. CDP_CFG_PEER_JITTER_STATS,
  1693. CDP_CONFIG_DP_DEBUG_LOG,
  1694. };
  1695. #ifdef CONFIG_AP_PLATFORM
  1696. /* RX peer metadata version if v1a_v1b is supported */
  1697. #define CDP_RX_PEER_METADATA_V1_A_B 3
  1698. #else
  1699. #define CDP_RX_PEER_METADATA_V1_A_B 2
  1700. #endif
  1701. #define TXRX_FW_STATS_TXSTATS 1
  1702. #define TXRX_FW_STATS_RXSTATS 2
  1703. #define TXRX_FW_STATS_RX_RATE_INFO 3
  1704. #define TXRX_FW_STATS_PHYSTATS 4
  1705. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  1706. #define TXRX_FW_STATS_TX_RATE_INFO 6
  1707. #define TXRX_FW_STATS_TID_STATE 7
  1708. #define TXRX_FW_STATS_HOST_STATS 8
  1709. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  1710. #define TXRX_FW_STATS_CE_STATS 10
  1711. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  1712. #define TXRX_FW_STATS_ME_STATS 12
  1713. #define TXRX_FW_STATS_TXBF_INFO 13
  1714. #define TXRX_FW_STATS_SND_INFO 14
  1715. #define TXRX_FW_STATS_ERROR_INFO 15
  1716. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  1717. #define TXRX_FW_STATS_TX_MU_INFO 17
  1718. #define TXRX_FW_SIFS_RESP_INFO 18
  1719. #define TXRX_FW_RESET_STATS 19
  1720. #define TXRX_FW_MAC_WDOG_STATS 20
  1721. #define TXRX_FW_MAC_DESC_STATS 21
  1722. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  1723. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  1724. #define TXRX_FW_STATS_DURATION_INFO 24
  1725. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  1726. #define TXRX_FW_HALPHY_STATS 26
  1727. #define TXRX_FW_COEX_STATS 27
  1728. #define PER_RADIO_FW_STATS_REQUEST 0
  1729. #define PER_VDEV_FW_STATS_REQUEST 1
  1730. /**
  1731. * enum data_stall_log_event_indicator - Module triggering data stall
  1732. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1733. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1734. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1735. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1736. *
  1737. * Enum indicating the module that indicates data stall event
  1738. */
  1739. enum data_stall_log_event_indicator {
  1740. DATA_STALL_LOG_INDICATOR_UNUSED,
  1741. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1742. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1743. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1744. };
  1745. /**
  1746. * enum data_stall_log_event_type - data stall event type
  1747. * @DATA_STALL_LOG_NONE:
  1748. * @DATA_STALL_LOG_FW_VDEV_PAUSE:
  1749. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER:
  1750. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH:
  1751. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED:
  1752. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR:
  1753. * @DATA_STALL_LOG_FW_WDOG_ERRORS:
  1754. * @DATA_STALL_LOG_BB_WDOG_ERROR:
  1755. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR:
  1756. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT:
  1757. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT:
  1758. * @DATA_STALL_LOG_NUD_FAILURE:
  1759. *
  1760. * Enum indicating data stall event type
  1761. */
  1762. enum data_stall_log_event_type {
  1763. DATA_STALL_LOG_NONE,
  1764. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1765. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1766. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1767. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1768. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1769. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1770. DATA_STALL_LOG_BB_WDOG_ERROR,
  1771. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1772. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1773. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1774. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1775. DATA_STALL_LOG_NUD_FAILURE,
  1776. };
  1777. /**
  1778. * enum data_stall_log_recovery_type - data stall recovery type
  1779. * @DATA_STALL_LOG_RECOVERY_NONE:
  1780. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT:
  1781. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR:
  1782. *
  1783. * Enum indicating data stall recovery type
  1784. */
  1785. enum data_stall_log_recovery_type {
  1786. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1787. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1788. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1789. };
  1790. /**
  1791. * struct data_stall_event_info - data stall info
  1792. * @indicator: Module triggering data stall
  1793. * @data_stall_type: data stall event type
  1794. * @vdev_id_bitmap: vdev_id_bitmap
  1795. * @pdev_id: pdev id
  1796. * @recovery_type: data stall recovery type
  1797. */
  1798. struct data_stall_event_info {
  1799. uint32_t indicator;
  1800. uint32_t data_stall_type;
  1801. uint32_t vdev_id_bitmap;
  1802. uint32_t pdev_id;
  1803. uint32_t recovery_type;
  1804. };
  1805. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1806. /**
  1807. * enum cdp_stats - options for host and firmware statistics
  1808. * @CDP_TXRX_STATS_0:
  1809. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1810. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1811. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1812. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1813. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1814. * @CDP_TXRX_STATS_6: HTT TQM stats
  1815. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1816. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1817. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1818. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1819. * @CDP_TXRX_STATS_11: HTT Peer stats
  1820. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1821. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1822. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1823. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1824. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1825. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1826. * @CDP_TXRX_STATS_18: HTT Peer list details
  1827. * @CDP_TXRX_STATS_19: Reserved
  1828. * @CDP_TXRX_STATS_20: Reset Host stats
  1829. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1830. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1831. * @CDP_TXRX_STATS_23: Host Tx stats
  1832. * @CDP_TXRX_STATS_24: Host Rx stats
  1833. * @CDP_TXRX_STATS_25: Host Ast stats
  1834. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1835. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1836. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1837. * @CDP_TXRX_STATS_29: Host Soc config params info
  1838. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1839. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1840. * @CDP_TXRX_STATS_HTT_MAX:
  1841. * @CDP_TXRX_MAX_STATS:
  1842. */
  1843. enum cdp_stats {
  1844. CDP_TXRX_STATS_0 = 0,
  1845. CDP_TXRX_STATS_1,
  1846. CDP_TXRX_STATS_2,
  1847. CDP_TXRX_STATS_3,
  1848. CDP_TXRX_STATS_4,
  1849. CDP_TXRX_STATS_5,
  1850. CDP_TXRX_STATS_6,
  1851. CDP_TXRX_STATS_7,
  1852. CDP_TXRX_STATS_8,
  1853. CDP_TXRX_STATS_9,
  1854. CDP_TXRX_STATS_10,
  1855. CDP_TXRX_STATS_11,
  1856. CDP_TXRX_STATS_12,
  1857. CDP_TXRX_STATS_13,
  1858. CDP_TXRX_STATS_14,
  1859. CDP_TXRX_STATS_15,
  1860. CDP_TXRX_STATS_16,
  1861. CDP_TXRX_STATS_17,
  1862. CDP_TXRX_STATS_18,
  1863. CDP_TXRX_STATS_19,
  1864. CDP_TXRX_STATS_20,
  1865. CDP_TXRX_STATS_21,
  1866. CDP_TXRX_STATS_22,
  1867. CDP_TXRX_STATS_23,
  1868. CDP_TXRX_STATS_24,
  1869. CDP_TXRX_STATS_25,
  1870. CDP_TXRX_STATS_26,
  1871. CDP_TXRX_STATS_27,
  1872. CDP_TXRX_STATS_28,
  1873. CDP_TXRX_STATS_29,
  1874. CDP_TXRX_STATS_30,
  1875. CDP_TXRX_STATS_31,
  1876. CDP_TXRX_STATS_HTT_MAX = 256,
  1877. CDP_TXRX_MAX_STATS = 265,
  1878. };
  1879. /**
  1880. * enum cdp_stat_update_type - Different Stat update types sent to
  1881. * OL_IF
  1882. * @UPDATE_PEER_STATS: update peer stats
  1883. * @UPDATE_VDEV_STATS: update vdev stats
  1884. * @UPDATE_PDEV_STATS: Update pdev stats
  1885. * @UPDATE_VDEV_STATS_MLD: Update mld vdev stats
  1886. */
  1887. enum cdp_stat_update_type {
  1888. UPDATE_PEER_STATS = 0,
  1889. UPDATE_VDEV_STATS = 1,
  1890. UPDATE_PDEV_STATS = 2,
  1891. UPDATE_VDEV_STATS_MLD = 3,
  1892. };
  1893. /**
  1894. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1895. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1896. * @avg_sojourn_msdu: average sojourn msdu time
  1897. * @sum_sojourn_msdu: sum sojourn msdu time
  1898. * @num_msdus: number of msdus per ppdu
  1899. * @cookie: cookie to be used by upper layer
  1900. */
  1901. struct cdp_tx_sojourn_stats {
  1902. uint32_t ppdu_seq_id;
  1903. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1904. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1905. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1906. struct cdp_stats_cookie *cookie;
  1907. };
  1908. /**
  1909. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1910. * per-user information
  1911. * @frame_ctrl: frame control field in 802.11 header
  1912. * @qos_ctrl: QoS control field in 802.11 header
  1913. * @mpdu_tried_ucast: number of unicast mpdus tried
  1914. * @mpdu_tried_mcast: number of multicastmpdus tried
  1915. * @ltf_size: ltf_size
  1916. * @stbc: stbc
  1917. * @he_re: he_re (range extension)
  1918. * @txbf: txbf
  1919. * @bw: Transmission bandwidth
  1920. * <enum 2 transmit_bw_20_MHz>
  1921. * <enum 3 transmit_bw_40_MHz>
  1922. * <enum 4 transmit_bw_80_MHz>
  1923. * <enum 5 transmit_bw_160_MHz>
  1924. * @nss: NSS 1,2, ...8
  1925. * @mcs: MCS index
  1926. * @preamble: preamble
  1927. * @gi: guard interval 800/400/1600/3200 ns
  1928. * @dcm: dcm
  1929. * @ldpc: ldpc
  1930. * @delayed_ba:
  1931. * @ru_start: RU start index
  1932. * @ru_tones: RU tones length
  1933. * @is_mcast: MCAST or UCAST
  1934. * @user_pos: user position
  1935. * @mu_group_id: mu group id
  1936. * @ppdu_start_timestamp: 64 bits ppdu start timestamp
  1937. * @ppdu_end_timestamp: 64 bits ppdu end timestamp
  1938. */
  1939. struct cdp_delayed_tx_completion_ppdu_user {
  1940. uint32_t frame_ctrl:16,
  1941. qos_ctrl:16;
  1942. uint32_t mpdu_tried_ucast:16,
  1943. mpdu_tried_mcast:16;
  1944. uint32_t ltf_size:2,
  1945. stbc:1,
  1946. he_re:1,
  1947. txbf:4,
  1948. bw:4,
  1949. nss:4,
  1950. mcs:4,
  1951. preamble:4,
  1952. gi:4,
  1953. dcm:1,
  1954. ldpc:1,
  1955. delayed_ba:1;
  1956. uint16_t ru_start;
  1957. uint16_t ru_tones;
  1958. bool is_mcast;
  1959. uint32_t user_pos;
  1960. uint32_t mu_group_id;
  1961. uint64_t ppdu_start_timestamp;
  1962. uint64_t ppdu_end_timestamp;
  1963. };
  1964. /**
  1965. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1966. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1967. * @tid: TID number
  1968. * @peer_id: Peer ID
  1969. * @mac_addr:
  1970. * @ba_size: Block-Ack size
  1971. * @frame_ctrl: frame control field in 802.11 header
  1972. * @qos_ctrl: QoS control field in 802.11 header
  1973. * @mpdu_tried_ucast: number of unicast mpdus tried
  1974. * @mpdu_tried_mcast: number of multicast mpdus tried
  1975. * @mpdu_success: number of mpdus successfully transmitted
  1976. * @mpdu_failed:
  1977. * @long_retries: long retries
  1978. * @short_retries: short retries
  1979. * @tx_ratecode:
  1980. * @is_ampdu: mpdu aggregate or non-aggregate?
  1981. * @ppdu_type:
  1982. * @pream_punct:
  1983. * @is_seq_num_valid:
  1984. * @success_bytes: bytes successfully transmitted
  1985. * @retry_bytes: bytes retried
  1986. * @failed_bytes:
  1987. * @success_msdus: MSDUs successfully transmitted
  1988. * @retry_msdus: MSDUs retried
  1989. * @retry_mpdus: MPDUs retried
  1990. * @failed_msdus: MSDUs failed transmission
  1991. * @duration: user duration in ppdu
  1992. * @ltf_size: ltf_size
  1993. * @stbc: stbc
  1994. * @he_re: he_re (range extension)
  1995. * @txbf: txbf
  1996. * @bw: Transmission bandwidth
  1997. * <enum 2 transmit_bw_20_MHz>
  1998. * <enum 3 transmit_bw_40_MHz>
  1999. * <enum 4 transmit_bw_80_MHz>
  2000. * <enum 5 transmit_bw_160_MHz>
  2001. * @nss: NSS 1,2, ...8
  2002. * @mcs: MCS index
  2003. * @preamble: preamble
  2004. * @gi: guard interval 800/400/1600/3200 ns
  2005. * @dcm: dcm
  2006. * @ldpc: ldpc
  2007. * @delayed_ba: delayed ba bit
  2008. * @ack_ba_tlv: ack ba recv tlv bit
  2009. * @ba_seq_no: Block Ack sequence number
  2010. * @ba_bitmap: Block Ack bitmap
  2011. * @start_seq: Sequence number of first MPDU
  2012. * @enq_bitmap: Enqueue MPDU bitmap
  2013. * @failed_bitmap:
  2014. * @num_mpdu:
  2015. * @num_msdu:
  2016. * @tx_duration:
  2017. * @ru_start: RU start index
  2018. * @ru_tones: RU tones length
  2019. * @is_mcast: MCAST or UCAST
  2020. * @tx_rate: Transmission Rate
  2021. * @tx_ratekbps:
  2022. * @ack_rssi: ack rssi for separate chains
  2023. * @ack_rssi_valid:
  2024. * @usr_ack_rssi:
  2025. * @user_pos: user position
  2026. * @mu_group_id: mu group id
  2027. * @rix: rate index
  2028. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  2029. * @ppdu_cookie: 16-bit ppdu_cookie
  2030. * @sa_is_training: smart antenna training packets indication
  2031. * @rssi_chain: rssi chain per bandwidth
  2032. * @sa_tx_antenna: antenna in which packet is transmitted
  2033. * @sa_max_rates: smart antenna tx feedback info max rates
  2034. * @sa_goodput: smart antenna tx feedback info goodput
  2035. * @current_rate_per: Moving average per
  2036. * @last_enq_seq: last equeue sequence number
  2037. * @is_bss_peer: is bss peer check
  2038. * @mpdu_q: queue of mpdu in a ppdu
  2039. * @mpdus: MPDU list based on enqueue sequence bitmap
  2040. * @pending_retries: pending MPDUs (retries)
  2041. * @tlv_bitmap: per user tlv bitmap
  2042. * @skip: tx capture skip flag
  2043. * @mon_procd: to indicate user processed in ppdu of the sched cmd
  2044. * @debug_copied: flag to indicate bar frame copied
  2045. * @peer_last_delayed_ba: flag to indicate peer last delayed ba
  2046. * @phy_tx_time_us: Phy TX duration for the User
  2047. * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
  2048. * @punc_mode: puncutured mode to indicate punctured bw
  2049. * @punc_pattern_bitmap: bitmap indicating punctured pattern
  2050. * @fixed_rate_used: flag to indicate fixed rate TX
  2051. * @mprot_type: medium protection type
  2052. * @msduq_bitmap: msduq bitmap
  2053. * @rts_success: rts success
  2054. * @rts_failure: rts failure
  2055. */
  2056. struct cdp_tx_completion_ppdu_user {
  2057. uint32_t completion_status:8,
  2058. tid:8,
  2059. peer_id:16;
  2060. uint8_t mac_addr[6];
  2061. uint16_t ba_size;
  2062. uint32_t frame_ctrl:16,
  2063. qos_ctrl:16;
  2064. uint32_t mpdu_tried_ucast:16,
  2065. mpdu_tried_mcast:16;
  2066. uint16_t mpdu_success:16;
  2067. uint16_t mpdu_failed:16;
  2068. uint32_t long_retries:4,
  2069. short_retries:4,
  2070. tx_ratecode:16,
  2071. is_ampdu:1,
  2072. ppdu_type:5,
  2073. pream_punct:1,
  2074. is_seq_num_valid:1;
  2075. uint32_t success_bytes;
  2076. uint32_t retry_bytes;
  2077. uint32_t failed_bytes;
  2078. uint32_t success_msdus:16,
  2079. retry_msdus:16;
  2080. uint32_t retry_mpdus;
  2081. uint32_t failed_msdus:16,
  2082. duration:16;
  2083. uint32_t ltf_size:2,
  2084. stbc:1,
  2085. he_re:1,
  2086. txbf:4,
  2087. bw:4,
  2088. nss:4,
  2089. mcs:4,
  2090. preamble:4,
  2091. gi:4,
  2092. dcm:1,
  2093. ldpc:1,
  2094. delayed_ba:1,
  2095. ack_ba_tlv:1;
  2096. uint32_t ba_seq_no;
  2097. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2098. uint32_t start_seq;
  2099. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2100. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2101. uint32_t num_mpdu:9,
  2102. num_msdu:16;
  2103. uint32_t tx_duration;
  2104. uint16_t ru_start;
  2105. uint16_t ru_tones;
  2106. bool is_mcast;
  2107. uint32_t tx_rate;
  2108. uint32_t tx_ratekbps;
  2109. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  2110. bool ack_rssi_valid;
  2111. uint32_t usr_ack_rssi;
  2112. uint32_t user_pos;
  2113. uint32_t mu_group_id;
  2114. uint32_t rix;
  2115. uint8_t is_ppdu_cookie_valid;
  2116. uint16_t ppdu_cookie;
  2117. uint8_t sa_is_training;
  2118. int32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  2119. uint32_t sa_tx_antenna;
  2120. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ and 320MHZ
  2121. * |-------------------------------------------------|
  2122. * | 16 bits | 16 bits | 16 bits | 16 bits | 16 bits |
  2123. * | BW-1 | BW-2 | BW-3 | BW-4 | BW-5 |
  2124. * | /\ \ |
  2125. * | / \ \ |
  2126. * | / \ \ |
  2127. * | / \ \ |
  2128. * | / \ \ |
  2129. * | / \ \ |
  2130. * |/ \ \ |
  2131. * |[11|8] [5|8] \ |
  2132. * | BW1 PADDED \ |
  2133. * |-------------------------------------------------|
  2134. */
  2135. uint16_t sa_max_rates[CDP_NUM_SA_BW + 1];
  2136. uint32_t sa_goodput;
  2137. /* below field is used to calculate goodput in non-training period
  2138. * Note: As host is exposing goodput and hence current_rate_per is
  2139. * of no use. It is just for Host computation.
  2140. */
  2141. uint32_t current_rate_per;
  2142. uint32_t last_enq_seq;
  2143. uint8_t is_bss_peer;
  2144. qdf_nbuf_queue_t mpdu_q;
  2145. qdf_nbuf_t *mpdus;
  2146. uint32_t pending_retries;
  2147. uint32_t tlv_bitmap;
  2148. bool skip;
  2149. bool mon_procd;
  2150. bool debug_copied;
  2151. bool peer_last_delayed_ba;
  2152. uint16_t phy_tx_time_us;
  2153. uint32_t mpdu_bytes;
  2154. uint8_t punc_mode;
  2155. uint32_t punc_pattern_bitmap:16,
  2156. fixed_rate_used:1;
  2157. uint32_t msduq_bitmap;
  2158. uint8_t mprot_type:3,
  2159. rts_success:1,
  2160. rts_failure:1;
  2161. };
  2162. /**
  2163. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  2164. * @ppdu_id: PPDU id
  2165. * @tx_duration: user duration in ppdu
  2166. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  2167. * @frame_ctrl: frame control field in 802.11 header
  2168. * @qos_ctrl: QoS control field in 802.11 header
  2169. * @tid: TID number
  2170. * @num_msdu: number of msdu in MPDU
  2171. * @seq_no: Sequence number of first MPDU
  2172. * @ltf_size: ltf_size
  2173. * @he_re: he_re (range extension)
  2174. * @txbf: txbf
  2175. * @bw: Transmission bandwidth
  2176. * <enum 2 transmit_bw_20_MHz>
  2177. * <enum 3 transmit_bw_40_MHz>
  2178. * <enum 4 transmit_bw_80_MHz>
  2179. * <enum 5 transmit_bw_160_MHz>
  2180. * @nss: NSS 1,2, ...8
  2181. * @mcs: MCS index
  2182. * @preamble: preamble
  2183. * @gi: guard interval 800/400/1600/3200 ns
  2184. * @channel: frequency
  2185. * @channel_num: channel number
  2186. * @ack_rssi: ack rssi
  2187. * @ldpc: ldpc
  2188. * @tx_rate: Transmission Rate
  2189. * @mac_address: peer mac address
  2190. * @bss_mac_address: bss mac address
  2191. * @ppdu_start_timestamp: TSF at PPDU start
  2192. * @ppdu_end_timestamp: TSF at PPDU end
  2193. * @ba_start_seq: Block Ack sequence number
  2194. * @ba_bitmap: Block Ack bitmap
  2195. * @ppdu_cookie: 16-bit ppdu_cookie
  2196. * @long_retries: long retries
  2197. * @short_retries: short retries
  2198. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2199. * @resp_type: response type
  2200. * @mprot_type: medium protection type
  2201. * @rts_success: rts success
  2202. * @rts_failure: rts failure
  2203. * @usr_idx: user index
  2204. */
  2205. struct cdp_tx_indication_mpdu_info {
  2206. uint32_t ppdu_id;
  2207. uint32_t tx_duration;
  2208. uint16_t frame_type;
  2209. uint16_t frame_ctrl;
  2210. uint16_t qos_ctrl;
  2211. uint8_t tid;
  2212. uint32_t num_msdu;
  2213. uint32_t seq_no;
  2214. uint32_t ltf_size:2,
  2215. he_re:1,
  2216. txbf:4,
  2217. bw:4,
  2218. nss:4,
  2219. mcs:4,
  2220. preamble:4,
  2221. gi:4;
  2222. uint32_t channel;
  2223. uint8_t channel_num;
  2224. uint32_t ack_rssi;
  2225. uint32_t ldpc;
  2226. uint32_t tx_rate;
  2227. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  2228. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  2229. uint64_t ppdu_start_timestamp;
  2230. uint64_t ppdu_end_timestamp;
  2231. uint32_t ba_start_seq;
  2232. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2233. uint16_t ppdu_cookie;
  2234. uint16_t long_retries:4,
  2235. short_retries:4,
  2236. completion_status:8;
  2237. uint16_t resp_type:4,
  2238. mprot_type:3,
  2239. rts_success:1,
  2240. rts_failure:1;
  2241. uint8_t usr_idx;
  2242. };
  2243. /**
  2244. * struct cdp_tx_indication_info - Tx capture information
  2245. * @radiotap_done: Flag to say radiotap already done or not
  2246. * 0 - radiotap not updated
  2247. * 1 - radiotap header updated
  2248. * @mpdu_info: Tx MPDU completion information
  2249. * @mpdu_nbuf: reconstructed mpdu packet
  2250. * @ppdu_desc: tx completion ppdu
  2251. * @osif_vdev: OS IF vdev handle
  2252. */
  2253. struct cdp_tx_indication_info {
  2254. bool radiotap_done;
  2255. struct cdp_tx_indication_mpdu_info mpdu_info;
  2256. qdf_nbuf_t mpdu_nbuf;
  2257. struct cdp_tx_completion_ppdu *ppdu_desc;
  2258. #ifdef QCA_SUPPORT_LITE_MONITOR
  2259. ol_osif_vdev_handle osif_vdev;
  2260. #endif
  2261. };
  2262. /**
  2263. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  2264. * @ppdu_id: ppdu_id
  2265. * @is_sgen_pkt: payload received from wmi or htt path
  2266. * @retries_count: retries count
  2267. * @tx_tsf: 64 bit timestamp
  2268. */
  2269. struct cdp_tx_mgmt_comp_info {
  2270. uint32_t ppdu_id;
  2271. bool is_sgen_pkt;
  2272. uint16_t retries_count;
  2273. uint64_t tx_tsf;
  2274. };
  2275. /**
  2276. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  2277. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2278. * @ppdu_id: PPDU Id
  2279. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  2280. * @vdev_id: VAP Id
  2281. * @bar_num_users: BA response user count, based on completion common TLV
  2282. * @num_users: Number of users
  2283. * @max_users: Number of users from USR_INFO TLV
  2284. * @last_usr_index:
  2285. * @drop_reason: drop reason from flush status
  2286. * @is_flush: is_flush is set based on flush tlv
  2287. * @flow_type: tx flow type from flush status
  2288. * @queue_type: queue type from flush status
  2289. * @num_mpdu: Number of MPDUs in PPDU
  2290. * @num_msdu: Number of MSDUs in PPDU
  2291. * @frame_type: frame SU or MU
  2292. * @htt_frame_type: frame type from htt
  2293. * @frame_ctrl: frame control of 80211 header
  2294. * @channel: Channel informartion
  2295. * @resp_type: response type
  2296. * @mprot_type: medium protection type
  2297. * @rts_success: rts success
  2298. * @rts_failure: rts failure
  2299. * @phy_mode: phy mode
  2300. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  2301. * @tx_duration: PPDU airtime
  2302. * @ppdu_start_timestamp: TSF at PPDU start
  2303. * @ppdu_end_timestamp: TSF at PPDU end
  2304. * @ack_timestamp: TSF at the reception of ACK
  2305. * @delayed_ba: Delayed ba flag
  2306. * @beam_change: beam change bit in ppdu for he-information
  2307. * @bss_color: 6 bit value for full bss color
  2308. * @doppler: value for doppler (will be 0 most of the times)
  2309. * @spatial_reuse: value for spatial reuse used in radiotap HE header
  2310. * @usr_nss_sum: Sum of user nss
  2311. * @usr_ru_tones_sum: Sum of user ru_tones
  2312. * @bar_ppdu_id: BAR ppdu_id
  2313. * @bar_tx_duration: BAR tx duration
  2314. * @bar_ppdu_start_timestamp: BAR start timestamp
  2315. * @bar_ppdu_end_timestamp: BAR end timestamp
  2316. * @tlv_bitmap: tlv_bitmap for the PPDU
  2317. * @sched_cmdid: schedule command id
  2318. * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
  2319. * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
  2320. * @htt_seq_type: Seq type
  2321. * @txmode_type: tx mode type UL/DL
  2322. * @txmode: tx mode
  2323. * @num_ul_users: Number of UL expected users
  2324. * @ch_access_delay: Channel access delay
  2325. * @backoff_ac_valid: Backoff AC valid
  2326. * @backoff_ac: Backoff AC
  2327. * @num_ul_user_resp_valid: Number of UL users response valid
  2328. * @num_ul_user_resp: Number of UL users response
  2329. * @user: per-User stats (array of per-user structures)
  2330. */
  2331. struct cdp_tx_completion_ppdu {
  2332. uint32_t ppdu_id;
  2333. uint32_t ppdu_seq_id;
  2334. uint16_t vdev_id;
  2335. uint16_t bar_num_users;
  2336. uint32_t num_users;
  2337. uint8_t max_users;
  2338. uint8_t last_usr_index;
  2339. uint32_t drop_reason;
  2340. uint32_t is_flush:1,
  2341. flow_type:8,
  2342. queue_type:8;
  2343. uint32_t num_mpdu:9,
  2344. num_msdu:16;
  2345. uint16_t frame_type;
  2346. uint16_t htt_frame_type;
  2347. uint16_t frame_ctrl;
  2348. uint16_t channel;
  2349. uint16_t resp_type:4,
  2350. mprot_type:3,
  2351. rts_success:1,
  2352. rts_failure:1;
  2353. uint16_t phy_mode;
  2354. uint32_t ack_rssi;
  2355. uint32_t tx_duration;
  2356. uint64_t ppdu_start_timestamp;
  2357. uint64_t ppdu_end_timestamp;
  2358. uint64_t ack_timestamp;
  2359. bool delayed_ba;
  2360. uint8_t beam_change;
  2361. uint8_t bss_color;
  2362. uint8_t doppler;
  2363. uint8_t spatial_reuse;
  2364. uint8_t usr_nss_sum;
  2365. uint32_t usr_ru_tones_sum;
  2366. uint32_t bar_ppdu_id;
  2367. uint32_t bar_tx_duration;
  2368. uint64_t bar_ppdu_start_timestamp;
  2369. uint64_t bar_ppdu_end_timestamp;
  2370. uint32_t tlv_bitmap;
  2371. uint16_t sched_cmdid;
  2372. uint16_t phy_ppdu_tx_time_us;
  2373. uint32_t ppdu_bytes;
  2374. uint8_t htt_seq_type;
  2375. uint8_t txmode_type;
  2376. uint8_t txmode;
  2377. uint32_t num_ul_users;
  2378. uint32_t ch_access_delay;
  2379. uint32_t backoff_ac_valid;
  2380. uint32_t backoff_ac;
  2381. uint32_t num_ul_user_resp_valid;
  2382. uint32_t num_ul_user_resp;
  2383. struct cdp_tx_completion_ppdu_user user[];
  2384. };
  2385. /**
  2386. * struct cdp_dev_stats - Network device stats structure
  2387. * @tx_packets: Tx total packets transmitted
  2388. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  2389. * @tx_dropped: Tx dropped is same as tx errors as above
  2390. * @rx_packets: Rx total packets transmitted
  2391. * @rx_errors : Rx errors
  2392. * @rx_dropped: Rx dropped stats
  2393. * @tx_bytes : Tx total bytes transmitted
  2394. * @rx_bytes : Rx total bytes transmitted
  2395. */
  2396. struct cdp_dev_stats {
  2397. uint32_t tx_packets;
  2398. uint32_t tx_errors;
  2399. uint32_t tx_dropped;
  2400. uint32_t rx_packets;
  2401. uint32_t rx_errors;
  2402. uint32_t rx_dropped;
  2403. uint64_t tx_bytes;
  2404. uint64_t rx_bytes;
  2405. };
  2406. /**
  2407. * struct cdp_rate_stats - Tx/Rx Rate statistics
  2408. * @rate_stats_info_valid: set if the stats are valid
  2409. * @bw: Indicates the BW of the upcoming transmission -
  2410. * <enum 2 transmit_bw_20_MHz>
  2411. * <enum 3 transmit_bw_40_MHz>
  2412. * <enum 4 transmit_bw_80_MHz>
  2413. * <enum 5 transmit_bw_160_MHz>
  2414. * @pkt_type: Transmit Packet Type
  2415. * @stbc: When set, STBC transmission rate was used
  2416. * @ldpc: When set, use LDPC transmission rates
  2417. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  2418. * <enum 1 0_4_us_sgi > Legacy short GI
  2419. * <enum 2 1_6_us_sgi > HE related GI
  2420. * <enum 3 3_2_us_sgi > HE
  2421. * @mcs: Transmit MCS Rate
  2422. * @ofdma: Set when the transmission was an OFDMA transmission
  2423. * @tones_in_ru: The number of tones in the RU used.
  2424. * @resvd0: reserved bits
  2425. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  2426. * @peer_id: Peer ID of the flow or MPDU queue
  2427. * @tid: TID of the flow or MPDU queue
  2428. */
  2429. struct cdp_rate_stats {
  2430. uint32_t rate_stats_info_valid:1,
  2431. bw:2,
  2432. pkt_type:4,
  2433. stbc:1,
  2434. ldpc:1,
  2435. sgi:2,
  2436. mcs:4,
  2437. ofdma:1,
  2438. tones_in_ru:12,
  2439. resvd0:4;
  2440. uint32_t tsf;
  2441. uint16_t peer_id;
  2442. uint8_t tid;
  2443. };
  2444. /**
  2445. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  2446. * @ppdu_id: PPDU to which this MSDU belongs
  2447. * @transmit_cnt: Number of times this frame has been transmitted
  2448. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2449. * @resvd0: reserved bit
  2450. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2451. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2452. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  2453. * @extd: Extended structure containing rate statistics
  2454. * @resvd1: reserved bits
  2455. */
  2456. struct cdp_tx_completion_msdu {
  2457. uint32_t ppdu_id;
  2458. uint8_t transmit_cnt;
  2459. uint32_t ack_frame_rssi:8,
  2460. resvd0:1,
  2461. first_msdu:1,
  2462. last_msdu:1,
  2463. msdu_part_of_amsdu:1,
  2464. resvd1:20;
  2465. struct cdp_rate_stats extd;
  2466. };
  2467. /**
  2468. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  2469. * @peer_id: Peer ID
  2470. * @vdev_id: VAP ID
  2471. * @is_ampdu: mpdu aggregate or non-aggregate?
  2472. * @mu_ul_info_valid: MU UL info valid
  2473. * @ofdma_ru_start_index: RU index number(0-73)
  2474. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  2475. * @nss: NSS 1,2, ...8
  2476. * @mcs: MCS index
  2477. * @user_index: user ID in multi-user case
  2478. * @is_bss_peer: is bss peer check
  2479. * @ast_index: ast index in multi-user case
  2480. * @tid: TID number
  2481. * @num_msdu: Number of MSDUs in PPDU
  2482. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2483. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2484. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2485. * @frame_control: frame control field
  2486. * @frame_control_info_valid: frame_control valid
  2487. * @qos_control: qos control field
  2488. * @qos_control_info_valid: qos_control valid
  2489. * @data_sequence_control_info_valid: data_sequence_control_info valid
  2490. * @first_data_seq_ctrl: Sequence control field of first data frame
  2491. * @preamble_type: preamble
  2492. * @ht_flags: HT flags
  2493. * @vht_flags: VHT flags
  2494. * @he_flags: HE flags
  2495. * @mac_addr: Peer MAC Address
  2496. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  2497. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  2498. * @mpdu_fcs_ok_bitmap: MPDU with fcs ok bitmap
  2499. * @mpdu_ok_byte_count:
  2500. * @mpdu_err_byte_count:
  2501. * @retries: number of retries
  2502. * @rx_ratekbps: rx rate in kbps
  2503. * @rix: rate index
  2504. * @mpdu_retries: retries of mpdu in rx
  2505. * @rx_time_us: Rx duration
  2506. */
  2507. struct cdp_rx_stats_ppdu_user {
  2508. uint16_t peer_id;
  2509. uint8_t vdev_id;
  2510. bool is_ampdu;
  2511. uint32_t mu_ul_info_valid:1,
  2512. ofdma_ru_start_index:7,
  2513. ofdma_ru_width:7,
  2514. nss:4,
  2515. mcs:4;
  2516. /* user id */
  2517. uint8_t user_index;
  2518. uint8_t is_bss_peer;
  2519. uint32_t ast_index;
  2520. uint32_t tid;
  2521. uint32_t num_msdu;
  2522. uint16_t tcp_msdu_count;
  2523. uint16_t udp_msdu_count;
  2524. uint16_t other_msdu_count;
  2525. uint16_t frame_control;
  2526. uint8_t frame_control_info_valid;
  2527. uint16_t qos_control;
  2528. uint8_t qos_control_info_valid;
  2529. uint8_t data_sequence_control_info_valid;
  2530. uint16_t first_data_seq_ctrl;
  2531. uint32_t preamble_type;
  2532. uint16_t ht_flags;
  2533. uint16_t vht_flags;
  2534. uint16_t he_flags;
  2535. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2536. uint32_t mpdu_cnt_fcs_ok;
  2537. uint32_t mpdu_cnt_fcs_err;
  2538. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  2539. uint32_t mpdu_ok_byte_count;
  2540. uint32_t mpdu_err_byte_count;
  2541. uint32_t retries;
  2542. uint32_t rx_ratekbps;
  2543. uint32_t rix;
  2544. uint32_t mpdu_retries;
  2545. uint16_t rx_time_us;
  2546. };
  2547. /**
  2548. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  2549. * @ppdu_id: PPDU Id
  2550. * @is_ampdu: mpdu aggregate or non-aggregate?
  2551. * @num_mpdu: Number of MPDUs in PPDU
  2552. * @reserved: Reserved bits for future use
  2553. * @num_msdu: Number of MSDUs in PPDU
  2554. * @num_bytes: Number of bytes
  2555. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2556. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2557. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2558. * @duration: PPDU duration
  2559. * @tid: TID number
  2560. * @peer_id: Peer ID
  2561. * @vdev_id: VAP ID
  2562. * @mac_addr: Peer MAC Address
  2563. * @first_data_seq_ctrl: Sequence control field of first data frame
  2564. * @u: union of rate information representations
  2565. * @rate_info: consolidated rate fields
  2566. * @ltf_size: ltf_size
  2567. * @stbc: When set, STBC rate was used
  2568. * @he_re: he_re (range extension)
  2569. * @bw: Bandwidth
  2570. * <enum 0 bw_20_MHz>
  2571. * <enum 1 bw_40_MHz>
  2572. * <enum 2 bw_80_MHz>
  2573. * <enum 3 bw_160_MHz>
  2574. * @nss: NSS 1,2, ...8
  2575. * @mcs: MCS index
  2576. * @preamble: preamble
  2577. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  2578. * <enum 1 0_4_us_sgi > Legacy short GI
  2579. * <enum 2 1_6_us_sgi > HE related GI
  2580. * <enum 3 3_2_us_sgi > HE
  2581. * @dcm: dcm
  2582. * @ldpc: ldpc
  2583. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  2584. * UL_BSR_TRIG/UNKNOWN
  2585. * @rix: rate index
  2586. * @lsig_a: L-SIG in 802.11 PHY header
  2587. * @rssi: RSSI value (units = dB above noise floor)
  2588. * @timestamp: TSF at the reception of PPDU
  2589. * @length: PPDU length
  2590. * @channel: Channel information
  2591. * @beamformed:
  2592. * @rx_ratekbps:
  2593. * @ppdu_rx_rate:
  2594. * @retries:
  2595. * @rx_byte_count:
  2596. * @rx_ratecode:
  2597. * @fcs_error_mpdus:
  2598. * @frame_ctrl: frame control field
  2599. * @rssi_chain: rssi chain per nss per bw
  2600. * @evm_info:
  2601. * @rx_antenna:
  2602. * @num_users:
  2603. * @nf: noise floor
  2604. * @per_chain_rssi: rssi per antenna
  2605. * @is_mcast_bcast:
  2606. * @cfr_info:
  2607. * @punc_bw: punctured bw
  2608. * @phyrx_abort: rx aborted undecoded frame indication
  2609. * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
  2610. * @l_sig_length: L SIG A length
  2611. * @l_sig_a_parity: L SIG A parity
  2612. * @l_sig_a_pkt_type: L SIG A info pkt type
  2613. * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
  2614. * @vht_crc: Indicate vht crc
  2615. * @group_id:
  2616. * @ht_length: num of bytes in PSDU
  2617. * @ht_smoothing: Indicate ht_smoothing
  2618. * @ht_not_sounding: Indicate ht not sounding
  2619. * @ht_aggregation: Indicate ht aggregation
  2620. * @ht_stbc: Indicate ht stbc
  2621. * @ht_crc: Indicate ht crc
  2622. * @vht_no_txop_ps: Indicate TXOP power save mode
  2623. * @bss_color_id: Indicate BSS color ID
  2624. * @beam_change: Indicates whether spatial mapping is changed
  2625. * @dl_ul_flag: Differentiates between DL and UL transmission
  2626. * @transmit_mcs: Indicates the data MCS
  2627. * @ldpc_extra_sym: LDPC extra symbol
  2628. * @special_reuse: Spatial reuse
  2629. * @ltf_sym: Indictaes HE NSTS
  2630. * @txbf: Indicates whether beamforming is applied
  2631. * @pe_disambiguity: packet extension disambiguity
  2632. * @pre_fec_pad: packet extension a factor
  2633. * @dopplar: Doppler support
  2634. * @txop_duration: Indicates the remaining time in the current TXOP
  2635. * @sig_b_mcs: MCS of HE-SIG-B
  2636. * @sig_b_dcm: DCM of HE-SIG-B
  2637. * @sig_b_sym: Number of symbols of HE-SIG-B
  2638. * @sig_b_comp: Compression mode of HE-SIG-B
  2639. * @he_crc: CRC for HE-SIG contents
  2640. * @usr_nss_sum: Sum of user nss
  2641. * @usr_ru_tones_sum: Sum of user ru_tones
  2642. * @user: per user stats in MU-user case
  2643. */
  2644. struct cdp_rx_indication_ppdu {
  2645. uint32_t ppdu_id;
  2646. uint16_t is_ampdu:1,
  2647. num_mpdu:9,
  2648. reserved:6;
  2649. uint32_t num_msdu;
  2650. uint32_t num_bytes;
  2651. uint16_t udp_msdu_count;
  2652. uint16_t tcp_msdu_count;
  2653. uint16_t other_msdu_count;
  2654. uint16_t duration;
  2655. uint32_t tid:8,
  2656. peer_id:16;
  2657. uint8_t vdev_id;
  2658. uint8_t mac_addr[6];
  2659. uint16_t first_data_seq_ctrl;
  2660. union {
  2661. uint32_t rate_info;
  2662. struct {
  2663. uint32_t ltf_size:2,
  2664. stbc:1,
  2665. he_re:1,
  2666. bw:4,
  2667. nss:4,
  2668. mcs:4,
  2669. preamble:4,
  2670. gi:4,
  2671. dcm:1,
  2672. ldpc:1,
  2673. ppdu_type:5;
  2674. };
  2675. } u;
  2676. uint32_t rix;
  2677. uint32_t lsig_a;
  2678. uint32_t rssi;
  2679. uint64_t timestamp;
  2680. uint32_t length;
  2681. uint8_t channel;
  2682. uint8_t beamformed;
  2683. uint32_t rx_ratekbps;
  2684. uint32_t ppdu_rx_rate;
  2685. uint32_t retries;
  2686. uint32_t rx_byte_count;
  2687. uint16_t rx_ratecode;
  2688. uint8_t fcs_error_mpdus;
  2689. uint16_t frame_ctrl;
  2690. int8_t rssi_chain[SS_COUNT][MAX_BW];
  2691. struct cdp_rx_su_evm_info evm_info;
  2692. uint32_t rx_antenna;
  2693. uint8_t num_users;
  2694. uint32_t nf;
  2695. uint8_t per_chain_rssi[MAX_CHAIN];
  2696. uint8_t is_mcast_bcast;
  2697. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2698. struct cdp_rx_ppdu_cfr_info cfr_info;
  2699. #endif
  2700. uint8_t punc_bw;
  2701. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  2702. bool phyrx_abort;
  2703. uint8_t phyrx_abort_reason;
  2704. uint32_t l_sig_length:12,
  2705. l_sig_a_parity:1,
  2706. l_sig_a_pkt_type:4,
  2707. l_sig_a_implicit_sounding:1,
  2708. vht_crc:8,
  2709. group_id:6;
  2710. uint32_t ht_length:16,
  2711. ht_smoothing:1,
  2712. ht_not_sounding:1,
  2713. ht_aggregation:1,
  2714. ht_stbc:2,
  2715. ht_crc:8,
  2716. vht_no_txop_ps:1;
  2717. uint32_t bss_color_id:6,
  2718. beam_change:1,
  2719. dl_ul_flag:1,
  2720. transmit_mcs:4,
  2721. ldpc_extra_sym:1,
  2722. special_reuse:4,
  2723. ltf_sym:3,
  2724. txbf:1,
  2725. pe_disambiguity:1,
  2726. pre_fec_pad:4,
  2727. dopplar:1;
  2728. uint32_t txop_duration:7,
  2729. sig_b_mcs:3,
  2730. sig_b_dcm:1,
  2731. sig_b_sym:4,
  2732. sig_b_comp:1,
  2733. he_crc:4;
  2734. #endif
  2735. uint8_t usr_nss_sum;
  2736. uint32_t usr_ru_tones_sum;
  2737. struct cdp_rx_stats_ppdu_user user[];
  2738. };
  2739. /**
  2740. * struct cdp_rx_indication_msdu - Rx MSDU info
  2741. * @ppdu_id: PPDU to which the MSDU belongs
  2742. * @msdu_len: Length of MSDU in bytes
  2743. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2744. * @resvd0: reserved bit
  2745. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2746. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2747. * @msdu_part_of_amsdu: Indicates this MSDU was part of an A-MSDU in MPDU
  2748. * @msdu_part_of_ampdu:
  2749. * @resvd1: reserved bit
  2750. * @extd: Extended structure containing rate statistics
  2751. */
  2752. struct cdp_rx_indication_msdu {
  2753. uint32_t ppdu_id;
  2754. uint16_t msdu_len;
  2755. uint32_t ack_frame_rssi:8,
  2756. resvd0:1,
  2757. first_msdu:1,
  2758. last_msdu:1,
  2759. msdu_part_of_amsdu:1,
  2760. msdu_part_of_ampdu:1,
  2761. resvd1:19;
  2762. struct cdp_rate_stats extd;
  2763. };
  2764. /**
  2765. * struct cdp_config_params - Propagate configuration parameters to datapath
  2766. * @tso_enable: Enable/Disable TSO
  2767. * @lro_enable: Enable/Disable LRO
  2768. * @gro_enable: Enable/Disable GRO
  2769. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  2770. * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
  2771. * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
  2772. * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
  2773. * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
  2774. * legacy modes.
  2775. * @napi_enable: Enable/Disable Napi
  2776. * @ipa_enable: Flag indicating if IPA is enabled or not
  2777. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  2778. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  2779. * tx queue
  2780. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  2781. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  2782. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  2783. */
  2784. struct cdp_config_params {
  2785. unsigned int tso_enable:1;
  2786. unsigned int lro_enable:1;
  2787. unsigned int gro_enable:1;
  2788. unsigned int flow_steering_enable:1;
  2789. unsigned int p2p_tcp_udp_checksumoffload:1;
  2790. unsigned int nan_tcp_udp_checksumoffload:1;
  2791. unsigned int tcp_udp_checksumoffload:1;
  2792. unsigned int legacy_mode_checksumoffload_disable:1;
  2793. unsigned int napi_enable:1;
  2794. unsigned int ipa_enable:1;
  2795. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  2796. uint8_t tx_flow_stop_queue_threshold;
  2797. uint8_t tx_flow_start_queue_offset;
  2798. uint32_t tx_comp_loop_pkt_limit;
  2799. uint32_t rx_reap_loop_pkt_limit;
  2800. uint32_t rx_hp_oos_update_limit;
  2801. };
  2802. /**
  2803. * struct cdp_txrx_stats_req - stats request wrapper
  2804. * used to pass request information to cdp layer
  2805. * @stats: type of stats requested
  2806. * @param0: opaque argument 0 to be passed to htt
  2807. * @param1: opaque argument 1 to be passed to htt
  2808. * @param2: opaque argument 2 to be passed to htt
  2809. * @param3: opaque argument 3 to be passed to htt
  2810. * @cookie_val: cookie
  2811. * @mac_id: mac id
  2812. * @peer_addr: peer address
  2813. */
  2814. struct cdp_txrx_stats_req {
  2815. enum cdp_stats stats;
  2816. uint32_t param0;
  2817. uint32_t param1;
  2818. uint32_t param2;
  2819. uint32_t param3;
  2820. uint32_t cookie_val;
  2821. uint8_t mac_id;
  2822. char *peer_addr;
  2823. };
  2824. /**
  2825. * struct cdp_monitor_filter - monitor filter info
  2826. * @mode: set filter mode
  2827. * @fp_mgmt: set Filter Pass MGMT Configuration
  2828. * @fp_ctrl: set Filter Pass CTRL Configuration
  2829. * @fp_data: set Filter Pass DATA Configuration
  2830. * @mo_mgmt: set Monitor Other MGMT Configuration
  2831. * @mo_ctrl: set Monitor Other CTRL Configuration
  2832. * @mo_data: set Monitor other DATA Configuration
  2833. *
  2834. */
  2835. struct cdp_monitor_filter {
  2836. uint16_t mode;
  2837. uint16_t fp_mgmt;
  2838. uint16_t fp_ctrl;
  2839. uint16_t fp_data;
  2840. uint16_t mo_mgmt;
  2841. uint16_t mo_ctrl;
  2842. uint16_t mo_data;
  2843. };
  2844. /**
  2845. * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
  2846. * @cfg_dp_enable_data_stall: context passed to be used by consumer
  2847. * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
  2848. * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
  2849. * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
  2850. * @cfg_dp_disable_legacy_mode_csum_offload: Disable checksum offload for
  2851. * legacy modes
  2852. * @cfg_dp_tso_enable: get TSO enable config
  2853. * @cfg_dp_lro_enable: get LRO enable config
  2854. * @cfg_dp_gro_enable: get GRO enable config
  2855. * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
  2856. * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
  2857. * @cfg_dp_sg_enable:
  2858. * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
  2859. * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
  2860. * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
  2861. * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
  2862. * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
  2863. * @cfg_dp_enable_flow_steering: get flow steerint enable config
  2864. * @cfg_dp_reorder_offload_supported: get reorder offload support config
  2865. * @cfg_dp_ce_classify_enable: get CE classify enable config
  2866. * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
  2867. * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
  2868. * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
  2869. * @cfg_dp_local_pkt_capture: get local packet capture config
  2870. */
  2871. enum cdp_dp_cfg {
  2872. cfg_dp_enable_data_stall,
  2873. cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
  2874. cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
  2875. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  2876. cfg_dp_disable_legacy_mode_csum_offload,
  2877. cfg_dp_tso_enable,
  2878. cfg_dp_lro_enable,
  2879. cfg_dp_gro_enable,
  2880. cfg_dp_tc_based_dyn_gro_enable,
  2881. cfg_dp_tc_ingress_prio,
  2882. cfg_dp_sg_enable,
  2883. cfg_dp_tx_flow_start_queue_offset,
  2884. cfg_dp_tx_flow_stop_queue_threshold,
  2885. cfg_dp_ipa_uc_tx_buf_size,
  2886. cfg_dp_ipa_uc_tx_partition_base,
  2887. cfg_dp_ipa_uc_rx_ind_ring_count,
  2888. cfg_dp_enable_flow_steering,
  2889. cfg_dp_reorder_offload_supported,
  2890. cfg_dp_ce_classify_enable,
  2891. cfg_dp_disable_intra_bss_fwd,
  2892. cfg_dp_pktlog_buffer_size,
  2893. cfg_dp_wow_check_rx_pending,
  2894. cfg_dp_local_pkt_capture,
  2895. };
  2896. /**
  2897. * struct cdp_peer_cookie - cookie used when creating peer
  2898. * @ctx: context passed to be used by consumer
  2899. * @mac_addr: MAC address of peer
  2900. * @peer_id: peer id
  2901. * @pdev_id: pdev_id
  2902. * @cookie: cookie to be used by consumer
  2903. */
  2904. struct cdp_peer_cookie {
  2905. struct cdp_stats_cookie *ctx;
  2906. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2907. uint8_t peer_id;
  2908. uint8_t pdev_id;
  2909. uint8_t cookie;
  2910. };
  2911. /**
  2912. * enum cdp_fisa_stats_id - ID to query FISA stats
  2913. * @CDP_FISA_STATS_ID_ERR_STATS: FISA error stats
  2914. * @CDP_FISA_STATS_ID_DUMP_HW_FST: HW FST dump
  2915. * @CDP_FISA_STATS_ID_DUMP_SW_FST: SW FST dump
  2916. */
  2917. enum cdp_fisa_stats_id {
  2918. CDP_FISA_STATS_ID_ERR_STATS,
  2919. CDP_FISA_STATS_ID_DUMP_HW_FST,
  2920. CDP_FISA_STATS_ID_DUMP_SW_FST,
  2921. };
  2922. #ifdef WLAN_SUPPORT_RX_FISA
  2923. /**
  2924. * enum cdp_fisa_config_id - FISA config ID
  2925. * @CDP_FISA_HTT_RX_FISA_CFG: FISA config HTT message
  2926. * @CDP_FISA_HTT_RX_FSE_OP_CFG: FSE operation HTT message
  2927. * @CDP_FISA_HTT_RX_FSE_SETUP_CFG: FSE setup HTT message
  2928. */
  2929. enum cdp_fisa_config_id {
  2930. CDP_FISA_HTT_RX_FISA_CFG,
  2931. CDP_FISA_HTT_RX_FSE_OP_CFG,
  2932. CDP_FISA_HTT_RX_FSE_SETUP_CFG,
  2933. };
  2934. /**
  2935. * union cdp_fisa_config - FISA HTT message data
  2936. * @fisa_config: FISA config HTT msg data
  2937. * @fse_op_cmd: FSE operation HTT msg data
  2938. * @fse_setup_info: FSE setup HTT msg data
  2939. */
  2940. union cdp_fisa_config {
  2941. struct dp_htt_rx_fisa_cfg *fisa_config;
  2942. struct dp_htt_rx_flow_fst_operation *fse_op_cmd;
  2943. struct dp_htt_rx_flow_fst_setup *fse_setup_info;
  2944. };
  2945. struct cdp_flow_stats {
  2946. uint32_t aggr_count;
  2947. uint32_t curr_aggr_count;
  2948. uint32_t flush_count;
  2949. uint32_t bytes_aggregated;
  2950. };
  2951. #else
  2952. /**
  2953. * struct cdp_flow_stats - Per-Flow (5-tuple) statistics
  2954. * @msdu_count: number of rx msdus matching this flow
  2955. * @mon_msdu_count: number of msdus matching this flow in mon path
  2956. *
  2957. * HW also includes msdu_byte_count and timestamp, which
  2958. * are not currently tracked in SW.
  2959. */
  2960. struct cdp_flow_stats {
  2961. uint32_t msdu_count;
  2962. uint32_t mon_msdu_count;
  2963. };
  2964. #endif
  2965. /**
  2966. * enum cdp_flow_fst_operation - RX FST operations allowed
  2967. * @CDP_FLOW_FST_ENTRY_ADD: Add entry
  2968. * @CDP_FLOW_FST_ENTRY_DEL: Delete entry
  2969. * @CDP_FLOW_FST_RX_BYPASS_ENABLE: RX bypass enable
  2970. * @CDP_FLOW_FST_RX_BYPASS_DISABLE: RX bypass disable
  2971. */
  2972. enum cdp_flow_fst_operation {
  2973. CDP_FLOW_FST_ENTRY_ADD,
  2974. CDP_FLOW_FST_ENTRY_DEL,
  2975. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  2976. CDP_FLOW_FST_RX_BYPASS_DISABLE
  2977. };
  2978. /**
  2979. * enum cdp_flow_protocol_type - RX FST supported protocol types,
  2980. * mapped to HW spec
  2981. * @CDP_FLOW_PROTOCOL_TYPE_TCP: TCP
  2982. * @CDP_FLOW_PROTOCOL_TYPE_UDP: UDP
  2983. */
  2984. enum cdp_flow_protocol_type {
  2985. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  2986. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  2987. };
  2988. /**
  2989. * struct cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  2990. * @tuple_populated:
  2991. * @is_exception: Flows which are added to flow table but not aggregated.
  2992. * @bypass_fisa: Flow which are not added to flow table.
  2993. * @dest_ip_127_96: destination IP address bit fields 96-127
  2994. * @dest_ip_95_64: destination IP address bit fields 64-95
  2995. * @dest_ip_63_32: destination IP address bit fields 32-63
  2996. * @dest_ip_31_0: destination IP address bit fields 0-31
  2997. * @src_ip_127_96: source IP address bit fields 96-127
  2998. * @src_ip_95_64: source IP address bit fields 64-95
  2999. * @src_ip_63_32: source IP address bit fields 32-63
  3000. * @src_ip_31_0: source IP address bit fields 0-31
  3001. * @dest_port: destination port of flow
  3002. * @src_port: source port of flow
  3003. * @l4_protocol: protocol type in flow (TCP/UDP)
  3004. */
  3005. struct cdp_rx_flow_tuple_info {
  3006. #ifdef WLAN_SUPPORT_RX_FISA
  3007. uint8_t tuple_populated;
  3008. uint8_t is_exception;
  3009. bool bypass_fisa;
  3010. #endif
  3011. uint32_t dest_ip_127_96;
  3012. uint32_t dest_ip_95_64;
  3013. uint32_t dest_ip_63_32;
  3014. uint32_t dest_ip_31_0;
  3015. uint32_t src_ip_127_96;
  3016. uint32_t src_ip_95_64;
  3017. uint32_t src_ip_63_32;
  3018. uint32_t src_ip_31_0;
  3019. uint16_t dest_port;
  3020. uint16_t src_port;
  3021. uint16_t l4_protocol;
  3022. };
  3023. /**
  3024. * struct cdp_rx_flow_info - RX flow info used for addition/deletion
  3025. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  3026. * @op_code: add/delete/enable/disable operation requested
  3027. * @flow_tuple_info: structure containing tuple info
  3028. * @fse_metadata: metadata to be set in RX flow
  3029. * @use_ppe_ds: use DS mode
  3030. * @priority_vld: is priority valid
  3031. * @service_code: service code for DS
  3032. */
  3033. struct cdp_rx_flow_info {
  3034. bool is_addr_ipv4;
  3035. enum cdp_flow_fst_operation op_code;
  3036. struct cdp_rx_flow_tuple_info flow_tuple_info;
  3037. uint16_t fse_metadata;
  3038. uint8_t use_ppe_ds;
  3039. uint8_t priority_vld;
  3040. uint16_t service_code;
  3041. };
  3042. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  3043. /**
  3044. * struct cdp_scan_spcl_vap_stats - Special vap statistics info
  3045. * @rx_ok_pkts: rx fcs ok pkts count
  3046. * @rx_ok_bytes: rx fcs ok bytes count
  3047. * @rx_err_pkts: rx fcs err pkts count
  3048. * @rx_err_bytes: rx fcs err bytes count
  3049. * @rx_mgmt_pkts: rx mgmt pkts count
  3050. * @rx_ctrl_pkts: rx ctrl pkts count
  3051. * @rx_data_pkts: rx data pkts count
  3052. */
  3053. struct cdp_scan_spcl_vap_stats {
  3054. uint64_t rx_ok_pkts;
  3055. uint64_t rx_ok_bytes;
  3056. uint64_t rx_err_pkts;
  3057. uint64_t rx_err_bytes;
  3058. uint64_t rx_mgmt_pkts;
  3059. uint64_t rx_ctrl_pkts;
  3060. uint64_t rx_data_pkts;
  3061. };
  3062. #endif
  3063. /**
  3064. * struct cdp_soc_attach_params
  3065. *
  3066. * @hif_handle: Opaque HIF handle
  3067. * @htc_handle: Opaque HTC handle
  3068. * @qdf_osdev: QDF device
  3069. * @ol_ops: Offload Operations
  3070. * @device_id: Device ID
  3071. * @ml_context: DP ML object context
  3072. * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
  3073. * @mlo_enabled: MLO enable bit
  3074. */
  3075. struct cdp_soc_attach_params {
  3076. struct hif_opaque_softc *hif_handle;
  3077. HTC_HANDLE htc_handle;
  3078. qdf_device_t qdf_osdev;
  3079. struct ol_if_ops *ol_ops;
  3080. uint16_t device_id;
  3081. struct cdp_mlo_ctxt *ml_context;
  3082. uint8_t mlo_chip_id;
  3083. uint8_t mlo_enabled;
  3084. };
  3085. /**
  3086. * struct cdp_pdev_attach_params - params for pdev attach
  3087. *
  3088. * @htc_handle: HTC handle for host-target interface
  3089. * @qdf_osdev: QDF OS device
  3090. * @pdev_id: PDEV ID
  3091. * @mlo_link_id: ML link id
  3092. */
  3093. struct cdp_pdev_attach_params {
  3094. HTC_HANDLE htc_handle;
  3095. qdf_device_t qdf_osdev;
  3096. uint8_t pdev_id;
  3097. uint32_t mlo_link_id;
  3098. };
  3099. /*
  3100. * cdp_txrx_peer_params_update
  3101. *
  3102. * @vdev_id: VDEV ID
  3103. * @peer_mac: Peer mac address
  3104. * @chip_id: CHIP ID
  3105. * @pdev_id: PDEV ID
  3106. */
  3107. struct cdp_txrx_peer_params_update {
  3108. uint8_t vdev_id;
  3109. uint8_t *peer_mac;
  3110. uint8_t chip_id;
  3111. uint8_t pdev_id;
  3112. };
  3113. /**
  3114. * enum cdp_umac_reset_state - umac reset in progress state
  3115. * @CDP_UMAC_RESET_NOT_IN_PROGRESS: Umac reset is not in progress
  3116. * @CDP_UMAC_RESET_IN_PROGRESS: Umac reset is in progress
  3117. * @CDP_UMAC_RESET_IN_PROGRESS_DURING_BUFFER_WINDOW: Umac reset was in progress
  3118. * during this buffer window.
  3119. * @CDP_UMAC_RESET_INVALID_STATE: Umac reset invalid state
  3120. */
  3121. enum cdp_umac_reset_state {
  3122. CDP_UMAC_RESET_NOT_IN_PROGRESS,
  3123. CDP_UMAC_RESET_IN_PROGRESS,
  3124. CDP_UMAC_RESET_IN_PROGRESS_DURING_BUFFER_WINDOW,
  3125. CDP_UMAC_RESET_INVALID_STATE
  3126. };
  3127. #ifdef WLAN_FEATURE_TX_LATENCY_STATS
  3128. /* the maximum distribution level of tx latency stats */
  3129. #define CDP_TX_LATENCY_DISTR_LV_MAX 4
  3130. /**
  3131. * enum cdp_tx_latency_type - transmit latency types
  3132. * @CDP_TX_LATENCY_TYPE_DRIVER: Per MSDU latency
  3133. * from: A MSDU is presented to the driver
  3134. * to: the MSDU is queued into TCL SRNG
  3135. * @CDP_TX_LATENCY_TYPE_RING_BUF: Per MSDU latency
  3136. * from: the MSDU is queued into TCL SRNG
  3137. * to: the MSDU is released by the driver
  3138. * @CDP_TX_LATENCY_TYPE_HW: Per MSDU latency
  3139. * from: the MSDU is presented to the hardware
  3140. * to: the MSDU is released by the hardware
  3141. * @CDP_TX_LATENCY_TYPE_CCA: Per PPDU latency
  3142. * The time spent on Clear Channel Assessment, the maximum value is 50000(us)
  3143. * from: A PPDU is presented to the hardware LMAC
  3144. * to: over-the-air transmission is started for the PPDU
  3145. * @CDP_TX_LATENCY_TYPE_MAX: maximum number of types
  3146. */
  3147. enum cdp_tx_latency_type {
  3148. CDP_TX_LATENCY_TYPE_DRIVER,
  3149. CDP_TX_LATENCY_TYPE_RING_BUF,
  3150. CDP_TX_LATENCY_TYPE_HW,
  3151. CDP_TX_LATENCY_TYPE_CCA,
  3152. /* keep last */
  3153. CDP_TX_LATENCY_TYPE_MAX,
  3154. };
  3155. /**
  3156. * struct cdp_tx_latency_config - configuration for per-link transmit latency
  3157. * statistics
  3158. * @enable: enable/disable the feature
  3159. * @report: enable/disable async report
  3160. * @period: statistical period(in ms)
  3161. * @granularity: granularity(in microseconds) of the distribution for the types
  3162. */
  3163. struct cdp_tx_latency_config {
  3164. bool enable;
  3165. bool report;
  3166. uint32_t period;
  3167. uint32_t granularity[CDP_TX_LATENCY_TYPE_MAX];
  3168. };
  3169. /**
  3170. * struct cdp_tx_latency_stats - per-type transmit latency statistics
  3171. * @average: average of the latency(in us) for the type within a cycle
  3172. * @granularity: granularity(in us) of the distribution for the type
  3173. * @distribution: latency distribution for the type
  3174. */
  3175. struct cdp_tx_latency_stats {
  3176. uint32_t average;
  3177. uint32_t granularity;
  3178. uint32_t distribution[CDP_TX_LATENCY_DISTR_LV_MAX];
  3179. };
  3180. /**
  3181. * struct cdp_tx_latency - per-link transmit latency statistics
  3182. * @node: list node for membership in the stats list
  3183. * @mac_remote: link mac address of remote peer
  3184. * @stats: transmit latency statistics for types
  3185. */
  3186. struct cdp_tx_latency {
  3187. qdf_list_node_t node;
  3188. struct qdf_mac_addr mac_remote;
  3189. struct cdp_tx_latency_stats stats[CDP_TX_LATENCY_TYPE_MAX];
  3190. };
  3191. /**
  3192. * typedef cdp_tx_latency_cb() - callback for transmit latency
  3193. * @vdev_id: vdev id
  3194. * @stats_list: list of per-link transmit latency statistics
  3195. */
  3196. typedef QDF_STATUS(*cdp_tx_latency_cb)(uint8_t vdev_id,
  3197. qdf_list_t *stats_list);
  3198. #endif
  3199. #endif