Browse Source

qcacmn: Fix host dfs confirmation FR issues

1. Do not send the RADAR found command to FW for bangradar. Since FW is
   unaware of the bangradar command for Partial Offload chips there is no
   need to send the Radar found indication to FW in bangradar processing.

2. Fix two times vap restart during spoof test: After sending the radar
   found command to the FW, the host waits for the FW to send the status
   check event to the host but if FW takes a very long time to send the
   event then the host timer times out and restarts the channel. After the
   channel restart if the host receives the status from FW, the host does
   the channel change again. Increase the host timer timeout value to avoid
   the two times channel change.

3. When removing the spoofed-radar-infected channel from NOL list, also
   remove the channel from regulatory channel list so that the regulatory
   channels are consistent with NOL.

Change-Id: I914d48e6202261b87a5ed6f8f40e150eb42463e2
CRs-Fixed: 2250008
Abhijit Pradhan 6 years ago
parent
commit
45098b95de

+ 13 - 1
umac/dfs/core/src/dfs.h

@@ -362,7 +362,7 @@
  * wait timer with this timeout.
  */
 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
-#define HOST_DFS_STATUS_WAIT_TIMER_MS 100
+#define HOST_DFS_STATUS_WAIT_TIMER_MS 200
 #endif
 
 /**
@@ -2201,6 +2201,18 @@ void __dfs_process_radarevent(struct wlan_dfs *dfs,
 		int *found,
 		int *false_radar_found);
 
+/**
+ * dfs_radar_found_action() - Radar found action
+ * @dfs: Pointer to wlan_dfs structure.
+ * @bangradar: true if radar is due to bangradar command.
+ * @seg_id: Segment id.
+ * @false_radar_found: value is 1 if false radar is found.
+ */
+void dfs_radar_found_action(struct wlan_dfs *dfs,
+			    bool bangradar,
+			    uint8_t seg_id,
+			    int false_radar_found);
+
 /**
  * bin5_rules_check_internal() - This is a extension of dfs_bin5_check().
  * @dfs: Pointer to wlan_dfs structure.

+ 1 - 1
umac/dfs/core/src/filtering/dfs_partial_offload_radar.c

@@ -553,7 +553,7 @@ void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id,
 void dfs_host_wait_timer_reset(struct wlan_dfs *dfs)
 {
 	dfs->dfs_is_host_wait_running = 0;
-	qdf_timer_stop(&dfs->dfs_host_wait_timer);
+	qdf_timer_sync_cancel(&dfs->dfs_host_wait_timer);
 }
 
 /**

+ 26 - 15
umac/dfs/core/src/filtering/dfs_process_radarevent.c

@@ -1293,6 +1293,25 @@ void dfs_radarfound_action_generic(struct wlan_dfs *dfs,
 		dfs_false_radarfound_reset_vars(dfs);
 }
 
+void dfs_radar_found_action(struct wlan_dfs *dfs,
+			    bool bangradar,
+			    uint8_t seg_id,
+			    int false_radar_found)
+{
+	/* If Host DFS confirmation is supported, save the curchan as
+	 * radar found chan, send radar found indication along with
+	 * average radar parameters to FW and start the host status
+	 * wait timer.
+	 */
+	if (!bangradar &&
+	    (utils_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_FCC_DOMAIN) &&
+	    lmac_is_host_dfs_check_support_enabled(dfs->dfs_pdev_obj)) {
+		dfs_radarfound_action_fcc(dfs, seg_id, false_radar_found);
+	} else {
+		dfs_radarfound_action_generic(dfs, seg_id, false_radar_found);
+	}
+}
+
 void dfs_process_radarevent(
 	struct wlan_dfs *dfs,
 	struct dfs_channel *chan)
@@ -1301,6 +1320,7 @@ void dfs_process_radarevent(
 	uint8_t   seg_id = 0;
 	int retval = 0;
 	int false_radar_found = 0;
+	bool bangradar = false;
 
 	if (!dfs_radarevent_basic_sanity(dfs, chan))
 		return;
@@ -1308,8 +1328,11 @@ void dfs_process_radarevent(
 	 * TEST : Simulate radar bang, make sure we add the channel to NOL
 	 * (bug 29968)
 	 */
-	if (dfs_handle_bangradar(dfs, chan, &rs, &seg_id, &retval))
+	if (dfs_handle_bangradar(dfs, chan, &rs, &seg_id, &retval)) {
+		if (retval)
+			bangradar = true;
 		goto dfsfound;
+	}
 
 	if (!dfs_handle_missing_pulses(dfs, chan))
 		return;
@@ -1320,20 +1343,8 @@ void dfs_process_radarevent(
 dfsfound:
 	if (retval) {
 		dfs_radarfound_reset_vars(dfs, rs, chan, seg_id);
-		/* If Host DFS confirmation is supported, save the curchan as
-		 * radar found chan, send radar found indication along with
-		 * average radar parameters to FW and start the host status
-		 * wait timer.
-		 */
-		if (utils_get_dfsdomain(dfs->dfs_pdev_obj) == DFS_FCC_DOMAIN &&
-		    lmac_is_host_dfs_check_support_enabled(
-				dfs->dfs_pdev_obj)) {
-			dfs_radarfound_action_fcc(dfs, seg_id,
-				false_radar_found);
-		} else {
-			dfs_radarfound_action_generic(dfs, seg_id,
-				false_radar_found);
-		}
+		dfs_radar_found_action(dfs, bangradar, seg_id,
+				       false_radar_found);
 	}
 
 }

+ 3 - 0
umac/dfs/core/src/misc/dfs_nol.c

@@ -613,5 +613,8 @@ void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs)
 		}
 	}
 	WLAN_DFSNOL_UNLOCK(dfs);
+
+	utils_dfs_reg_update_nol_ch(dfs->dfs_pdev_obj,
+				    channels, nchans, DFS_NOL_RESET);
 }
 #endif