cdp_txrx_cmn_struct.h 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file cdp_txrx_cmn_struct.h
  20. * @brief Define the host data path converged API functions
  21. * called by the host control SW and the OS interface module
  22. */
  23. #ifndef _CDP_TXRX_CMN_STRUCT_H_
  24. #define _CDP_TXRX_CMN_STRUCT_H_
  25. /**
  26. * For WIN legacy header compilation
  27. * Temporary add dummy definitions
  28. * should be removed properly WIN legacy code handle
  29. */
  30. #include "htc_api.h"
  31. #include "qdf_types.h"
  32. #include "qdf_nbuf.h"
  33. #include "qdf_atomic.h"
  34. #ifdef DP_MOB_DEFS
  35. #include <cdp_txrx_mob_def.h>
  36. #endif
  37. #include <cdp_txrx_handle.h>
  38. #include <cdp_txrx_stats_struct.h>
  39. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  40. #include "cdp_txrx_extd_struct.h"
  41. #endif
  42. #ifdef WLAN_MAX_CLIENTS_ALLOWED
  43. #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
  44. #endif
  45. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  46. /*
  47. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  48. * Clients will be assigned max 32 IDs.
  49. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  50. */
  51. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  52. #endif
  53. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  54. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  55. #define CDP_RSSI_CHAIN_LEN 8
  56. #define OL_TXRX_INVALID_PDEV_ID 0xff
  57. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  58. #define CDP_INVALID_VDEV_ID 0xff
  59. /* Options for Dump Statistics */
  60. #define CDP_HDD_STATS 0
  61. #define CDP_TXRX_PATH_STATS 1
  62. #define CDP_TXRX_HIST_STATS 2
  63. #define CDP_TXRX_TSO_STATS 3
  64. #define CDP_HDD_NETIF_OPER_HISTORY 4
  65. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  66. #define CDP_TXRX_DESC_STATS 6
  67. #define CDP_HIF_STATS 7
  68. #define CDP_LRO_STATS 8
  69. #define CDP_NAPI_STATS 9
  70. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  71. #define CDP_RX_RING_STATS 11
  72. #define CDP_DP_NAPI_STATS 12
  73. #define CDP_DP_RX_THREAD_STATS 13
  74. #define CDP_SCHEDULER_STATS 21
  75. #define CDP_TX_QUEUE_STATS 22
  76. #define CDP_BUNDLE_STATS 23
  77. #define CDP_CREDIT_STATS 24
  78. #define CDP_DISCONNECT_STATS 25
  79. #define CDP_DP_RX_FISA_STATS 26
  80. #define CDP_DP_SWLM_STATS 27
  81. #define WME_AC_TO_TID(_ac) ( \
  82. ((_ac) == WME_AC_VO) ? 6 : \
  83. ((_ac) == WME_AC_VI) ? 5 : \
  84. ((_ac) == WME_AC_BK) ? 1 : \
  85. 0)
  86. #define TID_TO_WME_AC(_tid) ( \
  87. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  88. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  89. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  90. WME_AC_VO)
  91. #define CDP_MU_MAX_USERS 37
  92. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  93. #define CDP_INVALID_PEER 0xffff
  94. #define CDP_INVALID_TID 31
  95. #define CDP_INVALID_TX_ENCAP_TYPE 6
  96. #define CDP_INVALID_SEC_TYPE 12
  97. #define CDP_DATA_TID_MAX 8
  98. #define CDP_DATA_NON_QOS_TID 16
  99. #define CDP_NUM_SA_BW 4
  100. #define CDP_PERCENT_MACRO 100
  101. #define CDP_NUM_KB_IN_MB 1000
  102. /*
  103. * advance rx monitor filter
  104. * */
  105. #define MON_FILTER_PASS 0x0001
  106. #define MON_FILTER_OTHER 0x0002
  107. #define MON_FILTER_ALL 0x0003
  108. #define FILTER_MGMT_ALL 0xFFFF
  109. #define FILTER_MGMT_ASSOC_REQ 0x0001
  110. #define FILTER_MGMT_ASSOC_RES 0x0002
  111. #define FILTER_MGMT_REASSOC_REQ 0x0004
  112. #define FILTER_MGMT_REASSOC_RES 0x0008
  113. #define FILTER_MGMT_PROBE_REQ 0x0010
  114. #define FILTER_MGMT_PROBE_RES 0x0020
  115. #define FILTER_MGMT_TIM_ADVT 0x0040
  116. #define FILTER_MGMT_RESERVED_7 0x0080
  117. #define FILTER_MGMT_BEACON 0x0100
  118. #define FILTER_MGMT_ATIM 0x0200
  119. #define FILTER_MGMT_DISASSOC 0x0400
  120. #define FILTER_MGMT_AUTH 0x0800
  121. #define FILTER_MGMT_DEAUTH 0x1000
  122. #define FILTER_MGMT_ACTION 0x2000
  123. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  124. #define FILTER_MGMT_RESERVED_15 0x8000
  125. #define FILTER_CTRL_ALL 0xFFFF
  126. #define FILTER_CTRL_RESERVED_1 0x0001
  127. #define FILTER_CTRL_RESERVED_2 0x0002
  128. #define FILTER_CTRL_TRIGGER 0x0004
  129. #define FILTER_CTRL_RESERVED_4 0x0008
  130. #define FILTER_CTRL_BF_REP_POLL 0x0010
  131. #define FILTER_CTRL_VHT_NDP 0x0020
  132. #define FILTER_CTRL_FRAME_EXT 0x0040
  133. #define FILTER_CTRL_CTRLWRAP 0x0080
  134. #define FILTER_CTRL_BA_REQ 0x0100
  135. #define FILTER_CTRL_BA 0x0200
  136. #define FILTER_CTRL_PSPOLL 0x0400
  137. #define FILTER_CTRL_RTS 0x0800
  138. #define FILTER_CTRL_CTS 0x1000
  139. #define FILTER_CTRL_ACK 0x2000
  140. #define FILTER_CTRL_CFEND 0x4000
  141. #define FILTER_CTRL_CFEND_CFACK 0x8000
  142. #define FILTER_DATA_ALL 0xFFFF
  143. #define FILTER_DATA_MCAST 0x4000
  144. #define FILTER_DATA_UCAST 0x8000
  145. #define FILTER_DATA_DATA 0x0001
  146. #define FILTER_DATA_NULL 0x0008
  147. /*
  148. * Multiply rate by 2 to avoid float point
  149. * and get rate in units of 500kbps
  150. */
  151. #define CDP_11B_RATE_0MCS (11 * 2)
  152. #define CDP_11B_RATE_1MCS (5.5 * 2)
  153. #define CDP_11B_RATE_2MCS (2 * 2)
  154. #define CDP_11B_RATE_3MCS (1 * 2)
  155. #define CDP_11B_RATE_4MCS (11 * 2)
  156. #define CDP_11B_RATE_5MCS (5.5 * 2)
  157. #define CDP_11B_RATE_6MCS (2 * 2)
  158. #define CDP_11A_RATE_0MCS (48 * 2)
  159. #define CDP_11A_RATE_1MCS (24 * 2)
  160. #define CDP_11A_RATE_2MCS (12 * 2)
  161. #define CDP_11A_RATE_3MCS (6 * 2)
  162. #define CDP_11A_RATE_4MCS (54 * 2)
  163. #define CDP_11A_RATE_5MCS (36 * 2)
  164. #define CDP_11A_RATE_6MCS (18 * 2)
  165. #define CDP_11A_RATE_7MCS (9 * 2)
  166. #define CDP_LEGACY_MCS0 0
  167. #define CDP_LEGACY_MCS1 1
  168. #define CDP_LEGACY_MCS2 2
  169. #define CDP_LEGACY_MCS3 3
  170. #define CDP_LEGACY_MCS4 4
  171. #define CDP_LEGACY_MCS5 5
  172. #define CDP_LEGACY_MCS6 6
  173. #define CDP_LEGACY_MCS7 7
  174. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  175. struct cdp_stats_cookie;
  176. /*
  177. * DP configuration parameters
  178. */
  179. enum cdp_cfg_param_type {
  180. CDP_CFG_MAX_PEER_ID,
  181. CDP_CFG_CCE_DISABLE,
  182. CDP_CFG_NUM_PARAMS
  183. };
  184. /*
  185. * PPDU TYPE from FW -
  186. * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
  187. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
  188. * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
  189. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
  190. * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
  191. * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
  192. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
  193. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
  194. * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
  195. * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN
  196. */
  197. enum CDP_PPDU_STATS_PPDU_TYPE {
  198. CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
  199. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
  200. CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
  201. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
  202. CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
  203. CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
  204. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
  205. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
  206. CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
  207. CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  208. };
  209. /*
  210. * htt_dbg_stats_type -
  211. * bit positions for each stats type within a stats type bitmask
  212. * The bitmask contains 24 bits.
  213. */
  214. enum htt_cmn_dbg_stats_type {
  215. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  216. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  217. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  218. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  219. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  220. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  221. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  222. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  223. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  224. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  225. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  226. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  227. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  228. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  229. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  230. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  231. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  232. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  233. /* bits 18-23 currently reserved */
  234. /* keep this last */
  235. HTT_DBG_CMN_NUM_STATS,
  236. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  237. };
  238. /*
  239. * cdp_host_txrx_stats: Different types of host stats
  240. * @TXRX_HOST_STATS_INVALID: Invalid option
  241. * @TXRX_RX_RATE_STATS: Rx rate info
  242. * @TXRX_TX_RATE_STATS: Tx rate info
  243. * @TXRX_TX_HOST_STATS: Print Tx stats
  244. * @TXRX_RX_HOST_STATS: Print host Rx stats
  245. * @TXRX_CLEAR_STATS: clear all host stats
  246. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  247. * @TXRX_RX_MON_STATS: Print monitor mode stats
  248. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  249. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  250. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  251. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  252. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  253. * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
  254. */
  255. enum cdp_host_txrx_stats {
  256. TXRX_HOST_STATS_INVALID = -1,
  257. TXRX_CLEAR_STATS = 0,
  258. TXRX_RX_RATE_STATS = 1,
  259. TXRX_TX_RATE_STATS = 2,
  260. TXRX_TX_HOST_STATS = 3,
  261. TXRX_RX_HOST_STATS = 4,
  262. TXRX_AST_STATS = 5,
  263. TXRX_SRNG_PTR_STATS = 6,
  264. TXRX_RX_MON_STATS = 7,
  265. TXRX_REO_QUEUE_STATS = 8,
  266. TXRX_SOC_CFG_PARAMS = 9,
  267. TXRX_PDEV_CFG_PARAMS = 10,
  268. TXRX_NAPI_STATS = 11,
  269. TXRX_SOC_INTERRUPT_STATS = 12,
  270. TXRX_SOC_FSE_STATS = 13,
  271. TXRX_HAL_REG_WRITE_STATS = 14,
  272. TXRX_HOST_STATS_MAX,
  273. };
  274. /*
  275. * cdp_ppdu_ftype: PPDU Frame Type
  276. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  277. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  278. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  279. */
  280. enum cdp_ppdu_ftype {
  281. CDP_PPDU_FTYPE_CTRL,
  282. CDP_PPDU_FTYPE_DATA,
  283. CDP_PPDU_FTYPE_BAR,
  284. CDP_PPDU_FTYPE_MAX
  285. };
  286. /**
  287. * @brief General specification of the tx frame contents
  288. *
  289. * @details
  290. * for efficiency, the HTT packet type values correspond
  291. * to the bit positions of the WAL packet type values, so the
  292. * translation is a simple shift operation.
  293. */
  294. enum htt_cmn_pkt_type {
  295. htt_cmn_pkt_type_raw = 0,
  296. htt_cmn_pkt_type_native_wifi = 1,
  297. htt_cmn_pkt_type_ethernet = 2,
  298. htt_cmn_pkt_type_mgmt = 3,
  299. htt_cmn_pkt_type_eth2 = 4,
  300. /* keep this last */
  301. htt_cmn_pkt_num_types
  302. };
  303. /**
  304. * @General description of HTT received packets status
  305. * It is similar to htt_rx_status enum
  306. * but is added as a cdp enum can be freely used in OL_IF layer
  307. */
  308. enum htt_cmn_rx_status {
  309. htt_cmn_rx_status_unknown = 0x0,
  310. htt_cmn_rx_status_ok,
  311. htt_cmn_rx_status_err_fcs,
  312. htt_cmn_rx_status_err_dup,
  313. htt_cmn_rx_status_err_replay,
  314. htt_cmn_rx_status_inv_peer,
  315. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  316. htt_cmn_rx_status_tkip_mic_err = 0x09,
  317. htt_cmn_rx_status_decrypt_err = 0x0A,
  318. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  319. htt_cmn_rx_status_err_misc = 0xFF
  320. };
  321. enum cdp_host_reo_dest_ring {
  322. cdp_host_reo_dest_ring_unknown = 0,
  323. cdp_host_reo_dest_ring_1 = 1,
  324. cdp_host_reo_dest_ring_2 = 2,
  325. cdp_host_reo_dest_ring_3 = 3,
  326. cdp_host_reo_dest_ring_4 = 4,
  327. };
  328. enum htt_cmn_t2h_en_stats_type {
  329. /* keep this alwyas first */
  330. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  331. /** ppdu_common_stats is the payload */
  332. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  333. /** ppdu_sant_stats is the payload */
  334. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  335. /** ppdu_common_stats_v2 is the payload */
  336. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  337. /* Keep this last */
  338. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  339. };
  340. enum htt_cmn_t2h_en_stats_status {
  341. /* Keep this first always */
  342. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  343. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  344. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  345. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  346. /* keep this always last */
  347. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  348. };
  349. /**
  350. * struct ol_txrx_peer_state - Peer state information
  351. */
  352. enum ol_txrx_peer_state {
  353. OL_TXRX_PEER_STATE_INVALID,
  354. OL_TXRX_PEER_STATE_DISC, /* initial state */
  355. OL_TXRX_PEER_STATE_CONN, /* authentication in progress */
  356. OL_TXRX_PEER_STATE_AUTH, /* authentication successful */
  357. };
  358. /**
  359. * struct ol_txrx_ast_type - AST entry type information
  360. */
  361. enum cdp_txrx_ast_entry_type {
  362. CDP_TXRX_AST_TYPE_NONE, /* static ast entry for connected peer */
  363. CDP_TXRX_AST_TYPE_STATIC, /* static ast entry for connected peer */
  364. CDP_TXRX_AST_TYPE_SELF, /* static ast entry for self peer (STA mode) */
  365. CDP_TXRX_AST_TYPE_WDS, /* WDS peer ast entry type*/
  366. CDP_TXRX_AST_TYPE_WDS_HM, /* HM WDS entry */
  367. CDP_TXRX_AST_TYPE_STA_BSS, /* BSS entry(STA mode) */
  368. CDP_TXRX_AST_TYPE_DA, /* AST entry based on Destination address */
  369. CDP_TXRX_AST_TYPE_WDS_HM_SEC, /* HM WDS entry for secondary radio */
  370. CDP_TXRX_AST_TYPE_MAX
  371. };
  372. /*
  373. * cdp_ast_free_status: status passed to callback function before freeing ast
  374. * @CDP_TXRX_AST_DELETED - AST is deleted from FW and delete response received
  375. * @CDP_TXRX_AST_DELETE_IN_PROGRESS - AST delete command sent to FW and host
  376. * is waiting for FW response
  377. */
  378. enum cdp_ast_free_status {
  379. CDP_TXRX_AST_DELETED,
  380. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  381. };
  382. /**
  383. * txrx_ast_free_cb - callback registered for ast free
  384. * @ctrl_soc: control path soc context
  385. * @cdp_soc: DP soc context
  386. * @cookie: cookie
  387. * @cdp_ast_free_status: ast free status
  388. */
  389. typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
  390. struct cdp_soc *cdp_soc,
  391. void *cookie,
  392. enum cdp_ast_free_status);
  393. /**
  394. * struct cdp_ast_entry_info - AST entry information
  395. * @peer_mac_addr: mac address of peer on which AST entry is added
  396. * @type: ast entry type
  397. * @vdev_id: vdev_id
  398. * @pdev_id: pdev_id
  399. * @peer_id: peer_id
  400. *
  401. * This structure holds the ast entry information
  402. *
  403. */
  404. struct cdp_ast_entry_info {
  405. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  406. enum cdp_txrx_ast_entry_type type;
  407. uint8_t vdev_id;
  408. uint8_t pdev_id;
  409. uint16_t peer_id;
  410. };
  411. #define MIC_SEQ_CTR_SIZE 6
  412. enum cdp_rx_frame_type {
  413. cdp_rx_frame_type_802_11,
  414. cdp_rx_frame_type_802_3,
  415. };
  416. /**
  417. * struct cdp_rx_mic_err_info - rx mic error information
  418. * @frame_type: frame type - 0 - 802.11 frame
  419. * - 1 - 802.3 frame
  420. * @data: 802.11 frame
  421. * @ta_mac_addr: transmitter mac address
  422. * @da_mac_addr: destination mac address
  423. * @tsc: sequence number
  424. * @key_id: Key ID
  425. * @multicast: flag for multicast
  426. * @vdev_id: vdev ID
  427. *
  428. * This structure holds rx mic error information
  429. *
  430. */
  431. struct cdp_rx_mic_err_info {
  432. uint8_t frame_type;
  433. uint8_t *data;
  434. struct qdf_mac_addr ta_mac_addr;
  435. struct qdf_mac_addr da_mac_addr;
  436. uint8_t tsc[MIC_SEQ_CTR_SIZE];
  437. uint8_t key_id;
  438. bool multicast;
  439. uint16_t vdev_id;
  440. };
  441. #ifdef WLAN_SUPPORT_MSCS
  442. /**
  443. * struct cdp_mscs_params - MSCS parameters obtained
  444. * from handshake
  445. * @user_pri_bitmap - User priority bitmap
  446. * @user_pri_limit - User priority limit
  447. * @classifier_type - TCLAS Classifier type
  448. * @classifier_mask - TCLAS Classifier mask
  449. */
  450. struct cdp_mscs_params {
  451. uint8_t user_pri_bitmap;
  452. uint8_t user_pri_limit;
  453. uint8_t classifier_type;
  454. uint8_t classifier_mask;
  455. };
  456. #endif
  457. /**
  458. * struct cdp_sec_type - security type information
  459. */
  460. enum cdp_sec_type {
  461. cdp_sec_type_none,
  462. cdp_sec_type_wep128,
  463. cdp_sec_type_wep104,
  464. cdp_sec_type_wep40,
  465. cdp_sec_type_tkip,
  466. cdp_sec_type_tkip_nomic,
  467. cdp_sec_type_aes_ccmp,
  468. cdp_sec_type_wapi,
  469. cdp_sec_type_aes_ccmp_256,
  470. cdp_sec_type_aes_gcmp,
  471. cdp_sec_type_aes_gcmp_256,
  472. /* keep this last! */
  473. cdp_num_sec_types
  474. };
  475. /**
  476. * struct cdp_tx_exception_metadata - Exception path parameters
  477. * @peer_id: Peer id of the peer
  478. * @tid: Transmit Identifier
  479. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  480. * @sec_type: sec_type to be passed to HAL
  481. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  482. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  483. *
  484. * This structure holds the parameters needed in the exception path of tx
  485. *
  486. */
  487. struct cdp_tx_exception_metadata {
  488. uint16_t peer_id;
  489. uint8_t tid;
  490. uint16_t tx_encap_type;
  491. enum cdp_sec_type sec_type;
  492. uint8_t is_tx_sniffer;
  493. uint16_t ppdu_cookie;
  494. #ifdef QCA_SUPPORT_WDS_EXTENDED
  495. uint8_t is_wds_extended;
  496. #endif
  497. };
  498. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  499. /**
  500. * ol_txrx_vdev_delete_cb - callback registered during vdev
  501. * detach
  502. */
  503. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  504. /**
  505. * ol_txrx_peer_unmap_sync_cb - callback registered during peer detach sync
  506. */
  507. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  508. uint32_t peer_id_cnt,
  509. uint16_t *peer_id_list);
  510. /**
  511. * ol_txrx_pkt_direction - Packet Direction
  512. * @rx_direction: rx path packet
  513. * @tx_direction: tx path packet
  514. */
  515. enum txrx_direction {
  516. rx_direction = 1,
  517. tx_direction = 0,
  518. };
  519. /**
  520. * cdp_capabilities- DP capabilities
  521. */
  522. enum cdp_capabilities {
  523. CDP_CFG_DP_TSO,
  524. CDP_CFG_DP_LRO,
  525. CDP_CFG_DP_SG,
  526. CDP_CFG_DP_GRO,
  527. CDP_CFG_DP_OL_TX_CSUM,
  528. CDP_CFG_DP_OL_RX_CSUM,
  529. CDP_CFG_DP_RAWMODE,
  530. CDP_CFG_DP_PEER_FLOW_CTRL,
  531. };
  532. /**
  533. * ol_txrx_nbuf_classify - Packet classification object
  534. * @peer_id: unique peer identifier from fw
  535. * @tid: traffic identifier(could be overridden)
  536. * @pkt_tid: traffic identifier(cannot be overridden)
  537. * @pkt_tos: ip header tos value
  538. * @pkt_dscp: ip header dscp value
  539. * @tos: index value in map
  540. * @dscp: DSCP_TID map index
  541. * @is_mcast: multicast pkt check
  542. * @is_eap: eapol pkt check
  543. * @is_arp: arp pkt check
  544. * @is_tcp: tcp pkt check
  545. * @is_dhcp: dhcp pkt check
  546. * @is_igmp: igmp pkt check
  547. * @is_ipv4: ip version 4 pkt check
  548. * @is_ipv6: ip version 6 pkt check
  549. */
  550. struct ol_txrx_nbuf_classify {
  551. uint16_t peer_id;
  552. uint8_t tid;
  553. uint8_t pkt_tid;
  554. uint8_t pkt_tos;
  555. uint8_t pkt_dscp;
  556. uint8_t tos;
  557. uint8_t dscp;
  558. uint8_t is_mcast;
  559. uint8_t is_eap;
  560. uint8_t is_arp;
  561. uint8_t is_tcp;
  562. uint8_t is_dhcp;
  563. uint8_t is_igmp;
  564. uint8_t is_ipv4;
  565. uint8_t is_ipv6;
  566. };
  567. /**
  568. * ol_osif_vdev_handle - paque handle for OS shim virtual device
  569. * object
  570. */
  571. struct ol_osif_vdev_t;
  572. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  573. #ifdef QCA_SUPPORT_WDS_EXTENDED
  574. struct ol_osif_peer_t;
  575. typedef struct ol_osif_peer_t *ol_osif_peer_handle;
  576. #endif
  577. /**
  578. * wlan_op_mode - Virtual device operation mode
  579. * @wlan_op_mode_unknown: Unknown mode
  580. * @wlan_op_mode_ap: AP mode
  581. * @wlan_op_mode_ibss: IBSS mode
  582. * @wlan_op_mode_sta: STA (client) mode
  583. * @wlan_op_mode_monitor: Monitor mode
  584. * @wlan_op_mode_ocb: OCB mode
  585. */
  586. enum wlan_op_mode {
  587. wlan_op_mode_unknown,
  588. wlan_op_mode_ap,
  589. wlan_op_mode_ibss,
  590. wlan_op_mode_sta,
  591. wlan_op_mode_monitor,
  592. wlan_op_mode_ocb,
  593. wlan_op_mode_ndi,
  594. };
  595. /**
  596. * enum wlan_op_subtype - Virtual device subtype
  597. * @wlan_op_subtype_none: Subtype not applicable
  598. * @wlan_op_subtype_p2p_device: P2P device
  599. * @wlan_op_subtye_p2p_cli: P2P Client
  600. * @wlan_op_subtype_p2p_go: P2P GO
  601. *
  602. * This enum lists the subtypes of a particular virtual
  603. * device.
  604. */
  605. enum wlan_op_subtype {
  606. wlan_op_subtype_none,
  607. wlan_op_subtype_p2p_device,
  608. wlan_op_subtype_p2p_cli,
  609. wlan_op_subtype_p2p_go,
  610. };
  611. /**
  612. * connectivity_stats_pkt_status - data pkt type
  613. * @PKT_TYPE_REQ: Request packet
  614. * @PKT_TYPE_RSP: Response packet
  615. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  616. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  617. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  618. * @PKT_TYPE_RX_REFUSED: RX packet refused
  619. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  620. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  621. * @PKT_TYPE_NONE: Invalid packet
  622. */
  623. enum connectivity_stats_pkt_status {
  624. PKT_TYPE_REQ,
  625. PKT_TYPE_RSP,
  626. PKT_TYPE_TX_DROPPED,
  627. PKT_TYPE_RX_DROPPED,
  628. PKT_TYPE_RX_DELIVERED,
  629. PKT_TYPE_RX_REFUSED,
  630. PKT_TYPE_TX_HOST_FW_SENT,
  631. PKT_TYPE_TX_ACK_CNT,
  632. PKT_TYPE_NONE,
  633. };
  634. /**
  635. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  636. * callback function
  637. */
  638. typedef void
  639. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  640. /**
  641. * ol_txrx_data_tx_cb - Function registered with the data path
  642. * that is called when tx frames marked as "no free" are
  643. * done being transmitted
  644. */
  645. typedef void
  646. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  647. /**
  648. * ol_txrx_tx_fp - top-level transmit function
  649. * @soc - dp soc handle
  650. * @vdev_id - handle to the virtual device object
  651. * @msdu_list - list of network buffers
  652. */
  653. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  654. qdf_nbuf_t msdu_list);
  655. /**
  656. * ol_txrx_tx_exc_fp - top-level transmit function on exception path
  657. * @soc - dp soc handle
  658. * @vdev_id - handle to the virtual device object
  659. * @msdu_list - list of network buffers
  660. * @tx_exc_metadata - structure that holds parameters to exception path
  661. */
  662. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  663. qdf_nbuf_t msdu_list,
  664. struct cdp_tx_exception_metadata
  665. *tx_exc_metadata);
  666. /**
  667. * ol_txrx_completion_fp - top-level transmit function
  668. * for tx completion
  669. * @skb: skb data
  670. * @osif_dev: the virtual device's OS shim object
  671. * @flag: flag
  672. */
  673. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  674. void *osif_dev, uint16_t flag);
  675. /**
  676. * ol_txrx_tx_flow_control_fp - tx flow control notification
  677. * function from txrx to OS shim
  678. * @osif_dev - the virtual device's OS shim object
  679. * @tx_resume - tx os q should be resumed or not
  680. */
  681. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  682. bool tx_resume);
  683. /**
  684. * ol_txrx_tx_flow_control_is_pause_fp - is tx paused by flow control
  685. * function from txrx to OS shim
  686. * @osif_dev - the virtual device's OS shim object
  687. *
  688. * Return: true if tx is paused by flow control
  689. */
  690. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  691. /**
  692. * ol_txrx_rx_fp - receive function to hand batches of data
  693. * frames from txrx to OS shim
  694. * @data_vdev - handle to the OSIF virtual device object
  695. * @msdu_list - list of network buffers
  696. */
  697. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  698. typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
  699. void *dp_vdev,
  700. qdf_nbuf_t msdu_list);
  701. typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
  702. /**
  703. * ol_txrx_rx_flush_fp - receive function to hand batches of data
  704. * frames from txrx to OS shim
  705. * @osif_dev: handle to the OSIF virtual device object
  706. * @vdev_id: vdev_if of the packets to be flushed
  707. */
  708. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  709. /**
  710. * ol_txrx_rx_gro_flush_ind - function to send GRO flush indication to stack
  711. * for a given RX Context Id.
  712. * @osif_dev - handle to the OSIF virtual device object
  713. * @rx_ctx_id - Rx context Id for which gro flush should happen
  714. */
  715. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  716. int rx_ctx_id);
  717. /**
  718. * ol_txrx_stats_rx_fp - receive function to hand batches of data
  719. * frames from txrx to OS shim
  720. * @skb: skb data
  721. * @osif_dev: the virtual device's OS shim object
  722. * @action: data packet type
  723. * @pkt_type: packet data type
  724. */
  725. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  726. void *osif_dev, enum connectivity_stats_pkt_status action,
  727. uint8_t *pkt_type);
  728. /**
  729. * ol_txrx_get_key_fp - function to gey key based on keyix and peer
  730. * mac address
  731. * @osif_dev - the virtual device's OS shim object
  732. * @key_buf - pointer to store key
  733. * @mac_addr - pointer to mac address
  734. * @keyix - key id
  735. */
  736. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf, uint8_t *mac_addr, uint8_t keyix);
  737. /**
  738. * ol_txrx_rsim_rx_decap_fp - raw mode simulation function to decap the
  739. * packets in receive path.
  740. * @osif_dev - the virtual device's OS shim object
  741. * @list_head - poniter to head of receive packet queue to decap
  742. * @list_tail - poniter to tail of receive packet queue to decap
  743. * @peer_mac - mac address of peer handler
  744. */
  745. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  746. qdf_nbuf_t *list_head,
  747. qdf_nbuf_t *list_tail,
  748. uint8_t *peer_mac);
  749. /* ol_txrx_rx_fp - external tx free function to read per packet stats and
  750. * free tx buffer externally
  751. * @netbuf - tx network buffer
  752. */
  753. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  754. /**
  755. * ol_txrx_rx_check_wai_fp - OSIF WAPI receive function
  756. */
  757. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  758. qdf_nbuf_t mpdu_head,
  759. qdf_nbuf_t mpdu_tail);
  760. /**
  761. * ol_txrx_rx_mon_fp - OSIF monitor mode receive function for single
  762. * MPDU (802.11 format)
  763. */
  764. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  765. qdf_nbuf_t mpdu,
  766. void *rx_status);
  767. /**
  768. * ol_txrx_proxy_arp_fp - proxy arp function pointer
  769. */
  770. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  771. qdf_nbuf_t netbuf);
  772. /*
  773. * ol_txrx_mcast_me_fp - function pointer for multicast enhancement
  774. */
  775. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  776. qdf_nbuf_t netbuf);
  777. /**
  778. * ol_txrx_stats_callback - statistics notify callback
  779. */
  780. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  781. enum htt_cmn_dbg_stats_type type,
  782. uint8_t *buf, int bytes);
  783. /**
  784. * ol_txrx_pktdump_cb - callback for packet dump feature
  785. */
  786. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  787. uint8_t pdev_id,
  788. uint8_t vdev_id,
  789. qdf_nbuf_t netbuf,
  790. uint8_t status,
  791. uint8_t type);
  792. /**
  793. * ol_txrx_ops - (pointers to) the functions used for tx and rx
  794. * data xfer
  795. *
  796. * There are two portions of these txrx operations.
  797. * The rx portion is filled in by OSIF SW before calling
  798. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  799. * the txrx SW stores a copy of these rx function pointers, to use
  800. * as it delivers rx data frames to the OSIF SW.
  801. * The tx portion is filled in by the txrx SW inside
  802. * ol_txrx_osif_vdev_register; when the function call returns,
  803. * the OSIF SW stores a copy of these tx functions to use as it
  804. * delivers tx data frames to the txrx SW.
  805. *
  806. * @tx.std - the tx function pointer for standard data
  807. * frames This function pointer is set by the txrx SW
  808. * perform host-side transmit operations based on
  809. * whether a HL or LL host/target interface is in use.
  810. * @tx.flow_control_cb - the transmit flow control
  811. * function that is registered by the
  812. * OSIF which is called from txrx to
  813. * indicate whether the transmit OS
  814. * queues should be paused/resumed
  815. * @rx.rx - the OS shim rx function to deliver rx data
  816. * frames to. This can have different values for
  817. * different virtual devices, e.g. so one virtual
  818. * device's OS shim directly hands rx frames to the OS,
  819. * but another virtual device's OS shim filters out P2P
  820. * messages before sending the rx frames to the OS. The
  821. * netbufs delivered to the osif_rx function are in the
  822. * format specified by the OS to use for tx and rx
  823. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  824. * are given to the thread, instead of the stack via this pointer.
  825. * @rx.stack - function to give packets to the stack. Differs from @rx.rx.
  826. * In case RX Threads are enabled, this pointer holds the callback to give
  827. * packets to the stack.
  828. * @rx.rx_gro_flush - GRO flush indication to stack for a given RX CTX ID
  829. * @rx.wai_check - the tx function pointer for WAPI frames
  830. * @rx.mon - the OS shim rx monitor function to deliver
  831. * monitor data to Though in practice, it is probable
  832. * that the same function will be used for delivering
  833. * rx monitor data for all virtual devices, in theory
  834. * each different virtual device can have a different
  835. * OS shim function for accepting rx monitor data. The
  836. * netbufs delivered to the osif_rx_mon function are in
  837. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  838. * an 802.11 MSDU. Depending on compile-time
  839. * configuration, each netbuf may also have a
  840. * monitor-mode encapsulation header such as a radiotap
  841. * header added before the MPDU contents.
  842. * @rx.std - the OS shim rx function to deliver rx data
  843. * @proxy_arp - proxy arp function pointer - specified by
  844. * OS shim, stored by txrx
  845. * @get_key - function pointer to get key of the peer with
  846. * specific key index
  847. */
  848. struct ol_txrx_ops {
  849. /* tx function pointers - specified by txrx, stored by OS shim */
  850. struct {
  851. ol_txrx_tx_fp tx;
  852. ol_txrx_tx_exc_fp tx_exception;
  853. ol_txrx_tx_free_ext_fp tx_free_ext;
  854. ol_txrx_completion_fp tx_comp;
  855. } tx;
  856. /* rx function pointers - specified by OS shim, stored by txrx */
  857. struct {
  858. ol_txrx_rx_fp rx;
  859. ol_txrx_rx_fp rx_stack;
  860. ol_txrx_rx_flush_fp rx_flush;
  861. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  862. ol_txrx_rx_check_wai_fp wai_check;
  863. ol_txrx_rx_mon_fp mon;
  864. ol_txrx_stats_rx_fp stats_rx;
  865. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  866. ol_txrx_fisa_rx_fp osif_fisa_rx;
  867. ol_txrx_fisa_flush_fp osif_fisa_flush;
  868. } rx;
  869. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  870. ol_txrx_proxy_arp_fp proxy_arp;
  871. ol_txrx_mcast_me_fp me_convert;
  872. ol_txrx_get_key_fp get_key;
  873. };
  874. /**
  875. * ol_txrx_stats_req - specifications of the requested
  876. * statistics
  877. */
  878. struct ol_txrx_stats_req {
  879. uint32_t stats_type_upload_mask; /* which stats to upload */
  880. uint32_t stats_type_reset_mask; /* which stats to reset */
  881. /* stats will be printed if either print element is set */
  882. struct {
  883. int verbose; /* verbose stats printout */
  884. int concise; /* concise stats printout (takes precedence) */
  885. } print; /* print uploaded stats */
  886. /* stats notify callback will be invoked if fp is non-NULL */
  887. struct {
  888. ol_txrx_stats_callback fp;
  889. void *ctxt;
  890. } callback;
  891. /* stats will be copied into the specified buffer if buf is non-NULL */
  892. struct {
  893. uint8_t *buf;
  894. int byte_limit; /* don't copy more than this */
  895. } copy;
  896. /*
  897. * If blocking is true, the caller will take the specified semaphore
  898. * to wait for the stats to be uploaded, and the driver will release
  899. * the semaphore when the stats are done being uploaded.
  900. */
  901. struct {
  902. int blocking;
  903. /*Note: this needs to change to some qdf_* type */
  904. qdf_semaphore_t *sem_ptr;
  905. } wait;
  906. };
  907. /* DP soc struct definition */
  908. struct cdp_soc_t {
  909. struct cdp_ops *ops;
  910. struct ol_if_ops *ol_ops;
  911. };
  912. /*
  913. * cdp_peer_param_type: different types of parameters
  914. * to set values in peer
  915. * @CDP_CONFIG_NAWDS: Enable nawds mode
  916. * @CDP_CONFIG_NAC: Enable nac
  917. * @CDP_CONFIG_ISOLATION : Enable isolation
  918. * @CDP_CONFIG_IN_TWT : In TWT session or not
  919. */
  920. enum cdp_peer_param_type {
  921. CDP_CONFIG_NAWDS,
  922. CDP_CONFIG_NAC,
  923. CDP_CONFIG_ISOLATION,
  924. CDP_CONFIG_IN_TWT,
  925. };
  926. /*
  927. * cdp_pdev_param_type: different types of parameters
  928. * to set values in pdev
  929. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  930. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  931. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  932. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  933. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  934. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  935. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  936. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  937. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  938. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  939. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  940. * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
  941. * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
  942. * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
  943. * @CDP_CONFIG_TX_CAPTURE: set tx capture
  944. * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
  945. * @CDP_CONFIG_VOW: set/get vow config
  946. * @CDP_TIDQ_OVERRIDE: set/get tid queue override
  947. * @CDP_TIDMAP_PRTY: set/get tid map prty
  948. * @CDP_TX_PENDING: get tx pending
  949. * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
  950. * @CDP_FILTER_UCAST_DATA: filter unicast data
  951. * @CDP_FILTER_MCAST_DATA: filter multicast data
  952. * @CDP_FILTER_NO_DATA: filter no data
  953. * @CDP_MONITOR_CHANNEL: monitor channel
  954. * @CDP_MONITOR_FREQUENCY: monitor frequency
  955. * @CDP_CONFIG_BSS_COLOR: configure bss color
  956. * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
  957. */
  958. enum cdp_pdev_param_type {
  959. CDP_CONFIG_DEBUG_SNIFFER,
  960. CDP_CONFIG_BPR_ENABLE,
  961. CDP_CONFIG_PRIMARY_RADIO,
  962. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  963. CDP_CONFIG_IGMPMLD_OVERRIDE,
  964. CDP_CONFIG_IGMPMLD_TID,
  965. CDP_CONFIG_ARP_DBG_CONF,
  966. CDP_CONFIG_CAPTURE_LATENCY,
  967. CDP_INGRESS_STATS,
  968. CDP_OSIF_DROP,
  969. CDP_CONFIG_ENH_RX_CAPTURE,
  970. CDP_CONFIG_ENH_TX_CAPTURE,
  971. CDP_CONFIG_HMMC_TID_OVERRIDE,
  972. CDP_CONFIG_HMMC_TID_VALUE,
  973. CDP_CONFIG_TX_CAPTURE,
  974. CDP_CHAN_NOISE_FLOOR,
  975. CDP_CONFIG_VOW,
  976. CDP_TIDQ_OVERRIDE,
  977. CDP_TIDMAP_PRTY,
  978. CDP_TX_PENDING,
  979. CDP_FILTER_NEIGH_PEERS,
  980. CDP_FILTER_UCAST_DATA,
  981. CDP_FILTER_MCAST_DATA,
  982. CDP_FILTER_NO_DATA,
  983. CDP_MONITOR_CHANNEL,
  984. CDP_MONITOR_FREQUENCY,
  985. CDP_CONFIG_BSS_COLOR,
  986. CDP_SET_ATF_STATS_ENABLE,
  987. };
  988. /*
  989. * cdp_config_param_type: union of different types of parameters
  990. * to set values into dp handles.
  991. *
  992. * @cdp_peer_param_nawds: Enable nawds mode
  993. * @cdp_peer_param_isolation: Enable isolation
  994. * @cdp_peer_param_in_twt: in TWT session or not
  995. * @cdp_peer_param_nac: Enable nac
  996. *
  997. * @cdp_vdev_param_nawds: set nawds enable/disable
  998. * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
  999. * @cdp_vdev_param_wds: wds sta
  1000. * @cdp_vdev_param_mec: MEC enable flags
  1001. * @cdp_vdev_param_proxysta: proxy sta
  1002. * @cdp_vdev_param_tdls_flags: tdls link flags
  1003. * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
  1004. * @cdp_vdev_param_cipher_en: set cipher type based on security
  1005. * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
  1006. * @cdp_vdev_param_tx_encap: tx encap type
  1007. * @cdp_vdev_param_rx_decap: rx decap type
  1008. * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
  1009. * @cdp_vdev_param_tidmap_prty: set tid vdev prty
  1010. * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
  1011. * @cdp_vdev_param_mesh_mode: set mesh mode
  1012. * @cdp_vdev_param_safe_mode: set safe mode
  1013. * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
  1014. * @cdp_vdev_param_hlos_tid_override: set hlos tid override
  1015. * @cdp_vdev_param_peer_authorize: set peer authorize
  1016. * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
  1017. * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
  1018. *
  1019. * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
  1020. * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
  1021. * @cdp_pdev_param_primary_radio: Configure radio as primary
  1022. * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
  1023. * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
  1024. * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
  1025. * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
  1026. * @cdp_pdev_param_cptr_latcy: Capture time latency
  1027. * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
  1028. * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
  1029. * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
  1030. * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
  1031. * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
  1032. * @cdp_pdev_param_hmmc_tid: set hmmc tid value
  1033. * @cdp_pdev_param_tx_capture: set tx capture
  1034. * @cdp_pdev_param_chn_noise_flr: set channel noise floor
  1035. * @cdp_pdev_param_cfg_vow: set/get vow config
  1036. * @cdp_pdev_param_tidq_override: set/get tid queue override
  1037. * @cdp_pdev_param_mon_freq: set monitor frequency
  1038. * @cdp_pdev_param_bss_color: configure bss color
  1039. * @cdp_pdev_param_tidmap_prty: set/get tid map prty
  1040. * @cdp_pdev_param_tx_pending: get tx pending
  1041. * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
  1042. * @cdp_pdev_param_fltr_ucast: filter unicast data
  1043. * @cdp_pdev_param_fltr_mcast: filter multicast data
  1044. * @cdp_pdev_param_fltr_none: filter no data
  1045. * @cdp_pdev_param_monitor_chan: monitor channel
  1046. * @cdp_pdev_param_atf_stats_enable: ATF stats enable
  1047. *
  1048. * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  1049. * @cdp_psoc_param_en_nss_cfg: set nss cfg
  1050. *
  1051. * @cdp_enable_tx_checksum: Flag to specify if HW Tx checksum enabled
  1052. */
  1053. typedef union cdp_config_param_t {
  1054. /* peer params */
  1055. bool cdp_peer_param_nawds;
  1056. bool cdp_peer_param_isolation;
  1057. uint8_t cdp_peer_param_nac;
  1058. bool cdp_peer_param_in_twt;
  1059. /* vdev params */
  1060. bool cdp_vdev_param_wds;
  1061. bool cdp_vdev_param_mec;
  1062. bool cdp_vdev_param_nawds;
  1063. bool cdp_vdev_param_proxysta;
  1064. bool cdp_vdev_param_tdls_flags;
  1065. bool cdp_vdev_param_ap_brdg_en;
  1066. bool cdp_vdev_param_qwrap_isolation;
  1067. bool cdp_vdev_param_update_multipass;
  1068. uint8_t cdp_vdev_param_da_war;
  1069. uint8_t cdp_vdev_param_mcast_en;
  1070. uint8_t cdp_vdev_param_igmp_mcast_en;
  1071. uint8_t cdp_vdev_param_tidmap_prty;
  1072. uint8_t cdp_vdev_param_tidmap_tbl_id;
  1073. uint32_t cdp_vdev_param_aging_tmr;
  1074. uint32_t cdp_vdev_param_cipher_en;
  1075. uint32_t cdp_vdev_param_tx_encap;
  1076. uint32_t cdp_vdev_param_rx_decap;
  1077. uint32_t cdp_vdev_param_mesh_rx_filter;
  1078. uint32_t cdp_vdev_param_mesh_mode;
  1079. uint32_t cdp_vdev_param_safe_mode;
  1080. uint32_t cdp_vdev_param_drop_unenc;
  1081. uint8_t cdp_vdev_param_hlos_tid_override;
  1082. bool cdp_vdev_param_wds_ext;
  1083. uint8_t cdp_vdev_param_peer_authorize;
  1084. uint8_t cdp_vdev_param_peer_tid_latency_enable;
  1085. uint8_t cdp_vdev_param_mesh_tid;
  1086. /* pdev params */
  1087. bool cdp_pdev_param_cptr_latcy;
  1088. bool cdp_pdev_param_hmmc_tid_ovrd;
  1089. bool cdp_pdev_param_fltr_neigh_peers;
  1090. bool cdp_pdev_param_cfg_vow;
  1091. bool cdp_pdev_param_fltr_mcast;
  1092. bool cdp_pdev_param_fltr_none;
  1093. bool cdp_pdev_param_fltr_ucast;
  1094. uint8_t cdp_pdev_param_primary_radio;
  1095. uint8_t cdp_pdev_param_en_rx_cap;
  1096. uint8_t cdp_pdev_param_en_tx_cap;
  1097. uint8_t cdp_pdev_param_tx_capture;
  1098. uint8_t cdp_pdev_param_hmmc_tid;
  1099. uint8_t cdp_pdev_param_tidmap_prty;
  1100. uint8_t cdp_pdev_param_igmpmld_override;
  1101. uint8_t cdp_pdev_param_igmpmld_tid;
  1102. uint8_t cdp_pdev_param_arp_dbg_conf;
  1103. uint8_t cdp_pdev_param_tidq_override;
  1104. uint8_t cdp_pdev_param_bss_color;
  1105. uint16_t cdp_pdev_param_chn_noise_flr;
  1106. qdf_freq_t cdp_pdev_param_mon_freq;
  1107. int cdp_pdev_param_dbg_snf;
  1108. int cdp_pdev_param_bpr_enable;
  1109. int cdp_pdev_param_monitor_chan;
  1110. uint32_t cdp_pdev_param_ingrs_stats;
  1111. uint32_t cdp_pdev_param_osif_drop;
  1112. uint32_t cdp_pdev_param_en_perpkt_txstats;
  1113. uint32_t cdp_pdev_param_tx_pending;
  1114. bool cdp_pdev_param_atf_stats_enable;
  1115. /* psoc params */
  1116. bool cdp_psoc_param_en_rate_stats;
  1117. int cdp_psoc_param_en_nss_cfg;
  1118. int cdp_psoc_param_preferred_hw_mode;
  1119. bool cdp_psoc_param_pext_stats;
  1120. bool cdp_enable_tx_checksum;
  1121. } cdp_config_param_type;
  1122. /**
  1123. * cdp_rx_enh_capture_mode - Rx enhanced capture modes
  1124. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  1125. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  1126. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  1127. */
  1128. enum cdp_rx_enh_capture_mode {
  1129. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  1130. CDP_RX_ENH_CAPTURE_MPDU,
  1131. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  1132. };
  1133. /**
  1134. * cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  1135. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  1136. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  1137. */
  1138. enum cdp_rx_enh_capture_peer {
  1139. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  1140. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  1141. };
  1142. /**
  1143. * cdp_tx_enh_capture_mode - Tx enhanced capture modes
  1144. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  1145. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  1146. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  1147. */
  1148. enum cdp_tx_enh_capture_mode {
  1149. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  1150. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  1151. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  1152. CDP_TX_ENH_CAPTURE_MAX,
  1153. };
  1154. /*
  1155. * enum cdp_pdev_bpr_param - different types of parameters
  1156. * to set value in pdev
  1157. * @CDP_BPR_DISABLE: Set bpr to disable state
  1158. * @CDP_BPR_ENABLE: set bpr to enable state
  1159. *
  1160. * Enum indicating bpr state to enable/disable.
  1161. */
  1162. enum cdp_pdev_bpr_param {
  1163. CDP_BPR_DISABLE,
  1164. CDP_BPR_ENABLE,
  1165. };
  1166. /*
  1167. * cdp_vdev_param_type: different types of parameters
  1168. * to set values in vdev
  1169. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  1170. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  1171. * @CDP_ENABLE_WDS: wds sta
  1172. * @CDP_ENABLE_MEC: MEC enable flags
  1173. * @CDP_ENABLE_PROXYSTA: proxy sta
  1174. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  1175. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  1176. * @CDP_ENABLE_CIPHER : set cipher type based on security
  1177. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  1178. * @CDP_TX_ENCAP_TYPE: tx encap type
  1179. * @CDP_RX_DECAP_TYPE: rx decap type
  1180. * @CDP_MESH_RX_FILTER: set mesh rx filter
  1181. * @CDP_TID_VDEV_PRTY: set tid vdev prty
  1182. * @CDP_TIDMAP_TBL_ID: set tidmap table id
  1183. * @CDP_MESH_MODE: set mesh mode
  1184. * @CDP_SAFEMODE: set safe mode
  1185. * @CDP_DROP_UNENC: set drop unencrypted flag
  1186. * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
  1187. * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
  1188. * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
  1189. * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
  1190. * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
  1191. * @CDP_SET_VAP_MESH_TID : Set latency tid in vap
  1192. */
  1193. enum cdp_vdev_param_type {
  1194. CDP_ENABLE_NAWDS,
  1195. CDP_ENABLE_MCAST_EN,
  1196. CDP_ENABLE_WDS,
  1197. CDP_ENABLE_MEC,
  1198. CDP_ENABLE_DA_WAR,
  1199. CDP_ENABLE_PROXYSTA,
  1200. CDP_UPDATE_TDLS_FLAGS,
  1201. CDP_CFG_WDS_AGING_TIMER,
  1202. CDP_ENABLE_AP_BRIDGE,
  1203. CDP_ENABLE_CIPHER,
  1204. CDP_ENABLE_QWRAP_ISOLATION,
  1205. CDP_UPDATE_MULTIPASS,
  1206. CDP_TX_ENCAP_TYPE,
  1207. CDP_RX_DECAP_TYPE,
  1208. CDP_MESH_RX_FILTER,
  1209. CDP_TID_VDEV_PRTY,
  1210. CDP_TIDMAP_TBL_ID,
  1211. #ifdef MESH_MODE_SUPPORT
  1212. CDP_MESH_MODE,
  1213. #endif
  1214. CDP_SAFEMODE,
  1215. CDP_DROP_UNENC,
  1216. CDP_ENABLE_CSUM,
  1217. CDP_ENABLE_IGMP_MCAST_EN,
  1218. CDP_ENABLE_HLOS_TID_OVERRIDE,
  1219. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1220. CDP_CFG_WDS_EXT,
  1221. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1222. CDP_ENABLE_PEER_AUTHORIZE,
  1223. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1224. CDP_ENABLE_PEER_TID_LATENCY,
  1225. CDP_SET_VAP_MESH_TID,
  1226. #endif
  1227. };
  1228. /*
  1229. * cdp_psoc_param_type: different types of parameters
  1230. * to set values in psoc
  1231. * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
  1232. * @CDP_SET_NSS_CFG: set nss cfg
  1233. * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  1234. * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  1235. */
  1236. enum cdp_psoc_param_type {
  1237. CDP_ENABLE_RATE_STATS,
  1238. CDP_SET_NSS_CFG,
  1239. CDP_SET_PREFERRED_HW_MODE,
  1240. CDP_CFG_PEER_EXT_STATS,
  1241. };
  1242. #define TXRX_FW_STATS_TXSTATS 1
  1243. #define TXRX_FW_STATS_RXSTATS 2
  1244. #define TXRX_FW_STATS_RX_RATE_INFO 3
  1245. #define TXRX_FW_STATS_PHYSTATS 4
  1246. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  1247. #define TXRX_FW_STATS_TX_RATE_INFO 6
  1248. #define TXRX_FW_STATS_TID_STATE 7
  1249. #define TXRX_FW_STATS_HOST_STATS 8
  1250. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  1251. #define TXRX_FW_STATS_CE_STATS 10
  1252. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  1253. #define TXRX_FW_STATS_ME_STATS 12
  1254. #define TXRX_FW_STATS_TXBF_INFO 13
  1255. #define TXRX_FW_STATS_SND_INFO 14
  1256. #define TXRX_FW_STATS_ERROR_INFO 15
  1257. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  1258. #define TXRX_FW_STATS_TX_MU_INFO 17
  1259. #define TXRX_FW_SIFS_RESP_INFO 18
  1260. #define TXRX_FW_RESET_STATS 19
  1261. #define TXRX_FW_MAC_WDOG_STATS 20
  1262. #define TXRX_FW_MAC_DESC_STATS 21
  1263. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  1264. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  1265. #define TXRX_FW_STATS_DURATION_INFO 24
  1266. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  1267. #define TXRX_FW_HALPHY_STATS 26
  1268. #define TXRX_FW_COEX_STATS 27
  1269. #define PER_RADIO_FW_STATS_REQUEST 0
  1270. #define PER_VDEV_FW_STATS_REQUEST 1
  1271. /**
  1272. * enum data_stall_log_event_indicator - Module triggering data stall
  1273. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1274. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1275. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1276. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1277. *
  1278. * Enum indicating the module that indicates data stall event
  1279. */
  1280. enum data_stall_log_event_indicator {
  1281. DATA_STALL_LOG_INDICATOR_UNUSED,
  1282. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1283. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1284. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1285. };
  1286. /**
  1287. * enum data_stall_log_event_type - data stall event type
  1288. * @DATA_STALL_LOG_NONE
  1289. * @DATA_STALL_LOG_FW_VDEV_PAUSE
  1290. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER
  1291. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH
  1292. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED
  1293. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR
  1294. * @DATA_STALL_LOG_FW_WDOG_ERRORS
  1295. * @DATA_STALL_LOG_BB_WDOG_ERROR
  1296. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR
  1297. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT
  1298. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT
  1299. * @DATA_STALL_LOG_NUD_FAILURE
  1300. *
  1301. * Enum indicating data stall event type
  1302. */
  1303. enum data_stall_log_event_type {
  1304. DATA_STALL_LOG_NONE,
  1305. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1306. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1307. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1308. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1309. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1310. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1311. DATA_STALL_LOG_BB_WDOG_ERROR,
  1312. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1313. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1314. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1315. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1316. DATA_STALL_LOG_NUD_FAILURE,
  1317. };
  1318. /**
  1319. * enum data_stall_log_recovery_type - data stall recovery type
  1320. * @DATA_STALL_LOG_RECOVERY_NONE,
  1321. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1322. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR
  1323. *
  1324. * Enum indicating data stall recovery type
  1325. */
  1326. enum data_stall_log_recovery_type {
  1327. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1328. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1329. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1330. };
  1331. /**
  1332. * struct data_stall_event_info - data stall info
  1333. * @indicator: Module triggering data stall
  1334. * @data_stall_type: data stall event type
  1335. * @vdev_id_bitmap: vdev_id_bitmap
  1336. * @pdev_id: pdev id
  1337. * @recovery_type: data stall recovery type
  1338. */
  1339. struct data_stall_event_info {
  1340. uint32_t indicator;
  1341. uint32_t data_stall_type;
  1342. uint32_t vdev_id_bitmap;
  1343. uint32_t pdev_id;
  1344. uint32_t recovery_type;
  1345. };
  1346. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1347. /*
  1348. * enum cdp_stats - options for host and firmware
  1349. * statistics
  1350. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1351. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1352. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1353. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1354. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1355. * @CDP_TXRX_STATS_6: HTT TQM stats
  1356. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1357. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1358. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1359. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1360. * @CDP_TXRX_STATS_11: HTT Peer stats
  1361. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1362. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1363. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1364. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1365. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1366. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1367. * @CDP_TXRX_STATS_18: HTT Peer list details
  1368. * @CDP_TXRX_STATS_19: Reserved
  1369. * @CDP_TXRX_STATS_20: Reset Host stats
  1370. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1371. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1372. * @CDP_TXRX_STATS_23: Host Tx stats
  1373. * @CDP_TXRX_STATS_24: Host Rx stats
  1374. * @CDP_TXRX_STATS_25: Host Ast stats
  1375. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1376. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1377. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1378. * @CDP_TXRX_STATS_29: Host Soc config params info
  1379. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1380. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1381. */
  1382. enum cdp_stats {
  1383. CDP_TXRX_STATS_0 = 0,
  1384. CDP_TXRX_STATS_1,
  1385. CDP_TXRX_STATS_2,
  1386. CDP_TXRX_STATS_3,
  1387. CDP_TXRX_STATS_4,
  1388. CDP_TXRX_STATS_5,
  1389. CDP_TXRX_STATS_6,
  1390. CDP_TXRX_STATS_7,
  1391. CDP_TXRX_STATS_8,
  1392. CDP_TXRX_STATS_9,
  1393. CDP_TXRX_STATS_10,
  1394. CDP_TXRX_STATS_11,
  1395. CDP_TXRX_STATS_12,
  1396. CDP_TXRX_STATS_13,
  1397. CDP_TXRX_STATS_14,
  1398. CDP_TXRX_STATS_15,
  1399. CDP_TXRX_STATS_16,
  1400. CDP_TXRX_STATS_17,
  1401. CDP_TXRX_STATS_18,
  1402. CDP_TXRX_STATS_19,
  1403. CDP_TXRX_STATS_20,
  1404. CDP_TXRX_STATS_21,
  1405. CDP_TXRX_STATS_22,
  1406. CDP_TXRX_STATS_23,
  1407. CDP_TXRX_STATS_24,
  1408. CDP_TXRX_STATS_25,
  1409. CDP_TXRX_STATS_26,
  1410. CDP_TXRX_STATS_27,
  1411. CDP_TXRX_STATS_28,
  1412. CDP_TXRX_STATS_29,
  1413. CDP_TXRX_STATS_30,
  1414. CDP_TXRX_STATS_31,
  1415. CDP_TXRX_STATS_HTT_MAX = 256,
  1416. CDP_TXRX_MAX_STATS = 265,
  1417. };
  1418. /*
  1419. * Different Stat update types sent to OL_IF
  1420. * @UPDATE_PEER_STATS: update peer stats
  1421. * @UPDATE_VDEV_STATS: update vdev stats
  1422. * @UPDATE_PDE_STATS: Update pdev stats
  1423. */
  1424. enum cdp_stat_update_type {
  1425. UPDATE_PEER_STATS = 0,
  1426. UPDATE_VDEV_STATS = 1,
  1427. UPDATE_PDEV_STATS = 2,
  1428. };
  1429. /*
  1430. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1431. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1432. * @avg_sojourn_msdu: average sojourn msdu time
  1433. * @sum_sojourn_msdu: sum sojourn msdu time
  1434. * @num_msdu: number of msdus per ppdu
  1435. * @cookie: cookie to be used by upper layer
  1436. */
  1437. struct cdp_tx_sojourn_stats {
  1438. uint32_t ppdu_seq_id;
  1439. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1440. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1441. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1442. struct cdp_stats_cookie *cookie;
  1443. };
  1444. /**
  1445. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1446. * per-user information
  1447. * @frame_ctrl: frame control field in 802.11 header
  1448. * @qos_ctrl: QoS control field in 802.11 header
  1449. * @mpdu_tried: number of mpdus tried
  1450. * @ltf_size: ltf_size
  1451. * @stbc: stbc
  1452. * @he_re: he_re (range extension)
  1453. * @txbf: txbf
  1454. * @bw: Transmission bandwidth
  1455. * <enum 2 transmit_bw_20_MHz>
  1456. * <enum 3 transmit_bw_40_MHz>
  1457. * <enum 4 transmit_bw_80_MHz>
  1458. * <enum 5 transmit_bw_160_MHz>
  1459. * @nss: NSS 1,2, ...8
  1460. * @mcs: MCS index
  1461. * @preamble: preamble
  1462. * @gi: guard interval 800/400/1600/3200 ns
  1463. * @dcm: dcm
  1464. * @ldpc: ldpc
  1465. * @ru_start: RU start index
  1466. * @ru_tones: RU tones length
  1467. * @is_mcast: MCAST or UCAST
  1468. * @user_pos: user position
  1469. * @mu_group_id: mu group id
  1470. * @ppdu_start_timestamp: 64 bits ppdu start timestamp
  1471. * @ppdu_end_timestamp: 64 bits ppdu end timestamp
  1472. */
  1473. struct cdp_delayed_tx_completion_ppdu_user {
  1474. uint32_t frame_ctrl:16,
  1475. qos_ctrl:16;
  1476. uint32_t mpdu_tried_ucast:16,
  1477. mpdu_tried_mcast:16;
  1478. uint32_t ltf_size:2,
  1479. stbc:1,
  1480. he_re:1,
  1481. txbf:4,
  1482. bw:4,
  1483. nss:4,
  1484. mcs:4,
  1485. preamble:4,
  1486. gi:4,
  1487. dcm:1,
  1488. ldpc:1,
  1489. delayed_ba:1;
  1490. uint16_t ru_start;
  1491. uint16_t ru_tones;
  1492. bool is_mcast;
  1493. uint32_t user_pos;
  1494. uint32_t mu_group_id;
  1495. uint64_t ppdu_start_timestamp;
  1496. uint64_t ppdu_end_timestamp;
  1497. };
  1498. /**
  1499. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1500. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1501. * @tid: TID number
  1502. * @peer_id: Peer ID
  1503. * @ba_size: Block-Ack size
  1504. * @frame_ctrl: frame control field in 802.11 header
  1505. * @qos_ctrl: QoS control field in 802.11 header
  1506. * @mpdu_tried: number of mpdus tried
  1507. * @mpdu_success: number of mpdus successfully transmitted
  1508. * @long_retries: long retries
  1509. * @short_retries: short retries
  1510. * @is_ampdu: mpdu aggregate or non-aggregate?
  1511. * @success_bytes: bytes successfully transmitted
  1512. * @retry_bytes: bytes retried
  1513. * @failed_msdus: MSDUs failed transmission
  1514. * @duration: user duration in ppdu
  1515. * @ltf_size: ltf_size
  1516. * @stbc: stbc
  1517. * @he_re: he_re (range extension)
  1518. * @txbf: txbf
  1519. * @bw: Transmission bandwidth
  1520. * <enum 2 transmit_bw_20_MHz>
  1521. * <enum 3 transmit_bw_40_MHz>
  1522. * <enum 4 transmit_bw_80_MHz>
  1523. * <enum 5 transmit_bw_160_MHz>
  1524. * @nss: NSS 1,2, ...8
  1525. * @mcs: MCS index
  1526. * @preamble: preamble
  1527. * @gi: guard interval 800/400/1600/3200 ns
  1528. * @dcm: dcm
  1529. * @ldpc: ldpc
  1530. * @delayed_ba: delayed ba bit
  1531. * @ack_ba_tlv: ack ba recv tlv bit
  1532. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  1533. * @pream_punct: Preamble Punctured PPDU
  1534. * UL_BSR_TRIG/UNKNOWN
  1535. * @ba_seq_no: Block Ack sequence number
  1536. * @ba_bitmap: Block Ack bitmap
  1537. * @start_seqa: Sequence number of first MPDU
  1538. * @enq_bitmap: Enqueue MPDU bitmap
  1539. * @ru_start: RU start index
  1540. * @ru_tones: RU tones length
  1541. * @is_mcast: MCAST or UCAST
  1542. * @tx_rate: Transmission Rate
  1543. * @user_pos: user position
  1544. * @mu_group_id: mu group id
  1545. * @rix: rate index
  1546. * @cookie: cookie to used by upper layer
  1547. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1548. * @ppdu_cookie: 16-bit ppdu_cookie
  1549. * @sa_is_training: smart antenna training packets indication
  1550. * @rssi_chain: rssi chain per bandwidth
  1551. * @usr_ack_rssi: overall per user ack rssi
  1552. * @sa_tx_antenna: antenna in which packet is transmitted
  1553. * @sa_max_rates: smart antenna tx feedback info max rates
  1554. * @sa_goodput: smart antenna tx feedback info goodput
  1555. * @current_rate_per: Moving average per
  1556. * @last_enq_seq: last equeue sequence number
  1557. * @is_bss_peer: is bss peer check
  1558. * @mpdu_q: queue of mpdu in a ppdu
  1559. * @mpdus: MPDU list based on enqueue sequence bitmap
  1560. * @pending_retries: pending MPDUs (retries)
  1561. * @tlv_bitmap: per user tlv bitmap
  1562. * @skip: tx capture skip flag
  1563. * @mon_procd: to indicate user processed in ppdu of the sched cmd
  1564. * @debug_copied: flag to indicate bar frame copied
  1565. * @peer_last_delayed_ba: flag to indicate peer last delayed ba
  1566. * @phy_tx_time_us: Phy TX duration for the User
  1567. */
  1568. struct cdp_tx_completion_ppdu_user {
  1569. uint32_t completion_status:8,
  1570. tid:8,
  1571. peer_id:16;
  1572. uint8_t mac_addr[6];
  1573. uint16_t ba_size;
  1574. uint32_t frame_ctrl:16,
  1575. qos_ctrl:16;
  1576. uint32_t mpdu_tried_ucast:16,
  1577. mpdu_tried_mcast:16;
  1578. uint16_t mpdu_success:16;
  1579. uint16_t mpdu_failed:16;
  1580. uint32_t long_retries:4,
  1581. short_retries:4,
  1582. tx_ratecode:16,
  1583. is_ampdu:1,
  1584. ppdu_type:5,
  1585. pream_punct:1;
  1586. uint32_t success_bytes;
  1587. uint32_t retry_bytes;
  1588. uint32_t failed_bytes;
  1589. uint32_t success_msdus:16,
  1590. retry_msdus:16;
  1591. uint32_t failed_msdus:16,
  1592. duration:16;
  1593. uint32_t ltf_size:2,
  1594. stbc:1,
  1595. he_re:1,
  1596. txbf:4,
  1597. bw:4,
  1598. nss:4,
  1599. mcs:4,
  1600. preamble:4,
  1601. gi:4,
  1602. dcm:1,
  1603. ldpc:1,
  1604. delayed_ba:1,
  1605. ack_ba_tlv:1;
  1606. uint32_t ba_seq_no;
  1607. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1608. uint32_t start_seq;
  1609. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1610. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1611. uint32_t num_mpdu:9,
  1612. num_msdu:16;
  1613. uint32_t tx_duration;
  1614. uint16_t ru_start;
  1615. uint16_t ru_tones;
  1616. bool is_mcast;
  1617. uint32_t tx_rate;
  1618. uint32_t tx_ratekbps;
  1619. /*ack rssi for separate chains*/
  1620. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1621. bool ack_rssi_valid;
  1622. uint32_t usr_ack_rssi;
  1623. uint32_t user_pos;
  1624. uint32_t mu_group_id;
  1625. uint32_t rix;
  1626. uint8_t is_ppdu_cookie_valid;
  1627. uint16_t ppdu_cookie;
  1628. uint8_t sa_is_training;
  1629. uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1630. uint32_t sa_tx_antenna;
  1631. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1632. * |---------------------------------------|
  1633. * | 16 bits | 16 bits | 16 bits | 16 bits |
  1634. * | BW-1 | BW-2 | BW-3 | BW-4 |
  1635. * | /\ \ |
  1636. * | / \ \ |
  1637. * | / \ \ |
  1638. * | / \ \ |
  1639. * | / \ \ |
  1640. * | / \ \ |
  1641. * |/ \ \ |
  1642. * |[11|8] [5|8] \ |
  1643. * | BW1 PADDED \ |
  1644. * |---------------------------------------|
  1645. */
  1646. uint16_t sa_max_rates[CDP_NUM_SA_BW];
  1647. uint32_t sa_goodput;
  1648. /* below field is used to calculate goodput in non-training period
  1649. * Note: As host is exposing goodput and hence current_rate_per is
  1650. * of no use. It is just for Host computation.
  1651. */
  1652. uint32_t current_rate_per;
  1653. uint32_t last_enq_seq;
  1654. uint8_t is_bss_peer;
  1655. qdf_nbuf_queue_t mpdu_q;
  1656. qdf_nbuf_t *mpdus;
  1657. uint32_t pending_retries;
  1658. uint32_t tlv_bitmap;
  1659. bool skip;
  1660. bool mon_procd;
  1661. bool debug_copied;
  1662. bool peer_last_delayed_ba;
  1663. uint16_t phy_tx_time_us;
  1664. };
  1665. /**
  1666. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  1667. * @ppdu_id: PPDU id
  1668. * @duration: user duration in ppdu
  1669. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  1670. * @frame_ctrl: frame control field in 802.11 header
  1671. * @qos_ctrl: QoS control field in 802.11 header
  1672. * @tid: TID number
  1673. * @num_msdu: number of msdu in MPDU
  1674. * @seq_no: Sequence number of first MPDU
  1675. * @ltf_size: ltf_size
  1676. * @stbc: stbc
  1677. * @he_re: he_re (range extension)
  1678. * @txbf: txbf
  1679. * @bw: Transmission bandwidth
  1680. * <enum 2 transmit_bw_20_MHz>
  1681. * <enum 3 transmit_bw_40_MHz>
  1682. * <enum 4 transmit_bw_80_MHz>
  1683. * <enum 5 transmit_bw_160_MHz>
  1684. * @nss: NSS 1,2, ...8
  1685. * @mcs: MCS index
  1686. * @preamble: preamble
  1687. * @gi: guard interval 800/400/1600/3200 ns
  1688. * @resp_type: response type
  1689. * @mprot_type: medium protection type
  1690. * @rts_success: rts success
  1691. * @rts failure: rts failure
  1692. * @channel: frequency
  1693. * @channel_num: channel number
  1694. * @ack_rssi: ack rssi
  1695. * @ldpc: ldpc
  1696. * @tx_rate: Transmission Rate
  1697. * @mac_address: peer mac address
  1698. * @bss_mac_address: bss mac address
  1699. * @ppdu_start_timestamp: TSF at PPDU start
  1700. * @ppdu_end_timestamp: TSF at PPDU end
  1701. * @ba_start_seq: Block Ack sequence number
  1702. * @ba_bitmap: Block Ack bitmap
  1703. * @ppdu_cookie: 16-bit ppdu_cookie
  1704. * @long_retries: long retries
  1705. * @short_retries: short retries
  1706. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1707. * @usr_idx: user index
  1708. */
  1709. struct cdp_tx_indication_mpdu_info {
  1710. uint32_t ppdu_id;
  1711. uint32_t tx_duration;
  1712. uint16_t frame_type;
  1713. uint16_t frame_ctrl;
  1714. uint16_t qos_ctrl;
  1715. uint8_t tid;
  1716. uint32_t num_msdu;
  1717. uint32_t seq_no;
  1718. uint32_t ltf_size:2,
  1719. he_re:1,
  1720. txbf:4,
  1721. bw:4,
  1722. nss:4,
  1723. mcs:4,
  1724. preamble:4,
  1725. gi:4;
  1726. uint32_t channel;
  1727. uint8_t channel_num;
  1728. uint32_t ack_rssi;
  1729. uint32_t ldpc;
  1730. uint32_t tx_rate;
  1731. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  1732. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  1733. uint64_t ppdu_start_timestamp;
  1734. uint64_t ppdu_end_timestamp;
  1735. uint32_t ba_start_seq;
  1736. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1737. uint16_t ppdu_cookie;
  1738. uint16_t long_retries:4,
  1739. short_retries:4,
  1740. completion_status:8;
  1741. uint16_t resp_type:4,
  1742. mprot_type:3,
  1743. rts_success:1,
  1744. rts_failure:1;
  1745. uint8_t usr_idx;
  1746. };
  1747. /**
  1748. * struct cdp_tx_indication_info - Tx capture information
  1749. * @mpdu_info: Tx MPDU completion information
  1750. * @mpdu_nbuf: reconstructed mpdu packet
  1751. * @ppdu_desc: tx completion ppdu
  1752. */
  1753. struct cdp_tx_indication_info {
  1754. struct cdp_tx_indication_mpdu_info mpdu_info;
  1755. qdf_nbuf_t mpdu_nbuf;
  1756. struct cdp_tx_completion_ppdu *ppdu_desc;
  1757. };
  1758. /**
  1759. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  1760. * @ppdu_id: ppdu_id
  1761. * @is_sgen_pkt: payload recevied from wmi or htt path
  1762. * @retries_count: retries count
  1763. * @tx_tsf: 64 bit timestamp
  1764. */
  1765. struct cdp_tx_mgmt_comp_info {
  1766. uint32_t ppdu_id;
  1767. bool is_sgen_pkt;
  1768. uint16_t retries_count;
  1769. uint64_t tx_tsf;
  1770. };
  1771. /**
  1772. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  1773. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1774. * @ppdu_id: PPDU Id
  1775. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  1776. * @vdev_id: VAP Id
  1777. * @bar_num_users: BA response user count, based on completion common TLV
  1778. * @num_users: Number of users
  1779. * @max_users: Number of users from USR_INFO TLV
  1780. * @drop_reason: drop reason from flush status
  1781. * @is_flush: is_flush is set based on flush tlv
  1782. * @flow_type: tx flow type from flush status
  1783. * @queue_type: queue type from flush status
  1784. * @num_mpdu: Number of MPDUs in PPDU
  1785. * @num_msdu: Number of MSDUs in PPDU
  1786. * @frame_type: frame SU or MU
  1787. * @htt_frame_type: frame type from htt
  1788. * @frame_ctrl: frame control of 80211 header
  1789. * @channel: Channel informartion
  1790. * @resp_type: response type
  1791. * @mprot_type: medium protection type
  1792. * @rts_success: rts success
  1793. * @rts failure: rts failure
  1794. * @phymode: phy mode
  1795. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  1796. * @tx_duration: PPDU airtime
  1797. * @ppdu_start_timestamp: TSF at PPDU start
  1798. * @ppdu_end_timestamp: TSF at PPDU end
  1799. * @ack_timestamp: TSF at the reception of ACK
  1800. * @delayed_ba: Delayed ba flag
  1801. * @beam_change: beam change bit in ppdu for he-information
  1802. * @bss_color: 6 bit value for full bss color
  1803. * @doppler: value for doppler (will be 0 most of the times)
  1804. * @spatial_reuse: value for spatial reuse used in radiotap HE header
  1805. * @usr_nss_sum: Sum of user nss
  1806. * @usr_ru_tones_sum: Sum of user ru_tones
  1807. * @bar_ppdu_id: BAR ppdu_id
  1808. * @bar_tx_duration: BAR tx duration
  1809. * @bar_ppdu_start_timestamp: BAR start timestamp
  1810. * @bar_ppdu_end_timestamp: BAR end timestamp
  1811. * @tlv_bitmap: tlv_bitmap for the PPDU
  1812. * @sched_cmdid: schedule command id
  1813. * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
  1814. * @user: per-User stats (array of per-user structures)
  1815. */
  1816. struct cdp_tx_completion_ppdu {
  1817. uint32_t ppdu_id;
  1818. uint32_t ppdu_seq_id;
  1819. uint16_t vdev_id;
  1820. uint16_t bar_num_users;
  1821. uint32_t num_users;
  1822. uint8_t max_users;
  1823. uint8_t last_usr_index;
  1824. uint32_t drop_reason;
  1825. uint32_t is_flush:1,
  1826. flow_type:8,
  1827. queue_type:8;
  1828. uint32_t num_mpdu:9,
  1829. num_msdu:16;
  1830. uint16_t frame_type;
  1831. uint16_t htt_frame_type;
  1832. uint16_t frame_ctrl;
  1833. uint16_t channel;
  1834. uint16_t resp_type:4,
  1835. mprot_type:3,
  1836. rts_success:1,
  1837. rts_failure:1;
  1838. uint16_t phy_mode;
  1839. uint32_t ack_rssi;
  1840. uint32_t tx_duration;
  1841. uint64_t ppdu_start_timestamp;
  1842. uint64_t ppdu_end_timestamp;
  1843. uint64_t ack_timestamp;
  1844. bool delayed_ba;
  1845. uint8_t beam_change;
  1846. uint8_t bss_color;
  1847. uint8_t doppler;
  1848. uint8_t spatial_reuse;
  1849. uint8_t usr_nss_sum;
  1850. uint32_t usr_ru_tones_sum;
  1851. uint32_t bar_ppdu_id;
  1852. uint32_t bar_tx_duration;
  1853. uint64_t bar_ppdu_start_timestamp;
  1854. uint64_t bar_ppdu_end_timestamp;
  1855. uint32_t tlv_bitmap;
  1856. uint16_t sched_cmdid;
  1857. uint16_t phy_ppdu_tx_time_us;
  1858. struct cdp_tx_completion_ppdu_user user[];
  1859. };
  1860. /**
  1861. * struct cdp_dev_stats - Network device stats structure
  1862. * @tx_packets: Tx total packets transmitted
  1863. * @tx_bytes : Tx total bytes transmitted
  1864. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  1865. * @tx_dropped: Tx dropped is same as tx errors as above
  1866. * @rx_packets: Rx total packets transmitted
  1867. * @rx_bytes : Rx total bytes transmitted
  1868. * @rx_errors : Rx erros
  1869. * @rx_dropped: Rx dropped stats
  1870. */
  1871. struct cdp_dev_stats {
  1872. uint32_t tx_packets;
  1873. uint32_t tx_bytes;
  1874. uint32_t tx_errors;
  1875. uint32_t tx_dropped;
  1876. uint32_t rx_packets;
  1877. uint32_t rx_bytes;
  1878. uint32_t rx_errors;
  1879. uint32_t rx_dropped;
  1880. };
  1881. /**
  1882. * struct cdp_rate_stats - Tx/Rx Rate statistics
  1883. * @bw: Indicates the BW of the upcoming transmission -
  1884. * <enum 2 transmit_bw_20_MHz>
  1885. * <enum 3 transmit_bw_40_MHz>
  1886. * <enum 4 transmit_bw_80_MHz>
  1887. * <enum 5 transmit_bw_160_MHz>
  1888. * @pkt_type: Transmit Packet Type
  1889. * @stbc: When set, STBC transmission rate was used
  1890. * @ldpc: When set, use LDPC transmission rates
  1891. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  1892. * <enum 1 0_4_us_sgi > Legacy short GI
  1893. * <enum 2 1_6_us_sgi > HE related GI
  1894. * <enum 3 3_2_us_sgi > HE
  1895. * @mcs: Transmit MCS Rate
  1896. * @ofdma: Set when the transmission was an OFDMA transmission
  1897. * @tones_in_ru: The number of tones in the RU used.
  1898. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  1899. * @peer_id: Peer ID of the flow or MPDU queue
  1900. * @tid: TID of the flow or MPDU queue
  1901. */
  1902. struct cdp_rate_stats {
  1903. uint32_t rate_stats_info_valid:1,
  1904. bw:2,
  1905. pkt_type:4,
  1906. stbc:1,
  1907. ldpc:1,
  1908. sgi:2,
  1909. mcs:4,
  1910. ofdma:1,
  1911. tones_in_ru:12,
  1912. resvd0:4;
  1913. uint32_t tsf;
  1914. uint16_t peer_id;
  1915. uint8_t tid;
  1916. };
  1917. /**
  1918. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  1919. * @ppdu_id: PPDU to which this MSDU belongs
  1920. * @transmit_cnt: Number of times this frame has been transmitted
  1921. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  1922. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  1923. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  1924. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  1925. * @extd: Extended structure containing rate statistics
  1926. */
  1927. struct cdp_tx_completion_msdu {
  1928. uint32_t ppdu_id;
  1929. uint8_t transmit_cnt;
  1930. uint32_t ack_frame_rssi:8,
  1931. resvd0:1,
  1932. first_msdu:1,
  1933. last_msdu:1,
  1934. msdu_part_of_amsdu:1,
  1935. resvd1:20;
  1936. struct cdp_rate_stats extd;
  1937. };
  1938. /**
  1939. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  1940. * @peer_id: Peer ID
  1941. * @vdev_id: VAP ID
  1942. * @is_ampdu: mpdu aggregate or non-aggregate?
  1943. * @mu_ul_info_valid: MU UL info valid
  1944. * @ofdma_ru_start_index: RU index number(0-73)
  1945. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  1946. * @nss: NSS 1,2, ...8
  1947. * @mcs: MCS index
  1948. * @user_index: user ID in multi-user case
  1949. * @is_bss_peer - is bss peer check
  1950. * @ast_index: ast index in multi-user case
  1951. * @tid: TID number
  1952. * @num_msdu: Number of MSDUs in PPDU
  1953. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  1954. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  1955. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  1956. * @frame_control: frame control field
  1957. * @frame_control_info_valid: frame_control valid
  1958. * @qos_control: qos control field
  1959. * @qos_control_info_valid: qos_control valid
  1960. * @data_sequence_control_info_valid: data_sequence_control_info valid
  1961. * @first_data_seq_ctrl: Sequence control field of first data frame
  1962. * @preamble: preamble
  1963. * @ht_flag: ht flag
  1964. * @vht_flag: vht flag
  1965. * @he_re: he_re (range extension)
  1966. * @mac_addr: Peer MAC Address
  1967. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  1968. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  1969. * @mpdu_fcs_ok_bitmap - MPDU with fcs ok bitmap
  1970. * @retries - number of retries
  1971. * @rx_ratekpbs - rx rate in kbps
  1972. */
  1973. struct cdp_rx_stats_ppdu_user {
  1974. uint16_t peer_id;
  1975. uint8_t vdev_id;
  1976. bool is_ampdu;
  1977. uint32_t mu_ul_info_valid:1,
  1978. ofdma_ru_start_index:7,
  1979. ofdma_ru_width:7,
  1980. nss:4,
  1981. mcs:4;
  1982. /* user id */
  1983. uint8_t user_index;
  1984. uint8_t is_bss_peer;
  1985. uint32_t ast_index;
  1986. uint32_t tid;
  1987. uint32_t num_msdu;
  1988. uint16_t tcp_msdu_count;
  1989. uint16_t udp_msdu_count;
  1990. uint16_t other_msdu_count;
  1991. uint16_t frame_control;
  1992. uint8_t frame_control_info_valid;
  1993. uint16_t qos_control;
  1994. uint8_t qos_control_info_valid;
  1995. uint8_t data_sequence_control_info_valid;
  1996. uint16_t first_data_seq_ctrl;
  1997. uint32_t preamble_type;
  1998. uint16_t ht_flags;
  1999. uint16_t vht_flags;
  2000. uint16_t he_flags;
  2001. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2002. uint32_t mpdu_cnt_fcs_ok;
  2003. uint32_t mpdu_cnt_fcs_err;
  2004. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  2005. uint32_t mpdu_ok_byte_count;
  2006. uint32_t mpdu_err_byte_count;
  2007. uint32_t retries;
  2008. uint32_t rx_ratekbps;
  2009. };
  2010. /**
  2011. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  2012. * @ppdu_id: PPDU Id
  2013. * @is_ampdu: mpdu aggregate or non-aggregate?
  2014. * @num_mpdu: Number of MPDUs in PPDU
  2015. * @reserved: Reserved bits for future use
  2016. * @num_msdu: Number of MSDUs in PPDU
  2017. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2018. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2019. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2020. * @duration: PPDU duration
  2021. * @tid: TID number
  2022. * @peer_id: Peer ID
  2023. * @vdev_id: VAP ID
  2024. * @mac_addr: Peer MAC Address
  2025. * @first_data_seq_ctrl: Sequence control field of first data frame
  2026. * @ltf_size: ltf_size
  2027. * @stbc: When set, STBC rate was used
  2028. * @he_re: he_re (range extension)
  2029. * @bw: Bandwidth
  2030. * <enum 0 bw_20_MHz>
  2031. * <enum 1 bw_40_MHz>
  2032. * <enum 2 bw_80_MHz>
  2033. * <enum 3 bw_160_MHz>
  2034. * @nss: NSS 1,2, ...8
  2035. * @mcs: MCS index
  2036. * @preamble: preamble
  2037. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  2038. * <enum 1 0_4_us_sgi > Legacy short GI
  2039. * <enum 2 1_6_us_sgi > HE related GI
  2040. * <enum 3 3_2_us_sgi > HE
  2041. * @dcm: dcm
  2042. * @ldpc: ldpc
  2043. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  2044. * UL_BSR_TRIG/UNKNOWN
  2045. * @rssi: RSSI value (units = dB above noise floor)
  2046. * @timestamp: TSF at the reception of PPDU
  2047. * @length: PPDU length
  2048. * @channel: Channel informartion
  2049. * @lsig_A: L-SIG in 802.11 PHY header
  2050. * @frame_ctrl: frame control field
  2051. * @rix: rate index
  2052. * @rssi_chain: rssi chain per nss per bw
  2053. * @cookie: cookie to used by upper layer
  2054. * @user: per user stats in MU-user case
  2055. * @nf: noise floor
  2056. * @per_chain_rssi: rssi per antenna
  2057. */
  2058. struct cdp_rx_indication_ppdu {
  2059. uint32_t ppdu_id;
  2060. uint16_t is_ampdu:1,
  2061. num_mpdu:9,
  2062. reserved:6;
  2063. uint32_t num_msdu;
  2064. uint32_t num_bytes;
  2065. uint16_t udp_msdu_count;
  2066. uint16_t tcp_msdu_count;
  2067. uint16_t other_msdu_count;
  2068. uint16_t duration;
  2069. uint32_t tid:8,
  2070. peer_id:16;
  2071. uint8_t vdev_id;
  2072. uint8_t mac_addr[6];
  2073. uint16_t first_data_seq_ctrl;
  2074. union {
  2075. uint32_t rate_info;
  2076. struct {
  2077. uint32_t ltf_size:2,
  2078. stbc:1,
  2079. he_re:1,
  2080. bw:4,
  2081. nss:4,
  2082. mcs:4,
  2083. preamble:4,
  2084. gi:4,
  2085. dcm:1,
  2086. ldpc:1,
  2087. ppdu_type:5;
  2088. };
  2089. } u;
  2090. uint32_t rix;
  2091. uint32_t lsig_a;
  2092. uint32_t rssi;
  2093. uint64_t timestamp;
  2094. uint32_t length;
  2095. uint8_t channel;
  2096. uint8_t beamformed;
  2097. uint32_t rx_ratekbps;
  2098. uint32_t ppdu_rx_rate;
  2099. uint32_t retries;
  2100. uint32_t rx_byte_count;
  2101. uint16_t rx_ratecode;
  2102. uint8_t fcs_error_mpdus;
  2103. uint16_t frame_ctrl;
  2104. int8_t rssi_chain[SS_COUNT][MAX_BW];
  2105. struct cdp_rx_su_evm_info evm_info;
  2106. uint32_t rx_antenna;
  2107. uint8_t num_users;
  2108. struct cdp_rx_stats_ppdu_user user[CDP_MU_MAX_USERS];
  2109. uint32_t nf;
  2110. uint8_t per_chain_rssi[MAX_CHAIN];
  2111. uint8_t is_mcast_bcast;
  2112. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2113. struct cdp_rx_ppdu_cfr_info cfr_info;
  2114. #endif
  2115. };
  2116. /**
  2117. * struct cdp_rx_indication_msdu - Rx MSDU info
  2118. * @ppdu_id: PPDU to which the MSDU belongs
  2119. * @msdu_len: Length of MSDU in bytes
  2120. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2121. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2122. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2123. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  2124. * @extd: Extended structure containing rate statistics
  2125. */
  2126. struct cdp_rx_indication_msdu {
  2127. uint32_t ppdu_id;
  2128. uint16_t msdu_len;
  2129. uint32_t ack_frame_rssi:8,
  2130. resvd0:1,
  2131. first_msdu:1,
  2132. last_msdu:1,
  2133. msdu_part_of_amsdu:1,
  2134. msdu_part_of_ampdu:1,
  2135. resvd1:19;
  2136. struct cdp_rate_stats extd;
  2137. };
  2138. /**
  2139. * struct cdp_config_params - Propagate configuration parameters to datapath
  2140. * @tso_enable: Enable/Disable TSO
  2141. * @lro_enable: Enable/Disable LRO
  2142. * @gro_enable: Enable/Disable GRO
  2143. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  2144. * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
  2145. * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
  2146. * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
  2147. * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
  2148. * legacy modes.
  2149. * @napi_enable: Enable/Disable Napi
  2150. * @ipa_enable: Flag indicating if IPA is enabled or not
  2151. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  2152. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  2153. * tx queue
  2154. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  2155. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  2156. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  2157. */
  2158. struct cdp_config_params {
  2159. unsigned int tso_enable:1;
  2160. unsigned int lro_enable:1;
  2161. unsigned int gro_enable:1;
  2162. unsigned int flow_steering_enable:1;
  2163. unsigned int p2p_tcp_udp_checksumoffload:1;
  2164. unsigned int nan_tcp_udp_checksumoffload:1;
  2165. unsigned int tcp_udp_checksumoffload:1;
  2166. unsigned int legacy_mode_checksumoffload_disable:1;
  2167. unsigned int napi_enable:1;
  2168. unsigned int ipa_enable:1;
  2169. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  2170. uint8_t tx_flow_stop_queue_threshold;
  2171. uint8_t tx_flow_start_queue_offset;
  2172. uint32_t tx_comp_loop_pkt_limit;
  2173. uint32_t rx_reap_loop_pkt_limit;
  2174. uint32_t rx_hp_oos_update_limit;
  2175. };
  2176. /**
  2177. * cdp_txrx_stats_req: stats request wrapper
  2178. * used to pass request information to cdp layer
  2179. * @stats: type of stats requested
  2180. * @param0: opaque argument 0 to be passed to htt
  2181. * @param1: opaque argument 1 to be passed to htt
  2182. * @param2: opaque argument 2 to be passed to htt
  2183. * @param3: opaque argument 3 to be passed to htt
  2184. * @mac id: mac_id
  2185. */
  2186. struct cdp_txrx_stats_req {
  2187. enum cdp_stats stats;
  2188. uint32_t param0;
  2189. uint32_t param1;
  2190. uint32_t param2;
  2191. uint32_t param3;
  2192. uint32_t cookie_val;
  2193. uint8_t mac_id;
  2194. char *peer_addr;
  2195. };
  2196. /**
  2197. * struct cdp_monitor_filter - monitor filter info
  2198. * @mode: set filter mode
  2199. * @fp_mgmt: set Filter Pass MGMT Configuration
  2200. * @fp_ctrl: set Filter Pass CTRL Configuration
  2201. * @fp_data: set Filter Pass DATA Configuration
  2202. * @mo_mgmt: set Monitor Other MGMT Configuration
  2203. * @mo_ctrl: set Monitor Other CTRL Configuration
  2204. * @mo_data: set Monitor other DATA Configuration
  2205. *
  2206. */
  2207. struct cdp_monitor_filter {
  2208. uint16_t mode;
  2209. uint16_t fp_mgmt;
  2210. uint16_t fp_ctrl;
  2211. uint16_t fp_data;
  2212. uint16_t mo_mgmt;
  2213. uint16_t mo_ctrl;
  2214. uint16_t mo_data;
  2215. };
  2216. /**
  2217. * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
  2218. * @cfg_dp_enable_data_stall: context passed to be used by consumer
  2219. * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
  2220. * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
  2221. * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
  2222. * @cfg_dp_tso_enable: get TSO enable config
  2223. * @cfg_dp_lro_enable: get LRO enable config
  2224. * @cfg_dp_gro_enable: get GRP enable config
  2225. * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
  2226. * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
  2227. * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
  2228. * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
  2229. * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
  2230. * @cfg_dp_enable_flow_steering: get flow steerint enable config
  2231. * @cfg_dp_reorder_offload_supported: get reorder offload support config
  2232. * @cfg_dp_ce_classify_enable: get CE classify enable config
  2233. * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
  2234. * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
  2235. * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
  2236. */
  2237. enum cdp_dp_cfg {
  2238. cfg_dp_enable_data_stall,
  2239. cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
  2240. cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
  2241. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  2242. /* Disable checksum offload for legacy modes */
  2243. cfg_dp_disable_legacy_mode_csum_offload,
  2244. cfg_dp_tso_enable,
  2245. cfg_dp_lro_enable,
  2246. cfg_dp_gro_enable,
  2247. cfg_dp_sg_enable,
  2248. cfg_dp_tx_flow_start_queue_offset,
  2249. cfg_dp_tx_flow_stop_queue_threshold,
  2250. cfg_dp_ipa_uc_tx_buf_size,
  2251. cfg_dp_ipa_uc_tx_partition_base,
  2252. cfg_dp_ipa_uc_rx_ind_ring_count,
  2253. cfg_dp_enable_flow_steering,
  2254. cfg_dp_reorder_offload_supported,
  2255. cfg_dp_ce_classify_enable,
  2256. cfg_dp_disable_intra_bss_fwd,
  2257. cfg_dp_pktlog_buffer_size,
  2258. cfg_dp_wow_check_rx_pending,
  2259. };
  2260. /**
  2261. * struct cdp_peer_cookie - cookie used when creating peer
  2262. * @ctx: context passed to be used by consumer
  2263. * @mac_addr: MAC address of peer
  2264. * @peer_id: peer id
  2265. * @pdev_id: pdev_id
  2266. * @cookie: cookie to be used by consumer
  2267. */
  2268. struct cdp_peer_cookie {
  2269. struct cdp_stats_cookie *ctx;
  2270. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2271. uint8_t peer_id;
  2272. uint8_t pdev_id;
  2273. uint8_t cookie;
  2274. };
  2275. #ifdef WLAN_SUPPORT_RX_FISA
  2276. struct cdp_flow_stats {
  2277. uint32_t aggr_count;
  2278. uint32_t curr_aggr_count;
  2279. uint32_t flush_count;
  2280. uint32_t bytes_aggregated;
  2281. };
  2282. #else
  2283. /**
  2284. * cdp_flow_stats - Per-Flow (5-tuple) statistics
  2285. * @msdu_count: number of rx msdus matching this flow
  2286. *
  2287. * HW also includes msdu_byte_count and timestamp, which
  2288. * are not currently tracked in SW.
  2289. */
  2290. struct cdp_flow_stats {
  2291. uint32_t msdu_count;
  2292. };
  2293. #endif
  2294. /**
  2295. * cdp_flow_fst_operation - RX FST operations allowed
  2296. */
  2297. enum cdp_flow_fst_operation {
  2298. CDP_FLOW_FST_ENTRY_ADD,
  2299. CDP_FLOW_FST_ENTRY_DEL,
  2300. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  2301. CDP_FLOW_FST_RX_BYPASS_DISABLE
  2302. };
  2303. /**
  2304. * cdp_flow_protocol_type - RX FST supported protocol types, mapped to HW spec
  2305. */
  2306. enum cdp_flow_protocol_type {
  2307. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  2308. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  2309. };
  2310. /**
  2311. * cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  2312. * @dest_ip_127_96: destination IP address bit fields 96-127
  2313. * @dest_ip_95_64: destination IP address bit fields 64-95
  2314. * @dest_ip_63_32: destination IP address bit fields 32-63
  2315. * @dest_ip_31_0: destination IP address bit fields 0-31
  2316. * @src_ip_127_96: source IP address bit fields 96-127
  2317. * @src_ip_95_64: source IP address bit fields 64-95
  2318. * @src_ip_63_32: source IP address bit fields 32-63
  2319. * @src_ip_31_0: source IP address bit fields 0-31
  2320. * @dest_port: destination port of flow
  2321. * @src_port: source port of flow
  2322. * @l4_protocol: protocol type in flow (TCP/UDP)
  2323. */
  2324. struct cdp_rx_flow_tuple_info {
  2325. #ifdef WLAN_SUPPORT_RX_FISA
  2326. uint8_t tuple_populated;
  2327. uint8_t is_exception;
  2328. #endif
  2329. uint32_t dest_ip_127_96;
  2330. uint32_t dest_ip_95_64;
  2331. uint32_t dest_ip_63_32;
  2332. uint32_t dest_ip_31_0;
  2333. uint32_t src_ip_127_96;
  2334. uint32_t src_ip_95_64;
  2335. uint32_t src_ip_63_32;
  2336. uint32_t src_ip_31_0;
  2337. uint16_t dest_port;
  2338. uint16_t src_port;
  2339. uint16_t l4_protocol;
  2340. };
  2341. /**
  2342. * cdp_rx_flow_info - RX flow info used for addition/deletion
  2343. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  2344. * @op_code: add/delete/enable/disable operation requested
  2345. * @flow_tupe_info: structure containing tuple info
  2346. * @fse_metadata: metadata to be set in RX flow
  2347. */
  2348. struct cdp_rx_flow_info {
  2349. bool is_addr_ipv4;
  2350. enum cdp_flow_fst_operation op_code;
  2351. struct cdp_rx_flow_tuple_info flow_tuple_info;
  2352. uint16_t fse_metadata;
  2353. };
  2354. #endif