diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 0038eea34095..2ee1474971e8 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -5031,6 +5031,27 @@ void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle, pdis_intra_fwd->disableintrabssfwd); } +/** + * wma_get_pdev_from_scn_handle() - API to get pdev from scn handle + * @scn_handle: opaque wma handle + * + * API to get pdev from scn handle + * + * Return: None + */ +static struct wlan_objmgr_pdev *wma_get_pdev_from_scn_handle(void *scn_handle) +{ + tp_wma_handle wma_handle; + + if (!scn_handle) { + WMA_LOGE("invalid scn handle"); + return NULL; + } + wma_handle = (tp_wma_handle)scn_handle; + + return wma_handle->pdev; +} + void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev) { tp_wma_handle wma = (tp_wma_handle)wma_ctx; @@ -5043,6 +5064,10 @@ void wma_store_pdev(void *wma_ctx, struct wlan_objmgr_pdev *pdev) } wma->pdev = pdev; + + target_if_store_pdev_target_if_ctx(wma_get_pdev_from_scn_handle); + target_pdev_set_wmi_handle(wma->pdev->tgt_if_handle, + wma->wmi_handle); } /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 42113b116ff1..3b2be8568294 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1955,27 +1955,6 @@ static void wma_target_if_close(tp_wma_handle wma_handle) wlan_global_lmac_if_close(psoc); } -/** - * wma_get_pdev_from_scn_handle() - API to get pdev from scn handle - * @scn_handle: opaque wma handle - * - * API to get pdev from scn handle - * - * Return: None - */ -static struct wlan_objmgr_pdev *wma_get_pdev_from_scn_handle(void *scn_handle) -{ - tp_wma_handle wma_handle; - - if (!scn_handle) { - WMA_LOGE("invalid scn handle"); - return NULL; - } - wma_handle = (tp_wma_handle)scn_handle; - - return wma_handle->pdev; -} - /** * wma_legacy_service_ready_event_handler() - legacy (ext)service ready handler * @event_id: event_id @@ -5529,9 +5508,6 @@ static int wma_update_hdd_cfg(tp_wma_handle wma_handle) if (ret) return -EINVAL; - target_if_store_pdev_target_if_ctx(wma_get_pdev_from_scn_handle); - target_pdev_set_wmi_handle(wma_handle->pdev->tgt_if_handle, - wma_handle->wmi_handle); wma_green_ap_register_handlers(wma_handle); return ret;