WiFi: add rtl8189es/etv support, Optimization wifi configuration.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8189es / hal / OUTSRC-BTCoexist / HalBtc8821a2Ant.h
1 //===========================================\r
2 // The following is for 8821A 2Ant BT Co-exist definition\r
3 //===========================================\r
4 #define BT_INFO_8821A_2ANT_B_FTP                                                BIT7\r
5 #define BT_INFO_8821A_2ANT_B_A2DP                                       BIT6\r
6 #define BT_INFO_8821A_2ANT_B_HID                                                BIT5\r
7 #define BT_INFO_8821A_2ANT_B_SCO_BUSY                           BIT4\r
8 #define BT_INFO_8821A_2ANT_B_ACL_BUSY                           BIT3\r
9 #define BT_INFO_8821A_2ANT_B_INQ_PAGE                           BIT2\r
10 #define BT_INFO_8821A_2ANT_B_SCO_ESCO                           BIT1\r
11 #define BT_INFO_8821A_2ANT_B_CONNECTION                         BIT0\r
12 \r
13 #define         BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT             2\r
14 \r
15 typedef enum _BT_INFO_SRC_8821A_2ANT{\r
16         BT_INFO_SRC_8821A_2ANT_WIFI_FW                  = 0x0,\r
17         BT_INFO_SRC_8821A_2ANT_BT_RSP                           = 0x1,\r
18         BT_INFO_SRC_8821A_2ANT_BT_ACTIVE_SEND           = 0x2,\r
19         BT_INFO_SRC_8821A_2ANT_MAX\r
20 }BT_INFO_SRC_8821A_2ANT,*PBT_INFO_SRC_8821A_2ANT;\r
21 \r
22 typedef enum _BT_8821A_2ANT_BT_STATUS{\r
23         BT_8821A_2ANT_BT_STATUS_IDLE                            = 0x0,\r
24         BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE  = 0x1,\r
25         BT_8821A_2ANT_BT_STATUS_NON_IDLE                        = 0x2,\r
26         BT_8821A_2ANT_BT_STATUS_MAX\r
27 }BT_8821A_2ANT_BT_STATUS,*PBT_8821A_2ANT_BT_STATUS;\r
28 \r
29 typedef enum _BT_8821A_2ANT_COEX_ALGO{\r
30         BT_8821A_2ANT_COEX_ALGO_UNDEFINED                       = 0x0,\r
31         BT_8821A_2ANT_COEX_ALGO_SCO                             = 0x1,\r
32         BT_8821A_2ANT_COEX_ALGO_HID                             = 0x2,\r
33         BT_8821A_2ANT_COEX_ALGO_A2DP                            = 0x3,\r
34         BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS              = 0x4,\r
35         BT_8821A_2ANT_COEX_ALGO_PANEDR                  = 0x5,\r
36         BT_8821A_2ANT_COEX_ALGO_PANHS                   = 0x6,\r
37         BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP             = 0x7,\r
38         BT_8821A_2ANT_COEX_ALGO_PANEDR_HID              = 0x8,\r
39         BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,\r
40         BT_8821A_2ANT_COEX_ALGO_HID_A2DP                        = 0xa,\r
41         BT_8821A_2ANT_COEX_ALGO_MAX                             = 0xb,\r
42 }BT_8821A_2ANT_COEX_ALGO,*PBT_8821A_2ANT_COEX_ALGO;\r
43 \r
44 typedef struct _COEX_DM_8821A_2ANT{\r
45         // fw mechanism\r
46         BOOLEAN         bPreDecBtPwr;\r
47         BOOLEAN         bCurDecBtPwr;\r
48         BOOLEAN         bPreBtLnaConstrain;\r
49         BOOLEAN         bCurBtLnaConstrain;\r
50         u1Byte          bPreBtPsdMode;\r
51         u1Byte          bCurBtPsdMode;\r
52         u1Byte          preFwDacSwingLvl;\r
53         u1Byte          curFwDacSwingLvl;\r
54         BOOLEAN         bCurIgnoreWlanAct;\r
55         BOOLEAN         bPreIgnoreWlanAct;\r
56         u1Byte          prePsTdma;\r
57         u1Byte          curPsTdma;\r
58         u1Byte          psTdmaPara[5];\r
59         u1Byte          psTdmaDuAdjType;\r
60         BOOLEAN         bResetTdmaAdjust;\r
61         BOOLEAN         bPrePsTdmaOn;\r
62         BOOLEAN         bCurPsTdmaOn;\r
63         BOOLEAN         bPreBtAutoReport;\r
64         BOOLEAN         bCurBtAutoReport;\r
65 \r
66         // sw mechanism\r
67         BOOLEAN         bPreRfRxLpfShrink;\r
68         BOOLEAN         bCurRfRxLpfShrink;\r
69         u4Byte          btRf0x1eBackup;\r
70         BOOLEAN         bPreLowPenaltyRa;\r
71         BOOLEAN         bCurLowPenaltyRa;\r
72         BOOLEAN         bPreDacSwingOn;\r
73         u4Byte          preDacSwingLvl;\r
74         BOOLEAN         bCurDacSwingOn;\r
75         u4Byte          curDacSwingLvl;\r
76         BOOLEAN         bPreAdcBackOff;\r
77         BOOLEAN         bCurAdcBackOff;\r
78         BOOLEAN         bPreAgcTableEn;\r
79         BOOLEAN         bCurAgcTableEn;\r
80         u4Byte          preVal0x6c0;\r
81         u4Byte          curVal0x6c0;\r
82         u4Byte          preVal0x6c4;\r
83         u4Byte          curVal0x6c4;\r
84         u4Byte          preVal0x6c8;\r
85         u4Byte          curVal0x6c8;\r
86         u1Byte          preVal0x6cc;\r
87         u1Byte          curVal0x6cc;\r
88         BOOLEAN         bLimitedDig;\r
89 \r
90         // algorithm related\r
91         u1Byte          preAlgorithm;\r
92         u1Byte          curAlgorithm;\r
93         u1Byte          btStatus;\r
94         u1Byte          wifiChnlInfo[3];\r
95 } COEX_DM_8821A_2ANT, *PCOEX_DM_8821A_2ANT;\r
96 \r
97 typedef struct _COEX_STA_8821A_2ANT{\r
98         BOOLEAN                                 bBtLinkExist;\r
99         BOOLEAN                                 bScoExist;\r
100         BOOLEAN                                 bA2dpExist;\r
101         BOOLEAN                                 bHidExist;\r
102         BOOLEAN                                 bPanExist;\r
103 \r
104         BOOLEAN                                 bUnderLps;\r
105         BOOLEAN                                 bUnderIps;\r
106         u4Byte                                  highPriorityTx;\r
107         u4Byte                                  highPriorityRx;\r
108         u4Byte                                  lowPriorityTx;\r
109         u4Byte                                  lowPriorityRx;\r
110         u1Byte                                  btRssi;\r
111         u1Byte                                  preBtRssiState;\r
112         u1Byte                                  preWifiRssiState[4];\r
113         BOOLEAN                                 bC2hBtInfoReqSent;\r
114         u1Byte                                  btInfoC2h[BT_INFO_SRC_8821A_2ANT_MAX][10];\r
115         u4Byte                                  btInfoC2hCnt[BT_INFO_SRC_8821A_2ANT_MAX];\r
116         BOOLEAN                                 bC2hBtInquiryPage;\r
117         u1Byte                                  btRetryCnt;\r
118         u1Byte                                  btInfoExt;\r
119 }COEX_STA_8821A_2ANT, *PCOEX_STA_8821A_2ANT;\r
120 \r
121 //===========================================\r
122 // The following is interface which will notify coex module.\r
123 //===========================================\r
124 VOID\r
125 EXhalbtc8821a2ant_InitHwConfig(\r
126         IN      PBTC_COEXIST            pBtCoexist\r
127         );\r
128 VOID\r
129 EXhalbtc8821a2ant_InitCoexDm(\r
130         IN      PBTC_COEXIST            pBtCoexist\r
131         );\r
132 VOID\r
133 EXhalbtc8821a2ant_IpsNotify(\r
134         IN      PBTC_COEXIST            pBtCoexist,\r
135         IN      u1Byte                  type\r
136         );\r
137 VOID\r
138 EXhalbtc8821a2ant_LpsNotify(\r
139         IN      PBTC_COEXIST            pBtCoexist,\r
140         IN      u1Byte                  type\r
141         );\r
142 VOID\r
143 EXhalbtc8821a2ant_ScanNotify(\r
144         IN      PBTC_COEXIST            pBtCoexist,\r
145         IN      u1Byte                  type\r
146         );\r
147 VOID\r
148 EXhalbtc8821a2ant_ConnectNotify(\r
149         IN      PBTC_COEXIST            pBtCoexist,\r
150         IN      u1Byte                  type\r
151         );\r
152 VOID\r
153 EXhalbtc8821a2ant_MediaStatusNotify(\r
154         IN      PBTC_COEXIST                    pBtCoexist,\r
155         IN      u1Byte                          type\r
156         );\r
157 VOID\r
158 EXhalbtc8821a2ant_SpecialPacketNotify(\r
159         IN      PBTC_COEXIST                    pBtCoexist,\r
160         IN      u1Byte                          type\r
161         );\r
162 VOID\r
163 EXhalbtc8821a2ant_BtInfoNotify(\r
164         IN      PBTC_COEXIST            pBtCoexist,\r
165         IN      pu1Byte                 tmpBuf,\r
166         IN      u1Byte                  length\r
167         );\r
168 VOID\r
169 EXhalbtc8821a2ant_HaltNotify(\r
170         IN      PBTC_COEXIST                    pBtCoexist\r
171         );\r
172 VOID\r
173 EXhalbtc8821a2ant_Periodical(\r
174         IN      PBTC_COEXIST                    pBtCoexist\r
175         );\r
176 VOID\r
177 EXhalbtc8821a2ant_DisplayCoexInfo(\r
178         IN      PBTC_COEXIST            pBtCoexist\r
179         );\r
180 \r