cdp_txrx_ops.h 71 KB

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