Browse Source

qca-wifi: Add extra time for agile precac timeout

While configuring the precac timeout as part of starting the agile
engine, the timeout value sent to FW and HOST timer were both equal,
resulting in two separate timeout.
1. Zero second timeout due to OCAC complete event from FW.
2. preCAC timer timeout.
Because of these timeouts, same channel is marked as OCAC complete
twice. To avoid this, increase the HOST timer timeout value by
2 seconds.

Change-Id: I9b649b5c783df962df2b8410691ee00d1abb4a9d
CRs-Fixed: 2556726
Vignesh Mohan 5 years ago
parent
commit
ee04d7a71b
1 changed files with 13 additions and 2 deletions
  1. 13 2
      umac/dfs/core/src/misc/dfs_zero_cac.c

+ 13 - 2
umac/dfs/core/src/misc/dfs_zero_cac.c

@@ -3189,6 +3189,7 @@ static bool dfs_is_pcac_on_weather_channel_for_freq(struct wlan_dfs *dfs,
  * @ocac_status: OCAC Status.
  * @adfs_param: Pointer to ADFS params.
  */
+#define EXTRA_TIME_IN_MS 2000
 #ifdef CONFIG_CHAN_FREQ_API
 void dfs_start_agile_precac_timer(struct wlan_dfs *dfs,
 				  uint8_t ocac_status,
@@ -3224,9 +3225,14 @@ void dfs_start_agile_precac_timer(struct wlan_dfs *dfs,
 
 	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
 		 "precactimeout = %d ms", (min_precac_timeout));
-	qdf_timer_mod(&dfs_soc_obj->dfs_precac_timer, min_precac_timeout);
+	/* Add the preCAC timeout in the params to be sent to FW. */
 	adfs_param->min_precac_timeout = min_precac_timeout;
 	adfs_param->max_precac_timeout = max_precac_timeout;
+	/* Increase the preCAC timeout in HOST by 2 seconds to avoid
+	 * FW OCAC completion event and HOST timer firing at same time. */
+	if (min_precac_timeout)
+		min_precac_timeout += EXTRA_TIME_IN_MS;
+	qdf_timer_mod(&dfs_soc_obj->dfs_precac_timer, min_precac_timeout);
 }
 #else
 #ifdef CONFIG_CHAN_NUM_API
@@ -3264,9 +3270,14 @@ void dfs_start_agile_precac_timer(struct wlan_dfs *dfs,
 
 	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
 		 "precactimeout = %d ms", (min_precac_timeout));
-	qdf_timer_mod(&dfs_soc_obj->dfs_precac_timer, min_precac_timeout);
+	/* Add the preCAC timeout in the params to be sent to FW. */
 	adfs_param->min_precac_timeout = min_precac_timeout;
 	adfs_param->max_precac_timeout = max_precac_timeout;
+	/* Increase the preCAC timeout in HOST by 2 seconds to avoid
+	 * FW OCAC completion event and HOST timer firing at same time. */
+	if (min_precac_timeout)
+		min_precac_timeout += EXTRA_TIME_IN_MS;
+	qdf_timer_mod(&dfs_soc_obj->dfs_precac_timer, min_precac_timeout);
 }
 #endif
 #endif