OSDN Git Service

rtl8723au: Remove some trailing white space
[android-x86/external-modules-rtl8723au.git] / include / rtl8723a_dm.h
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef __RTL8723A_DM_H__
21 #define __RTL8723A_DM_H__
22 //============================================================
23 // Description:
24 //
25 // This file is for 8723A dynamic mechanism only
26 //
27 //
28 //============================================================
29 #define DYNAMIC_FUNC_BT BIT(0)
30
31 enum{
32         UP_LINK,
33         DOWN_LINK,
34 };
35 //============================================================
36 // structure and define
37 //============================================================
38
39 //###### duplicate code,will move to ODM #########
40 #define IQK_MAC_REG_NUM         4
41 #define IQK_ADDA_REG_NUM                16
42 #define IQK_BB_REG_NUM                  9
43 #define HP_THERMAL_NUM          8
44 //###### duplicate code,will move to ODM #########
45 struct dm_priv
46 {
47         u8      DM_Type;
48         u8      DMFlag;
49         u8      InitDMFlag;
50         u32     InitODMFlag;
51
52         //* Upper and Lower Signal threshold for Rate Adaptive*/
53         int     UndecoratedSmoothedPWDB;
54         int     UndecoratedSmoothedCCK;
55         int     EntryMinUndecoratedSmoothedPWDB;
56         int     EntryMaxUndecoratedSmoothedPWDB;
57         int     MinUndecoratedPWDBForDM;
58         int     LastMinUndecoratedPWDBForDM;
59
60         s32     UndecoratedSmoothedBeacon;
61         #ifdef CONFIG_BT_COEXIST
62         s32 BT_EntryMinUndecoratedSmoothedPWDB;
63         s32 BT_EntryMaxUndecoratedSmoothedPWDB;
64         #endif
65
66 //###### duplicate code,will move to ODM #########
67 /*
68         //for DIG
69         u8      bDMInitialGainEnable;
70         u8      binitialized; // for dm_initial_gain_Multi_STA use.
71         DIG_T   DM_DigTable;
72
73         PS_T    DM_PSTable;
74
75         FALSE_ALARM_STATISTICS FalseAlmCnt;
76
77         //for rate adaptive, in fact,  88c/92c fw will handle this
78         u8 bUseRAMask;
79         RATE_ADAPTIVE RateAdaptive;
80 */
81         //for High Power
82         u8 bDynamicTxPowerEnable;
83         u8 LastDTPLvl;
84         u8 DynamicTxHighPowerLvl;//Add by Jacken Tx Power Control for Near/Far Range 2008/03/06
85
86         //for tx power tracking
87         u8      bTXPowerTracking;
88         u8      TXPowercount;
89         u8      bTXPowerTrackingInit;
90         u8      TxPowerTrackControl;    //for mp mode, turn off txpwrtracking as default
91         u8      TM_Trigger;
92
93         u8      ThermalMeter[2];                                // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1
94         u8      ThermalValue;
95         u8      ThermalValue_LCK;
96         u8      ThermalValue_IQK;
97         u8      ThermalValue_DPK;
98
99         u8      bRfPiEnable;
100
101         //for APK
102         u32     APKoutput[2][2];        //path A/B; output1_1a/output1_2a
103         u8      bAPKdone;
104         u8      bAPKThermalMeterIgnore;
105         u8      bDPdone;
106         u8      bDPPathAOK;
107         u8      bDPPathBOK;
108
109         //for IQK
110         u32     RegC04;
111         u32     Reg874;
112         u32     RegC08;
113         u32     RegB68;
114         u32     RegB6C;
115         u32     Reg870;
116         u32     Reg860;
117         u32     Reg864;
118         u32     ADDA_backup[IQK_ADDA_REG_NUM];
119         u32     IQK_MAC_backup[IQK_MAC_REG_NUM];
120         u32     IQK_BB_backup_recover[9];
121         u32     IQK_BB_backup[IQK_BB_REG_NUM];
122         u8      PowerIndex_backup[6];
123
124         u8      bCCKinCH14;
125
126         u8      CCK_index;
127         u8      OFDM_index[2];
128
129         u8      bDoneTxpower;
130         u8      CCK_index_HP;
131         u8      OFDM_index_HP[2];
132         u8      ThermalValue_HP[HP_THERMAL_NUM];
133         u8      ThermalValue_HP_index;
134
135         //for TxPwrTracking
136         s32     RegE94;
137         s32     RegE9C;
138         s32     RegEB4;
139         s32     RegEBC;
140
141         u32     TXPowerTrackingCallbackCnt;     //cosa add for debug
142
143         u32     prv_traffic_idx; // edca turbo
144
145 /*
146         // for dm_RF_Saving
147         u8      initialize;
148         u32     rf_saving_Reg874;
149         u32     rf_saving_RegC70;
150         u32     rf_saving_Reg85C;
151         u32     rf_saving_RegA74;
152 */
153         //for Antenna diversity
154 #ifdef CONFIG_ANTENNA_DIVERSITY
155 //      SWAT_T DM_SWAT_Table;
156 #endif
157
158 #ifdef CONFIG_SW_ANTENNA_DIVERSITY
159 //      _timer SwAntennaSwitchTimer;
160 /*
161         u64     lastTxOkCnt;
162         u64     lastRxOkCnt;
163         u64     TXByteCnt_A;
164         u64     TXByteCnt_B;
165         u64     RXByteCnt_A;
166         u64     RXByteCnt_B;
167         u8      DoubleComfirm;
168         u8      TrafficLoad;
169 */
170 #endif
171
172         s32     OFDM_Pkt_Cnt;
173         u8      RSSI_Select;
174 //      u8      DIG_Dynamic_MIN ;
175 //###### duplicate code,will move to ODM #########
176         // Add for Reading Initial Data Rate SEL Register 0x484 during watchdog. Using for fill tx desc. 2011.3.21 by Thomas
177         u8      INIDATA_RATE[32];
178 };
179
180
181 //============================================================
182 // function prototype
183 //============================================================
184
185 void rtl8723a_init_dm_priv(PADAPTER padapter);
186 void rtl8723a_deinit_dm_priv(PADAPTER padapter);
187
188 void rtl8723a_InitHalDm(PADAPTER padapter);
189 void rtl8723a_HalDmWatchDog(PADAPTER padapter);
190
191
192
193 #endif