From 6523bc72c997ae6eeefdbc45cc5ea30f5cb23c06 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Mon, 2 Dec 2019 19:40:53 +0530 Subject: [PATCH] qcacld-3.0: Clear Static channel list in fw for SETROAMSCANCONTROL 0 In the present implementation, it is observed that "SETROAMSCANCONTROL 0" command is not clearing STATIC channels in the firmware for ROAM scan list. So to clear STATIC channels configured for ROAM scan and set dynamically added ROAM scan channels host sends two RSO commands to Firmware. In the first RSO command STATIC channel list is cleared and second RSO command will add dynamically added ROAM scan channels to ROAM scan list in firmware. Change-Id: Ic359326032c5776540c773a51d7531c0cfcd7bdc CRs-Fixed: 2571119 --- core/sme/src/common/sme_api.c | 10 +++++++++- core/sme/src/csr/csr_api_roam.c | 20 ++++++++++++-------- core/wma/src/wma_scan_roam.c | 16 ++++++---------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index fc62844c56c9..06b98b92d4ca 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -6252,9 +6252,17 @@ QDF_STATUS sme_set_roam_scan_control(mac_handle_t mac_handle, uint8_t sessionId, specific_channel_info = &neighbor_roam_info->cfgParams.specific_chan_info; csr_flush_cfg_bg_scan_roam_channel_list(specific_channel_info); - if (mac->mlme_cfg->lfr.roam_scan_offload_enabled) + if (mac->mlme_cfg->lfr.roam_scan_offload_enabled) { + /** Clear the static channel in FW by REASON_FLUSH_CHANNEL_LIST + * and then append channel list with dynamic channels in the FW + * using REASON_CHANNEL_LIST_CHANGED. + */ csr_roam_update_cfg(mac, sessionId, REASON_FLUSH_CHANNEL_LIST); + + csr_roam_update_cfg(mac, sessionId, + REASON_CHANNEL_LIST_CHANGED); + } } mac->roam.configParam.nRoamScanControl = roamScanControl; sme_release_global_lock(&mac->sme); diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index aca4beee7a59..c957b65eff3c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -18448,13 +18448,16 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx, status = csr_fetch_ch_lst_from_ini(mac_ctx, roam_info, req_buf); - if (!QDF_IS_STATUS_SUCCESS(status)) { - QDF_TRACE(QDF_MODULE_ID_SME, - QDF_TRACE_LEVEL_DEBUG, - "Fetch channel list from ini failed"); - qdf_mem_free(req_buf); - return NULL; - } + if (!QDF_IS_STATUS_SUCCESS(status)) { + QDF_TRACE(QDF_MODULE_ID_SME, + QDF_TRACE_LEVEL_DEBUG, + "Fetch channel list from ini failed"); + qdf_mem_free(req_buf); + return NULL; + } + } else if (reason == REASON_FLUSH_CHANNEL_LIST) { + req_buf->ChannelCacheType = CHANNEL_LIST_STATIC; + req_buf->ConnectedNetwork.ChannelCount = 0; } else { csr_fetch_ch_lst_from_occupied_lst(mac_ctx, session_id, reason, req_buf, @@ -18480,7 +18483,8 @@ csr_create_roam_scan_offload_request(struct mac_context *mac_ctx, curr_ch_lst_info, req_buf); } #endif - if (req_buf->ConnectedNetwork.ChannelCount == 0) { + if (req_buf->ConnectedNetwork.ChannelCount == 0 && + reason != REASON_FLUSH_CHANNEL_LIST) { /* Maintain the Valid Channels List */ status = csr_fetch_valid_ch_lst(mac_ctx, req_buf, session_id); if (!QDF_IS_STATUS_SUCCESS(status)) { diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c index bf748e35e81c..a0a63137b8a7 100644 --- a/core/wma/src/wma_scan_roam.c +++ b/core/wma/src/wma_scan_roam.c @@ -719,22 +719,18 @@ QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle, { QDF_STATUS status; int i; - uint32_t *chan_list_mhz; - - if (chan_count == 0) { - WMA_LOGD("%s : invalid number of channels %d", __func__, - chan_count); - return QDF_STATUS_E_EMPTY; - } + uint32_t *chan_list_mhz = NULL; if (!wma_is_vdev_valid(vdev_id)) { WMA_LOGE("%s: Invalid vdev id:%d", __func__, vdev_id); return QDF_STATUS_E_FAILURE; } - chan_list_mhz = qdf_mem_malloc(chan_count * sizeof(*chan_list_mhz)); - if (!chan_list_mhz) - return QDF_STATUS_E_NOMEM; + if (chan_count) { + chan_list_mhz = qdf_mem_malloc(chan_count * sizeof(*chan_list_mhz)); + if (!chan_list_mhz) + return QDF_STATUS_E_NOMEM; + } for (i = 0; ((i < chan_count) && (i < SIR_ROAM_MAX_CHANNELS)); i++) {