xref: /wlan-driver/qcacld-3.0/components/disa/core/inc/wlan_disa_main.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 /**
20  * DOC: declare various api which shall be used by
21  * DISA user configuration and target interface
22  */
23 
24 #ifndef _WLAN_DISA_MAIN_H_
25 #define _WLAN_DISA_MAIN_H_
26 
27 #include "wlan_disa_public_struct.h"
28 #include "wlan_disa_obj_mgmt_public_struct.h"
29 #include "wlan_disa_priv.h"
30 #include "wlan_disa_objmgr.h"
31 
32 #define disa_fatal(params...) \
33 	QDF_TRACE_FATAL(QDF_MODULE_ID_DISA, params)
34 #define disa_err(params...) \
35 	QDF_TRACE_ERROR(QDF_MODULE_ID_DISA, params)
36 #define disa_warn(params...) \
37 	QDF_TRACE_ERROR(QDF_MODULE_ID_DISA, params)
38 #define disa_info(params...) \
39 	QDF_TRACE_INFO(QDF_MODULE_ID_DISA, params)
40 #define disa_debug(params...) \
41 	QDF_TRACE_DEBUG(QDF_MODULE_ID_DISA, params)
42 
43 #define disa_nofl_fatal(params...) \
44 	QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_DISA, params)
45 #define disa_nofl_err(params...) \
46 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_DISA, params)
47 #define disa_nofl_warn(params...) \
48 	QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_DISA, params)
49 #define disa_nofl_info(params...) \
50 	QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_DISA, params)
51 #define disa_nofl_debug(params...) \
52 	QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_DISA, params)
53 
54 #define DISA_ENTER() \
55 	QDF_TRACE_ENTER(QDF_MODULE_ID_DISA, "enter")
56 #define DISA_EXIT() \
57 	QDF_TRACE_EXIT(QDF_MODULE_ID_DISA, "exit")
58 
59 /**
60  * disa_allocate_ctx() - Api to allocate disa ctx
61  *
62  * Helper function to allocate disa ctx
63  *
64  * Return: Success or failure.
65  */
66 QDF_STATUS disa_allocate_ctx(void);
67 
68 /**
69  * disa_free_ctx() - to free disa context
70  *
71  * Helper function to free disa context
72  *
73  * Return: None.
74  */
75 void disa_free_ctx(void);
76 
77 /**
78  * disa_get_context() - to get disa context
79  *
80  * Helper function to get disa context
81  *
82  * Return: disa context.
83  */
84 struct wlan_disa_ctx *disa_get_context(void);
85 
86 /**
87  * disa_core_encrypt_decrypt_req() - Form encrypt/decrypt request
88  * @psoc: objmgr psoc object
89  * @req: DISA encrypt/decrypt request parameters
90  * @cb: Response callback for the encrypt/decrypt request
91  * @cookie: Cookie to pass to the response callback
92  *
93  * Return: QDF status success or failure
94  */
95 QDF_STATUS disa_core_encrypt_decrypt_req(struct wlan_objmgr_psoc *psoc,
96 		struct disa_encrypt_decrypt_req_params *req,
97 		encrypt_decrypt_resp_callback cb,
98 		void *cookie);
99 
100 #endif /* end  of _WLAN_DISA_MAIN_H_ */
101