Sfoglia il codice sorgente

qcacld-3.0: Add new INI to separate scan policy for rest of world users

Currently host drops an AP from scan list if host country is set to
US and AP country is non-US. This implementation violates our
standard regulatory scan policy.

To address this issue, introduce a new INI to differentiate
between our standard regulatory policy with others.

Change-Id: Ie6bd2d1925048aef427136b34d00d361955f40b2
CRs-Fixed: 3377242
Asutosh Mohapatra 2 anni fa
parent
commit
dee1c76bd6

+ 22 - 1
components/mlme/core/src/wlan_mlme_main.c

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -464,11 +464,31 @@ static void mlme_init_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
 	gen->relaxed_6ghz_conn_policy =
 	gen->relaxed_6ghz_conn_policy =
 		cfg_default(CFG_RELAXED_6GHZ_CONN_POLICY);
 		cfg_default(CFG_RELAXED_6GHZ_CONN_POLICY);
 }
 }
+
+/**
+ * mlme_init_standard_6ghz_conn_policy() - initialize standard 6GHz
+ *                                         policy connection flag
+ * @psoc: Pointer to PSOC
+ * @gen: pointer to generic CFG items
+ *
+ * Return: None
+ */
+static void mlme_init_standard_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
+						struct wlan_mlme_generic *gen)
+{
+	gen->std_6ghz_conn_policy =
+		cfg_get(psoc, CFG_6GHZ_STANDARD_CONNECTION_POLICY);
+}
 #else
 #else
 static void mlme_init_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
 static void mlme_init_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
 					       struct wlan_mlme_generic *gen)
 					       struct wlan_mlme_generic *gen)
 {
 {
 }
 }
