cdp_txrx_ops.h 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681
  1. /*
  2. * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  3. *
  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. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  35. #include <qdf_ipa_wdi3.h>
  36. #else
  37. #include <qdf_ipa.h>
  38. #endif
  39. #endif
  40. /**
  41. * bitmap values to indicate special handling of peer_delete
  42. */
  43. #define CDP_PEER_DELETE_NO_SPECIAL 0
  44. #define CDP_PEER_DO_NOT_START_UNMAP_TIMER 1
  45. struct hif_opaque_softc;
  46. /* same as ieee80211_nac_param */
  47. enum cdp_nac_param_cmd {
  48. /* IEEE80211_NAC_PARAM_ADD */
  49. CDP_NAC_PARAM_ADD = 1,
  50. /* IEEE80211_NAC_PARAM_DEL */
  51. CDP_NAC_PARAM_DEL,
  52. /* IEEE80211_NAC_PARAM_LIST */
  53. CDP_NAC_PARAM_LIST,
  54. };
  55. /**
  56. * enum vdev_peer_protocol_enter_exit - whether ingress or egress
  57. * @CDP_VDEV_PEER_PROTOCOL_IS_INGRESS: ingress
  58. * @CDP_VDEV_PEER_PROTOCOL_IS_EGRESS: egress
  59. *
  60. * whether ingress or egress
  61. */
  62. enum vdev_peer_protocol_enter_exit {
  63. CDP_VDEV_PEER_PROTOCOL_IS_INGRESS,
  64. CDP_VDEV_PEER_PROTOCOL_IS_EGRESS
  65. };
  66. /**
  67. * enum vdev_peer_protocol_tx_rx - whether tx or rx
  68. * @CDP_VDEV_PEER_PROTOCOL_IS_TX: tx
  69. * @CDP_VDEV_PEER_PROTOCOL_IS_RX: rx
  70. *
  71. * whether tx or rx
  72. */
  73. enum vdev_peer_protocol_tx_rx {
  74. CDP_VDEV_PEER_PROTOCOL_IS_TX,
  75. CDP_VDEV_PEER_PROTOCOL_IS_RX
  76. };
  77. /******************************************************************************
  78. *
  79. * Control Interface (A Interface)
  80. *
  81. *****************************************************************************/
  82. struct cdp_cmn_ops {
  83. QDF_STATUS (*txrx_soc_attach_target)(ol_txrx_soc_handle soc);
  84. int (*txrx_pdev_attach_target)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  85. QDF_STATUS (*txrx_vdev_attach)
  86. (struct cdp_soc_t *soc, uint8_t pdev_id, uint8_t *mac,
  87. uint8_t vdev_id, enum wlan_op_mode op_mode,
  88. enum wlan_op_subtype subtype);
  89. QDF_STATUS
  90. (*txrx_vdev_detach)(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
  91. ol_txrx_vdev_delete_cb callback,
  92. void *cb_context);
  93. QDF_STATUS (*txrx_pdev_attach)
  94. (ol_txrx_soc_handle soc, HTC_HANDLE htc_pdev,
  95. qdf_device_t osdev, uint8_t pdev_id);
  96. int (*txrx_pdev_post_attach)(struct cdp_soc_t *soc, uint8_t pdev_id);
  97. void
  98. (*txrx_pdev_pre_detach)(struct cdp_soc_t *soc, uint8_t pdev_id,
  99. int force);
  100. QDF_STATUS
  101. (*txrx_pdev_detach)(struct cdp_soc_t *psoc, uint8_t pdev_id,
  102. int force);
  103. /**
  104. * txrx_pdev_deinit() - Deinitialize pdev and dp ring memory
  105. * @soc: soc dp handle
  106. * @pdev_id: id of Dp pdev handle
  107. * @force: Force deinit or not
  108. *
  109. * Return: QDF_STATUS
  110. */
  111. QDF_STATUS
  112. (*txrx_pdev_deinit)(struct cdp_soc_t *soc, uint8_t pdev_id,
  113. int force);
  114. QDF_STATUS
  115. (*txrx_peer_create)
  116. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  117. uint8_t *peer_mac_addr);
  118. QDF_STATUS
  119. (*txrx_peer_setup)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  120. uint8_t *peer_mac);
  121. QDF_STATUS
  122. (*txrx_cp_peer_del_response)
  123. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  124. uint8_t *peer_mac_addr);
  125. QDF_STATUS
  126. (*txrx_peer_teardown)
  127. (struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *peer_mac);
  128. int (*txrx_peer_add_ast)
  129. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  130. uint8_t *mac_addr, enum cdp_txrx_ast_entry_type type,
  131. uint32_t flags);
  132. int (*txrx_peer_update_ast)
  133. (ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
  134. uint8_t *mac_addr, uint32_t flags);
  135. bool (*txrx_peer_get_ast_info_by_soc)
  136. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  137. struct cdp_ast_entry_info *ast_entry_info);
  138. bool (*txrx_peer_get_ast_info_by_pdev)
  139. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  140. uint8_t pdev_id,
  141. struct cdp_ast_entry_info *ast_entry_info);
  142. QDF_STATUS (*txrx_peer_ast_delete_by_soc)
  143. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  144. txrx_ast_free_cb callback,
  145. void *cookie);
  146. QDF_STATUS (*txrx_peer_ast_delete_by_pdev)
  147. (ol_txrx_soc_handle soc, uint8_t *ast_mac_addr,
  148. uint8_t pdev_id,
  149. txrx_ast_free_cb callback,
  150. void *cookie);
  151. QDF_STATUS
  152. (*txrx_peer_delete)(struct cdp_soc_t *soc, uint8_t vdev_id,
  153. uint8_t *peer_mac, uint32_t bitmap);
  154. QDF_STATUS (*txrx_set_monitor_mode)(struct cdp_soc_t *soc,
  155. uint8_t vdev_id,
  156. uint8_t smart_monitor);
  157. void (*txrx_peer_delete_sync)(struct cdp_soc_t *soc, uint8_t vdev_id,
  158. uint8_t *peer_mac,
  159. QDF_STATUS(*delete_cb)(
  160. uint8_t vdev_id,
  161. uint32_t peerid_cnt,
  162. uint16_t *peerid_list),
  163. uint32_t bitmap);
  164. void (*txrx_peer_unmap_sync_cb_set)(struct cdp_soc_t *soc_hdl,
  165. uint8_t pdev_id,
  166. ol_txrx_peer_unmap_sync_cb
  167. peer_unmap_sync);
  168. QDF_STATUS
  169. (*txrx_get_peer_mac_from_peer_id)
  170. (struct cdp_soc_t *cdp_soc,
  171. uint32_t peer_id, uint8_t *peer_mac);
  172. void
  173. (*txrx_vdev_tx_lock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  174. void
  175. (*txrx_vdev_tx_unlock)(struct cdp_soc_t *soc, uint8_t vdev_id);
  176. QDF_STATUS
  177. (*txrx_ath_getstats)(struct cdp_soc_t *soc, uint8_t id,
  178. struct cdp_dev_stats *stats, uint8_t type);
  179. QDF_STATUS
  180. (*txrx_set_gid_flag)(struct cdp_soc_t *soc, uint8_t pdev_id,
  181. u_int8_t *mem_status,
  182. u_int8_t *user_position);
  183. uint32_t (*txrx_fw_supported_enh_stats_version)(struct cdp_soc_t *soc,
  184. uint8_t pdev_id);
  185. QDF_STATUS
  186. (*txrx_if_mgmt_drain)(struct cdp_soc_t *soc, uint8_t pdev_id,
  187. int force);
  188. QDF_STATUS
  189. (*txrx_set_curchan)(struct cdp_soc_t *soc, uint8_t pdev_id,
  190. uint32_t chan_mhz);
  191. QDF_STATUS
  192. (*txrx_set_privacy_filters)
  193. (struct cdp_soc_t *soc, uint8_t vdev_id, void *filter,
  194. uint32_t num);
  195. uint32_t (*txrx_get_cfg)(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg);
  196. /********************************************************************
  197. * Data Interface (B Interface)
  198. ********************************************************************/
  199. QDF_STATUS
  200. (*txrx_vdev_register)(struct cdp_soc_t *soc, uint8_t vdev_id,
  201. ol_osif_vdev_handle osif_vdev,
  202. struct ol_txrx_ops *txrx_ops);
  203. int (*txrx_mgmt_send)(struct cdp_soc_t *soc, uint8_t vdev_id,
  204. qdf_nbuf_t tx_mgmt_frm, uint8_t type);
  205. int (*txrx_mgmt_send_ext)(struct cdp_soc_t *soc, uint8_t vdev_id,
  206. qdf_nbuf_t tx_mgmt_frm, uint8_t type,
  207. uint8_t use_6mbps, uint16_t chanfreq);
  208. /**
  209. * ol_txrx_mgmt_tx_cb - tx management delivery notification
  210. * callback function
  211. */
  212. QDF_STATUS
  213. (*txrx_mgmt_tx_cb_set)(struct cdp_soc_t *soc, uint8_t pdev_id,
  214. uint8_t type,
  215. ol_txrx_mgmt_tx_cb download_cb,
  216. ol_txrx_mgmt_tx_cb ota_ack_cb,
  217. void *ctxt);
  218. /**
  219. * ol_txrx_data_tx_cb - Function registered with the data path
  220. * that is called when tx frames marked as "no free" are
  221. * done being transmitted
  222. */
  223. void (*txrx_data_tx_cb_set)(struct cdp_soc_t *soc, uint8_t vdev_id,
  224. ol_txrx_data_tx_cb callback, void *ctxt);
  225. qdf_nbuf_t (*tx_send_exc)
  226. (ol_txrx_soc_handle soc, uint8_t vdev_id, qdf_nbuf_t msdu_list,
  227. struct cdp_tx_exception_metadata *tx_exc_metadata);
  228. /*******************************************************************
  229. * Statistics and Debugging Interface (C Interface)
  230. ********************************************************************/
  231. int (*txrx_aggr_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  232. int max_subfrms_ampdu,
  233. int max_subfrms_amsdu);
  234. A_STATUS
  235. (*txrx_fw_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  236. struct ol_txrx_stats_req *req,
  237. bool per_vdev, bool response_expected);
  238. int (*txrx_debug)(struct cdp_soc_t *soc, uint8_t vdev_id,
  239. int debug_specs);
  240. QDF_STATUS
  241. (*txrx_fw_stats_cfg)(struct cdp_soc_t *soc, uint8_t vdev_id,
  242. uint8_t cfg_stats_type, uint32_t cfg_val);
  243. void (*txrx_print_level_set)(unsigned level);
  244. /**
  245. * ol_txrx_get_vdev_mac_addr() - Return mac addr of vdev
  246. * @soc: datapath soc handle
  247. * @vdev_id: vdev id
  248. *
  249. * Return: vdev mac address
  250. */
  251. uint8_t * (*txrx_get_vdev_mac_addr)(struct cdp_soc_t *soc,
  252. uint8_t vdev_id);
  253. /**
  254. * ol_txrx_get_ctrl_pdev_from_vdev() - Return control pdev of vdev
  255. * @soc: datapath soc handle
  256. * @vdev_id: vdev id
  257. *
  258. * Return: Handle to control pdev
  259. */
  260. struct cdp_cfg *(*txrx_get_ctrl_pdev_from_vdev)(struct cdp_soc_t *soc,
  261. uint8_t vdev_id);
  262. /**
  263. * txrx_get_mon_vdev_from_pdev() - Return monitor mode vdev
  264. * @soc: datapath soc handle
  265. * @pdev: pdev id
  266. *
  267. * Return: vdev_id
  268. */
  269. uint8_t (*txrx_get_mon_vdev_from_pdev)(struct cdp_soc_t *soc,
  270. uint8_t pdev_id);
  271. void (*txrx_soc_detach)(struct cdp_soc_t *soc);
  272. /**
  273. * txrx_soc_deinit() - Deinitialize dp soc and dp ring memory
  274. * @soc: Opaque Dp handle
  275. *
  276. * Return None
  277. */
  278. void (*txrx_soc_deinit)(struct cdp_soc_t *soc);
  279. /**
  280. * txrx_soc_init() - Initialize dp soc and dp ring memory
  281. * @soc: Opaque Dp handle
  282. * @ctrl_psoc: Opaque Cp handle
  283. * @htchdl: Opaque htc handle
  284. * @hifhdl: Opaque hif handle
  285. *
  286. * Return: None
  287. */
  288. void *(*txrx_soc_init)(struct cdp_soc_t *soc,
  289. struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  290. struct hif_opaque_softc *hif_handle,
  291. HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
  292. struct ol_if_ops *ol_ops, uint16_t device_id);
  293. QDF_STATUS (*txrx_pdev_init)(ol_txrx_soc_handle soc,
  294. HTC_HANDLE htc_handle,
  295. qdf_device_t qdf_osdev,
  296. uint8_t pdev_id);
  297. /**
  298. * txrx_tso_soc_attach() - TSO attach handler triggered during
  299. * dynamic tso activation
  300. * @soc: Opaque Dp handle
  301. *
  302. * Return: QDF status
  303. */
  304. QDF_STATUS (*txrx_tso_soc_attach)(struct cdp_soc_t *soc);
  305. /**
  306. * txrx_tso_soc_detach() - TSO detach handler triggered during
  307. * dynamic tso de-activation
  308. * @soc: Opaque Dp handle
  309. *
  310. * Return: QDF status
  311. */
  312. QDF_STATUS (*txrx_tso_soc_detach)(struct cdp_soc_t *soc);
  313. int (*addba_resp_tx_completion)(struct cdp_soc_t *cdp_soc,
  314. uint8_t *peer_mac,
  315. uint16_t vdev_id, uint8_t tid,
  316. int status);
  317. int (*addba_requestprocess)(struct cdp_soc_t *cdp_soc,
  318. uint8_t *peer_mac,
  319. uint16_t vdev_id,
  320. uint8_t dialogtoken,
  321. uint16_t tid, uint16_t batimeout,
  322. uint16_t buffersize,
  323. uint16_t startseqnum);
  324. QDF_STATUS
  325. (*addba_responsesetup)(struct cdp_soc_t *cdp_soc,
  326. uint8_t *peer_mac,
  327. uint16_t vdev_id, uint8_t tid,
  328. uint8_t *dialogtoken, uint16_t *statuscode,
  329. uint16_t *buffersize, uint16_t *batimeout);
  330. int (*delba_process)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  331. uint16_t vdev_id, int tid, uint16_t reasoncode);
  332. /**
  333. * delba_tx_completion() - Indicate delba tx status
  334. * @cdp_soc: soc handle
  335. * @peer_mac: Peer mac address
  336. * @vdev_id: vdev id
  337. * @tid: Tid number
  338. * @status: Tx completion status
  339. *
  340. * Return: 0 on Success, 1 on failure
  341. */
  342. int (*delba_tx_completion)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  343. uint16_t vdev_id,
  344. uint8_t tid, int status);
  345. QDF_STATUS
  346. (*set_addba_response)(struct cdp_soc_t *cdp_soc, uint8_t *peer_mac,
  347. uint16_t vdev_id, uint8_t tid,
  348. uint16_t statuscode);
  349. QDF_STATUS
  350. (*set_vdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  351. uint8_t vdev_id, uint8_t map_id);
  352. int (*txrx_get_total_per)(struct cdp_soc_t *soc, uint8_t pdev_id);
  353. void (*flush_cache_rx_queue)(void);
  354. QDF_STATUS (*set_pdev_dscp_tid_map)(struct cdp_soc_t *soc_handle,
  355. uint8_t pdev_id,
  356. uint8_t map_id,
  357. uint8_t tos, uint8_t tid);
  358. QDF_STATUS (*txrx_stats_request)(struct cdp_soc_t *soc_handle,
  359. uint8_t vdev_id,
  360. struct cdp_txrx_stats_req *req);
  361. QDF_STATUS (*display_stats)(struct cdp_soc_t *psoc, uint16_t value,
  362. enum qdf_stats_verbosity_level level);
  363. QDF_STATUS (*txrx_intr_attach)(struct cdp_soc_t *soc_handle);
  364. void (*txrx_intr_detach)(struct cdp_soc_t *soc_handle);
  365. QDF_STATUS (*set_pn_check)(struct cdp_soc_t *soc_handle,
  366. uint8_t vdev_id, uint8_t *peermac,
  367. enum cdp_sec_type sec_type,
  368. uint32_t *rx_pn);
  369. QDF_STATUS(*set_key_sec_type)(struct cdp_soc_t *soc_handle,
  370. uint8_t vdev_id, uint8_t *peermac,
  371. enum cdp_sec_type sec_type,
  372. bool is_unicast);
  373. QDF_STATUS (*update_config_parameters)(struct cdp_soc *psoc,
  374. struct cdp_config_params *params);
  375. void *(*get_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id);
  376. void (*set_dp_txrx_handle)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  377. void *dp_hdl);
  378. void *(*get_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
  379. uint8_t vdev_id);
  380. QDF_STATUS (*set_vdev_dp_ext_txrx_handle)(struct cdp_soc_t *soc,
  381. uint8_t vdev_id,
  382. uint16_t size);
  383. void *(*get_soc_dp_txrx_handle)(struct cdp_soc *soc_handle);
  384. void (*set_soc_dp_txrx_handle)(struct cdp_soc *soc_handle,
  385. void *dp_txrx_handle);
  386. QDF_STATUS (*map_pdev_to_lmac)(ol_txrx_soc_handle soc, uint8_t pdev_id,
  387. uint32_t lmac_id);
  388. QDF_STATUS (*handle_mode_change)(ol_txrx_soc_handle soc,
  389. uint8_t pdev_id, uint32_t lmac_id);
  390. QDF_STATUS (*set_pdev_status_down)(struct cdp_soc_t *soc_handle,
  391. uint8_t pdev_id, bool is_pdev_down);
  392. QDF_STATUS (*txrx_peer_reset_ast)
  393. (ol_txrx_soc_handle soc, uint8_t *ast_macaddr,
  394. uint8_t *peer_macaddr, uint8_t vdev_id);
  395. QDF_STATUS (*txrx_peer_reset_ast_table)(ol_txrx_soc_handle soc,
  396. uint8_t vdev_id);
  397. void (*txrx_peer_flush_ast_table)(ol_txrx_soc_handle soc);
  398. void (*txrx_set_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  399. uint8_t ac, uint32_t value);
  400. void (*txrx_get_ba_aging_timeout)(struct cdp_soc_t *soc_handle,
  401. uint8_t ac, uint32_t *value);
  402. QDF_STATUS (*txrx_peer_map_attach)(ol_txrx_soc_handle soc,
  403. uint32_t num_peers,
  404. uint32_t max_ast_index,
  405. bool peer_map_unmap_v2);
  406. QDF_STATUS (*set_soc_param)(ol_txrx_soc_handle soc,
  407. enum cdp_soc_param_t param,
  408. uint32_t value);
  409. ol_txrx_tx_fp tx_send;
  410. /**
  411. * txrx_get_os_rx_handles_from_vdev() - Return function, osif vdev
  412. * to deliver pkt to stack.
  413. * @soc: datapath soc handle
  414. * @vdev: vdev id
  415. * @stack_fn: pointer to - function pointer to deliver RX pkt to stack
  416. * @osif_vdev: pointer to - osif vdev to deliver RX packet to.
  417. */
  418. void (*txrx_get_os_rx_handles_from_vdev)
  419. (ol_txrx_soc_handle soc,
  420. uint8_t vdev_id,
  421. ol_txrx_rx_fp *stack_fn,
  422. ol_osif_vdev_handle *osif_vdev);
  423. void (*set_rate_stats_ctx)(struct cdp_soc_t *soc,
  424. void *ctx);
  425. int (*txrx_classify_update)
  426. (struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t skb,
  427. enum txrx_direction, struct ol_txrx_nbuf_classify *nbuf_class);
  428. bool (*get_dp_capabilities)(struct cdp_soc_t *soc,
  429. enum cdp_capabilities dp_caps);
  430. void* (*get_rate_stats_ctx)(struct cdp_soc_t *soc);
  431. QDF_STATUS (*txrx_peer_flush_rate_stats)(struct cdp_soc_t *soc,
  432. uint8_t pdev_id,
  433. void *buf);
  434. void* (*txrx_peer_get_wlan_stats_ctx)(struct cdp_soc_t *soc,
  435. uint8_t vdev_id,
  436. uint8_t *mac_addr);
  437. QDF_STATUS (*txrx_flush_rate_stats_request)(struct cdp_soc_t *soc,
  438. uint8_t pdev_id);
  439. QDF_STATUS (*set_pdev_pcp_tid_map)(struct cdp_soc_t *soc,
  440. uint8_t pdev_id,
  441. uint8_t pcp, uint8_t tid);
  442. QDF_STATUS (*set_vdev_pcp_tid_map)(struct cdp_soc_t *soc,
  443. uint8_t vdev_id,
  444. uint8_t pcp, uint8_t tid);
  445. #ifdef QCA_MULTIPASS_SUPPORT
  446. QDF_STATUS (*set_vlan_groupkey)(struct cdp_soc_t *soc, uint8_t vdev_id,
  447. uint16_t vlan_id, uint16_t group_key);
  448. #endif
  449. uint16_t (*get_peer_mac_list)
  450. (ol_txrx_soc_handle soc, uint8_t vdev_id,
  451. u_int8_t newmac[][QDF_MAC_ADDR_SIZE], uint16_t mac_cnt,
  452. bool limit);
  453. };
  454. struct cdp_ctrl_ops {
  455. int
  456. (*txrx_mempools_attach)(ol_txrx_soc_handle dp_soc);
  457. int
  458. (*txrx_update_filter_neighbour_peers)(
  459. struct cdp_soc_t *soc, uint8_t vdev_id,
  460. uint32_t cmd, uint8_t *macaddr);
  461. /* Is this similar to ol_txrx_peer_state_update() in MCL */
  462. /**
  463. * @brief Update the authorize peer object at association time
  464. * @details
  465. * For the host-based implementation of rate-control, it
  466. * updates the peer/node-related parameters within rate-control
  467. * context of the peer at association.
  468. *
  469. * @param soc_hdl - pointer to the soc object
  470. * @param vdev_id - id of the virtual object
  471. * @param peer_mac - mac address of the node's object
  472. * @authorize - either to authorize or unauthorize peer
  473. *
  474. * @return QDF_STATUS
  475. */
  476. QDF_STATUS
  477. (*txrx_peer_authorize)(struct cdp_soc_t *soc_hdl,
  478. uint8_t vdev_id,
  479. uint8_t *peer_mac,
  480. u_int32_t authorize);
  481. void (*tx_flush_buffers)(struct cdp_soc_t *soc, uint8_t vdev_id);
  482. int (*txrx_is_target_ar900b)(struct cdp_soc_t *soc_hdl);
  483. QDF_STATUS
  484. (*txrx_set_vdev_param)(struct cdp_soc_t *soc, uint8_t vdev_id,
  485. enum cdp_vdev_param_type param,
  486. cdp_config_param_type val);
  487. /**
  488. * @brief Set the reo dest ring num of the radio
  489. * @details
  490. * Set the reo destination ring no on which we will receive
  491. * pkts for this radio.
  492. *
  493. * @txrx_soc - soc handle
  494. * @param pdev_id - id of physical device
  495. * @return the reo destination ring number
  496. * @param reo_dest_ring_num - value ranges between 1 - 4
  497. */
  498. QDF_STATUS (*txrx_set_pdev_reo_dest)(
  499. struct cdp_soc_t *txrx_soc,
  500. uint8_t pdev_id,
  501. enum cdp_host_reo_dest_ring reo_dest_ring_num);
  502. /**
  503. * @brief Get the reo dest ring num of the radio
  504. * @details
  505. * Get the reo destination ring no on which we will receive
  506. * pkts for this radio.
  507. *
  508. * @txrx_soc - soc handle
  509. * @param pdev_id - id of physical device
  510. * @return the reo destination ring number
  511. */
  512. enum cdp_host_reo_dest_ring (*txrx_get_pdev_reo_dest)(
  513. struct cdp_soc_t *txrx_soc,
  514. uint8_t pdev_id);
  515. int (*txrx_wdi_event_sub)(struct cdp_soc_t *soc, uint8_t pdev_id,
  516. wdi_event_subscribe *event_cb_sub,
  517. uint32_t event);
  518. int (*txrx_wdi_event_unsub)(struct cdp_soc_t *soc, uint8_t pdev_id,
  519. wdi_event_subscribe *event_cb_sub,
  520. uint32_t event);
  521. int (*txrx_get_sec_type)(ol_txrx_soc_handle soc, uint8_t vdev_id,
  522. uint8_t *peer_mac, uint8_t sec_idx);
  523. QDF_STATUS
  524. (*txrx_update_mgmt_txpow_vdev)(struct cdp_soc_t *soc,
  525. uint8_t vdev_id,
  526. uint8_t subtype, uint8_t tx_power);
  527. /**
  528. * txrx_set_pdev_param() - callback to set pdev parameter
  529. * @soc: opaque soc handle
  530. * @pdev_id:id of data path pdev handle
  531. * @val: value of pdev_tx_capture
  532. *
  533. * Return: status: 0 - Success, non-zero: Failure
  534. */
  535. QDF_STATUS (*txrx_set_pdev_param)(struct cdp_soc_t *soc,
  536. uint8_t pdev_id,
  537. enum cdp_pdev_param_type type,
  538. cdp_config_param_type val);
  539. QDF_STATUS (*txrx_get_pdev_param)(struct cdp_soc_t *soc,
  540. uint8_t pdev_id,
  541. enum cdp_pdev_param_type type,
  542. cdp_config_param_type *val);
  543. QDF_STATUS (*txrx_set_peer_param)(struct cdp_soc_t *soc,
  544. uint8_t vdev_id, uint8_t *peer_mac,
  545. enum cdp_peer_param_type param,
  546. cdp_config_param_type val);
  547. QDF_STATUS (*txrx_get_peer_param)(struct cdp_soc_t *soc,
  548. uint8_t vdev_id, uint8_t *peer_mac,
  549. enum cdp_peer_param_type param,
  550. cdp_config_param_type *val);
  551. void * (*txrx_get_pldev)(struct cdp_soc_t *soc, uint8_t pdev_id);
  552. #ifdef VDEV_PEER_PROTOCOL_COUNT
  553. void (*txrx_peer_protocol_cnt)(struct cdp_soc_t *soc,
  554. int8_t vdev_id,
  555. qdf_nbuf_t nbuf,
  556. bool is_egress,
  557. bool is_rx);
  558. #endif
  559. #ifdef ATH_SUPPORT_NAC_RSSI
  560. QDF_STATUS (*txrx_vdev_config_for_nac_rssi)(struct cdp_soc_t *cdp_soc,
  561. uint8_t vdev_id,
  562. enum cdp_nac_param_cmd cmd,
  563. char *bssid,
  564. char *client_macaddr,
  565. uint8_t chan_num);
  566. QDF_STATUS (*txrx_vdev_get_neighbour_rssi)(struct cdp_soc_t *cdp_soc,
  567. uint8_t vdev_id,
  568. char *macaddr,
  569. uint8_t *rssi);
  570. #endif
  571. #ifdef WLAN_SUPPORT_MSCS
  572. QDF_STATUS
  573. (*txrx_record_mscs_params) (
  574. struct cdp_soc_t *soc, uint8_t *macaddr,
  575. uint8_t vdev_id,
  576. struct cdp_mscs_params *mscs_params,
  577. bool active);
  578. #endif
  579. QDF_STATUS
  580. (*set_key)(struct cdp_soc_t *soc, uint8_t vdev_id, uint8_t *mac,
  581. bool is_unicast, uint32_t *key);
  582. QDF_STATUS (*txrx_get_vdev_param)(struct cdp_soc_t *soc,
  583. uint8_t vdev_id,
  584. enum cdp_vdev_param_type param,
  585. cdp_config_param_type *val);
  586. int (*enable_peer_based_pktlog)(struct cdp_soc_t *cdp_soc,
  587. uint8_t pdev_id,
  588. uint8_t *macaddr, uint8_t enb_dsb);
  589. QDF_STATUS
  590. (*calculate_delay_stats)(struct cdp_soc_t *cdp_soc,
  591. uint8_t vdev_id, qdf_nbuf_t nbuf);
  592. #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
  593. QDF_STATUS (*txrx_update_pdev_rx_protocol_tag)(
  594. struct cdp_soc_t *soc, uint8_t pdev_id,
  595. uint32_t protocol_mask, uint16_t protocol_type,
  596. uint16_t tag);
  597. #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
  598. void (*txrx_dump_pdev_rx_protocol_tag_stats)(
  599. struct cdp_soc_t *soc, uint8_t pdev_id,
  600. uint16_t protocol_type);
  601. #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
  602. #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
  603. #ifdef WLAN_SUPPORT_RX_FLOW_TAG
  604. QDF_STATUS (*txrx_set_rx_flow_tag)(
  605. struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
  606. struct cdp_rx_flow_info *flow_info);
  607. QDF_STATUS (*txrx_dump_rx_flow_tag_stats)(
  608. struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
  609. struct cdp_rx_flow_info *flow_info);
  610. #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
  611. #ifdef QCA_MULTIPASS_SUPPORT
  612. void (*txrx_peer_set_vlan_id)(struct cdp_soc_t *cdp_soc,
  613. uint8_t vdev_id, uint8_t *peer_mac,
  614. uint16_t vlan_id);
  615. #endif
  616. #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
  617. QDF_STATUS (*txrx_update_peer_pkt_capture_params)(
  618. ol_txrx_soc_handle soc, uint8_t pdev_id,
  619. bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
  620. uint8_t *peer_mac);
  621. #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
  622. QDF_STATUS
  623. (*txrx_set_psoc_param)(struct cdp_soc_t *soc,
  624. enum cdp_psoc_param_type param,
  625. cdp_config_param_type val);
  626. QDF_STATUS (*txrx_get_psoc_param)(ol_txrx_soc_handle soc,
  627. enum cdp_psoc_param_type type,
  628. cdp_config_param_type *val);
  629. #ifdef VDEV_PEER_PROTOCOL_COUNT
  630. /*
  631. * Enable per-peer protocol counters
  632. */
  633. void (*txrx_enable_peer_protocol_count)(struct cdp_soc_t *soc,
  634. int8_t vdev_id, bool enable);
  635. void (*txrx_set_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
  636. int8_t vdev_id, int mask);
  637. int (*txrx_is_peer_protocol_count_enabled)(struct cdp_soc_t *soc,
  638. int8_t vdev_id);
  639. int (*txrx_get_peer_protocol_drop_mask)(struct cdp_soc_t *soc,
  640. int8_t vdev_id);
  641. #endif
  642. };
  643. struct cdp_me_ops {
  644. void (*tx_me_alloc_descriptor)(struct cdp_soc_t *soc,
  645. uint8_t pdev_id);
  646. void (*tx_me_free_descriptor)(struct cdp_soc_t *soc, uint8_t pdev_id);
  647. uint16_t (*tx_me_convert_ucast)(struct cdp_soc_t *soc, uint8_t vdev_id,
  648. qdf_nbuf_t wbuf, u_int8_t newmac[][6],
  649. uint8_t newmaccnt, uint8_t tid,
  650. bool is_igmp);
  651. };
  652. struct cdp_mon_ops {
  653. QDF_STATUS (*txrx_reset_monitor_mode)
  654. (ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor);
  655. QDF_STATUS (*txrx_deliver_tx_mgmt)
  656. (struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);
  657. /* HK advance monitor filter support */
  658. QDF_STATUS (*txrx_set_advance_monitor_filter)
  659. (struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  660. struct cdp_monitor_filter *filter_val);
  661. /* Configure full monitor mode */
  662. QDF_STATUS
  663. (*config_full_mon_mode)(struct cdp_soc_t *soc, uint8_t val);
  664. };
  665. struct cdp_host_stats_ops {
  666. int (*txrx_host_stats_get)(struct cdp_soc_t *soc, uint8_t vdev_id,
  667. struct ol_txrx_stats_req *req);
  668. QDF_STATUS (*txrx_host_stats_clr)(struct cdp_soc_t *soc,
  669. uint8_t vdev_id);
  670. QDF_STATUS
  671. (*txrx_host_ce_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  672. int (*txrx_stats_publish)(struct cdp_soc_t *soc, uint8_t pdev_id,
  673. struct cdp_stats_extd *buf);
  674. /**
  675. * @brief Enable enhanced stats functionality.
  676. *
  677. * @param soc - the soc handle
  678. * @param pdev_id - pdev_id of pdev
  679. * @return - QDF_STATUS
  680. */
  681. QDF_STATUS (*txrx_enable_enhanced_stats)(struct cdp_soc_t *soc,
  682. uint8_t pdev_id);
  683. /**
  684. * @brief Disable enhanced stats functionality.
  685. *
  686. * @param soc - the soc handle
  687. * @param pdev_id - pdev_id of pdev
  688. * @return - QDF_STATUS
  689. */
  690. QDF_STATUS (*txrx_disable_enhanced_stats)(struct cdp_soc_t *soc,
  691. uint8_t pdev_id);
  692. QDF_STATUS
  693. (*tx_print_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  694. QDF_STATUS
  695. (*tx_rst_tso_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  696. QDF_STATUS
  697. (*tx_print_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  698. QDF_STATUS
  699. (*tx_rst_sg_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  700. QDF_STATUS
  701. (*print_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  702. QDF_STATUS
  703. (*rst_rx_cksum_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  704. QDF_STATUS
  705. (*txrx_host_me_stats)(struct cdp_soc_t *soc, uint8_t vdev_id);
  706. QDF_STATUS
  707. (*txrx_per_peer_stats)(struct cdp_soc_t *soc, uint8_t *addr);
  708. int (*txrx_host_msdu_ttl_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  709. struct ol_txrx_stats_req *req);
  710. int (*ol_txrx_update_peer_stats)(struct cdp_soc_t *soc,
  711. uint8_t pdev_id,
  712. uint8_t *addr, void *stats,
  713. uint32_t last_tx_rate_mcs,
  714. uint32_t stats_id);
  715. QDF_STATUS
  716. (*get_fw_peer_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  717. uint8_t *addr,
  718. uint32_t cap, uint32_t copy_stats);
  719. QDF_STATUS
  720. (*get_htt_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  721. void *data,
  722. uint32_t data_len);
  723. QDF_STATUS
  724. (*txrx_update_pdev_stats)(struct cdp_soc_t *soc,
  725. uint8_t pdev_id, void *data,
  726. uint16_t stats_id);
  727. QDF_STATUS
  728. (*txrx_get_peer_stats_param)(struct cdp_soc_t *soc,
  729. uint8_t vdev_id,
  730. uint8_t *peer_mac,
  731. enum cdp_peer_stats_type type,
  732. cdp_peer_stats_param_t *buf);
  733. QDF_STATUS
  734. (*txrx_get_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  735. uint8_t *peer_mac,
  736. struct cdp_peer_stats *peer_stats);
  737. QDF_STATUS
  738. (*txrx_reset_peer_ald_stats)(struct cdp_soc_t *soc,
  739. uint8_t vdev_id,
  740. uint8_t *peer_mac);
  741. QDF_STATUS
  742. (*txrx_reset_peer_stats)(struct cdp_soc_t *soc,
  743. uint8_t vdev_id, uint8_t *peer_mac);
  744. int
  745. (*txrx_get_vdev_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  746. void *buf, bool is_aggregate);
  747. int
  748. (*txrx_process_wmi_host_vdev_stats)(ol_txrx_soc_handle soc,
  749. void *data, uint32_t len,
  750. uint32_t stats_id);
  751. int
  752. (*txrx_get_vdev_extd_stats)(struct cdp_soc_t *soc,
  753. uint8_t vdev_id,
  754. wmi_host_vdev_extd_stats *buffer);
  755. QDF_STATUS
  756. (*txrx_update_vdev_stats)(struct cdp_soc_t *soc,
  757. uint8_t vdev_id, void *buf,
  758. uint16_t stats_id);
  759. int
  760. (*txrx_get_radio_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  761. void *buf);
  762. QDF_STATUS
  763. (*txrx_get_pdev_stats)(struct cdp_soc_t *soc, uint8_t pdev_id,
  764. struct cdp_pdev_stats *buf);
  765. int
  766. (*txrx_get_ratekbps)(int preamb, int mcs,
  767. int htflag, int gintval);
  768. QDF_STATUS
  769. (*txrx_update_peer_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
  770. uint8_t *peer_mac, void *stats,
  771. uint32_t last_tx_rate_mcs,
  772. uint32_t stats_id);
  773. };
  774. struct cdp_wds_ops {
  775. QDF_STATUS
  776. (*txrx_set_wds_rx_policy)(struct cdp_soc_t *soc, uint8_t vdev_id,
  777. u_int32_t val);
  778. QDF_STATUS
  779. (*txrx_wds_peer_tx_policy_update)(struct cdp_soc_t *soc,
  780. uint8_t vdev_id, uint8_t *peer_mac,
  781. int wds_tx_ucast, int wds_tx_mcast);
  782. int (*vdev_set_wds)(struct cdp_soc_t *soc, uint8_t vdev_id,
  783. uint32_t val);
  784. };
  785. struct cdp_raw_ops {
  786. int (*txrx_get_nwifi_mode)(struct cdp_soc_t *soc, uint8_t vdev_id);
  787. QDF_STATUS
  788. (*rsim_get_astentry)(struct cdp_soc_t *soc, uint8_t vdev_id,
  789. qdf_nbuf_t *pnbuf, struct cdp_raw_ast *raw_ast);
  790. };
  791. #ifdef PEER_FLOW_CONTROL
  792. struct cdp_pflow_ops {
  793. uint32_t (*pflow_update_pdev_params)(struct cdp_soc_t *soc,
  794. uint8_t pdev_id,
  795. enum _dp_param_t,
  796. uint32_t, void *);
  797. };
  798. #endif /* PEER_FLOW_CONTROL */
  799. #define LRO_IPV4_SEED_ARR_SZ 5
  800. #define LRO_IPV6_SEED_ARR_SZ 11
  801. /**
  802. * struct cdp_lro_hash_config - set rx_offld(LRO/GRO) init parameters
  803. * @lro_enable: indicates whether rx_offld is enabled
  804. * @tcp_flag: If the TCP flags from the packet do not match
  805. * the values in this field after masking with TCP flags mask
  806. * below, packet is not rx_offld eligible
  807. * @tcp_flag_mask: field for comparing the TCP values provided
  808. * above with the TCP flags field in the received packet
  809. * @toeplitz_hash_ipv4: contains seed needed to compute the flow id
  810. * 5-tuple toeplitz hash for ipv4 packets
  811. * @toeplitz_hash_ipv6: contains seed needed to compute the flow id
  812. * 5-tuple toeplitz hash for ipv6 packets
  813. */
  814. struct cdp_lro_hash_config {
  815. uint32_t lro_enable;
  816. uint32_t tcp_flag:9,
  817. tcp_flag_mask:9;
  818. uint32_t toeplitz_hash_ipv4[LRO_IPV4_SEED_ARR_SZ];
  819. uint32_t toeplitz_hash_ipv6[LRO_IPV6_SEED_ARR_SZ];
  820. };
  821. struct ol_if_ops {
  822. void
  823. (*peer_set_default_routing)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  824. uint8_t pdev_id, uint8_t *peer_macaddr,
  825. uint8_t vdev_id,
  826. bool hash_based, uint8_t ring_num);
  827. QDF_STATUS
  828. (*peer_rx_reorder_queue_setup)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  829. uint8_t pdev_id,
  830. uint8_t vdev_id, uint8_t *peer_mac,
  831. qdf_dma_addr_t hw_qdesc, int tid,
  832. uint16_t queue_num,
  833. uint8_t ba_window_size_valid,
  834. uint16_t ba_window_size);
  835. QDF_STATUS
  836. (*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  837. uint8_t pdev_id,
  838. uint8_t vdev_id, uint8_t *peer_macaddr,
  839. uint32_t tid_mask);
  840. int (*peer_unref_delete)(struct cdp_ctrl_objmgr_psoc *psoc,
  841. uint8_t pdev_id,
  842. uint8_t *peer_mac,
  843. uint8_t *vdev_mac, enum wlan_op_mode opmode);
  844. bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
  845. int (*peer_add_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  846. uint8_t vdev_id,
  847. uint8_t *peer_macaddr,
  848. uint16_t peer_id,
  849. const uint8_t *dest_macaddr,
  850. uint8_t *next_node_mac,
  851. uint32_t flags,
  852. uint8_t type);
  853. int (*peer_update_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  854. uint8_t vdev_id,
  855. uint8_t *dest_macaddr,
  856. uint8_t *peer_macaddr,
  857. uint32_t flags);
  858. void (*peer_del_wds_entry)(struct cdp_ctrl_objmgr_psoc *soc,
  859. uint8_t vdev_id,
  860. uint8_t *wds_macaddr,
  861. uint8_t type,
  862. uint8_t delete_in_fw);
  863. QDF_STATUS
  864. (*lro_hash_config)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t pdev_id,
  865. struct cdp_lro_hash_config *rx_offld_hash);
  866. void (*update_dp_stats)(void *soc, void *stats, uint16_t id,
  867. uint8_t type);
  868. #ifdef FEATURE_NAC_RSSI
  869. uint8_t (*rx_invalid_peer)(struct cdp_ctrl_objmgr_psoc *soc,
  870. uint8_t pdev_id, void *msg);
  871. #else
  872. uint8_t (*rx_invalid_peer)(uint8_t vdev_id, void *wh);
  873. #endif
  874. int (*peer_map_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  875. uint16_t peer_id, uint16_t hw_peer_id,
  876. uint8_t vdev_id, uint8_t *peer_mac_addr,
  877. enum cdp_txrx_ast_entry_type peer_type,
  878. uint32_t tx_ast_hashidx);
  879. int (*peer_unmap_event)(struct cdp_ctrl_objmgr_psoc *psoc,
  880. uint16_t peer_id,
  881. uint8_t vdev_id);
  882. int (*get_dp_cfg_param)(struct cdp_ctrl_objmgr_psoc *psoc,
  883. enum cdp_cfg_param_type param_num);
  884. void (*rx_mic_error)(struct cdp_ctrl_objmgr_psoc *psoc,
  885. uint8_t pdev_id,
  886. struct cdp_rx_mic_err_info *info);
  887. bool (*rx_frag_tkip_demic)(struct cdp_ctrl_objmgr_psoc *psoc,
  888. uint8_t vdev_id, uint8_t *peer_mac_addr,
  889. qdf_nbuf_t nbuf,
  890. uint16_t hdr_space);
  891. uint8_t (*freq_to_channel)(struct cdp_ctrl_objmgr_psoc *psoc,
  892. uint8_t pdev_id, uint16_t freq);
  893. uint8_t (*freq_to_band)(struct cdp_ctrl_objmgr_psoc *psoc,
  894. uint8_t pdev_id, uint16_t freq);
  895. #ifdef ATH_SUPPORT_NAC_RSSI
  896. int (*config_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  897. uint8_t pdev_id,
  898. u_int8_t vdev_id,
  899. enum cdp_nac_param_cmd cmd, char *bssid,
  900. char *client_macaddr, uint8_t chan_num);
  901. int
  902. (*config_bssid_in_fw_for_nac_rssi)(struct cdp_ctrl_objmgr_psoc *psoc,
  903. uint8_t pdev_id, u_int8_t vdev_id,
  904. enum cdp_nac_param_cmd cmd,
  905. char *bssid, char *client_mac);
  906. #endif
  907. int (*peer_sta_kickout)(struct cdp_ctrl_objmgr_psoc *psoc,
  908. uint16_t pdev_id, uint8_t *peer_macaddr);
  909. /**
  910. * send_delba() - Send delba to peer
  911. * @psoc: Objmgr soc handle
  912. * @vdev_id: dp vdev id
  913. * @peer_macaddr: Peer mac addr
  914. * @tid: Tid number
  915. *
  916. * Return: 0 for success, non-zero for failure
  917. */
  918. int (*send_delba)(struct cdp_ctrl_objmgr_psoc *psoc, uint8_t vdev_id,
  919. uint8_t *peer_macaddr, uint8_t tid,
  920. uint8_t reason_code);
  921. int
  922. (*peer_delete_multiple_wds_entries)(struct cdp_ctrl_objmgr_psoc *psoc,
  923. uint8_t vdev_id,
  924. uint8_t *dest_macaddr,
  925. uint8_t *peer_macaddr,
  926. uint32_t flags);
  927. int
  928. (*pdev_update_lmac_n_target_pdev_id)(struct cdp_ctrl_objmgr_psoc *psoc,
  929. uint8_t *pdev_id,
  930. uint8_t *lmac_id,
  931. uint8_t *target_pdev_id);
  932. bool (*is_roam_inprogress)(uint32_t vdev_id);
  933. enum QDF_GLOBAL_MODE (*get_con_mode)(void);
  934. #ifdef QCA_PEER_MULTIQ_SUPPORT
  935. int (*peer_ast_flowid_map)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle,
  936. uint16_t peer_id, uint8_t vdev_id,
  937. uint8_t *peer_mac_addr);
  938. #endif
  939. #ifdef DP_MEM_PRE_ALLOC
  940. void *(*dp_prealloc_get_consistent)(uint32_t *size,
  941. void **base_vaddr_unaligned,
  942. qdf_dma_addr_t *paddr_unaligned,
  943. qdf_dma_addr_t *paddr_aligned,
  944. uint32_t align,
  945. uint32_t ring_type);
  946. void (*dp_prealloc_put_consistent)(qdf_size_t size,
  947. void *vaddr_unligned,
  948. qdf_dma_addr_t paddr);
  949. #endif
  950. int (*get_soc_nss_cfg)(struct cdp_ctrl_objmgr_psoc *ol_soc_handle);
  951. char *(*get_device_name)(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
  952. uint8_t pdev_id);
  953. QDF_STATUS(*nss_stats_clr)(struct cdp_ctrl_objmgr_psoc *psoc,
  954. uint8_t vdev_id);
  955. int (*dp_rx_get_pending)(ol_txrx_soc_handle soc);
  956. /* TODO: Add any other control path calls required to OL_IF/WMA layer */
  957. };
  958. #ifdef DP_PEER_EXTENDED_API
  959. /**
  960. * struct cdp_misc_ops - mcl ops not classified
  961. * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer
  962. * @set_wmm_param: set wmm parameters
  963. * @bad_peer_txctl_set_setting: configure bad peer tx limit setting
  964. * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit
  965. * @hl_tdls_flag_reset: reset tdls flag for vdev
  966. * @tx_non_std: Allow the control-path SW to send data frames
  967. * @get_vdev_id: get vdev id
  968. * @set_wisa_mode: set wisa mode for a vdev
  969. * @txrx_data_stall_cb_register: register data stall callback
  970. * @txrx_data_stall_cb_deregister: deregister data stall callback
  971. * @txrx_post_data_stall_event: post data stall event
  972. * @runtime_suspend: ensure TXRX is ready to runtime suspend
  973. * @runtime_resume: ensure TXRX is ready to runtime resume
  974. * @get_opmode: get operation mode of vdev
  975. * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for
  976. marking first packet after wow wakeup
  977. * @update_mac_id: update mac_id for vdev
  978. * @flush_rx_frames: flush rx frames on the queue
  979. * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that
  980. has been forwarded from txrx layer
  981. without going to upper layers
  982. * @pkt_log_init: handler to initialize packet log
  983. * @pkt_log_con_service: handler to connect packet log service
  984. * @get_num_rx_contexts: handler to get number of RX contexts
  985. * @register_packetdump_cb: register callback for different pktlog
  986. * @unregister_packetdump_cb: unregister callback for different pktlog
  987. * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag
  988. * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag
  989. *
  990. * Function pointers for miscellaneous soc/pdev/vdev related operations.
  991. */
  992. struct cdp_misc_ops {
  993. uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl,
  994. uint8_t vdev_id,
  995. uint16_t timer_value_sec);
  996. void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  997. struct ol_tx_wmm_param_t wmm_param);
  998. void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl,
  999. uint8_t pdev_id, int enable,
  1000. int period, int txq_limit);
  1001. void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl,
  1002. uint8_t pdev_id,
  1003. int level, int tput_thresh,
  1004. int tx_limit);
  1005. void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl,
  1006. uint8_t vdev_id, bool flag);
  1007. qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1008. enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
  1009. uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
  1010. uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl,
  1011. uint8_t vdev_id);
  1012. QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl,
  1013. uint8_t vdev_id, bool enable);
  1014. QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl,
  1015. uint8_t pdev_id,
  1016. data_stall_detect_cb cb);
  1017. QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl,
  1018. uint8_t pdev_id,
  1019. data_stall_detect_cb cb);
  1020. void (*txrx_post_data_stall_event)(
  1021. struct cdp_soc_t *soc_hdl,
  1022. enum data_stall_log_event_indicator indicator,
  1023. enum data_stall_log_event_type data_stall_type,
  1024. uint32_t pdev_id, uint32_t vdev_id_bitmap,
  1025. enum data_stall_log_recovery_type recovery_type);
  1026. QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl,
  1027. uint8_t pdev_id);
  1028. QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl,
  1029. uint8_t pdev_id);
  1030. int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1031. void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl,
  1032. uint8_t pdev_id, uint8_t value);
  1033. void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1034. uint8_t mac_id);
  1035. void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1036. void *peer, bool drop);
  1037. A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl,
  1038. uint8_t vdev_id,
  1039. uint64_t *fwd_tx_packets,
  1040. uint64_t *fwd_rx_packets);
  1041. void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev,
  1042. void *scn);
  1043. void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl,
  1044. uint8_t pdev_id, void *scn);
  1045. int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl);
  1046. void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1047. ol_txrx_pktdump_cb tx_cb,
  1048. ol_txrx_pktdump_cb rx_cb);
  1049. void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl,
  1050. uint8_t pdev_id);
  1051. void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl,
  1052. uint8_t pdev_id);
  1053. void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl,
  1054. uint8_t vdev_id,
  1055. unsigned long rx_packets,
  1056. uint32_t time_in_ms,
  1057. uint32_t high_th,
  1058. uint32_t low_th);
  1059. void (*vdev_set_bundle_require_flag)(uint8_t vdev_id,
  1060. unsigned long tx_bytes,
  1061. uint32_t time_in_ms,
  1062. uint32_t high_th,
  1063. uint32_t low_th);
  1064. void (*pdev_reset_bundle_require_flag)(struct cdp_soc_t *soc_hdl,
  1065. uint8_t pdev_id);
  1066. QDF_STATUS (*txrx_ext_stats_request)(struct cdp_soc_t *soc_hdl,
  1067. uint8_t pdev_id,
  1068. struct cdp_txrx_ext_stats *req);
  1069. QDF_STATUS (*request_rx_hw_stats)(struct cdp_soc_t *soc_hdl,
  1070. uint8_t vdev_id);
  1071. };
  1072. /**
  1073. * struct cdp_ocb_ops - mcl ocb ops
  1074. * @set_ocb_chan_info: set OCB channel info
  1075. * @get_ocb_chan_info: get OCB channel info
  1076. *
  1077. * Function pointers for operations related to OCB.
  1078. */
  1079. struct cdp_ocb_ops {
  1080. void (*set_ocb_chan_info)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1081. struct ol_txrx_ocb_set_chan ocb_set_chan);
  1082. struct ol_txrx_ocb_chan_info *(*get_ocb_chan_info)(
  1083. struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1084. };
  1085. /**
  1086. * struct cdp_peer_ops - mcl peer related ops
  1087. * @register_peer:
  1088. * @clear_peer:
  1089. * @find_peer_exist
  1090. * @find_peer_exist_on_vdev
  1091. * @find_peer_exist_on_other_vdev
  1092. * @peer_state_update:
  1093. * @get_vdevid:
  1094. * @register_ocb_peer:
  1095. * @peer_get_peer_mac_addr:
  1096. * @get_peer_state:
  1097. * @update_ibss_add_peer_num_of_vdev:
  1098. * @copy_mac_addr_raw:
  1099. * @add_last_real_peer:
  1100. * @is_vdev_restore_last_peer:
  1101. * @update_last_real_peer:
  1102. */
  1103. struct cdp_peer_ops {
  1104. QDF_STATUS (*register_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1105. struct ol_txrx_desc_type *sta_desc);
  1106. QDF_STATUS (*clear_peer)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1107. struct qdf_mac_addr peer_addr);
  1108. bool (*find_peer_exist)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1109. uint8_t *peer_addr);
  1110. bool (*find_peer_exist_on_vdev)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1111. uint8_t *peer_addr);
  1112. bool (*find_peer_exist_on_other_vdev)(struct cdp_soc_t *soc,
  1113. uint8_t vdev_id,
  1114. uint8_t *peer_addr,
  1115. uint16_t max_bssid);
  1116. QDF_STATUS (*peer_state_update)(struct cdp_soc_t *soc,
  1117. uint8_t *peer_addr,
  1118. enum ol_txrx_peer_state state);
  1119. QDF_STATUS (*get_vdevid)(struct cdp_soc_t *soc_hdl, uint8_t *peer_mac,
  1120. uint8_t *vdev_id);
  1121. struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev,
  1122. struct qdf_mac_addr peer_addr);
  1123. QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr);
  1124. uint8_t * (*peer_get_peer_mac_addr)(void *peer);
  1125. int (*get_peer_state)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1126. uint8_t *peer_mac);
  1127. struct cdp_vdev * (*get_vdev_for_peer)(void *peer);
  1128. int16_t (*update_ibss_add_peer_num_of_vdev)(struct cdp_soc_t *soc,
  1129. uint8_t vdev_id,
  1130. int16_t peer_num_delta);
  1131. void (*remove_peers_for_vdev)(struct cdp_vdev *vdev,
  1132. ol_txrx_vdev_peer_remove_cb callback,
  1133. void *callback_context, bool remove_last_peer);
  1134. void (*remove_peers_for_vdev_no_lock)(struct cdp_vdev *vdev,
  1135. ol_txrx_vdev_peer_remove_cb callback,
  1136. void *callback_context);
  1137. void (*copy_mac_addr_raw)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1138. uint8_t *bss_addr);
  1139. void (*add_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1140. uint8_t vdev_id);
  1141. bool (*is_vdev_restore_last_peer)(struct cdp_soc_t *soc,
  1142. uint8_t vdev_id,
  1143. uint8_t *peer_mac);
  1144. void (*update_last_real_peer)(struct cdp_soc_t *soc, uint8_t pdev_id,
  1145. uint8_t vdev_id, bool restore_last_peer);
  1146. void (*peer_detach_force_delete)(struct cdp_soc_t *soc_hdl,
  1147. uint8_t vdev_id, uint8_t *peer_addr);
  1148. void (*set_tdls_offchan_enabled)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1149. uint8_t *peer_mac, bool val);
  1150. void (*set_peer_as_tdls_peer)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1151. uint8_t *peer_mac, bool val);
  1152. };
  1153. /**
  1154. * struct cdp_mob_stats_ops - mcl mob stats ops
  1155. * @clear_stats: handler to clear ol txrx stats
  1156. * @stats: handler to update ol txrx stats
  1157. */
  1158. struct cdp_mob_stats_ops {
  1159. QDF_STATUS(*clear_stats)(struct cdp_soc_t *soc_hdl,
  1160. uint8_t pdev_id, uint8_t bitmap);
  1161. int (*stats)(uint8_t vdev_id, char *buffer, unsigned buf_len);
  1162. };
  1163. /**
  1164. * struct cdp_pmf_ops - mcl protected management frame ops
  1165. * @get_pn_info: handler to get pn info from peer
  1166. *
  1167. * Function pointers for pmf related operations.
  1168. */
  1169. struct cdp_pmf_ops {
  1170. void (*get_pn_info)(struct cdp_soc_t *soc, uint8_t *peer_mac,
  1171. uint8_t vdev_id, uint8_t **last_pn_valid,
  1172. uint64_t **last_pn, uint32_t **rmf_pn_replays);
  1173. };
  1174. #endif
  1175. #ifdef DP_FLOW_CTL
  1176. /**
  1177. * struct cdp_cfg_ops - mcl configuration ops
  1178. * @set_cfg_rx_fwd_disabled: set rx_fwd_disabled flag
  1179. * @set_cfg_packet_log_enabled: set is_packet_log_enabled flag
  1180. * @cfg_attach: hardcode the configuration parameters
  1181. * @vdev_rx_set_intrabss_fwd: set disable_intrabss_fwd flag
  1182. * @is_rx_fwd_disabled: get the rx_fwd_disabled flag,
  1183. * 1 enabled, 0 disabled.
  1184. * @tx_set_is_mgmt_over_wmi_enabled: set is_mgmt_over_wmi_enabled flag to
  1185. * indicate that mgmt over wmi is enabled
  1186. * or not,
  1187. * 1 for enabled, 0 for disable
  1188. * @is_high_latency: get device is high or low latency device,
  1189. * 1 high latency bus, 0 low latency bus
  1190. * @set_flow_control_parameters: set flow control parameters
  1191. * @set_flow_steering: set flow_steering_enabled flag
  1192. * @set_ptp_rx_opt_enabled: set is_ptp_rx_opt_enabled flag
  1193. * @set_new_htt_msg_format: set new_htt_msg_format flag
  1194. * @set_peer_unmap_conf_support: set enable_peer_unmap_conf_support flag
  1195. * @get_peer_unmap_conf_support: get enable_peer_unmap_conf_support flag
  1196. * @set_tx_compl_tsf64: set enable_tx_compl_tsf64 flag,
  1197. * 1 enabled, 0 disabled.
  1198. * @get_tx_compl_tsf64: get enable_tx_compl_tsf64 flag,
  1199. * 1 enabled, 0 disabled.
  1200. */
  1201. struct cdp_cfg_ops {
  1202. void (*set_cfg_rx_fwd_disabled)(struct cdp_cfg *cfg_pdev,
  1203. uint8_t disable_rx_fwd);
  1204. void (*set_cfg_packet_log_enabled)(struct cdp_cfg *cfg_pdev,
  1205. uint8_t val);
  1206. struct cdp_cfg * (*cfg_attach)(qdf_device_t osdev, void *cfg_param);
  1207. void (*vdev_rx_set_intrabss_fwd)(struct cdp_soc_t *soc_hdl,
  1208. uint8_t vdev_id, bool val);
  1209. uint8_t (*is_rx_fwd_disabled)(struct cdp_vdev *vdev);
  1210. void (*tx_set_is_mgmt_over_wmi_enabled)(uint8_t value);
  1211. int (*is_high_latency)(struct cdp_cfg *cfg_pdev);
  1212. void (*set_flow_control_parameters)(struct cdp_cfg *cfg_pdev,
  1213. void *param);
  1214. void (*set_flow_steering)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1215. void (*set_ptp_rx_opt_enabled)(struct cdp_cfg *cfg_pdev, uint8_t val);
  1216. void (*set_new_htt_msg_format)(uint8_t val);
  1217. void (*set_peer_unmap_conf_support)(bool val);
  1218. bool (*get_peer_unmap_conf_support)(void);
  1219. void (*set_tx_compl_tsf64)(bool val);
  1220. bool (*get_tx_compl_tsf64)(void);
  1221. };
  1222. /**
  1223. * struct cdp_flowctl_ops - mcl flow control
  1224. * @flow_pool_map_handler: handler to map flow_id and pool descriptors
  1225. * @flow_pool_unmap_handler: handler to unmap flow_id and pool descriptors
  1226. * @register_pause_cb: handler to register tx pause callback
  1227. * @set_desc_global_pool_size: handler to set global pool size
  1228. * @dump_flow_pool_info: handler to dump global and flow pool info
  1229. * @tx_desc_thresh_reached: handler to set tx desc threshold
  1230. *
  1231. * Function pointers for operations related to flow control
  1232. */
  1233. struct cdp_flowctl_ops {
  1234. QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
  1235. uint8_t pdev_id,
  1236. uint8_t vdev_id);
  1237. void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
  1238. uint8_t pdev_id,
  1239. uint8_t vdev_id);
  1240. QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
  1241. tx_pause_callback);
  1242. void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
  1243. void (*dump_flow_pool_info)(struct cdp_soc_t *soc_hdl);
  1244. bool (*tx_desc_thresh_reached)(struct cdp_soc_t *soc_hdl,
  1245. uint8_t vdev_id);
  1246. };
  1247. /**
  1248. * struct cdp_lflowctl_ops - mcl legacy flow control ops
  1249. * @register_tx_flow_control: Register tx flow control callback
  1250. * @set_vdev_tx_desc_limit: Set tx descriptor limit for a vdev
  1251. * @set_vdev_os_queue_status: Set vdev queue status
  1252. * @deregister_tx_flow_control_cb: Deregister tx flow control callback
  1253. * @flow_control_cb: Call osif flow control callback
  1254. * @get_tx_resource: Get tx resources and comapre with watermark
  1255. * @ll_set_tx_pause_q_depth: set pause queue depth
  1256. * @vdev_flush: Flush all packets on a particular vdev
  1257. * @vdev_pause: Pause a particular vdev
  1258. * @vdev_unpause: Unpause a particular vdev
  1259. *
  1260. * Function pointers for operations related to flow control
  1261. */
  1262. struct cdp_lflowctl_ops {
  1263. #ifdef QCA_HL_NETDEV_FLOW_CONTROL
  1264. int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl,
  1265. uint8_t pdev_id,
  1266. tx_pause_callback flowcontrol);
  1267. int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl,
  1268. uint8_t vdev_id, uint32_t chan_freq);
  1269. int (*set_vdev_os_queue_status)(struct cdp_soc_t *soc_hdl,
  1270. uint8_t vdev_id,
  1271. enum netif_action_type action);
  1272. #else
  1273. int (*register_tx_flow_control)(
  1274. struct cdp_soc_t *soc_hdl,
  1275. uint8_t vdev_id,
  1276. ol_txrx_tx_flow_control_fp flowControl, void *osif_fc_ctx,
  1277. ol_txrx_tx_flow_control_is_pause_fp flow_control_is_pause);
  1278. #endif /* QCA_HL_NETDEV_FLOW_CONTROL */
  1279. int (*deregister_tx_flow_control_cb)(struct cdp_soc_t *soc_hdl,
  1280. uint8_t vdev_id);
  1281. void (*flow_control_cb)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1282. bool tx_resume);
  1283. bool (*get_tx_resource)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1284. struct qdf_mac_addr peer_addr,
  1285. unsigned int low_watermark,
  1286. unsigned int high_watermark_offset);
  1287. int (*ll_set_tx_pause_q_depth)(struct cdp_soc_t *soc, uint8_t vdev_id,
  1288. int pause_q_depth);
  1289. void (*vdev_flush)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
  1290. void (*vdev_pause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1291. uint32_t reason, uint32_t pause_type);
  1292. void (*vdev_unpause)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1293. uint32_t reason, uint32_t pause_type);
  1294. };
  1295. /**
  1296. * struct cdp_throttle_ops - mcl throttle ops
  1297. * @throttle_init_period: handler to initialize tx throttle time
  1298. * @throttle_set_level: handler to set tx throttle level
  1299. */
  1300. struct cdp_throttle_ops {
  1301. void (*throttle_init_period)(struct cdp_soc_t *soc_hdl,
  1302. uint8_t pdev_id, int period,
  1303. uint8_t *dutycycle_level);
  1304. void (*throttle_set_level)(struct cdp_soc_t *soc_hdl,
  1305. uint8_t pdev_id, int level);
  1306. };
  1307. #endif
  1308. #ifdef IPA_OFFLOAD
  1309. /**
  1310. * struct cdp_ipa_ops - mcl ipa data path ops
  1311. * @ipa_get_resource:
  1312. * @ipa_set_doorbell_paddr:
  1313. * @ipa_set_active:
  1314. * @ipa_op_response:
  1315. * @ipa_register_op_cb:
  1316. * @ipa_get_stat:
  1317. * @ipa_tx_data_frame:
  1318. */
  1319. struct cdp_ipa_ops {
  1320. QDF_STATUS (*ipa_get_resource)(struct cdp_soc_t *soc_hdl,
  1321. uint8_t pdev_id);
  1322. QDF_STATUS (*ipa_set_doorbell_paddr)(struct cdp_soc_t *soc_hdl,
  1323. uint8_t pdev_id);
  1324. QDF_STATUS (*ipa_set_active)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1325. bool uc_active, bool is_tx);
  1326. QDF_STATUS (*ipa_op_response)(struct cdp_soc_t *soc_hdl,
  1327. uint8_t pdev_id, uint8_t *op_msg);
  1328. QDF_STATUS (*ipa_register_op_cb)(struct cdp_soc_t *soc_hdl,
  1329. uint8_t pdev_id,
  1330. void (*ipa_uc_op_cb_type)
  1331. (uint8_t *op_msg, void *osif_ctxt),
  1332. void *usr_ctxt);
  1333. QDF_STATUS (*ipa_get_stat)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1334. qdf_nbuf_t (*ipa_tx_data_frame)(struct cdp_soc_t *soc_hdl,
  1335. uint8_t vdev_id, qdf_nbuf_t skb);
  1336. void (*ipa_set_uc_tx_partition_base)(struct cdp_cfg *pdev,
  1337. uint32_t value);
  1338. #ifdef FEATURE_METERING
  1339. QDF_STATUS (*ipa_uc_get_share_stats)(struct cdp_soc_t *soc_hdl,
  1340. uint8_t pdev_id,
  1341. uint8_t reset_stats);
  1342. QDF_STATUS (*ipa_uc_set_quota)(struct cdp_soc_t *soc_hdl,
  1343. uint8_t pdev_id, uint64_t quota_bytes);
  1344. #endif
  1345. QDF_STATUS (*ipa_enable_autonomy)(struct cdp_soc_t *soc_hdl,
  1346. uint8_t pdev_id);
  1347. QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl,
  1348. uint8_t pdev_id);
  1349. #ifdef CONFIG_IPA_WDI_UNIFIED_API
  1350. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1351. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1352. void *ipa_wdi_meter_notifier_cb,
  1353. uint32_t ipa_desc_size, void *ipa_priv,
  1354. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1355. uint32_t *rx_pipe_handle, bool is_smmu_enabled,
  1356. qdf_ipa_sys_connect_params_t *sys_in,
  1357. bool over_gsi);
  1358. #else /* CONFIG_IPA_WDI_UNIFIED_API */
  1359. QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1360. void *ipa_i2w_cb, void *ipa_w2i_cb,
  1361. void *ipa_wdi_meter_notifier_cb,
  1362. uint32_t ipa_desc_size, void *ipa_priv,
  1363. bool is_rm_enabled, uint32_t *tx_pipe_handle,
  1364. uint32_t *rx_pipe_handle);
  1365. #endif /* CONFIG_IPA_WDI_UNIFIED_API */
  1366. QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle,
  1367. uint32_t rx_pipe_handle);
  1368. QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
  1369. qdf_ipa_client_type_t prod_client,
  1370. qdf_ipa_client_type_t cons_client,
  1371. uint8_t session_id, bool is_ipv6_enabled);
  1372. QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
  1373. QDF_STATUS (*ipa_enable_pipes)(struct cdp_soc_t *soc_hdl,
  1374. uint8_t pdev_id);
  1375. QDF_STATUS (*ipa_disable_pipes)(struct cdp_soc_t *soc_hdl,
  1376. uint8_t pdev_id);
  1377. QDF_STATUS (*ipa_set_perf_level)(int client,
  1378. uint32_t max_supported_bw_mbps);
  1379. bool (*ipa_rx_intrabss_fwd)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
  1380. qdf_nbuf_t nbuf, bool *fwd_success);
  1381. };
  1382. #endif
  1383. #ifdef DP_POWER_SAVE
  1384. /**
  1385. * struct cdp_tx_delay_ops - mcl tx delay ops
  1386. * @tx_delay: handler to get tx packet delay
  1387. * @tx_delay_hist: handler to get tx packet delay histogram
  1388. * @tx_packet_count: handler to get tx packet count
  1389. * @tx_set_compute_interval: update compute interval period for TSM stats
  1390. *
  1391. * Function pointer for operations related to tx delay.
  1392. */
  1393. struct cdp_tx_delay_ops {
  1394. void (*tx_delay)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1395. uint32_t *queue_delay_microsec,
  1396. uint32_t *tx_delay_microsec, int category);
  1397. void (*tx_delay_hist)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1398. uint16_t *bin_values, int category);
  1399. void (*tx_packet_count)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
  1400. uint16_t *out_packet_count,
  1401. uint16_t *out_packet_loss_count, int category);
  1402. void (*tx_set_compute_interval)(struct cdp_soc_t *soc_hdl,
  1403. uint8_t pdev_id, uint32_t interval);
  1404. };
  1405. /**
  1406. * struct cdp_bus_ops - mcl bus suspend/resume ops
  1407. * @bus_suspend: handler for bus suspend
  1408. * @bus_resume: handler for bus resume
  1409. * @process_wow_ack_rsp: handler for wow ack response
  1410. * @process_target_suspend_req: handler for target suspend request
  1411. */
  1412. struct cdp_bus_ops {
  1413. QDF_STATUS (*bus_suspend)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1414. QDF_STATUS (*bus_resume)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1415. void (*process_wow_ack_rsp)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
  1416. void (*process_target_suspend_req)(struct cdp_soc_t *soc_hdl,
  1417. uint8_t pdev_id);
  1418. };
  1419. #endif
  1420. #ifdef RECEIVE_OFFLOAD
  1421. /**
  1422. * struct cdp_rx_offld_ops - mcl host receive offload ops
  1423. * @register_rx_offld_flush_cb:
  1424. * @deregister_rx_offld_flush_cb:
  1425. */
  1426. struct cdp_rx_offld_ops {
  1427. void (*register_rx_offld_flush_cb)(void (rx_offld_flush_cb)(void *));
  1428. void (*deregister_rx_offld_flush_cb)(void);
  1429. };
  1430. #endif
  1431. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  1432. /**
  1433. * struct cdp_cfr_ops - host cfr ops
  1434. * @txrx_cfr_filter: Handler to configure host rx monitor status ring
  1435. * @txrx_get_cfr_rcc: Handler to get CFR mode
  1436. * @txrx_set_cfr_rcc: Handler to enable/disable CFR mode
  1437. * @txrx_get_cfr_dbg_stats: Handler to get debug statistics for CFR mode
  1438. * @txrx_clear_cfr_dbg_stats: Handler to clear debug statistics for CFR mode
  1439. * @txrx_enable_mon_reap_timer: Enable/Disable reap timer of monitor status ring
  1440. */
  1441. struct cdp_cfr_ops {
  1442. void (*txrx_cfr_filter)(struct cdp_soc_t *soc_hdl,
  1443. uint8_t pdev_id,
  1444. bool enable,
  1445. struct cdp_monitor_filter *filter_val);
  1446. bool (*txrx_get_cfr_rcc)(struct cdp_soc_t *soc_hdl,
  1447. uint8_t pdev_id);
  1448. void (*txrx_set_cfr_rcc)(struct cdp_soc_t *soc_hdl,
  1449. uint8_t pdev_id,
  1450. bool enable);
  1451. void (*txrx_get_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
  1452. uint8_t pdev_id,
  1453. struct cdp_cfr_rcc_stats *buf);
  1454. void (*txrx_clear_cfr_dbg_stats)(struct cdp_soc_t *soc_hdl,
  1455. uint8_t pdev_id);
  1456. void (*txrx_enable_mon_reap_timer)(struct cdp_soc_t *soc_hdl,
  1457. uint8_t pdev_id,
  1458. bool enable);
  1459. };
  1460. #endif
  1461. struct cdp_ops {
  1462. struct cdp_cmn_ops *cmn_drv_ops;
  1463. struct cdp_ctrl_ops *ctrl_ops;
  1464. struct cdp_me_ops *me_ops;
  1465. struct cdp_mon_ops *mon_ops;
  1466. struct cdp_host_stats_ops *host_stats_ops;
  1467. struct cdp_wds_ops *wds_ops;
  1468. struct cdp_raw_ops *raw_ops;
  1469. struct cdp_pflow_ops *pflow_ops;
  1470. #ifdef DP_PEER_EXTENDED_API
  1471. struct cdp_misc_ops *misc_ops;
  1472. struct cdp_peer_ops *peer_ops;
  1473. struct cdp_ocb_ops *ocb_ops;
  1474. struct cdp_mob_stats_ops *mob_stats_ops;
  1475. struct cdp_pmf_ops *pmf_ops;
  1476. #endif
  1477. #ifdef DP_FLOW_CTL
  1478. struct cdp_cfg_ops *cfg_ops;
  1479. struct cdp_flowctl_ops *flowctl_ops;
  1480. struct cdp_lflowctl_ops *l_flowctl_ops;
  1481. struct cdp_throttle_ops *throttle_ops;
  1482. #endif
  1483. #ifdef DP_POWER_SAVE
  1484. struct cdp_bus_ops *bus_ops;
  1485. struct cdp_tx_delay_ops *delay_ops;
  1486. #endif
  1487. #ifdef IPA_OFFLOAD
  1488. struct cdp_ipa_ops *ipa_ops;
  1489. #endif
  1490. #ifdef RECEIVE_OFFLOAD
  1491. struct cdp_rx_offld_ops *rx_offld_ops;
  1492. #endif
  1493. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  1494. struct cdp_cfr_ops *cfr_ops;
  1495. #endif
  1496. };
  1497. #endif