From aa6f96a345ee01c9effca2fc309122880d50b602 Mon Sep 17 00:00:00 2001 From: bings Date: Mon, 11 Sep 2017 09:49:43 +0800 Subject: [PATCH] qcacld-3.0: Fix channel weight calculation errors in ACS mode Channel 13 and channel 9 can be combined to HT40. The channel weight of 13 is updated with channel 9 when chStartNum of acs_ht40_channels24_g is 9 in sap_sort_chl_weight_ht40_24_g, however at this time the channel weight of 9 may be already updated to SAP_ACS_WEIGHT_MAX * 2 when the chStartNum of acs_ht40_channels24_g is 1. In such case channel weight of 13 is updated incorrectly. When update the channel weight of 13, use original channel weight of channel 9 and channel 13. Change-Id: Iab16cd5b1ab45fdf2f9805767d81c6fc997ee4be CRs-Fixed: 2105213 --- core/sap/src/sap_ch_select.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index e0751120441a..3d070510f55c 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -2188,10 +2188,10 @@ static void sap_sort_chl_weight_ht40_24_g(tSapChSelSpectInfo *pSpectInfoParams, } } } else { - tmpWeight1 = pSpectInfo[j].weight + - pSpectInfo[j + 4].weight; - if (pSpectInfo[j].weight <= - pSpectInfo[j + 4].weight) { + tmpWeight1 = pSpectInfo[j].weight_copy + + pSpectInfo[j + 4].weight_copy; + if (pSpectInfo[j].weight_copy <= + pSpectInfo[j + 4].weight_copy) { pSpectInfo[j].weight = tmpWeight1; pSpectInfo[j + 4].weight = SAP_ACS_WEIGHT_MAX * 2;