Browse Source

qcacmn: Move reg_get_6g_ap_master_chan_list out of AFC flag

Currently api wlan_reg_get_6g_ap_master_chan_list is declared
and defined under CONFIG_AFC_SUPPORT feature flag, since this is
a generic API and can be used by other functionalities as well.

With this change move wlan_reg_get_6g_ap_master_chan_list api
out of CONFIG_AFC_SUPPORT feature flag.

Change-Id: Ifa7b27895b4660bbf248fc2827472ba50c9df9a4
CRs-Fixed: 3090281
Ashish 3 years ago
parent
commit
2cb0e9b21e

+ 24 - 24
umac/regulatory/core/src/reg_build_chan_list.c

@@ -2463,6 +2463,30 @@ QDF_STATUS reg_process_master_chan_list_ext(
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
+					  enum reg_6g_ap_type ap_pwr_type,
+					  struct regulatory_channel *chan_list)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	struct regulatory_channel *master_chan_list_6g;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("reg pdev private obj is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (ap_pwr_type >= REG_CURRENT_MAX_AP_TYPE)
+		return QDF_STATUS_E_FAILURE;
+
+	master_chan_list_6g = pdev_priv_obj->mas_chan_list_6g_ap[ap_pwr_type];
+	qdf_mem_copy(chan_list, master_chan_list_6g,
+		     NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel));
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef CONFIG_AFC_SUPPORT
 static void reg_disable_afc_mas_chan_list_channels(
 		struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
@@ -3307,30 +3331,6 @@ reg_get_secondary_current_chan_list(struct wlan_objmgr_pdev *pdev,
 #endif
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
-QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
-					  enum reg_6g_ap_type ap_pwr_type,
-					  struct regulatory_channel *chan_list)
-{
-	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
-	struct regulatory_channel *master_chan_list_6g;
-
-	pdev_priv_obj = reg_get_pdev_obj(pdev);
-
-	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
-		reg_err("reg pdev private obj is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	if (ap_pwr_type >= REG_CURRENT_MAX_AP_TYPE)
-		return QDF_STATUS_E_FAILURE;
-
-	master_chan_list_6g = pdev_priv_obj->mas_chan_list_6g_ap[ap_pwr_type];
-	qdf_mem_copy(chan_list, master_chan_list_6g,
-		     NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel));
-
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS reg_get_6g_afc_chan_list(struct wlan_objmgr_pdev *pdev,
 				    struct regulatory_channel *chan_list)
 {

+ 22 - 13
umac/regulatory/core/src/reg_build_chan_list.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -94,6 +95,17 @@ void reg_propagate_mas_chan_list_to_pdev(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 reg_process_master_chan_list_ext(struct cur_regulatory_info *reg_info);
 
+/**
+ * reg_get_6g_ap_master_chan_list() - Get  an ap  master channel list depending
+ * on * ap power type
+ * @ap_pwr_type: Power type (LPI/VLP/SP)
+ * @chan_list: Pointer to the channel list. The output channel list
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
+					  enum reg_6g_ap_type ap_pwr_type,
+					  struct regulatory_channel *chan_list);
 #ifdef CONFIG_AFC_SUPPORT
 /**
  * reg_process_afc_event() - Process the afc event and compute the 6G AFC
@@ -105,7 +117,16 @@ reg_process_master_chan_list_ext(struct cur_regulatory_info *reg_info);
 QDF_STATUS
 reg_process_afc_event(struct afc_regulatory_info *afc_info);
 #endif
-#endif
+
+#else /* CONFIG_BAND_6GHZ */
+static inline QDF_STATUS
+reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
+			       enum reg_6g_ap_type ap_pwr_type,
+			       struct regulatory_channel *chan_list)
+{
+	return QDF_STATUS_E_FAILURE;
+}
+#endif /* CONFIG_BAND_6GHZ */
 /**
  * reg_process_master_chan_list() - Compute master channel list based on the
  * regulatory rules.
@@ -126,18 +147,6 @@ QDF_STATUS reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
 				     struct regulatory_channel *chan_list);
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
-/**
- * reg_get_6g_ap_master_chan_list() - Get  an ap  master channel list depending
- * on * ap power type
- * @ap_pwr_type: Power type (LPI/VLP/SP)
- * @chan_list: Pointer to the channel list. The output channel list
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
-					  enum reg_6g_ap_type ap_pwr_type,
-					  struct regulatory_channel *chan_list);
-
 /**
  * reg_get_6g_afc_chan_list() - provide the pdev afc channel list
  * @pdev: pdev pointer

+ 22 - 13
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -191,6 +191,20 @@ static inline bool wlan_reg_is_range_overlap_6g(qdf_freq_t low_freq,
 }
 #endif
 
+/**
+ * wlan_reg_get_6g_ap_master_chan_list() - provide  the appropriate ap master
+ * channel list
+ * @pdev: pdev pointer
+ * @ap_pwr_type: The ap power type (LPI/VLP/SP)
+ * @chan_list: channel list pointer
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(
+					struct wlan_objmgr_pdev *pdev,
+					enum reg_6g_ap_type ap_pwr_type,
+					struct regulatory_channel *chan_list);
+
 /**
  * wlan_reg_is_6ghz_psc_chan_freq() - Check if the given 6GHz channel frequency
  * is preferred scanning channel frequency.
@@ -307,6 +321,14 @@ wlan_reg_get_max_txpower_for_6g_tpe(struct wlan_objmgr_pdev *pdev,
 {
 	return QDF_STATUS_E_FAILURE;
 }
+
+static inline QDF_STATUS
+wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
+				    enum reg_6g_ap_type ap_pwr_type,
+				    struct regulatory_channel *chan_list)
+{
+	return QDF_STATUS_E_FAILURE;
+}
 #endif /* CONFIG_BAND_6GHZ */
 
 /**
@@ -543,19 +565,6 @@ QDF_STATUS wlan_reg_get_secondary_current_chan_list(
 #endif
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
-/**
- * wlan_reg_get_6g_ap_master_chan_list() - provide  the appropriate ap master
- * channel list
- * @pdev: pdev pointer
- * @ap_pwr_type: The ap power type (LPI/VLP/SP)
- * @chan_list: channel list pointer
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
-					       enum reg_6g_ap_type ap_pwr_type,
-					       struct regulatory_channel *chan_list);
-
 /**
  * wlan_reg_get_6g_afc_chan_list() - provide the pdev afc channel list
  * @pdev: pdev pointer

+ 10 - 9
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -132,15 +132,6 @@ QDF_STATUS wlan_reg_get_secondary_current_chan_list(
 #endif
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)
-QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(struct wlan_objmgr_pdev *pdev,
-					       enum reg_6g_ap_type ap_pwr_type,
-					       struct regulatory_channel *chan_list)
-{
-	return  reg_get_6g_ap_master_chan_list(pdev, ap_pwr_type, chan_list);
-}
-
-qdf_export_symbol(wlan_reg_get_6g_ap_master_chan_list);
-
 QDF_STATUS wlan_reg_get_6g_afc_chan_list(struct wlan_objmgr_pdev *pdev,
 					 struct regulatory_channel *chan_list)
 {
@@ -399,6 +390,16 @@ regulatory_assign_unregister_master_ext_handler(struct wlan_objmgr_psoc *psoc,
 		tx_ops->unregister_master_ext_handler(psoc, NULL);
 }
 
+QDF_STATUS wlan_reg_get_6g_ap_master_chan_list(
+					struct wlan_objmgr_pdev *pdev,
+					enum reg_6g_ap_type ap_pwr_type,
+					struct regulatory_channel *chan_list)
+{
+	return  reg_get_6g_ap_master_chan_list(pdev, ap_pwr_type, chan_list);
+}
+
+qdf_export_symbol(wlan_reg_get_6g_ap_master_chan_list);
+
 #ifdef CONFIG_AFC_SUPPORT
 static void regulatory_assign_register_afc_event_handler(
 		struct wlan_objmgr_psoc *psoc,