Wifi: rtl8812au wifi support.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8812au / hal / OUTSRC-BTCoexist / HalBtc8723b2Ant.h
1 //===========================================\r
2 // The following is for 8723B 2Ant BT Co-exist definition\r
3 //===========================================\r
4 #define BT_AUTO_REPORT_ONLY_8723B_2ANT                          1\r
5 \r
6 \r
7 #define BT_INFO_8723B_2ANT_B_FTP                                                BIT7\r
8 #define BT_INFO_8723B_2ANT_B_A2DP                                       BIT6\r
9 #define BT_INFO_8723B_2ANT_B_HID                                                BIT5\r
10 #define BT_INFO_8723B_2ANT_B_SCO_BUSY                           BIT4\r
11 #define BT_INFO_8723B_2ANT_B_ACL_BUSY                           BIT3\r
12 #define BT_INFO_8723B_2ANT_B_INQ_PAGE                           BIT2\r
13 #define BT_INFO_8723B_2ANT_B_SCO_ESCO                           BIT1\r
14 #define BT_INFO_8723B_2ANT_B_CONNECTION                         BIT0\r
15 \r
16 #define         BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT             2\r
17 \r
18 \r
19 #define BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES                                42  //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation\r
20 #define BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES                          46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation\r
21 \r
22 typedef enum _BT_INFO_SRC_8723B_2ANT{\r
23         BT_INFO_SRC_8723B_2ANT_WIFI_FW                  = 0x0,\r
24         BT_INFO_SRC_8723B_2ANT_BT_RSP                           = 0x1,\r
25         BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND           = 0x2,\r
26         BT_INFO_SRC_8723B_2ANT_MAX\r
27 }BT_INFO_SRC_8723B_2ANT,*PBT_INFO_SRC_8723B_2ANT;\r
28 \r
29 typedef enum _BT_8723B_2ANT_BT_STATUS{\r
30         BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE      = 0x0,\r
31         BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE          = 0x1,\r
32         BT_8723B_2ANT_BT_STATUS_INQ_PAGE                                = 0x2,\r
33         BT_8723B_2ANT_BT_STATUS_ACL_BUSY                                = 0x3,\r
34         BT_8723B_2ANT_BT_STATUS_SCO_BUSY                                = 0x4,\r
35         BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY                    = 0x5,\r
36         BT_8723B_2ANT_BT_STATUS_MAX\r
37 }BT_8723B_2ANT_BT_STATUS,*PBT_8723B_2ANT_BT_STATUS;\r
38 \r
39 typedef enum _BT_8723B_2ANT_COEX_ALGO{\r
40         BT_8723B_2ANT_COEX_ALGO_UNDEFINED                       = 0x0,\r
41         BT_8723B_2ANT_COEX_ALGO_SCO                             = 0x1,\r
42         BT_8723B_2ANT_COEX_ALGO_HID                             = 0x2,\r
43         BT_8723B_2ANT_COEX_ALGO_A2DP                            = 0x3,\r
44         BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS              = 0x4,\r
45         BT_8723B_2ANT_COEX_ALGO_PANEDR                  = 0x5,\r
46         BT_8723B_2ANT_COEX_ALGO_PANHS                   = 0x6,\r
47         BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP             = 0x7,\r
48         BT_8723B_2ANT_COEX_ALGO_PANEDR_HID              = 0x8,\r
49         BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,\r
50         BT_8723B_2ANT_COEX_ALGO_HID_A2DP                        = 0xa,\r
51         BT_8723B_2ANT_COEX_ALGO_MAX                             = 0xb,\r
52 }BT_8723B_2ANT_COEX_ALGO,*PBT_8723B_2ANT_COEX_ALGO;\r
53 \r
54 typedef struct _COEX_DM_8723B_2ANT{\r
55         // fw mechanism\r
56         u1Byte          preBtDecPwrLvl;\r
57         u1Byte          curBtDecPwrLvl;\r
58         u1Byte          preFwDacSwingLvl;\r
59         u1Byte          curFwDacSwingLvl;\r
60         BOOLEAN         bCurIgnoreWlanAct;\r
61         BOOLEAN         bPreIgnoreWlanAct;\r
62         u1Byte          prePsTdma;\r
63         u1Byte          curPsTdma;\r
64         u1Byte          psTdmaPara[5];\r
65         u1Byte          psTdmaDuAdjType;\r
66         BOOLEAN         bResetTdmaAdjust;\r
67         BOOLEAN         bAutoTdmaAdjust;\r
68         BOOLEAN         bPrePsTdmaOn;\r
69         BOOLEAN         bCurPsTdmaOn;\r
70         BOOLEAN         bPreBtAutoReport;\r
71         BOOLEAN         bCurBtAutoReport;\r
72 \r
73         // sw mechanism\r
74         BOOLEAN         bPreRfRxLpfShrink;\r
75         BOOLEAN         bCurRfRxLpfShrink;\r
76         u4Byte          btRf0x1eBackup;\r
77         BOOLEAN         bPreLowPenaltyRa;\r
78         BOOLEAN         bCurLowPenaltyRa;\r
79         BOOLEAN         bPreDacSwingOn;\r
80         u4Byte          preDacSwingLvl;\r
81         BOOLEAN         bCurDacSwingOn;\r
82         u4Byte          curDacSwingLvl;\r
83         BOOLEAN         bPreAdcBackOff;\r
84         BOOLEAN         bCurAdcBackOff;\r
85         BOOLEAN         bPreAgcTableEn;\r
86         BOOLEAN         bCurAgcTableEn;\r
87         u4Byte          preVal0x6c0;\r
88         u4Byte          curVal0x6c0;\r
89         u4Byte          preVal0x6c4;\r
90         u4Byte          curVal0x6c4;\r
91         u4Byte          preVal0x6c8;\r
92         u4Byte          curVal0x6c8;\r
93         u1Byte          preVal0x6cc;\r
94         u1Byte          curVal0x6cc;\r
95         BOOLEAN         bLimitedDig;\r
96 \r
97         // algorithm related\r
98         u1Byte          preAlgorithm;\r
99         u1Byte          curAlgorithm;\r
100         u1Byte          btStatus;\r
101         u1Byte          wifiChnlInfo[3];\r
102 \r
103         BOOLEAN         bNeedRecover0x948;\r
104         u4Byte          backup0x948;\r
105 \r
106         u1Byte          preLps;\r
107         u1Byte          curLps;\r
108         u1Byte          preRpwm;\r
109         u1Byte          curRpwm;\r
110 } COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT;\r
111 \r
112 typedef struct _COEX_STA_8723B_2ANT{    \r
113         BOOLEAN                                 bBtLinkExist;\r
114         BOOLEAN                                 bScoExist;\r
115         BOOLEAN                                 bA2dpExist;\r
116         BOOLEAN                                 bHidExist;\r
117         BOOLEAN                                 bPanExist;\r
118 \r
119         BOOLEAN                                 bUnderLps;\r
120         BOOLEAN                                 bUnderIps;\r
121         u4Byte                                  highPriorityTx;\r
122         u4Byte                                  highPriorityRx;\r
123         u4Byte                                  lowPriorityTx;\r
124         u4Byte                                  lowPriorityRx;\r
125         u1Byte                                  btRssi;\r
126         BOOLEAN                         bBtTxRxMask;\r
127         u1Byte                                  preBtRssiState;\r
128         u1Byte                                  preWifiRssiState[4];\r
129         BOOLEAN                                 bC2hBtInfoReqSent;\r
130         u1Byte                                  btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10];\r
131         u4Byte                                  btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];\r
132         BOOLEAN                                 bBtWhckTest;\r
133         BOOLEAN                                 bC2hBtInquiryPage;\r
134         u1Byte                                  btRetryCnt;\r
135         u1Byte                                  btInfoExt;\r
136 \r
137         u4Byte                                  nCRCOK_CCK;\r
138         u4Byte                                  nCRCOK_11g;\r
139         u4Byte                                  nCRCOK_11n;\r
140         u4Byte                                  nCRCOK_11nAgg;\r
141         \r
142         u4Byte                                  nCRCErr_CCK;\r
143         u4Byte                                  nCRCErr_11g;\r
144         u4Byte                                  nCRCErr_11n;\r
145         u4Byte                                  nCRCErr_11nAgg;\r
146 \r
147         u1Byte                                  nCoexTableType;\r
148         BOOLEAN                                 bForceLpsOn;\r
149 \r
150         u1Byte                                  disVerInfoCnt;\r
151 }COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT;\r
152 \r
153 //===========================================\r
154 // The following is interface which will notify coex module.\r
155 //===========================================\r
156 VOID\r
157 EXhalbtc8723b2ant_PowerOnSetting(\r
158         IN      PBTC_COEXIST            pBtCoexist\r
159         );\r
160 VOID\r
161 EXhalbtc8723b2ant_PreLoadFirmware(\r
162         IN      PBTC_COEXIST            pBtCoexist\r
163         );\r
164 VOID\r
165 EXhalbtc8723b2ant_InitHwConfig(\r
166         IN      PBTC_COEXIST            pBtCoexist,\r
167         IN      BOOLEAN                         bWifiOnly\r
168         );\r
169 VOID\r
170 EXhalbtc8723b2ant_InitCoexDm(\r
171         IN      PBTC_COEXIST            pBtCoexist\r
172         );\r
173 VOID\r
174 EXhalbtc8723b2ant_IpsNotify(\r
175         IN      PBTC_COEXIST            pBtCoexist,\r
176         IN      u1Byte                  type\r
177         );\r
178 VOID\r
179 EXhalbtc8723b2ant_LpsNotify(\r
180         IN      PBTC_COEXIST            pBtCoexist,\r
181         IN      u1Byte                  type\r
182         );\r
183 VOID\r
184 EXhalbtc8723b2ant_ScanNotify(\r
185         IN      PBTC_COEXIST            pBtCoexist,\r
186         IN      u1Byte                  type\r
187         );\r
188 VOID\r
189 EXhalbtc8723b2ant_ConnectNotify(\r
190         IN      PBTC_COEXIST            pBtCoexist,\r
191         IN      u1Byte                  type\r
192         );\r
193 VOID\r
194 EXhalbtc8723b2ant_MediaStatusNotify(\r
195         IN      PBTC_COEXIST                    pBtCoexist,\r
196         IN      u1Byte                          type\r
197         );\r
198 VOID\r
199 EXhalbtc8723b2ant_SpecialPacketNotify(\r
200         IN      PBTC_COEXIST                    pBtCoexist,\r
201         IN      u1Byte                          type\r
202         );\r
203 VOID\r
204 EXhalbtc8723b2ant_BtInfoNotify(\r
205         IN      PBTC_COEXIST            pBtCoexist,\r
206         IN      pu1Byte                 tmpBuf,\r
207         IN      u1Byte                  length\r
208         );\r
209 VOID\r
210 EXhalbtc8723b2ant_HaltNotify(\r
211         IN      PBTC_COEXIST                    pBtCoexist\r
212         );\r
213 VOID\r
214 EXhalbtc8723b2ant_PnpNotify(\r
215         IN      PBTC_COEXIST                    pBtCoexist,\r
216         IN      u1Byte                          pnpState\r
217         );\r
218 VOID\r
219 EXhalbtc8723b2ant_Periodical(\r
220         IN      PBTC_COEXIST                    pBtCoexist\r
221         );\r
222 VOID\r
223 EXhalbtc8723b2ant_DisplayCoexInfo(\r
224         IN      PBTC_COEXIST            pBtCoexist\r
225         );\r
226 \r