From 008bbdfec4d903acadea34ef4f6cdcfbd980e269 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Tue, 10 Dec 2019 17:08:50 +0530 Subject: [PATCH] qcacld-3.0: Set weight calculation done as true in ACS Currently the driver does not set weight calculated flag in the spectrum channel structure for each channel as true in 40, 80, 160 sorting case. Now in the next iteration the weight calculation done comes as false, and the weight is set as maximum which leads to wrong channel and BW selection and the last while running channel selection logic. Fix is to set weight calculation done as true for all the channels which come under the particular BW, and skip the channels for which the weights are already calculated. Change-Id: Ib355dd5cf7c3aeeb5534bfa295785bdfc30eed86 CRs-Fixed: 2583538 --- core/sap/src/sap_ch_select.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 6e526509d7eb..f61a460b9c69 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -1658,6 +1658,7 @@ static void sap_sort_chl_weight_80_mhz(struct mac_context *mac_ctx, minIdx = i; } pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 4; + pSpectInfo[j + i].weight_calc_done = true; } pSpectInfo[j + minIdx].weight = combined_weight; @@ -1823,6 +1824,7 @@ static void sap_sort_chl_weight_160_mhz(struct mac_context *mac_ctx, minIdx = i; } pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 8; + pSpectInfo[j + i].weight_calc_done = true; } pSpectInfo[j + minIdx].weight = combined_weight; @@ -2122,6 +2124,7 @@ static void sap_sort_chl_weight_40_mhz(struct mac_context *mac_ctx, minIdx = i; } pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 2; + pSpectInfo[j + i].weight_calc_done = true; } pSpectInfo[j + minIdx].weight = combined_weight;