xref: /wlan-dirver/qca-wifi-host-cmn/umac/cmn_services/crypto/inc/wlan_crypto_main.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2017-2018, 2021 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
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 /**
21  * DOC: Private API for crypto service with object manager handler
22  */
23 #ifndef _WLAN_CRYPTO_MAIN_H_
24 #define _WLAN_CRYPTO_MAIN_H_
25 #include "wlan_crypto_global_def.h"
26 
27 /**
28  * wlan_crypto_init() - Init the crypto service with object manager
29  *                      Called from umac init context.
30  *
31  * Return: QDF_STATUS_SUCCESS - in case of success
32  */
33 QDF_STATUS wlan_crypto_init(void);
34 
35 /**
36  * wlan_crypto_deinit() - Deinit the crypto service with object manager
37  *                        Called from umac deinit context.
38  *
39  * Return: QDF_STATUS_SUCCESS - in case of success
40  */
41 QDF_STATUS wlan_crypto_deinit(void);
42 
43 #ifdef CRYPTO_SET_KEY_CONVERGED
44 /**
45  * wlan_crypto_psoc_enable() - psoc enable API for wlan crypto component
46  * @psoc: pointer to PSOC
47  *
48  * Return: status of operation
49  */
50 QDF_STATUS wlan_crypto_psoc_enable(struct wlan_objmgr_psoc *psoc);
51 
52 /**
53  * wlan_crypto_psoc_disable() - psoc disable API for wlan crypto component
54  * @psoc: pointer to PSOC
55  *
56  * Return: status of operation
57  */
58 QDF_STATUS wlan_crypto_psoc_disable(struct wlan_objmgr_psoc *psoc);
59 #else
60 static inline QDF_STATUS wlan_crypto_psoc_enable(struct wlan_objmgr_psoc *psoc)
61 {
62 	return QDF_STATUS_SUCCESS;
63 }
64 
65 static inline QDF_STATUS wlan_crypto_psoc_disable(struct wlan_objmgr_psoc *psoc)
66 {
67 	return QDF_STATUS_SUCCESS;
68 }
69 #endif
70 
71 #endif /* end of _WLAN_CRYPTO_MAIN_H_ */
72