From 8de3c1c76562c30fac33be9a1b7f787804b86d8b Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Thu, 13 Apr 2017 17:56:18 -0700 Subject: [PATCH] qcacld-3.0: Deinitialize the scan pdev OS private Deinitialize the scan pdev os private member as part of the hdd deinit sequence. Change-Id: I451000ac5d883418e380b72f281663c57b276f2d CRs-Fixed: 2033622 --- core/hdd/src/wlan_hdd_main.c | 4 +- core/hdd/src/wlan_hdd_object_manager.c | 13 ++++--- core/hdd/src/wlan_hdd_power.c | 6 +-- core/hdd/src/wlan_hdd_scan.c | 53 -------------------------- core/hdd/src/wlan_hdd_scan.h | 2 - 5 files changed, 9 insertions(+), 69 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2b440043cac6..277dc39525b9 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5410,9 +5410,7 @@ static void hdd_wlan_exit(hdd_context_t *hdd_ctx) * the expectation is that by the time Request Full Power has * completed, all scans will be cancelled */ -#ifndef NAPIER_SCAN - hdd_cleanup_scan_queue(hdd_ctx); -#endif + wlan_cfg80211_cleanup_scan_queue(hdd_ctx->hdd_pdev); hdd_abort_mac_scan_all_adapters(hdd_ctx); hdd_abort_sched_scan_all_adapters(hdd_ctx); hdd_stop_all_adapters(hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_object_manager.c b/core/hdd/src/wlan_hdd_object_manager.c index c83f2f11bbc0..b8c6920ef93b 100644 --- a/core/hdd/src/wlan_hdd_object_manager.c +++ b/core/hdd/src/wlan_hdd_object_manager.c @@ -33,18 +33,18 @@ #include #include -#ifdef NAPIER_SCAN -#define hdd_init_scan_priv(x) wlan_cfg80211_scan_priv_init(x) -#else -#define hdd_init_scan_priv(x) -#endif static void hdd_init_pdev_os_priv(hdd_context_t *hdd_ctx, struct pdev_osif_priv *os_priv) { /* Initialize the OS private structure*/ os_priv->wiphy = hdd_ctx->wiphy; - hdd_init_scan_priv(hdd_ctx->hdd_pdev); + wlan_cfg80211_scan_priv_init(hdd_ctx->hdd_pdev); +} + +static void hdd_deinit_pdev_os_priv(hdd_context_t *hdd_ctx) +{ + wlan_cfg80211_scan_priv_deinit(hdd_ctx->hdd_pdev); } static void hdd_init_vdev_os_priv(hdd_adapter_t *adapter, @@ -125,6 +125,7 @@ int hdd_objmgr_release_and_destroy_pdev(hdd_context_t *hdd_ctx) struct wlan_objmgr_pdev *pdev = hdd_ctx->hdd_pdev; struct pdev_osif_priv *osif_priv; + hdd_deinit_pdev_os_priv(hdd_ctx); hdd_ctx->hdd_pdev = NULL; if (!pdev) return -EINVAL; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 4dc0605ae351..2e26f3ddf26b 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1272,11 +1272,7 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_debug("Invoking packetdump deregistration API"); wlan_deregister_txrx_packetdump(); -#ifndef NAPIER_SCAN - hdd_cleanup_scan_queue(pHddCtx); -#else - wlan_cfg80211_abort_scan(pHddCtx->hdd_pdev); -#endif + wlan_cfg80211_cleanup_scan_queue(pHddCtx->hdd_pdev); hdd_ipa_uc_ssr_deinit(); hdd_reset_all_adapters(pHddCtx); diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index eda64899ed44..b54afbdd55aa 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -2735,59 +2735,6 @@ void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy, cds_ssr_unprotect(__func__); } #endif -#ifndef NAPIER_SCAN -/** - * hdd_cleanup_scan_queue() - remove entries in scan queue - * - * Removes entries in scan queue and sends scan complete event to NL - * Return: None - */ -void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx) -{ - struct hdd_scan_req *hdd_scan_req; - qdf_list_node_t *node = NULL; - struct cfg80211_scan_request *req; - hdd_adapter_t *adapter; - uint8_t source; - bool aborted = true; - - if (NULL == hdd_ctx) { - hdd_err("HDD context is Null"); - return; - } - - qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock); - while (!qdf_list_empty(&hdd_ctx->hdd_scan_req_q)) { - if (QDF_STATUS_SUCCESS != - qdf_list_remove_front(&hdd_ctx->hdd_scan_req_q, - &node)) { - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - hdd_err("Failed to remove scan request"); - return; - } - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - hdd_scan_req = container_of(node, struct hdd_scan_req, node); - req = hdd_scan_req->scan_request; - source = hdd_scan_req->source; - adapter = hdd_scan_req->adapter; - if (WLAN_HDD_ADAPTER_MAGIC != adapter->magic) { - hdd_err("HDD adapter magic is invalid"); - } else { - if (NL_SCAN == source) - hdd_cfg80211_scan_done(adapter, req, aborted); - else - hdd_vendor_scan_callback(adapter, req, aborted); - hdd_debug("removed Scan id: %d, req = %p", - hdd_scan_req->scan_id, req); - } - qdf_mem_free(hdd_scan_req); - qdf_spin_lock(&hdd_ctx->hdd_scan_req_q_lock); - } - qdf_spin_unlock(&hdd_ctx->hdd_scan_req_q_lock); - - return; -} -#endif /** * hdd_scan_context_destroy() - Destroy scan context diff --git a/core/hdd/src/wlan_hdd_scan.h b/core/hdd/src/wlan_hdd_scan.h index a056a0afdadd..38f42b0a69f5 100644 --- a/core/hdd/src/wlan_hdd_scan.h +++ b/core/hdd/src/wlan_hdd_scan.h @@ -104,8 +104,6 @@ int wlan_hdd_vendor_abort_scan( struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); -void hdd_cleanup_scan_queue(hdd_context_t *hdd_ctx); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)) || \ defined(CFG80211_ABORT_SCAN) void wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,