From a693c6aa64b458366acbfd02797214aa266c1bb1 Mon Sep 17 00:00:00 2001 From: Vignesh U Date: Sun, 19 Jul 2020 19:20:22 +0530 Subject: [PATCH] qcacmn: Expand DFS Radar found on curchan sanity check Move the dfs current channel NULL check inside the routine that does the sanity check(dfs_radarevent_basic_sanity()). Since we have two completely different functions to handle radar from: 1) Home channel 2) Agile Channel we do not need agile detector check in "radar from home channel" function. Change-Id: Ie91f1d24c948e9d136f49d9ce8bc4cff29327862 CRs-Fixed: 2737944 --- .../src/misc/dfs_process_radar_found_ind.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c index 2afff375b785..3e883f757bb8 100644 --- a/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c +++ b/umac/dfs/core/src/misc/dfs_process_radar_found_ind.c @@ -772,9 +772,15 @@ void dfs_reset_bangradar(struct wlan_dfs *dfs) int dfs_radarevent_basic_sanity(struct wlan_dfs *dfs, struct dfs_channel *chan) { + if (!chan) { + dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, + "dfs->dfs_curchan is NULL"); + return 0; + } + if (!(WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(chan))) { - dfs_debug(dfs, WLAN_DEBUG_DFS2, - "radar event on non-DFS chan"); + dfs_debug(dfs, WLAN_DEBUG_DFS_ALWAYS, + "radar event on non-DFS chan"); if (!(dfs->dfs_is_offload_enabled)) { dfs_reset_radarq(dfs); dfs_reset_alldelaylines(dfs); @@ -1189,22 +1195,13 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs, dfs_curchan = dfs->dfs_curchan; - if (!dfs_curchan) { - dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs->dfs_curchan is NULL"); - goto exit; - } - /* Check if the current channel is a non DFS channel * If the current channel is non-DFS and the radar is from Agile * Detector we need to process it since Agile Detector has a * different channel. */ - if (!dfs_radarevent_basic_sanity(dfs, dfs_curchan) && - !(radar_found->detector_id == dfs_get_agile_detector_id(dfs))) { - dfs_err(dfs, WLAN_DEBUG_DFS, - "radar event on a non-DFS channel"); + if (!dfs_radarevent_basic_sanity(dfs, dfs_curchan)) goto exit; - } dfs_compute_radar_found_cfreq(dfs, radar_found, &freq_center); radarfound_freq = freq_center + radar_found->freq_offset;