From 228370de3f200864f3a711baf7ff0540f011d162 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Wed, 10 Apr 2019 12:12:40 +0530 Subject: [PATCH] qcacld-3.0: Don't force SCC in AP+AP DFS scenario Overwrite 2nd AP's channel with 1st AP only when: 1. Current operating mode is single mac 2. or 2nd AP is coming up on 5G band channel Change-Id: I8260721a5f9b8547d93ed7c6775741e6a8cc2a44 CRs-Fixed: 2427083 --- core/hdd/src/wlan_hdd_hostapd.c | 15 +++++++++++---- core/sap/src/sap_fsm.c | 18 ++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 77efae3d02b9..af1f8dd3bc7e 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -5085,10 +5085,17 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, config->countryCode[0] = hdd_ctx->reg.alpha2[0]; config->countryCode[1] = hdd_ctx->reg.alpha2[1]; - ret = wlan_hdd_sap_cfg_dfs_override(adapter); - if (ret < 0) - goto error; - + /* Overwrite second AP's channel with first only when: + * 1. If operating mode is single mac + * 2. or if 2nd AP is coming up on 5G band channel + */ + ret = 0; + if (!policy_mgr_is_hw_dbs_capable(hdd_ctx->psoc) || + WLAN_REG_IS_5GHZ_CH(config->channel)) { + ret = wlan_hdd_sap_cfg_dfs_override(adapter); + if (ret < 0) + goto error; + } if (!ret && wlan_reg_is_dfs_ch(hdd_ctx->pdev, config->channel)) hdd_ctx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 6ea16fe7eb5d..8ac3f009d7bb 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2195,11 +2195,6 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx, sap_ctx->secondary_ch, &sap_ctx->ch_params); } - if (sap_ctx->channel > 14 && - (sap_ctx->csr_roamProfile.phyMode == eCSR_DOT11_MODE_11g || - sap_ctx->csr_roamProfile.phyMode == - eCSR_DOT11_MODE_11g_ONLY)) - sap_ctx->csr_roamProfile.phyMode = eCSR_DOT11_MODE_11a; /* * when AP2 is started while AP1 is performing ACS, we may not @@ -2212,13 +2207,24 @@ static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx, con_ch = sme_get_beaconing_concurrent_operation_channel( mac_handle, sap_ctx->sessionId); - if (con_ch && wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch)) { + /* Overwrite second AP's channel with first only when: + * 1. If operating mode is single mac + * 2. or if 2nd AP is coming up on 5G band channel + */ + if ((!policy_mgr_is_hw_dbs_capable(mac_ctx->psoc) || + WLAN_REG_IS_5GHZ_CH(sap_ctx->channel)) && + con_ch && wlan_reg_is_dfs_ch(mac_ctx->pdev, con_ch)) { sap_ctx->channel = con_ch; wlan_reg_set_channel_params(mac_ctx->pdev, sap_ctx->channel, 0, &sap_ctx->ch_params); } } + if (sap_ctx->channel > 14 && + (sap_ctx->csr_roamProfile.phyMode == eCSR_DOT11_MODE_11g || + sap_ctx->csr_roamProfile.phyMode == + eCSR_DOT11_MODE_11g_ONLY)) + sap_ctx->csr_roamProfile.phyMode = eCSR_DOT11_MODE_11a; /* * Transition from SAP_INIT to SAP_STARTING