Преглед изворни кода

qcacld-3.0: Enable utf for connection manager

Add a logic to enable utf for connection manager.

Change-Id: Id8ac70c6437bb9d77cc374abbbeea17dab6f9e3a
CRs-Fixed: 2975701
Ashish Kumar Dhanotiya пре 3 година
родитељ
комит
89c41b9256

+ 17 - 2
Kbuild

@@ -1384,7 +1384,8 @@ UMAC_MLME_INC := -I$(WLAN_COMMON_INC)/umac/mlme \
 		-I$(WLAN_COMMON_INC)/umac/mlme/vdev_mgr/dispatcher/inc \
 		-I$(WLAN_COMMON_INC)/umac/mlme/pdev_mgr/dispatcher/inc \
 		-I$(WLAN_COMMON_INC)/umac/mlme/psoc_mgr/dispatcher/inc \
-		-I$(WLAN_COMMON_INC)/umac/mlme/connection_mgr/dispatcher/inc
+		-I$(WLAN_COMMON_INC)/umac/mlme/connection_mgr/dispatcher/inc \
+		-I$(WLAN_COMMON_INC)/umac/mlme/connection_mgr/utf/inc
 
 UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.o \
@@ -1409,6 +1410,10 @@ UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_
 		$(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/core/src/wlan_cm_util.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_ucfg_api.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_api.o
+ifeq ($(CONFIG_CM_UTF_ENABLE), y)
+UMAC_MLME_OBJS += $(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/utf/src/wlan_cm_utf_main.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/connection_mgr/utf/src/wlan_cm_utf_scan.o
+endif
 
 ifeq ($(CONFIG_QCACLD_WLAN_LFR3), y)
 # Add LFR3/FW roam specific connection manager files here
@@ -1426,7 +1431,7 @@ $(call add-wlan-objs,umac_mlme,$(UMAC_MLME_OBJS))
 ######## MLME ##############
 MLME_DIR := components/mlme
 MLME_INC := -I$(WLAN_ROOT)/$(MLME_DIR)/core/inc \
-		-I$(WLAN_ROOT)/$(MLME_DIR)/dispatcher/inc
+		-I$(WLAN_ROOT)/$(MLME_DIR)/dispatcher/inc \
 
 MLME_OBJS :=	$(MLME_DIR)/core/src/wlan_mlme_main.o \
 		$(MLME_DIR)/dispatcher/src/wlan_mlme_api.o \
@@ -1443,6 +1448,7 @@ CM_DIR := components/umac/mlme/connection_mgr
 CM_TGT_IF_DIR := components/target_if/connection_mgr
 
 CM_INC := -I$(WLAN_ROOT)/$(CM_DIR)/dispatcher/inc \
+		-I$(WLAN_ROOT)/$(CM_DIR)/utf/inc \
 		-I$(WLAN_ROOT)/$(CM_TGT_IF_DIR)/inc
 
 MLME_INC += $(CM_INC)
@@ -1455,6 +1461,10 @@ MLME_OBJS +=    $(CM_DIR)/dispatcher/src/wlan_cm_tgt_if_tx_api.o \
 		$(CM_DIR)/core/src/wlan_cm_vdev_connect.o \
 		$(CM_DIR)/core/src/wlan_cm_vdev_disconnect.o
 
+ifeq ($(CONFIG_CM_UTF_ENABLE), y)
+MLME_OBJS +=    $(CM_DIR)/utf/src/cm_utf.o
+endif
+
 ifeq ($(CONFIG_QCACLD_WLAN_LFR3), y)
 MLME_OBJS +=    $(CM_TGT_IF_DIR)/src/target_if_cm_roam_event.o \
 		$(CM_DIR)/core/src/wlan_cm_roam_fw_sync.o \
@@ -3030,6 +3040,11 @@ cppflags-$(CONFIG_WLAN_SYSFS_TDLS_PEERS) += -DWLAN_SYSFS_TDLS_PEERS
 cppflags-$(CONFIG_WLAN_SYSFS_RANGE_EXT) += -DWLAN_SYSFS_RANGE_EXT
 
 cppflags-$(CONFIG_QCACLD_WLAN_LFR2) += -DWLAN_FEATURE_PREAUTH_ENABLE
+
+ifeq ($(CONFIG_CM_UTF_ENABLE), y)
+cppflags-y += -DFEATURE_CM_UTF_ENABLE
+endif
+
 cppflags-y += -DCONN_MGR_ADV_FEATURE
 
 cppflags-$(CONFIG_QCACLD_WLAN_LFR3) += -DWLAN_FEATURE_ROAM_OFFLOAD

+ 4 - 0
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -33,6 +33,7 @@
 #include "target_if_wfa_testcmd.h"
 #include <../../core/src/wlan_cm_vdev_api.h>
 #include "csr_api.h"
+#include <cm_utf.h>
 
 static struct vdev_mlme_ops sta_mlme_ops;
 static struct vdev_mlme_ops ap_mlme_ops;
@@ -65,6 +66,9 @@ static struct mlme_ext_ops *mlme_get_global_ops(void)
 QDF_STATUS mlme_register_mlme_ext_ops(void)
 {
 	mlme_set_ops_register_cb(mlme_get_global_ops);
+
+	/* Overwrite with UTF cb if UTF enabled */
+	cm_utf_set_mlme_ops(mlme_get_global_ops());
 	return QDF_STATUS_SUCCESS;
 }
 

+ 53 - 0
components/umac/mlme/connection_mgr/utf/inc/cm_utf.h

@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: Implements CM UTF releted functionalities
+ */
+
+#ifndef WLAN_MLME_CM_UTF_H
+#define WLAN_MLME_CM_UTF_H
+
+#include <wlan_objmgr_vdev_obj.h>
+#include <include/wlan_mlme_cmn.h>
+
+#ifdef FEATURE_CM_UTF_ENABLE
+void cm_utf_set_mlme_ops(struct mlme_ext_ops *ext_ops);
+
+QDF_STATUS cm_utf_register_os_if_cb(void);
+
+void cm_utf_attach(struct wlan_objmgr_vdev *vdev);
+
+void cm_utf_detach(struct wlan_objmgr_vdev *vdev);
+#else
+static inline void cm_utf_set_mlme_ops(struct mlme_ext_ops *ext_ops)
+{
+}
+
+static inline QDF_STATUS cm_utf_register_os_if_cb(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline void cm_utf_attach(struct wlan_objmgr_vdev *vdev)
+{
+}
+
+static inline void cm_utf_detach(struct wlan_objmgr_vdev *vdev)
+{
+}
+#endif
+#endif //WLAN_MLME_CM_UTF_H

+ 59 - 0
components/umac/mlme/connection_mgr/utf/src/cm_utf.c

@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2021, The Linux Foundation. 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * DOC: Implements CM UTF
+ */
+
+#ifdef FEATURE_CM_UTF_ENABLE
+#include <cm_utf.h>
+#include <wlan_cm_utf.h>
+#include <include/wlan_mlme_cmn.h>
+
+void cm_utf_set_mlme_ops(struct mlme_ext_ops *ext_ops)
+{
+	ext_ops->mlme_cm_ext_connect_start_ind_cb = NULL;
+	ext_ops->mlme_cm_ext_bss_select_ind_cb = NULL;
+	ext_ops->mlme_cm_ext_bss_peer_create_req_cb =
+					wlan_cm_utf_bss_peer_create_req;
+	ext_ops->mlme_cm_ext_connect_req_cb = wlan_cm_utf_connect_req;
+	ext_ops->mlme_cm_ext_connect_complete_ind_cb = NULL;
+	ext_ops->mlme_cm_ext_disconnect_start_ind_cb = NULL;
+	ext_ops->mlme_cm_ext_disconnect_req_cb = wlan_cm_utf_disconnect_req;
+	ext_ops->mlme_cm_ext_bss_peer_delete_req_cb =
+					wlan_cm_utf_bss_peer_delete_req;
+	ext_ops->mlme_cm_ext_disconnect_complete_ind_cb = NULL;
+	ext_ops->mlme_cm_ext_vdev_down_req_cb = wlan_cm_utf_vdev_down;
+}
+
+QDF_STATUS cm_utf_register_os_if_cb(void)
+{
+	return osif_cm_utf_register_cb();
+}
+
+void cm_utf_attach(struct wlan_objmgr_vdev *vdev)
+{
+	if (QDF_IS_STATUS_ERROR(wlan_cm_utf_attach(vdev)))
+		mlme_err("utf attach failed");
+	else
+		mlme_debug("utf attach success");
+}
+
+void cm_utf_detach(struct wlan_objmgr_vdev *vdev)
+{
+	wlan_cm_utf_detach(vdev);
+}
+#endif

+ 8 - 1
core/hdd/src/wlan_hdd_assoc.c

@@ -83,6 +83,7 @@
 #include "wlan_cm_public_struct.h"
 #include "osif_cm_util.h"
 #include "wlan_hdd_cm_api.h"
+#include "cm_utf.h"
 
 #include "wlan_hdd_bootup_marker.h"
 #include "wlan_roam_debug.h"
@@ -2443,9 +2444,15 @@ struct osif_cm_ops osif_ops = {
 
 QDF_STATUS hdd_cm_register_cb(void)
 {
+	QDF_STATUS status;
 	osif_cm_set_legacy_cb(&osif_ops);
 
-	return osif_cm_register_cb();
+	status = osif_cm_register_cb();
+	if (QDF_IS_STATUS_ERROR(status))
+		return status;
+
+	/* Overwrite with UTF cb if UTF enabled */
+	return cm_utf_register_os_if_cb();
 }
 
 void hdd_cm_unregister_cb(void)

+ 4 - 0
core/sme/src/common/sme_api.c

@@ -75,6 +75,7 @@
 #include <../../core/src/wlan_cm_vdev_api.h>
 #include <wlan_mlme_twt_api.h>
 #include "wlan_cm_roam_ucfg_api.h"
+#include <cm_utf.h>
 
 static QDF_STATUS init_sme_cmd_list(struct mac_context *mac);
 
@@ -4651,6 +4652,7 @@ struct wlan_objmgr_vdev
 		return NULL;
 	}
 
+	cm_utf_attach(vdev);
 	MTRACE(qdf_trace(QDF_MODULE_ID_SME,
 			 TRACE_CODE_SME_RX_HDD_OPEN_SESSION,
 			 wlan_vdev_get_id(vdev), 0));
@@ -4733,6 +4735,8 @@ QDF_STATUS sme_vdev_delete(mac_handle_t mac_handle,
 		return status;
 	}
 
+	cm_utf_detach(vdev);
+
 	del_self_peer = qdf_mem_malloc(sizeof(*del_self_peer));
 	if (!del_self_peer)
 		return QDF_STATUS_E_NOMEM;