+
+static void mlme_init_standard_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
+						struct wlan_mlme_generic *gen)
+{
+}
 #endif
 #endif
 
 
 /**
 /**
@@ -641,6 +661,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
 	mlme_init_relaxed_6ghz_conn_policy(psoc, gen);
 	mlme_init_relaxed_6ghz_conn_policy(psoc, gen);
 	mlme_init_emlsr_mode(psoc, gen);
 	mlme_init_emlsr_mode(psoc, gen);
 	mlme_init_tl2m_negotiation_support(psoc, gen);
 	mlme_init_tl2m_negotiation_support(psoc, gen);
+	mlme_init_standard_6ghz_conn_policy(psoc, gen);
 }
 }
 
 
 static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc,
 static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc,

+ 25 - 1
components/mlme/dispatcher/inc/cfg_mlme_generic.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -223,6 +223,29 @@ enum t2lm_negotiation_support {
 		0, \
 		0, \
 		"rf test mode Enable Flag")
 		"rf test mode Enable Flag")
 
 
+#ifdef CONFIG_BAND_6GHZ
+/*
+ * standard_6ghz_connection_policy - Enable 6 GHz standard connection policy
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to set standard 6 GHz policies where STA will be
+ * allowed to scan and connect to any 6 GHz AP.
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ */
+#define CFG_6GHZ_STANDARD_CONNECTION_POLICY CFG_INI_BOOL( \
+		"standard_6ghz_connection_policy", \
+		1, \
+		"6ghz standard 6 GHZ connection policy")
+#define CFG_6GHZ_STD_CONN_POLICY	CFG(CFG_6GHZ_STANDARD_CONNECTION_POLICY)
+#else
+#define CFG_6GHZ_STD_CONN_POLICY
+#endif
+
 #ifdef CONFIG_BAND_6GHZ
 #ifdef CONFIG_BAND_6GHZ
 /*
 /*
  * relaxed_6ghz_conn_policy - Enable 6ghz relaxed connection policy
  * relaxed_6ghz_conn_policy - Enable 6ghz relaxed connection policy
@@ -1153,6 +1176,7 @@ enum t2lm_negotiation_support {
 	CFG(CFG_TX_RETRY_MULTIPLIER) \
 	CFG(CFG_TX_RETRY_MULTIPLIER) \
 	CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT) \
 	CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT) \
 	CFG_RELAX_6GHZ_CONN_POLICY \
 	CFG_RELAX_6GHZ_CONN_POLICY \
+	CFG_6GHZ_STD_CONN_POLICY \
 	CFG_EMLSR_MODE_ENABLED \
 	CFG_EMLSR_MODE_ENABLED \
 	CFG_SR_ENABLE_MODES_ALL \
 	CFG_SR_ENABLE_MODES_ALL \
 	CFG_T2LM_NEGOTIATION_SUPPORTED
 	CFG_T2LM_NEGOTIATION_SUPPORTED

+ 20 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2449,6 +2449,18 @@ QDF_STATUS
 wlan_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value);
 wlan_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value);
 
 
 #ifdef CONFIG_BAND_6GHZ
 #ifdef CONFIG_BAND_6GHZ
+/**
+ * wlan_mlme_is_standard_6ghz_conn_policy_enabled() - Get the 6 GHz standard
+ *                                                    connection policy flag
+ * @psoc: psoc context
+ * @value: Enable/Disable value ptr.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
+					       bool *value);
+
 /**
 /**
  * wlan_mlme_is_relaxed_6ghz_conn_policy_enabled() - Get the 6 GHz relaxed
  * wlan_mlme_is_relaxed_6ghz_conn_policy_enabled() - Get the 6 GHz relaxed
  *                                                   connection policy flag
  *                                                   connection policy flag
@@ -2473,6 +2485,14 @@ QDF_STATUS
 wlan_mlme_set_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
 wlan_mlme_set_relaxed_6ghz_conn_policy(struct wlan_objmgr_psoc *psoc,
 				       bool value);
 				       bool value);
 #else
 #else
+static inline QDF_STATUS
+wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
+					       bool *value)
+{
+	*value = false;
+	return QDF_STATUS_SUCCESS;
+}
+
 static inline QDF_STATUS
 static inline QDF_STATUS
 wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 					      bool *value)
 					      bool *value)

+ 3 - 1
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -1385,6 +1385,7 @@ struct wlan_user_mcc_quota {
  * @tx_retry_multiplier: TX xretry extension parameter
  * @tx_retry_multiplier: TX xretry extension parameter
  * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames
  * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames
  * @relaxed_6ghz_conn_policy: 6GHz relaxed connection policy
  * @relaxed_6ghz_conn_policy: 6GHz relaxed connection policy
+ * @std_6ghz_conn_policy: 6GHz standard connection policy
  * @t2lm_negotiation_support: T2LM negotiation supported enum value
  * @t2lm_negotiation_support: T2LM negotiation supported enum value
  * @enable_emlsr_mode: 11BE eMLSR mode support
  * @enable_emlsr_mode: 11BE eMLSR mode support
  * @safe_mode_enable: safe mode to bypass some strict 6 GHz checks for
  * @safe_mode_enable: safe mode to bypass some strict 6 GHz checks for
@@ -1440,6 +1441,7 @@ struct wlan_mlme_generic {
 	uint8_t mgmt_hw_tx_retry_count[CFG_FRAME_TYPE_MAX];
 	uint8_t mgmt_hw_tx_retry_count[CFG_FRAME_TYPE_MAX];
 #ifdef CONFIG_BAND_6GHZ
 #ifdef CONFIG_BAND_6GHZ
 	bool relaxed_6ghz_conn_policy;
 	bool relaxed_6ghz_conn_policy;
+	bool std_6ghz_conn_policy;
 #endif
 #endif
 #ifdef WLAN_FEATURE_11BE_MLO
 #ifdef WLAN_FEATURE_11BE_MLO
 	bool enable_emlsr_mode;
 	bool enable_emlsr_mode;

+ 17 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -2916,6 +2916,23 @@ ucfg_mlme_is_relaxed_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 	return wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(psoc, value);
 	return wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(psoc, value);
 }
 }
 
 
+/**
+ * ucfg_mlme_is_standard_6ghz_conn_policy_enabled() - Get 6ghz standard
+ *                                                    connection policy flag
+ * @psoc: pointer to psoc object
+ * @value: pointer to hold the value of flag
+ *
+ * Inline UCFG API to be used by HDD/OSIF callers
+ *
+ * Return: QDF Status
+ */
+static inline QDF_STATUS
+ucfg_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
+					       bool *value)
+{
+	return wlan_mlme_is_standard_6ghz_conn_policy_enabled(psoc, value);
+}
+
 /**
 /**
  * ucfg_mlme_set_relaxed_6ghz_conn_policy() - Set 6ghz relaxed
  * ucfg_mlme_set_relaxed_6ghz_conn_policy() - Set 6ghz relaxed
  *                                            connection policy flag
  *                                            connection policy flag

+ 15 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3361,6 +3361,21 @@ wlan_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 }
 }
 
 
 #ifdef CONFIG_BAND_6GHZ
 #ifdef CONFIG_BAND_6GHZ
+QDF_STATUS
+wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
+					       bool *value)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	*value = mlme_obj->cfg.gen.std_6ghz_conn_policy;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS
 QDF_STATUS
 wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 wlan_mlme_is_relaxed_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 					      bool *value)
 					      bool *value)

+ 11 - 0
core/hdd/src/wlan_hdd_main.c

@@ -14539,6 +14539,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	bool b_cts2self, is_imps_enabled;
 	bool b_cts2self, is_imps_enabled;
 	bool rf_test_mode;
 	bool rf_test_mode;
 	bool conn_policy;
 	bool conn_policy;
+	bool std_6ghz_conn_policy;
 	uint32_t fw_data_stall_evt;
 	uint32_t fw_data_stall_evt;
 
 
 	hdd_enter();
 	hdd_enter();
@@ -14645,6 +14646,16 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	if (conn_policy)
 	if (conn_policy)
 		wlan_cm_set_relaxed_6ghz_conn_policy(hdd_ctx->psoc, true);
 		wlan_cm_set_relaxed_6ghz_conn_policy(hdd_ctx->psoc, true);
 
 
+	status = ucfg_mlme_is_standard_6ghz_conn_policy_enabled(hdd_ctx->psoc,
+							&std_6ghz_conn_policy);
+
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		hdd_err("Get 6ghz standard connection policy failed");
+		return QDF_STATUS_E_FAILURE;
+	}
+	if (std_6ghz_conn_policy)
+		wlan_cm_set_standard_6ghz_conn_policy(hdd_ctx->psoc, true);
+
 	hdd_thermal_stats_cmd_init(hdd_ctx);
 	hdd_thermal_stats_cmd_init(hdd_ctx);
 	sme_set_cal_failure_event_cb(hdd_ctx->mac_handle,
 	sme_set_cal_failure_event_cb(hdd_ctx->mac_handle,
 				     hdd_cal_fail_send_event);
 				     hdd_cal_fail_send_event);