diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index dcd1fe4e3dbb..8e0d07dbed72 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2577,7 +2577,9 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, } hdd_debug("channel width =%d", ch_width); - if (ch_width == 80) + if (ch_width == 160) + sap_config->acs_cfg.ch_width = CH_WIDTH_160MHZ; + else if (ch_width == 80) sap_config->acs_cfg.ch_width = CH_WIDTH_80MHZ; else if (ch_width == 40) sap_config->acs_cfg.ch_width = CH_WIDTH_40MHZ; @@ -2886,7 +2888,9 @@ void wlan_hdd_cfg80211_acs_ch_select_evt(struct hdd_adapter *adapter) return; } - if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_80MHZ) + if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_160MHZ) + ch_width = 160; + else if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_80MHZ) ch_width = 80; else if (sap_cfg->acs_cfg.ch_width == CH_WIDTH_40MHZ) ch_width = 40; diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 2046cd88a991..058a6fd57b31 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1911,12 +1911,16 @@ static void sap_sort_chl_weight_ht80(tSapChSelSpectInfo *pSpectInfoParams) } } + /* + * Assign max weight(SAP_ACS_WEIGHT_MAX * 4) to 2.4 Ghz channels + * and channel 165 as they cannot be part of a 80Mhz channel bonding. + */ pSpectInfo = pSpectInfoParams->pSpectCh; for (j = 0; j < pSpectInfoParams->numSpectChans; j++) { - if (CHANNEL_165 == pSpectInfo[j].chNum) { + if ((pSpectInfo[j].chNum >= WLAN_REG_CH_NUM(CHAN_ENUM_1) && + pSpectInfo[j].chNum <= WLAN_REG_CH_NUM(CHAN_ENUM_14)) || + (CHANNEL_165 == pSpectInfo[j].chNum)) pSpectInfo[j].weight = SAP_ACS_WEIGHT_MAX * 4; - break; - } } sap_sort_chl_weight(pSpectInfoParams); @@ -2051,12 +2055,18 @@ static void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams) pSpectInfo[j + minIdx].weight = acs_vht160_channels[i].weight; } + /* + * Assign max weight(SAP_ACS_WEIGHT_MAX * 8) to 2.4 Ghz channels + * and channel 132-165 as they cannot be part of a 160Mhz channel + * bonding. + */ pSpectInfo = pSpectInfoParams->pSpectCh; for (j = 0; j < pSpectInfoParams->numSpectChans; j++) { - if (CHANNEL_165 == pSpectInfo[j].chNum) { + if ((pSpectInfo[j].chNum >= WLAN_REG_CH_NUM(CHAN_ENUM_1) && + pSpectInfo[j].chNum <= WLAN_REG_CH_NUM(CHAN_ENUM_14)) || + (pSpectInfo[j].chNum >= WLAN_REG_CH_NUM(CHAN_ENUM_132) && + pSpectInfo[j].chNum <= WLAN_REG_CH_NUM(CHAN_ENUM_165))) pSpectInfo[j].weight = SAP_ACS_WEIGHT_MAX * 8; - break; - } } sap_sort_chl_weight(pSpectInfoParams);