WiFi: add rtl8189es/etv support, Optimization wifi configuration.
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8189es / 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 typedef enum _BT_INFO_SRC_8723B_2ANT{\r
19         BT_INFO_SRC_8723B_2ANT_WIFI_FW                  = 0x0,\r
20         BT_INFO_SRC_8723B_2ANT_BT_RSP                           = 0x1,\r
21         BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND           = 0x2,\r
22         BT_INFO_SRC_8723B_2ANT_MAX\r
23 }BT_INFO_SRC_8723B_2ANT,*PBT_INFO_SRC_8723B_2ANT;\r
24 \r
25 typedef enum _BT_8723B_2ANT_BT_STATUS{\r
26         BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE      = 0x0,\r
27         BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE          = 0x1,\r
28         BT_8723B_2ANT_BT_STATUS_INQ_PAGE                                = 0x2,\r
29         BT_8723B_2ANT_BT_STATUS_ACL_BUSY                                = 0x3,\r
30         BT_8723B_2ANT_BT_STATUS_SCO_BUSY                                = 0x4,\r
31         BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY                    = 0x5,\r
32         BT_8723B_2ANT_BT_STATUS_MAX\r
33 }BT_8723B_2ANT_BT_STATUS,*PBT_8723B_2ANT_BT_STATUS;\r
34 \r
35 typedef enum _BT_8723B_2ANT_COEX_ALGO{\r
36         BT_8723B_2ANT_COEX_ALGO_UNDEFINED                       = 0x0,\r
37         BT_8723B_2ANT_COEX_ALGO_SCO                             = 0x1,\r
38         BT_8723B_2ANT_COEX_ALGO_HID                             = 0x2,\r
39         BT_8723B_2ANT_COEX_ALGO_A2DP                            = 0x3,\r
40         BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS              = 0x4,\r
41         BT_8723B_2ANT_COEX_ALGO_PANEDR                  = 0x5,\r
42         BT_8723B_2ANT_COEX_ALGO_PANHS                   = 0x6,\r
43         BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP             = 0x7,\r
44         BT_8723B_2ANT_COEX_ALGO_PANEDR_HID              = 0x8,\r
45         BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,\r
46         BT_8723B_2ANT_COEX_ALGO_HID_A2DP                        = 0xa,\r
47         BT_8723B_2ANT_COEX_ALGO_MAX                             = 0xb,\r
48 }BT_8723B_2ANT_COEX_ALGO,*PBT_8723B_2ANT_COEX_ALGO;\r
49 \r
50 typedef struct _COEX_DM_8723B_2ANT{\r
51         // fw mechanism\r
52         BOOLEAN         bPreDecBtPwr;\r
53         BOOLEAN         bCurDecBtPwr;\r
54         u1Byte          preFwDacSwingLvl;\r
55         u1Byte          curFwDacSwingLvl;\r
56         BOOLEAN         bCurIgnoreWlanAct;\r
57         BOOLEAN         bPreIgnoreWlanAct;\r
58         u1Byte          prePsTdma;\r
59         u1Byte          curPsTdma;\r
60         u1Byte          psTdmaPara[5];\r
61         u1Byte          psTdmaDuAdjType;\r
62         BOOLEAN         bResetTdmaAdjust;\r
63         BOOLEAN         bAutoTdmaAdjust;\r
64         BOOLEAN         bPrePsTdmaOn;\r
65         BOOLEAN         bCurPsTdmaOn;\r
66         BOOLEAN         bPreBtAutoReport;\r
67         BOOLEAN         bCurBtAutoReport;\r
68 \r
69         // sw mechanism\r
70         BOOLEAN         bPreRfRxLpfShrink;\r
71         BOOLEAN         bCurRfRxLpfShrink;\r
72         u4Byte          btRf0x1eBackup;\r
73         BOOLEAN         bPreLowPenaltyRa;\r
74         BOOLEAN         bCurLowPenaltyRa;\r
75         BOOLEAN         bPreDacSwingOn;\r
76         u4Byte          preDacSwingLvl;\r
77         BOOLEAN         bCurDacSwingOn;\r
78         u4Byte          curDacSwingLvl;\r
79         BOOLEAN         bPreAdcBackOff;\r
80         BOOLEAN         bCurAdcBackOff;\r
81         BOOLEAN         bPreAgcTableEn;\r
82         BOOLEAN         bCurAgcTableEn;\r
83         u4Byte          preVal0x6c0;\r
84         u4Byte          curVal0x6c0;\r
85         u4Byte          preVal0x6c4;\r
86         u4Byte          curVal0x6c4;\r
87         u4Byte          preVal0x6c8;\r
88         u4Byte          curVal0x6c8;\r
89         u1Byte          preVal0x6cc;\r
90         u1Byte          curVal0x6cc;\r
91         BOOLEAN         bLimitedDig;\r
92 \r
93         // algorithm related\r
94         u1Byte          preAlgorithm;\r
95         u1Byte          curAlgorithm;\r
96         u1Byte          btStatus;\r
97         u1Byte          wifiChnlInfo[3];\r
98 \r
99         BOOLEAN         bNeedRecover0x948;\r
100         u4Byte          backup0x948;\r
101 } COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT;\r
102 \r
103 typedef struct _COEX_STA_8723B_2ANT{    \r
104         BOOLEAN                                 bBtLinkExist;\r
105         BOOLEAN                                 bScoExist;\r
106         BOOLEAN                                 bA2dpExist;\r
107         BOOLEAN                                 bHidExist;\r
108         BOOLEAN                                 bPanExist;\r
109 \r
110         BOOLEAN                                 bUnderLps;\r
111         BOOLEAN                                 bUnderIps;\r
112         u4Byte                                  highPriorityTx;\r
113         u4Byte                                  highPriorityRx;\r
114         u4Byte                                  lowPriorityTx;\r
115         u4Byte                                  lowPriorityRx;\r
116         u1Byte                                  btRssi;\r
117         u1Byte                                  preBtRssiState;\r
118         u1Byte                                  preWifiRssiState[4];\r
119         BOOLEAN                                 bC2hBtInfoReqSent;\r
120         u1Byte                                  btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10];\r
121         u4Byte                                  btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];\r
122         BOOLEAN                                 bC2hBtInquiryPage;\r
123         u1Byte                                  btRetryCnt;\r
124         u1Byte                                  btInfoExt;\r
125 }COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT;\r
126 \r
127 //===========================================\r
128 // The following is interface which will notify coex module.\r
129 //===========================================\r
130 VOID\r
131 EXhalbtc8723b2ant_InitHwConfig(\r
132         IN      PBTC_COEXIST            pBtCoexist\r
133         );\r
134 VOID\r
135 EXhalbtc8723b2ant_InitCoexDm(\r
136         IN      PBTC_COEXIST            pBtCoexist\r
137         );\r
138 VOID\r
139 EXhalbtc8723b2ant_IpsNotify(\r
140         IN      PBTC_COEXIST            pBtCoexist,\r
141         IN      u1Byte                  type\r
142         );\r
143 VOID\r
144 EXhalbtc8723b2ant_LpsNotify(\r
145         IN      PBTC_COEXIST            pBtCoexist,\r
146         IN      u1Byte                  type\r
147         );\r
148 VOID\r
149 EXhalbtc8723b2ant_ScanNotify(\r
150         IN      PBTC_COEXIST            pBtCoexist,\r
151         IN      u1Byte                  type\r
152         );\r
153 VOID\r
154 EXhalbtc8723b2ant_ConnectNotify(\r
155         IN      PBTC_COEXIST            pBtCoexist,\r
156         IN      u1Byte                  type\r
157         );\r
158 VOID\r
159 EXhalbtc8723b2ant_MediaStatusNotify(\r
160         IN      PBTC_COEXIST                    pBtCoexist,\r
161         IN      u1Byte                          type\r
162         );\r
163 VOID\r
164 EXhalbtc8723b2ant_SpecialPacketNotify(\r
165         IN      PBTC_COEXIST                    pBtCoexist,\r
166         IN      u1Byte                          type\r
167         );\r
168 VOID\r
169 EXhalbtc8723b2ant_BtInfoNotify(\r
170         IN      PBTC_COEXIST            pBtCoexist,\r
171         IN      pu1Byte                 tmpBuf,\r
172         IN      u1Byte                  length\r
173         );\r
174 VOID\r
175 EXhalbtc8723b2ant_HaltNotify(\r
176         IN      PBTC_COEXIST                    pBtCoexist\r
177         );\r
178 VOID\r
179 EXhalbtc8723b2ant_Periodical(\r
180         IN      PBTC_COEXIST                    pBtCoexist\r
181         );\r
182 VOID\r
183 EXhalbtc8723b2ant_DisplayCoexInfo(\r
184         IN      PBTC_COEXIST            pBtCoexist\r
185         );\r
186 \r