xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8188eu/include/hal_pg.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2017 Realtek Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  *****************************************************************************/
16 
17 #ifndef __HAL_PG_H__
18 #define __HAL_PG_H__
19 
20 #define PPG_BB_GAIN_2G_TX_OFFSET_MASK	0x0F
21 #define PPG_BB_GAIN_2G_TXB_OFFSET_MASK	0xF0
22 
23 #define PPG_BB_GAIN_5G_TX_OFFSET_MASK	0x1F
24 #define PPG_THERMAL_OFFSET_MASK			0x1F
25 #define KFREE_BB_GAIN_2G_TX_OFFSET(_ppg_v) (((_ppg_v) == PPG_BB_GAIN_2G_TX_OFFSET_MASK) ? 0 : (((_ppg_v) & 0x01) ? ((_ppg_v) >> 1) : (-((_ppg_v) >> 1))))
26 #define KFREE_BB_GAIN_2G_TXB_OFFSET(_ppg_v) (((_ppg_v) == PPG_BB_GAIN_2G_TXB_OFFSET_MASK) ? 0 : (((_ppg_v) & 0x10) ? ((_ppg_v) >> 5) : (-((_ppg_v) >> 5))))
27 #define KFREE_BB_GAIN_5G_TX_OFFSET(_ppg_v) (((_ppg_v) == PPG_BB_GAIN_5G_TX_OFFSET_MASK) ? 0 : (((_ppg_v) & 0x01) ? ((_ppg_v) >> 1) : (-((_ppg_v) >> 1))))
28 #define KFREE_THERMAL_OFFSET(_ppg_v) (((_ppg_v) == PPG_THERMAL_OFFSET_MASK) ? 0 : (((_ppg_v) & 0x01) ? ((_ppg_v) >> 1) : (-((_ppg_v) >> 1))))
29 
30 /* ****************************************************
31  *			EEPROM/Efuse PG Offset for 88EE/88EU/88ES
32  * **************************************************** */
33 #define EEPROM_ChannelPlan_88E					0xB8
34 #define EEPROM_XTAL_88E						0xB9
35 #define EEPROM_THERMAL_METER_88E				0xBA
36 #define EEPROM_IQK_LCK_88E						0xBB
37 
38 #define EEPROM_RF_BOARD_OPTION_88E			0xC1
39 #define EEPROM_RF_FEATURE_OPTION_88E			0xC2
40 #define EEPROM_RF_BT_SETTING_88E				0xC3
41 #define EEPROM_VERSION_88E						0xC4
42 #define EEPROM_CustomID_88E					0xC5
43 #define EEPROM_RF_ANTENNA_OPT_88E			0xC9
44 #define EEPROM_COUNTRY_CODE_88E				0xCB
45 
46 /* RTL88EE */
47 #define EEPROM_MAC_ADDR_88EE					0xD0
48 #define EEPROM_VID_88EE						0xD6
49 #define EEPROM_DID_88EE						0xD8
50 #define EEPROM_SVID_88EE						0xDA
51 #define EEPROM_SMID_88EE						0xDC
52 
53 /* RTL88EU */
54 #define EEPROM_MAC_ADDR_88EU					0xD7
55 #define EEPROM_VID_88EU						0xD0
56 #define EEPROM_PID_88EU						0xD2
57 #define EEPROM_USB_OPTIONAL_FUNCTION0		0xD4 /* 8188EU, 8192EU, 8812AU is the same */
58 #define EEPROM_USB_OPTIONAL_FUNCTION0_8811AU 0x104
59 
60 /* RTL88ES */
61 #define EEPROM_MAC_ADDR_88ES					0x11A
62 /* ****************************************************
63  *			EEPROM/Efuse PG Offset for 8192EE/8192EU/8192ES
64  * **************************************************** */
65 #define GET_PG_KFREE_ON_8192E(_pg_m)			LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC1, 4, 1)
66 #define GET_PG_KFREE_THERMAL_K_ON_8192E(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
67 
68 #define PPG_BB_GAIN_2G_TXA_OFFSET_8192E	0x1F6
69 #define PPG_THERMAL_OFFSET_8192E		0x1F5
70 
71 #define	EEPROM_ChannelPlan_8192E				0xB8
72 #define	EEPROM_XTAL_8192E						0xB9
73 #define	EEPROM_THERMAL_METER_8192E			0xBA
74 #define	EEPROM_IQK_LCK_8192E					0xBB
75 #define	EEPROM_2G_5G_PA_TYPE_8192E			0xBC
76 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8192E	0xBD
77 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8192E	0xBF
78 
79 #define	EEPROM_RF_BOARD_OPTION_8192E		0xC1
80 #define	EEPROM_RF_FEATURE_OPTION_8192E		0xC2
81 #define	EEPROM_RF_BT_SETTING_8192E			0xC3
82 #define	EEPROM_VERSION_8192E					0xC4
83 #define	EEPROM_CustomID_8192E				0xC5
84 #define	EEPROM_TX_BBSWING_2G_8192E			0xC6
85 #define	EEPROM_TX_BBSWING_5G_8192E			0xC7
86 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8192E	0xC8
87 #define	EEPROM_RF_ANTENNA_OPT_8192E			0xC9
88 #define	EEPROM_RFE_OPTION_8192E				0xCA
89 #define	EEPROM_RFE_OPTION_8188E				0xCA
90 #define EEPROM_COUNTRY_CODE_8192E			0xCB
91 
92 /* RTL8192EE */
93 #define	EEPROM_MAC_ADDR_8192EE				0xD0
94 #define	EEPROM_VID_8192EE						0xD6
95 #define	EEPROM_DID_8192EE						0xD8
96 #define	EEPROM_SVID_8192EE					0xDA
97 #define	EEPROM_SMID_8192EE					0xDC
98 
99 /* RTL8192EU */
100 #define	EEPROM_MAC_ADDR_8192EU				0xD7
101 #define	EEPROM_VID_8192EU						0xD0
102 #define	EEPROM_PID_8192EU						0xD2
103 #define	EEPROM_PA_TYPE_8192EU		0xBC
104 #define	EEPROM_LNA_TYPE_2G_8192EU	0xBD
105 #define	EEPROM_LNA_TYPE_5G_8192EU	0xBF
106 
107 /* RTL8192ES */
108 #define	EEPROM_MAC_ADDR_8192ES				0x11A
109 /* ****************************************************
110  *			EEPROM/Efuse PG Offset for 8812AE/8812AU/8812AS
111  * *****************************************************/
112 #define EEPROM_USB_MODE_8812					0x08
113 
114 #define EEPROM_ChannelPlan_8812				0xB8
115 #define EEPROM_XTAL_8812						0xB9
116 #define EEPROM_THERMAL_METER_8812			0xBA
117 #define EEPROM_IQK_LCK_8812					0xBB
118 #define EEPROM_2G_5G_PA_TYPE_8812			0xBC
119 #define EEPROM_2G_LNA_TYPE_GAIN_SEL_8812	0xBD
120 #define EEPROM_5G_LNA_TYPE_GAIN_SEL_8812	0xBF
121 
122 #define EEPROM_RF_BOARD_OPTION_8812			0xC1
123 #define EEPROM_RF_FEATURE_OPTION_8812		0xC2
124 #define EEPROM_RF_BT_SETTING_8812				0xC3
125 #define EEPROM_VERSION_8812					0xC4
126 #define EEPROM_CustomID_8812					0xC5
127 #define EEPROM_TX_BBSWING_2G_8812			0xC6
128 #define EEPROM_TX_BBSWING_5G_8812			0xC7
129 #define EEPROM_TX_PWR_CALIBRATE_RATE_8812	0xC8
130 #define EEPROM_RF_ANTENNA_OPT_8812			0xC9
131 #define EEPROM_RFE_OPTION_8812				0xCA
132 #define EEPROM_COUNTRY_CODE_8812			0xCB
133 
134 /* RTL8812AE */
135 #define EEPROM_MAC_ADDR_8812AE				0xD0
136 #define EEPROM_VID_8812AE						0xD6
137 #define EEPROM_DID_8812AE						0xD8
138 #define EEPROM_SVID_8812AE						0xDA
139 #define EEPROM_SMID_8812AE					0xDC
140 
141 /* RTL8812AU */
142 #define EEPROM_MAC_ADDR_8812AU				0xD7
143 #define EEPROM_VID_8812AU						0xD0
144 #define EEPROM_PID_8812AU						0xD2
145 #define EEPROM_PA_TYPE_8812AU					0xBC
146 #define EEPROM_LNA_TYPE_2G_8812AU			0xBD
147 #define EEPROM_LNA_TYPE_5G_8812AU			0xBF
148 
149 /* RTL8814AU */
150 #define	EEPROM_MAC_ADDR_8814AU				0xD8
151 #define	EEPROM_VID_8814AU						0xD0
152 #define	EEPROM_PID_8814AU						0xD2
153 #define	EEPROM_PA_TYPE_8814AU				0xBC
154 #define	EEPROM_LNA_TYPE_2G_8814AU			0xBD
155 #define	EEPROM_LNA_TYPE_5G_8814AU			0xBF
156 
157 /* RTL8814AE */
158 #define EEPROM_MAC_ADDR_8814AE				0xD0
159 #define EEPROM_VID_8814AE						0xD6
160 #define EEPROM_DID_8814AE						0xD8
161 #define EEPROM_SVID_8814AE						0xDA
162 #define EEPROM_SMID_8814AE					0xDC
163 
164 /* ****************************************************
165  *			EEPROM/Efuse PG Offset for 8814AU
166  * **************************************************** */
167 #define GET_PG_KFREE_ON_8814A(_pg_m)			LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 4, 1)
168 #define GET_PG_KFREE_THERMAL_K_ON_8814A(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
169 #define GET_PG_TX_POWER_TRACKING_MODE_8814A(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 6, 2)
170 
171 #define KFREE_GAIN_DATA_LENGTH_8814A	22
172 
173 #define PPG_BB_GAIN_2G_TXBA_OFFSET_8814A	0x3EE
174 
175 #define PPG_THERMAL_OFFSET_8814A		0x3EF
176 
177 #define EEPROM_USB_MODE_8814A				0x0E
178 #define EEPROM_ChannelPlan_8814				0xB8
179 #define EEPROM_XTAL_8814					0xB9
180 #define EEPROM_THERMAL_METER_8814			0xBA
181 #define	EEPROM_IQK_LCK_8814					0xBB
182 
183 
184 #define EEPROM_PA_TYPE_8814					0xBC
185 #define EEPROM_LNA_TYPE_AB_2G_8814			0xBD
186 #define	EEPROM_LNA_TYPE_CD_2G_8814			0xBE
187 #define EEPROM_LNA_TYPE_AB_5G_8814			0xBF
188 #define EEPROM_LNA_TYPE_CD_5G_8814			0xC0
189 #define	EEPROM_RF_BOARD_OPTION_8814			0xC1
190 #define	EEPROM_RF_BT_SETTING_8814			0xC3
191 #define	EEPROM_VERSION_8814					0xC4
192 #define	EEPROM_CustomID_8814				0xC5
193 #define	EEPROM_TX_BBSWING_2G_8814			0xC6
194 #define	EEPROM_TX_BBSWING_5G_8814			0xC7
195 #define EEPROM_TRX_ANTENNA_OPTION_8814		0xC9
196 #define	EEPROM_RFE_OPTION_8814				0xCA
197 #define EEPROM_COUNTRY_CODE_8814			0xCB
198 
199 /*Extra Info for 8814A Initial Gain Fine Tune  suggested by Willis, JIRA: MP123*/
200 #define	EEPROM_IG_OFFSET_4_AB_2G_8814A				0x120
201 #define	EEPROM_IG_OFFSET_4_CD_2G_8814A				0x121
202 #define	EEPROM_IG_OFFSET_4_AB_5GL_8814A				0x122
203 #define	EEPROM_IG_OFFSET_4_CD_5GL_8814A				0x123
204 #define	EEPROM_IG_OFFSET_4_AB_5GM_8814A				0x124
205 #define	EEPROM_IG_OFFSET_4_CD_5GM_8814A				0x125
206 #define	EEPROM_IG_OFFSET_4_AB_5GH_8814A				0x126
207 #define	EEPROM_IG_OFFSET_4_CD_5GH_8814A				0x127
208 
209 /* ****************************************************
210  *			EEPROM/Efuse PG Offset for 8821AE/8821AU/8821AS
211  * **************************************************** */
212 
213 #define GET_PG_KFREE_ON_8821A(_pg_m)			LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 4, 1)
214 #define GET_PG_KFREE_THERMAL_K_ON_8821A(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
215 
216 #define PPG_BB_GAIN_2G_TXA_OFFSET_8821A		0x1F6
217 #define PPG_THERMAL_OFFSET_8821A			0x1F5
218 #define PPG_BB_GAIN_5GLB1_TXA_OFFSET_8821A	0x1F4
219 #define PPG_BB_GAIN_5GLB2_TXA_OFFSET_8821A	0x1F3
220 #define PPG_BB_GAIN_5GMB1_TXA_OFFSET_8821A	0x1F2
221 #define PPG_BB_GAIN_5GMB2_TXA_OFFSET_8821A	0x1F1
222 #define PPG_BB_GAIN_5GHB_TXA_OFFSET_8821A	0x1F0
223 
224 #define EEPROM_ChannelPlan_8821				0xB8
225 #define EEPROM_XTAL_8821						0xB9
226 #define EEPROM_THERMAL_METER_8821			0xBA
227 #define EEPROM_IQK_LCK_8821					0xBB
228 
229 
230 #define EEPROM_RF_BOARD_OPTION_8821			0xC1
231 #define EEPROM_RF_FEATURE_OPTION_8821		0xC2
232 #define EEPROM_RF_BT_SETTING_8821				0xC3
233 #define EEPROM_VERSION_8821					0xC4
234 #define EEPROM_CustomID_8821					0xC5
235 #define EEPROM_RF_ANTENNA_OPT_8821			0xC9
236 
237 /* RTL8821AE */
238 #define EEPROM_MAC_ADDR_8821AE				0xD0
239 #define EEPROM_VID_8821AE						0xD6
240 #define EEPROM_DID_8821AE						0xD8
241 #define EEPROM_SVID_8821AE						0xDA
242 #define EEPROM_SMID_8821AE					0xDC
243 
244 /* RTL8821AU */
245 #define EEPROM_PA_TYPE_8821AU					0xBC
246 #define EEPROM_LNA_TYPE_8821AU				0xBF
247 
248 /* RTL8821AS */
249 #define EEPROM_MAC_ADDR_8821AS				0x11A
250 
251 /* RTL8821AU */
252 #define EEPROM_MAC_ADDR_8821AU				0x107
253 #define EEPROM_VID_8821AU						0x100
254 #define EEPROM_PID_8821AU						0x102
255 
256 
257 /* ****************************************************
258  *			EEPROM/Efuse PG Offset for 8192 SE/SU
259  * **************************************************** */
260 #define EEPROM_VID_92SE						0x0A
261 #define EEPROM_DID_92SE						0x0C
262 #define EEPROM_SVID_92SE						0x0E
263 #define EEPROM_SMID_92SE						0x10
264 
265 #define EEPROM_MAC_ADDR_92S					0x12
266 
267 #define EEPROM_TSSI_A_92SE						0x74
268 #define EEPROM_TSSI_B_92SE						0x75
269 
270 #define EEPROM_Version_92SE					0x7C
271 
272 
273 #define EEPROM_VID_92SU						0x08
274 #define EEPROM_PID_92SU						0x0A
275 
276 #define EEPROM_Version_92SU					0x50
277 #define EEPROM_TSSI_A_92SU						0x6b
278 #define EEPROM_TSSI_B_92SU						0x6c
279 
280 /* ====================================================
281 	EEPROM/Efuse PG Offset for 8188FE/8188FU/8188FS
282    ====================================================
283  */
284 
285 #define GET_PG_KFREE_ON_8188F(_pg_m)			LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC1, 4, 1)
286 #define GET_PG_KFREE_THERMAL_K_ON_8188F(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
287 
288 #define PPG_BB_GAIN_2G_TXA_OFFSET_8188F	0xEE
289 #define PPG_THERMAL_OFFSET_8188F		0xEF
290 
291 #define	EEPROM_ChannelPlan_8188F			0xB8
292 #define	EEPROM_XTAL_8188F					0xB9
293 #define	EEPROM_THERMAL_METER_8188F			0xBA
294 #define	EEPROM_IQK_LCK_8188F				0xBB
295 #define	EEPROM_2G_5G_PA_TYPE_8188F			0xBC
296 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8188F	0xBD
297 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8188F	0xBF
298 
299 #define	EEPROM_RF_BOARD_OPTION_8188F		0xC1
300 #define	EEPROM_FEATURE_OPTION_8188F			0xC2
301 #define	EEPROM_RF_BT_SETTING_8188F			0xC3
302 #define	EEPROM_VERSION_8188F				0xC4
303 #define	EEPROM_CustomID_8188F				0xC5
304 #define	EEPROM_TX_BBSWING_2G_8188F			0xC6
305 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8188F	0xC8
306 #define	EEPROM_RF_ANTENNA_OPT_8188F			0xC9
307 #define	EEPROM_RFE_OPTION_8188F				0xCA
308 #define EEPROM_COUNTRY_CODE_8188F			0xCB
309 #define EEPROM_CUSTOMER_ID_8188F			0x7F
310 #define EEPROM_SUBCUSTOMER_ID_8188F			0x59
311 
312 /* RTL8188FU */
313 #define EEPROM_MAC_ADDR_8188FU				0xD7
314 #define EEPROM_VID_8188FU					0xD0
315 #define EEPROM_PID_8188FU					0xD2
316 #define EEPROM_PA_TYPE_8188FU				0xBC
317 #define EEPROM_LNA_TYPE_2G_8188FU			0xBD
318 #define EEPROM_USB_OPTIONAL_FUNCTION0_8188FU 0xD4
319 
320 /* RTL8188FS */
321 #define	EEPROM_MAC_ADDR_8188FS				0x11A
322 #define EEPROM_Voltage_ADDR_8188F			0x8
323 
324 /* ====================================================
325 	EEPROM/Efuse PG Offset for 8188GTV/8188GTVS
326    ====================================================
327  */
328 
329 #define GET_PG_KFREE_ON_8188GTV(_pg_m)				LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC1, 4, 1)
330 #define GET_PG_KFREE_THERMAL_K_ON_8188GTV(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
331 
332 #define PPG_BB_GAIN_2G_TXA_OFFSET_8188GTV	0xEE
333 #define PPG_THERMAL_OFFSET_8188GTV			0xEF
334 
335 #define	EEPROM_ChannelPlan_8188GTV				0xB8
336 #define	EEPROM_XTAL_8188GTV						0xB9
337 #define	EEPROM_THERMAL_METER_8188GTV			0xBA
338 #define	EEPROM_IQK_LCK_8188GTV					0xBB
339 #define	EEPROM_2G_5G_PA_TYPE_8188GTV			0xBC
340 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8188GTV		0xBD
341 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8188GTV		0xBF
342 
343 #define	EEPROM_RF_BOARD_OPTION_8188GTV			0xC1
344 #define	EEPROM_FEATURE_OPTION_8188GTV			0xC2
345 #define	EEPROM_RF_BT_SETTING_8188GTV			0xC3
346 #define	EEPROM_VERSION_8188GTV					0xC4
347 #define	EEPROM_CustomID_8188GTV					0xC5
348 #define	EEPROM_TX_BBSWING_2G_8188GTV			0xC6
349 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8188GTV	0xC8
350 #define	EEPROM_RF_ANTENNA_OPT_8188GTV			0xC9
351 #define	EEPROM_RFE_OPTION_8188GTV				0xCA
352 #define EEPROM_COUNTRY_CODE_8188GTV				0xCB
353 #define EEPROM_CUSTOMER_ID_8188GTV				0x7F
354 #define EEPROM_SUBCUSTOMER_ID_8188GTV			0x59
355 
356 /* RTL8188GTVU */
357 #define EEPROM_MAC_ADDR_8188GTVU				0xD7
358 #define EEPROM_VID_8188GTVU						0xD0
359 #define EEPROM_PID_8188GTVU						0xD2
360 #define EEPROM_PA_TYPE_8188GTVU					0xBC
361 #define EEPROM_LNA_TYPE_2G_8188GTVU				0xBD
362 #define EEPROM_USB_OPTIONAL_FUNCTION0_8188GTVU	0xD4
363 
364 /* RTL8188GTVS */
365 #define	EEPROM_MAC_ADDR_8188GTVS				0x11A
366 #define EEPROM_Voltage_ADDR_8188GTV				0x8
367 
368 /* ****************************************************
369  *			EEPROM/Efuse PG Offset for 8723BE/8723BU/8723BS
370  * *****************************************************/
371 #define	EEPROM_ChannelPlan_8723B				0xB8
372 #define	EEPROM_XTAL_8723B						0xB9
373 #define	EEPROM_THERMAL_METER_8723B			0xBA
374 #define	EEPROM_IQK_LCK_8723B					0xBB
375 #define	EEPROM_2G_5G_PA_TYPE_8723B			0xBC
376 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8723B	0xBD
377 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8723B	0xBF
378 
379 #define	EEPROM_RF_BOARD_OPTION_8723B		0xC1
380 #define	EEPROM_FEATURE_OPTION_8723B			0xC2
381 #define	EEPROM_RF_BT_SETTING_8723B			0xC3
382 #define	EEPROM_VERSION_8723B					0xC4
383 #define	EEPROM_CustomID_8723B				0xC5
384 #define	EEPROM_TX_BBSWING_2G_8723B			0xC6
385 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8723B	0xC8
386 #define	EEPROM_RF_ANTENNA_OPT_8723B		0xC9
387 #define	EEPROM_RFE_OPTION_8723B				0xCA
388 #define EEPROM_COUNTRY_CODE_8723B			0xCB
389 
390 /* RTL8723BE */
391 #define EEPROM_MAC_ADDR_8723BE				0xD0
392 #define EEPROM_VID_8723BE						0xD6
393 #define EEPROM_DID_8723BE						0xD8
394 #define EEPROM_SVID_8723BE						0xDA
395 #define EEPROM_SMID_8723BE						0xDC
396 
397 /* RTL8723BU */
398 #define EEPROM_MAC_ADDR_8723BU				0x107
399 #define EEPROM_VID_8723BU						0x100
400 #define EEPROM_PID_8723BU						0x102
401 #define EEPROM_PA_TYPE_8723BU					0xBC
402 #define EEPROM_LNA_TYPE_2G_8723BU				0xBD
403 
404 
405 /* RTL8723BS */
406 #define	EEPROM_MAC_ADDR_8723BS				0x11A
407 #define EEPROM_Voltage_ADDR_8723B			0x8
408 
409 /* ****************************************************
410  *			EEPROM/Efuse PG Offset for 8703B
411  * **************************************************** */
412 #define GET_PG_KFREE_ON_8703B(_pg_m)			LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC1, 4, 1)
413 #define GET_PG_KFREE_THERMAL_K_ON_8703B(_pg_m)	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
414 
415 #define PPG_BB_GAIN_2G_TXA_OFFSET_8703B	0xEE
416 #define PPG_THERMAL_OFFSET_8703B		0xEF
417 
418 #define	EEPROM_ChannelPlan_8703B				0xB8
419 #define	EEPROM_XTAL_8703B					0xB9
420 #define	EEPROM_THERMAL_METER_8703B			0xBA
421 #define	EEPROM_IQK_LCK_8703B					0xBB
422 #define	EEPROM_2G_5G_PA_TYPE_8703B			0xBC
423 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8703B	0xBD
424 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8703B	0xBF
425 
426 #define	EEPROM_RF_BOARD_OPTION_8703B		0xC1
427 #define	EEPROM_FEATURE_OPTION_8703B			0xC2
428 #define	EEPROM_RF_BT_SETTING_8703B			0xC3
429 #define	EEPROM_VERSION_8703B					0xC4
430 #define	EEPROM_CustomID_8703B					0xC5
431 #define	EEPROM_TX_BBSWING_2G_8703B			0xC6
432 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8703B	0xC8
433 #define	EEPROM_RF_ANTENNA_OPT_8703B		0xC9
434 #define	EEPROM_RFE_OPTION_8703B				0xCA
435 #define EEPROM_COUNTRY_CODE_8703B			0xCB
436 
437 /* RTL8703BU */
438 #define EEPROM_MAC_ADDR_8703BU                          0x107
439 #define EEPROM_VID_8703BU                               0x100
440 #define EEPROM_PID_8703BU                               0x102
441 #define EEPROM_USB_OPTIONAL_FUNCTION0_8703BU            0x104
442 #define EEPROM_PA_TYPE_8703BU                           0xBC
443 #define EEPROM_LNA_TYPE_2G_8703BU                       0xBD
444 
445 /* RTL8703BS */
446 #define	EEPROM_MAC_ADDR_8703BS				0x11A
447 #define	EEPROM_Voltage_ADDR_8703B			0x8
448 
449 /*
450  * ====================================================
451  *	EEPROM/Efuse PG Offset for 8822B
452  * ====================================================
453  */
454 #define	EEPROM_ChannelPlan_8822B		0xB8
455 #define	EEPROM_XTAL_8822B			0xB9
456 #define	EEPROM_THERMAL_METER_8822B		0xBA
457 #define	EEPROM_IQK_LCK_8822B			0xBB
458 #define	EEPROM_2G_5G_PA_TYPE_8822B		0xBC
459 /* PATH A & PATH B */
460 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_AB_8822B	0xBD
461 /* PATH C & PATH D */
462 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_CD_8822B	0xBE
463 /* PATH A & PATH B */
464 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_AB_8822B	0xBF
465 /* PATH C & PATH D */
466 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_CD_8822B	0xC0
467 
468 #define	EEPROM_RF_BOARD_OPTION_8822B		0xC1
469 #define	EEPROM_FEATURE_OPTION_8822B		0xC2
470 #define	EEPROM_RF_BT_SETTING_8822B		0xC3
471 #define	EEPROM_VERSION_8822B			0xC4
472 #define	EEPROM_CustomID_8822B			0xC5
473 #define	EEPROM_TX_BBSWING_2G_8822B		0xC6
474 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8822B	0xC8
475 #define	EEPROM_RF_ANTENNA_OPT_8822B		0xC9
476 #define	EEPROM_RFE_OPTION_8822B			0xCA
477 #define EEPROM_COUNTRY_CODE_8822B		0xCB
478 
479 /* RTL8822BU */
480 #define EEPROM_MAC_ADDR_8822BU			0x107
481 #define EEPROM_VID_8822BU			0x100
482 #define EEPROM_PID_8822BU			0x102
483 #define EEPROM_USB_OPTIONAL_FUNCTION0_8822BU	0x104
484 #define EEPROM_USB_MODE_8822BU			0x06
485 
486 /* RTL8822BS */
487 #define	EEPROM_MAC_ADDR_8822BS			0x11A
488 
489 /* RTL8822BE */
490 #define	EEPROM_MAC_ADDR_8822BE			0xD0
491 /*
492  * ====================================================
493  *	EEPROM/Efuse PG Offset for 8821C
494  * ====================================================
495  */
496 #define	EEPROM_CHANNEL_PLAN_8821C		0xB8
497 #define	EEPROM_XTAL_8821C			0xB9
498 #define	EEPROM_THERMAL_METER_8821C		0xBA
499 #define	EEPROM_IQK_LCK_8821C			0xBB
500 #define	EEPROM_2G_5G_PA_TYPE_8821C		0xBC
501 /* PATH A & PATH B */
502 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_AB_8821C	0xBD
503 /* PATH C & PATH D */
504 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_CD_8821C	0xBE
505 /* PATH A & PATH B */
506 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_AB_8821C	0xBF
507 /* PATH C & PATH D */
508 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_CD_8821C	0xC0
509 
510 #define	EEPROM_RF_BOARD_OPTION_8821C		0xC1
511 #define	EEPROM_FEATURE_OPTION_8821C		0xC2
512 #define	EEPROM_RF_BT_SETTING_8821C		0xC3
513 #define	EEPROM_VERSION_8821C			0xC4
514 #define	EEPROM_CUSTOMER_ID_8821C			0xC5
515 #define	EEPROM_TX_BBSWING_2G_8821C		0xC6
516 #define	EEPROM_TX_BBSWING_5G_8821C		0xC7
517 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8821C	0xC8
518 #define	EEPROM_RF_ANTENNA_OPT_8821C		0xC9
519 #define	EEPROM_RFE_OPTION_8821C			0xCA
520 #define EEPROM_COUNTRY_CODE_8821C		0xCB
521 
522 /* RTL8821CU */
523 #define EEPROM_MAC_ADDR_8821CU			0x107
524 #define EEPROM_VID_8821CU					0x100
525 #define EEPROM_PID_8821CU					0x102
526 #define EEPROM_USB_OPTIONAL_FUNCTION0_8821CU	0x104
527 #define EEPROM_USB_MODE_8821CU			0x06
528 
529 /* RTL8821CS */
530 #define	EEPROM_MAC_ADDR_8821CS			0x11A
531 
532 /* RTL8821CE */
533 #define	EEPROM_MAC_ADDR_8821CE			0xD0
534 /* ****************************************************
535  *	EEPROM/Efuse PG Offset for 8723D
536  * **************************************************** */
537 #define GET_PG_KFREE_ON_8723D(_pg_m)	\
538 	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC1, 4, 1)
539 #define GET_PG_KFREE_THERMAL_K_ON_8723D(_pg_m)	\
540 	LE_BITS_TO_1BYTE(((u8 *)(_pg_m)) + 0xC8, 5, 1)
541 
542 #define PPG_8723D_S1	0
543 #define PPG_8723D_S0	1
544 
545 #define PPG_BB_GAIN_2G_TXA_OFFSET_8723D		0xEE
546 #define PPG_BB_GAIN_2G_TX_OFFSET_8723D		0x1EE
547 #define PPG_THERMAL_OFFSET_8723D		0xEF
548 
549 #define	EEPROM_ChannelPlan_8723D		0xB8
550 #define	EEPROM_XTAL_8723D			0xB9
551 #define	EEPROM_THERMAL_METER_8723D		0xBA
552 #define	EEPROM_IQK_LCK_8723D			0xBB
553 #define	EEPROM_2G_5G_PA_TYPE_8723D		0xBC
554 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8723D	0xBD
555 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8723D	0xBF
556 
557 #define	EEPROM_RF_BOARD_OPTION_8723D		0xC1
558 #define	EEPROM_FEATURE_OPTION_8723D		0xC2
559 #define	EEPROM_RF_BT_SETTING_8723D		0xC3
560 #define	EEPROM_VERSION_8723D			0xC4
561 #define	EEPROM_CustomID_8723D			0xC5
562 #define	EEPROM_TX_BBSWING_2G_8723D		0xC6
563 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8723D	0xC8
564 #define	EEPROM_RF_ANTENNA_OPT_8723D		0xC9
565 #define	EEPROM_RFE_OPTION_8723D			0xCA
566 #define EEPROM_COUNTRY_CODE_8723D		0xCB
567 
568 /* RTL8723DE */
569 #define EEPROM_MAC_ADDR_8723DE              0xD0
570 #define EEPROM_VID_8723DE                   0xD6
571 #define EEPROM_DID_8723DE                   0xD8
572 #define EEPROM_SVID_8723DE                  0xDA
573 #define EEPROM_SMID_8723DE                  0xDC
574 
575 /* RTL8723DU */
576 #define EEPROM_MAC_ADDR_8723DU                  0x107
577 #define EEPROM_VID_8723DU                       0x100
578 #define EEPROM_PID_8723DU                       0x102
579 #define EEPROM_USB_OPTIONAL_FUNCTION0_8723DU    0x104
580 
581 /* RTL8723BS */
582 #define	EEPROM_MAC_ADDR_8723DS			0x11A
583 #define	EEPROM_Voltage_ADDR_8723D		0x8
584 
585 /*
586  * ====================================================
587  *	EEPROM/Efuse PG Offset for 8822C
588  * ====================================================
589  */
590 #define	EEPROM_TX_PWR_INX_8822C			0x10
591 #define	EEPROM_ChannelPlan_8822C		0xB8
592 #define	EEPROM_XTAL_8822C			0xB9
593 #define	EEPROM_IQK_LCK_8822C			0xBB
594 #define	EEPROM_2G_5G_PA_TYPE_8822C		0xBC
595 /* PATH A & PATH B */
596 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_AB_8822C	0xBD
597 /* PATH C & PATH D */
598 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_CD_8822C	0xBE
599 /* PATH A & PATH B */
600 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_AB_8822C	0xBF
601 /* PATH C & PATH D */
602 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_CD_8822C	0xC0
603 
604 #define	EEPROM_RF_BOARD_OPTION_8822C		0xC1
605 #define	EEPROM_FEATURE_OPTION_8822C		0xC2
606 #define	EEPROM_RF_BT_SETTING_8822C		0xC3
607 #define	EEPROM_VERSION_8822C			0xC4
608 #define	EEPROM_CustomID_8822C			0xC5
609 #define	EEPROM_TX_BBSWING_2G_8822C		0xC6
610 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8822C	0xC8
611 #define	EEPROM_RF_ANTENNA_OPT_8822C		0xC9
612 #define	EEPROM_RFE_OPTION_8822C			0xCA
613 #define EEPROM_COUNTRY_CODE_8822C		0xCB
614 #define	EEPROM_THERMAL_METER_A_8822C		0xD0
615 #define	EEPROM_THERMAL_METER_B_8822C		0xD1
616 /* RTL8822CU */
617 #define EEPROM_MAC_ADDR_8822CU			0x157
618 #define EEPROM_VID_8822CU			0x100
619 #define EEPROM_PID_8822CU			0x102
620 #define EEPROM_USB_OPTIONAL_FUNCTION0_8822CU	0x104
621 #define EEPROM_USB_MODE_8822CU			0x06
622 
623 /* RTL8822CS */
624 #define	EEPROM_MAC_ADDR_8822CS			0x16A
625 
626 /* RTL8822CE */
627 #define	EEPROM_MAC_ADDR_8822CE			0x120
628 
629 /* ****************************************************
630  *	EEPROM/Efuse PG Offset for 8192F
631  * **************************************************** */
632 #define	EEPROM_ChannelPlan_8192F			0xB8
633 #define	EEPROM_XTAL_8192F					0xB9
634 #define	EEPROM_THERMAL_METER_8192F			0xBA
635 #define	EEPROM_IQK_LCK_8192F				0xBB
636 #define	EEPROM_2G_5G_PA_TYPE_8192F			0xBC
637 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8192F	0xBD
638 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8192F	0xBF
639 
640 #define	EEPROM_RF_BOARD_OPTION_8192F		0xC1
641 #define	EEPROM_FEATURE_OPTION_8192F			0xC2
642 #define	EEPROM_RF_BT_SETTING_8192F			0xC3
643 #define	EEPROM_VERSION_8192F				0xC4
644 #define	EEPROM_CustomID_8192F				0xC5
645 #define	EEPROM_TX_BBSWING_2G_8192F			0xC6
646 #define	EEPROM_TX_BBSWING_5G_8192F			0xC7
647 #define	EEPROM_TX_PWR_CALIBRATE_RATE_8192F	0xC8
648 #define	EEPROM_RF_ANTENNA_OPT_8192F			0xC9
649 #define	EEPROM_RFE_OPTION_8192F				0xCA
650 #define EEPROM_COUNTRY_CODE_8192F			0xCB
651 /*RTL8192FS*/
652 #define	EEPROM_MAC_ADDR_8192FS				0x11A
653 #define EEPROM_Voltage_ADDR_8192F			0x8
654 /* RTL8192FU */
655 #define EEPROM_MAC_ADDR_8192FU					0x107
656 #define EEPROM_VID_8192FU							0x100
657 #define EEPROM_PID_8192FU							0x102
658 #define EEPROM_USB_OPTIONAL_FUNCTION0_8192FU	0x104
659 /* RTL8192FE */
660 #define EEPROM_MAC_ADDR_8192FE					0xD0
661 #define EEPROM_VID_8192FE							0xD6
662 #define EEPROM_DID_8192FE							0xD8
663 #define EEPROM_SVID_8192FE							0xDA
664 #define EEPROM_SMID_8192FE						0xDC
665 
666 /* ****************************************************
667  *	EEPROM/Efuse PG Offset for 8710B
668  * **************************************************** */
669 #define RTL_EEPROM_ID_8710B 					0x8195
670 #define EEPROM_Default_ThermalMeter_8710B		0x1A
671 
672 #define	EEPROM_CHANNEL_PLAN_8710B			0xC8
673 #define	EEPROM_XTAL_8710B					0xC9
674 #define	EEPROM_THERMAL_METER_8710B			0xCA
675 #define	EEPROM_IQK_LCK_8710B					0xCB
676 #define	EEPROM_2G_5G_PA_TYPE_8710B			0xCC
677 #define	EEPROM_2G_LNA_TYPE_GAIN_SEL_8710B	0xCD
678 #define	EEPROM_5G_LNA_TYPE_GAIN_SEL_8710B	0xCF
679 #define 	EEPROM_TX_KFREE_8710B				0xEE    //Physical  Efuse Address
680 #define 	EEPROM_THERMAL_8710B				0xEF    //Physical  Efuse Address
681 #define 	EEPROM_PACKAGE_TYPE_8710B			0xF8    //Physical  Efuse Address
682 
683 #define EEPROM_RF_BOARD_OPTION_8710B		0x131
684 #define EEPROM_RF_FEATURE_OPTION_8710B		0x132
685 #define EEPROM_RF_BT_SETTING_8710B			0x133
686 #define EEPROM_VERSION_8710B					0x134
687 #define EEPROM_CUSTOM_ID_8710B				0x135
688 #define EEPROM_TX_BBSWING_2G_8710B			0x136
689 #define EEPROM_TX_BBSWING_5G_8710B			0x137
690 #define EEPROM_TX_PWR_CALIBRATE_RATE_8710B	0x138
691 #define EEPROM_RF_ANTENNA_OPT_8710B			0x139
692 #define EEPROM_RFE_OPTION_8710B				0x13A
693 #define EEPROM_COUNTRY_CODE_8710B			0x13B
694 #define EEPROM_COUNTRY_CODE_2_8710B			0x13C
695 
696 #define EEPROM_MAC_ADDR_8710B 				0x11A
697 #define EEPROM_VID_8710BU						0x1C0
698 #define EEPROM_PID_8710BU						0x1C2
699 
700 /* ****************************************************
701  *			EEPROM/Efuse Value Type
702  * **************************************************** */
703 #define EETYPE_TX_PWR							0x0
704 #define EETYPE_MAX_RFE_8192F					0x31
705 /* ****************************************************
706  *			EEPROM/Efuse Default Value
707  * **************************************************** */
708 #define EEPROM_CID_DEFAULT					0x0
709 #define EEPROM_CID_DEFAULT_EXT				0xFF /* Reserved for Realtek */
710 #define EEPROM_CID_TOSHIBA						0x4
711 #define EEPROM_CID_CCX							0x10
712 #define EEPROM_CID_QMI							0x0D
713 #define EEPROM_CID_WHQL						0xFE
714 
715 #define EEPROM_CHANNEL_PLAN_FCC				0x0
716 #define EEPROM_CHANNEL_PLAN_IC				0x1
717 #define EEPROM_CHANNEL_PLAN_ETSI				0x2
718 #define EEPROM_CHANNEL_PLAN_SPAIN			0x3
719 #define EEPROM_CHANNEL_PLAN_FRANCE			0x4
720 #define EEPROM_CHANNEL_PLAN_MKK				0x5
721 #define EEPROM_CHANNEL_PLAN_MKK1				0x6
722 #define EEPROM_CHANNEL_PLAN_ISRAEL			0x7
723 #define EEPROM_CHANNEL_PLAN_TELEC			0x8
724 #define EEPROM_CHANNEL_PLAN_GLOBAL_DOMAIN	0x9
725 #define EEPROM_CHANNEL_PLAN_WORLD_WIDE_13	0xA
726 #define EEPROM_CHANNEL_PLAN_NCC_TAIWAN		0xB
727 #define EEPROM_CHANNEL_PLAN_CHIAN			0XC
728 #define EEPROM_CHANNEL_PLAN_SINGAPORE_INDIA_MEXICO  0XD
729 #define EEPROM_CHANNEL_PLAN_KOREA			0xE
730 #define EEPROM_CHANNEL_PLAN_TURKEY	0xF
731 #define EEPROM_CHANNEL_PLAN_JAPAN	0x10
732 #define EEPROM_CHANNEL_PLAN_FCC_NO_DFS		0x11
733 #define EEPROM_CHANNEL_PLAN_JAPAN_NO_DFS	0x12
734 #define EEPROM_CHANNEL_PLAN_WORLD_WIDE_5G	0x13
735 #define EEPROM_CHANNEL_PLAN_TAIWAN_NO_DFS	0x14
736 
737 #define EEPROM_USB_OPTIONAL1					0xE
738 #define EEPROM_CHANNEL_PLAN_BY_HW_MASK		0x80
739 
740 #define RTL_EEPROM_ID							0x8129
741 #define EEPROM_Default_TSSI						0x0
742 #define EEPROM_Default_BoardType				0x02
743 #define EEPROM_Default_ThermalMeter			0x12
744 #define EEPROM_Default_ThermalMeter_92SU		0x7
745 #define EEPROM_Default_ThermalMeter_88E		0x18
746 #define EEPROM_Default_ThermalMeter_8812		0x18
747 #define	EEPROM_Default_ThermalMeter_8192E			0x1A
748 #define	EEPROM_Default_ThermalMeter_8723B		0x18
749 #define	EEPROM_Default_ThermalMeter_8703B		0x18
750 #define	EEPROM_Default_ThermalMeter_8723D		0x18
751 #define	EEPROM_Default_ThermalMeter_8188F		0x18
752 #define	EEPROM_Default_ThermalMeter_8188GTV		0x18
753 #define EEPROM_Default_ThermalMeter_8814A		0x18
754 #define	EEPROM_Default_ThermalMeter_8192F		0x1A
755 
756 #define EEPROM_Default_CrystalCap				0x0
757 #define EEPROM_Default_CrystalCap_8723A		0x20
758 #define EEPROM_Default_CrystalCap_88E			0x20
759 #define EEPROM_Default_CrystalCap_8812			0x20
760 #define EEPROM_Default_CrystalCap_8814			0x20
761 #define EEPROM_Default_CrystalCap_8192E			0x20
762 #define EEPROM_Default_CrystalCap_8723B			0x20
763 #define EEPROM_Default_CrystalCap_8703B			0x20
764 #define EEPROM_Default_CrystalCap_8723D			0x20
765 #define EEPROM_Default_CrystalCap_8188F			0x20
766 #define EEPROM_Default_CrystalCap_8188GTV		0x20
767 #define EEPROM_Default_CrystalCap_8192F			0x20
768 #define EEPROM_Default_CrystalCap_8822C			0x3F
769 #define EEPROM_Default_CrystalFreq				0x0
770 #define EEPROM_Default_TxPowerLevel_92C		0x22
771 #define EEPROM_Default_TxPowerLevel_2G			0x2C
772 #define EEPROM_Default_TxPowerLevel_5G			0x22
773 #define EEPROM_Default_TxPowerLevel			0x22
774 #define EEPROM_Default_HT40_2SDiff				0x0
775 #define EEPROM_Default_HT20_Diff				2
776 #define EEPROM_Default_LegacyHTTxPowerDiff		0x3
777 #define EEPROM_Default_LegacyHTTxPowerDiff_92C	0x3
778 #define EEPROM_Default_LegacyHTTxPowerDiff_92D	0x4
779 #define EEPROM_Default_HT40_PwrMaxOffset		0
780 #define EEPROM_Default_HT20_PwrMaxOffset		0
781 
782 #define EEPROM_Default_PID						0x1234
783 #define EEPROM_Default_VID						0x5678
784 #define EEPROM_Default_CustomerID				0xAB
785 #define EEPROM_Default_CustomerID_8188E		0x00
786 #define EEPROM_Default_SubCustomerID			0xCD
787 #define EEPROM_Default_Version					0
788 
789 #define EEPROM_Default_externalPA_C9		0x00
790 #define EEPROM_Default_externalPA_CC		0xFF
791 #define EEPROM_Default_internalPA_SP3T_C9	0xAA
792 #define EEPROM_Default_internalPA_SP3T_CC	0xAF
793 #define EEPROM_Default_internalPA_SPDT_C9	0xAA
794 #ifdef CONFIG_PCI_HCI
795 	#define EEPROM_Default_internalPA_SPDT_CC	0xA0
796 #else
797 	#define EEPROM_Default_internalPA_SPDT_CC	0xFA
798 #endif
799 #define EEPROM_Default_PAType						0
800 #define EEPROM_Default_LNAType						0
801 
802 /* New EFUSE default value */
803 #define EEPROM_DEFAULT_CHANNEL_PLAN		0x7F
804 #define EEPROM_DEFAULT_BOARD_OPTION		0x00
805 #define EEPROM_DEFAULT_RFE_OPTION_8192E 0xFF
806 #define EEPROM_DEFAULT_RFE_OPTION_8188E 0xFF
807 #define EEPROM_DEFAULT_RFE_OPTION		0x04
808 #define EEPROM_DEFAULT_FEATURE_OPTION	0x00
809 #define EEPROM_DEFAULT_BT_OPTION			0x10
810 
811 
812 #define EEPROM_DEFAULT_TX_CALIBRATE_RATE	0x00
813 
814 /* PCIe related */
815 #define	EEPROM_PCIE_DEV_CAP_01				0xE0 /* Express device capability in PCIe configuration space, i.e., map to offset 0x74 */
816 #define	EEPROM_PCIE_DEV_CAP_02				0xE1 /* Express device capability in PCIe configuration space, i.e., map to offset 0x75 */
817 
818 
819 /*
820  * For VHT series TX power by rate table.
821  * VHT TX power by rate off setArray =
822  * Band:-2G&5G = 0 / 1
823  * RF: at most 4*4 = ABCD=0/1/2/3
824  * CCK=0 OFDM=1/2 HT-MCS 0-15=3/4/56 VHT=7/8/9/10/11
825  *   */
826 #define TX_PWR_BY_RATE_NUM_BAND			2
827 #define TX_PWR_BY_RATE_NUM_RF			4
828 #define TX_PWR_BY_RATE_NUM_RATE			84
829 
830 #define TXPWR_LMT_MAX_RF				4
831 
832 /* ----------------------------------------------------------------------------
833  * EEPROM/EFUSE data structure definition.
834  * ---------------------------------------------------------------------------- */
835 
836 /* For 88E new structure */
837 
838 /*
839 2.4G:
840 {
841 {1,2},
842 {3,4,5},
843 {6,7,8},
844 {9,10,11},
845 {12,13},
846 {14}
847 }
848 
849 5G:
850 {
851 {36,38,40},
852 {44,46,48},
853 {52,54,56},
854 {60,62,64},
855 {100,102,104},
856 {108,110,112},
857 {116,118,120},
858 {124,126,128},
859 {132,134,136},
860 {140,142,144},
861 {149,151,153},
862 {157,159,161},
863 {173,175,177},
864 }
865 */
866 #define	MAX_RF_PATH				4
867 #define RF_PATH_MAX				MAX_RF_PATH
868 #define	MAX_CHNL_GROUP_24G		6
869 #define	MAX_CHNL_GROUP_5G		14
870 
871 /* It must always set to 4, otherwise read efuse table sequence will be wrong. */
872 #define	MAX_TX_COUNT				4
873 
874 typedef struct _TxPowerInfo24G {
875 	u8 IndexCCK_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
876 	u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_24G];
877 	/* If only one tx, only BW20 and OFDM are used. */
878 	s8 CCK_Diff[MAX_RF_PATH][MAX_TX_COUNT];
879 	s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
880 	s8 BW20_Diff[MAX_RF_PATH][MAX_TX_COUNT];
881 	s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT];
882 } TxPowerInfo24G, *PTxPowerInfo24G;
883 
884 typedef struct _TxPowerInfo5G {
885 	u8 IndexBW40_Base[MAX_RF_PATH][MAX_CHNL_GROUP_5G];
886 	/* If only one tx, only BW20, OFDM, BW80 and BW160 are used. */
887 	s8 OFDM_Diff[MAX_RF_PATH][MAX_TX_COUNT];
888 	s8 BW20_Diff[MAX_RF_PATH][MAX_TX_COUNT];
889 	s8 BW40_Diff[MAX_RF_PATH][MAX_TX_COUNT];
890 	s8 BW80_Diff[MAX_RF_PATH][MAX_TX_COUNT];
891 	s8 BW160_Diff[MAX_RF_PATH][MAX_TX_COUNT];
892 } TxPowerInfo5G, *PTxPowerInfo5G;
893 
894 
895 typedef	enum _BT_Ant_NUM {
896 	Ant_x2	= 0,
897 	Ant_x1	= 1
898 } BT_Ant_NUM, *PBT_Ant_NUM;
899 
900 typedef	enum _BT_CoType {
901 	BT_2WIRE		= 0,
902 	BT_ISSC_3WIRE	= 1,
903 	BT_ACCEL		= 2,
904 	BT_CSR_BC4		= 3,
905 	BT_CSR_BC8		= 4,
906 	BT_RTL8756		= 5,
907 	BT_RTL8723A		= 6,
908 	BT_RTL8821		= 7,
909 	BT_RTL8723B		= 8,
910 	BT_RTL8192E		= 9,
911 	BT_RTL8814A		= 10,
912 	BT_RTL8812A		= 11,
913 	BT_RTL8703B		= 12,
914 	BT_RTL8822B		= 13,
915 	BT_RTL8723D		= 14,
916 	BT_RTL8821C		= 15,
917 	BT_RTL8192F		= 16,
918 	BT_RTL8822C		= 17
919 } BT_CoType, *PBT_CoType;
920 
921 typedef	enum _BT_RadioShared {
922 	BT_Radio_Shared	= 0,
923 	BT_Radio_Individual	= 1,
924 } BT_RadioShared, *PBT_RadioShared;
925 
926 
927 #endif
928