Browse Source

qcacmn: update mlme info for standby link

update  AP link information for standby link.

Change-Id: Ie5ff52e2ecea4548f738965efcfee54e08f63eb5
CRs-Fixed: 3530713
Deeksha Gupta 2 years ago
parent
commit
9b7258ffff

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

@@ -2791,6 +2791,10 @@ QDF_STATUS cm_connect_complete(struct cnx_mgr *cm_ctx,
 					&bss_info, &mlme_info);
 					&bss_info, &mlme_info);
 	}
 	}
 
 
+	cm_standby_link_update_mlme_by_bssid(cm_ctx->vdev,
+					     mlme_info.assoc_state,
+					     resp->ssid);
+
 	mlme_debug(CM_PREFIX_FMT,
 	mlme_debug(CM_PREFIX_FMT,
 		   CM_PREFIX_REF(wlan_vdev_get_id(cm_ctx->vdev),
 		   CM_PREFIX_REF(wlan_vdev_get_id(cm_ctx->vdev),
 				 resp->cm_id));
 				 resp->cm_id));

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

@@ -380,6 +380,9 @@ cm_update_scan_mlme_on_disconnect(struct wlan_objmgr_vdev *vdev,
 
 
 	bss_info.freq = chan->ch_freq;
 	bss_info.freq = chan->ch_freq;
 
 
+	cm_standby_link_update_mlme_by_bssid(vdev, mlme.assoc_state,
+					     bss_info.ssid);
+
 	wlan_scan_update_mlme_by_bssinfo(pdev, &bss_info, &mlme);
 	wlan_scan_update_mlme_by_bssinfo(pdev, &bss_info, &mlme);
 }
 }
 
 

+ 41 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_main.c

