cdp_txrx_ops.h 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_ops.h
  21. * Define the host data path converged API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_CMN_OPS_H_
  25. #define _CDP_TXRX_CMN_OPS_H_
  26. #include <cdp_txrx_cmn_struct.h>
  27. #include <cdp_txrx_stats_struct.h>
  28. #include "cdp_txrx_handle.h"
  29. #include <cdp_txrx_mon_struct.h>
  30. #include "wlan_objmgr_psoc_obj.h"
  31. #include <wmi_unified_api.h>
  32. #include <wdi_event_api.h>
  33. #ifdef IPA_OFFLOAD
  34. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \
  35. defined(CONFIG_IPA_WDI_UNIFIED_API)
  36. #include <qdf_ipa_wdi3.h>
  37. #else
  38. #include <qdf_ipa.h>
  39. #endif
  40. #endif
  41. /*
  42. * bitmap values to indicate special handling of peer_delete
  43. */
  44. #define CDP_PEER_DELETE_NO_SPECIAL 0
  45. #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1
  46. struct hif_opaque_softc;
  47. /*
  48. * cdp_ctrl_mlo_mgr - opaque handle for mlo manager context
  49. */
  50. struct cdp_ctrl_mlo_mgr;
  51. /* same as ieee80211_nac_param */
  52. enum cdp_nac_param_cmd {
  53. /* IEEE80211_NAC_PARAM_ADD */
  54. CDP_NAC_PARAM_ADD = 1,
  55. /* IEEE80211_NAC_PARAM_DEL */
  56. CDP_NAC_PARAM_DEL,
  57. /* IEEE80211_NAC_PARAM_LIST */
  58. CDP_NAC_PARAM_LIST,
  59. };
  60. /**
  61. * enum cdp_tx_filter_action - TX peer filtering action
  62. * @CDP_TX_FILTER_ACTION_ADD: add peer mac address
  63. * @CDP_TX_FILTER_ACTION_DEL: delete peer mac address
  64. * @CDP_TX_FILTER_ACTION_ENABLE_FILTERING: Enable Tx peer filtering
  65. * @CDP_TX_FILTER_ACTION_CLEAR_FILTERING: Clear Tx peer filtering
  66. */
  67. enum cdp_tx_filter_action {
  68. CDP_TX_FILTER_ACTION_ADD = 1,
  69. CDP_TX_FILTER_ACTION_DEL,
  70. CDP_TX_FILTER_ACTION_ENABLE_FILTERING,
  71. CDP_TX_FILTER_ACTION_CLEAR_FILTERING,
  72. };
  73. #define CDP_DELBA_INTERVAL_MS 3000
  74. /**
  75. * enum cdp_delba_rcode - CDP reason code for sending DELBA
  76. * @CDP_DELBA_REASON_NONE: None
  77. * @CDP_DELBA_2K_JUMP: Sending DELBA from 2k_jump_handle
  78. */
  79. enum cdp_delba_rcode {
  80. CDP_DELBA_REASON_NONE = 0,
  81. CDP_DELBA_2K_JUMP,
  82. };
  83. /**
  84. * enum vdev_peer_protocol_enter_exit - whether ingress or egress
  85. * @CDP_VDEV_PEER_PROTOCOL_IS_INGRESS: ingress
  86. * @CDP_VDEV_PEER_PROTOCOL_IS_EGRESS: egress
  87. *
  88. * whether ingress or egress
  89. */
  90. enum vdev_peer_protocol_enter_exit {
  91. CDP_VDEV_PEER_PROTOCOL_IS_INGRESS,
  92. CDP_VDEV_PEER_PROTOCOL_IS_EGRESS
  93. };
  94. /**
  95. * enum vdev_peer_protocol_tx_rx - whether tx or rx
  96. * @CDP_VDEV_PEER_PROTOCOL_IS_TX: tx
  97. * @CDP_VDEV_PEER_PROTOCOL_IS_RX: rx
  98. *
  99. * whether tx or rx
  100. */
  101. enum vdev_peer_protocol_tx_rx {
  102. CDP_VDEV_PEER_PROTOCOL_IS_TX,
  103. CDP_VDEV_PEER_PROTOCOL_IS_RX
  104. };
  105. /**
  106. * enum vdev_ll_conn_actions - Actions to informvdev about
  107. * low latency connection.
  108. * @CDP_VDEV_LL_CONN_ADD: Add Low latency connection
  109. * @CDP_VDEV_LL_CONN_DEL: Delete Low latency connection
  110. */
  111. enum vdev_ll_conn_actions {
  112. CDP_VDEV_LL_CONN_ADD,
  113. CDP_VDEV_LL_CONN_DEL
  114. };
  115. /**
  116. * enum cdp_peer_txq_flush_policy: Values for peer TX TID queues flush policy
  117. * @CDP_PEER_TXQ_FLUSH_POLICY_NONE: No flush policy configured
  118. * @CDP_PEER_TXQ_FLUSH_POLICY_IMMEDIATE: Flush peer TX TID queue(s) immediately
  119. * @CDP_PEER_TXQ_FLUSH_POLICY_TWT_SP_END: Flush peer TX TID queue(s) at SP end
  120. * @CDP_PEER_TXQ_FLUSH_POLICY_INVALID: Invalid policy
  121. *
  122. * This is used to map the 'flush_policy' in WMI_PEER_FLUSH_POLICY_CMDID
  123. */
  124. enum cdp_peer_txq_flush_policy {
  125. CDP_PEER_TXQ_FLUSH_POLICY_NONE = 0,
  126. CDP_PEER_TXQ_FLUSH_POLICY_IMMEDIATE = 1,
  127. CDP_PEER_TXQ_FLUSH_POLICY_TWT_SP_END = 2,
  128. /* keep last */
  129. CDP_PEER_TXQ_FLUSH_POLICY_INVALID,
  130. };
  131. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  132. /**
  133. * struct cdp_mlo_ops - MLO ops for multichip
  134. * @mlo_soc_setup: setup DP mlo for SOC
  135. * @mlo_soc_teardown: teardown DP mlo for SOC
  136. * @update_mlo_ptnr_list:
  137. * @clear_mlo_ptnr_list:
  138. * @mlo_setup_complete: indication to DP that all SOCs mlo is setup
  139. * @mlo_update_delta_tsf2: update delta tsf2 for link
  140. * @mlo_update_delta_tqm: update delta tqm for SOC
  141. * @mlo_update_mlo_ts_offset: update MLO timestamp offset for SOC
  142. * @mlo_ctxt_attach: Attach DP MLO context
  143. * @mlo_ctxt_detach: Detach DP MLO context
  144. */
  145. struct cdp_mlo_ops {
  146. void (*mlo_soc_setup)(struct cdp_soc_t *cdp_soc,
  147. struct cdp_mlo_ctxt *mlo_ctxt);
  148. void (*mlo_soc_teardown)(struct cdp_soc_t *cdp_soc,
  149. struct cdp_mlo_ctxt *mlo_ctxt,
  150. bool is_force_down);
  151. QDF_STATUS (*update_mlo_ptnr_list)(struct cdp_soc_t *soc_hdl,
  152. int8_t *vdev_ids, uint8_t num_vdevs,
  153. uint8_t vdev_id);
  154. QDF_STATUS (*clear_mlo_ptnr_list)(struct cdp_soc_t *soc_hdl,
  155. uint8_t vdev_id);
  156. void (*mlo_setup_complete)(struct cdp_mlo_ctxt *mlo_ctxt);
  157. struct cdp_mlo_ctxt *(*mlo_ctxt_attach)(struct cdp_ctrl_mlo_mgr *m_ctx);
  158. void (*mlo_ctxt_detach)(struct cdp_mlo_ctxt *mlo_ctxt);
  159. void (*mlo_update_delta_tsf2)(struct cdp_soc_t *soc_hdl,
  160. uint8_t pdev_id,
  161. uint64_t delta_tsf2);
  162. void (*mlo_update_delta_tqm)(struct cdp_soc_t *soc_hdl,
  163. uint64_t delta_tqm);
  164. void (*mlo_update_mlo_ts_offset)(struct cdp_soc_t *soc_hdl,
  165. uint64_t offset);
  166. };
  167. #endif
  168. /******************************************************************************
  169. *
  170. * Control Interface (A Interface)
  171. *
  172. *****************************************************************************/
  173. struct cdp_cmn_ops {
  174. QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
  175. int (*txrx_pdev_attach_target)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  176. QDF_STATUS (*txrx_vdev_attach)
  177. (struct cdp_soc_t *soc, uint8_t pdev_id,
  178. struct cdp_vdev_info *vdev_info);
  179. QDF_STATUS
  180. (*txrx_vdev_detach)(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
  181. ol_txrx_vdev_delete_cb callback,
  182. void *cb_context);
  183. QDF_STATUS (*txrx_pdev_attach)
  184. (ol_txrx_soc_handle soc,
  185. struct cdp_pdev_attach_params *params);
  186. int (*txrx_pdev_post_attach)(struct cdp_soc_t *soc, uint8_t pdev_id);
  187. void
  188. (*txrx_pdev_pre_detach)(struct cdp_soc_t *soc, uint8_t pdev_id,
  189. int force);
  190. QDF_STATUS
  191. (*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id,
  192. int force);
  193. /**
  194. * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory
  195. * @soc: soc dp handle
  196. * @pdev_id: id of Dp pdev handle
  197. * @force: Force deinit or not
  198. *
  199. * Return: QDF_STATUS
  200. */
  201. QDF_STATUS
  202. (*txrx_pdev_deinit)(struct cdp_soc_t *soc, uint8_t pdev_id,
  203. int force);
  204. QDF_STATUS
  205. (*txrx_peer_create)
  206. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  207. uint8_t *peer_mac_addr, enum cdp_peer_type peer_type);
  208. QDF_STATUS
  209. (*txrx_peer_setup)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  210. uint8_t *peer_mac,
  211. struct cdp_peer_setup_info *setup_info);
  212. QDF_STATUS
  213. (*txrx_cp_peer_del_response)
  214. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  215. uint8_t *peer_mac_addr);
  216. QDF_STATUS
  217. (*txrx_peer_teardown)
  218. (struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac);
  219. int (*txrx_peer_add_ast)
  220. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  221. uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type,
  222. uint32_t flags);
  223. int (*txrx_peer_update_ast)
  224. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  225. uint8_t *mac_addr, uint32_t flags);
  226. bool (*txrx_peer_get_ast_info_by_soc)
  227. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  228. struct cdp_ast_entry_info *ast_entry_info);
  229. bool (*txrx_peer_get_ast_info_by_pdev)
  230. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  231. uint8_t pdev_id,
  232. struct cdp_ast_entry_info *ast_entry_info);
  233. QDF_STATUS (*txrx_peer_ast_delete_by_soc)
  234. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  235. txrx_ast_free_cb callback,
  236. void *cookie);
  237. QDF_STATUS (*txrx_peer_ast_delete_by_pdev)
  238. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  239. uint8_t pdev_id,
  240. txrx_ast_free_cb callback,
  241. void *cookie);
  242. QDF_STATUS (*txrx_peer_HMWDS_ast_delete)
  243. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *dest_mac,
  244. uint8_t type, uint8_t delete_in_fw);
  245. QDF_STATUS
  246. (*txrx_peer_delete)(struct cdp_soc_t *soc, uint8_t vdev_id,
  247. uint8_t *peer_mac, uint32_t bitmap,
  248. enum cdp_peer_type peer_type);
  249. QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc,
  250. uint8_t vdev_id,
  251. uint8_t smart_monitor);
  252. void (*txrx_peer_delete_sync)(struct cdp_soc_t *soc, uint8_t vdev_id,
  253. uint8_t *peer_mac,
  254. QDF_STATUS(*delete_cb)(
  255. uint8_t vdev_id,
  256. uint32_t peerid_cnt,
  257. uint16_t *peerid_list),
  258. uint32_t bitmap);
  259. void (*txrx_peer_unmap_sync_cb_set)(struct cdp_soc_t *soc_hdl,
  260. uint8_t pdev_id,
  261. ol_txrx_peer_unmap_sync_cb
  262. peer_unmap_sync);
  263. QDF_STATUS
  264. (*txrx_get_peer_mac_from_peer_id)
  265. (struct cdp_soc_t *cdp_soc,
  266. uint32_t peer_id, uint8_t *peer_mac);
  267. void
  268. (*txrx_vdev_tx_lock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  269. void
  270. (*txrx_vdev_tx_unlock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  271. QDF_STATUS
  272. (*txrx_ath_getstats)(struct cdp_soc_t *soc, uint8_t id,
  273. struct cdp_dev_stats *stats, uint8_t type);
  274. QDF_STATUS
  275. (*txrx_set_gid_flag)(struct cdp_soc_t *soc, uint8_t pdev_id,
  276. u_int8_t *mem_status,
  277. u_int8_t *user_position);
  278. uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_soc_t *soc,
  279. uint8_t pdev_id);
  280. QDF_STATUS
  281. (*txrx_if_mgmt_drain)(struct cdp_soc_t *soc, uint8_t pdev_id,
  282. int force);
  283. QDF_STATUS
  284. (*txrx_set_curchan)(struct cdp_soc_t *soc, uint8_t pdev_id,
  285. uint32_t chan_mhz);
  286. QDF_STATUS
  287. (*txrx_set_privacy_filters)
  288. (struct cdp_soc_t *soc, uint8_t vdev_id, void *filter,
  289. uint32_t num);
  290. uint32_t (*txrx_get_cfg)(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg);
  291. /********************************************************************
  292. * Data Interface (B Interface)
  293. ********************************************************************/
  294. QDF_STATUS
  295. (*txrx_vdev_register)(struct cdp_soc_t *soc, uint8_t vdev_id,
  296. ol_osif_vdev_handle osif_vdev,
  297. struct ol_txrx_ops *txrx_ops);
  298. int (*txrx_mgmt_send)(struct cdp_soc_t *soc, uint8_t vdev_id,
  299. qdf_nbuf_t tx_mgmt_frm, uint8_t type);
  300. int (*txrx_mgmt_send_ext)(struct cdp_soc_t *soc, uint8_t vdev_id,
  301. qdf_nbuf_t tx_mgmt_frm, uint8_t type,
  302. uint8_t use_6mbps, uint16_t chanfreq);
  303. /**
  304. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  305. * callback function
  306. */
  307. QDF_STATUS
  308. (*txrx_mgmt_tx_cb_set)(struct cdp_soc_t *soc, uint8_t pdev_id,
  309. uint8_t type,
  310. ol_txrx_mgmt_tx_cb download_cb,
  311. ol_txrx_mgmt_tx_cb ota_ack_cb,
  312. void *ctxt);
  313. /**
  314. * ol_txrx_data_tx_cb - Function registered with the data path
  315. * that is called when tx frames marked as "no free" are
  316. * done being transmitted
  317. */
  318. void (*txrx_data_tx_cb_set)(struct cdp_soc_t *soc, uint8_t vdev_id,
  319. ol_txrx_data_tx_cb callback, void *ctxt);
  320. qdf_nbuf_t (*tx_send_exc)
  321. (ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t msdu_list,
  322. struct cdp_tx_exception_metadata *tx_exc_metadata);
  323. /*******************************************************************
  324. * Statistics and Debugging Interface (C Interface)
  325. ********************************************************************/
  326. int (*txrx_aggr_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  327. int max_subfrms_ampdu,
  328. int max_subfrms_amsdu);
  329. A_STATUS
  330. (*txrx_fw_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  331. struct ol_txrx_stats_req *req,
  332. bool per_vdev, bool response_expected);
  333. int (*txrx_debug)(struct cdp_soc_t *soc, uint8_t vdev_id,
  334. int debug_specs);
  335. QDF_STATUS
  336. (*txrx_fw_stats_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  337. uint8_t cfg_stats_type, uint32_t cfg_val);
  338. void (*txrx_print_level_set)(unsigned level);
  339. /**
  340. * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
  341. * @soc: datapath soc handle
  342. * @vdev_id: vdev id
  343. *
  344. * Return: vdev mac address
  345. */
  346. uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_soc_t *soc,
  347. uint8_t vdev_id);
  348. /**
  349. * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  350. * @soc: datapath soc handle
  351. * @vdev_id: vdev id
  352. *
  353. * Return: Handle to control pdev
  354. */
  355. struct cdp_cfg *(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_soc_t *soc,
  356. uint8_t vdev_id);
  357. /**
  358. * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
  359. * @soc: datapath soc handle
  360. * @pdev: pdev id
  361. *
  362. * Return: vdev_id
  363. */
  364. uint8_t (*txrx_get_mon_vdev_from_pdev)(struct cdp_soc_t *soc,
  365. uint8_t pdev_id);
  366. void (*txrx_soc_detach)(struct cdp_soc_t *soc);
  367. /**
  368. * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory
  369. * @soc: Opaque Dp handle
  370. *
  371. * Return None
  372. */
  373. void (*txrx_soc_deinit)(struct cdp_soc_t *soc);
  374. /**
  375. * txrx_soc_init() - Initialize dp soc and dp ring memory
  376. * @soc: Opaque Dp handle
  377. * @ctrl_psoc: Opaque Cp handle
  378. * @htchdl: Opaque htc handle
  379. * @hifhdl: Opaque hif handle
  380. *
  381. * Return: None
  382. */
  383. void *(*txrx_soc_init)(struct cdp_soc_t *soc,
  384. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  385. struct hif_opaque_softc *hif_handle,
  386. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  387. struct ol_if_ops *ol_ops, uint16_t device_id);
  388. QDF_STATUS (*txrx_pdev_init)(ol_txrx_soc_handle soc,
  389. HTC_HANDLE htc_handle,
  390. qdf_device_t qdf_osdev,
  391. uint8_t pdev_id);
  392. /**
  393. * txrx_tso_soc_attach() - TSO attach handler triggered during
  394. * dynamic tso activation
  395. * @soc: Opaque Dp handle
  396. *
  397. * Return: QDF status
  398. */
  399. QDF_STATUS (*txrx_tso_soc_attach)(struct cdp_soc_t *soc);
  400. /**
  401. * txrx_tso_soc_detach() - TSO detach handler triggered during
  402. * dynamic tso de-activation
  403. * @soc: Opaque Dp handle
  404. *
  405. * Return: QDF status
  406. */
  407. QDF_STATUS (*txrx_tso_soc_detach)(struct cdp_soc_t *soc);
  408. int (*addba_resp_tx_completion)(struct cdp_soc_t *cdp_soc,
  409. uint8_t *peer_mac,
  410. uint16_t vdev_id, uint8_t tid,
  411. int status);
  412. int (*addba_requestprocess)(struct cdp_soc_t *cdp_soc,
  413. uint8_t *peer_mac,
  414. uint16_t vdev_id,
  415. uint8_t dialogtoken,
  416. uint16_t tid, uint16_t batimeout,
  417. uint16_t buffersize,
  418. uint16_t startseqnum);
  419. QDF_STATUS
  420. (*addba_responsesetup)(struct cdp_soc_t *cdp_soc,
  421. uint8_t *peer_mac,
  422. uint16_t vdev_id, uint8_t tid,
  423. uint8_t *dialogtoken, uint16_t *statuscode,
  424. uint16_t *buffersize, uint16_t *batimeout);
  425. int (*delba_process)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  426. uint16_t vdev_id, int tid, uint16_t reasoncode);
  427. QDF_STATUS (*tid_update_ba_win_size)(ol_txrx_soc_handle soc,
  428. uint8_t *peer_mac,
  429. uint16_t vdev_id, uint8_t tid,
  430. uint16_t buffersize);
  431. /**
  432. * delba_tx_completion() - Indicate delba tx status
  433. * @cdp_soc: soc handle
  434. * @peer_mac: Peer mac address
  435. * @vdev_id: vdev id
  436. * @tid: Tid number
  437. * @status: Tx completion status
  438. *
  439. * Return: 0 on Success, 1 on failure
  440. */
  441. int (*delba_tx_completion)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  442. uint16_t vdev_id,
  443. uint8_t tid, int status);
  444. QDF_STATUS
  445. (*set_addba_response)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  446. uint16_t vdev_id, uint8_t tid,
  447. uint16_t statuscode);
  448. QDF_STATUS
  449. (*set_vdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  450. uint8_t vdev_id, uint8_t map_id);
  451. int (*txrx_get_total_per)(struct cdp_soc_t *soc, uint8_t pdev_id);
  452. void (*flush_cache_rx_queue)(void);
  453. QDF_STATUS (*set_pdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  454. uint8_t pdev_id,
  455. uint8_t map_id,
  456. uint8_t tos, uint8_t tid);
  457. QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle,
  458. uint8_t vdev_id,
  459. struct cdp_txrx_stats_req *req);
  460. QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value,
  461. enum qdf_stats_verbosity_level level);
  462. /**
  463. * notify_asserted_soc() - Notified asserted soc info to UMAC Reset
  464. * @cdp_soc: soc handle
  465. *
  466. * Return: QDF_STATUS
  467. */
  468. QDF_STATUS (*notify_asserted_soc)(struct cdp_soc_t *psoc);
  469. QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle);
  470. void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle);
  471. void (*txrx_ppeds_stop)(struct cdp_soc_t *soc_handle);
  472. QDF_STATUS (*set_pn_check)(struct cdp_soc_t *soc_handle,
  473. uint8_t vdev_id, uint8_t *peermac,
  474. enum cdp_sec_type sec_type,
  475. uint32_t *rx_pn);
  476. QDF_STATUS(*set_key_sec_type)(struct cdp_soc_t *soc_handle,
  477. uint8_t vdev_id, uint8_t *peermac,
  478. enum cdp_sec_type sec_type,
  479. bool is_unicast);
  480. QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
  481. struct cdp_config_params *params);
  482. void *(*get_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  483. void (*set_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  484. void *dp_hdl);
  485. void *(*get_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
  486. uint8_t vdev_id);
  487. QDF_STATUS (*set_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
  488. uint8_t vdev_id,
  489. uint16_t size);
  490. void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
  491. void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
  492. void *dp_txrx_handle);
  493. QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  494. uint32_t lmac_id);
  495. QDF_STATUS (*handle_mode_change)(ol_txrx_soc_handle soc,
  496. uint8_t pdev_id, uint32_t lmac_id);
  497. QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
  498. uint8_t pdev_id, bool is_pdev_down);
  499. QDF_STATUS (*txrx_peer_reset_ast)
  500. (ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
  501. uint8_t *peer_macaddr, uint8_t vdev_id);
  502. QDF_STATUS (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
  503. uint8_t vdev_id);
  504. void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
  505. void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  506. uint8_t ac, uint32_t value);
  507. void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  508. uint8_t ac, uint32_t *value);
  509. QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
  510. uint32_t num_peers,
  511. uint32_t max_ast_index,
  512. uint8_t peer_map_unmap_v);
  513. QDF_STATUS (*set_soc_param)(ol_txrx_soc_handle soc,
  514. enum cdp_soc_param_t param,
  515. uint32_t value);
  516. ol_txrx_tx_fp tx_send;
  517. /* tx_fast_send will be called only in AP mode when all the
  518. * transmit path features are disabled including extended stats
  519. */
  520. ol_txrx_tx_fast_fp tx_fast_send;
  521. void (*set_tx_pause)(ol_txrx_soc_handle soc, bool flag);
  522. /**
  523. * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
  524. * to deliver pkt to stack.
  525. * @soc: datapath soc handle
  526. * @vdev: vdev id
  527. * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
  528. * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
  529. */
  530. void (*txrx_get_os_rx_handles_from_vdev)
  531. (ol_txrx_soc_handle soc,
  532. uint8_t vdev_id,
  533. ol_txrx_rx_fp *stack_fn,
  534. ol_osif_vdev_handle *osif_vdev);
  535. void (*set_rate_stats_ctx)(struct cdp_soc_t *soc,
  536. void *ctx);
  537. int (*txrx_classify_update)
  538. (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb,
  539. enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
  540. bool (*get_dp_capabilities)(struct cdp_soc_t *soc,
  541. enum cdp_capabilities dp_caps);
  542. void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc);
  543. QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc,
  544. uint8_t pdev_id,
  545. void *buf);
  546. void* (*txrx_peer_get_peerstats_ctx)(struct cdp_soc_t *soc,
  547. uint8_t vdev_id,
  548. uint8_t *mac_addr);
  549. QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc,
  550. uint8_t pdev_id);
  551. QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc,
  552. uint8_t pdev_id,
  553. uint8_t pcp, uint8_t tid);
  554. QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc,
  555. uint8_t vdev_id,
  556. uint8_t pcp, uint8_t tid);
  557. #ifdef DP_RX_UDP_OVER_PEER_ROAM
  558. QDF_STATUS (*txrx_update_roaming_peer)(struct cdp_soc_t *soc,
  559. uint8_t vdev_id,
  560. uint8_t *peer_mac,
  561. uint32_t auth_status);
  562. #endif
  563. #ifdef QCA_MULTIPASS_SUPPORT
  564. QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id,
  565. uint16_t vlan_id, uint16_t group_key);
  566. #endif
  567. uint16_t (*get_peer_mac_list)
  568. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  569. u_int8_t newmac[][QDF_MAC_ADDR_SIZE], uint16_t mac_cnt,
  570. bool limit);
  571. uint16_t (*get_peer_id)(ol_txrx_soc_handle soc,
  572. uint8_t vdev_id,
  573. uint8_t *mac);
  574. #ifdef QCA_SUPPORT_WDS_EXTENDED
  575. QDF_STATUS (*set_wds_ext_peer_rx)(ol_txrx_soc_handle soc,
  576. uint8_t vdev_id,
  577. uint8_t *mac,
  578. ol_txrx_rx_fp rx,
  579. ol_osif_peer_handle osif_peer);
  580. QDF_STATUS (*get_wds_ext_peer_osif_handle)
  581. (ol_txrx_soc_handle soc,
  582. uint8_t vdev_id,
  583. uint8_t *mac,
  584. ol_osif_peer_handle *osif_peer);
  585. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  586. void (*txrx_drain)(ol_txrx_soc_handle soc);
  587. int (*get_free_desc_poolsize)(struct cdp_soc_t *soc);
  588. #ifdef WLAN_SYSFS_DP_STATS
  589. QDF_STATUS (*txrx_sysfs_fill_stats)(ol_txrx_soc_handle soc,
  590. char *buf, uint32_t buf_size);
  591. QDF_STATUS (*txrx_sysfs_set_stat_type)(ol_txrx_soc_handle soc,
  592. uint32_t stat_type,
  593. uint32_t mac_id);
  594. #endif /* WLAN_SYSFS_DP_STATS */
  595. #ifdef WLAN_FEATURE_PKT_CAPTURE_V2
  596. void (*set_pkt_capture_mode)(struct cdp_soc_t *soc, bool val);
  597. #endif
  598. #ifdef FEATURE_RUNTIME_PM
  599. void (*set_rtpm_tput_policy)(struct cdp_soc_t *soc, bool val);
  600. #endif
  601. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  602. void (*txrx_recovery_vdev_flush_peers)(struct cdp_soc_t *soc,
  603. uint8_t vdev_id,
  604. bool mlo_peers_only);
  605. #endif
  606. QDF_STATUS (*txrx_umac_reset_deinit)(ol_txrx_soc_handle soc);
  607. void (*txrx_get_tsf_time)(struct cdp_soc_t *soc_hdl, uint32_t tsf_id,
  608. uint32_t mac_id, uint64_t *tsf,
  609. uint64_t *tsf_sync_soc_time);
  610. void (*txrx_get_tsf2_offset)(struct cdp_soc_t *soc_hdl, uint8_t mac_id,
  611. uint64_t *value);
  612. void (*txrx_get_tqm_offset)(struct cdp_soc_t *soc_hdl, uint64_t *value);
  613. };
  614. struct cdp_ctrl_ops {
  615. int
  616. (*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc);
  617. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  618. /**
  619. * @brief Update the authorize peer object at association time
  620. * @details
  621. * For the host-based implementation of rate-control, it
  622. * updates the peer/node-related parameters within rate-control
  623. * context of the peer at association.
  624. *
  625. * @param soc_hdl - pointer to the soc object
  626. * @param vdev_id - id of the virtual object
  627. * @param peer_mac - mac address of the node's object
  628. * @authorize - either to authorize or unauthorize peer
  629. *
  630. * @return QDF_STATUS
  631. */
  632. QDF_STATUS
  633. (*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl,
  634. uint8_t vdev_id,
  635. uint8_t *peer_mac,
  636. u_int32_t authorize);
  637. bool
  638. (*txrx_peer_get_authorize)(struct cdp_soc_t *soc_hdl,
  639. uint8_t vdev_id,
  640. uint8_t *peer_mac);
  641. void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id);
  642. int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl);
  643. QDF_STATUS
  644. (*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id,
  645. enum cdp_vdev_param_type param,
  646. cdp_config_param_type val);
  647. /**
  648. * @brief Set the reo dest ring num of the radio
  649. * @details
  650. * Set the reo destination ring no on which we will receive
  651. * pkts for this radio.
  652. *
  653. * @txrx_soc - soc handle
  654. * @param pdev_id - id of physical device
  655. * @return the reo destination ring number
  656. * @param reo_dest_ring_num - value ranges between 1 - 4
  657. */
  658. QDF_STATUS (*txrx_set_pdev_reo_dest)(
  659. struct cdp_soc_t *txrx_soc,
  660. uint8_t pdev_id,
  661. enum cdp_host_reo_dest_ring reo_dest_ring_num);
  662. /**
  663. * @brief Get the reo dest ring num of the radio
  664. * @details
  665. * Get the reo destination ring no on which we will receive
  666. * pkts for this radio.
  667. *
  668. * @txrx_soc - soc handle
  669. * @param pdev_id - id of physical device
  670. * @return the reo destination ring number
  671. */
  672. enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
  673. struct cdp_soc_t *txrx_soc,
  674. uint8_t pdev_id);
  675. int (*txrx_wdi_event_sub)(struct cdp_soc_t *soc, uint8_t pdev_id,
  676. wdi_event_subscribe *event_cb_sub,
  677. uint32_t event);
  678. int (*txrx_wdi_event_unsub)(struct cdp_soc_t *soc, uint8_t pdev_id,
  679. wdi_event_subscribe *event_cb_sub,
  680. uint32_t event);
  681. int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id,
  682. uint8_t *peer_mac, uint8_t sec_idx);
  683. QDF_STATUS
  684. (*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc,
  685. uint8_t vdev_id,
  686. uint8_t subtype, uint8_t tx_power);
  687. /**
  688. * txrx_set_pdev_param() - callback to set pdev parameter
  689. * @soc: opaque soc handle
  690. * @pdev_id:id of data path pdev handle
  691. * @val: value of pdev_tx_capture
  692. *
  693. * Return: status: 0 - Success, non-zero: Failure
  694. */
  695. QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc,
  696. uint8_t pdev_id,
  697. enum cdp_pdev_param_type type,
  698. cdp_config_param_type val);
  699. QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc,
  700. uint8_t pdev_id,
  701. enum cdp_pdev_param_type type,
  702. cdp_config_param_type *val);
  703. QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc,
  704. uint8_t vdev_id, uint8_t *peer_mac,
  705. enum cdp_peer_param_type param,
  706. cdp_config_param_type val);
  707. QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc,
  708. uint8_t vdev_id, uint8_t *peer_mac,
  709. enum cdp_peer_param_type param,
  710. cdp_config_param_type *val);
  711. void * (*txrx_get_pldev)(struct cdp_soc_t *soc, uint8_t pdev_id);
  712. void (*txrx_peer_flush_frags)(struct cdp_soc_t *soc, uint8_t vdev_id,
  713. uint8_t *peer_mac);
  714. #ifdef VDEV_PEER_PROTOCOL_COUNT
  715. void (*txrx_peer_protocol_cnt)(struct cdp_soc_t *soc,
  716. int8_t vdev_id,
  717. qdf_nbuf_t nbuf,
  718. bool is_egress,
  719. bool is_rx);
  720. #endif
  721. #ifdef WLAN_SUPPORT_MSCS
  722. QDF_STATUS
  723. (*txrx_record_mscs_params) (
  724. struct cdp_soc_t *soc, uint8_t *macaddr,
  725. uint8_t vdev_id,
  726. struct cdp_mscs_params *mscs_params,
  727. bool active);
  728. #endif
  729. QDF_STATUS
  730. (*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac,
  731. bool is_unicast, uint32_t *key);
  732. QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc,
  733. uint8_t vdev_id,
  734. enum cdp_vdev_param_type param,
  735. cdp_config_param_type *val);
  736. int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc,
  737. uint8_t pdev_id,
  738. uint8_t *macaddr, uint8_t enb_dsb);
  739. QDF_STATUS
  740. (*calculate_delay_stats)(struct cdp_soc_t *cdp_soc,
  741. uint8_t vdev_id, qdf_nbuf_t nbuf);
  742. #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  743. QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)(
  744. struct cdp_soc_t *soc, uint8_t pdev_id,
  745. uint32_t protocol_mask, uint16_t protocol_type,
  746. uint16_t tag);
  747. #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
  748. void (*txrx_dump_pdev_rx_protocol_tag_stats)(
  749. struct cdp_soc_t *soc, uint8_t pdev_id,
  750. uint16_t protocol_type);
  751. #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
  752. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  753. #ifdef WLAN_SUPPORT_RX_FLOW_TAG
  754. QDF_STATUS (*txrx_set_rx_flow_tag)(
  755. struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
  756. struct cdp_rx_flow_info *flow_info);
  757. QDF_STATUS (*txrx_dump_rx_flow_tag_stats)(
  758. struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
  759. struct cdp_rx_flow_info *flow_info);
  760. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  761. #ifdef QCA_MULTIPASS_SUPPORT
  762. void (*txrx_peer_set_vlan_id)(struct cdp_soc_t *cdp_soc,
  763. uint8_t vdev_id, uint8_t *peer_mac,
  764. uint16_t vlan_id);
  765. #endif
  766. #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
  767. QDF_STATUS (*txrx_update_peer_pkt_capture_params)(
  768. ol_txrx_soc_handle soc, uint8_t pdev_id,
  769. bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
  770. uint8_t *peer_mac);
  771. #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
  772. QDF_STATUS
  773. (*txrx_set_psoc_param)(struct cdp_soc_t *soc,
  774. enum cdp_psoc_param_type param,
  775. cdp_config_param_type val);
  776. QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc,
  777. enum cdp_psoc_param_type type,
  778. cdp_config_param_type *val);
  779. #ifdef VDEV_PEER_PROTOCOL_COUNT
  780. /*
  781. * Enable per-peer protocol counters
  782. */
  783. void (*txrx_enable_peer_protocol_count)(struct cdp_soc_t *soc,
  784. int8_t vdev_id, bool enable);
  785. void (*txrx_set_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
  786. int8_t vdev_id, int mask);
  787. int (*txrx_is_peer_protocol_count_enabled)(struct cdp_soc_t *soc,
  788. int8_t vdev_id);
  789. int (*txrx_get_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
  790. int8_t vdev_id);
  791. #endif
  792. #if defined(WLAN_FEATURE_TSF_UPLINK_DELAY) || defined(WLAN_CONFIG_TX_DELAY)
  793. void (*txrx_set_delta_tsf)(struct cdp_soc_t *soc, uint8_t vdev_id,
  794. uint32_t delta_tsf);
  795. #endif
  796. #ifdef WLAN_FEATURE_TSF_UPLINK_DELAY
  797. QDF_STATUS (*txrx_set_tsf_ul_delay_report)(struct cdp_soc_t *soc,
  798. uint8_t vdev_id,
  799. bool enable);
  800. QDF_STATUS (*txrx_get_uplink_delay)(struct cdp_soc_t *soc,
  801. uint8_t vdev_id,
  802. uint32_t *val);
  803. #endif
  804. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  805. QDF_STATUS (*txrx_set_pdev_phyrx_error_mask)(struct cdp_soc_t *soc,
  806. uint8_t pdev_id,
  807. uint32_t mask,
  808. uint32_t mask_cont);
  809. QDF_STATUS (*txrx_get_pdev_phyrx_error_mask)(struct cdp_soc_t *soc,
  810. uint8_t pdev_id,
  811. uint32_t *mask,
  812. uint32_t *mask_cont);
  813. #endif
  814. QDF_STATUS (*txrx_update_mon_mac_filter)(struct cdp_soc_t *soc,
  815. uint8_t vdev_id,
  816. uint32_t cmd);
  817. };
  818. struct cdp_me_ops {
  819. void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc,
  820. uint8_t pdev_id);
  821. void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id);
  822. uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id,
  823. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  824. uint8_t newmaccnt, uint8_t tid,
  825. bool is_igmp, bool is_dms_pkt);
  826. };
  827. /**
  828. * struct cdp_mon_ops - host mon ops
  829. * @txrx_reset_monitor_mode: Handler to reset monitor mode
  830. * @txrx_deliver_tx_mgmt: deliver mgmt tx frame
  831. * @txrx_set_advance_monitor_filter: set advanced monitor mode
  832. * @config_full_mon_mode: configure full monitor mode
  833. * @soc_config_full_mon_mode: pdev configure full monitor mode
  834. * @get_mon_pdev_rx_stats: Get monitor mode pdev stats
  835. * @txrx_enable_mon_reap_timer: Enable/Disable reap timer of monitor status ring
  836. * @txrx_update_filter_neighbour_peers: config nac peer
  837. * @txrx_vdev_config_for_nac_rssi: config nac rssi peer
  838. * @txrx_vdev_get_neighbour_rssi: get nac peer rssi
  839. * @txrx_set_lite_mon_config: set lite monitor config
  840. * @txrx_get_lite_mon_config: get lite monitor config
  841. * @txrx_set_lite_mon_peer_config: set lite monitor peer config
  842. * @txrx_get_lite_mon_peer_config: get lite monitor peer list
  843. * @txrx_is_lite_mon_enabled: get lite monitor enable/disable status
  844. * @txrx_enable_enhanced_stats: Enable enhanced stats
  845. * @txrx_disable_enhanced_stats: Disable enhanced stats
  846. * @txrx_get_lite_mon_legacy_feature_enabled: returns the legacy filter enabled
  847. * @txrx_set_mon_pdev_params_rssi_dbm_conv: To set RSSI dbm conversion params
  848. * in monitor pdev
  849. * @txrx_update_pdev_mon_telemetry_airtime_stats: update telemetry airtime
  850. * stats in monitor pdev
  851. * @txrx_cfr_filter: Handler to configure host rx monitor status ring
  852. */
  853. struct cdp_mon_ops {
  854. QDF_STATUS (*txrx_reset_monitor_mode)
  855. (ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor);
  856. QDF_STATUS (*txrx_deliver_tx_mgmt)
  857. (struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);
  858. QDF_STATUS (*txrx_set_advance_monitor_filter)
  859. (struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  860. struct cdp_monitor_filter *filter_val);
  861. QDF_STATUS
  862. (*config_full_mon_mode)(struct cdp_soc_t *soc, uint8_t val);
  863. QDF_STATUS (*soc_config_full_mon_mode)(struct cdp_pdev *cdp_pdev,
  864. uint8_t val);
  865. QDF_STATUS
  866. (*get_mon_pdev_rx_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  867. struct cdp_pdev_mon_stats *stats);
  868. bool (*txrx_enable_mon_reap_timer)(struct cdp_soc_t *soc_hdl,
  869. enum cdp_mon_reap_source source,
  870. bool enable);
  871. QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc,
  872. uint8_t pdev_id);
  873. QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc,
  874. uint8_t pdev_id);
  875. int
  876. (*txrx_update_filter_neighbour_peers)(
  877. struct cdp_soc_t *soc, uint8_t vdev_id,
  878. uint32_t cmd, uint8_t *macaddr);
  879. #ifdef ATH_SUPPORT_NAC_RSSI
  880. QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_soc_t *cdp_soc,
  881. uint8_t vdev_id,
  882. enum cdp_nac_param_cmd cmd,
  883. char *bssid,
  884. char *client_macaddr,
  885. uint8_t chan_num);
  886. QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_soc_t *cdp_soc,
  887. uint8_t vdev_id,
  888. char *macaddr,
  889. uint8_t *rssi);
  890. #endif
  891. #ifdef QCA_SUPPORT_LITE_MONITOR
  892. QDF_STATUS
  893. (*txrx_set_lite_mon_config)(
  894. struct cdp_soc_t *soc,
  895. struct cdp_lite_mon_filter_config *mon_config,
  896. uint8_t pdev_id);
  897. QDF_STATUS
  898. (*txrx_get_lite_mon_config)(
  899. struct cdp_soc_t *soc,
  900. struct cdp_lite_mon_filter_config *mon_config,
  901. uint8_t pdev_id);
  902. QDF_STATUS
  903. (*txrx_set_lite_mon_peer_config)(
  904. struct cdp_soc_t *soc,
  905. struct cdp_lite_mon_peer_config *peer_config,
  906. uint8_t pdev_id);
  907. QDF_STATUS
  908. (*txrx_get_lite_mon_peer_config)(
  909. struct cdp_soc_t *soc,
  910. struct cdp_lite_mon_peer_info *info,
  911. uint8_t pdev_id);
  912. int
  913. (*txrx_is_lite_mon_enabled)(struct cdp_soc_t *soc,
  914. uint8_t pdev_id,
  915. uint8_t direction);
  916. /* get the legacy feature enabled */
  917. int
  918. (*txrx_get_lite_mon_legacy_feature_enabled)(struct cdp_soc_t *soc,
  919. uint8_t pdev_id,
  920. uint8_t direction);
  921. #endif
  922. QDF_STATUS (*txrx_set_mon_pdev_params_rssi_dbm_conv)
  923. (struct cdp_soc_t *soc,
  924. struct cdp_rssi_db2dbm_param_dp *params);
  925. #ifdef WLAN_CONFIG_TELEMETRY_AGENT
  926. QDF_STATUS (*txrx_update_pdev_mon_telemetry_airtime_stats)
  927. (struct cdp_soc_t *soc,
  928. uint8_t pdev_id);
  929. #endif
  930. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  931. void (*txrx_cfr_filter)(struct cdp_soc_t *soc_hdl,
  932. uint8_t pdev_id,
  933. bool enable,
  934. struct cdp_monitor_filter *filter_val,
  935. bool cfr_enable_monitor_mode);
  936. #endif
  937. };
  938. /**
  939. * struct cdp_host_stats_ops - statistic operations
  940. * @txrx_host_stats_get:
  941. * @txrx_host_stats_clr:
  942. * @txrx_host_ce_stats:
  943. * @txrx_stats_publish:
  944. * @tx_print_tso_stats:
  945. * @tx_rst_tso_stats:
  946. * @tx_print_sg_stats:
  947. * @tx_rst_sg_stats:
  948. * @print_rx_cksum_stats:
  949. * @rst_rx_cksum_stats:
  950. * @txrx_host_me_stats:
  951. * @txrx_per_peer_stats:
  952. * @txrx_host_msdu_ttl_stats:
  953. * @ol_txrx_update_peer_stats:
  954. * @get_fw_peer_stats:
  955. * @get_htt_stats:
  956. * @txrx_update_pdev_stats:
  957. * @txrx_get_peer_stats_param:
  958. * @txrx_get_peer_stats:
  959. * @txrx_get_soc_stats:
  960. * @txrx_reset_peer_ald_stats:
  961. * @txrx_reset_peer_stats:
  962. * @txrx_get_vdev_stats:
  963. * @txrx_process_wmi_host_vdev_stats:
  964. * @txrx_get_vdev_extd_stats:
  965. * @txrx_update_vdev_stats:
  966. * @txrx_get_radio_stats:
  967. * @txrx_get_pdev_stats:
  968. * @txrx_get_ratekbps:
  969. * @txrx_update_peer_stats:
  970. * @txrx_get_scan_spcl_vap_stats:
  971. * @txrx_get_peer_delay_stats:
  972. * @txrx_get_peer_jitter_stats:
  973. * @txrx_alloc_vdev_stats_id:
  974. * @txrx_reset_vdev_stats_id:
  975. * @get_peer_tx_capture_stats:
  976. * @get_pdev_tx_capture_stats:
  977. * @enable_disable_vdev_tx_delay_stats:
  978. * @is_tx_delay_stats_enabled:
  979. * @txrx_get_pdev_tid_stats:
  980. * @txrx_pdev_telemetry_stats:
  981. * @txrx_peer_telemetry_stats:
  982. * @txrx_pdev_deter_stats:
  983. * @txrx_peer_deter_stats:
  984. * @txrx_update_pdev_chan_util_stats:
  985. * @txrx_get_peer_extd_rate_link_stats:
  986. * @get_pdev_obss_stats:
  987. * @clear_pdev_obss_pd_stats:
  988. */
  989. struct cdp_host_stats_ops {
  990. int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  991. struct ol_txrx_stats_req *req);
  992. QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc,
  993. uint8_t vdev_id);
  994. QDF_STATUS
  995. (*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  996. int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id,
  997. struct cdp_stats_extd *buf);
  998. QDF_STATUS
  999. (*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1000. QDF_STATUS
  1001. (*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1002. QDF_STATUS
  1003. (*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1004. QDF_STATUS
  1005. (*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1006. QDF_STATUS
  1007. (*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1008. QDF_STATUS
  1009. (*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1010. QDF_STATUS
  1011. (*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  1012. QDF_STATUS
  1013. (*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr);
  1014. int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1015. struct ol_txrx_stats_req *req);
  1016. int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc,
  1017. uint8_t pdev_id,
  1018. uint8_t *addr, void *stats,
  1019. uint32_t last_tx_rate_mcs,
  1020. uint32_t stats_id);
  1021. QDF_STATUS
  1022. (*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1023. uint8_t *addr,
  1024. uint32_t cap, uint32_t copy_stats);
  1025. QDF_STATUS
  1026. (*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1027. void *data,
  1028. uint32_t data_len);
  1029. QDF_STATUS
  1030. (*txrx_update_pdev_stats)(struct cdp_soc_t *soc,
  1031. uint8_t pdev_id, void *data,
  1032. uint16_t stats_id);
  1033. QDF_STATUS
  1034. (*txrx_get_peer_stats_param)(struct cdp_soc_t *soc,
  1035. uint8_t vdev_id,
  1036. uint8_t *peer_mac,
  1037. enum cdp_peer_stats_type type,
  1038. cdp_peer_stats_param_t *buf);
  1039. QDF_STATUS
  1040. (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1041. uint8_t *peer_mac,
  1042. struct cdp_peer_stats *peer_stats);
  1043. QDF_STATUS
  1044. (*txrx_get_soc_stats)(struct cdp_soc_t *soc,
  1045. struct cdp_soc_stats *soc_stats);
  1046. QDF_STATUS
  1047. (*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc,
  1048. uint8_t vdev_id,
  1049. uint8_t *peer_mac);
  1050. QDF_STATUS
  1051. (*txrx_reset_peer_stats)(struct cdp_soc_t *soc,
  1052. uint8_t vdev_id, uint8_t *peer_mac);
  1053. int
  1054. (*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1055. void *buf, bool is_aggregate);
  1056. int
  1057. (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
  1058. void *data, uint32_t len,
  1059. uint32_t stats_id);
  1060. int
  1061. (*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc,
  1062. uint8_t vdev_id,
  1063. wmi_host_vdev_extd_stats *buffer);
  1064. QDF_STATUS
  1065. (*txrx_update_vdev_stats)(struct cdp_soc_t *soc,
  1066. uint8_t vdev_id, void *buf,
  1067. uint16_t stats_id);
  1068. int
  1069. (*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1070. void *buf);
  1071. QDF_STATUS
  1072. (*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1073. struct cdp_pdev_stats *buf);
  1074. int
  1075. (*txrx_get_ratekbps)(int preamb, int mcs,
  1076. int htflag, int gintval);
  1077. QDF_STATUS
  1078. (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1079. uint8_t *peer_mac, void *stats,
  1080. uint32_t last_tx_rate_mcs,
  1081. uint32_t stats_id);
  1082. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  1083. QDF_STATUS
  1084. (*txrx_get_scan_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1085. struct cdp_scan_spcl_vap_stats *stats);
  1086. #endif
  1087. QDF_STATUS
  1088. (*txrx_get_peer_delay_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1089. uint8_t *peer_mac,
  1090. struct cdp_delay_tid_stats *delay_stats);
  1091. QDF_STATUS
  1092. (*txrx_get_peer_jitter_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1093. uint8_t vdev_id, uint8_t *peer_mac,
  1094. struct cdp_peer_tid_stats *tid_stats);
  1095. QDF_STATUS
  1096. (*txrx_alloc_vdev_stats_id)(struct cdp_soc_t *soc,
  1097. uint8_t *vdev_stats_id);
  1098. void (*txrx_reset_vdev_stats_id)(struct cdp_soc_t *soc,
  1099. uint8_t vdev_stats_id);
  1100. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  1101. QDF_STATUS
  1102. (*get_peer_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1103. uint8_t *peer_mac,
  1104. struct cdp_peer_tx_capture_stats *stats);
  1105. QDF_STATUS
  1106. (*get_pdev_tx_capture_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1107. struct cdp_pdev_tx_capture_stats *stats);
  1108. #endif /* WLAN_TX_PKT_CAPTURE_ENH */
  1109. #ifdef HW_TX_DELAY_STATS_ENABLE
  1110. void
  1111. (*enable_disable_vdev_tx_delay_stats)(struct cdp_soc_t *soc,
  1112. uint8_t vdev_id,
  1113. uint8_t value);
  1114. uint8_t (*is_tx_delay_stats_enabled)(struct cdp_soc_t *soc_hdl,
  1115. uint8_t vdev_id);
  1116. #endif
  1117. QDF_STATUS
  1118. (*txrx_get_pdev_tid_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1119. struct cdp_tid_stats_intf *tid_stats);
  1120. #ifdef WLAN_CONFIG_TELEMETRY_AGENT
  1121. QDF_STATUS
  1122. (*txrx_pdev_telemetry_stats)(
  1123. struct cdp_soc_t *soc,
  1124. uint8_t pdev_id,
  1125. struct cdp_pdev_telemetry_stats *stats);
  1126. QDF_STATUS
  1127. (*txrx_peer_telemetry_stats)(
  1128. struct cdp_soc_t *soc,
  1129. uint8_t *addr,
  1130. struct cdp_peer_telemetry_stats *stats);
  1131. QDF_STATUS
  1132. (*txrx_pdev_deter_stats)(
  1133. struct cdp_soc_t *soc,
  1134. uint8_t pdev_id,
  1135. struct cdp_pdev_deter_stats *stats);
  1136. QDF_STATUS
  1137. (*txrx_peer_deter_stats)(
  1138. struct cdp_soc_t *soc,
  1139. uint8_t vdev_id,
  1140. uint8_t *addr,
  1141. struct cdp_peer_deter_stats *stats);
  1142. QDF_STATUS
  1143. (*txrx_update_pdev_chan_util_stats)(
  1144. struct cdp_soc_t *soc,
  1145. uint8_t pdev_id,
  1146. struct cdp_pdev_chan_util_stats *ch_util);
  1147. #endif
  1148. QDF_STATUS
  1149. (*txrx_get_peer_extd_rate_link_stats)
  1150. (struct cdp_soc_t *soc, uint8_t *mac_addr);
  1151. QDF_STATUS
  1152. (*get_pdev_obss_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1153. struct cdp_pdev_obss_pd_stats_tlv *buf,
  1154. struct cdp_txrx_stats_req *req);
  1155. QDF_STATUS (*clear_pdev_obss_pd_stats)(struct cdp_soc_t *soc,
  1156. uint8_t pdev_id,
  1157. struct cdp_txrx_stats_req *req);
  1158. };
  1159. /**
  1160. * struct cdp_wds_ops - WDS operations
  1161. * @txrx_set_wds_rx_policy:
  1162. * @txrx_wds_peer_tx_policy_update:
  1163. * @vdev_set_wds:
  1164. */
  1165. struct cdp_wds_ops {
  1166. QDF_STATUS
  1167. (*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1168. u_int32_t val);
  1169. QDF_STATUS
  1170. (*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc,
  1171. uint8_t vdev_id, uint8_t *peer_mac,
  1172. int wds_tx_ucast, int wds_tx_mcast);
  1173. int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1174. uint32_t val);
  1175. };
  1176. /**
  1177. * struct cdp_raw_ops - raw packet operations
  1178. * @rsim_get_astentry:
  1179. */
  1180. struct cdp_raw_ops {
  1181. QDF_STATUS
  1182. (*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1183. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast);
  1184. };
  1185. #ifdef PEER_FLOW_CONTROL
  1186. /**
  1187. * struct cdp_pflow_ops - peer flow control operations
  1188. * @pflow_update_pdev_params:
  1189. */
  1190. struct cdp_pflow_ops {
  1191. uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc,
  1192. uint8_t pdev_id,
  1193. enum _dp_param_t,
  1194. uint32_t, void *);
  1195. };
  1196. #endif /* PEER_FLOW_CONTROL */
  1197. #define LRO_IPV4_SEED_ARR_SZ 5
  1198. #define LRO_IPV6_SEED_ARR_SZ 11
  1199. /**
  1200. * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
  1201. * @lro_enable: indicates whether rx_offld is enabled
  1202. * @tcp_flag: If the TCP flags from the packet do not match
  1203. * the values in this field after masking with TCP flags mask
  1204. * below, packet is not rx_offld eligible
  1205. * @tcp_flag_mask: field for comparing the TCP values provided
  1206. * above with the TCP flags field in the received packet
  1207. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  1208. * 5-tuple toeplitz hash for ipv4 packets
  1209. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  1210. * 5-tuple toeplitz hash for ipv6 packets
  1211. */
  1212. struct cdp_lro_hash_config {
  1213. uint32_t lro_enable;
  1214. uint32_t tcp_flag:9,
  1215. tcp_flag_mask:9;
  1216. uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
  1217. uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
  1218. };
  1219. struct ol_if_ops {
  1220. void
  1221. (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1222. uint8_t pdev_id, uint8_t *peer_macaddr,
  1223. uint8_t vdev_id,
  1224. bool hash_based, uint8_t ring_num,
  1225. uint8_t lmac_peer_id_msb);
  1226. QDF_STATUS
  1227. (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1228. uint8_t pdev_id,
  1229. uint8_t vdev_id, uint8_t *peer_mac,
  1230. qdf_dma_addr_t hw_qdesc, int tid,
  1231. uint16_t queue_num,
  1232. uint8_t ba_window_size_valid,
  1233. uint16_t ba_window_size);
  1234. QDF_STATUS
  1235. (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1236. uint8_t pdev_id,
  1237. uint8_t vdev_id, uint8_t *peer_macaddr,
  1238. uint32_t tid_mask);
  1239. int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc,
  1240. uint8_t pdev_id,
  1241. uint8_t *peer_mac,
  1242. uint8_t *vdev_mac, enum wlan_op_mode opmode);
  1243. bool (*is_hw_dbs_capable)(struct wlan_objmgr_psoc *psoc);
  1244. int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  1245. uint8_t vdev_id,
  1246. uint8_t *peer_macaddr,
  1247. uint16_t peer_id,
  1248. const uint8_t *dest_macaddr,
  1249. uint8_t *next_node_mac,
  1250. uint32_t flags,
  1251. uint8_t type);
  1252. int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  1253. uint8_t vdev_id,
  1254. uint8_t *dest_macaddr,
  1255. uint8_t *peer_macaddr,
  1256. uint32_t flags);
  1257. void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  1258. uint8_t vdev_id,
  1259. uint8_t *wds_macaddr,
  1260. uint8_t type,
  1261. uint8_t delete_in_fw);
  1262. #ifdef WLAN_FEATURE_MULTI_AST_DEL
  1263. void (*peer_del_multi_wds_entry)(
  1264. struct cdp_ctrl_objmgr_psoc *soc,
  1265. uint8_t vdev_id,
  1266. struct peer_del_multi_wds_entries *wds_list);
  1267. #endif
  1268. QDF_STATUS
  1269. (*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
  1270. struct cdp_lro_hash_config *rx_offld_hash);
  1271. void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
  1272. uint8_t type);
  1273. #ifdef RX_PEER_INVALID_ENH
  1274. uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc,
  1275. uint8_t pdev_id, void *msg);
  1276. #else
  1277. uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
  1278. #endif
  1279. int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  1280. uint16_t peer_id, uint16_t hw_peer_id,
  1281. uint8_t vdev_id, uint8_t *peer_mac_addr,
  1282. enum cdp_txrx_ast_entry_type peer_type,
  1283. uint32_t tx_ast_hashidx);
  1284. int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  1285. uint16_t peer_id,
  1286. uint8_t vdev_id, uint8_t *mac_addr);
  1287. int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc,
  1288. enum cdp_cfg_param_type param_num);
  1289. void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc,
  1290. uint8_t pdev_id,
  1291. struct cdp_rx_mic_err_info *info);
  1292. bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc,
  1293. uint8_t vdev_id, uint8_t *peer_mac_addr,
  1294. qdf_nbuf_t nbuf,
  1295. uint16_t hdr_space);
  1296. #ifdef QCA_SUPPORT_PRIMARY_LINK_MIGRATE
  1297. void (*update_primary_link)(struct cdp_ctrl_objmgr_psoc *psoc,
  1298. uint8_t *mac_addr);
  1299. #endif
  1300. uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc,
  1301. uint8_t pdev_id, uint16_t freq);
  1302. uint8_t (*freq_to_band)(struct cdp_ctrl_objmgr_psoc *psoc,
  1303. uint8_t pdev_id, uint16_t freq);
  1304. QDF_STATUS(*set_mec_timer)(struct cdp_ctrl_objmgr_psoc *psoc,
  1305. uint8_t vdev_id, uint16_t mec_timer_val);
  1306. #ifdef INTRA_BSS_FWD_OFFLOAD
  1307. void (*vdev_set_intra_bss)(struct cdp_ctrl_objmgr_psoc *psoc,
  1308. uint16_t vdev_id, bool enable);
  1309. #endif
  1310. #ifdef ATH_SUPPORT_NAC_RSSI
  1311. int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  1312. uint8_t pdev_id,
  1313. u_int8_t vdev_id,
  1314. enum cdp_nac_param_cmd cmd, char *bssid,
  1315. char *client_macaddr, uint8_t chan_num);
  1316. int
  1317. (*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  1318. uint8_t pdev_id, u_int8_t vdev_id,
  1319. enum cdp_nac_param_cmd cmd,
  1320. char *bssid, char *client_mac);
  1321. #endif
  1322. int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc,
  1323. uint16_t pdev_id, uint8_t *peer_macaddr);
  1324. /**
  1325. * send_delba() - Send delba to peer
  1326. * @psoc: Objmgr soc handle
  1327. * @vdev_id: dp vdev id
  1328. * @peer_macaddr: Peer mac addr
  1329. * @tid: Tid number
  1330. * @reason_code: Reason code
  1331. * @cdp_rcode: CDP reason code for sending DELBA
  1332. *
  1333. * Return: 0 for success, non-zero for failure
  1334. */
  1335. int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id,
  1336. uint8_t *peer_macaddr, uint8_t tid,
  1337. uint8_t reason_code, uint8_t cdp_rcode);
  1338. int
  1339. (*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc,
  1340. uint8_t vdev_id,
  1341. uint8_t *dest_macaddr,
  1342. uint8_t *peer_macaddr,
  1343. uint32_t flags);
  1344. int
  1345. (*pdev_update_lmac_n_target_pdev_id)(struct cdp_ctrl_objmgr_psoc *psoc,
  1346. uint8_t *pdev_id,
  1347. uint8_t *lmac_id,
  1348. uint8_t *target_pdev_id);
  1349. bool (*is_roam_inprogress)(uint32_t vdev_id);
  1350. enum QDF_GLOBAL_MODE (*get_con_mode)(void);
  1351. #ifdef QCA_PEER_MULTIQ_SUPPORT
  1352. int (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle,
  1353. uint16_t peer_id, uint8_t vdev_id,
  1354. uint8_t *peer_mac_addr);
  1355. #endif
  1356. #ifdef DP_MEM_PRE_ALLOC
  1357. void *(*dp_prealloc_get_context)(uint32_t ctxt_type, size_t ctxt_size);
  1358. QDF_STATUS(*dp_prealloc_put_context)(uint32_t ctxt_type, void *vaddr);
  1359. void *(*dp_prealloc_get_consistent)(uint32_t *size,
  1360. void **base_vaddr_unaligned,
  1361. qdf_dma_addr_t *paddr_unaligned,
  1362. qdf_dma_addr_t *paddr_aligned,
  1363. uint32_t align,
  1364. uint32_t ring_type);
  1365. void (*dp_prealloc_put_consistent)(qdf_size_t size,
  1366. void *vaddr_unligned,
  1367. qdf_dma_addr_t paddr);
  1368. void (*dp_get_multi_pages)(uint32_t desc_type,
  1369. size_t element_size,
  1370. uint16_t element_num,
  1371. struct qdf_mem_multi_page_t *pages,
  1372. bool cacheable);
  1373. void (*dp_put_multi_pages)(uint32_t desc_type,
  1374. struct qdf_mem_multi_page_t *pages);
  1375. #endif
  1376. int (*get_soc_nss_cfg)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle);
  1377. char *(*get_device_name)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1378. uint8_t pdev_id);
  1379. QDF_STATUS(*nss_stats_clr)(struct cdp_ctrl_objmgr_psoc *psoc,
  1380. uint8_t vdev_id);
  1381. int (*dp_rx_get_pending)(ol_txrx_soc_handle soc);
  1382. void (*dp_rx_sched_refill_thread)(ol_txrx_soc_handle soc);
  1383. /* TODO: Add any other control path calls required to OL_IF/WMA layer */
  1384. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1385. void (*rx_wds_ext_peer_learn)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  1386. uint16_t peer_id, uint8_t vdev_id,
  1387. uint8_t *peer_macaddr);
  1388. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1389. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1390. QDF_STATUS(*peer_update_mesh_latency_params)(
  1391. struct cdp_ctrl_objmgr_psoc *psoc,
  1392. uint8_t vdev_id, uint8_t *peer_mac, uint8_t tid,
  1393. uint32_t service_interval_dl, uint32_t burst_size_dl,
  1394. uint32_t service_interval_ul, uint32_t burst_size_ul,
  1395. uint8_t add_or_sub, uint8_t ac);
  1396. #endif
  1397. #ifdef CONFIG_SAWF
  1398. QDF_STATUS
  1399. (*peer_update_sawf_ul_params)(struct cdp_ctrl_objmgr_psoc *soc,
  1400. uint8_t vdev_id, uint8_t *peer_mac,
  1401. uint8_t tid, uint8_t ac,
  1402. uint32_t service_interval,
  1403. uint32_t burst_size, uint32_t min_tput,
  1404. uint32_t max_latency, uint8_t add_sub);
  1405. #endif
  1406. uint32_t (*dp_get_tx_inqueue)(ol_txrx_soc_handle soc);
  1407. QDF_STATUS(*dp_send_unit_test_cmd)(uint32_t vdev_id,
  1408. uint32_t module_id,
  1409. uint32_t arg_count, uint32_t *arg);
  1410. #ifdef QCA_SUPPORT_LITE_MONITOR
  1411. int (*config_lite_mon_peer)(struct cdp_ctrl_objmgr_psoc *psoc,
  1412. uint8_t pdev_id,
  1413. uint8_t vdev_id,
  1414. enum cdp_nac_param_cmd cmd,
  1415. uint8_t *peer_mac);
  1416. int (*config_lite_mon_tx_peer)(struct cdp_ctrl_objmgr_psoc *psoc,
  1417. uint8_t pdev_id, uint8_t vdev_id,
  1418. enum cdp_tx_filter_action cmd,
  1419. uint8_t *peer_mac);
  1420. #endif
  1421. #ifdef WLAN_SUPPORT_SCS
  1422. bool (*peer_scs_rule_match)(struct cdp_ctrl_objmgr_psoc *psoc,
  1423. uint8_t vdev_id, uint32_t rule_id,
  1424. uint8_t *peer_mac);
  1425. #endif
  1426. #ifdef DP_UMAC_HW_RESET_SUPPORT
  1427. void (*dp_update_tx_hardstart)(struct cdp_ctrl_objmgr_psoc *psoc,
  1428. uint8_t vdev_id,
  1429. struct ol_txrx_hardtart_ctxt *ctxt);
  1430. #endif
  1431. #if defined(IPA_WDS_EASYMESH_FEATURE) && defined(FEATURE_AST)
  1432. void (*peer_send_wds_disconnect)(struct cdp_ctrl_objmgr_psoc *psoc,
  1433. uint8_t *mac_addr, uint8_t vdev_id);
  1434. #endif
  1435. #ifdef WLAN_SUPPORT_PPEDS
  1436. QDF_STATUS
  1437. (*peer_set_ppeds_default_routing)(struct cdp_ctrl_objmgr_psoc *psoc,
  1438. uint8_t *peer_macaddr,
  1439. uint16_t service_code,
  1440. uint8_t priority_valid,
  1441. uint16_t src_info,
  1442. uint8_t vdev_id, uint8_t use_ppe,
  1443. uint8_t routing_enabled);
  1444. QDF_STATUS
  1445. (*get_ppeds_profile_info_for_vap)(struct cdp_ctrl_objmgr_psoc *psoc,
  1446. uint8_t vdev_id,
  1447. struct cdp_ds_vp_params *vp_params);
  1448. #endif /* WLAN_SUPPORT_PPEDS */
  1449. #ifdef CONFIG_SAWF_DEF_QUEUES
  1450. int (*disable_sawf_svc)(uint8_t svc_id);
  1451. #endif
  1452. };
  1453. #ifdef DP_PEER_EXTENDED_API
  1454. /**
  1455. * struct cdp_misc_ops - mcl ops not classified
  1456. * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer
  1457. * @set_wmm_param: set wmm parameters
  1458. * @bad_peer_txctl_set_setting: configure bad peer tx limit setting
  1459. * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit
  1460. * @hl_tdls_flag_reset: reset tdls flag for vdev
  1461. * @tx_non_std: Allow the control-path SW to send data frames
  1462. * @get_vdev_id: get vdev id
  1463. * @get_tx_ack_stats:
  1464. * @set_wisa_mode: set wisa mode for a vdev
  1465. * @txrx_data_stall_cb_register: register data stall callback
  1466. * @txrx_data_stall_cb_deregister: deregister data stall callback
  1467. * @txrx_post_data_stall_event: post data stall event
  1468. * @runtime_suspend: ensure TXRX is ready to runtime suspend
  1469. * @runtime_resume: ensure TXRX is ready to runtime resume
  1470. * @get_opmode: get operation mode of vdev
  1471. * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for
  1472. * marking first packet after wow wakeup
  1473. * @update_mac_id: update mac_id for vdev
  1474. * @flush_rx_frames: flush rx frames on the queue
  1475. * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that
  1476. * has been forwarded from txrx layer
  1477. * without going to upper layers
  1478. * @pkt_log_init: handler to initialize packet log
  1479. * @pkt_log_con_service: handler to connect packet log service
  1480. * @pkt_log_exit:
  1481. * @get_num_rx_contexts: handler to get number of RX contexts
  1482. * @register_pktdump_cb: register callback for different pktlog
  1483. * @unregister_pktdump_cb: unregister callback for different pktlog
  1484. * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag
  1485. * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag
  1486. *
  1487. * @vdev_set_bundle_require_flag:
  1488. * @pdev_reset_bundle_require_flag:
  1489. * @txrx_ext_stats_request:
  1490. * @request_rx_hw_stats:
  1491. * @reset_rx_hw_ext_stats:
  1492. * @vdev_inform_ll_conn: inform DP to add/delete a latency critical connection
  1493. * for this particular vdev.
  1494. * @set_swlm_enable: Enable or Disable Software Latency Manager.
  1495. * @is_swlm_enabled: Check if Software latency manager is enabled or not.
  1496. * @display_txrx_hw_info: Dump the DP rings info
  1497. * @get_tx_rings_grp_bitmap:
  1498. * @set_peer_txq_flush_config: Configures the ac/tid to be flushed and policy
  1499. * to flush.
  1500. * @set_bus_vote_lvl_high: The bus lvl is set to high or low based on tput
  1501. * @get_bus_vote_lvl_high: Get bus lvl to determine whether or not get
  1502. * rx rate stats
  1503. *
  1504. * Function pointers for miscellaneous soc/pdev/vdev related operations.
  1505. */
  1506. struct cdp_misc_ops {
  1507. uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl,
  1508. uint8_t vdev_id,
  1509. uint16_t timer_value_sec);
  1510. void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1511. struct ol_tx_wmm_param_t wmm_param);
  1512. void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl,
  1513. uint8_t pdev_id, int enable,
  1514. int period, int txq_limit);
  1515. void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl,
  1516. uint8_t pdev_id,
  1517. int level, int tput_thresh,
  1518. int tx_limit);
  1519. void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl,
  1520. uint8_t vdev_id, bool flag);
  1521. qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1522. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  1523. uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
  1524. uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl,
  1525. uint8_t vdev_id);
  1526. QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl,
  1527. uint8_t vdev_id, bool enable);
  1528. QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl,
  1529. uint8_t pdev_id,
  1530. data_stall_detect_cb cb);
  1531. QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl,
  1532. uint8_t pdev_id,
  1533. data_stall_detect_cb cb);
  1534. void (*txrx_post_data_stall_event)(
  1535. struct cdp_soc_t *soc_hdl,
  1536. enum data_stall_log_event_indicator indicator,
  1537. enum data_stall_log_event_type data_stall_type,
  1538. uint32_t pdev_id, uint32_t vdev_id_bitmap,
  1539. enum data_stall_log_recovery_type recovery_type);
  1540. QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl,
  1541. uint8_t pdev_id);
  1542. QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl,
  1543. uint8_t pdev_id);
  1544. int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1545. void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl,
  1546. uint8_t pdev_id, uint8_t value);
  1547. void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1548. uint8_t mac_id);
  1549. void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1550. void *peer, bool drop);
  1551. A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl,
  1552. uint8_t vdev_id,
  1553. uint64_t *fwd_tx_packets,
  1554. uint64_t *fwd_rx_packets);
  1555. void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev,
  1556. void *scn);
  1557. void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl,
  1558. uint8_t pdev_id, void *scn);
  1559. void (*pkt_log_exit)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1560. int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl);
  1561. void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1562. ol_txrx_pktdump_cb tx_cb,
  1563. ol_txrx_pktdump_cb rx_cb);
  1564. void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl,
  1565. uint8_t pdev_id);
  1566. void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl,
  1567. uint8_t pdev_id);
  1568. void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl,
  1569. uint8_t vdev_id,
  1570. unsigned long rx_packets,
  1571. uint32_t time_in_ms,
  1572. uint32_t high_th,
  1573. uint32_t low_th);
  1574. void (*vdev_set_bundle_require_flag)(uint8_t vdev_id,
  1575. unsigned long tx_bytes,
  1576. uint32_t time_in_ms,
  1577. uint32_t high_th,
  1578. uint32_t low_th);
  1579. void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl,
  1580. uint8_t pdev_id);
  1581. QDF_STATUS (*txrx_ext_stats_request)(struct cdp_soc_t *soc_hdl,
  1582. uint8_t pdev_id,
  1583. struct cdp_txrx_ext_stats *req);
  1584. QDF_STATUS (*request_rx_hw_stats)(struct cdp_soc_t *soc_hdl,
  1585. uint8_t vdev_id);
  1586. void (*reset_rx_hw_ext_stats)(struct cdp_soc_t *soc_hdl);
  1587. QDF_STATUS (*vdev_inform_ll_conn)(struct cdp_soc_t *soc_hdl,
  1588. uint8_t vdev_id,
  1589. enum vdev_ll_conn_actions action);
  1590. QDF_STATUS (*set_swlm_enable)(struct cdp_soc_t *soc_hdl,
  1591. uint8_t val);
  1592. uint8_t (*is_swlm_enabled)(struct cdp_soc_t *soc_hdl);
  1593. void (*display_txrx_hw_info)(struct cdp_soc_t *soc_hdl);
  1594. uint32_t (*get_tx_rings_grp_bitmap)(struct cdp_soc_t *soc_hdl);
  1595. #ifdef WLAN_FEATURE_PEER_TXQ_FLUSH_CONF
  1596. int (*set_peer_txq_flush_config)(struct cdp_soc_t *soc_hdl,
  1597. uint8_t vdev_id, uint8_t *addr,
  1598. uint8_t ac, uint32_t tid,
  1599. enum cdp_peer_txq_flush_policy policy);
  1600. #endif
  1601. #ifdef FEATURE_RX_LINKSPEED_ROAM_TRIGGER
  1602. void (*set_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl, bool high);
  1603. bool (*get_bus_vote_lvl_high)(struct cdp_soc_t *soc_hdl);
  1604. #endif
  1605. };
  1606. /**
  1607. * struct cdp_ocb_ops - mcl ocb ops
  1608. * @set_ocb_chan_info: set OCB channel info
  1609. * @get_ocb_chan_info: get OCB channel info
  1610. *
  1611. * Function pointers for operations related to OCB.
  1612. */
  1613. struct cdp_ocb_ops {
  1614. void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1615. struct ol_txrx_ocb_set_chan ocb_set_chan);
  1616. struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)(
  1617. struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1618. };
  1619. /**
  1620. * struct cdp_peer_ops - mcl peer related ops
  1621. * @register_peer:
  1622. * @clear_peer:
  1623. * @find_peer_exist:
  1624. * @find_peer_exist_on_vdev:
  1625. * @find_peer_exist_on_other_vdev:
  1626. * @peer_state_update:
  1627. * @get_vdevid:
  1628. * @get_vdev_by_peer_addr:
  1629. * @register_ocb_peer:
  1630. * @peer_get_peer_mac_addr:
  1631. * @get_peer_state:
  1632. * @get_vdev_for_peer:
  1633. * @update_ibss_add_peer_num_of_vdev:
  1634. * @remove_peers_for_vdev:
  1635. * @remove_peers_for_vdev_no_lock:
  1636. * @copy_mac_addr_raw:
  1637. * @add_last_real_peer:
  1638. * @is_vdev_restore_last_peer:
  1639. * @update_last_real_peer:
  1640. * @peer_detach_force_delete:
  1641. * @set_tdls_offchan_enabled:
  1642. * @set_peer_as_tdls_peer:
  1643. * @peer_flush_frags:
  1644. */
  1645. struct cdp_peer_ops {
  1646. QDF_STATUS (*register_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1647. struct ol_txrx_desc_type *sta_desc);
  1648. QDF_STATUS (*clear_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1649. struct qdf_mac_addr peer_addr);
  1650. bool (*find_peer_exist)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1651. uint8_t *peer_addr);
  1652. bool (*find_peer_exist_on_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1653. uint8_t *peer_addr);
  1654. bool (*find_peer_exist_on_other_vdev)(struct cdp_soc_t *soc,
  1655. uint8_t vdev_id,
  1656. uint8_t *peer_addr,
  1657. uint16_t max_bssid);
  1658. QDF_STATUS (*peer_state_update)(struct cdp_soc_t *soc,
  1659. uint8_t *peer_addr,
  1660. enum ol_txrx_peer_state state);
  1661. QDF_STATUS (*get_vdevid)(struct cdp_soc_t *soc_hdl, uint8_t *peer_mac,
  1662. uint8_t *vdev_id);
  1663. struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev,
  1664. struct qdf_mac_addr peer_addr);
  1665. QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr);
  1666. uint8_t * (*peer_get_peer_mac_addr)(void *peer);
  1667. int (*get_peer_state)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1668. uint8_t *peer_mac);
  1669. struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
  1670. int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_soc_t *soc,
  1671. uint8_t vdev_id,
  1672. int16_t peer_num_delta);
  1673. void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
  1674. ol_txrx_vdev_peer_remove_cb callback,
  1675. void *callback_context, bool remove_last_peer);
  1676. void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
  1677. ol_txrx_vdev_peer_remove_cb callback,
  1678. void *callback_context);
  1679. void (*copy_mac_addr_raw)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1680. uint8_t *bss_addr);
  1681. void (*add_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1682. uint8_t vdev_id);
  1683. bool (*is_vdev_restore_last_peer)(struct cdp_soc_t *soc,
  1684. uint8_t vdev_id,
  1685. uint8_t *peer_mac);
  1686. void (*update_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1687. uint8_t vdev_id, bool restore_last_peer);
  1688. void (*peer_detach_force_delete)(struct cdp_soc_t *soc_hdl,
  1689. uint8_t vdev_id, uint8_t *peer_addr);
  1690. void (*set_tdls_offchan_enabled)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1691. uint8_t *peer_mac, bool val);
  1692. void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1693. uint8_t *peer_mac, bool val);
  1694. void (*peer_flush_frags)(struct cdp_soc_t *soc_hdl,
  1695. uint8_t vdev_id, uint8_t *peer_mac);
  1696. };
  1697. /**
  1698. * struct cdp_mob_stats_ops - mcl mob stats ops
  1699. * @clear_stats: handler to clear ol txrx stats
  1700. * @stats: handler to update ol txrx stats
  1701. */
  1702. struct cdp_mob_stats_ops {
  1703. QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl,
  1704. uint8_t pdev_id, uint8_t bitmap);
  1705. int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
  1706. };
  1707. /**
  1708. * struct cdp_pmf_ops - mcl protected management frame ops
  1709. * @get_pn_info: handler to get pn info from peer
  1710. *
  1711. * Function pointers for pmf related operations.
  1712. */
  1713. struct cdp_pmf_ops {
  1714. void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac,
  1715. uint8_t vdev_id, uint8_t **last_pn_valid,
  1716. uint64_t **last_pn, uint32_t **rmf_pn_replays);
  1717. };
  1718. #endif
  1719. #ifdef DP_FLOW_CTL
  1720. /**
  1721. * struct cdp_cfg_ops - mcl configuration ops
  1722. * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag
  1723. * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag
  1724. * @cfg_attach: hardcode the configuration parameters
  1725. * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag
  1726. * @is_rx_fwd_disabled: get the rx_fwd_disabled flag,
  1727. * 1 enabled, 0 disabled.
  1728. * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to
  1729. * indicate that mgmt over wmi is enabled
  1730. * or not,
  1731. * 1 for enabled, 0 for disable
  1732. * @is_high_latency: get device is high or low latency device,
  1733. * 1 high latency bus, 0 low latency bus
  1734. * @set_flow_control_parameters: set flow control parameters
  1735. * @set_flow_steering: set flow_steering_enabled flag
  1736. * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag
  1737. * @set_new_htt_msg_format: set new_htt_msg_format flag
  1738. * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag
  1739. * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag
  1740. * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag,
  1741. * 1 enabled, 0 disabled.
  1742. * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag,
  1743. * 1 enabled, 0 disabled.
  1744. */
  1745. struct cdp_cfg_ops {
  1746. void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
  1747. uint8_t disable_rx_fwd);
  1748. void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
  1749. uint8_t val);
  1750. struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
  1751. void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl,
  1752. uint8_t vdev_id, bool val);
  1753. uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
  1754. void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
  1755. int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
  1756. void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
  1757. void *param);
  1758. void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1759. void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1760. void (*set_new_htt_msg_format)(uint8_t val);
  1761. void (*set_peer_unmap_conf_support)(bool val);
  1762. bool (*get_peer_unmap_conf_support)(void);
  1763. void (*set_tx_compl_tsf64)(bool val);
  1764. bool (*get_tx_compl_tsf64)(void);
  1765. };
  1766. /**
  1767. * struct cdp_flowctl_ops - mcl flow control
  1768. * @flow_pool_map_handler: handler to map flow_id and pool descriptors
  1769. * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors
  1770. * @register_pause_cb: handler to register tx pause callback
  1771. * @set_desc_global_pool_size: handler to set global pool size
  1772. * @dump_flow_pool_info: handler to dump global and flow pool info
  1773. * @tx_desc_thresh_reached: handler to set tx desc threshold
  1774. *
  1775. * Function pointers for operations related to flow control
  1776. */
  1777. struct cdp_flowctl_ops {
  1778. QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
  1779. uint8_t pdev_id,
  1780. uint8_t vdev_id);
  1781. void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
  1782. uint8_t pdev_id,
  1783. uint8_t vdev_id);
  1784. QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
  1785. tx_pause_callback);
  1786. void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
  1787. void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl);
  1788. bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl,
  1789. uint8_t vdev_id);
  1790. };
  1791. /**
  1792. * struct cdp_lflowctl_ops - mcl legacy flow control ops
  1793. * @register_tx_flow_control: Register tx flow control callback
  1794. * @set_vdev_tx_desc_limit: Set tx descriptor limit for a vdev
  1795. * @set_vdev_os_queue_status: Set vdev queue status
  1796. * @deregister_tx_flow_control_cb: Deregister tx flow control callback
  1797. * @flow_control_cb: Call osif flow control callback
  1798. * @get_tx_resource: Get tx resources and compare with watermark
  1799. * @ll_set_tx_pause_q_depth: set pause queue depth
  1800. * @vdev_flush: Flush all packets on a particular vdev
  1801. * @vdev_pause: Pause a particular vdev
  1802. * @vdev_unpause: Unpause a particular vdev
  1803. *
  1804. * Function pointers for operations related to flow control
  1805. */
  1806. struct cdp_lflowctl_ops {
  1807. #ifdef QCA_HL_NETDEV_FLOW_CONTROL
  1808. int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl,
  1809. uint8_t pdev_id,
  1810. tx_pause_callback flowcontrol);
  1811. int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl,
  1812. uint8_t vdev_id, uint32_t chan_freq);
  1813. int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl,
  1814. uint8_t vdev_id,
  1815. enum netif_action_type action);
  1816. #else
  1817. int (*register_tx_flow_control)(
  1818. struct cdp_soc_t *soc_hdl,
  1819. uint8_t vdev_id,
  1820. ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
  1821. ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
  1822. #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
  1823. int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl,
  1824. uint8_t vdev_id);
  1825. void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1826. bool tx_resume);
  1827. bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1828. struct qdf_mac_addr peer_addr,
  1829. unsigned int low_watermark,
  1830. unsigned int high_watermark_offset);
  1831. int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1832. int pause_q_depth);
  1833. void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1834. void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1835. uint32_t reason, uint32_t pause_type);
  1836. void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1837. uint32_t reason, uint32_t pause_type);
  1838. };
  1839. /**
  1840. * struct cdp_throttle_ops - mcl throttle ops
  1841. * @throttle_init_period: handler to initialize tx throttle time
  1842. * @throttle_set_level: handler to set tx throttle level
  1843. */
  1844. struct cdp_throttle_ops {
  1845. void (*throttle_init_period)(struct cdp_soc_t *soc_hdl,
  1846. uint8_t pdev_id, int period,
  1847. uint8_t *dutycycle_level);
  1848. void (*throttle_set_level)(struct cdp_soc_t *soc_hdl,
  1849. uint8_t pdev_id, int level);
  1850. };
  1851. #endif
  1852. #ifdef IPA_OFFLOAD
  1853. /**
  1854. * struct cdp_ipa_ops - mcl ipa data path ops
  1855. * @ipa_get_resource:
  1856. * @ipa_set_doorbell_paddr:
  1857. * @ipa_iounmap_doorbell_vaddr: I/O unmap ipa doorbell vaddr
  1858. * @ipa_set_active:
  1859. * @ipa_op_response:
  1860. * @ipa_register_op_cb:
  1861. * @ipa_deregister_op_cb:
  1862. * @ipa_get_stat:
  1863. * @ipa_tx_data_frame:
  1864. * @ipa_set_uc_tx_partition_base:
  1865. * @ipa_update_peer_rx_stats:
  1866. * @ipa_uc_get_share_stats:
  1867. * @ipa_uc_set_quota:
  1868. * @ipa_pcie_link_up: Hold PCIe link in L0
  1869. * @ipa_pcie_link_down: Release PCIe link L0 hold
  1870. * @ipa_enable_autonomy:
  1871. * @ipa_disable_autonomy:
  1872. * @ipa_setup:
  1873. * @ipa_cleanup:
  1874. * @ipa_setup_iface:
  1875. * @ipa_cleanup_iface:
  1876. * @ipa_enable_pipes:
  1877. * @ipa_disable_pipes:
  1878. * @ipa_set_perf_level:
  1879. * @ipa_rx_intrabss_fwd:
  1880. * @ipa_tx_buf_smmu_mapping: Create SMMU mappings for Tx
  1881. * @ipa_tx_buf_smmu_unmapping: Release SMMU mappings for Tx
  1882. * buffers to IPA
  1883. * @ipa_rx_super_rule_setup: Setup cce super rules based on filter tuple
  1884. * @ipa_ast_create: Create/Update ast entry
  1885. * @ipa_get_wdi_version: Get WDI version
  1886. */
  1887. struct cdp_ipa_ops {
  1888. QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl,
  1889. uint8_t pdev_id);
  1890. QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl,
  1891. uint8_t pdev_id);
  1892. QDF_STATUS (*ipa_iounmap_doorbell_vaddr)(struct cdp_soc_t *soc_hdl,
  1893. uint8_t pdev_id);
  1894. QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1895. bool uc_active, bool is_tx);
  1896. QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl,
  1897. uint8_t pdev_id, uint8_t *op_msg);
  1898. QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl,
  1899. uint8_t pdev_id,
  1900. void (*ipa_uc_op_cb_type)
  1901. (uint8_t *op_msg, void *osif_ctxt),
  1902. void *usr_ctxt);
  1903. void (*ipa_deregister_op_cb)(struct cdp_soc_t *soc_hdl,
  1904. uint8_t pdev_id);
  1905. QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1906. qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl,
  1907. uint8_t vdev_id, qdf_nbuf_t skb);
  1908. void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
  1909. uint32_t value);
  1910. QDF_STATUS (*ipa_update_peer_rx_stats)(struct cdp_soc_t *soc_hdl,
  1911. uint8_t vdev_id,
  1912. uint8_t *peer_mac,
  1913. qdf_nbuf_t nbuf);
  1914. #ifdef FEATURE_METERING
  1915. QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl,
  1916. uint8_t pdev_id,
  1917. uint8_t reset_stats);
  1918. QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl,
  1919. uint8_t pdev_id, uint64_t quota_bytes);
  1920. #endif
  1921. #ifdef IPA_OPT_WIFI_DP
  1922. int (*ipa_pcie_link_up)(struct cdp_soc_t *soc_hdl);
  1923. void (*ipa_pcie_link_down)(struct cdp_soc_t *soc_hdl);
  1924. #endif
  1925. QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl,
  1926. uint8_t pdev_id);
  1927. QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl,
  1928. uint8_t pdev_id);
  1929. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || \
  1930. defined(CONFIG_IPA_WDI_UNIFIED_API)
  1931. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1932. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1933. void *ipa_wdi_meter_notifier_cb,
  1934. uint32_t ipa_desc_size, void *ipa_priv,
  1935. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1936. uint32_t *rx_pipe_handle, bool is_smmu_enabled,
  1937. qdf_ipa_sys_connect_params_t *sys_in,
  1938. bool over_gsi, qdf_ipa_wdi_hdl_t hdl,
  1939. qdf_ipa_wdi_hdl_t id,
  1940. void *ipa_ast_notify_cb);
  1941. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  1942. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1943. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1944. void *ipa_wdi_meter_notifier_cb,
  1945. uint32_t ipa_desc_size, void *ipa_priv,
  1946. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1947. uint32_t *rx_pipe_handle);
  1948. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  1949. QDF_STATUS (*ipa_cleanup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1950. uint32_t tx_pipe_handle,
  1951. uint32_t rx_pipe_handle,
  1952. qdf_ipa_wdi_hdl_t hdl);
  1953. QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
  1954. qdf_ipa_client_type_t prod_client,
  1955. qdf_ipa_client_type_t cons_client,
  1956. uint8_t session_id, bool is_ipv6_enabled,
  1957. qdf_ipa_wdi_hdl_t hdl);
  1958. QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled,
  1959. qdf_ipa_wdi_hdl_t hdl);
  1960. QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl,
  1961. uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl);
  1962. QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl,
  1963. uint8_t pdev_id, qdf_ipa_wdi_hdl_t hdl);
  1964. QDF_STATUS (*ipa_set_perf_level)(int client,
  1965. uint32_t max_supported_bw_mbps,
  1966. qdf_ipa_wdi_hdl_t hdl);
  1967. bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1968. qdf_nbuf_t nbuf, bool *fwd_success);
  1969. QDF_STATUS (*ipa_tx_buf_smmu_mapping)(struct cdp_soc_t *soc_hdl,
  1970. uint8_t pdev_id,
  1971. const char *func,
  1972. uint32_t line);
  1973. QDF_STATUS (*ipa_tx_buf_smmu_unmapping)(struct cdp_soc_t *soc_hdl,
  1974. uint8_t pdev_id,
  1975. const char *func,
  1976. uint32_t line);
  1977. #ifdef IPA_OPT_WIFI_DP
  1978. QDF_STATUS (*ipa_rx_super_rule_setup)(struct cdp_soc_t *soc_hdl,
  1979. void *flt_params);
  1980. #endif
  1981. #ifdef IPA_WDS_EASYMESH_FEATURE
  1982. QDF_STATUS (*ipa_ast_create)(struct cdp_soc_t *soc_hdl,
  1983. qdf_ipa_ast_info_type_t *data);
  1984. #endif
  1985. void (*ipa_get_wdi_version)(struct cdp_soc_t *soc_hdl,
  1986. uint8_t *wdi_ver);
  1987. };
  1988. #endif
  1989. #ifdef DP_POWER_SAVE
  1990. /**
  1991. * struct cdp_tx_delay_ops - mcl tx delay ops
  1992. * @tx_delay: handler to get tx packet delay
  1993. * @tx_delay_hist: handler to get tx packet delay histogram
  1994. * @tx_packet_count: handler to get tx packet count
  1995. * @tx_set_compute_interval: update compute interval period for TSM stats
  1996. *
  1997. * Function pointer for operations related to tx delay.
  1998. */
  1999. struct cdp_tx_delay_ops {
  2000. void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2001. uint32_t *queue_delay_microsec,
  2002. uint32_t *tx_delay_microsec, int category);
  2003. void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2004. uint16_t *bin_values, int category);
  2005. void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  2006. uint16_t *out_packet_count,
  2007. uint16_t *out_packet_loss_count, int category);
  2008. void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl,
  2009. uint8_t pdev_id, uint32_t interval);
  2010. };
  2011. /**
  2012. * struct cdp_bus_ops - mcl bus suspend/resume ops
  2013. * @bus_suspend: handler for bus suspend
  2014. * @bus_resume: handler for bus resume
  2015. * @process_wow_ack_rsp: handler for wow ack response
  2016. * @process_target_suspend_req: handler for target suspend request
  2017. */
  2018. struct cdp_bus_ops {
  2019. QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  2020. QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  2021. void (*process_wow_ack_rsp)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  2022. void (*process_target_suspend_req)(struct cdp_soc_t *soc_hdl,
  2023. uint8_t pdev_id);
  2024. };
  2025. #endif
  2026. #ifdef RECEIVE_OFFLOAD
  2027. /**
  2028. * struct cdp_rx_offld_ops - mcl host receive offload ops
  2029. * @register_rx_offld_flush_cb:
  2030. * @deregister_rx_offld_flush_cb:
  2031. */
  2032. struct cdp_rx_offld_ops {
  2033. void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
  2034. void (*deregister_rx_offld_flush_cb)(void);
  2035. };
  2036. #endif
  2037. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2038. /**
  2039. * struct cdp_cfr_ops - host cfr ops
  2040. * @txrx_get_cfr_rcc: Handler to get CFR mode
  2041. * @txrx_set_cfr_rcc: Handler to enable/disable CFR mode
  2042. * @txrx_get_cfr_dbg_stats: Handler to get debug statistics for CFR mode
  2043. * @txrx_clear_cfr_dbg_stats: Handler to clear debug statistics for CFR mode
  2044. */
  2045. struct cdp_cfr_ops {
  2046. bool (*txrx_get_cfr_rcc)(struct cdp_soc_t *soc_hdl,
  2047. uint8_t pdev_id);
  2048. void (*txrx_set_cfr_rcc)(struct cdp_soc_t *soc_hdl,
  2049. uint8_t pdev_id,
  2050. bool enable);
  2051. void (*txrx_get_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
  2052. uint8_t pdev_id,
  2053. struct cdp_cfr_rcc_stats *buf);
  2054. void (*txrx_clear_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
  2055. uint8_t pdev_id);
  2056. };
  2057. #endif
  2058. #ifdef WLAN_SUPPORT_MSCS
  2059. /**
  2060. * struct cdp_mscs_ops - data path ops for MSCS
  2061. * @mscs_peer_lookup_n_get_priority:
  2062. */
  2063. struct cdp_mscs_ops {
  2064. int (*mscs_peer_lookup_n_get_priority)(struct cdp_soc_t *soc,
  2065. uint8_t *src_mac,
  2066. uint8_t *dst_mac,
  2067. qdf_nbuf_t nbuf);
  2068. };
  2069. #endif
  2070. #ifdef WLAN_SUPPORT_MESH_LATENCY
  2071. /**
  2072. * struct cdp_mesh_latency_ops - data path ops for Mesh latency
  2073. * @mesh_latency_update_peer_parameter:
  2074. */
  2075. struct cdp_mesh_latency_ops {
  2076. QDF_STATUS (*mesh_latency_update_peer_parameter)(
  2077. struct cdp_soc_t *soc,
  2078. uint8_t *dest_mac, uint32_t service_interval_dl,
  2079. uint32_t burst_size_dl, uint32_t service_interval_ul,
  2080. uint32_t burst_size_ul, uint16_t priority,
  2081. uint8_t add_or_sub);
  2082. };
  2083. #endif
  2084. #ifdef WLAN_SUPPORT_SCS
  2085. /**
  2086. * struct cdp_scs_ops - data path ops for SCS
  2087. * @scs_peer_lookup_n_rule_match : Handler for peer lookup and scs rule match
  2088. */
  2089. struct cdp_scs_ops {
  2090. bool (*scs_peer_lookup_n_rule_match)(struct cdp_soc_t *soc,
  2091. uint32_t rule_id,
  2092. uint8_t *dst_mac_addr);
  2093. };
  2094. #endif
  2095. #ifdef CONFIG_SAWF_DEF_QUEUES
  2096. struct cdp_sawf_ops {
  2097. QDF_STATUS
  2098. (*sawf_def_queues_map_req)(struct cdp_soc_t *soc, uint8_t *mac_addr,
  2099. uint8_t svc_class_id);
  2100. QDF_STATUS
  2101. (*sawf_def_queues_unmap_req)(struct cdp_soc_t *soc, uint8_t *mac_addr,
  2102. uint8_t svc_class_id);
  2103. QDF_STATUS
  2104. (*sawf_def_queues_get_map_report)(struct cdp_soc_t *soc,
  2105. uint8_t *mac_addr);
  2106. #ifdef CONFIG_SAWF
  2107. QDF_STATUS
  2108. (*txrx_get_peer_sawf_delay_stats)(struct cdp_soc_t *soc,
  2109. uint32_t svc_id, uint8_t *mac,
  2110. void *data);
  2111. QDF_STATUS
  2112. (*txrx_get_peer_sawf_tx_stats)(struct cdp_soc_t *soc,
  2113. uint32_t svc_id, uint8_t *mac,
  2114. void *data);
  2115. QDF_STATUS
  2116. (*sawf_mpdu_stats_req)(struct cdp_soc_t *soc, uint8_t enable);
  2117. QDF_STATUS
  2118. (*sawf_mpdu_details_stats_req)(struct cdp_soc_t *soc, uint8_t enable);
  2119. QDF_STATUS
  2120. (*txrx_sawf_set_mov_avg_params)(uint32_t num_pkt, uint32_t num_win);
  2121. QDF_STATUS
  2122. (*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs);
  2123. QDF_STATUS
  2124. (*txrx_sawf_init_telemtery_params)(void);
  2125. QDF_STATUS
  2126. (*telemetry_get_throughput_stats)(void *arg, uint64_t *in_bytes,
  2127. uint64_t *in_cnt, uint64_t *tx_bytes,
  2128. uint64_t *tx_cnt, uint8_t tid,
  2129. uint8_t msduq);
  2130. QDF_STATUS
  2131. (*telemetry_get_mpdu_stats)(void *arg, uint64_t *svc_int_pass,
  2132. uint64_t *svc_int_fail,
  2133. uint64_t *burst_pass, uint64_t *burst_fail,
  2134. uint8_t tid, uint8_t msduq);
  2135. QDF_STATUS
  2136. (*telemetry_get_drop_stats)(void *arg, uint64_t *pass, uint64_t *drop,
  2137. uint64_t *drop_ttl, uint8_t tid,
  2138. uint8_t msduq);
  2139. QDF_STATUS
  2140. (*peer_config_ul)(struct cdp_soc_t *hdl, uint8_t *mac_addr, uint8_t tid,
  2141. uint32_t service_interval, uint32_t burst_size,
  2142. uint32_t min_tput, uint32_t max_latency,
  2143. uint8_t add_or_sub);
  2144. bool
  2145. (*swaf_peer_is_sla_configured)(struct cdp_soc_t *soc,
  2146. uint8_t *mac_addr);
  2147. #endif
  2148. };
  2149. #endif
  2150. #ifdef WLAN_SUPPORT_PPEDS
  2151. struct cdp_ppeds_txrx_ops {
  2152. QDF_STATUS
  2153. (*ppeds_vp_setup_recovery)(struct cdp_soc_t *soc,
  2154. uint8_t vdev_id, uint16_t profile_idx);
  2155. QDF_STATUS
  2156. (*ppeds_entry_attach)(struct cdp_soc_t *soc,
  2157. uint8_t vdev_id, void *vpai,
  2158. int32_t *ppe_vp_num,
  2159. struct cdp_ds_vp_params *vp_params);
  2160. QDF_STATUS
  2161. (*ppeds_enable_pri2tid)(struct cdp_soc_t *soc,
  2162. uint8_t vdev_id, bool val);
  2163. void (*ppeds_entry_detach)(struct cdp_soc_t *soc,
  2164. uint8_t vdev_id,
  2165. struct cdp_ds_vp_params *vp_params);
  2166. void (*ppeds_set_int_pri2tid)(struct cdp_soc_t *soc,
  2167. uint8_t *pri2tid);
  2168. void (*ppeds_update_int_pri2tid)(struct cdp_soc_t *soc,
  2169. uint8_t pri, uint8_t tid);
  2170. void (*ppeds_entry_dump)(struct cdp_soc_t *soc);
  2171. };
  2172. #endif /* WLAN_SUPPORT_PPEDS */
  2173. struct cdp_ops {
  2174. struct cdp_cmn_ops *cmn_drv_ops;
  2175. struct cdp_ctrl_ops *ctrl_ops;
  2176. struct cdp_me_ops *me_ops;
  2177. struct cdp_mon_ops *mon_ops;
  2178. struct cdp_host_stats_ops *host_stats_ops;
  2179. struct cdp_wds_ops *wds_ops;
  2180. struct cdp_raw_ops *raw_ops;
  2181. struct cdp_pflow_ops *pflow_ops;
  2182. #ifdef DP_PEER_EXTENDED_API
  2183. struct cdp_misc_ops *misc_ops;
  2184. struct cdp_peer_ops *peer_ops;
  2185. struct cdp_ocb_ops *ocb_ops;
  2186. struct cdp_mob_stats_ops *mob_stats_ops;
  2187. struct cdp_pmf_ops *pmf_ops;
  2188. #endif
  2189. #ifdef DP_FLOW_CTL
  2190. struct cdp_cfg_ops *cfg_ops;
  2191. struct cdp_flowctl_ops *flowctl_ops;
  2192. struct cdp_lflowctl_ops *l_flowctl_ops;
  2193. struct cdp_throttle_ops *throttle_ops;
  2194. #endif
  2195. #ifdef DP_POWER_SAVE
  2196. struct cdp_bus_ops *bus_ops;
  2197. struct cdp_tx_delay_ops *delay_ops;
  2198. #endif
  2199. #ifdef IPA_OFFLOAD
  2200. struct cdp_ipa_ops *ipa_ops;
  2201. #endif
  2202. #ifdef RECEIVE_OFFLOAD
  2203. struct cdp_rx_offld_ops *rx_offld_ops;
  2204. #endif
  2205. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2206. struct cdp_cfr_ops *cfr_ops;
  2207. #endif
  2208. #ifdef WLAN_SUPPORT_MSCS
  2209. struct cdp_mscs_ops *mscs_ops;
  2210. #endif
  2211. #ifdef WLAN_SUPPORT_MESH_LATENCY
  2212. struct cdp_mesh_latency_ops *mesh_latency_ops;
  2213. #endif
  2214. #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
  2215. struct cdp_mlo_ops *mlo_ops;
  2216. #endif
  2217. #ifdef CONFIG_SAWF_DEF_QUEUES
  2218. struct cdp_sawf_ops *sawf_ops;
  2219. #endif
  2220. #ifdef WLAN_SUPPORT_SCS
  2221. struct cdp_scs_ops *scs_ops;
  2222. #endif
  2223. #ifdef WLAN_SUPPORT_PPEDS
  2224. struct cdp_ppeds_txrx_ops *ppeds_ops;
  2225. #endif
  2226. };
  2227. #endif