[go: nahoru, domu]

1/******************************************************************************
2 *
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4 *
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.
8 *
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
12 * more details.
13 *
14 ******************************************************************************/
15#ifndef __RTL8723A_DM_H__
16#define __RTL8723A_DM_H__
17/*  */
18/*  Description: */
19/*  */
20/*  This file is for 8723A dynamic mechanism only */
21/*  */
22/*  */
23/*  */
24#define DYNAMIC_FUNC_BT BIT(0)
25
26enum{
27	UP_LINK,
28	DOWN_LINK,
29};
30/*  */
31/*  structure and define */
32/*  */
33
34/*  duplicate code,will move to ODM ######### */
35#define IQK_MAC_REG_NUM		4
36#define IQK_ADDA_REG_NUM		16
37#define IQK_BB_REG_NUM			9
38#define HP_THERMAL_NUM		8
39/*  duplicate code,will move to ODM ######### */
40struct dm_priv
41{
42	u32	InitODMFlag;
43
44	/*  Upper and Lower Signal threshold for Rate Adaptive*/
45	int	UndecoratedSmoothedPWDB;
46	int	UndecoratedSmoothedCCK;
47	int	EntryMinUndecoratedSmoothedPWDB;
48	int	EntryMaxUndecoratedSmoothedPWDB;
49	int	MinUndecoratedPWDBForDM;
50	int	LastMinUndecoratedPWDBForDM;
51
52	s32	UndecoratedSmoothedBeacon;
53	#ifdef CONFIG_8723AU_BT_COEXIST
54	s32 BT_EntryMinUndecoratedSmoothedPWDB;
55	s32 BT_EntryMaxUndecoratedSmoothedPWDB;
56	#endif
57
58	/* for High Power */
59	u8 DynamicTxHighPowerLvl;/* Add by Jacken Tx Power Control for Near/Far Range 2008/03/06 */
60
61	/* for tx power tracking */
62	u8	bTXPowerTracking;
63	u8	TXPowercount;
64	u8	bTXPowerTrackingInit;
65	u8	TxPowerTrackControl;	/* for mp mode, turn off txpwrtracking as default */
66	u8	TM_Trigger;
67
68	u8	ThermalMeter[2];				/*  ThermalMeter, index 0 for RFIC0, and 1 for RFIC1 */
69	u8	ThermalValue;
70	u8	ThermalValue_LCK;
71	u8	ThermalValue_IQK;
72	u8	ThermalValue_DPK;
73
74	u8	bRfPiEnable;
75
76	/* for APK */
77	u32	APKoutput[2][2];	/* path A/B; output1_1a/output1_2a */
78	u8	bAPKdone;
79	u8	bAPKThermalMeterIgnore;
80	u8	bDPdone;
81	u8	bDPPathAOK;
82	u8	bDPPathBOK;
83
84	/* for IQK */
85	u32	RegC04;
86	u32	Reg874;
87	u32	RegC08;
88	u32	RegB68;
89	u32	RegB6C;
90	u32	Reg870;
91	u32	Reg860;
92	u32	Reg864;
93	u32	ADDA_backup[IQK_ADDA_REG_NUM];
94	u32	IQK_MAC_backup[IQK_MAC_REG_NUM];
95	u32	IQK_BB_backup_recover[9];
96	u32	IQK_BB_backup[IQK_BB_REG_NUM];
97	u8	PowerIndex_backup[6];
98
99	u8	bCCKinCH14;
100
101	u8	CCK_index;
102	u8	OFDM_index[2];
103
104	u8	bDoneTxpower;
105	u8	CCK_index_HP;
106	u8	OFDM_index_HP[2];
107	u8	ThermalValue_HP[HP_THERMAL_NUM];
108	u8	ThermalValue_HP_index;
109
110	/* for TxPwrTracking */
111	s32	RegE94;
112	s32     RegE9C;
113	s32	RegEB4;
114	s32	RegEBC;
115
116	u32	TXPowerTrackingCallbackCnt;	/* cosa add for debug */
117
118	u32	prv_traffic_idx; /*  edca turbo */
119
120	s32	OFDM_Pkt_Cnt;
121	u8	RSSI_Select;
122/*	u8	DIG_Dynamic_MIN ; */
123/*  duplicate code,will move to ODM ######### */
124	/*  Add for Reading Initial Data Rate SEL Register 0x484 during watchdog. Using for fill tx desc. 2011.3.21 by Thomas */
125	u8	INIDATA_RATE[32];
126};
127
128
129/*  */
130/*  function prototype */
131/*  */
132
133void rtl8723a_init_dm_priv(struct rtw_adapter *padapter);
134
135void rtl8723a_InitHalDm(struct rtw_adapter *padapter);
136void rtl8723a_HalDmWatchDog(struct rtw_adapter *padapter);
137
138#endif
139