net: wireless: rockchip_wlan: add rtl8723ds support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723ds / hal / btc / HalBtc8723a2Ant.h
1 //===========================================\r
2 // The following is for 8723A 2Ant BT Co-exist definition\r
3 //===========================================\r
4 #define BT_INFO_8723A_2ANT_B_FTP                                                BIT7\r
5 #define BT_INFO_8723A_2ANT_B_A2DP                                       BIT6\r
6 #define BT_INFO_8723A_2ANT_B_HID                                                BIT5\r
7 #define BT_INFO_8723A_2ANT_B_SCO_BUSY                           BIT4\r
8 #define BT_INFO_8723A_2ANT_B_ACL_BUSY                           BIT3\r
9 #define BT_INFO_8723A_2ANT_B_INQ_PAGE                           BIT2\r
10 #define BT_INFO_8723A_2ANT_B_SCO_ESCO                           BIT1\r
11 #define BT_INFO_8723A_2ANT_B_CONNECTION                         BIT0\r
12 \r
13 #define         BTC_RSSI_COEX_THRESH_TOL_8723A_2ANT             2\r
14 \r
15 typedef enum _BT_INFO_SRC_8723A_2ANT{\r
16         BT_INFO_SRC_8723A_2ANT_WIFI_FW                  = 0x0,\r
17         BT_INFO_SRC_8723A_2ANT_BT_RSP                           = 0x1,\r
18         BT_INFO_SRC_8723A_2ANT_BT_ACTIVE_SEND           = 0x2,\r
19         BT_INFO_SRC_8723A_2ANT_MAX\r
20 }BT_INFO_SRC_8723A_2ANT,*PBT_INFO_SRC_8723A_2ANT;\r
21 \r
22 typedef enum _BT_8723A_2ANT_BT_STATUS{\r
23         BT_8723A_2ANT_BT_STATUS_IDLE                            = 0x0,\r
24         BT_8723A_2ANT_BT_STATUS_CONNECTED_IDLE  = 0x1,\r
25         BT_8723A_2ANT_BT_STATUS_NON_IDLE                        = 0x2,\r
26         BT_8723A_2ANT_BT_STATUS_MAX\r
27 }BT_8723A_2ANT_BT_STATUS,*PBT_8723A_2ANT_BT_STATUS;\r
28 \r
29 typedef enum _BT_8723A_2ANT_COEX_ALGO{\r
30         BT_8723A_2ANT_COEX_ALGO_UNDEFINED                       = 0x0,\r
31         BT_8723A_2ANT_COEX_ALGO_SCO                             = 0x1,\r
32         BT_8723A_2ANT_COEX_ALGO_HID                             = 0x2,\r
33         BT_8723A_2ANT_COEX_ALGO_A2DP                            = 0x3,\r
34         BT_8723A_2ANT_COEX_ALGO_PANEDR                  = 0x4,\r
35         BT_8723A_2ANT_COEX_ALGO_PANHS                   = 0x5,\r
36         BT_8723A_2ANT_COEX_ALGO_PANEDR_A2DP             = 0x6,\r
37         BT_8723A_2ANT_COEX_ALGO_PANEDR_HID              = 0x7,\r
38         BT_8723A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8,\r
39         BT_8723A_2ANT_COEX_ALGO_HID_A2DP                        = 0x9,\r
40         BT_8723A_2ANT_COEX_ALGO_MAX\r
41 }BT_8723A_2ANT_COEX_ALGO,*PBT_8723A_2ANT_COEX_ALGO;\r
42 \r
43 typedef struct _COEX_DM_8723A_2ANT{\r
44         // fw mechanism\r
45         BOOLEAN         bPreDecBtPwr;\r
46         BOOLEAN         bCurDecBtPwr;\r
47         //BOOLEAN               bPreBtLnaConstrain;\r
48         //BOOLEAN               bCurBtLnaConstrain;\r
49         //u1Byte                bPreBtPsdMode;\r
50         //u1Byte                bCurBtPsdMode;\r
51         u1Byte          preFwDacSwingLvl;\r
52         u1Byte          curFwDacSwingLvl;\r
53         BOOLEAN         bCurIgnoreWlanAct;\r
54         BOOLEAN         bPreIgnoreWlanAct;\r
55         u1Byte          prePsTdma;\r
56         u1Byte          curPsTdma;\r
57         u1Byte          psTdmaPara[5];\r
58         u1Byte          psTdmaDuAdjType;\r
59         BOOLEAN         bResetTdmaAdjust;\r
60         BOOLEAN         bPrePsTdmaOn;\r
61         BOOLEAN         bCurPsTdmaOn;\r
62         //BOOLEAN               bPreBtAutoReport;\r
63         //BOOLEAN               bCurBtAutoReport;\r
64 \r
65         // sw mechanism\r
66         BOOLEAN         bPreRfRxLpfShrink;\r
67         BOOLEAN         bCurRfRxLpfShrink;\r
68         u4Byte          btRf0x1eBackup;\r
69         BOOLEAN         bPreLowPenaltyRa;\r
70         BOOLEAN         bCurLowPenaltyRa;\r
71         BOOLEAN         bPreDacSwingOn;\r
72         u4Byte          preDacSwingLvl;\r
73         BOOLEAN         bCurDacSwingOn;\r
74         u4Byte          curDacSwingLvl;\r
75         BOOLEAN         bPreAdcBackOff;\r
76         BOOLEAN         bCurAdcBackOff;\r
77         BOOLEAN         bPreAgcTableEn;\r
78         BOOLEAN         bCurAgcTableEn;\r
79         u4Byte          preVal0x6c0;\r
80         u4Byte          curVal0x6c0;\r
81         u4Byte          preVal0x6c8;\r
82         u4Byte          curVal0x6c8;\r
83         u1Byte          preVal0x6cc;\r
84         u1Byte          curVal0x6cc;\r
85         BOOLEAN         bLimitedDig;\r
86 \r
87         // algorithm related\r
88         u1Byte          preAlgorithm;\r
89         u1Byte          curAlgorithm;\r
90         u1Byte          btStatus;\r
91         u1Byte          wifiChnlInfo[3];\r
92 } COEX_DM_8723A_2ANT, *PCOEX_DM_8723A_2ANT;\r
93 \r
94 typedef struct _COEX_STA_8723A_2ANT{\r
95         u4Byte                                  highPriorityTx;\r
96         u4Byte                                  highPriorityRx;\r
97         u4Byte                                  lowPriorityTx;\r
98         u4Byte                                  lowPriorityRx;\r
99         u1Byte                                  btRssi;\r
100         u1Byte                                  preBtRssiState;\r
101         u1Byte                                  preBtRssiState1;\r
102         u1Byte                                  preWifiRssiState[4];\r
103         BOOLEAN                                 bC2hBtInfoReqSent;\r
104         u1Byte                                  btInfoC2h[BT_INFO_SRC_8723A_2ANT_MAX][10];\r
105         u4Byte                                  btInfoC2hCnt[BT_INFO_SRC_8723A_2ANT_MAX];\r
106         BOOLEAN                                 bC2hBtInquiryPage;\r
107         u1Byte                                  btRetryCnt;\r
108         u1Byte                                  btInfoExt;\r
109         BOOLEAN                                 bHoldForStackOperation;\r
110         u1Byte                                  bHoldPeriodCnt;\r
111         // this is for c2h hang work-around\r
112         u4Byte                                  c2hHangDetectCnt;\r
113 }COEX_STA_8723A_2ANT, *PCOEX_STA_8723A_2ANT;\r
114 \r
115 //===========================================\r
116 // The following is interface which will notify coex module.\r
117 //===========================================\r
118 VOID\r
119 EXhalbtc8723a2ant_PowerOnSetting(\r
120         IN      PBTC_COEXIST            pBtCoexist\r
121         );\r
122 VOID\r
123 EXhalbtc8723a2ant_InitHwConfig(\r
124         IN      PBTC_COEXIST            pBtCoexist,\r
125         IN      BOOLEAN                         bWifiOnly\r
126         );\r
127 VOID\r
128 EXhalbtc8723a2ant_InitCoexDm(\r
129         IN      PBTC_COEXIST            pBtCoexist\r
130         );\r
131 VOID\r
132 EXhalbtc8723a2ant_IpsNotify(\r
133         IN      PBTC_COEXIST            pBtCoexist,\r
134         IN      u1Byte                  type\r
135         );\r
136 VOID\r
137 EXhalbtc8723a2ant_LpsNotify(\r
138         IN      PBTC_COEXIST            pBtCoexist,\r
139         IN      u1Byte                  type\r
140         );\r
141 VOID\r
142 EXhalbtc8723a2ant_ScanNotify(\r
143         IN      PBTC_COEXIST            pBtCoexist,\r
144         IN      u1Byte                  type\r
145         );\r
146 VOID\r
147 EXhalbtc8723a2ant_ConnectNotify(\r
148         IN      PBTC_COEXIST            pBtCoexist,\r
149         IN      u1Byte                  type\r
150         );\r
151 VOID\r
152 EXhalbtc8723a2ant_MediaStatusNotify(\r
153         IN      PBTC_COEXIST                    pBtCoexist,\r
154         IN      u1Byte                          type\r
155         );\r
156 VOID\r
157 EXhalbtc8723a2ant_SpecialPacketNotify(\r
158         IN      PBTC_COEXIST                    pBtCoexist,\r
159         IN      u1Byte                          type\r
160         );\r
161 VOID\r
162 EXhalbtc8723a2ant_HaltNotify(\r
163         IN      PBTC_COEXIST                    pBtCoexist\r
164         );\r
165 VOID\r
166 EXhalbtc8723a2ant_Periodical(\r
167         IN      PBTC_COEXIST                    pBtCoexist\r
168         );\r
169 VOID\r
170 EXhalbtc8723a2ant_BtInfoNotify(\r
171         IN      PBTC_COEXIST            pBtCoexist,\r
172         IN      pu1Byte                 tmpBuf,\r
173         IN      u1Byte                  length\r
174         );\r
175 VOID\r
176 EXhalbtc8723a2ant_StackOperationNotify(\r
177         IN      PBTC_COEXIST                    pBtCoexist,\r
178         IN      u1Byte                          type\r
179         );\r
180 VOID\r
181 EXhalbtc8723a2ant_DisplayCoexInfo(\r
182         IN      PBTC_COEXIST            pBtCoexist\r
183         );\r
184 \r