cdp_txrx_cmn_struct.h 95 KB

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