@@ -1,5 +1,6 @@
 /*
 /*
  * Copyright (c) 2012-2015, 2020-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2012-2015, 2020-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  * purpose with or without fee is hereby granted, provided that the above
@@ -22,6 +23,7 @@
 #include "wlan_cm_roam.h"
 #include "wlan_cm_roam.h"
 #include "wlan_cm_main_api.h"
 #include "wlan_cm_main_api.h"
 #include "wlan_scan_api.h"
 #include "wlan_scan_api.h"
+#include "wlan_mlo_mgr_link_switch.h"
 
 
 #ifdef WLAN_CM_USE_SPINLOCK
 #ifdef WLAN_CM_USE_SPINLOCK
 /**
 /**
@@ -186,3 +188,42 @@ QDF_STATUS wlan_cm_deinit(struct vdev_mlme_obj *vdev_mlme)
 
 
 	return QDF_STATUS_SUCCESS;
 	return QDF_STATUS_SUCCESS;
 }
 }
+
+#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+void cm_standby_link_update_mlme_by_bssid(struct wlan_objmgr_vdev *vdev,
+					  uint32_t assoc_state,
+					  struct wlan_ssid ssid)
+{
+	struct mlo_link_info *link_info;
+	uint8_t link_info_iter;
+	struct mlme_info mlme_info;
+	struct bss_info bss_info;
+
+	if (!wlan_vdev_mlme_is_assoc_sta_vdev(vdev))
+		return;
+
+	link_info = mlo_mgr_get_ap_link(vdev);
+	if (!link_info)
+		return;
+
+	for (link_info_iter = 0; link_info_iter < 3; link_info_iter++) {
+		if (qdf_is_macaddr_zero(&link_info->ap_link_addr))
+			break;
+
+		if (link_info->vdev_id == WLAN_INVALID_VDEV_ID) {
+			mlme_info.assoc_state = assoc_state;
+			qdf_copy_macaddr(&bss_info.bssid,
+					 &link_info->ap_link_addr);
+			bss_info.freq = link_info->link_chan_info->ch_freq;
+			bss_info.ssid.length = ssid.length;
+			qdf_mem_copy(&bss_info.ssid.ssid, ssid.ssid,
+				     bss_info.ssid.length);
+
+			wlan_scan_update_mlme_by_bssinfo(wlan_vdev_get_pdev(vdev),
+							 &bss_info, &mlme_info);
+		}
+
+		link_info++;
+	}
+}
+#endif

+ 23 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_main_api.h

@@ -255,6 +255,7 @@ QDF_STATUS cm_connect_rsp(struct wlan_objmgr_vdev *vdev,
 QDF_STATUS cm_notify_connect_complete(struct cnx_mgr *cm_ctx,
 QDF_STATUS cm_notify_connect_complete(struct cnx_mgr *cm_ctx,
 				      struct wlan_cm_connect_resp *resp,
 				      struct wlan_cm_connect_resp *resp,
 				      bool acquire_lock);
 				      bool acquire_lock);
+
 /**
 /**
  * cm_connect_complete() - This API would be called after connect complete
  * cm_connect_complete() - This API would be called after connect complete
  * request from the serialization.
  * request from the serialization.
@@ -1134,6 +1135,28 @@ cm_connect_rsp_get_mld_addr_or_bssid(struct wlan_cm_connect_resp *resp,
 }
 }
 #endif
 #endif
 
 
+#ifdef WLAN_FEATURE_11BE_MLO_ADV_FEATURE
+/**
+ * cm_standby_link_update_mlme_by_bssid() - update the scan mlme info for
+ * standby_link
+ * @vdev: Object manager vdev
+ * @assoc_state: association state
+ * @ssid: SSID of the connection
+ *
+ * Return: void
+ */
+void cm_standby_link_update_mlme_by_bssid(struct wlan_objmgr_vdev *vdev,
+					  uint32_t assoc_state,
+					  struct wlan_ssid ssid);
+#else
+static inline void
+cm_standby_link_update_mlme_by_bssid(struct wlan_objmgr_vdev *vdev,
+				     uint32_t assoc_state,
+				     struct wlan_ssid ssid)
+{
+}
+#endif
+
 /**
 /**
  * cm_get_cm_id_by_scan_id() - Get cm id by matching the scan id
  * cm_get_cm_id_by_scan_id() - Get cm id by matching the scan id
  * @cm_ctx: connection manager context
  * @cm_ctx: connection manager context

+ 10 - 0
umac/mlo_mgr/inc/wlan_mlo_mgr_link_switch.h

@@ -220,6 +220,16 @@ void mlo_mgr_update_ap_channel_info(struct wlan_objmgr_vdev *vdev,
 struct mlo_link_info*
 struct mlo_link_info*
 mlo_mgr_get_ap_link_by_link_id(struct wlan_objmgr_vdev *vdev, int link_id);
 mlo_mgr_get_ap_link_by_link_id(struct wlan_objmgr_vdev *vdev, int link_id);
 
 
+/**
+ * mlo_mgr_get_ap_link() - Assoc mlo link info from link id
+ * @vdev: Object Manager vdev
+ *
+ * Get Assoc link info.
+ *
+ * Return: Pointer of link info
+ */
+struct mlo_link_info *mlo_mgr_get_ap_link(struct wlan_objmgr_vdev *vdev);
+
 /**
 /**
  * mlo_mgr_link_switch_request_params() - Link switch request params from FW.
  * mlo_mgr_link_switch_request_params() - Link switch request params from FW.
  * @psoc: PSOC object manager
  * @psoc: PSOC object manager

+ 9 - 0
umac/mlo_mgr/src/wlan_mlo_mgr_link_switch.c

@@ -167,6 +167,15 @@ struct mlo_link_info
 	return NULL;
 	return NULL;
 }
 }
 
 
+struct mlo_link_info
+*mlo_mgr_get_ap_link(struct wlan_objmgr_vdev *vdev)
+{
+	if (!vdev || !vdev->mlo_dev_ctx)
+		return NULL;
+
+	return &vdev->mlo_dev_ctx->link_ctx->links_info[0];
+}
+
 static
 static
 void mlo_mgr_alloc_link_info_wmi_chan(struct wlan_mlo_dev_context *ml_dev)
 void mlo_mgr_alloc_link_info_wmi_chan(struct wlan_mlo_dev_context *ml_dev)
 {
 {