Эх сурвалжийг харах

qcacmn: Reset dfs chan state in CAC stop

When AP moves from DFS to NON-DFS channel, dfs chan state is
not updated and have state DFS_CAC_STARTED. Similarly, if the VAP
operating in a DFS channel goes down, the dfs chan state needs
to change to DFS_CAC_REQUIRED but the dfs chan state remains in
DFS_CAC_STARTED.

During CAC STOP, send the DFS event CAC RESET to change the dfs
chan state.

Change-Id: I21831e2c79da67375f8e340964f899ebd169fd85
CRs-Fixed: 3160346
Vijay Krishnan 3 жил өмнө
parent
commit
4bc26c9b2d

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

@@ -2156,10 +2156,19 @@ bool dfs_is_cac_required(struct wlan_dfs *dfs,
 			 bool is_vap_restart);
 
 /**
- * dfs_cac_stop() - Clear the AP CAC timer.
+ * dfs_send_dfs_events_for_chan() - Send CAC RESET events
  * @dfs: Pointer to wlan_dfs structure.
+ * @chan: Pointer to dfs_channel structure.
+ * @event: WLAN_DFS_EVENTS values
  */
+void dfs_send_dfs_events_for_chan(struct wlan_dfs *dfs,
+				  struct dfs_channel *chan,
+				  enum WLAN_DFS_EVENTS event);
 
+/**
+ * dfs_cac_stop() - Clear the AP CAC timer.
+ * @dfs: Pointer to wlan_dfs structure.
+ */
 void dfs_cac_stop(struct wlan_dfs *dfs);
 
 /**
@@ -2262,6 +2271,13 @@ void dfs_cac_stop(struct wlan_dfs *dfs)
 {
 }
 
+static inline
+void dfs_send_dfs_events_for_chan(struct wlan_dfs *dfs,
+				  struct dfs_channel *chan,
+				  enum WLAN_DFS_EVENTS event)
+{
+}
+
 static inline
 void dfs_cancel_cac_timer(struct wlan_dfs *dfs)
 {

+ 21 - 0
umac/dfs/core/src/misc/dfs_cac.c

@@ -261,15 +261,36 @@ void dfs_cancel_cac_timer(struct wlan_dfs *dfs)
 	dfs_clear_cac_started_chan(dfs);
 }
 
+void dfs_send_dfs_events_for_chan(struct wlan_dfs *dfs,
+				  struct dfs_channel *chan,
+				  enum WLAN_DFS_EVENTS event)
+{
+	uint8_t nchannels, i;
+	qdf_freq_t freq_list[MAX_20MHZ_SUBCHANS];
+
+	nchannels =
+		dfs_get_bonding_channel_without_seg_info_for_freq(chan,
+								  freq_list);
+	for (i = 0; i < nchannels; i++)
+		utils_dfs_deliver_event(dfs->dfs_pdev_obj,
+					freq_list[i],
+					event);
+}
+
 void dfs_cac_stop(struct wlan_dfs *dfs)
 {
 	uint32_t phyerr;
+	struct dfs_channel *chan;
 
+	chan = &dfs->dfs_cac_started_chan;
 	dfs_get_debug_info(dfs, (void *)&phyerr);
 	dfs_debug(dfs, WLAN_DEBUG_DFS,
 		"Stopping CAC Timer %d procphyerr 0x%08x",
 		 dfs->dfs_curchan->dfs_ch_freq, phyerr);
 	qdf_hrtimer_cancel(&dfs->dfs_cac_timer);
+
+	dfs_send_dfs_events_for_chan(dfs, chan, WLAN_EV_CAC_RESET);
+
 	if (dfs->dfs_cac_timer_running)
 		dfs->dfs_cac_aborted = 1;
 	dfs_clear_cac_started_chan(dfs);