Browse Source

qcacmn: Fix auto BW calculation

Auto BW computes new bandwidth for adjacent regulatory rules. But this
combined bandwidth can be more than the bandwidth allowed for a
particular reg-domain. So relax the check for combined BW for
adjacent regulatory rules.

Change-Id: I1486988c114f0348f7228b91aeadc5c027c6a510
CRs-Fixed: 2626165
Amar Singhal 5 năm trước cách đây
mục cha
commit
12105f94d1
1 tập tin đã thay đổi với 4 bổ sung6 xóa
  1. 4 6
      umac/regulatory/core/src/reg_build_chan_list.c

+ 4 - 6
umac/regulatory/core/src/reg_build_chan_list.c

@@ -183,12 +183,10 @@ static void reg_do_auto_bw_correction(uint32_t num_reg_rules,
 	uint16_t new_bw;
 
 	for (count = 0; count < num_reg_rules - 1; count++) {
-		if ((reg_rule_ptr[count].end_freq ==
-		     reg_rule_ptr[count + 1].start_freq) &&
-		    ((reg_rule_ptr[count].max_bw +
-		      reg_rule_ptr[count + 1].max_bw) <= max_bw)) {
-			new_bw = reg_rule_ptr[count].max_bw +
-				reg_rule_ptr[count + 1].max_bw;
+		if (reg_rule_ptr[count].end_freq ==
+		    reg_rule_ptr[count + 1].start_freq) {
+			new_bw = QDF_MIN(max_bw, reg_rule_ptr[count].max_bw +
+					 reg_rule_ptr[count + 1].max_bw);
 			reg_rule_ptr[count].max_bw = new_bw;
 			reg_rule_ptr[count + 1].max_bw = new_bw;
 		}