Browse Source

qcacld-3.0: Disable force SCC check for link switch disconnection

If disconnection event is for link switch, do not trigger SAP
force SCC check. And if link switch is in progress, skip
the force SCC workqueue.
And if link is in middle of switching, do not run link force logic.

Change-Id: I4a8bf59ff16dca2caf560eb36e1bc58f7d6a919b
CRs-Fixed: 3590814
Liangwei Dong 1 year ago
parent
commit
84250fda26

+ 4 - 5
components/cmn_services/interface_mgr/src/wlan_if_mgr_sta.c

@@ -35,11 +35,10 @@
 #include <wlan_cm_roam_api.h>
 #include "wlan_nan_api.h"
 #include "wlan_mlme_vdev_mgr_interface.h"
-#ifdef WLAN_FEATURE_11BE_MLO
 #include <wlan_mlo_mgr_sta.h>
-#endif
 #include "wlan_vdev_mgr_utils_api.h"
 #include "wlan_tdls_api.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 QDF_STATUS if_mgr_connect_start(struct wlan_objmgr_vdev *vdev,
 				struct if_mgr_event_data *event_data)
@@ -249,9 +248,9 @@ QDF_STATUS if_mgr_disconnect_complete(struct wlan_objmgr_vdev *vdev,
 		ifmgr_err("Failed to enable roaming after p2p disconnect");
 		return status;
 	}
-
-	policy_mgr_check_concurrent_intf_and_restart_sap(psoc,
-				wlan_util_vdev_mgr_get_acs_mode_for_vdev(vdev));
+	if (!mlo_is_mld_sta(vdev) || !mlo_mgr_is_link_switch_in_progress(vdev))
+		policy_mgr_check_concurrent_intf_and_restart_sap(
+			psoc, wlan_util_vdev_mgr_get_acs_mode_for_vdev(vdev));
 
 	status = if_mgr_enable_roaming_on_connected_sta(pdev, vdev);
 	if (status) {

+ 17 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -41,6 +41,8 @@
 #include "target_if.h"
 #include "wlan_cm_api.h"
 #include "wlan_mlo_link_force.h"
+#include "wlan_mlo_mgr_sta.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr)
 	(struct wlan_objmgr_psoc *psoc);
@@ -2479,7 +2481,7 @@ policy_mgr_check_sap_go_force_scc(struct wlan_objmgr_psoc *psoc,
  * @psoc: PSOC object information
  *
  * This function will check connection table and find any STA/CLI
- * in transition state such as disconnecting, or roaming.
+ * in transition state such as disconnecting, link switch or roaming.
  *
  * Return: true if there is one STA/CLI in transition state.
  */
@@ -2491,6 +2493,7 @@ policy_mgr_is_any_conn_in_transition(struct wlan_objmgr_psoc *psoc)
 	struct policy_mgr_conc_connection_info *conn_info;
 	struct wlan_objmgr_vdev *vdev;
 	bool non_connected = false;
+	bool in_link_switch = false;
 	uint8_t vdev_id;
 
 	pm_ctx = policy_mgr_get_context(psoc);
@@ -2515,16 +2518,26 @@ policy_mgr_is_any_conn_in_transition(struct wlan_objmgr_psoc *psoc)
 		}
 
 		non_connected = !wlan_cm_is_vdev_connected(vdev);
+
+		if (mlo_is_mld_sta(vdev) &&
+		    mlo_mgr_is_link_switch_in_progress(vdev))
+			in_link_switch = true;
+
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
 		if (non_connected) {
 			policy_mgr_debug("vdev %d: is in transition state",
 					 vdev_id);
 			break;
 		}
+		if (in_link_switch) {
+			policy_mgr_debug("vdev %d: sta mld is in link switch state",
+					 vdev_id);
+			break;
+		}
 	}
 	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
 
