From d3c3cb004bd5126b9406111fe67ab38a6cb122bb Mon Sep 17 00:00:00 2001 From: Priyadarshnee S Date: Thu, 25 Oct 2018 12:18:40 +0530 Subject: [PATCH] qcacmn: Reset Radar Log Counter on "wifi" command Currently radar event log is cleared only during dfs_detach which happens during wifi unload. On issuing "wifi or wifi down" command, the logs are not cleared. During Spoof Radar Detection, the log counter values are spuriuos due to accumulation of phyerror events. This accumulation of events is either due to false radar detection or logs of the previous wifi cycle. Hence resetting the dfs radar log counters in the below cases: 1) During vap delete 2) During CC/ Regdomain change. 3) After false radar detect. CRs-Fixed: 2244562 Change-Id: I74745f61c634bab7f9c1a78ef8dea8da2ab1a997 --- umac/dfs/core/src/dfs_partial_offload_radar.h | 8 ++++++++ umac/dfs/core/src/filtering/dfs_process_phyerr.c | 2 +- umac/dfs/core/src/filtering/dfs_process_radarevent.c | 6 +++++- umac/dfs/core/src/misc/dfs.c | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/umac/dfs/core/src/dfs_partial_offload_radar.h b/umac/dfs/core/src/dfs_partial_offload_radar.h index cbc1bd628a1a..40b94f6a8b67 100644 --- a/umac/dfs/core/src/dfs_partial_offload_radar.h +++ b/umac/dfs/core/src/dfs_partial_offload_radar.h @@ -189,4 +189,12 @@ static inline void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs, { } #endif + +#if defined(WLAN_DFS_PARTIAL_OFFLOAD) +void dfs_false_radarfound_reset_vars(struct wlan_dfs *dfs); +#else +static inline void dfs_false_radarfound_reset_vars(struct wlan_dfs *dfs) +{ +} +#endif #endif /* _DFS_PARTIAL_OFFLOAD_RADAR_H_ */ diff --git a/umac/dfs/core/src/filtering/dfs_process_phyerr.c b/umac/dfs/core/src/filtering/dfs_process_phyerr.c index bb4aff53302b..16f7cee89eb3 100644 --- a/umac/dfs/core/src/filtering/dfs_process_phyerr.c +++ b/umac/dfs/core/src/filtering/dfs_process_phyerr.c @@ -576,7 +576,7 @@ void dfs_process_phyerr(struct wlan_dfs *dfs, void *buf, uint16_t datalen, "Radar already found in the channel, do not queue radar data"); return; } - + dfs->dfs_phyerr_count++; dfs->wlan_dfs_stats.total_phy_errors++; dfs_debug(dfs, WLAN_DEBUG_DFS2, "phyerr %d len %d", dfs->wlan_dfs_stats.total_phy_errors, datalen); diff --git a/umac/dfs/core/src/filtering/dfs_process_radarevent.c b/umac/dfs/core/src/filtering/dfs_process_radarevent.c index c36091fa275f..435d855f7b79 100644 --- a/umac/dfs/core/src/filtering/dfs_process_radarevent.c +++ b/umac/dfs/core/src/filtering/dfs_process_radarevent.c @@ -1267,7 +1267,7 @@ static inline int dfs_process_each_radarevent( * found. * @dfs: Pointer to wlan_dfs structure. */ -static inline void dfs_false_radarfound_reset_vars( +void dfs_false_radarfound_reset_vars( struct wlan_dfs *dfs) { dfs->dfs_seq_num = 0; @@ -1276,6 +1276,10 @@ static inline void dfs_false_radarfound_reset_vars( dfs->dfs_phyerr_freq_min = 0x7fffffff; dfs->dfs_phyerr_freq_max = 0; dfs->dfs_phyerr_w53_counter = 0; + dfs->dfs_event_log_count = 0; + dfs->dfs_phyerr_count = 0; + dfs->dfs_phyerr_reject_count = 0; + dfs->dfs_phyerr_queued_count = 0; } void dfs_radarfound_action_generic(struct wlan_dfs *dfs, uint8_t seg_id) diff --git a/umac/dfs/core/src/misc/dfs.c b/umac/dfs/core/src/misc/dfs.c index be8ffb6ab72b..5cffc8b17cc1 100644 --- a/umac/dfs/core/src/misc/dfs.c +++ b/umac/dfs/core/src/misc/dfs.c @@ -236,7 +236,7 @@ void dfs_reset(struct wlan_dfs *dfs) if (!dfs->dfs_is_offload_enabled) { dfs_main_timer_reset(dfs); dfs_host_wait_timer_reset(dfs); - dfs->dfs_event_log_count = 0; + dfs_false_radarfound_reset_vars(dfs); } dfs_task_testtimer_reset(dfs); }