Browse Source

qcacmn: disable reg channels based on ini check

Disable ini channels based on coex_unsafe_chan_reg_disable
ini configuration.

Change-Id: Ia3acbc133cab4865d8ad69992e893be91439f837
CRs-Fixed: 3129049
Balaji Pothunoori 3 years ago
parent
commit
37411ce595

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

@@ -1700,8 +1700,10 @@ reg_modify_chan_list_for_avoid_chan_ext(struct wlan_regulatory_pdev_priv_obj
 	if (!psoc)
 		return;
 
-	if (reg_check_coex_unsafe_nb_user_prefer(psoc))
+	if (!reg_check_coex_unsafe_chan_reg_disable(psoc)) {
+		reg_debug("Don't disable reg channels for Coex unsafe channels");
 		return;
+	}
 
 	psoc_priv_obj = reg_get_psoc_obj(psoc);
 	if (!psoc_priv_obj)

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

@@ -115,6 +115,10 @@ struct chan_change_cbk_entry {
  * disabled
  * @ch_avoid_ext_ind: whether need to update extended channel frequency list
  * @avoid_freq_ext_list: the extended avoid channel frequency list
+ * @coex_unsafe_chan_nb_user_prefer: Honor coex unsafe chan cmd from firmware or
+ * userspace
+ * @coex_unsafe_chan_reg_disable: To disable reg channels for received coex
+ * unsafe channels list
  */
 struct wlan_regulatory_psoc_priv_obj {
 	struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
@@ -180,6 +184,7 @@ struct wlan_regulatory_psoc_priv_obj {
 	bool ch_avoid_ext_ind;
 	struct ch_avoid_ind_type avoid_freq_ext_list;
 	bool coex_unsafe_chan_nb_user_prefer;
+	bool coex_unsafe_chan_reg_disable;
 #endif
 };
 

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

@@ -6984,6 +6984,19 @@ bool reg_check_coex_unsafe_nb_user_prefer(struct wlan_objmgr_psoc *psoc)
 
 	return psoc_priv_obj->coex_unsafe_chan_nb_user_prefer;
 }
+
+bool reg_check_coex_unsafe_chan_reg_disable(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+
+	psoc_priv_obj = reg_get_psoc_obj(psoc);
+	if (!psoc_priv_obj) {
+		reg_err("reg psoc private obj is NULL");
+		return false;
+	}
+
+	return psoc_priv_obj->coex_unsafe_chan_reg_disable;
+}
 #endif
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)

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

@@ -1876,6 +1876,16 @@ reg_process_ch_avoid_ext_event(struct wlan_objmgr_psoc *psoc,
  */
 
 bool reg_check_coex_unsafe_nb_user_prefer(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * reg_disable_coex_unsafe_channel() - get reg channel disable for
+ * for coex unsafe channels
+ * @psoc: pointer to psoc
+ *
+ * Return: bool
+ */
+
+bool reg_check_coex_unsafe_chan_reg_disable(struct wlan_objmgr_psoc *psoc);
 #else
 static inline QDF_STATUS
 reg_process_ch_avoid_ext_event(struct wlan_objmgr_psoc *psoc,
@@ -1889,6 +1899,12 @@ bool reg_check_coex_unsafe_nb_user_prefer(struct wlan_objmgr_psoc *psoc)
 {
 	return false;
 }
+
+static inline
+bool reg_check_coex_unsafe_chan_reg_disable(struct wlan_objmgr_psoc *psoc)
+{
+	return false;
+}
 #endif
 
 #if defined(CONFIG_AFC_SUPPORT) && defined(CONFIG_BAND_6GHZ)

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

@@ -407,6 +407,15 @@ void reg_get_coex_unsafe_chan_nb_user_prefer(
 	psoc_priv_obj->coex_unsafe_chan_nb_user_prefer =
 		config_vars.coex_unsafe_chan_nb_user_prefer;
 }
+
+static inline
+void reg_get_coex_unsafe_chan_reg_disable(
+		struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
+		struct reg_config_vars config_vars)
+{
+	psoc_priv_obj->coex_unsafe_chan_reg_disable =
+		config_vars.coex_unsafe_chan_reg_disable;
+}
 #else
 static inline
 void reg_get_coex_unsafe_chan_nb_user_prefer(
@@ -415,6 +424,13 @@ void reg_get_coex_unsafe_chan_nb_user_prefer(
 		struct reg_config_vars config_vars)
 {
 }
+
+static inline
+void reg_get_coex_unsafe_chan_reg_disable(
+		struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj,
+		struct reg_config_vars config_vars)
+{
+}
 #endif
 
 #ifdef CONFIG_CHAN_FREQ_API
@@ -836,6 +852,7 @@ QDF_STATUS reg_set_config_vars(struct wlan_objmgr_psoc *psoc,
 	psoc_priv_obj->retain_nol_across_regdmn_update =
 		config_vars.retain_nol_across_regdmn_update;
 	reg_get_coex_unsafe_chan_nb_user_prefer(psoc_priv_obj, config_vars);
+	reg_get_coex_unsafe_chan_reg_disable(psoc_priv_obj, config_vars);
 
 	status = wlan_objmgr_psoc_try_get_ref(psoc, WLAN_REGULATORY_SB_ID);
 	if (QDF_IS_STATUS_ERROR(status)) {

+ 3 - 0
umac/regulatory/dispatcher/inc/reg_services_public_struct.h

@@ -1473,6 +1473,8 @@ enum restart_beaconing_on_ch_avoid_rule {
  * @retain_nol_across_regdmn_update: Retain the NOL list across the regdomain.
  * @coex_unsafe_chan_nb_user_prefer: Honor coex unsafe chan cmd from firmware or
  * userspace
+ * @coex_unsafe_chan_reg_disable: To disable reg channels for received coex
+ * unsafe channels list
  */
 struct reg_config_vars {
 	uint32_t enable_11d_support;
@@ -1489,6 +1491,7 @@ struct reg_config_vars {
 	bool retain_nol_across_regdmn_update;
 #ifdef FEATURE_WLAN_CH_AVOID_EXT
 	bool coex_unsafe_chan_nb_user_prefer;
+	bool coex_unsafe_chan_reg_disable;
 #endif
 };