xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/ssv6xxx/smac/sec_wpi.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (c) 2015 South Silicon Valley Microelectronics Inc.
3  * Copyright (c) 2015 iComm Corporation
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef WAPI_WPI_H
18 #define WAPI_WPI_H
19 #define WAPI_KEYID_LEN 1
20 #define WAPI_RESERVD_LEN 1
21 #define WAPI_PN_LEN 16
22 #define WAPI_IV_LEN (WAPI_KEYID_LEN + WAPI_RESERVD_LEN + WAPI_PN_LEN)
23 #define WAPI_MIC_LEN 16
24 #define ADDID_LEN (ETH_ALEN + ETH_ALEN)
25 #define WAPI_IV_ICV_OFFSET (WAPI_IV_LEN + WAPI_MIC_LEN)
26 typedef enum {BFALSE = 0,
27               BTRUE = 1
28 } BOOL_T;
29 typedef enum {TV_TRUE = 1,
30               TV_FALSE = 2
31 } TRUTH_VALUE_T;
32 int lib80211_wpi_set_key(void *key, int len, u8 *seq, void *priv);
33 int lib80211_wpi_encrypt(struct sk_buff *mpdu, int hdr_len, void *priv);
34 int lib80211_wpi_decrypt(struct sk_buff *mpdu, int hdr_len, void *priv);
35 void *lib80211_wpi_init(int key_idx);
36 void lib80211_wpi_deinit(void *priv);
37 #ifdef MULTI_THREAD_ENCRYPT
38 int lib80211_wpi_encrypt_prepare(struct sk_buff *mpdu, int hdr_len, void *priv);
39 #endif
40 #endif
41