From 3fb68e1e6d5d325a5c19aa5a3c6d69d9ade3da2b Mon Sep 17 00:00:00 2001 From: Hariharan Basuthkar Date: Fri, 16 Nov 2018 21:49:09 +0530 Subject: [PATCH] qcacmn: Correct frequency offset computation during bin5 radar Changes configured to operate in Channel 100(HT80), if bin5 chirp radar is injected at center frequency at 5530 MHz, instead of adding channel 108(HT20), it adds channel 116(HT20) of adjacent 80 MHz band to NOL list. We have the following variable assignments in function dfs_pulses_within_window: dfs->dfs_min_sidx = pl->pl_elems[*index].p_sidx dfs->dfs_max_sidx = pl->pl_elems[*index].p_sidx Since the variable pl->pl_elems[*index].p_sidx is of signed type and variables dfs->dfs_min_sidx/dfs->dfs_max_sidx are of unsigned type, if the value of the variable pl->pl_elems[*index].p_sidx is negative, the values of the variables dfs->dfs_min_sidx/dfs->dfs_max_sidx become very large unsigned value. When sidx is converted to frequency offset, the frequency offset also becomes very large and it is greater than 40Mhz(half of HT80). In this case, 50MHz is added to center frequency 5530 MHz, which becomes 5580MHz(channel 116(HT20)). This results in the channel 116(HT20) of adjacent 80 MHz band to be added to NOL list. Change the type of the variables dfs->dfs_min_sidx/dfs->dfs_max_sidx from unsigned to signed so that assignments do not alter the actual value of the frequency offset. Change-Id: I13995888b618d9dd8a91447d5dffe27aa2e27a27 CRs-Fixed: 2342743 --- umac/dfs/core/src/dfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index 21bd980f49f3..967e209cd399 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -1142,8 +1142,8 @@ struct wlan_dfs { int dfs_status_timeout_override; #endif bool dfs_is_stadfs_enabled; - uint32_t dfs_min_sidx; - uint32_t dfs_max_sidx; + int32_t dfs_min_sidx; + int32_t dfs_max_sidx; uint8_t dfs_seg_id; uint8_t dfs_is_chirp; uint8_t dfs_bw_reduced;