From 82302fc9387466ce0de699e9076172bde7c67331 Mon Sep 17 00:00:00 2001 From: Abhishek Ambure Date: Mon, 27 Jan 2020 17:35:58 +0530 Subject: [PATCH] qcacld-3.0: Update result for GETROAMSCANCHANNELS command User can configure roam scan channels using SETROAMSCANCHANNELS and ADDROAMSCANCHANNELS command. As the result of GETROAMSCANCHANNELS command, driver returns the list of channels configured by user. Change-Id: I847215c8319f819f8db60690842ef50037fe6aaf CRs-Fixed: 2610136 --- core/sme/src/common/sme_api.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 5b6d9616533a..850ad3c913f7 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7503,7 +7503,7 @@ QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle, struct mac_context *mac = MAC_CONTEXT(mac_handle); tpCsrNeighborRoamControlInfo pNeighborRoamInfo = NULL; QDF_STATUS status = QDF_STATUS_SUCCESS; - tCsrChannelInfo *specific_chan_info; + tCsrChannelInfo *chan_info; if (sessionId >= WLAN_MAX_VDEVS) { QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, @@ -7515,18 +7515,21 @@ QDF_STATUS sme_get_roam_scan_channel_list(mac_handle_t mac_handle, status = sme_acquire_global_lock(&mac->sme); if (!QDF_IS_STATUS_SUCCESS(status)) return status; - specific_chan_info = &pNeighborRoamInfo->cfgParams.specific_chan_info; - if (!specific_chan_info->freq_list) { - QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_WARN, - FL("Roam Scan channel list is NOT yet initialized")); - *pNumChannels = 0; - sme_release_global_lock(&mac->sme); - return status; + + chan_info = &pNeighborRoamInfo->cfgParams.specific_chan_info; + if (!chan_info->numOfChannels) { + chan_info = &pNeighborRoamInfo->cfgParams.pref_chan_info; + if (!chan_info->numOfChannels) { + sme_err("Roam Scan channel list is NOT yet initialized"); + *pNumChannels = 0; + sme_release_global_lock(&mac->sme); + return status; + } } - *pNumChannels = specific_chan_info->numOfChannels; + *pNumChannels = chan_info->numOfChannels; for (i = 0; i < (*pNumChannels); i++) - freq_list[i] = specific_chan_info->freq_list[i]; + freq_list[i] = chan_info->freq_list[i]; freq_list[i] = '\0'; sme_release_global_lock(&mac->sme);