1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
6 ******************************************************************************/
7 /* The following is for 8723B 2Ant BT Co-exist definition */
8 #define BT_INFO_8723B_2ANT_B_FTP BIT7
9 #define BT_INFO_8723B_2ANT_B_A2DP BIT6
10 #define BT_INFO_8723B_2ANT_B_HID BIT5
11 #define BT_INFO_8723B_2ANT_B_SCO_BUSY BIT4
12 #define BT_INFO_8723B_2ANT_B_ACL_BUSY BIT3
13 #define BT_INFO_8723B_2ANT_B_INQ_PAGE BIT2
14 #define BT_INFO_8723B_2ANT_B_SCO_ESCO BIT1
15 #define BT_INFO_8723B_2ANT_B_CONNECTION BIT0
17 #define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2
20 BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0,
21 BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1,
22 BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND = 0x2,
23 BT_INFO_SRC_8723B_2ANT_MAX
27 BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
28 BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
29 BT_8723B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
30 BT_8723B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
31 BT_8723B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
32 BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
33 BT_8723B_2ANT_BT_STATUS_MAX
37 BT_8723B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
38 BT_8723B_2ANT_COEX_ALGO_SCO = 0x1,
39 BT_8723B_2ANT_COEX_ALGO_HID = 0x2,
40 BT_8723B_2ANT_COEX_ALGO_A2DP = 0x3,
41 BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
42 BT_8723B_2ANT_COEX_ALGO_PANEDR = 0x5,
43 BT_8723B_2ANT_COEX_ALGO_PANHS = 0x6,
44 BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
45 BT_8723B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
46 BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
47 BT_8723B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
48 BT_8723B_2ANT_COEX_ALGO_MAX = 0xb,
51 struct coex_dm_8723b_2ant {
57 bool bCurIgnoreWlanAct;
58 bool bPreIgnoreWlanAct;
63 bool bResetTdmaAdjust;
67 bool bPreBtAutoReport;
68 bool bCurBtAutoReport;
71 bool bPreRfRxLpfShrink;
72 bool bCurRfRxLpfShrink;
74 bool bPreLowPenaltyRa;
75 bool bCurLowPenaltyRa;
94 /* algorithm related */
100 bool bNeedRecover0x948;
104 struct coex_sta_8723b_2ant {
120 u8 preWifiRssiState[4];
121 bool bC2hBtInfoReqSent;
122 u8 btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10];
123 u32 btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];
124 bool bC2hBtInquiryPage;
130 /* The following is interface which will notify coex module. */
132 void EXhalbtc8723b2ant_PowerOnSetting(struct btc_coexist *pBtCoexist);
133 void EXhalbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly);
134 void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist);
135 void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type);
136 void EXhalbtc8723b2ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type);
137 void EXhalbtc8723b2ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type);
138 void EXhalbtc8723b2ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type);
139 void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type);
140 void EXhalbtc8723b2ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type);
141 void EXhalbtc8723b2ant_BtInfoNotify(
142 struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length
144 void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist);
145 void EXhalbtc8723b2ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState);
146 void EXhalbtc8723b2ant_Periodical(struct btc_coexist *pBtCoexist);
147 void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist);