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