Przeglądaj źródła

qcacld-3.0: Add API to save and retrieve num roamed links

Add new APIs to save number of links to which FW roamed
and add new API to retrieve this saved info.

Change-Id: Idfd8727855bd5da97a3808c78e89a505ef06c249
CRs-Fixed: 3755754
(cherry picked from commit 3348a67e475b9d93376fc23d74a7fa3ac03892eb)
Vinod Kumar Pirla 1 rok temu
rodzic
commit
03a8bed136

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

@@ -604,6 +604,21 @@ cm_update_assoc_btm_cap(struct wlan_objmgr_vdev *vdev,
 	wlan_cm_set_assoc_btm_cap(vdev, extcap->bss_transition);
 }
 
+#ifdef WLAN_FEATURE_11BE_MLO
+static inline void
+cm_fill_num_roam_links_info(struct wlan_roam_sync_info *roam_info,
+			    struct roam_offload_synch_ind *roam_synch_ind)
+{
+	roam_info->num_setup_links = roam_synch_ind->num_setup_links;
+}
+#else
+static inline void
+cm_fill_num_roam_links_info(struct wlan_roam_sync_info *roam_info,
+			    struct roam_offload_synch_ind *roam_synch_ind)
+{
+}
+#endif
+
 static QDF_STATUS
 cm_fill_roam_info(struct wlan_objmgr_vdev *vdev,
 		  struct roam_offload_synch_ind *roam_synch_data,
@@ -663,6 +678,7 @@ cm_fill_roam_info(struct wlan_objmgr_vdev *vdev,
 
 	roaming_info = rsp->connect_rsp.roaming_info;
 	roaming_info->auth_status = roam_synch_data->auth_status;
+	cm_fill_num_roam_links_info(roaming_info, roam_synch_data);
 	roaming_info->kck_len = roam_synch_data->kck_len;
 	if (roaming_info->kck_len)
 		qdf_mem_copy(roaming_info->kck, roam_synch_data->kck,

+ 22 - 1
components/umac/mlme/mlo_mgr/inc/wlan_mlo_mgr_roam.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 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
@@ -351,6 +351,22 @@ void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
 				      struct ml_setup_link_param *src_link_info,
 				      struct wlan_channel *channel);
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+/**
+ * mlo_mgr_num_roam_links() - Get number of roaming links
+ * @vdev: VDEV object manager pointer
+ *
+ * Returns the num of links device roamed via FW roam sync event,
+ * for non-MLO VDEV the number of links is one.
+ */
+uint8_t mlo_mgr_num_roam_links(struct wlan_objmgr_vdev *vdev);
+#else
+static inline uint8_t mlo_mgr_num_roam_links(struct wlan_objmgr_vdev *vdev)
+{
+	return 0;
+}
+#endif
+
 /**
  * mlo_cm_roam_sync_cb - Callback function from CM to MLO mgr
  *
@@ -648,6 +664,11 @@ void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
 				      struct wlan_channel *channel)
 {}
 
+static inline uint8_t mlo_mgr_num_roam_links(struct wlan_objmgr_vdev *vdev)
+{
+	return 1;
+}
+
 static inline uint32_t
 mlo_roam_get_link_freq_from_mac_addr(struct roam_offload_synch_ind *sync_ind,
 				     uint8_t *link_mac_addr)

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

@@ -323,6 +323,25 @@ mlo_mgr_get_link_info_by_self_addr(struct wlan_objmgr_vdev *vdev,
 	return NULL;
 }
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+uint8_t mlo_mgr_num_roam_links(struct wlan_objmgr_vdev *vdev)
+{
+	struct wlan_cm_connect_resp *reassoc_rsp;
+
+	if (!vdev->mlo_dev_ctx)
+		return 1;
+
+	if (!vdev->mlo_dev_ctx->sta_ctx)
+		return 0;
+
+	reassoc_rsp = vdev->mlo_dev_ctx->sta_ctx->copied_reassoc_rsp;
+	if (!reassoc_rsp || !reassoc_rsp->roaming_info)
+		return 0;
+
+	return reassoc_rsp->roaming_info->num_setup_links;
+}
+#endif
+
 void mlo_mgr_roam_update_ap_link_info(struct wlan_objmgr_vdev *vdev,
 				      struct ml_setup_link_param *src_link_info,
 				      struct wlan_channel *channel)