فهرست منبع

qcacmn: Flush radar pulses after spoof check

Spoof DFS check happens when AP is brought up in a DFS channel in
FCC domain. These spoof pulses are sent by FW in several bursts
via wmi_phyerr_event_id. Once host receives the first set of pulses
and if radar is detected by the host, host sends the radar found params
to FW. However, host does not disable the radar detection. Hence, host
continues to receive the next burst of spoof pulses and detects radar
again. This second set of radar found params when sent to FW is treated
as "real radar" pulses and FW sends a DFS status code of 2. Hence
host does a channel change to a new channel.

Hence the spill-over spoof pulses are treated as "real radar" and causes
frequent channel change on the DUT.

Once the first set of spoof pulses are detected as radar and radar found
params are sent to FW, disable DFS radar detection until the DFS status
check is received from FW. Once FW responds with a DFS status check,
re-enable the radar detection.

Change-Id: I57018776a449203c6467bb384120d4319bc04805
CRs-Fixed: 3305592
Priyadarshnee Srinivasan 2 سال پیش
والد
کامیت
998c233d8f

+ 19 - 0
umac/dfs/core/src/dfs_partial_offload_radar.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -249,4 +250,22 @@ QDF_STATUS dfs_inject_synthetic_pulse_sequence(struct wlan_dfs *dfs,
 	return QDF_STATUS_SUCCESS;
 }
 #endif /* WLAN_DFS_PARTIAL_OFFLOAD && WLAN_DFS_SYNTHETIC_RADAR */
+
+/**
+ * dfs_disable_radar_and_flush_pulses() - Disable radar detect and flush
+ * the pulses to avoid false radar detects
+ * @dfs: Pointer to struct wlan_dfs
+ *
+ * Return: None
+ */
+#if defined(WLAN_DFS_PARTIAL_OFFLOAD)
+void
+dfs_disable_radar_and_flush_pulses(struct wlan_dfs *dfs);
+#else
+static inline void
+dfs_disable_radar_and_flush_pulses(struct wlan_dfs *dfs)
+{
+}
+#endif
+
 #endif /*  _DFS_PARTIAL_OFFLOAD_RADAR_H_ */

+ 13 - 0
umac/dfs/core/src/filtering/dfs_partial_offload_radar.c

@@ -825,6 +825,14 @@ void dfs_extract_radar_found_params(struct wlan_dfs *dfs,
 	dfs->dfs_average_pri = 0;
 }
 
+void
+dfs_disable_radar_and_flush_pulses(struct wlan_dfs *dfs)
+{
+	dfs_radar_disable(dfs);
+	dfs_second_segment_radar_disable(dfs);
+	dfs_flush_additional_pulses(dfs);
+}
+
 void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id)
 {
 	struct dfs_radar_found_params params;
@@ -839,6 +847,7 @@ void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id)
 		      dfs->dfs_status_timeout_override);
 	dfs->dfs_seg_id = seg_id;
 	dfs_send_avg_params_to_fw(dfs, &params);
+	dfs_disable_radar_and_flush_pulses(dfs);
 }
 
 void dfs_host_wait_timer_reset(struct wlan_dfs *dfs)
@@ -854,6 +863,10 @@ void dfs_host_wait_timer_reset(struct wlan_dfs *dfs)
 static void dfs_action_on_spoof_success(struct wlan_dfs *dfs)
 {
 	dfs->dfs_spoof_test_done = 1;
+
+	/* On spoof success, enable the radar detection flags */
+	dfs_radar_enable(dfs, 0, 0);
+
 	if (dfs->dfs_radar_found_chan.dfs_ch_freq ==
 			dfs->dfs_curchan->dfs_ch_freq) {
 		dfs_debug(dfs, WLAN_DEBUG_DFS_ALWAYS,

+ 3 - 8
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -1107,11 +1107,8 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 		goto exit;
 
 	if (!dfs->dfs_use_nol) {
-		if (!dfs->dfs_is_offload_enabled) {
-			dfs_radar_disable(dfs);
-			dfs_second_segment_radar_disable(dfs);
-			dfs_flush_additional_pulses(dfs);
-		}
+		if (!dfs->dfs_is_offload_enabled)
+			dfs_disable_radar_and_flush_pulses(dfs);
 		dfs_reset_bangradar(dfs);
 		dfs_send_csa_to_current_chan(dfs);
 		status = QDF_STATUS_SUCCESS;
@@ -1189,8 +1186,6 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 	 */
 
 	if (!dfs->dfs_is_offload_enabled) {
-		dfs_radar_disable(dfs);
-		dfs_second_segment_radar_disable(dfs);
 		/*
 		 * The radar queues were reset just after the filter match, but
 		 * the phyerror reception was not disabled. This might
@@ -1198,7 +1193,7 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 		 * detected as radar in the new channel. So, clear the radar
 		 * queues and the associated variables.
 		 */
-		dfs_flush_additional_pulses(dfs);
+		dfs_disable_radar_and_flush_pulses(dfs);
 	}
 
 	dfs_mlme_mark_dfs(dfs->dfs_pdev_obj,