xref: /wlan-driver/qcacld-3.0/core/wma/src/wma_fips_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef __WMA_FIPS_API_H
20 #define __WMA_FIPS_API_H
21 
22 #include "wma_api.h"
23 #include "wmi_unified_api.h"
24 #include "wma_fips_public_structs.h"
25 
26 #ifdef WLAN_FEATURE_FIPS
27 /**
28  * wma_fips_request() - Perform a FIPS certification operation
29  * @handle: WMA handle of the object being certified
30  * @param: The FIPS certification parameters
31  * @callback: Callback function to invoke with the results
32  * @context: Opaque context to pass back to caller in the callback
33  *
34  * Return: QDF_STATUS_SUCCESS if the request is successfully sent
35  * to firmware for processing, otherwise an error status.
36  */
37 QDF_STATUS wma_fips_request(WMA_HANDLE handle,
38 			    struct fips_params *param,
39 			    wma_fips_cb callback,
40 			    void *context);
41 
42 /**
43  * wma_fips_register_event_handlers() - Register FIPS event handlers
44  * @handle: WMA handle of the object being initialized
45  *
46  * This function registers all WMI event handlers required by the FIPS
47  * feature.
48  *
49  * Return: QDF_STATUS_SUCCESS upon success, otherwise an error
50  */
51 QDF_STATUS wma_fips_register_event_handlers(WMA_HANDLE handle);
52 
53 #else /* WLAN_FEATURE_FIPS */
54 
55 static inline
wma_fips_request(WMA_HANDLE handle,const struct fips_params * param,wma_fips_cb callback,void * context)56 QDF_STATUS wma_fips_request(WMA_HANDLE handle,
57 			    const struct fips_params *param,
58 			    wma_fips_cb callback,
59 			    void *context)
60 {
61 	return QDF_STATUS_E_NOSUPPORT;
62 }
63 
64 static inline
wma_fips_register_event_handlers(WMA_HANDLE wma_handle)65 QDF_STATUS wma_fips_register_event_handlers(WMA_HANDLE wma_handle)
66 {
67 	return QDF_STATUS_SUCCESS;
68 }
69 
70 #endif /* WLAN_FEATURE_FIPS */
71 
72 #endif /* __WMA_FIPS_API_H */
73