Bläddra i källkod

qcacmn: Separate GET APIs for precac and agile precac flags

Currently a single API(dfs_get_precac_enable) is used to get
dfs_precac_enable and dfs_agile_precac_enable. This API is
wrongly returning value for dfs_precac_enable since agile
capability is set even for Cascade.

Separate out the GET APIs for getting dfs_precac_enable and
dfs_agile_precac_enable so that getting these flags becomes
independent of each other.

Change-Id: I08b0cbcd29c320a345865e3e9456ce3e809e26a6
CRs-fixed: 2501266
Shreedhar Parande 5 år sedan
förälder
incheckning
45d12fa2de

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

@@ -540,6 +540,21 @@ static inline uint32_t dfs_get_precac_enable(struct wlan_dfs *dfs)
 }
 #endif
 
+/**
+ * dfs_get_agile_precac_enable() - Get agile precac enable flag.
+ * @dfs: Pointer to wlan_dfs structure.
+ *
+ * Return: Value of flag dfs_agile_precac_enable
+ */
+#ifdef QCA_SUPPORT_AGILE_DFS
+bool dfs_get_agile_precac_enable(struct wlan_dfs *dfs);
+#else
+static inline bool dfs_get_agile_precac_enable(struct wlan_dfs *dfs)
+{
+	return false;
+}
+#endif
+
 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
 /**
  * dfs_set_precac_intermediate_chan() - Set intermediate chan to be used while

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

@@ -258,6 +258,21 @@ QDF_STATUS ucfg_dfs_set_precac_enable(struct wlan_objmgr_pdev *pdev,
  */
 QDF_STATUS ucfg_dfs_get_precac_enable(struct wlan_objmgr_pdev *pdev, int *buff);
 
+/**
+ * ucfg_dfs_get_agile_precac_enable() - Get agile precac enable flag.
+ * @pdev: Pointer to DFS pdev object.
+ * @buff: Pointer to save dfs_agile_precac_enable value.
+ *
+ * Wrapper function for dfs_get_agile_precac_enable().
+ * This function called from outside of dfs component.
+ *
+ * Return:
+ * * QDF_STATUS_SUCCESS: Successfully able to get agile precac flag.
+ * * QDF_STATUS_E_FAILURE: Failed to get agile precac flag.
+ */
+QDF_STATUS ucfg_dfs_get_agile_precac_enable(struct wlan_objmgr_pdev *pdev,
+					    bool *buff);
+
 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
 /**
  * ucfg_dfs_set_precac_intermediate_chan() - Set intermediate channel

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

@@ -159,6 +159,32 @@ QDF_STATUS ucfg_dfs_get_precac_enable(struct wlan_objmgr_pdev *pdev,
 }
 qdf_export_symbol(ucfg_dfs_get_precac_enable);
 
+QDF_STATUS ucfg_dfs_get_agile_precac_enable(struct wlan_objmgr_pdev *pdev,
+					    bool *buff)
+{
+	struct wlan_dfs *dfs;
+
+	if (!pdev || !buff)
+		return QDF_STATUS_E_FAILURE;
+
+	if (!tgt_dfs_is_pdev_5ghz(pdev)) {
+		*buff = false;
+		return QDF_STATUS_SUCCESS;
+	}
+
+	dfs = wlan_pdev_get_dfs_obj(pdev);
+	if (!dfs) {
+		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "null dfs");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*buff = dfs_get_agile_precac_enable(dfs);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+qdf_export_symbol(ucfg_dfs_get_agile_precac_enable);
+
 QDF_STATUS
 ucfg_dfs_set_nol_subchannel_marking(struct wlan_objmgr_pdev *pdev,
 				    bool nol_subchannel_marking)

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

@@ -1321,6 +1321,8 @@ struct wlan_lmac_if_dfs_rx_ops {
 			uint32_t value);
 	QDF_STATUS (*dfs_get_precac_enable)(struct wlan_objmgr_pdev *pdev,
 			int *buff);
+	QDF_STATUS (*dfs_get_agile_precac_enable)(struct wlan_objmgr_pdev *pdev,
+						  bool *buff);
 #ifdef WLAN_DFS_PRECAC_AUTO_CHAN_SUPPORT
 	QDF_STATUS (*dfs_set_precac_intermediate_chan)(struct wlan_objmgr_pdev *pdev,
 						       uint32_t value);

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

@@ -392,6 +392,7 @@ wlan_lmac_if_umac_dfs_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 		ucfg_dfs_override_precac_timeout;
 	dfs_rx_ops->dfs_set_precac_enable = ucfg_dfs_set_precac_enable;
 	dfs_rx_ops->dfs_get_precac_enable = ucfg_dfs_get_precac_enable;
+	dfs_rx_ops->dfs_get_agile_precac_enable = ucfg_dfs_get_agile_precac_enable;
 	dfs_rx_ops->dfs_get_override_precac_timeout =
 		ucfg_dfs_get_override_precac_timeout;
 	dfs_rx_ops->dfs_set_current_channel = tgt_dfs_set_current_channel;