浏览代码

qcacld-3.0: Fix combined weight issue in ACS

Currently the driver calculates the best channel
amoung the given spectrum and uses logic to select
best frequency amoung the BW members, but the logic
to maximize the weight before selecting the min
weight is wrong, and must be done after the selection
of the minimum weight frequency.

Fix is to maximize the weight after the minimum weight
channel is selected.

Change-Id: Ie196462fbcc4215e6eb655168d07305110ff0ee7
CRs-Fixed: 2578582
gaurank kathpalia 5 年之前
父节点
当前提交
71562069e1
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      core/sap/src/sap_ch_select.c

+ 3 - 4
core/sap/src/sap_ch_select.c

@@ -1653,11 +1653,11 @@ static void sap_sort_chl_weight_80_mhz(struct mac_context *mac_ctx,
 		minIdx = 0;
 
 		for (i = 0; i < 4; i++) {
-			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 4;
 			if (min_ch_weight > pSpectInfo[j + i].weight) {
 				min_ch_weight = pSpectInfo[j + i].weight;
 				minIdx = i;
 			}
+			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 4;
 		}
 
 		pSpectInfo[j + minIdx].weight = combined_weight;
@@ -1818,12 +1818,11 @@ static void sap_sort_chl_weight_160_mhz(struct mac_context *mac_ctx,
 		minIdx = 0;
 
 		for (i = 0; i < 8; i++) {
-			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 8;
-
 			if (min_ch_weight > pSpectInfo[j + i].weight) {
 				min_ch_weight = pSpectInfo[j + i].weight;
 				minIdx = i;
 			}
+			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 8;
 		}
 
 		pSpectInfo[j + minIdx].weight = combined_weight;
@@ -2118,11 +2117,11 @@ static void sap_sort_chl_weight_40_mhz(struct mac_context *mac_ctx,
 		minIdx = 0;
 
 		for (i = 0; i < 2; i++) {
-			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 2;
 			if (min_ch_weight > pSpectInfo[j + i].weight) {
 				min_ch_weight = pSpectInfo[j + i].weight;
 				minIdx = i;
 			}
+			pSpectInfo[j + i].weight = SAP_ACS_WEIGHT_MAX * 2;
 		}
 
 		pSpectInfo[j + minIdx].weight = combined_weight;