From ed2d24fc50f45853126e125659f841218129a845 Mon Sep 17 00:00:00 2001 From: Shreedhar Parande Date: Wed, 29 Aug 2018 19:49:17 +0530 Subject: [PATCH] qcacmn: Fix for delay in preCAC timeout for non-weather radar channels Maximum among primary CAC timeout and secondary timeout was used to determime preCAC timeout. Due to this the non-weather radar channels were also using 600sec as preCAC timeout. To fix this, CAC on primary channel is done, then use secondary preCAC timeout. CRs-fixed: 2303360 Change-Id: If229957d8778a0a7794650e2908da8353fb9e090 --- umac/dfs/core/src/misc/dfs_zero_cac.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/umac/dfs/core/src/misc/dfs_zero_cac.c b/umac/dfs/core/src/misc/dfs_zero_cac.c index 81a651e0a5..f531369efb 100644 --- a/umac/dfs/core/src/misc/dfs_zero_cac.c +++ b/umac/dfs/core/src/misc/dfs_zero_cac.c @@ -94,6 +94,7 @@ #include "wlan_dfs_mlme_api.h" #include "wlan_dfs_utils_api.h" #include "../dfs_internal.h" +#include "../dfs_etsi_precac.h" void dfs_zero_cac_reset(struct wlan_dfs *dfs) { @@ -796,9 +797,21 @@ void dfs_start_precac_timer(struct wlan_dfs *dfs, uint8_t precac_chan) * which cancels any previous CAC timer and starts a new CAC again. * So CAC expiry does not happen and moreover a new CAC is started. * Therefore do not disturb the CAC by channel restart (vdev_restart). + * + * If CAC was already completed on primary, then we do not need to + * calculate which CAC timeout is maximum. + * For example: If primary's CAC is 600 seconds and secondary's CAC + * is 60 seconds then maximum gives 600 seconds which is not needed + * if CAC was already completed on primary. It is to be noted that + * etsi_precac/cac is done on primary segment. */ - precac_timeout = QDF_MAX(primary_cac_timeout, secondary_cac_timeout) + - EXTRA_TIME_IN_SEC; + if (!dfs_is_etsi_precac_done(dfs)) + precac_timeout = QDF_MAX(primary_cac_timeout, + secondary_cac_timeout) + + EXTRA_TIME_IN_SEC; + else + precac_timeout = secondary_cac_timeout + EXTRA_TIME_IN_SEC; + dfs_debug(dfs, WLAN_DEBUG_DFS, "precactimeout = %d", (precac_timeout)*1000); qdf_timer_mod(&dfs->dfs_precac_timer, (precac_timeout) * 1000);