Răsfoiți Sursa

qcacmn: Add a dispatcher API to determine if RCAC is supported

Add a dispatcher API ucfg_dfs_is_agile_rcac_enabled() to determine
if RCAC is supported for the given pdev.
Change the prototype of dfs_get_rcac_enable() to store rcac
config in a bool datatype.
Also, do a structure copy of ch_params of RCAC channel in
utils_dfs_get_rcac_channel().

CRs-Fixed: 2679975
Change-Id: I4b033463fc8111144bfffd3bb7e7d2bef6568c46
Priyadarshnee S 5 ani în urmă
părinte
comite
78bb108d7c

+ 2 - 21
umac/dfs/core/src/dfs_zero_cac.h

@@ -1171,11 +1171,11 @@ dfs_set_rcac_enable(struct wlan_dfs *dfs,
  */
 #ifdef QCA_SUPPORT_ADFS_RCAC
 QDF_STATUS dfs_get_rcac_enable(struct wlan_dfs *dfs,
-			       uint8_t *rcac_en);
+			       bool *rcac_en);
 #else
 static inline QDF_STATUS
 dfs_get_rcac_enable(struct wlan_dfs *dfs,
-		    uint8_t *rcac_en)
+		    bool *rcac_en)
 {
 	return QDF_STATUS_SUCCESS;
 }
@@ -1241,25 +1241,6 @@ dfs_rcac_timer_deinit(struct dfs_soc_priv_obj *dfs_soc_obj)
 }
 #endif
 
-/**
- * dfs_is_host_agile_rcac_config_enabled() - Check if agile rCAC is enabled.
- * This considers the user config and DFS domain of the pdev to
- * to decide if agile RCAC is supported or not.
- * @dfs: Pointer to the wlan_dfs object.
- *
- * Return: True if agile DFS is enabled, else false.
- *
- */
-#ifdef QCA_SUPPORT_ADFS_RCAC
-bool dfs_is_host_agile_rcac_config_enabled(struct wlan_dfs *dfs);
-#else
-static inline bool
-dfs_is_host_agile_rcac_config_enabled(struct wlan_dfs *dfs)
-{
-	return false;
-}
-#endif
-
 #ifdef QCA_SUPPORT_ADFS_RCAC
 #define DFS_RCAC_SM_SPIN_LOCK(_soc_obj) \
 	qdf_spin_lock_bh(&((_soc_obj)->dfs_rcac_sm_lock))

+ 25 - 2
umac/dfs/dispatcher/inc/wlan_dfs_ucfg_api.h

@@ -623,11 +623,11 @@ ucfg_dfs_set_rcac_enable(struct wlan_objmgr_pdev *pdev,
  */
 #ifdef QCA_SUPPORT_ADFS_RCAC
 QDF_STATUS ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev,
-				    uint8_t *rcac_en);
+				    bool *rcac_en);
 #else
 static inline QDF_STATUS
 ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev,
-			 uint8_t *rcac_en)
+			 bool *rcac_en)
 {
 	return QDF_STATUS_SUCCESS;
 }
@@ -669,4 +669,27 @@ ucfg_dfs_get_rcac_freq(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+/**
+ * ucfg_dfs_is_agile_rcac_enabled() - Determine if Rolling CAC is supported
+ * or not.
+ * @pdev: Pointer to struct wlan_objmgr_pdev.
+ *
+ * Following are the conditions needed to assertain that rolling CAC
+ * is enabled:
+ * 1. DFS domain of the PDEV must be FCC or MKK.
+ * 2. User has enabled Rolling CAC configuration.
+ * 3. FW capability to support ADFS.
+ *
+ * Return: True if RCAC support is enabled, false otherwise.
+ */
+#ifdef QCA_SUPPORT_ADFS_RCAC
+bool ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev);
+#else
+static inline bool
+ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev)
+{
+	return false;
+}
+#endif
+
 #endif /* _WLAN_DFS_UCFG_API_H_ */

+ 16 - 1
umac/dfs/dispatcher/src/wlan_dfs_ucfg_api.c

@@ -469,7 +469,7 @@ QDF_STATUS ucfg_dfs_set_rcac_enable(struct wlan_objmgr_pdev *pdev,
 qdf_export_symbol(ucfg_dfs_set_rcac_enable);
 
 QDF_STATUS ucfg_dfs_get_rcac_enable(struct wlan_objmgr_pdev *pdev,
-				    uint8_t *rcac_en)
+				    bool *rcac_en)
 {
 	struct wlan_dfs *dfs;
 
@@ -521,4 +521,19 @@ QDF_STATUS ucfg_dfs_get_rcac_freq(struct wlan_objmgr_pdev *pdev,
 }
 
 qdf_export_symbol(ucfg_dfs_get_rcac_freq);
+
+bool ucfg_dfs_is_agile_rcac_enabled(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_dfs *dfs;
+
+	dfs = wlan_pdev_get_dfs_obj(pdev);
+	if (!dfs) {
+		dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "null dfs");
+		return false;
+	}
+
+	return dfs_is_agile_rcac_enabled(dfs);
+}
+
+qdf_export_symbol(ucfg_dfs_is_agile_rcac_enabled);
 #endif

+ 1 - 1
umac/dfs/dispatcher/src/wlan_dfs_utils_api.c

@@ -1668,7 +1668,7 @@ QDF_STATUS utils_dfs_get_rcac_channel(struct wlan_objmgr_pdev *pdev,
 		return status;
 
 	*target_chan_freq = dfs->dfs_rcac_param.rcac_pri_freq;
-	chan_params = &dfs->dfs_rcac_param.rcac_ch_params;
+	*chan_params = dfs->dfs_rcac_param.rcac_ch_params;
 
 	return QDF_STATUS_SUCCESS;
 }

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

@@ -1636,13 +1636,14 @@ struct wlan_lmac_if_dfs_rx_ops {
 	QDF_STATUS (*dfs_set_rcac_enable)(struct wlan_objmgr_pdev *pdev,
 					  bool rcac_en);
 	QDF_STATUS (*dfs_get_rcac_enable)(struct wlan_objmgr_pdev *pdev,
-					  uint8_t *rcac_en);
+					  bool *rcac_en);
 	QDF_STATUS (*dfs_set_rcac_freq)(struct wlan_objmgr_pdev *pdev,
 					qdf_freq_t rcac_freq);
 	QDF_STATUS (*dfs_get_rcac_freq)(struct wlan_objmgr_pdev *pdev,
 					qdf_freq_t *rcac_freq);
 	void (*dfs_rcac_sm_deliver_evt)(struct wlan_objmgr_pdev *pdev,
 					enum dfs_rcac_sm_evt event);
+	bool (*dfs_is_agile_rcac_enabled)(struct wlan_objmgr_pdev *pdev);
 #endif
 };
 

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

@@ -500,6 +500,7 @@ static void register_rcac_dfs_rx_ops(struct wlan_lmac_if_dfs_rx_ops *rx_ops)
 	rx_ops->dfs_set_rcac_freq = ucfg_dfs_set_rcac_freq;
 	rx_ops->dfs_get_rcac_freq = ucfg_dfs_get_rcac_freq;
 	rx_ops->dfs_rcac_sm_deliver_evt = utils_dfs_rcac_sm_deliver_evt;
+	rx_ops->dfs_is_agile_rcac_enabled = ucfg_dfs_is_agile_rcac_enabled;
 }
 #else
 static inline void