1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
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
19 ******************************************************************************/
20 #ifndef __RTL8192D_DM_H__
21 #define __RTL8192D_DM_H__
22 //============================================================
25 // This file is for 92CE/92CU dynamic mechanism only
28 //============================================================
33 /*------------------------Export global variable----------------------------*/
34 /*------------------------Export global variable----------------------------*/
35 /*------------------------Export Marco Definition---------------------------*/
36 //#define DM_MultiSTA_InitGainChangeNotify(Event) {DM_DigTable.CurMultiSTAConnectState = Event;}
37 //============================================================
38 // structure and define
39 //============================================================
41 //###### duplicate code,will move to ODM #########
42 #define IQK_MAC_REG_NUM 4
43 #define IQK_ADDA_REG_NUM 16
44 #define IQK_BB_REG_NUM 10
45 #define IQK_BB_REG_NUM_92C 9
46 #define IQK_BB_REG_NUM_92D 10
47 #define IQK_BB_REG_NUM_test 6
48 #define index_mapping_NUM 13
49 #define Rx_index_mapping_NUM 15
50 #define AVG_THERMAL_NUM 8
51 #define IQK_Matrix_REG_NUM 8
52 #define IQK_Matrix_Settings_NUM 1+24+21
53 //###### duplicate code,will move to ODM #########
61 //* Upper and Lower Signal threshold for Rate Adaptive*/
62 int UndecoratedSmoothedPWDB;
63 int EntryMinUndecoratedSmoothedPWDB;
64 int EntryMaxUndecoratedSmoothedPWDB;
65 int MinUndecoratedPWDBForDM;
66 int LastMinUndecoratedPWDBForDM;
67 //###### duplicate code,will move to ODM #########
70 u8 bDMInitialGainEnable;
71 //u8 binitialized; // for dm_initial_gain_Multi_STA use.
76 FALSE_ALARM_STATISTICS FalseAlmCnt;
78 //for rate adaptive, in fact, 88c/92c fw will handle this
80 RATE_ADAPTIVE RateAdaptive;
84 u8 bDynamicTxPowerEnable;
86 u8 DynamicTxHighPowerLvl;//Add by Jacken Tx Power Control for Near/Far Range 2008/03/06
88 //for tx power tracking
91 u8 bTXPowerTrackingInit;
92 u8 TxPowerTrackControl; //for mp mode, turn off txpwrtracking as default
95 u8 ThermalMeter[2]; // ThermalMeter, index 0 for RFIC0, and 1 for RFIC1
99 u8 ThermalValue_AVG[AVG_THERMAL_NUM];
100 u8 ThermalValue_AVG_index;
101 u8 ThermalValue_RxGain;
102 u8 ThermalValue_Crystal;
106 u8 bReloadtxpowerindex;
110 u32 APKoutput[2][2]; //path A/B; output1_1a/output1_2a
112 u8 bAPKThermalMeterIgnore;
123 u32 ADDA_backup[IQK_ADDA_REG_NUM];
124 u32 IQK_MAC_backup[IQK_MAC_REG_NUM];
125 u32 IQK_BB_backup[IQK_BB_REG_NUM];
130 //u8 Record_CCK_20Mindex;
131 //u8 Record_CCK_40Mindex;
136 u8 PowerIndex_backup[6];
138 //for Antenna diversity
139 //#ifdef CONFIG_ANTENNA_DIVERSITY
140 //SWAT_T DM_SWAT_Table;
142 //Neil Chen----2011--06--23-----
144 BOOLEAN bPathDiv_Enable; //For 92D Non-interrupt Antenna Diversity by Neil ,add by wl.2011.07.19
150 struct sta_info *RSSI_target;
151 _timer PathDivSwitchTimer;
162 u32 TXPowerTrackingCallbackCnt; //cosa add for debug
164 u32 prv_traffic_idx; // edca turbo
166 u32 RegRF3C[2]; //pathA / pathB
167 //###### duplicate code,will move to ODM #########
168 // Add for Reading Initial Data Rate SEL Register 0x484 during watchdog. Using for fill tx desc. 2011.3.21 by Thomas
173 //============================================================
174 // function prototype
175 //============================================================
176 void rtl8192d_init_dm_priv(IN PADAPTER Adapter);
177 void rtl8192d_deinit_dm_priv(IN PADAPTER Adapter);
179 void rtl8192d_InitHalDm(IN PADAPTER Adapter);
180 void rtl8192d_HalDmWatchDog(IN PADAPTER Adapter);
182 #endif //__HAL8190PCIDM_H__