cdp_txrx_cmn_struct.h 98 KB

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