From bf933ff252063d4b45ed2579ee45c7b7513daed8 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Tue, 4 Jun 2019 14:15:49 +0530 Subject: [PATCH] qcacld-3.0: Clear the userspace blacklist info Clear the userspace blacklist info when a new command for set blacklist BSSID comes to the driver even if the userspace sends zero BSSIDs. Change-Id: Ic2e310359d8e83c0821a0c4c8fedd90e81998627 CRs-Fixed: 2464948 --- .../blacklist_mgr/core/src/wlan_blm_core.c | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/components/blacklist_mgr/core/src/wlan_blm_core.c b/components/blacklist_mgr/core/src/wlan_blm_core.c index 73e550e734ee..4ca1c4de2bfd 100644 --- a/components/blacklist_mgr/core/src/wlan_blm_core.c +++ b/components/blacklist_mgr/core/src/wlan_blm_core.c @@ -823,15 +823,36 @@ blm_add_userspace_black_list(struct wlan_objmgr_pdev *pdev, uint8_t i = 0; struct reject_ap_info ap_info; QDF_STATUS status; + struct blm_pdev_priv_obj *blm_ctx; + struct blm_psoc_priv_obj *blm_psoc_obj; + struct blm_config *cfg; + + blm_ctx = blm_get_pdev_obj(pdev); + blm_psoc_obj = blm_get_psoc_obj(wlan_pdev_get_psoc(pdev)); + + if (!blm_ctx || !blm_psoc_obj) { + blm_err("blm_ctx or blm_psoc_obj is NULL"); + return QDF_STATUS_E_INVAL; + } + + /* Clear all the info of APs already existing in BLM first */ + blm_clear_userspace_blacklist_info(pdev); + cfg = &blm_psoc_obj->blm_cfg; + + status = qdf_mutex_acquire(&blm_ctx->reject_ap_list_lock); + if (QDF_IS_STATUS_ERROR(status)) { + blm_err("failed to acquire reject_ap_list_lock"); + return status; + } + + blm_send_reject_ap_list_to_fw(pdev, &blm_ctx->reject_ap_list, cfg); + qdf_mutex_release(&blm_ctx->reject_ap_list_lock); if (!bssid_black_list || !num_of_bssid) { blm_debug("Userspace blacklist/num of blacklist NULL"); return QDF_STATUS_SUCCESS; } - /* Clear all the info of APs already existing in BLM first */ - blm_clear_userspace_blacklist_info(pdev); - for (i = 0; i < num_of_bssid; i++) { ap_info.bssid = bssid_black_list[i]; ap_info.reject_ap_type = USERSPACE_BLACKLIST_TYPE;