xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/ssv6xxx/smac/drv_comm.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 _DRV_COMM_H_
18 #define _DRV_COMM_H_
19 #define PHY_INFO_TBL1_SIZE 39
20 #define PHY_INFO_TBL2_SIZE 39
21 #define PHY_INFO_TBL3_SIZE 8
22 #define ampdu_fw_rate_info_status_no_use BIT(0)
23 #define ampdu_fw_rate_info_status_in_use BIT(1)
24 #define ampdu_fw_rate_info_status_reset BIT(2)
25 #define SSV_NUM_STA 8
26 #define SSV_NUM_VIF 2
27 #define SECURITY_KEY_LEN (32)
28 enum SSV_CIPHER_E {
29     SSV_CIPHER_NONE,
30     SSV_CIPHER_WEP40,
31     SSV_CIPHER_WEP104,
32     SSV_CIPHER_TKIP,
33     SSV_CIPHER_CCMP,
34     SSV_CIPHER_SMS4,
35     SSV_CIPHER_INVALID = (-1)
36 };
37 #define ME_NONE 0
38 #define ME_WEP40 1
39 #define ME_WEP104 2
40 #define ME_TKIP 3
41 #define ME_CCMP 4
42 #define ME_SMS4 5
43 struct ssv6xxx_hw_key {
44     u8 key[SECURITY_KEY_LEN];
45  u32 tx_pn_l;
46     u32 tx_pn_h;
47  u32 rx_pn_l;
48     u32 rx_pn_h;
49 }__attribute__((packed));
50 struct ssv6xxx_hw_sta_key {
51  u8 pair_key_idx:4;
52  u8 group_key_idx:4;
53     u8 valid;
54  u8 reserve[2];
55  struct ssv6xxx_hw_key pair;
56 }__attribute__((packed));
57 struct ssv6xxx_hw_sec {
58     struct ssv6xxx_hw_key group_key[3];
59     struct ssv6xxx_hw_sta_key sta_key[8];
60 }__attribute__((packed));
61 #endif
62