xref: /wlan-driver/qcacld-3.0/core/hdd/src/wlan_hdd_fips.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2024 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: wlan_hdd_fips.h
22  *
23  * WLAN Host Device Driver FIPS Certification Feature
24  */
25 
26 #ifndef __WLAN_HDD_FIPS_H__
27 #define __WLAN_HDD_FIPS_H__
28 
29 struct net_device;
30 struct iw_request_info;
31 union iwreq_data;
32 struct hdd_adapter;
33 void fips_test(struct hdd_adapter *adapter);
34 
35 #define FIPS_KEY_LEN 32
36 struct iw_fips_test_request {
37 	uint32_t operation;
38 	uint32_t mode;
39 	uint32_t key_len;
40 	uint8_t  key[FIPS_KEY_LEN];
41 	uint32_t data_len;
42 	uint8_t data[];
43 };
44 
45 struct iw_fips_test_response {
46 	uint32_t status;
47 	uint32_t data_len;
48 	uint8_t data[];
49 };
50 
51 
52 /**
53  * hdd_fips_test() - Perform FIPS test
54  * @dev: netdev upon which the FIPS test ioctl was received
55  * @info: ioctl request information
56  * @wrqu: ioctl request data structure
57  * @extra: extra payload for wireless extensions ioctl
58  *
59  * This API implements the FIPS test interface. Upon entry the @extra
60  * buffer will contain a FIPS test vector formatted as a &struct
61  * iw_fips_test_request. This vector will be sent to firmware where it
62  * will be run through the appropriate hardware. The result of the
63  * operation will be sent back to userspace via @extra encoded as a
64  * &struct iw_fips_test_response.
65  *
66  * Return: 0 if the test vector was processed, otherwise a negative
67  *         errno.
68  */
69 
70 int hdd_fips_test(struct net_device *dev,
71 		  struct iw_request_info *info,
72 		  union iwreq_data *wrqu, char *extra);
73 
74 #endif /* __WLAN_HDD_FIPS_H__ */
75