xref: /wlan-dirver/qca-wifi-host-cmn/os_if/linux/crypto/inc/wlan_nl_to_crypto_params.h (revision 8cfe6b10058a04cafb17eed051f2ddf11bee8931)
1 /*
2  * Copyright (c) 2019-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
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_nl_to_crypto_params.h
22  *
23  * Conversion of NL param type to Crypto param type APIs implementation
24  *
25  */
26 
27 /**
28  * osif_nl_to_crypto_auth_type() - populate auth type for crypto
29  * @auth_type: NL auth_type
30  *
31  * set the crypto auth type for corresponding auth type received
32  * from NL
33  *
34  * Return: crypto auth type
35  */
36 wlan_crypto_auth_mode
37 osif_nl_to_crypto_auth_type(enum nl80211_auth_type auth_type);
38 
39 /**
40  * osif_nl_to_crypto_akm_type() - populate akm type for crypto
41  * @key_mgmt: NL akm_type
42  *
43  * set the crypto akm type for corresponding akm type received
44  * from NL
45  *
46  * Return: crypto akm type
47  */
48 wlan_crypto_key_mgmt osif_nl_to_crypto_akm_type(u32 key_mgmt);
49 
50 /**
51  * osif_nl_to_crypto_cipher_type() - populate cipher type for crypto
52  * @cipher: NL cipher type
53  *
54  * set the crypto cipher type for corresponding cipher type received
55  * from NL.
56  *
57  * Return: crypto cipher type
58  */
59 enum wlan_crypto_cipher_type osif_nl_to_crypto_cipher_type(u32 cipher);
60 
61 /**
62  * osif_nl_to_crypto_cipher_len() - return the cipher length
63  * @cipher: NL cipher type
64  *
65  * Check the cipher type and return the corresponding length
66  *
67  * Return: crypto cipher length, negative value for failure
68  */
69 int osif_nl_to_crypto_cipher_len(u32 cipher);
70