Ver Fonte

qcacmn: Stop puncture SM during DFS reset

When AP is moving to down state, stop the puncture SM.
If we do not stop the SM, the corresponding puncturing
slots will not be available for new radar puncturing.

Introduce a new member dfs_is_unpunctured in dfs_punc_obj
structure. The dfs_is_unpunctured holds the information
whether SM object is unpunctured at that moment. Since
both un-puncturing and puncturing are done through vdev
channel change, current code cannot differentiate between
if the channel change is for puncturing or it is for
un-puncturing.This variable will help us identify whether
an event should be for puncturing, or it is for
un-puncturing.

Handle the radar puncturing after the usenol check,
otherwise the usenol case will not get executed.

The internal_radar_pattern is not needed as the
information can be fetched from DFS puncture SM object.

CRs-Fixed: 3540171
Change-Id: If889348056ad82e7cbbe6ca954af7ddfa99e6865
Vijay Krishnan há 2 anos atrás
pai
commit
baf0a16d29

+ 2 - 3
umac/dfs/core/src/dfs.h

@@ -743,9 +743,6 @@ struct dfs_channel {
 	 */
 	uint16_t       dfs_ch_punc_pattern;
 #endif
-#if defined(QCA_DFS_BW_PUNCTURE) && !defined(CONFIG_REG_CLIENT)
-	uint16_t       dfs_internal_radar_pattern;
-#endif
 };
 
 /**
@@ -1061,6 +1058,7 @@ enum dfs_punc_sm_state {
  * @dfs_punc_sm_hdl:       The handle for the state machine.
  * @dfs_punc_sm_cur_state: Current state of the Puncturing State Machine.
  * @dfs_punc_sm_lock:      Puncturing state machine lock.
+ * @dfs_is_unpunctured:    Denotes the SM is unpunctured or not.
  */
 struct dfs_punc_obj {
 	qdf_freq_t punc_low_freq;
@@ -1070,6 +1068,7 @@ struct dfs_punc_obj {
 	struct wlan_sm *dfs_punc_sm_hdl;
 	enum dfs_punc_sm_state dfs_punc_sm_cur_state;
 	qdf_spinlock_t dfs_punc_sm_lock;
+	bool dfs_is_unpunctured;
 };
 
 /**

+ 13 - 0
umac/dfs/core/src/dfs_zero_cac.h

@@ -1380,6 +1380,14 @@ void dfs_create_punc_sm(struct wlan_dfs *dfs);
  */
 void dfs_destroy_punc_sm(struct wlan_dfs *dfs);
 
+/**
+ * dfs_punc_sm_stop_all() - API to stop all puncture SM object.
+ * @dfs: pointer to wlan_dfs.
+ *
+ * Return: Nothing.
+ */
+void dfs_punc_sm_stop_all(struct wlan_dfs *dfs);
+
 /**
  * dfs_punc_sm_stop() - Stop DFS puncture state machine.
  * @dfs:           Pointer to wlan_dfs.
@@ -1522,6 +1530,11 @@ void dfs_destroy_punc_sm(struct wlan_dfs *dfs)
 {
 }
 
+static inline
+void dfs_punc_sm_stop_all(struct wlan_dfs *dfs)
+{
+}
+
 static inline
 void dfs_punc_sm_stop(struct wlan_dfs *dfs,
 		      uint8_t indx,

+ 15 - 12
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -978,6 +978,9 @@ uint16_t dfs_generate_radar_bitmap(struct wlan_dfs *dfs,
 		bits <<= 1;
 	}
 
+	if (!dfs_radar_bitmap)
+		dfs_debug(dfs, WLAN_DEBUG_DFS_ALWAYS, "Radar bitmap is zero");
+
 	return dfs_radar_bitmap;
 }
 #endif
@@ -1057,18 +1060,6 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 							freq_list,
 							freq_center);
 
-	if (dfs->dfs_use_puncture) {
-		bool is_ignore_radar_puncture = false;
-
-		dfs_handle_radar_puncturing(dfs,
-					    &dfs_radar_bitmap,
-					    freq_list,
-					    num_channels,
-					    &is_ignore_radar_puncture);
-		if (is_ignore_radar_puncture)
-			goto exit;
-	}
-
 	if (!dfs->dfs_use_nol) {
 		if (!dfs->dfs_is_offload_enabled)
 			dfs_disable_radar_and_flush_pulses(dfs);
@@ -1080,6 +1071,18 @@ dfs_process_radar_ind_on_home_chan(struct wlan_dfs *dfs,
 
 	dfs_reset_bangradar(dfs);
 
+	if (dfs->dfs_use_puncture && !dfs->dfs_is_stadfs_enabled) {
+		bool is_ignore_radar_puncture = false;
+
+		dfs_handle_radar_puncturing(dfs,
+					    &dfs_radar_bitmap,
+					    freq_list,
+					    num_channels,
+					    &is_ignore_radar_puncture);
+		if (is_ignore_radar_puncture)
+			goto exit;
+	}
+
 	status = dfs_radar_add_channel_list_to_nol_for_freq(dfs,
 							    freq_list,
 							    nol_freq_list,

+ 3 - 0
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -58,6 +58,9 @@ QDF_STATUS utils_dfs_reset(struct wlan_objmgr_pdev *pdev)
 	dfs_reset_precaclists(dfs);
 	dfs_init_chan_state_array(pdev);
 
+	if (dfs->dfs_use_puncture && !dfs->dfs_is_stadfs_enabled)
+		dfs_punc_sm_stop_all(dfs);
+
 	return QDF_STATUS_SUCCESS;
 }