diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index 2ef205fefe..f127145cc1 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -33,31 +33,30 @@ ol_txrx_soc_handle ol_txrx_soc_attach(void *scn_handle, struct ol_if_ops *dp_ol_if_ops); #ifdef QCA_WIFI_QCA8074 -void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, +void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc); + struct ol_if_ops *ol_ops); #else /* * dp_soc_attach_wifi3() - Attach txrx SOC - * @osif_soc: Opaque SOC handle from OSIF/HDD + * @ctrl_psoc: Opaque SOC handle from Ctrl plane * @htc_handle: Opaque HTC handle * @hif_handle: Opaque HIF handle * @qdf_osdev: QDF device * * Return: DP SOC handle on success, NULL on failure */ -static inline void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, +static inline void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc) + struct ol_if_ops *ol_ops) { return NULL; } #endif /* QCA_WIFI_QCA8074 */ static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, - void *hif_handle, void *scn, void *htc_handle, - qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops, - struct wlan_objmgr_psoc *psoc) + void *hif_handle, void *psoc, void *htc_handle, + qdf_device_t qdf_dev, struct ol_if_ops *dp_ol_if_ops) { switch (devid) { case LITHIUM_DP: /*FIXME Add lithium devide IDs */ @@ -66,11 +65,11 @@ static inline ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, case RUMIM2M_DEVICE_ID_NODE1: /*lithium emulation */ case RUMIM2M_DEVICE_ID_NODE2: /*lithium emulation */ case RUMIM2M_DEVICE_ID_NODE3: /*lithium emulation */ - return dp_soc_attach_wifi3(scn, hif_handle, htc_handle, - qdf_dev, dp_ol_if_ops, psoc); + return dp_soc_attach_wifi3(psoc, hif_handle, htc_handle, + qdf_dev, dp_ol_if_ops); break; default: - return ol_txrx_soc_attach(scn, dp_ol_if_ops); + return ol_txrx_soc_attach(psoc, dp_ol_if_ops); } return NULL; } diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 8ffdf91eb8..508c134eaa 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -2764,7 +2764,7 @@ htt_htc_soc_attach(struct htt_soc *soc) /* * htt_soc_attach() - SOC level HTT initialization * @dp_soc: Opaque Data path SOC handle - * @osif_soc: Opaque OSIF SOC handle + * @ctrl_psoc: Opaque ctrl SOC handle * @htc_soc: SOC level HTC handle * @hal_soc: Opaque HAL SOC handle * @osdev: QDF device @@ -2772,7 +2772,7 @@ htt_htc_soc_attach(struct htt_soc *soc) * Return: HTT handle on success; NULL on failure */ void * -htt_soc_attach(void *dp_soc, void *osif_soc, HTC_HANDLE htc_soc, +htt_soc_attach(void *dp_soc, void *ctrl_psoc, HTC_HANDLE htc_soc, void *hal_soc, qdf_device_t osdev) { struct htt_soc *soc; @@ -2784,7 +2784,7 @@ htt_soc_attach(void *dp_soc, void *osif_soc, HTC_HANDLE htc_soc, goto fail1; soc->osdev = osdev; - soc->osif_soc = osif_soc; + soc->ctrl_psoc = ctrl_psoc; soc->dp_soc = dp_soc; soc->htc_soc = htc_soc; soc->hal_soc = hal_soc; diff --git a/dp/wifi3.0/dp_htt.h b/dp/wifi3.0/dp_htt.h index 86a74d109c..6ce2c3aab3 100644 --- a/dp/wifi3.0/dp_htt.h +++ b/dp/wifi3.0/dp_htt.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -62,7 +62,7 @@ struct dp_htt_htc_pkt_union { }; struct htt_soc { - void *osif_soc; + void *ctrl_psoc; void *dp_soc; void *hal_soc; HTC_HANDLE htc_soc; @@ -135,7 +135,7 @@ struct htt_rx_ring_tlv_filter { }; void * -htt_soc_attach(void *txrx_soc, void *osif_soc, HTC_HANDLE htc_soc, +htt_soc_attach(void *txrx_soc, void *ctrl_psoc, HTC_HANDLE htc_soc, void *hal_soc, qdf_device_t osdev); void htt_soc_detach(void *soc); diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 2f53dbfe29..8e1a28828f 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -2080,7 +2080,7 @@ static void dp_lro_hash_setup(struct dp_soc *soc) if (soc->cdp_soc.ol_ops->lro_hash_config) (void)soc->cdp_soc.ol_ops->lro_hash_config - (soc->osif_soc, &lro_hash); + (soc->ctrl_psoc, &lro_hash); } /* @@ -2248,7 +2248,7 @@ void dp_mark_peer_inact(void *peer, bool inactive) /* * dp_pdev_attach_wifi3() - attach txrx pdev -* @osif_pdev: Opaque PDEV handle from OSIF/HDD +* @ctrl_pdev: Opaque PDEV object * @txrx_soc: Datapath SOC handle * @htc_handle: HTC handle for host-target interface * @qdf_osdev: QDF OS device @@ -2760,7 +2760,7 @@ static void dp_rxdma_ring_config(struct dp_soc *soc) if (soc->cdp_soc.ol_ops-> is_hw_dbs_2x2_capable) { dbs_enable = soc->cdp_soc.ol_ops-> - is_hw_dbs_2x2_capable(soc->psoc); + is_hw_dbs_2x2_capable(soc->ctrl_psoc); } if (dbs_enable) { @@ -6411,7 +6411,7 @@ static void dp_soc_set_txrx_ring_map(struct dp_soc *soc) /* * dp_soc_attach_wifi3() - Attach txrx SOC - * @osif_soc: Opaque SOC handle from OSIF/HDD + * @ctrl_psoc: Opaque SOC handle from control plane * @htc_handle: Opaque HTC handle * @hif_handle: Opaque HIF handle * @qdf_osdev: QDF device @@ -6423,12 +6423,12 @@ static void dp_soc_set_txrx_ring_map(struct dp_soc *soc) * -Wmissing-prototypes. A more correct solution, namely to expose * a prototype in an appropriate header file, will come later. */ -void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, +void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc); -void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, + struct ol_if_ops *ol_ops); +void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle, HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, - struct ol_if_ops *ol_ops, struct wlan_objmgr_psoc *psoc) + struct ol_if_ops *ol_ops) { struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc)); @@ -6440,13 +6440,12 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, soc->cdp_soc.ops = &dp_txrx_ops; soc->cdp_soc.ol_ops = ol_ops; - soc->osif_soc = osif_soc; + soc->ctrl_psoc = ctrl_psoc; soc->osdev = qdf_osdev; soc->hif_handle = hif_handle; - soc->psoc = psoc; soc->hal_soc = hif_get_hal_handle(hif_handle); - soc->htt_handle = htt_soc_attach(soc, osif_soc, htc_handle, + soc->htt_handle = htt_soc_attach(soc, ctrl_psoc, htc_handle, soc->hal_soc, qdf_osdev); if (!soc->htt_handle) { QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, @@ -6465,14 +6464,14 @@ void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle, soc->cce_disable = false; if (soc->cdp_soc.ol_ops->get_dp_cfg_param) { - int ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->osif_soc, + int ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->ctrl_psoc, CDP_CFG_MAX_PEER_ID); if (ret != -EINVAL) { wlan_cfg_set_max_peer_id(soc->wlan_cfg_ctx, ret); } - ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->osif_soc, + ret = soc->cdp_soc.ol_ops->get_dp_cfg_param(soc->ctrl_psoc, CDP_CFG_CCE_DISABLE); if (ret) soc->cce_disable = true; @@ -6552,7 +6551,7 @@ void dp_is_hw_dbs_enable(struct dp_soc *soc, bool dbs_enable = false; if (soc->cdp_soc.ol_ops->is_hw_dbs_2x2_capable) dbs_enable = soc->cdp_soc.ol_ops-> - is_hw_dbs_2x2_capable(soc->psoc); + is_hw_dbs_2x2_capable(soc->ctrl_psoc); *max_mac_rings = (dbs_enable)?(*max_mac_rings):1; } diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 0cdcb15f82..1eee462af9 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -382,7 +382,7 @@ static inline void dp_peer_map_ast(struct dp_soc *soc, if (ast_entry_found || (peer->vdev && peer->vdev->proxysta_vdev)) { if (soc->cdp_soc.ol_ops->peer_map_event) { soc->cdp_soc.ol_ops->peer_map_event( - soc->osif_soc, peer->peer_ids[0], + soc->ctrl_psoc, peer->peer_ids[0], hw_peer_id, vdev_id, mac_addr, peer_type); } @@ -856,7 +856,7 @@ dp_rx_peer_unmap_handler(void *soc_handle, uint16_t peer_id) } if (soc->cdp_soc.ol_ops->peer_unmap_event) { - soc->cdp_soc.ol_ops->peer_unmap_event(soc->osif_soc, + soc->cdp_soc.ol_ops->peer_unmap_event(soc->ctrl_psoc, peer_id); } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index ef6273a9b1..a95076cf4a 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -591,8 +591,8 @@ struct dp_soc { /* Common base structure - Should be the first member */ struct cdp_soc_t cdp_soc; - /* SoC/softc handle from OSIF layer */ - void *osif_soc; + /* SoC Obj */ + void *ctrl_psoc; /* OS device abstraction */ qdf_device_t osdev; @@ -795,8 +795,6 @@ struct dp_soc { qdf_list_t reo_desc_freelist; qdf_spinlock_t reo_desc_freelist_lock; - /* Obj Mgr SoC */ - struct wlan_objmgr_psoc *psoc; #ifdef QCA_SUPPORT_SON /* The timer to check station's inactivity status */ os_timer_t pdev_bs_inact_timer; diff --git a/target_if/init_deinit/inc/init_deinit_ucfg.h b/target_if/init_deinit/inc/init_deinit_ucfg.h index aba71c4ab8..a0cbf6c4dc 100644 --- a/target_if/init_deinit/inc/init_deinit_ucfg.h +++ b/target_if/init_deinit/inc/init_deinit_ucfg.h @@ -164,6 +164,17 @@ void *ucfg_get_wmi_hdl(struct wlan_objmgr_psoc *psoc); */ void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc); +/** + * ucfg_set_htc_hdl() - set htc handle + * @psoc: pointer to psoc + * @htc_hdl: HTC handle + * + * API to set htc handle + * + * Return: void + */ +void ucfg_set_htc_hdl(struct wlan_objmgr_psoc *psoc, void *htc_hdl); + /** * ucfg_get_hif_hdl() - get hif handle * @psoc: pointer to psoc @@ -183,4 +194,24 @@ void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc); * Return: wmi handle */ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev); + +/** + * ucfg_get_psoc_feature_ptr() - get feature pointer + * @psoc: pointer to psoc + * + * API to get legacy pointer + * + * Return: feature pointer + */ +void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc); + +/** + * ucfg_get_pdev_feature_ptr() - get feature pointer + * @pdev: pointer to pdev + * + * API to get legacy pointer + * + * Return: pdev feature pointer + */ +void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev); #endif /* _INIT_DEINIT_UCFG_H_ */ diff --git a/target_if/init_deinit/src/init_deinit_ucfg.c b/target_if/init_deinit/src/init_deinit_ucfg.c index e6fd1b269a..ac8b161709 100644 --- a/target_if/init_deinit/src/init_deinit_ucfg.c +++ b/target_if/init_deinit/src/init_deinit_ucfg.c @@ -249,6 +249,7 @@ void *ucfg_get_wmi_hdl(struct wlan_objmgr_psoc *psoc) target_if_err("psoc is null"); return NULL; } + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); if (!tgt_hdl) { target_if_err("target_psoc_info is null"); @@ -266,6 +267,7 @@ void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc) target_if_err("psoc is null"); return NULL; } + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); if (!tgt_hdl) { target_if_err("target_psoc_info is null"); @@ -275,6 +277,23 @@ void *ucfg_get_htc_hdl(struct wlan_objmgr_psoc *psoc) return target_psoc_get_htc_hdl(tgt_hdl); } +void ucfg_set_htc_hdl(struct wlan_objmgr_psoc *psoc, void *htc_hdl) +{ + struct target_psoc_info *tgt_hdl; + + if (!psoc) { + target_if_err("psoc is null"); + return; + } + tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(psoc); + if (!tgt_hdl) { + target_if_err("target_psoc_info is null"); + return; + } + + target_psoc_set_htc_hdl(tgt_hdl, htc_hdl); +} + void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc) { struct target_psoc_info *tgt_hdl; @@ -283,6 +302,7 @@ void *ucfg_get_hif_hdl(struct wlan_objmgr_psoc *psoc) target_if_err("psoc is null"); return NULL; } + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); if (!tgt_hdl) { target_if_err("target_psoc_info is null"); @@ -300,6 +320,7 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev) target_if_err("pdev is null"); return NULL; } + tgt_hdl = wlan_pdev_get_tgt_if_handle(pdev); if (!tgt_hdl) { target_if_err("target_pdev_info is null"); @@ -308,3 +329,37 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev) return target_pdev_get_wmi_handle(tgt_hdl); } + +void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc) +{ + struct target_psoc_info *tgt_hdl; + + if (!psoc) { + target_if_err("psoc is null"); + return NULL; + } + tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(psoc); + if (!tgt_hdl) { + target_if_err("target_psoc_info is null"); + return NULL; + } + + return target_psoc_get_feature_ptr(tgt_hdl); +} + +void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev) +{ + struct target_pdev_info *tgt_hdl; + + if (!pdev) { + target_if_err("pdev is null"); + return NULL; + } + tgt_hdl = (struct target_pdev_info *)wlan_pdev_get_tgt_if_handle(pdev); + if (!tgt_hdl) { + target_if_err("target_pdev_info is null"); + return NULL; + } + + return target_pdev_get_feature_ptr(tgt_hdl); +}