Parcourir la source

qcacld-3.0: Notify connection state change event

Notify connection state change event to policy mgr
to change force link mode accordingly.

Change-Id: I2da0f453ee1af67c95346f2dc23e9e757aa491b6
CRs-Fixed: 3525191
Liangwei Dong il y a 1 an
Parent
commit
11a102942b

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

@@ -40,6 +40,7 @@
 #include "wlan_mlme_ucfg_api.h"
 #include "target_if.h"
 #include "wlan_cm_api.h"
+#include "wlan_mlo_link_force.h"
 
 enum policy_mgr_conc_next_action (*policy_mgr_get_current_pref_hw_mode_ptr)
 	(struct wlan_objmgr_psoc *psoc);
@@ -412,8 +413,6 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
 
 	/* do we need to change the HW mode */
 	policy_mgr_check_n_start_opportunistic_timer(psoc);
-	policy_mgr_handle_ml_sta_links_on_vdev_up_csa(psoc,
-				policy_mgr_get_qdf_mode_from_pm(mode), vdev_id);
 
 	if (policy_mgr_is_conc_sap_present_on_sta_freq(psoc, mode, cur_freq) &&
 	    policy_mgr_update_indoor_concurrency(psoc, vdev_id, 0,
@@ -425,6 +424,8 @@ QDF_STATUS policy_mgr_update_connection_info(struct wlan_objmgr_psoc *psoc,
 	else if (wlan_reg_get_keep_6ghz_sta_cli_connection(pm_ctx->pdev))
 		wlan_reg_recompute_current_chan_list(psoc, pm_ctx->pdev);
 
+	ml_nlink_conn_change_notify(
+		psoc, vdev_id, ml_nlink_connection_updated_evt, NULL);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 6 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -4795,7 +4795,9 @@ void policy_mgr_incr_active_session(struct wlan_objmgr_psoc *psoc,
 		wlan_reg_recompute_current_chan_list(psoc, pm_ctx->pdev);
 
 	qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
-	policy_mgr_handle_ml_sta_links_on_vdev_up_csa(psoc, mode, session_id);
+	if (mode == QDF_SAP_MODE || mode == QDF_P2P_GO_MODE)
+		ml_nlink_conn_change_notify(
+			psoc, session_id, ml_nlink_ap_started_evt, NULL);
 }
 
 /**
@@ -7428,7 +7430,9 @@ void policy_mgr_handle_ml_sta_link_on_traffic_type_change(
 	/* Check if any set link is already progress and thus wait */
 	policy_mgr_wait_for_set_link_update(psoc);
 
-	policy_mgr_handle_sap_cli_go_ml_sta_up_csa(psoc, vdev);
+	ml_nlink_conn_change_notify(
+		psoc, wlan_vdev_get_id(vdev),
+		ml_nlink_connection_updated_evt, NULL);
 
 	/*
 	 * Check if traffic type change lead to set link is progress and

+ 4 - 1
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -41,6 +41,7 @@
 #include "wlan_cm_roam_api.h"
 #include "wlan_scan_api.h"
 #include "wlan_nan_api.h"
+#include "wlan_mlo_link_force.h"
 
 /*
  * first_connection_pcl_table - table which provides PCL for the
@@ -467,7 +468,9 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc,
 		return;
 
 	policy_mgr_check_n_start_opportunistic_timer(psoc);
-	policy_mgr_handle_ml_sta_links_on_vdev_down(psoc, mode, session_id);
+	if (mode == QDF_SAP_MODE || mode == QDF_P2P_GO_MODE)
+		ml_nlink_conn_change_notify(
+			psoc, session_id, ml_nlink_ap_stopped_evt, NULL);
 }
 
 /**

+ 3 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_fw_sync.c

@@ -1157,6 +1157,9 @@ QDF_STATUS cm_fw_roam_complete(struct cnx_mgr *cm_ctx, void *data)
 		roam_synch_data->hw_mode_trans_ind.num_vdev_mac_entries,
 		roam_synch_data->hw_mode_trans_ind.vdev_mac_map,
 		0, NULL, psoc);
+	ml_nlink_conn_change_notify(
+			psoc, vdev_id,
+			ml_nlink_roam_sync_completion_evt, NULL);
 
 	if (roam_synch_data->pmk_len) {
 		mlme_debug("Received pmk in roam sync. Length: %d",

+ 7 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -42,6 +42,7 @@
 #include "wlan_psoc_mlme_api.h"
 #include "wlan_t2lm_api.h"
 #include "wlan_mlo_t2lm.h"
+#include "wlan_mlo_link_force.h"
 
 #ifdef WLAN_FEATURE_FILS_SK
 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
@@ -1081,6 +1082,9 @@ QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
 					   wlan_vdev_get_id(vdev),
 					   HS_20_AP, &src_cfg);
 	}
+	ml_nlink_conn_change_notify(
+		psoc, wlan_vdev_get_id(vdev),
+		ml_nlink_connect_start_evt, NULL);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1669,7 +1673,9 @@ cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 								psoc, vdev_id);
 		else
 			policy_mgr_incr_active_session(psoc, op_mode, vdev_id);
-
+		ml_nlink_conn_change_notify(
+			psoc, vdev_id,
+			ml_nlink_connect_completion_evt, NULL);
 		cm_process_connect_complete(psoc, pdev, vdev, rsp);
 		cm_install_link_vdev_keys(vdev);
 		wlan_tdls_notify_sta_connect(vdev_id,

+ 7 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_disconnect.c

@@ -35,6 +35,7 @@
 #include <wlan_mlo_mgr_sta.h>
 #include "wlan_mlo_mgr_roam.h"
 #include "wlan_t2lm_api.h"
+#include "wlan_mlo_link_force.h"
 
 static void cm_abort_connect_request_timers(struct wlan_objmgr_vdev *vdev)
 {
@@ -74,6 +75,9 @@ QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_INVAL;
 	}
 	mlo_sta_stop_reconfig_timer(vdev);
+	ml_nlink_conn_change_notify(
+		psoc, wlan_vdev_get_id(vdev),
+		ml_nlink_disconnect_start_evt, NULL);
 	if (cm_csr_is_ss_wait_for_key(req->vdev_id)) {
 		mlme_debug("Stop Wait for key timer");
 		cm_stop_wait_for_key_timer(psoc, req->vdev_id);
@@ -252,6 +256,9 @@ cm_disconnect_complete_ind(struct wlan_objmgr_vdev *vdev,
 	wlan_tdls_notify_sta_disconnect(vdev_id, false, false, vdev);
 	policy_mgr_decr_session_set_pcl(psoc, op_mode, vdev_id);
 	wlan_clear_mlo_sta_link_removed_flag(vdev);
+	ml_nlink_conn_change_notify(
+		psoc, vdev_id, ml_nlink_disconnect_completion_evt,
+		NULL);
 
 	return QDF_STATUS_SUCCESS;
 }

+ 9 - 0
components/umac/mlme/mlo_mgr/src/wlan_mlo_link_force.c

@@ -23,6 +23,7 @@
 #include "wlan_cm_roam_public_struct.h"
 #include "wlan_cm_roam_api.h"
 #include "wlan_mlo_mgr_roam.h"
+#include "wlan_mlme_main.h"
 
 void
 ml_nlink_convert_linkid_bitmap_to_vdev_bitmap(
@@ -1535,6 +1536,7 @@ ml_nlink_conn_change_notify(struct wlan_objmgr_psoc *psoc,
 			    struct ml_nlink_change_event *data)
 {
 	struct wlan_objmgr_vdev *vdev;
+	enum QDF_OPMODE mode;
 
 	mlo_debug("vdev %d %s", vdev_id, link_evt_to_string(evt));
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
@@ -1543,6 +1545,7 @@ ml_nlink_conn_change_notify(struct wlan_objmgr_psoc *psoc,
 		mlo_err("invalid vdev id %d ", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
+	mode = wlan_vdev_mlme_get_opmode(vdev);
 
 	switch (evt) {
 	case ml_nlink_link_switch_start_evt:
@@ -1582,6 +1585,12 @@ ml_nlink_conn_change_notify(struct wlan_objmgr_psoc *psoc,
 			psoc, vdev, MLO_LINK_FORCE_REASON_DISCONNECT);
 		break;
 	case ml_nlink_connection_updated_evt:
+		if (mode == QDF_STA_MODE &&
+		    (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) ||
+		     MLME_IS_MLO_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id))) {
+			mlo_debug("vdev id %d in roam sync", vdev_id);
+			break;
+		}
 		ml_nlink_state_change_handler(
 			psoc, vdev, MLO_LINK_FORCE_REASON_CONNECT);
 		break;

+ 4 - 0
components/umac/mlme/mlo_mgr/src/wlan_mlo_mgr_roam.c

@@ -32,6 +32,7 @@
 #include <wlan_cm_api.h>
 #include <utils_mlo.h>
 #include <wlan_mlo_mgr_peer.h>
+#include "wlan_mlo_link_force.h"
 
 #ifdef WLAN_FEATURE_11BE_MLO
 static bool
@@ -269,6 +270,9 @@ QDF_STATUS mlo_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	}
 
 	mlo_roam_update_vdev_macaddr(psoc, vdev_id, is_non_mlo_ap);
+	ml_nlink_conn_change_notify(
+		psoc, vdev_id, ml_nlink_roam_sync_start_evt, NULL);
+
 	status = cm_fw_roam_sync_req(psoc, vdev_id, event, event_data_len);
 
 	if (QDF_IS_STATUS_ERROR(status))