1
/******************************************************************************
2
* Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4
* This program is distributed in the hope that it will be useful, but WITHOUT
5
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
9
* You should have received a copy of the GNU General Public License along with
10
* this program; if not, write to the Free Software Foundation, Inc.,
11
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
13
* The full GNU General Public License is included in this distribution in the
14
* file called LICENSE.
16
* Contact Information:
17
* wlanfae <wlanfae@realtek.com>
18
******************************************************************************/
19
#ifndef __R8192UDM_H__
20
#define __R8192UDM_H__
23
/*--------------------------Define Parameters-------------------------------*/
24
#define OFDM_Table_Length 19
25
#define CCK_Table_length 12
27
#define DM_DIG_THRESH_HIGH 40
28
#define DM_DIG_THRESH_LOW 35
30
#define DM_FALSEALARM_THRESH_LOW 40
31
#define DM_FALSEALARM_THRESH_HIGH 1000
33
#define DM_DIG_HIGH_PWR_THRESH_HIGH 75
34
#define DM_DIG_HIGH_PWR_THRESH_LOW 70
36
#define BW_AUTO_SWITCH_HIGH_LOW 25
37
#define BW_AUTO_SWITCH_LOW_HIGH 30
39
#define DM_check_fsync_time_interval 500
42
#define DM_DIG_BACKOFF 12
44
#define DM_DIG_MAX 0x3e
45
#elif defined RTL8190P || defined RTL8192E
46
#define DM_DIG_MAX 0x36
48
#define DM_DIG_MIN 0x1c
49
#define DM_DIG_MIN_Netcore 0x12
51
#define DM_DIG_BACKOFF_MAX 12
52
#define DM_DIG_BACKOFF_MIN -4
54
#define RxPathSelection_SS_TH_low 30
55
#define RxPathSelection_diff_TH 18
57
#define RateAdaptiveTH_High 50
58
#define RateAdaptiveTH_Low_20M 30
59
#define RateAdaptiveTH_Low_40M 10
60
#define VeryLowRSSI 15
63
#define CTSToSelfTHVal 30
64
#elif defined RTL8190P || defined RTL8192E
65
#define CTSToSelfTHVal 35
70
#define E_FOR_TX_POWER_TRACK 300
71
#define TX_POWER_NEAR_FIELD_THRESH_HIGH 68
72
#define TX_POWER_NEAR_FIELD_THRESH_LOW 62
73
#define TX_POWER_ATHEROAP_THRESH_HIGH 78
74
#define TX_POWER_ATHEROAP_THRESH_LOW 72
76
#define Current_Tx_Rate_Reg 0x1e0
77
#define Initial_Tx_Rate_Reg 0x1e1
78
#define Tx_Retry_Count_Reg 0x1ac
81
#define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
82
#define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
84
#define TxHighPwrLevel_Normal 0
85
#define TxHighPwrLevel_Level1 1
86
#define TxHighPwrLevel_Level2 2
88
#define DM_Type_ByFW 0
89
#define DM_Type_ByDriver 1
91
/*--------------------------Define Parameters-------------------------------*/
94
/*------------------------------Define structure----------------------------*/
95
typedef struct _dynamic_initial_gain_threshold_
99
u8 Dig_TwoPort_Algorithm;
100
u8 Dig_Ext_Port_Stage;
102
u8 dig_algorithm_switch;
104
long rssi_low_thresh;
105
long rssi_high_thresh;
110
long rssi_high_power_lowthresh;
111
long rssi_high_power_highthresh;
114
u8 dig_highpwr_state;
115
u8 CurSTAConnectState;
116
u8 PreSTAConnectState;
117
u8 CurAPConnectState;
118
u8 PreAPConnectState;
122
u8 curcs_ratio_state;
123
u8 precs_ratio_state;
128
u8 Backoff_Enable_Flag;
130
char BackoffVal_range_max;
131
char BackoffVal_range_min;
132
u8 rx_gain_range_max;
133
u8 rx_gain_range_min;
134
bool initialgain_lowerbound_state;
139
typedef enum tag_dynamic_init_gain_state_definition
147
typedef enum tag_dynamic_ratr_state_definition
149
DM_RATR_STA_HIGH = 0,
150
DM_RATR_STA_MIDDLE = 1,
155
typedef enum tag_dynamic_init_gain_operation_type_definition
157
DIG_TYPE_THRESH_HIGH = 0,
158
DIG_TYPE_THRESH_LOW = 1,
159
DIG_TYPE_THRESH_HIGHPWR_HIGH = 2,
160
DIG_TYPE_THRESH_HIGHPWR_LOW = 3,
161
DIG_TYPE_DBG_MODE = 4,
163
DIG_TYPE_ALGORITHM = 6,
164
DIG_TYPE_BACKOFF = 7,
165
DIG_TYPE_PWDB_FACTOR = 8,
166
DIG_TYPE_RX_GAIN_MIN = 9,
167
DIG_TYPE_RX_GAIN_MAX = 10,
168
DIG_TYPE_ENABLE = 20,
169
DIG_TYPE_DISABLE = 30,
173
typedef enum tag_dig_algorithm_definition
175
DIG_ALGO_BY_FALSE_ALARM = 0,
176
DIG_ALGO_BY_RSSI = 1,
177
DIG_ALGO_BEFORE_CONNECT_BY_RSSI_AND_ALARM = 2,
178
DIG_ALGO_BY_TOW_PORT = 3,
182
typedef enum tag_DIG_TWO_PORT_ALGO_Definition
184
DIG_TWO_PORT_ALGO_RSSI = 0,
185
DIG_TWO_PORT_ALGO_FALSE_ALARM = 1,
186
}DM_DIG_TWO_PORT_ALG_E;
189
typedef enum tag_DIG_EXT_PORT_ALGO_Definition
191
DIG_EXT_PORT_STAGE_0 = 0,
192
DIG_EXT_PORT_STAGE_1 = 1,
193
DIG_EXT_PORT_STAGE_2 = 2,
194
DIG_EXT_PORT_STAGE_3 = 3,
195
DIG_EXT_PORT_STAGE_MAX = 4,
196
}DM_DIG_EXT_PORT_ALG_E;
198
typedef enum tag_dig_dbgmode_definition
205
typedef enum tag_dig_connect_definition
207
DIG_STA_DISCONNECT = 0,
209
DIG_STA_BEFORE_CONNECT = 2,
210
DIG_AP_DISCONNECT = 3,
212
DIG_AP_ADD_STATION = 5,
216
typedef enum tag_dig_packetdetection_threshold_definition
218
DIG_PD_AT_LOW_POWER = 0,
219
DIG_PD_AT_NORMAL_POWER = 1,
220
DIG_PD_AT_HIGH_POWER = 2,
224
typedef enum tag_dig_cck_cs_ratio_state_definition
226
DIG_CS_RATIO_LOWER = 0,
227
DIG_CS_RATIO_HIGHER = 1,
230
typedef struct _Dynamic_Rx_Path_Selection_
243
u8 rf_enable_rssi_th[4];
244
long cck_pwdb_sta[4];
247
typedef enum tag_CCK_Rx_Path_Method_Definition
249
CCK_Rx_Version_1 = 0,
252
}DM_CCK_Rx_Path_Method;
255
typedef enum tag_DM_DbgMode_Definition
262
typedef struct tag_Tx_Config_Cmd_Format
267
}DCMD_TXCMD_T, *PDCMD_TXCMD_T;
268
/*------------------------------Define structure----------------------------*/
271
/*------------------------Export global variable----------------------------*/
272
extern dig_t dm_digtable;
273
extern u8 dm_shadow[16][256];
274
extern DRxPathSel DM_RxPathSelTable;
277
/*------------------------Export global variable----------------------------*/
280
/*------------------------Export Marco Definition---------------------------*/
281
#define DM_APInitGainChangeNotify(Event) {dm_digtable.CurAPConnectState = Event;}
282
/*------------------------Export Marco Definition---------------------------*/
285
/*--------------------------Exported Function prototype---------------------*/
286
/*--------------------------Exported Function prototype---------------------*/
287
extern void init_hal_dm(struct net_device *dev);
288
extern void deinit_hal_dm(struct net_device *dev);
290
extern void hal_dm_watchdog(struct net_device *dev);
293
extern void init_rate_adaptive(struct net_device *dev);
294
extern void dm_txpower_trackingcallback(void *data);
297
extern void dm_cck_txpower_adjust(struct net_device *dev,bool binch14);
300
extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
301
extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
302
extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
305
extern void DM_ChangeFsyncSetting(struct net_device *dev,
308
extern void dm_force_tx_fw_info(struct net_device *dev,
311
extern void dm_init_edca_turbo(struct net_device *dev);
312
extern void dm_rf_operation_test_callback(unsigned long data);
313
extern void dm_rf_pathcheck_workitemcallback(void *data);
314
extern void dm_fsync_timer_callback(unsigned long data);
316
extern bool dm_check_lbus_status(struct net_device *dev);
318
extern void dm_check_fsync(struct net_device *dev);
319
extern void dm_shadow_init(struct net_device *dev);
320
extern void dm_initialize_txpower_tracking(struct net_device *dev);
322
#if (defined RTL8192E || defined RTL8192SE)
323
extern void dm_CheckRfCtrlGPIO(void *data);
327
#endif /*__R8192UDM_H__ */
330
/* End of r8192U_dm.h */