Преглед изворни кода

qcacmn: Move the function used by WIN out of MCL specific macro

Move reg_enable_dfs_channels() outside of MCL specific macro as
it is also used by WIN.

Change-Id: I8fecf365a695524ad7a97b66eca5c6657aedb264
CRs-Fixed: 2398789
Vignesh U пре 6 година
родитељ
комит
0e6b19c47c

+ 52 - 0
umac/regulatory/core/src/reg_services_common.c

@@ -1956,3 +1956,55 @@ uint32_t reg_max_5ghz_ch_num(void)
 {
 	return REG_MAX_5GHZ_CH_NUM;
 }
+
+QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev,
+				   bool enable)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status;
+	struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("pdev reg component is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	if (pdev_priv_obj->dfs_enabled == enable) {
+		reg_info("dfs_enabled is already set to %d", enable);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		reg_err("psoc is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
+		reg_err("psoc reg component is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	reg_info("setting dfs_enabled: %d", enable);
+
+	pdev_priv_obj->dfs_enabled = enable;
+
+	reg_compute_pdev_current_chan_list(pdev_priv_obj);
+
+	reg_tx_ops = reg_get_psoc_tx_ops(psoc);
+
+	/* Fill the ic channel list with the updated current channel
+	 * chan list.
+	 */
+	if (reg_tx_ops->fill_umac_legacy_chanlist)
+		reg_tx_ops->fill_umac_legacy_chanlist(pdev,
+				pdev_priv_obj->cur_chan_list);
+
+	status = reg_send_scheduler_msg_sb(psoc, pdev);
+
+	return status;
+}

+ 8 - 0
umac/regulatory/core/src/reg_services_common.h

@@ -497,4 +497,12 @@ uint32_t reg_min_5ghz_ch_num(void);
  * Return: Maximum 5GHz channel number
  */
 uint32_t reg_max_5ghz_ch_num(void);
+
+/**
+ * reg_enable_dfs_channels() - Enable the use of DFS channels
+ * @pdev: The physical dev to enable/disable DFS channels for
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, bool enable);
 #endif

+ 0 - 52
umac/regulatory/core/src/reg_utils.c

@@ -538,58 +538,6 @@ QDF_STATUS reg_set_fcc_constraint(struct wlan_objmgr_pdev *pdev,
 	return status;
 }
 
-QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev,
-				   bool enable)
-{
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
-	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
-	struct wlan_objmgr_psoc *psoc;
-	QDF_STATUS status;
-	struct wlan_lmac_if_reg_tx_ops *reg_tx_ops;
-
-	pdev_priv_obj = reg_get_pdev_obj(pdev);
-	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
-		reg_err("pdev reg component is NULL");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	if (pdev_priv_obj->dfs_enabled == enable) {
-		reg_info("dfs_enabled is already set to %d", enable);
-		return QDF_STATUS_SUCCESS;
-	}
-
-	psoc = wlan_pdev_get_psoc(pdev);
-	if (!psoc) {
-		reg_err("psoc is NULL");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	psoc_priv_obj = reg_get_psoc_obj(psoc);
-	if (!IS_VALID_PSOC_REG_OBJ(psoc_priv_obj)) {
-		reg_err("psoc reg component is NULL");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	reg_info("setting dfs_enabled: %d", enable);
-
-	pdev_priv_obj->dfs_enabled = enable;
-
-	reg_compute_pdev_current_chan_list(pdev_priv_obj);
-
-	reg_tx_ops = reg_get_psoc_tx_ops(psoc);
-
-	/* Fill the ic channel list with the updated current channel
-	 * chan list.
-	 */
-	if (reg_tx_ops->fill_umac_legacy_chanlist)
-		reg_tx_ops->fill_umac_legacy_chanlist(pdev,
-				pdev_priv_obj->cur_chan_list);
-
-	status = reg_send_scheduler_msg_sb(psoc, pdev);
-
-	return status;
-}
-
 /**
  * reg_change_pdev_for_config() - Update user configuration in pdev private obj.
  * @psoc: Pointer to global psoc structure.

+ 0 - 14
umac/regulatory/core/src/reg_utils.h

@@ -160,14 +160,6 @@ QDF_STATUS reg_set_country(struct wlan_objmgr_pdev *pdev, uint8_t *country);
  */
 QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc);
 
-/**
- * reg_enable_dfs_channels() - Enable the use of DFS channels
- * @pdev: The physical dev to enable/disable DFS channels for
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev, bool enable);
-
 /**
  * reg_get_domain_from_country_code() - Get regdomain from country code
  * @reg_domain_ptr: Pointer to save regdomain
@@ -323,12 +315,6 @@ static inline QDF_STATUS reg_reset_country(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 }
 
-static inline QDF_STATUS reg_enable_dfs_channels(struct wlan_objmgr_pdev *pdev,
-						 bool enable)
-{
-	return QDF_STATUS_SUCCESS;
-}
-
 static inline QDF_STATUS reg_get_domain_from_country_code(
 	v_REGDOMAIN_t *reg_domain_ptr, const uint8_t *country_alpha2,
 	enum country_src source)