فهرست منبع

qcacld-3.0: Add new cfg item to disable SP AP connection to VLP STA

Add a new cfg item to drop connection request if
AP is operating in 6 GHz SP mode and STA doesn't
support SP mode but supports VLP mode.

Change-Id: I0f20d63f68b2424390ca424188f95f26971c9ada
CRs-Fixed: 3470602
Asutosh Mohapatra 2 سال پیش
والد
کامیت
c7a8607129

+ 25 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -717,6 +717,30 @@ static void mlme_init_wds_config_cfg(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+#ifdef CONFIG_BAND_6GHZ
+/**
+ * mlme_init_disable_vlp_sta_conn_to_sp_ap() - initialize disable vlp STA
+ *                                             connection to sp AP flag
+ * @psoc: Pointer to PSOC
+ * @gen: pointer to generic CFG items
+ *
+ * Return: None
+ */
+static void mlme_init_disable_vlp_sta_conn_to_sp_ap(
+						struct wlan_objmgr_psoc *psoc,
+						struct wlan_mlme_generic *gen)
+{
+	gen->disable_vlp_sta_conn_to_sp_ap =
+		cfg_default(CFG_DISABLE_VLP_STA_CONN_TO_SP_AP);
+}
+#else
+static void mlme_init_disable_vlp_sta_conn_to_sp_ap(
+						struct wlan_objmgr_psoc *psoc,
+						struct wlan_mlme_generic *gen)
+{
+}
+#endif
+
 #ifdef CONFIG_BAND_6GHZ
 /**
  * mlme_init_standard_6ghz_conn_policy() - initialize standard 6GHz
@@ -909,6 +933,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
 	mlme_init_emlsr_mode(psoc, gen);
 	mlme_init_tl2m_negotiation_support(psoc, gen);
 	mlme_init_standard_6ghz_conn_policy(psoc, gen);
+	mlme_init_disable_vlp_sta_conn_to_sp_ap(psoc, gen);
 }
 
 static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc,

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

@@ -244,6 +244,29 @@ enum t2lm_negotiation_support {
 		0, \
 		"rf test mode Enable Flag")
 
+#ifdef CONFIG_BAND_6GHZ
+/*
+ * disable_vlp_sta_conn_to_sp_ap - Disable VLP STA connection to SP AP
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This cfg is used to disable connection when AP is operating in 6 GHz
+ * SP mode but STA doesn't support SP mode and supports VLP mode.
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ */
+#define CFG_DISABLE_VLP_STA_CONN_TO_SP_AP CFG_BOOL( \
+		"disable_vlp_sta_conn_to_sp_ap", \
+		0, \
+		"disable vlp sta conn to sp ap")
+#define CFG_DIS_VLP_STA_CONN_TO_SP_AP	CFG(CFG_DISABLE_VLP_STA_CONN_TO_SP_AP)
+#else
+#define CFG_DIS_VLP_STA_CONN_TO_SP_AP
+#endif
+
 #ifdef CONFIG_BAND_6GHZ
 /*
  * standard_6ghz_connection_policy - Enable 6 GHz standard connection policy
@@ -1175,5 +1198,6 @@ enum t2lm_negotiation_support {
 	CFG_6GHZ_STD_CONN_POLICY \
 	CFG_EMLSR_MODE_ENABLED \
 	CFG_SR_ENABLE_MODES_ALL \
-	CFG_T2LM_NEGOTIATION_SUPPORTED
+	CFG_T2LM_NEGOTIATION_SUPPORTED\
+	CFG_DIS_VLP_STA_CONN_TO_SP_AP
 #endif /* __CFG_MLME_GENERIC_H */

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

@@ -2477,6 +2477,19 @@ QDF_STATUS
 wlan_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value);
 
 #ifdef CONFIG_BAND_6GHZ
