xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/ssv6xxx/include/ssv6200.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 _SSV6200_H_
18 #define _SSV6200_H_
19 #include <linux/device.h>
20 #include <linux/interrupt.h>
21 #include <net/mac80211.h>
22 #ifdef ECLIPSE
23 #include <ssv_mod_conf.h>
24 #endif
25 #include <ssv6200_reg.h>
26 #include <ssv6200_aux.h>
27 #include <hwif/hwif.h>
28 #include <hci/ssv_hci.h>
29 #include "ssv6200_common.h"
30 #ifdef SSV6200_ECO
31 #define SSV6200_TOTAL_ID 128
32 #ifndef HUW_DRV
33 #define SSV6200_ID_TX_THRESHOLD 19
34 #define SSV6200_ID_RX_THRESHOLD 60
35 #define SSV6200_PAGE_TX_THRESHOLD 115
36 #define SSV6200_PAGE_RX_THRESHOLD 115
37 #define SSV6XXX_AMPDU_DIVIDER (2)
38 #define SSV6200_TX_LOWTHRESHOLD_PAGE_TRIGGER (SSV6200_PAGE_TX_THRESHOLD - (SSV6200_PAGE_TX_THRESHOLD/SSV6XXX_AMPDU_DIVIDER))
39 #define SSV6200_TX_LOWTHRESHOLD_ID_TRIGGER 2
40 #else
41 #undef SSV6200_ID_TX_THRESHOLD
42 #undef SSV6200_ID_RX_THRESHOLD
43 #undef SSV6200_PAGE_TX_THRESHOLD
44 #undef SSV6200_PAGE_RX_THRESHOLD
45 #undef SSV6200_TX_LOWTHRESHOLD_PAGE_TRIGGER
46 #undef SSV6200_TX_LOWTHRESHOLD_ID_TRIGGER
47 #define SSV6200_ID_TX_THRESHOLD 31
48 #define SSV6200_ID_RX_THRESHOLD 31
49 #define SSV6200_PAGE_TX_THRESHOLD 61
50 #define SSV6200_PAGE_RX_THRESHOLD 61
51 #define SSV6200_TX_LOWTHRESHOLD_PAGE_TRIGGER 45
52 #define SSV6200_TX_LOWTHRESHOLD_ID_TRIGGER 2
53 #endif
54 #else
55 #undef SSV6200_ID_TX_THRESHOLD
56 #undef SSV6200_ID_RX_THRESHOLD
57 #undef SSV6200_PAGE_TX_THRESHOLD
58 #undef SSV6200_PAGE_RX_THRESHOLD
59 #undef SSV6200_TX_LOWTHRESHOLD_PAGE_TRIGGER
60 #undef SSV6200_TX_LOWTHRESHOLD_ID_TRIGGER
61 #define SSV6200_ID_TX_THRESHOLD 63
62 #define SSV6200_ID_RX_THRESHOLD 63
63 #ifdef PREFER_RX
64 #define SSV6200_PAGE_TX_THRESHOLD (126-24)
65 #define SSV6200_PAGE_RX_THRESHOLD (126+24)
66 #else
67 #undef SSV6200_PAGE_TX_THRESHOLD
68 #undef SSV6200_PAGE_RX_THRESHOLD
69 #define SSV6200_PAGE_TX_THRESHOLD 126
70 #define SSV6200_PAGE_RX_THRESHOLD 126
71 #endif
72 #define SSV6200_TX_LOWTHRESHOLD_PAGE_TRIGGER (SSV6200_PAGE_TX_THRESHOLD/2)
73 #define SSV6200_TX_LOWTHRESHOLD_ID_TRIGGER 2
74 #endif
75 #define SSV6200_ID_NUMBER (128)
76 #define PACKET_ADDR_2_ID(addr) ((addr >> 16) & 0x7F)
77 #define SSV6200_ID_AC_RESERVED 1
78 #define SSV6200_ID_AC_BK_OUT_QUEUE 8
79 #define SSV6200_ID_AC_BE_OUT_QUEUE 15
80 #define SSV6200_ID_AC_VI_OUT_QUEUE 16
81 #define SSV6200_ID_AC_VO_OUT_QUEUE 16
82 #define SSV6200_ID_MANAGER_QUEUE 8
83 #define HW_MMU_PAGE_SHIFT 0x8
84 #define HW_MMU_PAGE_MASK 0xff
85 #define SSV6200_BT_PRI_SMP_TIME 0
86 #define SSV6200_BT_STA_SMP_TIME (SSV6200_BT_PRI_SMP_TIME+0)
87 #define SSV6200_WLAN_REMAIN_TIME 0
88 #define BT_2WIRE_EN_MSK 0x00000400
89 struct txResourceControl {
90     u32 txUsePage:8;
91     u32 txUseID:6;
92     u32 edca0:4;
93     u32 edca1:4;
94     u32 edca2:5;
95     u32 edca3:5;
96 };
97 #include <ssv_cfg.h>
98 #endif
99