Эх сурвалжийг харах

qcacld-3.0: Handle t2lm ie after connection complete

Change done to handle t2lm ie after MLO connection
is completed and save tsf value received in beacon.
Also fix to not select link if tid mapping is not present.

Change-Id: Ie2ce1fcfa50a4e14a083a508b268dfebb308d3ad
CRs-Fixed: 3342807
Amruta Kulkarni 2 жил өмнө
parent
commit
38e2b1f38d

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

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2015, 2020-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 any
  * purpose with or without fee is hereby granted, provided that the above
@@ -40,6 +40,8 @@
 #include "wlan_mlme_api.h"
 #include "wlan_reg_services_api.h"
 #include "wlan_psoc_mlme_api.h"
+#include "wlan_t2lm_api.h"
+#include "wlan_mlo_t2lm.h"
 
 #ifdef WLAN_FEATURE_FILS_SK
 void cm_update_hlp_info(struct wlan_objmgr_vdev *vdev,
@@ -1511,6 +1513,35 @@ static void cm_process_connect_complete(struct wlan_objmgr_psoc *psoc,
 
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static QDF_STATUS
+cm_update_tid_mapping(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_t2lm_context *t2lm_ctx;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	if (!vdev || !vdev->mlo_dev_ctx)
+		return QDF_STATUS_E_NULL_VALUE;
+
+	if (!mlo_check_if_all_links_up(vdev))
+		return QDF_STATUS_E_FAILURE;
+
+	t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx;
+	status = wlan_process_bcn_prbrsp_t2lm_ie(vdev, t2lm_ctx, t2lm_ctx->tsf);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("T2LM IE beacon process failed");
+		return status;
+	}
+
+	return status;
+}
+#else
+static inline QDF_STATUS
+cm_update_tid_mapping(struct wlan_objmgr_vdev *vdev)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
 static void
 cm_install_link_vdev_keys(struct wlan_objmgr_vdev *vdev)
 {
@@ -1611,6 +1642,7 @@ cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 					     mlme_get_tdls_prohibited(vdev),
 					     vdev);
 		wlan_p2p_status_connect(vdev);
+		cm_update_tid_mapping(vdev);
 	}
 
 	if (op_mode == QDF_STA_MODE &&

+ 15 - 7
components/umac/mlme/mlo_mgr/src/wlan_t2lm_api.c

@@ -280,7 +280,7 @@ QDF_STATUS
 wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
 			     struct scan_cache_entry *scan_entry)
 {
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct wlan_objmgr_vdev *vdev;
 	struct wlan_t2lm_context t2lm_ctx;
 	uint16_t tid_map_link_id;
@@ -295,11 +295,14 @@ wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
 
 	vdev = cm_ctx->vdev;
 
-	if (scan_entry->ie_list.t2lm[0]) {
-		if (!vdev || !vdev->mlo_dev_ctx) {
-			status = QDF_STATUS_E_NULL_VALUE;
-			goto end;
-		}
+	if (wlan_vdev_mlme_is_mlo_link_vdev(vdev)) {
+		mlme_debug("Skip t2lm validation for link vdev");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	if (wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE &&
+	    wlan_vdev_mlme_is_mlo_vdev(vdev) &&
+	    scan_entry->ie_list.t2lm[0]) {
 
 		status = wlan_mlo_parse_bcn_prbresp_t2lm_ie(&t2lm_ctx,
 						scan_entry->ie_list.t2lm[0]);
@@ -327,10 +330,15 @@ wlan_t2lm_validate_candidate(struct cnx_mgr *cm_ctx,
 			tid_map_link_id = established_tid_mapped_link_id;
 
 		if (tid_map_link_id == scan_entry->ml_info.self_link_id) {
-			t2lm_debug("self link id %d, tid map link id %d",
+			t2lm_debug("self link id %d, tid map link id %d match",
 				   scan_entry->ml_info.self_link_id,
 				   tid_map_link_id);
 			status = QDF_STATUS_SUCCESS;
+		} else {
+			t2lm_debug("self link id %d, tid map link id %d do not match",
+				   scan_entry->ml_info.self_link_id,
+				   tid_map_link_id);
+			status = QDF_STATUS_E_FAILURE;
 		}
 	} else {
 		t2lm_debug("T2LM IE is not present in scan entry");

+ 5 - 3
core/mac/src/pe/lim/lim_process_beacon_frame.c

@@ -51,7 +51,7 @@ void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
 				  tpSirProbeRespBeacon bcn_ptr)
 {
 	struct wlan_objmgr_vdev *vdev;
-	uint64_t tsf;
+	struct wlan_t2lm_context *t2lm_ctx;
 
 	if (!session || !bcn_ptr || !mac_ctx) {
 		pe_err("invalid input parameters");
@@ -73,9 +73,11 @@ void lim_process_bcn_prb_rsp_t2lm(struct mac_context *mac_ctx,
 		return;
 	}
 
-	qdf_mem_copy((uint8_t *)&tsf, (uint8_t *)bcn_ptr->timeStamp,
+	t2lm_ctx = &vdev->mlo_dev_ctx->t2lm_ctx;
+	qdf_mem_copy((uint8_t *)&t2lm_ctx->tsf, (uint8_t *)bcn_ptr->timeStamp,
 		     sizeof(uint64_t));
-	wlan_process_bcn_prbrsp_t2lm_ie(vdev, &bcn_ptr->t2lm_ctx, tsf);
+	wlan_process_bcn_prbrsp_t2lm_ie(vdev, &bcn_ptr->t2lm_ctx,
+					t2lm_ctx->tsf);
 }
 
 void lim_process_beacon_mlo(struct mac_context *mac_ctx,