xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8189es/hal/btc/HalBtc8821aCsr2Ant.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 //===========================================
3 // The following is for 8821A_CSR 2Ant BT Co-exist definition
4 //===========================================
5 #define	BT_INFO_8821A_CSR_2ANT_B_FTP						BIT7
6 #define	BT_INFO_8821A_CSR_2ANT_B_A2DP					BIT6
7 #define	BT_INFO_8821A_CSR_2ANT_B_HID						BIT5
8 #define	BT_INFO_8821A_CSR_2ANT_B_SCO_BUSY				BIT4
9 #define	BT_INFO_8821A_CSR_2ANT_B_ACL_BUSY				BIT3
10 #define	BT_INFO_8821A_CSR_2ANT_B_INQ_PAGE				BIT2
11 #define	BT_INFO_8821A_CSR_2ANT_B_SCO_ESCO				BIT1
12 #define	BT_INFO_8821A_CSR_2ANT_B_CONNECTION				BIT0
13 
14 #define		BTC_RSSI_COEX_THRESH_TOL_8821A_CSR_2ANT		2
15 
16 typedef enum _BT_INFO_SRC_8821A_CSR_2ANT{
17 	BT_INFO_SRC_8821A_CSR_2ANT_WIFI_FW			= 0x0,
18 	BT_INFO_SRC_8821A_CSR_2ANT_BT_RSP				= 0x1,
19 	BT_INFO_SRC_8821A_CSR_2ANT_BT_ACTIVE_SEND		= 0x2,
20 	BT_INFO_SRC_8821A_CSR_2ANT_MAX
21 }BT_INFO_SRC_8821A_CSR_2ANT,*PBT_INFO_SRC_8821A_CSR_2ANT;
22 
23 typedef enum _BT_8821A_CSR_2ANT_BT_STATUS{
24 	BT_8821A_CSR_2ANT_BT_STATUS_IDLE				= 0x0,
25 	BT_8821A_CSR_2ANT_BT_STATUS_CONNECTED_IDLE	= 0x1,
26 	BT_8821A_CSR_2ANT_BT_STATUS_NON_IDLE			= 0x2,
27 	BT_8821A_CSR_2ANT_BT_STATUS_MAX
28 }BT_8821A_CSR_2ANT_BT_STATUS,*PBT_8821A_CSR_2ANT_BT_STATUS;
29 
30 typedef enum _BT_8821A_CSR_2ANT_COEX_ALGO{
31 	BT_8821A_CSR_2ANT_COEX_ALGO_UNDEFINED			= 0x0,
32 	BT_8821A_CSR_2ANT_COEX_ALGO_SCO				= 0x1,
33 	BT_8821A_CSR_2ANT_COEX_ALGO_HID				= 0x2,
34 	BT_8821A_CSR_2ANT_COEX_ALGO_A2DP				= 0x3,
35 	BT_8821A_CSR_2ANT_COEX_ALGO_A2DP_PANHS		= 0x4,
36 	BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR			= 0x5,
37 	BT_8821A_CSR_2ANT_COEX_ALGO_PANHS			= 0x6,
38 	BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_A2DP		= 0x7,
39 	BT_8821A_CSR_2ANT_COEX_ALGO_PANEDR_HID		= 0x8,
40 	BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP_PANEDR	= 0x9,
41 	BT_8821A_CSR_2ANT_COEX_ALGO_HID_A2DP			= 0xa,
42 	BT_8821A_CSR_2ANT_COEX_ALGO_MAX				= 0xb,
43 }BT_8821A_CSR_2ANT_COEX_ALGO,*PBT_8821A_CSR_2ANT_COEX_ALGO;
44 
45 typedef struct _COEX_DM_8821A_CSR_2ANT{
46 	// fw mechanism
47 	BOOLEAN		bPreDecBtPwr;
48 	BOOLEAN		bCurDecBtPwr;
49 	u1Byte		preFwDacSwingLvl;
50 	u1Byte		curFwDacSwingLvl;
51 	BOOLEAN		bCurIgnoreWlanAct;
52 	BOOLEAN		bPreIgnoreWlanAct;
53 	u1Byte		prePsTdma;
54 	u1Byte		curPsTdma;
55 	u1Byte		psTdmaPara[6];
56 	u1Byte		psTdmaDuAdjType;
57 	BOOLEAN		bResetTdmaAdjust;
58 	BOOLEAN		bPrePsTdmaOn;
59 	BOOLEAN		bCurPsTdmaOn;
60 	BOOLEAN		bPreBtAutoReport;
61 	BOOLEAN		bCurBtAutoReport;
62 
63 	// sw mechanism
64 	BOOLEAN		bPreRfRxLpfShrink;
65 	BOOLEAN		bCurRfRxLpfShrink;
66 	u4Byte		btRf0x1eBackup;
67 	BOOLEAN 	bPreLowPenaltyRa;
68 	BOOLEAN		bCurLowPenaltyRa;
69 	BOOLEAN		bPreDacSwingOn;
70 	u4Byte		preDacSwingLvl;
71 	BOOLEAN		bCurDacSwingOn;
72 	u4Byte		curDacSwingLvl;
73 	BOOLEAN		bPreAdcBackOff;
74 	BOOLEAN		bCurAdcBackOff;
75 	BOOLEAN 	bPreAgcTableEn;
76 	BOOLEAN		bCurAgcTableEn;
77 	u4Byte		preVal0x6c0;
78 	u4Byte		curVal0x6c0;
79 	u4Byte		preVal0x6c4;
80 	u4Byte		curVal0x6c4;
81 	u4Byte		preVal0x6c8;
82 	u4Byte		curVal0x6c8;
83 	u1Byte		preVal0x6cc;
84 	u1Byte		curVal0x6cc;
85 	BOOLEAN		bLimitedDig;
86 
87 	u4Byte		preRaMask;
88 	u4Byte		curRaMask;
89 
90 	u1Byte curAmpduNumType;
91 	u1Byte preAmpduNumType;
92 	u2Byte backupAmpduMaxNum;
93 
94 	u1Byte curAmpduTimeType;
95 	u1Byte preAmpduTimeType;
96 	u1Byte backupAmpduMaxTime;
97 
98 	u1Byte 		curArfrType;
99 	u1Byte 		preArfrType;
100 	u4Byte		backupArfrCnt1;
101 	u4Byte		backupArfrCnt2;
102 
103 	u1Byte		curRetryLimitType;
104 	u1Byte		preRetryLimitType;
105 	u2Byte		backupRetryLimit;
106 
107 	// algorithm related
108 	u1Byte		preAlgorithm;
109 	u1Byte		curAlgorithm;
110 	u1Byte		btStatus;
111 	u1Byte		wifiChnlInfo[3];
112 } COEX_DM_8821A_CSR_2ANT, *PCOEX_DM_8821A_CSR_2ANT;
113 
114 typedef struct _COEX_STA_8821A_CSR_2ANT{
115 	BOOLEAN					bBtLinkExist;
116 	BOOLEAN					bScoExist;
117 	BOOLEAN					bA2dpExist;
118 	BOOLEAN					bSlave;
119 	BOOLEAN					bHidExist;
120 	BOOLEAN					bPanExist;
121 
122 	BOOLEAN					bUnderLps;
123 	BOOLEAN					bUnderIps;
124 	u4Byte					highPriorityTx;
125 	u4Byte					highPriorityRx;
126 	u4Byte					lowPriorityTx;
127 	u4Byte					lowPriorityRx;
128 	u1Byte					btRssi;
129 	u1Byte					preBtRssiState;
130 	u1Byte					preWifiRssiState[4];
131 	BOOLEAN					bC2hBtInfoReqSent;
132 	u1Byte					btInfoC2h[BT_INFO_SRC_8821A_CSR_2ANT_MAX][10];
133 	u4Byte					btInfoC2hCnt[BT_INFO_SRC_8821A_CSR_2ANT_MAX];
134 	BOOLEAN					bC2hBtInquiryPage;
135 	u1Byte					btRetryCnt;
136 	u1Byte					btInfoExt;
137 }COEX_STA_8821A_CSR_2ANT, *PCOEX_STA_8821A_CSR_2ANT;
138 
139 //===========================================
140 // The following is interface which will notify coex module.
141 //===========================================
142 VOID
143 EXhalbtc8821aCsr2ant_PowerOnSetting(
144 	IN	PBTC_COEXIST		pBtCoexist
145 	);
146 VOID
147 EXhalbtc8821aCsr2ant_InitHwConfig(
148 	IN	PBTC_COEXIST		pBtCoexist,
149 	IN	BOOLEAN				bWifiOnly
150 	);
151 VOID
152 EXhalbtc8821aCsr2ant_InitCoexDm(
153 	IN	PBTC_COEXIST		pBtCoexist
154 	);
155 VOID
156 EXhalbtc8821aCsr2ant_IpsNotify(
157 	IN	PBTC_COEXIST		pBtCoexist,
158 	IN	u1Byte			type
159 	);
160 VOID
161 EXhalbtc8821aCsr2ant_LpsNotify(
162 	IN	PBTC_COEXIST		pBtCoexist,
163 	IN	u1Byte			type
164 	);
165 VOID
166 EXhalbtc8821aCsr2ant_ScanNotify(
167 	IN	PBTC_COEXIST		pBtCoexist,
168 	IN	u1Byte			type
169 	);
170 VOID
171 EXhalbtc8821aCsr2ant_ConnectNotify(
172 	IN	PBTC_COEXIST		pBtCoexist,
173 	IN	u1Byte			type
174 	);
175 VOID
176 EXhalbtc8821aCsr2ant_MediaStatusNotify(
177 	IN	PBTC_COEXIST			pBtCoexist,
178 	IN	u1Byte				type
179 	);
180 VOID
181 EXhalbtc8821aCsr2ant_SpecialPacketNotify(
182 	IN	PBTC_COEXIST			pBtCoexist,
183 	IN	u1Byte				type
184 	);
185 VOID
186 EXhalbtc8821aCsr2ant_BtInfoNotify(
187 	IN	PBTC_COEXIST		pBtCoexist,
188 	IN	pu1Byte			tmpBuf,
189 	IN	u1Byte			length
190 	);
191 VOID
192 EXhalbtc8821aCsr2ant_HaltNotify(
193 	IN	PBTC_COEXIST			pBtCoexist
194 	);
195 VOID
196 EXhalbtc8821aCsr2ant_PnpNotify(
197 	IN	PBTC_COEXIST			pBtCoexist,
198 	IN	u1Byte				pnpState
199 	);
200 VOID
201 EXhalbtc8821aCsr2ant_Periodical(
202 	IN	PBTC_COEXIST			pBtCoexist
203 	);
204 VOID
205 EXhalbtc8821aCsr2ant_DisplayCoexInfo(
206 	IN	PBTC_COEXIST		pBtCoexist
207 	);
208 
209