1 /******************************************************************************
3 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 ******************************************************************************/
15 /* The following is for 8723B 1ANT BT Co-exist definition */
16 #define BT_INFO_8723B_1ANT_B_FTP BIT7
17 #define BT_INFO_8723B_1ANT_B_A2DP BIT6
18 #define BT_INFO_8723B_1ANT_B_HID BIT5
19 #define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT4
20 #define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT3
21 #define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT2
22 #define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT1
23 #define BT_INFO_8723B_1ANT_B_CONNECTION BIT0
25 #define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
26 (((_BT_INFO_EXT_&BIT0)) ? true : false)
28 #define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
30 #define BT_8723B_1ANT_WIFI_NOISY_THRESH 30 /* max: 255 */
32 typedef enum _BT_INFO_SRC_8723B_1ANT {
33 BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0,
34 BT_INFO_SRC_8723B_1ANT_BT_RSP = 0x1,
35 BT_INFO_SRC_8723B_1ANT_BT_ACTIVE_SEND = 0x2,
36 BT_INFO_SRC_8723B_1ANT_MAX
37 } BT_INFO_SRC_8723B_1ANT, *PBT_INFO_SRC_8723B_1ANT;
39 typedef enum _BT_8723B_1ANT_BT_STATUS {
40 BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
41 BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
42 BT_8723B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
43 BT_8723B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
44 BT_8723B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
45 BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
46 BT_8723B_1ANT_BT_STATUS_MAX
47 } BT_8723B_1ANT_BT_STATUS, *PBT_8723B_1ANT_BT_STATUS;
49 typedef enum _BT_8723B_1ANT_WIFI_STATUS {
50 BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
51 BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
52 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
53 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
54 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
55 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
56 BT_8723B_1ANT_WIFI_STATUS_MAX
57 } BT_8723B_1ANT_WIFI_STATUS, *PBT_8723B_1ANT_WIFI_STATUS;
59 typedef enum _BT_8723B_1ANT_COEX_ALGO {
60 BT_8723B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
61 BT_8723B_1ANT_COEX_ALGO_SCO = 0x1,
62 BT_8723B_1ANT_COEX_ALGO_HID = 0x2,
63 BT_8723B_1ANT_COEX_ALGO_A2DP = 0x3,
64 BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
65 BT_8723B_1ANT_COEX_ALGO_PANEDR = 0x5,
66 BT_8723B_1ANT_COEX_ALGO_PANHS = 0x6,
67 BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
68 BT_8723B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
69 BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
70 BT_8723B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
71 BT_8723B_1ANT_COEX_ALGO_MAX = 0xb,
72 } BT_8723B_1ANT_COEX_ALGO, *PBT_8723B_1ANT_COEX_ALGO;
74 typedef struct _COEX_DM_8723B_1ANT {
76 bool bCurIgnoreWlanAct;
77 bool bPreIgnoreWlanAct;
85 bool bPreBtAutoReport;
86 bool bCurBtAutoReport;
93 bool bPreLowPenaltyRa;
94 bool bCurLowPenaltyRa;
105 u32 backupArfrCnt1; /* Auto Rate Fallback Retry cnt */
106 u32 backupArfrCnt2; /* Auto Rate Fallback Retry cnt */
107 u16 backupRetryLimit;
108 u8 backupAmpduMaxTime;
110 /* algorithm related */
120 u8 preRetryLimitType;
121 u8 curRetryLimitType;
127 } COEX_DM_8723B_1ANT, *PCOEX_DM_8723B_1ANT;
129 typedef struct _COEX_STA_8723B_1ANT {
138 u32 specialPktPeriodCnt;
146 u8 preWifiRssiState[4];
147 bool bC2hBtInfoReqSent;
148 u8 btInfoC2h[BT_INFO_SRC_8723B_1ANT_MAX][10];
149 u32 btInfoC2hCnt[BT_INFO_SRC_8723B_1ANT_MAX];
150 bool bC2hBtInquiryPage;
151 bool bC2hBtPage; /* Add for win8.1 page out issue */
152 bool bWiFiIsHighPriTask; /* Add for win8.1 page out issue */
173 } COEX_STA_8723B_1ANT, *PCOEX_STA_8723B_1ANT;
176 /* The following is interface which will notify coex module. */
178 void EXhalbtc8723b1ant_PowerOnSetting(PBTC_COEXIST pBtCoexist);
179 void EXhalbtc8723b1ant_InitHwConfig(PBTC_COEXIST pBtCoexist, bool bWifiOnly);
180 void EXhalbtc8723b1ant_InitCoexDm(PBTC_COEXIST pBtCoexist);
181 void EXhalbtc8723b1ant_IpsNotify(PBTC_COEXIST pBtCoexist, u8 type);
182 void EXhalbtc8723b1ant_LpsNotify(PBTC_COEXIST pBtCoexist, u8 type);
183 void EXhalbtc8723b1ant_ScanNotify(PBTC_COEXIST pBtCoexist, u8 type);
184 void EXhalbtc8723b1ant_ConnectNotify(PBTC_COEXIST pBtCoexist, u8 type);
185 void EXhalbtc8723b1ant_MediaStatusNotify(PBTC_COEXIST pBtCoexist, u8 type);
186 void EXhalbtc8723b1ant_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 type);
187 void EXhalbtc8723b1ant_BtInfoNotify(
188 PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length
190 void EXhalbtc8723b1ant_HaltNotify(PBTC_COEXIST pBtCoexist);
191 void EXhalbtc8723b1ant_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState);
192 void EXhalbtc8723b1ant_Periodical(PBTC_COEXIST pBtCoexist);
193 void EXhalbtc8723b1ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist);