1 /*****************************************************************************
2 * Copyright(c) 2007, RealTEK Technology Inc. All Right Reserved.
4 * Module: Hal819xUsbDM.h (RTL8192 Header H File)
7 * Note: For dynamic control definition constant structure.
16 * 10/04/2007 MHC Create initial version.
18 *****************************************************************************/
19 /* Check to see if the file has been included already. */
20 #ifndef __R8192UDM_H__
21 #define __R8192UDM_H__
24 /*--------------------------Define Parameters-------------------------------*/
25 #define DM_DIG_THRESH_HIGH 40
26 #define DM_DIG_THRESH_LOW 35
28 #define DM_DIG_HIGH_PWR_THRESH_HIGH 75
29 #define DM_DIG_HIGH_PWR_THRESH_LOW 70
31 #define BW_AUTO_SWITCH_HIGH_LOW 25
32 #define BW_AUTO_SWITCH_LOW_HIGH 30
34 #define DM_check_fsync_time_interval 500
37 #define DM_DIG_BACKOFF 12
38 #define DM_DIG_MAX 0x36
39 #define DM_DIG_MIN 0x1c
40 #define DM_DIG_MIN_Netcore 0x12
42 #define RxPathSelection_SS_TH_low 30
43 #define RxPathSelection_diff_TH 18
45 #define RateAdaptiveTH_High 50
46 #define RateAdaptiveTH_Low_20M 30
47 #define RateAdaptiveTH_Low_40M 10
48 #define VeryLowRSSI 15
49 #define CTSToSelfTHVal 30
51 /* defined by vivi, for tx power track */
52 #define E_FOR_TX_POWER_TRACK 300
53 /* Dynamic Tx Power Control Threshold */
54 #define TX_POWER_NEAR_FIELD_THRESH_HIGH 68
55 #define TX_POWER_NEAR_FIELD_THRESH_LOW 62
56 /* added by amy for atheros AP */
57 #define TX_POWER_ATHEROAP_THRESH_HIGH 78
58 #define TX_POWER_ATHEROAP_THRESH_LOW 72
60 /* defined by vivi, for showing on UI */
61 #define Current_Tx_Rate_Reg 0x1b8
62 #define Initial_Tx_Rate_Reg 0x1b9
63 #define Tx_Retry_Count_Reg 0x1ac
65 /*--------------------------Define Parameters-------------------------------*/
68 /*------------------------------Define structure----------------------------*/
69 /* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */
70 typedef struct _dynamic_initial_gain_threshold_
{
74 u8 dig_algorithm_switch
;
77 long rssi_high_thresh
;
79 long rssi_high_power_lowthresh
;
80 long rssi_high_power_highthresh
;
98 bool initialgain_lowerbound_state
;
103 typedef enum tag_dynamic_init_gain_state_definition
{
110 /* 2007/10/08 MH Define RATR state. */
111 typedef enum tag_dynamic_ratr_state_definition
{
112 DM_RATR_STA_HIGH
= 0,
113 DM_RATR_STA_MIDDLE
= 1,
118 /* 2007/10/11 MH Define DIG operation type. */
119 typedef enum tag_dynamic_init_gain_operation_type_definition
{
120 DIG_TYPE_THRESH_HIGH
= 0,
121 DIG_TYPE_THRESH_LOW
= 1,
122 DIG_TYPE_THRESH_HIGHPWR_HIGH
= 2,
123 DIG_TYPE_THRESH_HIGHPWR_LOW
= 3,
124 DIG_TYPE_DBG_MODE
= 4,
126 DIG_TYPE_ALGORITHM
= 6,
127 DIG_TYPE_BACKOFF
= 7,
128 DIG_TYPE_PWDB_FACTOR
= 8,
129 DIG_TYPE_RX_GAIN_MIN
= 9,
130 DIG_TYPE_RX_GAIN_MAX
= 10,
131 DIG_TYPE_ENABLE
= 20,
132 DIG_TYPE_DISABLE
= 30,
136 typedef enum tag_dig_algorithm_definition
{
137 DIG_ALGO_BY_FALSE_ALARM
= 0,
138 DIG_ALGO_BY_RSSI
= 1,
142 typedef enum tag_dig_dbgmode_definition
{
148 typedef enum tag_dig_connect_definition
{
154 typedef enum tag_dig_packetdetection_threshold_definition
{
155 DIG_PD_AT_LOW_POWER
= 0,
156 DIG_PD_AT_NORMAL_POWER
= 1,
157 DIG_PD_AT_HIGH_POWER
= 2,
161 typedef enum tag_dig_cck_cs_ratio_state_definition
{
162 DIG_CS_RATIO_LOWER
= 0,
163 DIG_CS_RATIO_HIGHER
= 1,
166 typedef struct _Dynamic_Rx_Path_Selection_
{
178 u8 rf_enable_rssi_th
[4];
179 long cck_pwdb_sta
[4];
182 typedef enum tag_CCK_Rx_Path_Method_Definition
{
183 CCK_Rx_Version_1
= 0,
184 CCK_Rx_Version_2
= 1,
186 } DM_CCK_Rx_Path_Method
;
188 typedef enum tag_DM_DbgMode_Definition
{
194 typedef struct tag_Tx_Config_Cmd_Format
{
195 u32 Op
; /* Command packet type. */
196 u32 Length
; /* Command packet length. */
198 } DCMD_TXCMD_T
, *PDCMD_TXCMD_T
;
199 /*------------------------------Define structure----------------------------*/
202 /*------------------------Export global variable----------------------------*/
203 extern dig_t dm_digtable
;
204 extern u8 dm_shadow
[16][256];
205 extern DRxPathSel DM_RxPathSelTable
;
206 /*------------------------Export global variable----------------------------*/
209 /*------------------------Export Marco Definition---------------------------*/
211 /*------------------------Export Marco Definition---------------------------*/
214 /*--------------------------Exported Function prototype---------------------*/
215 extern void init_hal_dm(struct net_device
*dev
);
216 extern void deinit_hal_dm(struct net_device
*dev
);
218 extern void hal_dm_watchdog(struct net_device
*dev
);
220 extern void init_rate_adaptive(struct net_device
*dev
);
221 extern void dm_txpower_trackingcallback(struct work_struct
*work
);
222 extern void dm_restore_dynamic_mechanism_state(struct net_device
*dev
);
223 extern void dm_backup_dynamic_mechanism_state(struct net_device
*dev
);
224 extern void dm_change_dynamic_initgain_thresh(struct net_device
*dev
,
225 u32 dm_type
, u32 dm_value
);
226 extern void dm_force_tx_fw_info(struct net_device
*dev
,
227 u32 force_type
, u32 force_value
);
228 extern void dm_init_edca_turbo(struct net_device
*dev
);
229 extern void dm_rf_operation_test_callback(unsigned long data
);
230 extern void dm_rf_pathcheck_workitemcallback(struct work_struct
*work
);
231 extern void dm_fsync_timer_callback(unsigned long data
);
232 extern void dm_cck_txpower_adjust(struct net_device
*dev
, bool binch14
);
233 extern void dm_shadow_init(struct net_device
*dev
);
234 extern void dm_initialize_txpower_tracking(struct net_device
*dev
);
235 /*--------------------------Exported Function prototype---------------------*/
238 #endif /*__R8192UDM_H__ */
241 /* End of r8192U_dm.h */