-	return non_connected;
+	return non_connected || in_link_switch;
 }
 
 static void __policy_mgr_check_sta_ap_concurrent_ch_intf(
@@ -2604,6 +2617,8 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(
 	 */
 	if (policy_mgr_is_any_conn_in_transition(pm_ctx->psoc)) {
 		policy_mgr_debug("defer sap conc check to a later time due to another sta/cli dicon/roam pending");
+		qdf_delayed_work_start(&pm_ctx->sta_ap_intf_check_work,
+				       SAP_CONC_CHECK_DEFER_TIMEOUT_MS);
 		goto end;
 	}
 

+ 42 - 7
components/umac/mlme/mlo_mgr/src/wlan_mlo_link_force.c

@@ -1774,6 +1774,47 @@ ml_nlink_update_force_active_num(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
+static bool
+ml_nlink_all_links_ready_for_state_change(struct wlan_objmgr_psoc *psoc,
+					  struct wlan_objmgr_vdev *vdev,
+					  enum ml_nlink_change_event_type evt)
+{
+	uint8_t ml_num_link = 0;
+	uint32_t ml_link_bitmap = 0;
+	uint8_t ml_vdev_lst[MAX_NUMBER_OF_CONC_CONNECTIONS];
+	qdf_freq_t ml_freq_lst[MAX_NUMBER_OF_CONC_CONNECTIONS];
+	uint8_t ml_linkid_lst[MAX_NUMBER_OF_CONC_CONNECTIONS];
+	struct ml_link_info ml_link_info[MAX_NUMBER_OF_CONC_CONNECTIONS];
+
+	if (!mlo_check_if_all_links_up(vdev))
+		return false;
+
+	if (mlo_mgr_is_link_switch_in_progress(vdev) &&
+	    evt != ml_nlink_connect_completion_evt) {
+		mlo_debug("mlo vdev %d link switch in progress!",
+			  wlan_vdev_get_id(vdev));
+		return false;
+	}
+	/* For initial connecting to 2 or 3 links ML ap, assoc link and
+	 * non assoc link connected one by one, avoid changing link state
+	 * before link vdev connect completion, to check connected link count.
+	 * If < 2, means non assoc link connect is not completed, disallow
+	 * link state change.
+	 */
+	if (!mlo_mgr_is_link_switch_in_progress(vdev) &&
+	    evt == ml_nlink_connect_completion_evt) {
+		ml_nlink_get_link_info(psoc, vdev, NLINK_EXCLUDE_STANDBY_LINK,
+				       QDF_ARRAY_SIZE(ml_linkid_lst),
+				       ml_link_info, ml_freq_lst, ml_vdev_lst,
+				       ml_linkid_lst, &ml_num_link,
+				       &ml_link_bitmap);
+		if (ml_num_link < 2)
+			return false;
+	}
+
+	return true;
+}
+
 /**
  * ml_nlink_state_change() - Handle ML STA link force
  * with concurrency internal function
@@ -1822,14 +1863,8 @@ static QDF_STATUS ml_nlink_state_change(struct wlan_objmgr_psoc *psoc,
 	vdev = ml_nlink_get_affect_ml_sta(psoc);
 	if (!vdev)
 		goto end;
-	if (!mlo_check_if_all_links_up(vdev))
-		goto end;
-	if (mlo_mgr_is_link_switch_in_progress(vdev) &&
-	    evt != ml_nlink_connect_completion_evt) {
-		mlo_debug("mlo vdev %d link switch in progress!",
-			  wlan_vdev_get_id(vdev));
+	if (!ml_nlink_all_links_ready_for_state_change(psoc, vdev, evt))
 		goto end;
-	}
 
 	ml_nlink_get_curr_force_state(psoc, vdev, &curr_force_state);
 

+ 6 - 1
core/sap/src/sap_module.c

@@ -4060,7 +4060,12 @@ qdf_freq_t wlansap_get_chan_band_restrict(struct sap_context *sap_ctx,
 						       cc_mode, vdev_id);
 	if (intf_ch_freq)
 		restart_freq = intf_ch_freq;
-	sap_debug("vdev: %d, CSA target freq: %d", vdev_id, restart_freq);
+	if (restart_freq == sap_ctx->chan_freq)
+		restart_freq = 0;
+
+	if (restart_freq)
+		sap_debug("vdev: %d, CSA target freq: %d", vdev_id,
+			  restart_freq);
 
 	return restart_freq;
 }