From 12105f94d1c74f1494ef70cf71803ebc7b713ac9 Mon Sep 17 00:00:00 2001 From: Amar Singhal Date: Fri, 21 Feb 2020 12:26:19 -0800 Subject: [PATCH] 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 --- umac/regulatory/core/src/reg_build_chan_list.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index eee8f98a2e..f523857c7c 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/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; }