Jelajahi Sumber

qcacmn: Add check for rf_test_mode to connect in MLO open mode

Add check for rf_test_mode to connect in MLO open mode

Change-Id: Ie23b2c949497fb8f473fe772d68e85654d1baa7c
CRs-Fixed: 3611147
Aravind Kishore Sukla 1 tahun lalu
induk
melakukan
77cbd24eb2

+ 23 - 6
umac/mlme/connection_mgr/core/src/wlan_cm_bss_scoring.c

@@ -1439,10 +1439,24 @@ cm_get_band_score(uint32_t freq, struct scoring_cfg *score_config)
 #ifdef WLAN_FEATURE_11BE
 #ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
 bool wlan_cm_is_eht_allowed_for_current_security(
+			struct wlan_objmgr_psoc *psoc,
 			struct scan_cache_entry *scan_entry)
 {
 	const uint8_t *rsnxe, *rsnxe_caps;
 	uint8_t cap_len;
+	bool rf_test_mode = false;
+	QDF_STATUS status;
+
+	status = wlan_mlme_is_rf_test_mode_enabled(psoc,
+						   &rf_test_mode);
+	if (!QDF_IS_STATUS_SUCCESS(status)) {
+		mlme_err("Get rf test mode failed");
+		return false;
+	}
+	if (rf_test_mode) {
+		mlme_debug("rf test mode is enabled, ignore setting");
+		return true;
+	}
 
 	if (!scan_entry->ie_list.rsn) {
 		mlme_debug(QDF_MAC_ADDR_FMT ": RSN IE not present",
@@ -1497,7 +1511,8 @@ bool wlan_cm_is_eht_allowed_for_current_security(
 }
 #endif
 
-static int cm_calculate_eht_score(struct scan_cache_entry *entry,
+static int cm_calculate_eht_score(struct wlan_objmgr_psoc *psoc,
+				  struct scan_cache_entry *entry,
 				  struct scoring_cfg *score_config,
 				  struct psoc_phy_config *phy_config,
 				  uint8_t prorated_pcnt)
@@ -1508,7 +1523,7 @@ static int cm_calculate_eht_score(struct scan_cache_entry *entry,
 	if (!phy_config->eht_cap || !entry->ie_list.ehtcap)
 		return 0;
 
-	if (!wlan_cm_is_eht_allowed_for_current_security(entry))
+	if (!wlan_cm_is_eht_allowed_for_current_security(psoc, entry))
 		return 0;
 
 	weight_config = &score_config->weight_config;
@@ -1552,10 +1567,11 @@ static bool cm_get_su_beam_former(struct scan_cache_entry *entry)
 	return false;
 }
 #else
-static int cm_calculate_eht_score(struct scan_cache_entry *entry,
+static int cm_calculate_eht_score(struct wlan_objmgr_psoc *psoc,
+				  struct scan_cache_entry *entry,
 				  struct scoring_cfg *score_config,
 				  struct psoc_phy_config *phy_config,
-				uint8_t prorated_pcnt)
+				  uint8_t prorated_pcnt)
 {
 	return 0;
 }
@@ -2354,7 +2370,7 @@ static int cm_calculate_bss_score(struct wlan_objmgr_psoc *psoc,
 		return score;
 	}
 
-	if (wlan_cm_is_eht_allowed_for_current_security(entry))
+	if (wlan_cm_is_eht_allowed_for_current_security(psoc, entry))
 		score += cm_calculate_ml_scores(psoc, entry, score_config,
 						phy_config, scan_list,
 						is_link_score, bss_mlo_type,
@@ -2468,7 +2484,8 @@ static int cm_calculate_bss_score(struct wlan_objmgr_psoc *psoc,
 						     entry->neg_sec_info);
 	score += security_score;
 
-	eht_score = cm_calculate_eht_score(entry, score_config, phy_config,
+	eht_score = cm_calculate_eht_score(psoc, entry, score_config,
+					   phy_config,
 					   prorated_pcnt);
 	score += eht_score;
 

+ 2 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -485,6 +485,7 @@ static QDF_STATUS cm_update_vdev_mlme_macaddr(struct cnx_mgr *cm_ctx,
 	if (req->cur_candidate->entry->ie_list.multi_link_bv &&
 	    !qdf_is_macaddr_zero(mac) &&
 	    wlan_cm_is_eht_allowed_for_current_security(
+					wlan_vdev_get_psoc(cm_ctx->vdev),
 					req->cur_candidate->entry)) {
 		wlan_vdev_obj_lock(cm_ctx->vdev);
 		/* Use link address for ML connection */
@@ -637,6 +638,7 @@ static void cm_create_bss_peer(struct cnx_mgr *cm_ctx,
 				      &eht_capab);
 	if (eht_capab && wlan_vdev_mlme_is_mlo_vdev(cm_ctx->vdev) &&
 	    wlan_cm_is_eht_allowed_for_current_security(
+					wlan_vdev_get_psoc(cm_ctx->vdev),
 					req->cur_candidate->entry)) {
 		cm_set_vdev_link_id(cm_ctx, req);
 		wlan_mlo_init_cu_bpcc(cm_ctx->vdev);

+ 4 - 0
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_bss_score_param.h

@@ -344,14 +344,17 @@ void wlan_cm_calculate_bss_score(struct wlan_objmgr_pdev *pdev,
 /**
  * wlan_cm_is_eht_allowed_for_current_security() - checks the current security,
  * if eht allowed or not.
+ * @psoc: psoc context
  * @scan_entry: pointer to scan cache entry
  *
  * Return: true if eht allowed for current security
  **/
 bool wlan_cm_is_eht_allowed_for_current_security(
+			struct wlan_objmgr_psoc *psoc,
 			struct scan_cache_entry *scan_entry);
 #else
 static inline bool wlan_cm_is_eht_allowed_for_current_security(
+			struct wlan_objmgr_psoc *psoc,
 			struct scan_cache_entry *scan_entry)
 {
 	return true;
@@ -359,6 +362,7 @@ static inline bool wlan_cm_is_eht_allowed_for_current_security(
 #endif
 #else
 static inline bool wlan_cm_is_eht_allowed_for_current_security(
+			struct wlan_objmgr_psoc *psoc,
 			struct scan_cache_entry *scan_entry)
 {
 	return false;