From c9a483e5d78c9934832318bb9a3f97d1e8c9edf8 Mon Sep 17 00:00:00 2001 From: Vignesh Mohan Date: Tue, 17 Sep 2019 12:06:46 +0530 Subject: [PATCH] qcacmn: Send the channel structure to check for ETSI preCAC While checking if ETSI preCAC is already done on a given channel in the API "dfs_is_etsi_precac_done", dfs_curchan is always used as the channel to be checked. Since the API "dfs_is_cac_required" maybe called without updating the dfs_curchan, using dfs_curchan in function "dfs_is_etsi_precac_done" is not correct. Use the current channel provided to the API "dfs_is_cac_required" as input while checking for ETSI preCAC. Change-Id: Id2bc59281e17afaa3ba7572f5a2d7bd4718a7639 CRs-Fixed: 2528023 --- umac/dfs/core/src/dfs_etsi_precac.h | 6 ++++-- umac/dfs/core/src/misc/dfs_cac.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/umac/dfs/core/src/dfs_etsi_precac.h b/umac/dfs/core/src/dfs_etsi_precac.h index 59c449b9bd..666fa2cb83 100644 --- a/umac/dfs/core/src/dfs_etsi_precac.h +++ b/umac/dfs/core/src/dfs_etsi_precac.h @@ -172,13 +172,15 @@ static inline int dfs_is_subchan_in_etsi_precac_done_list(struct wlan_dfs *dfs) /** * dfs_is_etsi_precac_done() - Is precac done. * @dfs: Pointer to wlan_dfs structure. + * @channel: Channel to be checked of dfs_channel structure. * * Return: If precac already done in channel, return 1. Otherwise return 0. */ #if defined(QCA_SUPPORT_ETSI_PRECAC_DFS) -bool dfs_is_etsi_precac_done(struct wlan_dfs *dfs); +bool dfs_is_etsi_precac_done(struct wlan_dfs *dfs, struct dfs_channel *channel); #else -static inline bool dfs_is_etsi_precac_done(struct wlan_dfs *dfs) +static inline bool +dfs_is_etsi_precac_done(struct wlan_dfs *dfs, struct dfs_channel *channel) { return false; } diff --git a/umac/dfs/core/src/misc/dfs_cac.c b/umac/dfs/core/src/misc/dfs_cac.c index 6417aab658..4788f916b0 100644 --- a/umac/dfs/core/src/misc/dfs_cac.c +++ b/umac/dfs/core/src/misc/dfs_cac.c @@ -410,7 +410,7 @@ bool dfs_is_cac_required(struct wlan_dfs *dfs, return false; } - if (dfs_is_etsi_precac_done(dfs)) { + if (dfs_is_etsi_precac_done(dfs, cur_chan)) { dfs_debug(dfs, WLAN_DEBUG_DFS, "ETSI PRE-CAC alreay done on this channel %d", dfs->dfs_curchan->dfs_ch_ieee);