Parcourir la source

qcacmn: Update the maximum bandwidth of CHAN_5835_5895_1 to 40

In the current implementation, the frequency range and maximum
bandwidth of the regulatory rule CHAN_5835_5895_1
are 60 MHz and 80 MHz respectively. Which means that maximum
bandwidth is greater than the frequency range for this rule. But the
kernel does not allow us to have such a rule.

If we change the maximum bandwidth to 40 MHz for this rule, the kernel
warning disappears. However, it introduces a new problem.
If the beginning frequency of rule CHAN_5835_5895_1 matches with the
end frequency of a previous rule, say CHAN_5735_5835_2,  then the
function 'reg_do_auto_bw_correction' cannot stitch them (the rules)
properly as it simply adds the max bandwidths the two rules.
In this case, if the maximum bandwidth was reduced from 80 MHz to
40 MHz and previous rule's maximum bandwidth was 80 MHz and
the new stitched rule would have 120 MHz as the maximum bandwidth.
We should consider the frequency range of both the rules in order to
achieve the max bandwidth possible. Therefore, use the version of the
function 'reg_do_auto_bw_correction' that already does it.

Change-Id: Ib3cb1a31b6d376b9b02f3d4e6b56cd7b5e6fed3a
CRs-Fixed: 3381553
Divya R il y a 2 ans
Parent
commit
3d76f47ca8

+ 0 - 27
umac/regulatory/core/src/reg_build_chan_list.c

@@ -344,7 +344,6 @@ static void reg_update_max_bw_per_rule(uint32_t num_reg_rules,
 			min(reg_rule_start[count].max_bw, max_bw);
 }
 
-#ifdef CONFIG_REG_CLIENT
 /**
  * reg_bw_floor() - Calculate floor of a given bandwidth. Find the nearest
  * bandwidth, from the set = {5, 10, 20, 40, 80, 160, 320}, which is less
@@ -422,32 +421,6 @@ static void reg_do_auto_bw_correction(uint32_t num_reg_rules,
 		}
 	}
 }
-#else
-/**
- * reg_do_auto_bw_correction() - Calculate and update the maximum bandwidth
- * value.
- * @num_reg_rules: Number of regulatory rules.
- * @reg_rule_ptr: Pointer to regulatory rules.
- * @max_bw: Maximum bandwidth
- */
-static void reg_do_auto_bw_correction(uint32_t num_reg_rules,
-				      struct cur_reg_rule *reg_rule_ptr,
-				      uint16_t max_bw)
-{
-	uint32_t count;
-	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) {
-			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;
-		}
-	}
-}
-#endif
 
 /**
  * reg_modify_chan_list_for_dfs_channels() - disable the DFS channels if

+ 1 - 5
umac/regulatory/core/src/reg_db.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -1275,11 +1275,7 @@ const struct regulatory_rule reg_rules_5g[] = {
 	[CHAN_5735_5895_2] = {5735, 5895, 160, 20, REGULATORY_CHAN_NO_IR},
 	[CHAN_5835_5855_1] = {5835, 5855, 20, 30, 0},
 	[CHAN_5835_5855_2] = {5835, 5855, 20, 14, REGULATORY_CHAN_INDOOR_ONLY},
-#ifdef CONFIG_REG_CLIENT
 	[CHAN_5835_5895_1] = {5835, 5895, 40, 30, REGULATORY_CHAN_INDOOR_ONLY},
-#else
-	[CHAN_5835_5895_1] = {5835, 5895, 80, 30, REGULATORY_CHAN_INDOOR_ONLY},
-#endif
 	[CHAN_5850_5925_1] = {5850, 5925, 20, 24, 0},
 	[CHAN_5850_5925_2] = {5850, 5925, 20, 30, 0},
 #if defined(CONFIG_BAND_6GHZ) && defined(COMPILE_REGDB_6G)