diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d357fdfd7d..265a29f357 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5682,7 +5682,14 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]) { enable_flag = nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_ENABLE]); - sme_set_scan_disable(mac_handle, !enable_flag); + + hdd_debug("scan enable %d", enable_flag); + if (enable_flag) + ucfg_scan_psoc_set_enable(hdd_ctx->psoc, + REASON_USER_SPACE); + else + ucfg_scan_psoc_set_disable(hdd_ctx->psoc, + REASON_USER_SPACE); } if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER]) { diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 75c74b5f37..e69147e2ed 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4026,7 +4026,7 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter) ucfg_pmo_del_wow_pattern(vdev); status = ucfg_reg_11d_vdev_delete_update(vdev); - ucfg_scan_set_vdev_del_in_progress(vdev); + ucfg_scan_vdev_set_disable(vdev, REASON_VDEV_DOWN); hdd_objmgr_put_vdev(adapter); /* close sme session (destroy vdev in firmware via legacy API) */ diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 8216ce6212..dcf50fb6b7 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -5099,10 +5099,13 @@ static int hdd_we_set_scan_disable(struct hdd_adapter *adapter, int value) hdd_debug("%d", value); - if (!hdd_ctx->mac_handle) + if (!hdd_ctx->psoc) return -EINVAL; - sme_set_scan_disable(hdd_ctx->mac_handle, value); + if (value) + ucfg_scan_psoc_set_disable(hdd_ctx->psoc, REASON_USER_SPACE); + else + ucfg_scan_psoc_set_enable(hdd_ctx->psoc, REASON_USER_SPACE); return 0; } diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index b22d4c040f..684cffaeba 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1477,7 +1477,6 @@ QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg); QDF_STATUS sme_soc_set_antenna_mode(mac_handle_t mac_handle, struct sir_antenna_mode_param *msg); -void sme_set_scan_disable(mac_handle_t mac_handle, int value); void sme_setdef_dot11mode(mac_handle_t mac_handle); QDF_STATUS sme_handle_set_fcc_channel(mac_handle_t mac_handle, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 3ddd90ca3c..fa3520d561 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -821,22 +821,6 @@ QDF_STATUS sme_set11dinfo(mac_handle_t mac_handle, return status; } -/** - * sme_set_scan_disable() - Dynamically enable/disable scan - * @mac_handle: Opaque handle to the global MAC context - * - * This command gives the user an option to dynamically - * enable or disable scans. - * - * Return: None - */ -void sme_set_scan_disable(mac_handle_t mac_handle, int value) -{ - struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); - - sme_info("scan disable %d", value); - ucfg_scan_set_enable(mac_ctx->psoc, !value); -} /* * sme_get_soft_ap_domain() - Get the current regulatory domain of softAp. * This is a synchronous call diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 4a43af80d0..afc6a50289 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1243,7 +1243,6 @@ QDF_STATUS csr_start(struct mac_context *mac) mac->scan.requester_id = ucfg_scan_register_requester( mac->psoc, "CSR", csr_scan_callback, mac); - ucfg_scan_set_enable(mac->psoc, true); } while (0); return status; } @@ -1252,7 +1251,7 @@ QDF_STATUS csr_stop(struct mac_context *mac) { uint32_t sessionId; - ucfg_scan_set_enable(mac->psoc, false); + ucfg_scan_psoc_set_disable(mac->psoc, REASON_SYSTEM_DOWN); ucfg_scan_unregister_requester(mac->psoc, mac->scan.requester_id); /* diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 382af8bc3c..deb4da530a 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -110,7 +110,8 @@ QDF_STATUS csr_scan_close(struct mac_context *mac) csr_purge_channel_power(mac, &mac->scan.channelPowerInfoList5G); csr_ll_close(&mac->scan.channelPowerInfoList24); csr_ll_close(&mac->scan.channelPowerInfoList5G); - ucfg_scan_set_enable(mac->psoc, false); + ucfg_scan_psoc_set_disable(mac->psoc, REASON_SYSTEM_DOWN); + return QDF_STATUS_SUCCESS; } @@ -1438,10 +1439,8 @@ QDF_STATUS csr_scan_for_ssid(struct mac_context *mac_ctx, uint32_t session_id, return status; } - if (!ucfg_scan_get_enable(mac_ctx->psoc) && (num_ssid != 1)) { - sme_err( - "cannot scan because scanEnable (%d) or numSSID (%d) is invalid", - ucfg_scan_get_enable(mac_ctx->psoc), profile->SSIDs.numOfSSIDs); + if (num_ssid != 1) { + sme_err("numSSID (%d) is invalid", profile->SSIDs.numOfSSIDs); return status; }