Ver Fonte

qcacmn: Introduce APIs to notify OSIF on assoc VDEV connect

Add APIs and callbacks to OSIF from CNX manager to notify
on assoc VDEV connect request becomes active in serialization.

Change-Id: Ica59c25199e0f09fc86b7311ae16d22f66af3b0c
CRs-Fixed: 3835003
Vinod Kumar Pirla há 1 ano atrás
pai
commit
b34016828e

+ 19 - 1
os_if/linux/mlme/inc/osif_cm_util.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2015, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-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
@@ -140,6 +140,10 @@ enum osif_cb_type {
 	OSIF_NOT_HANDLED,
 };
 
+#ifdef CONN_MGR_ADV_FEATURE
+typedef void (*osif_cm_connect_active_notify_cb)(uint8_t vdev_id);
+#endif
+
 /**
  * typedef osif_cm_connect_comp_cb  - Connect complete callback
  * @vdev: vdev pointer
@@ -364,6 +368,7 @@ typedef QDF_STATUS
 
 /**
  * struct osif_cm_ops - connection manager legacy callbacks
+ * @connect_active_notify_cb: callback for connect active to legacy modules
  * @connect_complete_cb: callback for connect complete to legacy
  * modules
  * @disconnect_complete_cb: callback for disconnect complete to
@@ -386,6 +391,9 @@ typedef QDF_STATUS
  * @perfd_set_cpufreq_cb: callback to update CPU min freq
  */
 struct osif_cm_ops {
+#ifdef CONN_MGR_ADV_FEATURE
+	osif_cm_connect_active_notify_cb connect_active_notify_cb;
+#endif
 	osif_cm_connect_comp_cb connect_complete_cb;
 	osif_cm_disconnect_comp_cb disconnect_complete_cb;
 #ifdef CONN_MGR_ADV_FEATURE
@@ -415,6 +423,16 @@ struct osif_cm_ops {
 #endif
 };
 
+#ifdef CONN_MGR_ADV_FEATURE
+/**
+ * osif_cm_connect_active_notify() - Function to notify connect active
+ * @vdev_id: VDEV ID on which connect req is active
+ *
+ * This API notifies connect active to legacy module
+ */
+void osif_cm_connect_active_notify(uint8_t vdev_id);
+#endif
+
 /**
  * osif_cm_connect_comp_ind() - Function to indicate connect
  * complete to legacy module

+ 12 - 1
os_if/linux/mlme/src/osif_cm_util.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012-2015, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-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
@@ -662,6 +662,9 @@ static void osif_cm_perfd_reset_cpufreq_ctrl_cb(void)
 #endif
 
 static struct mlme_cm_ops cm_ops = {
+#ifdef CONN_MGR_ADV_FEATURE
+	.mlme_cm_connect_active_notify_cb = osif_cm_connect_active_notify,
+#endif
 	.mlme_cm_connect_complete_cb = osif_cm_connect_complete_cb,
 	.mlme_cm_failed_candidate_cb = osif_cm_failed_candidate_cb,
 	.mlme_cm_update_id_and_src_cb = osif_cm_update_id_and_src_cb,
@@ -748,6 +751,14 @@ QDF_STATUS osif_cm_osif_priv_deinit(struct wlan_objmgr_vdev *vdev)
 	return QDF_STATUS_SUCCESS;
 }
 
+#ifdef CONN_MGR_ADV_FEATURE
+void osif_cm_connect_active_notify(uint8_t vdev_id)
+{
+	if (osif_cm_legacy_ops && osif_cm_legacy_ops->connect_active_notify_cb)
+		osif_cm_legacy_ops->connect_active_notify_cb(vdev_id);
+}
+#endif
+
 QDF_STATUS osif_cm_connect_comp_ind(struct wlan_objmgr_vdev *vdev,
 				    struct wlan_cm_connect_resp *rsp,
 				    enum osif_cb_type type)

+ 5 - 3
umac/mlme/connection_mgr/core/src/wlan_cm_connect.c

@@ -2458,9 +2458,11 @@ QDF_STATUS cm_connect_active(struct cnx_mgr *cm_ctx, wlan_cm_id *cm_id)
 	 * free vdev keys before setting crypto params for 1x/ owe roaming,
 	 * link vdev keys would be cleaned in osif
 	 */
-	if (!wlan_vdev_mlme_is_mlo_link_vdev(cm_ctx->vdev) &&
-	    !wlan_cm_check_mlo_roam_auth_status(cm_ctx->vdev))
-		wlan_crypto_free_vdev_key(cm_ctx->vdev);
+	if (!wlan_vdev_mlme_is_mlo_link_vdev(cm_ctx->vdev)) {
+		mlme_cm_osif_connect_active_notify(wlan_vdev_get_id(cm_ctx->vdev));
+		if (!wlan_cm_check_mlo_roam_auth_status(cm_ctx->vdev))
+			wlan_crypto_free_vdev_key(cm_ctx->vdev);
+	}
 	cm_fill_vdev_crypto_params(cm_ctx, req);
 	cm_store_wep_key(cm_ctx, &req->crypto, *cm_id);
 

+ 18 - 1
umac/mlme/include/wlan_mlme_cmn.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * 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
@@ -32,6 +32,7 @@
 
 /**
  * struct mlme_cm_ops: connection manager osif callbacks
+ * @mlme_cm_connect_active_notify_cb: Connect active notify callback
  * @mlme_cm_connect_complete_cb: Connect done callback
  * @vdev: vdev pointer
  * @rsp: connect response
@@ -105,6 +106,7 @@
  * @mlme_cm_perfd_reset_cpufreq_ctrl_cb: callback to reset CPU min freq
  */
 struct mlme_cm_ops {
+	void (*mlme_cm_connect_active_notify_cb)(uint8_t vdev_id);
 	QDF_STATUS (*mlme_cm_connect_complete_cb)(
 					struct wlan_objmgr_vdev *vdev,
 					struct wlan_cm_connect_resp *rsp);
@@ -734,6 +736,21 @@ QDF_STATUS mlme_cm_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
 QDF_STATUS mlme_cm_connect_req(struct wlan_objmgr_vdev *vdev,
 			       struct wlan_cm_vdev_connect_req *req);
 
+#ifdef CONN_MGR_ADV_FEATURE
+/**
+ * mlme_cm_osif_connect_active_notify() - CNX manager ext connect active
+ * notification.
+ * @vdev_id: VDEV ID
+ *
+ * Return: void
+ */
+void mlme_cm_osif_connect_active_notify(uint8_t vdev_id);
+#else
+static inline void mlme_cm_osif_connect_active_notify(uint8_t vdev_id)
+{
+}
+#endif
+
 /**
  * mlme_cm_connect_complete_ind() - Connection manager ext connect complete
  * indication

+ 9 - 1
umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
- * 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
@@ -409,6 +409,14 @@ QDF_STATUS mlme_cm_reassoc_req(struct wlan_objmgr_vdev *vdev,
 	return ret;
 }
 
+#ifdef CONN_MGR_ADV_FEATURE
+void mlme_cm_osif_connect_active_notify(uint8_t vdev_id)
+{
+	if (glbl_cm_ops && glbl_cm_ops->mlme_cm_connect_active_notify_cb)
+		glbl_cm_ops->mlme_cm_connect_active_notify_cb(vdev_id);
+}
+#endif
+
 QDF_STATUS mlme_cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 					struct wlan_cm_connect_resp *rsp)
 {