diff options
author | gaurank kathpalia <gkathpal@codeaurora.org> | 2020-12-24 11:11:44 +0530 |
---|---|---|
committer | Kuma Chang <kumachang@google.com> | 2020-12-29 11:59:34 +0000 |
commit | 67f04b057eaa5d9630f167e8f2e57f0972c57dc7 (patch) | |
tree | 9bad62f34da7c1814e7c69b4f14636965f58e21b | |
parent | 1ecf8d12c7415af1abfe532133530ddaace6b2cd (diff) | |
download | qcacld-67f04b057eaa5d9630f167e8f2e57f0972c57dc7.tar.gz |
qcacld-3.0: Override the SAP channel if num_ch = 0android-11.0.0_r0.81android-11.0.0_r0.76android-11.0.0_r0.66android-msm-redbull-4.19-android11-qpr2
Currently the driver overrides the channel for SAP
when the mode is ANY and STA is present on 2.4ghz
But there could be 5ghz channels also in the ch list
sent by hostpad, so consider them also, and if no
channel is left for operation, then only override
the channel.
Bug: 174373049
Test: Check hotspot channels after wifi connected
Change-Id: Ifa1d76b0d71c5791c381fbc2844717f2b14bdf69
CRs-Fixed: 2844587
-rw-r--r-- | core/hdd/src/wlan_hdd_cfg80211.c | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 81a3d6dc2c..26e609747e 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2893,6 +2893,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, goto out; } + sap_dump_acs_channel(&sap_config->acs_cfg); hdd_avoid_acs_channels(hdd_ctx, sap_config); pm_mode = @@ -2918,16 +2919,23 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, conc_channel = policy_mgr_mode_specific_get_channel(hdd_ctx->psoc, PM_STA_MODE); - if (is_external_acs_policy && conc_channel) { - if ((conc_channel <= WLAN_REG_CH_NUM(CHAN_ENUM_14) && - (sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211B || - sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211G || - sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211ANY))) { - sap_config->acs_cfg.pri_ch = conc_channel; + + if (is_external_acs_policy && + policy_mgr_is_force_scc(hdd_ctx->psoc) && + policy_mgr_get_connection_count(hdd_ctx->psoc)) { + policy_mgr_trim_acs_channel_list( + sap_config->acs_cfg.pcl_channels, + sap_config->acs_cfg.pcl_ch_count, + sap_config->acs_cfg.ch_list, + &sap_config->acs_cfg.ch_list_count); + + /* if it is only one channel, send ACS event to upper layer */ + if (sap_config->acs_cfg.ch_list_count == 1) { + sap_config->acs_cfg.pri_ch = + sap_config->acs_cfg.ch_list[0]; wlan_sap_set_sap_ctx_acs_cfg( WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config); - mac_handle = hdd_ctx->mac_handle; - sap_config_acs_result(mac_handle, + sap_config_acs_result(hdd_ctx->mac_handle, WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config->acs_cfg.ht_sec_ch); sap_config->ch_params.ch_width = @@ -2945,22 +2953,17 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, } } - if (is_external_acs_policy && - policy_mgr_is_force_scc(hdd_ctx->psoc) && - policy_mgr_get_connection_count(hdd_ctx->psoc)) { - policy_mgr_trim_acs_channel_list( - sap_config->acs_cfg.pcl_channels, - sap_config->acs_cfg.pcl_ch_count, - sap_config->acs_cfg.ch_list, - &sap_config->acs_cfg.ch_list_count); - - /* if it is only one channel, send ACS event to upper layer */ - if (sap_config->acs_cfg.ch_list_count == 1) { - sap_config->acs_cfg.pri_ch = - sap_config->acs_cfg.ch_list[0]; + if (is_external_acs_policy && conc_channel && + !sap_config->acs_cfg.ch_list_count) { + if ((conc_channel <= WLAN_REG_CH_NUM(CHAN_ENUM_14) && + (sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211B || + sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211G || + sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211ANY))) { + sap_config->acs_cfg.pri_ch = conc_channel; wlan_sap_set_sap_ctx_acs_cfg( WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config); - sap_config_acs_result(hdd_ctx->mac_handle, + mac_handle = hdd_ctx->mac_handle; + sap_config_acs_result(mac_handle, WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config->acs_cfg.ht_sec_ch); sap_config->ch_params.ch_width = @@ -2977,7 +2980,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, goto out; } } - ret = wlan_hdd_set_acs_ch_range(sap_config, hw_mode, ht_enabled, vht_enabled); if (ret) { |