From 58262e7922a0dace5466518fa90c5b2d4f1b5f97 Mon Sep 17 00:00:00 2001 From: Wu Gao Date: Sun, 14 Aug 2016 09:38:34 +0800 Subject: [PATCH] qcacld-3.0: Set wmi handle to pdev when saving pdev to wma handler Spectral scan and CFR components failed in pdev open since no valid wmi handle in pdev. This change sets wmi handle to pdev before calling dispatcher pdev open in hdd layer. Change-Id: I9461220b309f78e33770e423e24c97841b064a0f CRs-Fixed: 2637140 --- core/wma/src/wma_dev_if.c | 25 +++++++++++++++++++++++++ core/wma/src/wma_main.c | 24 ------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) 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;