Browse Source

qcacld-3.0: Add new ini to allow STA-SAP scc on indoor only channel

Add new ini for STA-SAP scc on 5 GHz indoor only channel -
"sta_sap_scc_on_indoor_chan"

When this ini is enabled, SAP moves to the STA channel
when STA is connected on indoor only 5 GHz channel with the
AP. When this ini is disabled, SAP moves to any 2.4 GHz
channel.
When gindoor_channel_support=1, this ini will not be considered and
SAP can come up on indoor channel.

Change-Id: Ia3ebc6d7fc2e6e569cde8e8a8b38ca76036b8fda
CRs-Fixed: 3186938
Pragaspathi Thilagaraj 2 years ago
parent
commit
4396764569

+ 29 - 0
components/cmn_services/policy_mgr/inc/cfg_policy_mgr.h

@@ -424,6 +424,34 @@ CFG_INI_UINT("gDualMacFeatureDisable", 0, 6, 6, CFG_VALUE_OR_DEFAULT, \
 CFG_INI_UINT("g_sta_sap_scc_on_dfs_chan", 0, 2, 2, CFG_VALUE_OR_DEFAULT, \
 	     "Allow STA+SAP SCC on DFS channel with master mode disable")
 
+/*
+ * <ini>
+ * sta_sap_scc_on_indoor_chan - Allow STA+SAP SCC on indoor channel
+ * when STA is connected on indoor channel.
+ * @Min: false
+ * @Max: true
+ * @Default: true
+ *
+ * This ini is used to allow STA+SAP SCC on indoor channel
+ * 0 - Disallow STA+SAP SCC on Indoor only channel
+ * 1 - Allow STA+SAP SCC on DFS channel. SAP will move to indoor channel
+ * once STA is connected on indoor only channel.
+ * When gindoor_channel_support=1, this ini will not be considered and
+ * SAP can come up on indoor channel.
+ *
+ * Related: gindoor_channel_support.
+ *
+ * Supported Feature: Non-DBS, DBS
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_STA_SAP_SCC_ON_INDOOR_CHAN CFG_INI_BOOL(\
+			"sta_sap_scc_on_indoor_chan", \
+			true, \
+			"Allow STA+SAP SCC on indoor channel")
+
 /*
  * <ini>
  * gForce1x1Exception - force 1x1 when connecting to certain peer
@@ -638,6 +666,7 @@ CFG_INI_BOOL("g_multi_sap_allowed_on_same_band", 1, \
 		CFG(CFG_DUAL_MAC_FEATURE_DISABLE)\
 		CFG(CFG_ENABLE_SBS)\
 		CFG(CFG_STA_SAP_SCC_ON_DFS_CHAN)\
+		CFG(CFG_STA_SAP_SCC_ON_INDOOR_CHAN)\
 		CFG(CFG_FORCE_1X1_FEATURE)\
 		CFG(CFG_ENABLE_SAP_MANDATORY_CHAN_LIST)\
 		CFG(CFG_STA_SAP_SCC_ON_LTE_COEX_CHAN)\

+ 10 - 0
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -296,6 +296,16 @@ QDF_STATUS
 policy_mgr_set_multi_sap_allowed_on_same_band(struct wlan_objmgr_psoc *psoc,
 				bool multi_sap_allowed_on_same_band);
 
+/**
+ * policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl() - Get if STA-SAP scc is
+ * allowed on indoor channel
+ * @psoc: Global psoc pointer
+ *
+ * Return: true if STA-SAP SCC on indoor channel is allowed
+ */
+bool policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(
+				struct wlan_objmgr_psoc *psoc);
+
 /**
  * policy_mgr_get_multi_sap_allowed_on_same_band() - to find out if multi sap
  * is allowed on same band

+ 14 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -175,6 +175,20 @@ policy_mgr_get_sta_sap_scc_on_dfs_chnl(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
+bool
+policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(struct wlan_objmgr_psoc *psoc)
+{
+	struct policy_mgr_psoc_priv_obj *pm_ctx;
+
+	pm_ctx = policy_mgr_get_context(psoc);
+	if (!pm_ctx) {
+		policy_mgr_err("pm_ctx is NULL");
+		return false;
+	}
+
+	return pm_ctx->cfg.sta_sap_scc_on_indoor_channel;
+}
+
 QDF_STATUS
 policy_mgr_set_multi_sap_allowed_on_same_band(struct wlan_objmgr_psoc *psoc,
 					bool multi_sap_allowed_on_same_band)

+ 3 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -241,6 +241,8 @@ extern enum policy_mgr_conc_next_action
  * @is_force_1x1_enable: Is 1x1 forced for connection
  * @sta_sap_scc_on_dfs_chnl: STA-SAP SCC on DFS channel
  * @sta_sap_scc_on_lte_coex_chnl: STA-SAP SCC on LTE Co-ex channel
+ * @sta_sap_scc_on_indoor_channel: Allow STA-SAP scc on indoor only
+ * channels
  * @nan_sap_scc_on_lte_coex_chnl: NAN-SAP SCC on LTE Co-ex channel
  * @sap_mandatory_chnl_enable: To enable/disable SAP mandatory channels
  * @mark_indoor_chnl_disable: Mark indoor channel as disable or enable
@@ -267,6 +269,7 @@ struct policy_mgr_cfg {
 	enum force_1x1_type is_force_1x1_enable;
 	uint8_t sta_sap_scc_on_dfs_chnl;
 	uint8_t sta_sap_scc_on_lte_coex_chnl;
+	bool sta_sap_scc_on_indoor_channel;
 	uint8_t nan_sap_scc_on_lte_coex_chnl;
 	uint8_t sap_mandatory_chnl_enable;
 	uint8_t mark_indoor_chnl_disable;

+ 5 - 0
components/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c

@@ -63,6 +63,11 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc)
 	cfg->sta_sap_scc_on_dfs_chnl =
 		cfg_get(psoc, CFG_STA_SAP_SCC_ON_DFS_CHAN);
 
+	cfg->sta_sap_scc_on_indoor_channel =
+		cfg_get(psoc, CFG_STA_SAP_SCC_ON_INDOOR_CHAN);
+	if (cfg_get(psoc, CFG_INDOOR_CHANNEL_SUPPORT))
+		cfg->sta_sap_scc_on_indoor_channel = true;
+
 	/*
 	 * Force set sta_sap_scc_on_dfs_chnl on Non-DBS HW so that standalone
 	 * SAP is not allowed on DFS channel on non-DBS HW, Also, force SCC in