Sfoglia il codice sorgente

qcacmn: Add DFS Radar Event Notifications

Add event notifications to userspace
    1. Radar Detect
    2. CAC Start
    3. CAC Complete
    4. NOL Start
    5. NOL Complete

CRs-Fixed: 2448199
Change-Id: I5deaa53c922fe4e149e7198b287e31d3876d49d4
phadiman 6 anni fa
parent
commit
b68fa39efd

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

@@ -249,6 +249,8 @@ static os_timer_func(dfs_remove_from_nol)
 
 	dfs_mlme_nol_timeout_notification(dfs->dfs_pdev_obj);
 	chan = utils_dfs_freq_to_chan(delfreq);
+	utils_dfs_deliver_event(dfs->dfs_pdev_obj, delfreq,
+				WLAN_EV_NOL_FINISHED);
 	dfs_debug(dfs, WLAN_DEBUG_DFS_NOL,
 		    "remove channel %d from nol", chan);
 	utils_dfs_add_to_etsi_precac_required_list(dfs->dfs_pdev_obj,

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

@@ -189,6 +189,10 @@ static QDF_STATUS dfs_radar_add_channel_list_to_nol(struct wlan_dfs *dfs,
 				(uint16_t)utils_dfs_chan_to_freq(channels[i]),
 				dfs->wlan_dfs_nol_timeout);
 		nollist[num_ch++] = last_chan;
+		utils_dfs_deliver_event(dfs->dfs_pdev_obj,
+					(uint16_t)
+					utils_dfs_chan_to_freq(channels[i]),
+					WLAN_EV_NOL_STARTED);
 		dfs_info(dfs, WLAN_DEBUG_DFS_NOL, "ch=%d Added to NOL",
 			 last_chan);
 	}
@@ -745,6 +749,10 @@ QDF_STATUS dfs_process_radar_ind(struct wlan_dfs *dfs,
 			 radarfound_freq, dfs->dfs_curchan->dfs_ch_ieee,
 			 dfs->dfs_curchan->dfs_ch_freq);
 
+	utils_dfs_deliver_event(dfs->dfs_pdev_obj,
+				radarfound_freq,
+				WLAN_EV_RADAR_DETECTED);
+
 	if (!dfs->dfs_use_nol) {
 		dfs_reset_bangradar(dfs);
 		dfs_send_csa_to_current_chan(dfs);

+ 19 - 0
umac/dfs/dispatcher/inc/wlan_dfs_ioctl.h

@@ -252,4 +252,23 @@ struct wlan_dfs_phyerr_param {
 	bool       pe_enmaxrssi;
 };
 
+/**
+ * enum WLAN_DFS_EVENTS - DFS Events that will be sent to userspace
+ * @WLAN_EV_RADAR_DETECTED: Radar is detected
+ * @WLAN_EV_CAC_STARTED:    CAC timer has started
+ * @WLAN_EV_CAC_COMPLETED:  CAC timer completed
+ * @WLAN_EV_NOL_STARTED:    NOL started
+ * @WLAN_EV_NOL_FINISHED:   NOL Completed
+ *
+ * DFS events such as radar detected, CAC started,
+ * CAC completed, NOL started, NOL finished
+ */
+enum WLAN_DFS_EVENTS {
+	WLAN_EV_RADAR_DETECTED,
+	WLAN_EV_CAC_STARTED,
+	WLAN_EV_CAC_COMPLETED,
+	WLAN_EV_NOL_STARTED,
+	WLAN_EV_NOL_FINISHED,
+};
+
 #endif  /* _DFS_IOCTL_H_ */

+ 6 - 0
umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h

@@ -27,6 +27,7 @@
 
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
+#include <wlan_dfs_ioctl.h>
 
 /**
  * struct dfs_to_mlme - These are MLME function pointer used by DFS component.
@@ -62,6 +63,7 @@
  *                                     list or not.
  * @mlme_update_scan_channel_list:     Update the scan channel list sent to FW.
  * @mlme_bringdown_vaps:               Bringdown vaps if no chans is present.
+ * @mlme_dfs_deliver_event:            Deliver DFS events to user space
  */
 struct dfs_to_mlme {
 	QDF_STATUS (*pdev_component_obj_attach)(struct wlan_objmgr_pdev *pdev,
@@ -148,6 +150,10 @@ struct dfs_to_mlme {
 			(struct wlan_objmgr_pdev *pdev);
 	QDF_STATUS (*mlme_bringdown_vaps)
 			(struct wlan_objmgr_pdev *pdev);
+	void (*mlme_dfs_deliver_event)
+			(struct wlan_objmgr_pdev *pdev,
+			 uint16_t freq,
+			 enum WLAN_DFS_EVENTS event);
 };
 
 extern struct dfs_to_mlme global_dfs_to_mlme;

+ 10 - 1
umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h

@@ -726,7 +726,7 @@ bool utils_dfs_check_for_cac_start(struct wlan_objmgr_pdev *pdev,
 bool utils_dfs_is_precac_done(struct wlan_objmgr_pdev *pdev,
 			      struct wlan_channel *wlan_chan);
 /**
- * utils_dfs_get_disable_radar_marking - Retrieve the value of disable radar
+ * utils_dfs_get_disable_radar_marking() - Retrieve the value of disable radar.
  * marking.
  * @pdev: Pointer to DFS pdev object.
  * @dis_radar_marking: pointer to retrieve the value of disable_radar_marking.
@@ -743,6 +743,15 @@ QDF_STATUS utils_dfs_get_disable_radar_marking(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+/**
+ * utils_dfs_deliver_event() - Deliver DFS event to userspace.
+ * @pdev: Pointer to DFS pdev object
+ * @chan: channel radar hit on
+ * @event: event being sent
+ */
+void utils_dfs_deliver_event(struct wlan_objmgr_pdev *pdev, uint16_t freq,
+			     enum WLAN_DFS_EVENTS event);
+
 /**
  * utils_dfs_clear_cac_started_chan() - Clear dfs cac started channel.
  * @pdev: pdev ptr

+ 2 - 0
umac/dfs/dispatcher/src/wlan_dfs_init_deinit_api.c

@@ -110,6 +110,8 @@ void register_dfs_callbacks(void)
 		mlme_dfs_update_scan_channel_list;
 	tmp_dfs_to_mlme->mlme_bringdown_vaps =
 		mlme_dfs_bringdown_vaps;
+	tmp_dfs_to_mlme->mlme_dfs_deliver_event =
+		mlme_dfs_deliver_event;
 
 	/*
 	 * Register precac auto channel switch feature related callbacks

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

@@ -1211,3 +1211,10 @@ bool utils_is_dfs_cfreq2_ch(struct wlan_objmgr_pdev *pdev)
 
 qdf_export_symbol(utils_is_dfs_cfreq2_ch);
 #endif
+
+void utils_dfs_deliver_event(struct wlan_objmgr_pdev *pdev, uint16_t freq,
+			     enum WLAN_DFS_EVENTS event)
+{
+	if (global_dfs_to_mlme.mlme_dfs_deliver_event)
+		global_dfs_to_mlme.mlme_dfs_deliver_event(pdev, freq, event);
+}