Переглянути джерело

qcacld-3.0: Move gEnableCustomConcRule1 (/2) from HDD to Plcy manager

As part of new INI/CFG model, move gEnableCustomConcRule1 and
gEnableCustomConcRule2 ownership from HDD to policy manager.

CRs-Fixed: 2324393
Change-Id: I11952819a6ba5581de51d9b58969ff02d582f233
Krunal Soni 6 роки тому
батько
коміт
d7ef8637a0
3 змінених файлів з 28 додано та 77 видалено
  1. 0 52
      core/hdd/inc/wlan_hdd_cfg.h
  2. 18 18
      core/hdd/src/wlan_hdd_cfg.c
  3. 10 7
      core/hdd/src/wlan_hdd_hostapd.c

+ 0 - 52
core/hdd/inc/wlan_hdd_cfg.h

@@ -4799,56 +4799,6 @@ enum hdd_link_speed_rpt_type {
 #define CFG_DHCP_SERVER_IP_DEFAULT  ""
 #endif /* DHCP_SERVER_OFFLOAD */
 
-/*
- * <ini>
- * gEnableCustomConcRule1 - Enable custom concurrency rule1.
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to enable/disable custom concurrency rule1.
- * If SAP comes up first and STA comes up later then SAP needs to follow STA's
- * channel.
- *
- * Related: None.
- *
- * Supported Feature: Concurrency
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME         "gEnableCustomConcRule1"
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN     (0)
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX     (1)
-#define CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT (0)
-
-/*
- * <ini>
- * gEnableCustomConcRule2 - Enable custom concurrency rule2.
- * @Min: 0
- * @Max: 1
- * @Default: 0
- *
- * This ini is used to enable/disable custom concurrency rule2.
- * If P2PGO comes up first and STA comes up later then P2PGO need to follow
- * STA's channel in 5Ghz. In following if condition we are just adding sanity
- * check to make sure that by this time P2PGO's channel is same as STA's
- * channel.
- *
- * Related: None.
- *
- * Supported Feature: Concurrency
- *
- * Usage: Internal/External
- *
- * </ini>
- */
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME         "gEnableCustomConcRule2"
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MIN     (0)
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MAX     (1)
-#define CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_DEFAULT (0)
-
 #define CFG_ENABLE_STA_CONNECTION_IN_5GHZ         "gEnableStaConnectionIn5Ghz"
 #define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MIN     (0)
 #define CFG_ENABLE_STA_CONNECTION_IN_5GHZ_MAX     (1)
@@ -7690,8 +7640,6 @@ struct hdd_config {
 	uint8_t dhcpServerIP[IPADDR_STRING_LENGTH];
 #endif /* DHCP_SERVER_OFFLOAD */
 	bool enable_mac_spoofing;
-	uint8_t conc_custom_rule1;
-	uint8_t conc_custom_rule2;
 	uint8_t is_sta_connection_in_5gz_enabled;
 	uint32_t sta_miracast_mcc_rest_time_val;
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE

+ 18 - 18
core/hdd/src/wlan_hdd_cfg.c

@@ -2026,20 +2026,6 @@ struct reg_table_entry g_registry_table[] = {
 		     CFG_ENABLE_MAC_ADDR_SPOOFING_MIN,
 		     CFG_ENABLE_MAC_ADDR_SPOOFING_MAX),
 
-	REG_VARIABLE(CFG_ENABLE_CUSTOM_CONC_RULE1_NAME,  WLAN_PARAM_Integer,
-		     struct hdd_config, conc_custom_rule1,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_DEFAULT,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MIN,
-		     CFG_ENABLE_CUSTOM_CONC_RULE1_NAME_MAX),
-
-	REG_VARIABLE(CFG_ENABLE_CUSTOM_CONC_RULE2_NAME,  WLAN_PARAM_Integer,
-		     struct hdd_config, conc_custom_rule2,
-		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_DEFAULT,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MIN,
-		     CFG_ENABLE_CUSTOM_CONC_RULE2_NAME_MAX),
-
 	REG_VARIABLE(CFG_ENABLE_STA_CONNECTION_IN_5GHZ,  WLAN_PARAM_Integer,
 		     struct hdd_config, is_sta_connection_in_5gz_enabled,
 		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
@@ -4327,6 +4313,8 @@ QDF_STATUS hdd_set_sme_cfgs_related_to_plcy_mgr(struct hdd_context *hdd_ctx,
 						tSmeConfigParams *sme_cfg)
 {
 	uint8_t mcc_to_scc_switch = 0;
+	uint8_t conc_rule1 = 0;
+	uint8_t conc_rule2 = 0;
 
 	if (QDF_STATUS_SUCCESS !=
 	    ucfg_policy_mgr_get_mcc_scc_switch(hdd_ctx->psoc,
@@ -4336,6 +4324,22 @@ QDF_STATUS hdd_set_sme_cfgs_related_to_plcy_mgr(struct hdd_context *hdd_ctx,
 	}
 	sme_cfg->csrConfig.cc_switch_mode = mcc_to_scc_switch;
 
+	if (QDF_STATUS_SUCCESS !=
+	    ucfg_policy_mgr_get_conc_rule1(hdd_ctx->psoc,
+					   &conc_rule1)) {
+		hdd_err("can't get conc rule1");
+		return QDF_STATUS_E_FAILURE;
+	}
+	sme_cfg->csrConfig.conc_custom_rule1 = conc_rule1;
+
+	if (QDF_STATUS_SUCCESS !=
+	    ucfg_policy_mgr_get_conc_rule2(hdd_ctx->psoc,
+					   &conc_rule2)) {
+		hdd_err("can't get conc rule2");
+		return QDF_STATUS_E_FAILURE;
+	}
+	sme_cfg->csrConfig.conc_custom_rule2 = conc_rule2;
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -4547,10 +4551,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx)
 	/* Update maximum interfaces information */
 	smeConfig->csrConfig.max_intf_count = hdd_ctx->max_intf_count;
 
-	smeConfig->csrConfig.conc_custom_rule1 =
-		hdd_ctx->config->conc_custom_rule1;
-	smeConfig->csrConfig.conc_custom_rule2 =
-		hdd_ctx->config->conc_custom_rule2;
 	smeConfig->csrConfig.is_sta_connection_in_5gz_enabled =
 		hdd_ctx->config->is_sta_connection_in_5gz_enabled;
 

+ 10 - 7
core/hdd/src/wlan_hdd_hostapd.c

@@ -2698,6 +2698,7 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
 	struct hdd_context *hdd_ctx = NULL;
 	struct hdd_adapter *sta_adapter;
 	struct hdd_station_ctx *sta_ctx;
+	uint8_t conc_rule1 = 0;
 
 	hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	ret = wlan_hdd_validate_context(hdd_ctx);
@@ -2712,13 +2713,14 @@ int hdd_softap_set_channel_change(struct net_device *dev, int target_channel,
 	}
 
 	sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
+	ucfg_policy_mgr_get_conc_rule1(hdd_ctx->psoc, &conc_rule1);
 	/*
 	 * conc_custom_rule1:
 	 * Force SCC for SAP + STA
 	 * if STA is already connected then we shouldn't allow
 	 * channel switch in SAP interface.
 	 */
-	if (sta_adapter && hdd_ctx->config->conc_custom_rule1) {
+	if (sta_adapter && conc_rule1) {
 		sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(sta_adapter);
 		if (hdd_conn_is_connected(sta_ctx)) {
 			hdd_err("Channel switch not allowed after STA connection with conc_custom_rule1 enabled");
@@ -4564,7 +4566,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	int32_t i;
 	struct hdd_config *iniConfig;
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
-	uint8_t mcc_to_scc_switch = 0;
+	uint8_t mcc_to_scc_switch = 0, conc_rule1 = 0;
 	tSmeConfigParams *sme_config;
 	bool MFPCapable = false;
 	bool MFPRequired = false;
@@ -4977,6 +4979,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	pConfig->SapMacaddr_acl = eSAP_ACCEPT_UNLESS_DENIED;
 	pConfig->num_accept_mac = 0;
 	pConfig->num_deny_mac = 0;
+	ucfg_policy_mgr_get_conc_rule1(hdd_ctx->psoc, &conc_rule1);
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 	/*
 	 * We don't want P2PGO to follow STA's channel
@@ -4984,9 +4987,8 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	 * Later if we decide to make p2pgo follow STA's
 	 * channel then remove this check.
 	 */
-	if ((0 == hdd_ctx->config->conc_custom_rule1) ||
-		(hdd_ctx->config->conc_custom_rule1 &&
-		QDF_SAP_MODE == adapter->device_mode))
+	if ((0 == conc_rule1) ||
+	    (conc_rule1 && (QDF_SAP_MODE == adapter->device_mode)))
 		pConfig->cc_switch_mode = mcc_to_scc_switch;
 #endif
 
@@ -5306,6 +5308,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 	struct hdd_beacon_data *old;
 	int ret;
 	mac_handle_t mac_handle;
+	uint8_t conc_rule1 = 0;
 
 	hdd_enter();
 
@@ -5361,13 +5364,13 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		wlan_hdd_del_station(adapter);
 
 	cds_flush_work(&adapter->sap_stop_bss_work);
+	ucfg_policy_mgr_get_conc_rule1(hdd_ctx->psoc, &conc_rule1);
 	/*
 	 * When ever stop ap adapter gets called, we need to check
 	 * whether any restart AP work is pending. If any restart is pending
 	 * then lets finish it and go ahead from there.
 	 */
-	if (hdd_ctx->config->conc_custom_rule1 &&
-	    (QDF_SAP_MODE == adapter->device_mode)) {
+	if (conc_rule1 && (QDF_SAP_MODE == adapter->device_mode)) {
 		cds_flush_work(&hdd_ctx->sap_start_work);
 		hdd_debug("Canceled the pending restart work");
 		qdf_spin_lock(&hdd_ctx->sap_update_info_lock);