+/**
+ * wlan_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled() - Get the disable vlp
+ *                                                       STA conn to SP AP flag
+ * @psoc: psoc context
+ * @value: Enable/Disable value ptr.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled(
+						struct wlan_objmgr_psoc *psoc,
+						bool *value);
+
 /**
  * wlan_mlme_is_standard_6ghz_conn_policy_enabled() - Get the 6 GHz standard
  *                                                    connection policy flag
@@ -2490,6 +2503,15 @@ wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 					       bool *value);
 
 #else
+static inline QDF_STATUS
+wlan_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled(
+						struct wlan_objmgr_psoc *psoc,
+						bool *value)
+{
+	*value = false;
+	return QDF_STATUS_SUCCESS;
+}
+
 static inline QDF_STATUS
 wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 					       bool *value)

+ 2 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1389,6 +1389,7 @@ struct wlan_user_mcc_quota {
  * @tx_retry_multiplier: TX xretry extension parameter
  * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames
  * @std_6ghz_conn_policy: 6GHz standard connection policy
+ * @disable_vlp_sta_conn_to_sp_ap: Disable VLP STA connection to SP AP
  * @eht_mode: EHT mode of operation
  * @t2lm_negotiation_support: T2LM negotiation supported enum value
  * @enable_emlsr_mode: 11BE eMLSR mode support
@@ -1445,6 +1446,7 @@ struct wlan_mlme_generic {
 	uint8_t mgmt_hw_tx_retry_count[CFG_FRAME_TYPE_MAX];
 #ifdef CONFIG_BAND_6GHZ
 	bool std_6ghz_conn_policy;
+	bool disable_vlp_sta_conn_to_sp_ap;
 #endif
 #ifdef WLAN_FEATURE_11BE_MLO
 	enum wlan_eht_mode eht_mode;

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

@@ -2899,6 +2899,24 @@ ucfg_mlme_set_rf_test_mode_enabled(struct wlan_objmgr_psoc *psoc, bool value)
 	return wlan_mlme_set_rf_test_mode_enabled(psoc, value);
 }
 
+/**
+ * ucfg_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled() - Get disable vlp sta
+ *                                                        conn to sp ap 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_disable_vlp_sta_conn_to_sp_ap_enabled(
+						struct wlan_objmgr_psoc *psoc,
+						bool *value)
+{
+	return wlan_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled(psoc, value);
+}
+
 /**
  * ucfg_mlme_is_standard_6ghz_conn_policy_enabled() - Get 6ghz standard
  *                                                    connection policy flag

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

@@ -3374,6 +3374,22 @@ wlan_mlme_is_standard_6ghz_conn_policy_enabled(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+wlan_mlme_is_disable_vlp_sta_conn_to_sp_ap_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.disable_vlp_sta_conn_to_sp_ap;
+
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 #ifdef WLAN_FEATURE_11BE_MLO

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

@@ -14830,6 +14830,7 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	bool rf_test_mode;
 	bool std_6ghz_conn_policy;
 	uint32_t fw_data_stall_evt;
+	bool disable_vlp_sta_conn_sp_ap;
 
 	hdd_enter();
 
@@ -14936,6 +14937,17 @@ static int hdd_features_init(struct hdd_context *hdd_ctx)
 	if (std_6ghz_conn_policy)
 		wlan_cm_set_standard_6ghz_conn_policy(hdd_ctx->psoc, true);
 
+	status = ucfg_mlme_is_disable_vlp_sta_conn_to_sp_ap_enabled(
+						hdd_ctx->psoc,
+						&disable_vlp_sta_conn_sp_ap);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		hdd_err("Get disable vlp sta conn to sp flag failed");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (disable_vlp_sta_conn_sp_ap)
+		wlan_cm_set_disable_vlp_sta_conn_to_sp_ap(hdd_ctx->psoc, true);
+
 	hdd_thermal_stats_cmd_init(hdd_ctx);
 	sme_set_cal_failure_event_cb(hdd_ctx->mac_handle,
 				     hdd_cal_fail_send_event);