From 2d3b0c58763595cc26aa7157b9dcda4035d6b15e Mon Sep 17 00:00:00 2001 From: Manjeet Singh Date: Fri, 2 Sep 2016 13:31:48 +0530 Subject: [PATCH] qcacld-3.0: Avoid Channel 0 in softap acs channel list qcacld-2.0 to qcacld-3.0 propagation. If ACS is enabled in hostapd configuration,hostapd sends a list of channels to HDD for softap bring-up. If hostapd finds a invalid/unsupported channel in its channel list, it will send a 0 for that channel. Since HDD always takes the lowest channel as starting channel for scan, the scan will always include 2.4Ghz channels even if channel mode is set to a. Hence HDD should ignore these invalid entries in channel list. CRs-fixed: 959490 Change-Id: Iddaf6c4ba14e22b476f22f1f098faf726f4407ec (cherry picked from commit 9f410939ff801316a153c44c603ce575fe6d15d5) --- core/hdd/src/wlan_hdd_cfg80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index a2ec1b5e16d6..918e4aaa8166 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1302,7 +1302,9 @@ static void wlan_hdd_set_acs_ch_range(tsap_Config_t *sap_cfg, bool ht_enabled, sap_cfg->acs_cfg.end_ch = sap_cfg->acs_cfg.ch_list[sap_cfg->acs_cfg.ch_list_count - 1]; for (i = 0; i < sap_cfg->acs_cfg.ch_list_count; i++) { - if (sap_cfg->acs_cfg.start_ch > sap_cfg->acs_cfg.ch_list[i]) + /* avoid channel as start channel */ + if (sap_cfg->acs_cfg.start_ch > sap_cfg->acs_cfg.ch_list[i] && + sap_cfg->acs_cfg.ch_list[i] != 0) sap_cfg->acs_cfg.start_ch = sap_cfg->acs_cfg.ch_list[i]; if (sap_cfg->acs_cfg.end_ch < sap_cfg->acs_cfg.ch_list[i]) sap_cfg->acs_cfg.end_ch = sap_cfg->acs_cfg.ch_list[i];