Parcourir la source

qcacmn: Add support to enable/disable NOL subchannel marking

Add DFS function to enable or disable NOL subchannel marking.

Change-Id: Ibb6dbdb373af5b328c813c3b80b0f2296f644406
CRs-Fixed: 2334258
Vignesh U il y a 6 ans
Parent
commit
c008454014

+ 23 - 0
umac/dfs/core/src/dfs_process_radar_found_ind.h

@@ -159,4 +159,27 @@ uint8_t dfs_get_bonding_channels(struct wlan_dfs *dfs,
  */
 uint8_t dfs_get_bonding_channels_without_seg_info(struct dfs_channel *chan,
 						  uint8_t *channels);
+
+/**
+ * dfs_set_nol_subchannel_marking() - Set or unset NOL subchannel marking.
+ * @dfs: Pointer to wlan_dfs structure.
+ * @nol_subchannel_marking - Configure NOL subchannel marking.
+ *
+ * Return: Status of the configuration.
+ */
+int
+dfs_set_nol_subchannel_marking(struct wlan_dfs *dfs,
+			       bool nol_subchannel_marking);
+
+/**
+ * dfs_get_nol_subchannel_marking() - Get the value of NOL subchannel marking.
+ * @dfs: Pointer to wlan_dfs structure.
+ * @nol_subchannel_marking - Read and store the value of NOL subchannel marking
+ * config.
+ *
+ * Return: Status of the read.
+ */
+int
+dfs_get_nol_subchannel_marking(struct wlan_dfs *dfs,
+			       bool *nol_subchannel_marking);
 #endif /*_DFS_PROCESS_RADAR_FOUND_IND_H_ */

+ 0 - 1
umac/dfs/core/src/misc/dfs.c

@@ -193,7 +193,6 @@ int dfs_attach(struct wlan_dfs *dfs)
 	dfs_zero_cac_attach(dfs);
 	dfs_etsi_precac_attach(dfs);
 	dfs_nol_attach(dfs);
-	dfs->dfs_use_nol_subchannel_marking = 1;
 
 	/*
 	 * Init of timer ,dfs_testtimer_task is required by both partial

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

@@ -119,6 +119,30 @@
  *     <-------- 20 Mhz ------>
  */
 
+int dfs_set_nol_subchannel_marking(struct wlan_dfs *dfs,
+				   bool nol_subchannel_marking)
+{
+	if (!dfs)
+		return -EIO;
+
+	dfs->dfs_use_nol_subchannel_marking = nol_subchannel_marking;
+	dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "NOL subchannel marking is %s ",
+		 (nol_subchannel_marking) ? "set" : "disabled");
+
+	return 0;
+}
+
+int dfs_get_nol_subchannel_marking(struct wlan_dfs *dfs,
+				   bool *nol_subchannel_marking)
+{
+	if (!dfs)
+		return -EIO;
+
+	(*nol_subchannel_marking) = dfs->dfs_use_nol_subchannel_marking;
+
+	return 0;
+}
+
 /**
  * dfs_radar_add_channel_list_to_nol()- Add given channels to nol
  * @dfs: Pointer to wlan_dfs structure.

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

@@ -362,4 +362,31 @@ QDF_STATUS ucfg_dfs_get_override_status_timeout(struct wlan_objmgr_pdev *pdev,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+
+/**
+ * ucfg_dfs_set_nol_subchannel_marking() - Set or unset NOL subchannel marking.
+ * @pdev: Pointer to DFS pdev object.
+ * @nol_subchannel_marking: Set NOL subchannel marking based on this value.
+ *
+ * Wrapper function for dfs_set_nol_subchannel_marking().
+ * This function is called from outside of dfs component.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_dfs_set_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
+					       bool nol_subchannel_marking);
+
+/**
+ * ucfg_dfs_get_nol_subchannel_marking() - Get the value of NOL subchannel
+ * marking.
+ * @pdev: Pointer to DFS pdev object.
+ * @nol_subchannel_marking: Store the value of  NOL subchannel marking.
+ *
+ * Wrapper function for dfs_get_nol_subchannel_marking().
+ * This function is called from outside of dfs component.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_dfs_get_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
+					       bool *nol_subchannel_marking);
 #endif /* _WLAN_DFS_UCFG_API_H_ */

+ 31 - 0
umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c

@@ -26,6 +26,7 @@
 #include "../../core/src/dfs.h"
 #include "../../core/src/dfs_zero_cac.h"
 #include "../../core/src/dfs_partial_offload_radar.h"
+#include "../../core/src/dfs_process_radar_found_ind.h"
 #include <qdf_module.h>
 
 QDF_STATUS ucfg_dfs_is_ap_cac_timer_running(struct wlan_objmgr_pdev *pdev,
@@ -157,6 +158,36 @@ QDF_STATUS ucfg_dfs_get_precac_enable(struct wlan_objmgr_pdev *pdev,
 }
 qdf_export_symbol(ucfg_dfs_get_precac_enable);
 
+QDF_STATUS
+ucfg_dfs_set_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
+				    bool nol_subchannel_marking)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
+	if (!dfs)
+		return  QDF_STATUS_E_FAILURE;
+
+	dfs_set_nol_subchannel_marking(dfs, nol_subchannel_marking);
+
+	return QDF_STATUS_SUCCESS;
+}
+qdf_export_symbol(ucfg_dfs_set_nol_subchannel_marking);
+
+QDF_STATUS ucfg_dfs_get_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
+					       bool *nol_subchannel_marking)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = global_dfs_to_mlme.pdev_get_comp_private_obj(pdev);
+	if (!dfs)
+		return  QDF_STATUS_E_FAILURE;
+
+	dfs_get_nol_subchannel_marking(dfs, nol_subchannel_marking);
+
+	return QDF_STATUS_SUCCESS;
+}
+qdf_export_symbol(ucfg_dfs_get_nol_subchannel_marking);
 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
 QDF_STATUS ucfg_dfs_set_precac_intermediate_chan(struct wlan_objmgr_pdev *pdev,
 						 uint32_t value)

+ 6 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -1197,6 +1197,12 @@ struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_is_disable_radar_marking_set)(struct wlan_objmgr_pdev
 						 *pdev,
 						 bool *disable_radar_marking);
+	QDF_STATUS (*dfs_set_nol_subchannel_marking)(
+			struct wlan_objmgr_pdev *pdev,
+			bool value);
+	QDF_STATUS (*dfs_get_nol_subchannel_marking)(
+			struct wlan_objmgr_pdev *pdev,
+			bool *value);
 };
 
 struct wlan_lmac_if_mlme_rx_ops {

+ 4 - 1
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -381,7 +381,10 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 		tgt_dfs_reset_spoof_test;
 	dfs_rx_ops->dfs_is_disable_radar_marking_set =
 		utils_dfs_get_disable_radar_marking;
-
+	dfs_rx_ops->dfs_set_nol_subchannel_marking =
+		ucfg_dfs_set_nol_subchannel_marking;
+	dfs_rx_ops->dfs_get_nol_subchannel_marking =
+		ucfg_dfs_get_nol_subchannel_marking;
 	register_precac_auto_chan_rx_ops(dfs_rx_ops);
 
 	return QDF_STATUS_SUCCESS;