From 44e334fb7ebe898ff4c3a08ae2372e5f911b8935 Mon Sep 17 00:00:00 2001 From: Manishekar Chandrasekaran Date: Mon, 30 May 2016 16:42:50 +0530 Subject: [PATCH] qcacld-3.0: Sort ACS channel list for all channel width cases Ensure that the channel list used for ACS channel selection is sorted for all the possible channel width cases. In the current implementation, channel list sorting is not done for channels widths 80, 80+80 and 160MHz. Along with this the ACS channel range is getting set before the 11ac override, leading to incorrect hardware mode. Fix the same by setting the ACS range after 11ac override and ensure that channel list is sorted in all the valid channel width cases. Change-Id: Ic773b3a4b1c049bc2053c1d0d17dd047d7a88324 CRs-Fixed: 1022304 --- core/hdd/src/wlan_hdd_cfg80211.c | 4 ++-- core/sap/src/sap_ch_select.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 55b8ad8e55ca..ae82271450b1 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -1539,8 +1539,6 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, if (QDF_STATUS_SUCCESS != status) hddLog(LOGE, FL("Get PCL failed")); - wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled); - /* ACS override for android */ if (hdd_ctx->config->sap_p2p_11ac_override && ht_enabled) { hddLog(LOG1, FL("ACS Config override for 11AC")); @@ -1554,6 +1552,8 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, sap_config->acs_cfg.ch_width = eHT_CHANNEL_WIDTH_40MHZ; } + wlan_hdd_set_acs_ch_range(sap_config, ht_enabled, vht_enabled); + hddLog(LOG1, FL("ACS Config for wlan%d: HW_MODE: %d ACS_BW: %d HT: %d VHT: %d START_CH: %d END_CH: %d"), adapter->dev->ifindex, sap_config->acs_cfg.hw_mode, ch_width, ht_enabled, vht_enabled, diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index a66b58f87931..1792ff79069e 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1428,6 +1428,8 @@ void sap_sort_chl_weight_ht80(tSapChSelSpectInfo *pSpectInfoParams) } } + sap_sort_chl_weight(pSpectInfoParams); + pSpectInfo = pSpectInfoParams->pSpectCh; for (j = 0; j < (pSpectInfoParams->numSpectChans); j++) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, @@ -1565,6 +1567,8 @@ void sap_sort_chl_weight_vht160(tSapChSelSpectInfo *pSpectInfoParams) } } + sap_sort_chl_weight(pSpectInfoParams); + pSpectInfo = pSpectInfoParams->pSpectCh; for (j = 0; j < (pSpectInfoParams->numSpectChans); j++) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, @@ -1671,6 +1675,7 @@ void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams) } } } + sap_sort_chl_weight(pSpectInfoParams); } /*========================================================================== @@ -1797,14 +1802,11 @@ void sap_sort_chl_weight_all(ptSapContext pSapCtx, sap_sort_chl_weight_ht40_24_g(pSpectInfoParams); sap_sort_chl_weight_ht40_5_g(pSpectInfoParams); } - sap_sort_chl_weight(pSpectInfoParams); break; - case CH_WIDTH_80MHZ: case CH_WIDTH_80P80MHZ: sap_sort_chl_weight_ht80(pSpectInfoParams); break; - case CH_WIDTH_160MHZ: sap_sort_chl_weight_vht160(pSpectInfoParams); break;