ソースを参照

qcacld-3.0: Add pre cac component

Add support for pre cac component.

Change-Id: I883febac103fc462fcd09f1534fda78c23b96466
CRs-Fixed: 3174505
Dundi Raviteja 3 年 前
コミット
e63bf7f295

+ 8 - 1
Kbuild

@@ -1669,8 +1669,14 @@ $(call add-wlan-objs,ftm_time_sync,$(FTM_TIME_SYNC_OBJS))
 
 ########## WLAN PRE_CAC ##########
 
+WLAN_PRE_CAC_DIR := components/pre_cac
+WLAN_PRE_CAC_INC := -I$(WLAN_ROOT)/$(WLAN_PRE_CAC_DIR)/dispatcher/inc
+
 ifeq ($(CONFIG_FEATURE_WLAN_PRE_CAC), y)
-WLAN_PRE_CAC_OBJS := $(HDD_SRC_DIR)/wlan_hdd_pre_cac.o
+WLAN_PRE_CAC_OBJS := $(HDD_SRC_DIR)/wlan_hdd_pre_cac.o \
+		$(WLAN_PRE_CAC_DIR)/core/src/wlan_pre_cac_main.o \
+		$(WLAN_PRE_CAC_DIR)/dispatcher/src/wlan_pre_cac_ucfg_api.o \
+		$(WLAN_PRE_CAC_DIR)/dispatcher/src/wlan_pre_cac_api.o
 endif
 
 $(call add-wlan-objs,wlan_pre_cac,$(WLAN_PRE_CAC_OBJS))
@@ -3001,6 +3007,7 @@ INCS +=		$(DISA_INC)
 INCS +=		$(ACTION_OUI_INC)
 INCS +=		$(PKT_CAPTURE_INC)
 INCS +=		$(FTM_TIME_SYNC_INC)
+INCS +=		$(WLAN_PRE_CAC_INC)
 
 INCS +=		$(UMAC_DISP_INC)
 INCS +=		$(UMAC_SCAN_INC)

+ 243 - 0
components/pre_cac/core/src/wlan_pre_cac_main.c

