Pārlūkot izejas kodu

qcacmn: Add a dispatcher API to read the ini AFC config

Add a regulatory dispatcher API to fetch the value of AFC action
from the ini config.

Change-Id: I053262f98991a656d1919817ce37227202a46bc3
CRs-Fixed: 2997899
Hariharan Basuthkar 4 gadi atpakaļ
vecāks
revīzija
033605a031

+ 3 - 1
umac/regulatory/core/src/reg_build_chan_list.c

@@ -35,6 +35,7 @@
 #include <scheduler_api.h>
 #include "reg_build_chan_list.h"
 #include <qdf_platform.h>
+#include <wlan_reg_services_api.h>
 
 #define MAX_PWR_FCC_CHAN_12 8
 #define MAX_PWR_FCC_CHAN_13 2
@@ -2824,7 +2825,8 @@ reg_process_afc_power_event(struct afc_regulatory_info *afc_info)
 	pdev_priv_obj->is_6g_afc_power_event_received =
 	soc_reg->mas_chan_params[phy_id].is_6g_afc_power_event_received;
 
-	if (tx_ops->trigger_acs_for_afc)
+	if (tx_ops->trigger_acs_for_afc &&
+	    !wlan_reg_is_noaction_on_afc_pwr_evt(pdev))
 		tx_ops->trigger_acs_for_afc(pdev);
 
 	wlan_objmgr_pdev_release_ref(pdev, dbg_id);

+ 19 - 0
umac/regulatory/core/src/reg_priv_objs.c

@@ -33,6 +33,9 @@
 #include "reg_build_chan_list.h"
 #include "reg_host_11d.h"
 #include "reg_callbacks.h"
+#ifdef CONFIG_AFC_SUPPORT
+#include <cfg_ucfg_api.h>
+#endif
 
 struct wlan_regulatory_psoc_priv_obj *reg_get_psoc_obj(
 		struct wlan_objmgr_psoc *psoc)
@@ -259,6 +262,14 @@ reg_destroy_afc_cb_spinlock(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
 {
 	qdf_spinlock_destroy(&pdev_priv_obj->afc_cb_lock);
 }
+
+static void
+reg_init_afc_vars(struct wlan_objmgr_psoc *psoc,
+		  struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+	pdev_priv_obj->is_reg_noaction_on_afc_pwr_evt =
+			cfg_get(psoc, CFG_OL_AFC_REG_NO_ACTION);
+}
 #else
 static inline void
 reg_create_afc_cb_spinlock(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
@@ -269,6 +280,12 @@ static inline void
 reg_destroy_afc_cb_spinlock(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
 {
 }
+
+static void
+reg_init_afc_vars(struct wlan_objmgr_psoc *psoc,
+		  struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+{
+}
 #endif
 
 QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
@@ -372,6 +389,8 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 
 	reg_compute_pdev_current_chan_list(pdev_priv_obj);
 
+	reg_init_afc_vars(parent_psoc, pdev_priv_obj);
+
 	if (!psoc_priv_obj->is_11d_offloaded)
 		reg_11d_host_scan_init(parent_psoc);
 

+ 3 - 0
umac/regulatory/core/src/reg_priv_objs.h

@@ -217,6 +217,8 @@ struct wlan_regulatory_psoc_priv_obj {
  * server response.
  * @power_info: pointer to AFC power information received from the AFC event
  * sent by the target
+ * @is_reg_noaction_on_afc_pwr_evt: indicates whether regulatory needs to
+ * take action when AFC Power event is received
  */
 struct wlan_regulatory_pdev_priv_obj {
 	struct regulatory_channel cur_chan_list[NUM_CHANNELS];
@@ -286,6 +288,7 @@ struct wlan_regulatory_pdev_priv_obj {
 	struct regulatory_channel afc_chan_list[NUM_6GHZ_CHANNELS];
 	struct regulatory_channel mas_chan_list_6g_afc[NUM_6GHZ_CHANNELS];
 	struct reg_fw_afc_power_event *power_info;
+	bool is_reg_noaction_on_afc_pwr_evt;
 #endif
 };
 

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

@@ -6223,4 +6223,18 @@ bool reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev)
 
 	return pdev_priv_obj->is_6g_afc_expiry_event_received;
 }
+
+bool reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	pdev_priv_obj = reg_get_pdev_obj(pdev);
+
+	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
+		reg_err("reg pdev priv obj is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return pdev_priv_obj->is_reg_noaction_on_afc_pwr_evt;
+}
 #endif

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

@@ -1783,5 +1783,15 @@ QDF_STATUS reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev, uint64_t *req_id);
  * Return: true if AFC expiry event is received from the FW or false otherwise
  */
 bool reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * reg_is_noaction_on_afc_pwr_evt() - Checks if the regulatory module
+ * needs to take action when AFC power event is received.
+ *
+ * @pdev: pdev ptr
+ *
+ * Return: true if regulatory should not take any action or false otherwise
+ */
+bool reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev);
 #endif
 #endif

+ 12 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -620,6 +620,18 @@ QDF_STATUS wlan_reg_get_afc_req_id(struct wlan_objmgr_pdev *pdev,
  * Return: true if AFC exipry event is received from the FW or false otherwise
  */
 bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev);
+
+/**
+ * wlan_reg_is_noaction_on_afc_pwr_evt() - Checks whether driver needs to
+ * take action for AFC action or the response should be handled by the
+ * user application.
+ *
+ * @pdev: pdev ptr
+ *
+ * Return: true if driver need not take action for AFC resp, false otherwise.
+ */
+bool
+wlan_reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev);
 #else
 static inline bool
 wlan_reg_is_afc_power_event_received(struct wlan_objmgr_pdev *pdev)

+ 5 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -1405,4 +1405,9 @@ bool wlan_reg_is_afc_expiry_event_received(struct wlan_objmgr_pdev *pdev)
 }
 
 qdf_export_symbol(wlan_reg_is_afc_expiry_event_received);
+
+bool wlan_reg_is_noaction_on_afc_pwr_evt(struct wlan_objmgr_pdev *pdev)
+{
+	return reg_is_noaction_on_afc_pwr_evt(pdev);
+}
 #endif