blob: a759b758faef2117ce0fc8e8e8caf714ce48526e [file] [log] [blame]
Greg Kroah-Hartman3c05bed2014-01-21 11:20:45 -08001//===========================================
2// The following is for 8192E_1ANT BT Co-exist definition
3//===========================================
4#define BT_AUTO_REPORT_ONLY_8192E_1ANT 0
5
6#define BT_INFO_8192E_1ANT_B_FTP BIT7
7#define BT_INFO_8192E_1ANT_B_A2DP BIT6
8#define BT_INFO_8192E_1ANT_B_HID BIT5
9#define BT_INFO_8192E_1ANT_B_SCO_BUSY BIT4
10#define BT_INFO_8192E_1ANT_B_ACL_BUSY BIT3
11#define BT_INFO_8192E_1ANT_B_INQ_PAGE BIT2
12#define BT_INFO_8192E_1ANT_B_SCO_ESCO BIT1
13#define BT_INFO_8192E_1ANT_B_CONNECTION BIT0
14
15#define BT_INFO_8192E_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
16 (((_BT_INFO_EXT_&BIT0))? true:FALSE)
17
18#define BTC_RSSI_COEX_THRESH_TOL_8192E_1ANT 2
19
20typedef enum _BT_INFO_SRC_8192E_1ANT{
21 BT_INFO_SRC_8192E_1ANT_WIFI_FW = 0x0,
22 BT_INFO_SRC_8192E_1ANT_BT_RSP = 0x1,
23 BT_INFO_SRC_8192E_1ANT_BT_ACTIVE_SEND = 0x2,
24 BT_INFO_SRC_8192E_1ANT_MAX
25}BT_INFO_SRC_8192E_1ANT,*PBT_INFO_SRC_8192E_1ANT;
26
27typedef enum _BT_8192E_1ANT_BT_STATUS{
28 BT_8192E_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
29 BT_8192E_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
30 BT_8192E_1ANT_BT_STATUS_INQ_PAGE = 0x2,
31 BT_8192E_1ANT_BT_STATUS_ACL_BUSY = 0x3,
32 BT_8192E_1ANT_BT_STATUS_SCO_BUSY = 0x4,
33 BT_8192E_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
34 BT_8192E_1ANT_BT_STATUS_MAX
35}BT_8192E_1ANT_BT_STATUS,*PBT_8192E_1ANT_BT_STATUS;
36
37typedef enum _BT_8192E_1ANT_WIFI_STATUS{
38 BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
39 BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
40 BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
41 BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
42 BT_8192E_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
43 BT_8192E_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
44 BT_8192E_1ANT_WIFI_STATUS_MAX
45}BT_8192E_1ANT_WIFI_STATUS,*PBT_8192E_1ANT_WIFI_STATUS;
46
47typedef enum _BT_8192E_1ANT_COEX_ALGO{
48 BT_8192E_1ANT_COEX_ALGO_UNDEFINED = 0x0,
49 BT_8192E_1ANT_COEX_ALGO_SCO = 0x1,
50 BT_8192E_1ANT_COEX_ALGO_HID = 0x2,
51 BT_8192E_1ANT_COEX_ALGO_A2DP = 0x3,
52 BT_8192E_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
53 BT_8192E_1ANT_COEX_ALGO_PANEDR = 0x5,
54 BT_8192E_1ANT_COEX_ALGO_PANHS = 0x6,
55 BT_8192E_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
56 BT_8192E_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
57 BT_8192E_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
58 BT_8192E_1ANT_COEX_ALGO_HID_A2DP = 0xa,
59 BT_8192E_1ANT_COEX_ALGO_MAX = 0xb,
60}BT_8192E_1ANT_COEX_ALGO,*PBT_8192E_1ANT_COEX_ALGO;
61
62typedef struct _COEX_DM_8192E_1ANT{
63 // fw mechanism
64 u1Byte preBtDecPwrLvl;
65 u1Byte curBtDecPwrLvl;
66 BOOLEAN bPreBtLnaConstrain;
67 BOOLEAN bCurBtLnaConstrain;
68 u1Byte bPreBtPsdMode;
69 u1Byte bCurBtPsdMode;
70 u1Byte preFwDacSwingLvl;
71 u1Byte curFwDacSwingLvl;
72 BOOLEAN bCurIgnoreWlanAct;
73 BOOLEAN bPreIgnoreWlanAct;
74 u1Byte prePsTdma;
75 u1Byte curPsTdma;
76 u1Byte psTdmaPara[5];
77 u1Byte psTdmaDuAdjType;
78 BOOLEAN bAutoTdmaAdjust;
79 BOOLEAN bPrePsTdmaOn;
80 BOOLEAN bCurPsTdmaOn;
81 BOOLEAN bPreBtAutoReport;
82 BOOLEAN bCurBtAutoReport;
83 u1Byte preLps;
84 u1Byte curLps;
85 u1Byte preRpwm;
86 u1Byte curRpwm;
87
88 // sw mechanism
89 BOOLEAN bPreRfRxLpfShrink;
90 BOOLEAN bCurRfRxLpfShrink;
91 u4Byte btRf0x1eBackup;
92 BOOLEAN bPreLowPenaltyRa;
93 BOOLEAN bCurLowPenaltyRa;
94 BOOLEAN bPreDacSwingOn;
95 u4Byte preDacSwingLvl;
96 BOOLEAN bCurDacSwingOn;
97 u4Byte curDacSwingLvl;
98 BOOLEAN bPreAdcBackOff;
99 BOOLEAN bCurAdcBackOff;
100 BOOLEAN bPreAgcTableEn;
101 BOOLEAN bCurAgcTableEn;
102 u4Byte preVal0x6c0;
103 u4Byte curVal0x6c0;
104 u4Byte preVal0x6c4;
105 u4Byte curVal0x6c4;
106 u4Byte preVal0x6c8;
107 u4Byte curVal0x6c8;
108 u1Byte preVal0x6cc;
109 u1Byte curVal0x6cc;
110 BOOLEAN limited_dig;
111
112 // algorithm related
113 u1Byte preAlgorithm;
114 u1Byte curAlgorithm;
115 u1Byte btStatus;
116 u1Byte wifiChnlInfo[3];
117
118 u1Byte preSsType;
119 u1Byte curSsType;
120
121 u4Byte prera_mask;
122 u4Byte curra_mask;
123
124 u1Byte errorCondition;
125} COEX_DM_8192E_1ANT, *PCOEX_DM_8192E_1ANT;
126
127typedef struct _COEX_STA_8192E_1ANT{
128 BOOLEAN bBtLinkExist;
129 BOOLEAN bScoExist;
130 BOOLEAN bA2dpExist;
131 BOOLEAN bHidExist;
132 BOOLEAN bPanExist;
133
134 BOOLEAN bUnderLps;
135 BOOLEAN bUnderIps;
136 u4Byte highPriorityTx;
137 u4Byte highPriorityRx;
138 u4Byte lowPriorityTx;
139 u4Byte lowPriorityRx;
140 u1Byte btRssi;
141 u1Byte preBtRssiState;
142 u1Byte preWifiRssiState[4];
143 BOOLEAN bC2hBtInfoReqSent;
144 u1Byte btInfoC2h[BT_INFO_SRC_8192E_1ANT_MAX][10];
145 u4Byte btInfoC2hCnt[BT_INFO_SRC_8192E_1ANT_MAX];
146 BOOLEAN bC2hBtInquiryPage;
147 u1Byte btRetryCnt;
148 u1Byte btInfoExt;
149}COEX_STA_8192E_1ANT, *PCOEX_STA_8192E_1ANT;
150
151//===========================================
152// The following is interface which will notify coex module.
153//===========================================
154VOID
155EXhalbtc8192e1ant_InitHwConfig(
156 IN PBTC_COEXIST pBtCoexist
157 );
158VOID
159EXhalbtc8192e1ant_InitCoexDm(
160 IN PBTC_COEXIST pBtCoexist
161 );
162VOID
163EXhalbtc8192e1ant_IpsNotify(
164 IN PBTC_COEXIST pBtCoexist,
165 IN u1Byte type
166 );
167VOID
168EXhalbtc8192e1ant_LpsNotify(
169 IN PBTC_COEXIST pBtCoexist,
170 IN u1Byte type
171 );
172VOID
173EXhalbtc8192e1ant_ScanNotify(
174 IN PBTC_COEXIST pBtCoexist,
175 IN u1Byte type
176 );
177VOID
178EXhalbtc8192e1ant_ConnectNotify(
179 IN PBTC_COEXIST pBtCoexist,
180 IN u1Byte type
181 );
182VOID
183EXhalbtc8192e1ant_MediaStatusNotify(
184 IN PBTC_COEXIST pBtCoexist,
185 IN u1Byte type
186 );
187VOID
188EXhalbtc8192e1ant_SpecialPacketNotify(
189 IN PBTC_COEXIST pBtCoexist,
190 IN u1Byte type
191 );
192VOID
193EXhalbtc8192e1ant_BtInfoNotify(
194 IN PBTC_COEXIST pBtCoexist,
195 IN pu1Byte tmpBuf,
196 IN u1Byte length
197 );
198VOID
199EXhalbtc8192e1ant_StackOperationNotify(
200 IN PBTC_COEXIST pBtCoexist,
201 IN u1Byte type
202 );
203VOID
204EXhalbtc8192e1ant_HaltNotify(
205 IN PBTC_COEXIST pBtCoexist
206 );
207VOID
208EXhalbtc8192e1ant_PnpNotify(
209 IN PBTC_COEXIST pBtCoexist,
210 IN u1Byte pnpState
211 );
212VOID
213EXhalbtc8192e1ant_Periodical(
214 IN PBTC_COEXIST pBtCoexist
215 );
216VOID
217EXhalbtc8192e1ant_DisplayCoexInfo(
218 IN PBTC_COEXIST pBtCoexist
219 );
220VOID
221EXhalbtc8192e1ant_DbgControl(
222 IN PBTC_COEXIST pBtCoexist,
223 IN u1Byte opCode,
224 IN u1Byte opLen,
225 IN pu1Byte pData
226 );