@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2022, 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
+ * 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: Implement various notification handlers which are accessed
+ * internally in pre_cac component only.
+ */
+
+#include "wlan_pre_cac_main.h"
+#include "wlan_objmgr_global_obj.h"
+
+struct pre_cac_vdev_priv *
+pre_cac_vdev_get_priv_fl(struct wlan_objmgr_vdev *vdev,
+			 const char *func, uint32_t line)
+{
+	struct pre_cac_vdev_priv *vdev_priv;
+
+	vdev_priv = wlan_objmgr_vdev_get_comp_private_obj(vdev,
+							WLAN_UMAC_COMP_PRE_CAC);
+	if (!vdev_priv) {
+		pre_cac_nofl_err("%s:%u: vdev id: %d, vdev_priv is NULL",
+				 func, line, wlan_vdev_get_id(vdev));
+	}
+
+	return vdev_priv;
+}
+
+struct pre_cac_psoc_priv *
+pre_cac_psoc_get_priv_fl(struct wlan_objmgr_psoc *psoc,
+			 const char *func, uint32_t line)
+{
+	struct pre_cac_psoc_priv *psoc_priv;
+
+	psoc_priv = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+					WLAN_UMAC_COMP_PRE_CAC);
+	if (!psoc_priv)
+		pre_cac_nofl_err("%s:%u: psoc_priv is NULL", func, line);
+
+	return psoc_priv;
+}
+
+QDF_STATUS
+pre_cac_vdev_create_notification(struct wlan_objmgr_vdev *vdev, void *arg)
+{
+	struct pre_cac_vdev_priv *vdev_priv;
+	QDF_STATUS status;
+
+	vdev_priv = qdf_mem_malloc(sizeof(*vdev_priv));
+	if (!vdev_priv) {
+		status = QDF_STATUS_E_NOMEM;
+		goto exit;
+	}
+
+	status = wlan_objmgr_vdev_component_obj_attach(
+				vdev, WLAN_UMAC_COMP_PRE_CAC,
+				(void *)vdev_priv, QDF_STATUS_SUCCESS);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to attach priv with vdev");
+		goto free_vdev_priv;
+	}
+
+	goto exit;
+
+free_vdev_priv:
+	qdf_mem_free(vdev_priv);
+	status = QDF_STATUS_E_INVAL;
+exit:
+	return status;
+}
+
+QDF_STATUS
+pre_cac_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg)
+{
+	struct pre_cac_vdev_priv *vdev_priv = NULL;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+	vdev_priv = pre_cac_vdev_get_priv(vdev);
+	if (!vdev_priv) {
+		pre_cac_err("vdev priv is NULL");
+		goto exit;
+	}
+
+	status = wlan_objmgr_vdev_component_obj_detach(
+					vdev, WLAN_UMAC_COMP_PRE_CAC,
+					(void *)vdev_priv);
+	if (QDF_IS_STATUS_ERROR(status))
+		pre_cac_err("Failed to detach priv with vdev");
+
+	qdf_mem_free(vdev_priv);
+	vdev_priv = NULL;
+
+exit:
+	return status;
+}
+
+QDF_STATUS
+pre_cac_psoc_create_notification(struct wlan_objmgr_psoc *psoc, void *arg)
+{
+	struct pre_cac_psoc_priv *psoc_priv;
+	QDF_STATUS status;
+
+	psoc_priv = qdf_mem_malloc(sizeof(*psoc_priv));
+	if (!psoc_priv)
+		return QDF_STATUS_E_NOMEM;
+
+	status = wlan_objmgr_psoc_component_obj_attach(psoc,
+				WLAN_UMAC_COMP_PRE_CAC,
+				psoc_priv, QDF_STATUS_SUCCESS);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to attach psoc component obj");
+		goto free_psoc_priv;
+	}
+
+	return status;
+
+free_psoc_priv:
+	qdf_mem_free(psoc_priv);
+	return status;
+}
+
+QDF_STATUS
+pre_cac_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc, void *arg)
+{
+	struct pre_cac_psoc_priv *psoc_priv;
+	QDF_STATUS status;
+
+	psoc_priv = pre_cac_psoc_get_priv(psoc);
+	if (!psoc_priv) {
+		pre_cac_err("psoc priv is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = wlan_objmgr_psoc_component_obj_detach(psoc,
+					WLAN_UMAC_COMP_PRE_CAC,
+					psoc_priv);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to detach psoc component obj");
+		return status;
+	}
+
+	qdf_mem_free(psoc_priv);
+	return status;
+}
+
+QDF_STATUS pre_cac_init(void)
+{
+	QDF_STATUS status;
+
+	status = wlan_objmgr_register_psoc_create_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_psoc_create_notification,
+				NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to register psoc create handler");
+		return status;
+	}
+
+	status = wlan_objmgr_register_psoc_destroy_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_psoc_destroy_notification,
+				NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to register psoc delete handler");
+		goto fail_destroy_psoc;
+	}
+
+	status = wlan_objmgr_register_vdev_create_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_vdev_create_notification, NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to register vdev create handler");
+		goto fail_create_vdev;
+	}
+
+	status = wlan_objmgr_register_vdev_destroy_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_vdev_destroy_notification, NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		pre_cac_err("Failed to register vdev destroy handler");
+		goto fail_destroy_vdev;
+	}
+	return status;
+
+fail_destroy_vdev:
+	wlan_objmgr_unregister_vdev_create_handler(WLAN_UMAC_COMP_PRE_CAC,
+		pre_cac_vdev_create_notification, NULL);
+
+fail_create_vdev:
+	wlan_objmgr_unregister_psoc_destroy_handler(WLAN_UMAC_COMP_PRE_CAC,
+		pre_cac_psoc_destroy_notification, NULL);
+
+fail_destroy_psoc:
+	wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_PRE_CAC,
+		pre_cac_psoc_create_notification, NULL);
+
+	return status;
+}
+
+void pre_cac_deinit(void)
+{
+	QDF_STATUS status;
+
+	status = wlan_objmgr_unregister_vdev_destroy_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_vdev_destroy_notification,
+				NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		pre_cac_err("Failed to unregister vdev destroy handler");
+
+	status = wlan_objmgr_unregister_vdev_create_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_vdev_create_notification, NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		pre_cac_err("Failed to unregister vdev create handler");
+
+	status = wlan_objmgr_unregister_psoc_destroy_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_psoc_destroy_notification,
+				NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		pre_cac_err("Failed to unregister psoc destroy handler");
+
+	status = wlan_objmgr_unregister_psoc_create_handler(
+				WLAN_UMAC_COMP_PRE_CAC,
+				pre_cac_psoc_create_notification,
+				NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		pre_cac_err("Failed to unregister psoc create handler");
+}

+ 174 - 0
components/pre_cac/core/src/wlan_pre_cac_main.h

@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2022, 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
+ * 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: Declare private API which shall be used internally only
+ * in pre_cac component. This file shall include prototypes of
+ * various notification handlers and logging functions.
+ *
+ * Note: This API should be never accessed out of pre_cac component.
+ */
+
+#ifndef _WLAN_PRE_CAC_MAIN_H_
+#define _WLAN_PRE_CAC_MAIN_H_
+
+#include <qdf_types.h>
+#include "wlan_objmgr_vdev_obj.h"
+
+#define pre_cac_log(level, args...) \
+	QDF_TRACE(QDF_MODULE_ID_WLAN_PRE_CAC, level, ## args)
+
+#define pre_cac_logfl(level, format, args...) \
+	pre_cac_log(level, FL(format), ## args)
+
+#define pre_cac_fatal(format, args...) \
+		      pre_cac_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args)
+#define pre_cac_err(format, args...) \
+		    pre_cac_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args)
+#define pre_cac_warn(format, args...) \
+		     pre_cac_logfl(QDF_TRACE_LEVEL_WARN, format, ## args)
+#define pre_cac_info(format, args...) \
+		     pre_cac_logfl(QDF_TRACE_LEVEL_INFO, format, ## args)
+#define pre_cac_debug(format, args...) \
+		      pre_cac_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args)
+
+#define pre_cac_nofl_err(format, args...) \
+	pre_cac_log(QDF_TRACE_LEVEL_ERROR, format, ## args)
+#define pre_cac_nofl_warn(format, args...) \
+		     pre_cac_log(QDF_TRACE_LEVEL_WARN, format, ## args)
+#define pre_cac_nofl_info(format, args...) \
+		     pre_cac_log(QDF_TRACE_LEVEL_INFO, format, ## args)
+#define pre_cac_nofl_debug(format, args...) \
+		      pre_cac_log(QDF_TRACE_LEVEL_DEBUG, format, ## args)
+
+#define PRE_CAC_ENTER() pre_cac_debug("enter")
+#define PRE_CAC_EXIT() pre_cac_debug("exit")
+
+/**
+ * struct pre_cac_vdev_priv - Private object to be stored in vdev
+ * @is_pre_cac_on: status of pre_cac
+ */
+struct pre_cac_vdev_priv {
+	bool is_pre_cac_on;
+};
+
+/**
+ * struct pre_cac_psoc_priv - Private object to be stored in psoc
+ * @pre_cac_work: pre cac work handler
+ */
+struct pre_cac_psoc_priv {
+	qdf_work_t pre_cac_work;
+};
+
+/**
+ * pre_cac_vdev_create_notification(): Handler for vdev create notify.
+ * @vdev: vdev which is going to be created by objmgr
+ * @arg: argument for notification handler.
+ *
+ * Allocate and attach vdev private object.
+ *
+ * Return: QDF_STATUS status in case of success else return error.
+ */
+QDF_STATUS pre_cac_vdev_create_notification(struct wlan_objmgr_vdev *vdev,
+					    void *arg);
+
+/**
+ * pre_cac_vdev_destroy_notification(): Handler for vdev destroy notify.
+ * @vdev: vdev which is going to be destroyed by objmgr
+ * @arg: argument for notification handler.
+ *
+ * Deallocate and detach vdev private object.
+ *
+ * Return QDF_STATUS status in case of success else return error
+ */
+QDF_STATUS
+pre_cac_vdev_destroy_notification(struct wlan_objmgr_vdev *vdev,
+				  void *arg);
+
+/**
+ * pre_cac_psoc_create_notification() - Handler for psoc create notify.
+ * @psoc: psoc which is going to be created by objmgr
+ * @arg: argument for notification handler.
+ *
+ * Allocate and attach psoc private object.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+pre_cac_psoc_create_notification(struct wlan_objmgr_psoc *psoc, void *arg);
+
+/**
+ * pre_cac_psoc_destroy_notification() - Handler for psoc destroy notify.
+ * @psoc: psoc which is going to be destroyed by objmgr
+ * @arg: argument for notification handler.
+ *
+ * Deallocate and detach psoc private object.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+pre_cac_psoc_destroy_notification(struct wlan_objmgr_psoc *psoc, void *arg);
+
+struct pre_cac_vdev_priv *
+pre_cac_vdev_get_priv_fl(struct wlan_objmgr_vdev *vdev,
+			 const char *func, uint32_t line);
+
+/**
+ * pre_cac_vdev_get_priv_fl(): Wrapper to retrieve vdev priv obj
+ * @vdev: vdev pointer
+ *
+ * Wrapper for pre_cac to get vdev private object pointer.
+ *
+ * Return: Private object of vdev
+ */
+#define pre_cac_vdev_get_priv(vdev) \
+			      pre_cac_vdev_get_priv_fl(vdev, __func__, __LINE__)
+
+struct pre_cac_psoc_priv *
+pre_cac_psoc_get_priv_fl(struct wlan_objmgr_psoc *psoc,
+			 const char *func, uint32_t line);
+
+/**
+ * pre_cac_psoc_get_priv_fl(): Wrapper to retrieve psoc priv obj
+ * @psoc: psoc pointer
+ *
+ * Wrapper for pre_cac to get psoc private object pointer.
+ *
+ * Return: pre_cac psoc private object
+ */
+#define pre_cac_psoc_get_priv(vdev) \
+			      pre_cac_psoc_get_priv_fl(vdev, __func__, __LINE__)
+
+/**
+ * pre_cac_init() - pre cac component initialization.
+ *
+ * This function initializes the pre cac component and registers
+ * the handlers which are invoked on vdev creation.
+ *
+ * Return: For successful registration - QDF_STATUS_SUCCESS,
+ *         else QDF_STATUS error codes.
+ */
+QDF_STATUS pre_cac_init(void);
+
+/**
+ * pre_cac_deinit() - pre cac component deinit.
+ *
+ * This function deinits pre cac component.
+ *
+ * Return: None
+ */
+void pre_cac_deinit(void);
+#endif /* end of _WLAN_PRE_CAC_MAIN_H_ */

+ 24 - 0
components/pre_cac/dispatcher/inc/wlan_pre_cac_api.h

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2022, 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
+ * 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: Public API declarations of pre cac called from SAP module
+ */
+
+#ifndef _WLAN_PRE_CAC_API_H_
+#define _WLAN_PRE_CAC_API_H_
+
+#endif /* _WLAN_PRE_CAC_API_H_ */

+ 61 - 0
components/pre_cac/dispatcher/inc/wlan_pre_cac_ucfg_api.h

@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2022, 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
+ * 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: Declare public API related to the pre_cac called by north bound
+ * HDD/OSIF/LIM
+ */
+
+#ifndef _WLAN_PRE_CAC_UCFG_API_H_
+#define _WLAN_PRE_CAC_UCFG_API_H_
+
+#include <qdf_status.h>
+#include <qdf_types.h>
+
+#ifdef PRE_CAC_SUPPORT
+/**
+ * ucfg_pre_cac_init() - pre cac component initialization.
+ *
+ * This function initializes the pre cac component and registers
+ * the handlers which are invoked on vdev creation.
+ *
+ * Return: For successful registration - QDF_STATUS_SUCCESS,
+ *         else QDF_STATUS error codes.
+ */
+QDF_STATUS ucfg_pre_cac_init(void);
+
+/**
+ * ucfg_pre_cac_deinit() - pre cac component deinit.
+ *
+ * This function deinits pre cac component.
+ *
+ * Return: None
+ */
+void ucfg_pre_cac_deinit(void);
+#else
+static inline
+QDF_STATUS ucfg_pre_cac_init(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline
+void ucfg_pre_cac_deinit(void)
+{
+}
+#endif /* PRE_CAC_SUPPORT */
+#endif /* _WLAN_PRE_CAC_UCFG_API_H_ */
+

+ 19 - 0
components/pre_cac/dispatcher/src/wlan_pre_cac_api.c

@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2022, 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
+ * 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: Public API implementation of pre cac called from SAP module
+ */

+ 32 - 0
components/pre_cac/dispatcher/src/wlan_pre_cac_ucfg_api.c

@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2022, 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
+ * 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: Public API implementation of pre cac called by north bound iface.
+ */
+
+#include "../../core/src/wlan_pre_cac_main.h"
+#include "wlan_pre_cac_ucfg_api.h"
+
+QDF_STATUS ucfg_pre_cac_init(void)
+{
+	return pre_cac_init();
+}
+
+void ucfg_pre_cac_deinit(void)
+{
+	pre_cac_deinit();
+}

+ 9 - 0
core/hdd/src/wlan_hdd_main.c

@@ -184,6 +184,7 @@
 #include <wlan_hdd_debugfs_config.h>
 #include "wlan_dlm_ucfg_api.h"
 #include "ftm_time_sync_ucfg_api.h"
+#include "wlan_pre_cac_ucfg_api.h"
 #include "ol_txrx.h"
 #include "wlan_hdd_sta_info.h"
 #include "mac_init_api.h"
@@ -420,6 +421,7 @@ static const struct category_info cinfo[MAX_SUPPORTED_CATEGORY] = {
 	[QDF_MODULE_ID_MLO] = {QDF_TRACE_LEVEL_ALL},
 	[QDF_MODULE_ID_SON] = {QDF_TRACE_LEVEL_ALL},
 	[QDF_MODULE_ID_TWT] = {QDF_TRACE_LEVEL_ALL},
+	[QDF_MODULE_ID_WLAN_PRE_CAC] = {QDF_TRACE_LEVEL_ALL},
 };
 
 struct notifier_block hdd_netdev_notifier;
@@ -17970,8 +17972,14 @@ static QDF_STATUS hdd_component_init(void)
 	if (QDF_IS_STATUS_ERROR(status))
 		goto pkt_capture_deinit;
 
+	status = ucfg_pre_cac_init();
+	if (QDF_IS_STATUS_ERROR(status))
+		goto pre_cac_deinit;
+
 	return QDF_STATUS_SUCCESS;
 
+pre_cac_deinit:
+	ucfg_pre_cac_deinit();
 pkt_capture_deinit:
 	ucfg_pkt_capture_deinit();
 dlm_deinit:
@@ -18018,6 +18026,7 @@ mlme_global_deinit:
 static void hdd_component_deinit(void)
 {
 	/* deinitialize non-converged components */
+	ucfg_pre_cac_deinit();
 	ucfg_ftm_time_sync_deinit();
 	ucfg_pkt_capture_deinit();
 	ucfg_dlm_deinit();