From eaf41e382c047a6371b3d4cb04ba7f7b146d5faa Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Tue, 24 Sep 2019 19:03:22 +0800 Subject: [PATCH] qcacld-3.0: Fix channel to freq conversion wlan_reg_ch_to_freq accepts channel enum number. Use wlan_reg_chan_to_freq to do channel -> freq conversion. Change-Id: I19255e5a3564139191fa53f528264388fc263a83 CRs-Fixed: 2534927 --- core/sap/src/sap_api_link_cntl.c | 9 ++++++--- core/sap/src/sap_ch_select.c | 3 ++- core/sap/src/sap_fsm.c | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index aa5e50156abf..0456128a9a84 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -239,6 +239,7 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(mac_handle_t mac_handle, eCsrScanStatus scan_status) { uint8_t oper_channel = SAP_CHANNEL_NOT_SELECTED; + struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle); host_log_acs_scan_done(acs_scan_done_status_str(scan_status), sessionid, scanid); @@ -248,7 +249,8 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(mac_handle_t mac_handle, scan_status); oper_channel = sap_select_default_oper_chan(sap_ctx->acs_cfg); - sap_ctx->chan_freq = wlan_reg_ch_to_freq(oper_channel); + sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev, + oper_channel); sap_ctx->acs_cfg->pri_ch = oper_channel; sap_config_acs_result(mac_handle, sap_ctx, sap_ctx->acs_cfg->ht_sec_ch); @@ -268,7 +270,7 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(mac_handle_t mac_handle, oper_channel = sap_select_default_oper_chan(sap_ctx->acs_cfg); } - sap_ctx->chan_freq = wlan_reg_ch_to_freq(oper_channel); + sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev, oper_channel); sap_ctx->acs_cfg->pri_ch = oper_channel; sap_config_acs_result(mac_handle, sap_ctx, sap_ctx->acs_cfg->ht_sec_ch); @@ -350,7 +352,8 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx, is_ch_dfs = true; } - sap_ctx->chan_freq = wlan_reg_ch_to_freq(target_channel); + sap_ctx->chan_freq = wlan_reg_chan_to_freq(mac_ctx->pdev, + target_channel); /* check if currently selected channel is a DFS channel */ if (is_ch_dfs && sap_ctx->pre_cac_complete) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_MED, FL( diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 8c74de284428..2f2fed45309e 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -2749,7 +2749,8 @@ uint8_t sap_select_channel(mac_handle_t mac_handle, } else if (best_ch_num == 14) { sap_ctx->acs_cfg->ht_sec_ch = 0; } - sap_ctx->sec_ch_freq = wlan_reg_ch_to_freq(sap_ctx->acs_cfg->ht_sec_ch); + sap_ctx->sec_ch_freq = wlan_reg_chan_to_freq( + mac_ctx->pdev, sap_ctx->acs_cfg->ht_sec_ch); sap_ch_sel_end: /* Free all the allocated memory */ diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index b4e67ac58719..072540f6eee6 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -735,12 +735,12 @@ sap_validate_chan(struct sap_context *sap_context, if (sap_context->cc_switch_mode != QDF_MCC_TO_SCC_SWITCH_DISABLE) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, - FL("check for overlap: chan:%d mode:%d"), - sap_ch, + FL("check for overlap: chan freq:%d mode:%d"), + sap_context->chan_freq, sap_context->csr_roamProfile.phyMode); con_ch = sme_check_concurrent_channel_overlap( mac_handle, - sap_ch, + sap_context->chan_freq, sap_context->csr_roamProfile.phyMode, sap_context->cc_switch_mode); QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG,