xref: /wlan-driver/qca-wifi-host-cmn/umac/cmn_services/interface_mgr/inc/wlan_if_mgr_main.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /**
19  * DOC: contains Interface MGR init/deinit public api
20  */
21 
22 #ifndef _WLAN_IF_MGR_MAIN_API_H_
23 #define _WLAN_IF_MGR_MAIN_API_H_
24 
25 #ifdef WLAN_FEATURE_INTERFACE_MGR
26 
27 #include <qdf_atomic.h>
28 #include <wlan_objmgr_psoc_obj.h>
29 #include <wlan_objmgr_pdev_obj.h>
30 #include <wlan_objmgr_vdev_obj.h>
31 #include <wlan_if_mgr_public_struct.h>
32 
33 #define ifmgr_alert(params...) \
34 	QDF_TRACE_FATAL(QDF_MODULE_ID_IFMGR, params)
35 #define ifmgr_err(params...) \
36 	QDF_TRACE_ERROR(QDF_MODULE_ID_IFMGR, params)
37 #define ifmgr_warn(params...) \
38 	QDF_TRACE_WARN(QDF_MODULE_ID_IFMGR, params)
39 #define ifmgr_notice(params...) \
40 	QDF_TRACE_INFO(QDF_MODULE_ID_IFMGR, params)
41 #define ifmgr_info(params...) \
42 	QDF_TRACE_INFO(QDF_MODULE_ID_IFMGR, params)
43 #define ifmgr_debug(params...) \
44 	QDF_TRACE_DEBUG(QDF_MODULE_ID_IFMGR, params)
45 
46 /* Rate Limited Logs */
47 #define ifmgr_alert_rl(params...) \
48 	QDF_TRACE_FATAL_RL(QDF_MODULE_ID_IFMGR, params)
49 #define ifmgr_err_rl(params...) \
50 	QDF_TRACE_ERROR_RL(QDF_MODULE_ID_IFMGR, params)
51 #define ifmgr_warn_rl(params...) \
52 	QDF_TRACE_WARN_RL(QDF_MODULE_ID_IFMGR, params)
53 #define ifmgr_info_rl(params...) \
54 	QDF_TRACE_INFO_RL(QDF_MODULE_ID_IFMGR, params)
55 #define ifmgr_debug_rl(params...) \
56 	QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_IFMGR, params)
57 
58 #define ifmgr_nofl_alert(params...) \
59 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_IFMGR, params)
60 #define ifmgr_nofl_err(params...) \
61 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_IFMGR, params)
62 #define ifmgr_nofl_warn(params...) \
63 	QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_IFMGR, params)
64 #define ifmgr_nofl_info(params...) \
65 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_IFMGR, params)
66 #define ifmgr_nofl_debug(params...) \
67 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_IFMGR, params)
68 
69 #define ifmgr_hex_dump(level, data, buf_len) \
70 		qdf_trace_hex_dump(QDF_MODULE_ID_IFMGR, level, data, buf_len)
71 
72 /**
73  * wlan_if_mgr_init() - Interface manager module initialization API
74  *
75  * Return: QDF_STATUS
76  */
77 QDF_STATUS wlan_if_mgr_init(void);
78 
79 /**
80  * wlan_if_mgr_deinit() - interface manager module deinitialization API
81  *
82  * Return: QDF_STATUS
83  */
84 QDF_STATUS wlan_if_mgr_deinit(void);
85 
86 /**
87  * wlan_if_mgr_psoc_created_notification() - interface mgr psoc create handler
88  * @psoc: psoc object
89  * @arg_list: Argument list
90  *
91  * Return: QDF_STATUS
92  */
93 QDF_STATUS wlan_if_mgr_psoc_created_notification(struct wlan_objmgr_psoc *psoc,
94 						 void *arg_list);
95 
96 /**
97  * wlan_if_mgr_psoc_destroyed_notification() - scan psoc delete handler
98  * @psoc: psoc object
99  * @arg_list: Argument list
100  *
101  * Return: QDF_STATUS
102  */
103 QDF_STATUS wlan_if_mgr_psoc_destroyed_notification(struct wlan_objmgr_psoc *psoc,
104 						   void *arg_list);
105 #else
wlan_if_mgr_init(void)106 inline QDF_STATUS wlan_if_mgr_init(void)
107 {
108 	return QDF_STATUS_SUCCESS;
109 }
110 
wlan_if_mgr_deinit(void)111 QDF_STATUS wlan_if_mgr_deinit(void)
112 {
113 	return QDF_STATUS_SUCCESS;
114 }
115 #endif
116 #endif
117