Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rtl_dm.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3  *
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
7  * more details.
8  *
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
12  *
13  * The full GNU General Public License is included in this distribution in the
14  * file called LICENSE.
15  *
16  * Contact Information:
17  * wlanfae <[email protected]>
18 ******************************************************************************/
19 #ifndef __R8192UDM_H__
20 #define __R8192UDM_H__
21 
22 
23 /*--------------------------Define Parameters-------------------------------*/
24 #define OFDM_Table_Length 19
25 #define CCK_Table_length 12
26 
27 #define DM_DIG_THRESH_HIGH 40
28 #define DM_DIG_THRESH_LOW 35
29 
30 #define DM_FALSEALARM_THRESH_LOW 40
31 #define DM_FALSEALARM_THRESH_HIGH 1000
32 
33 #define DM_DIG_HIGH_PWR_THRESH_HIGH 75
34 #define DM_DIG_HIGH_PWR_THRESH_LOW 70
35 
36 #define BW_AUTO_SWITCH_HIGH_LOW 25
37 #define BW_AUTO_SWITCH_LOW_HIGH 30
38 
39 #define DM_check_fsync_time_interval 500
40 
41 
42 #define DM_DIG_BACKOFF 12
43 #define DM_DIG_MAX 0x36
44 #define DM_DIG_MIN 0x1c
45 #define DM_DIG_MIN_Netcore 0x12
46 
47 #define DM_DIG_BACKOFF_MAX 12
48 #define DM_DIG_BACKOFF_MIN -4
49 
50 #define RxPathSelection_SS_TH_low 30
51 #define RxPathSelection_diff_TH 18
52 
53 #define RateAdaptiveTH_High 50
54 #define RateAdaptiveTH_Low_20M 30
55 #define RateAdaptiveTH_Low_40M 10
56 #define VeryLowRSSI 15
57 
58 #define CTSToSelfTHVal 35
59 
60 #define WAIotTHVal 25
61 
62 #define E_FOR_TX_POWER_TRACK 300
63 #define TX_POWER_NEAR_FIELD_THRESH_HIGH 68
64 #define TX_POWER_NEAR_FIELD_THRESH_LOW 62
65 #define TX_POWER_ATHEROAP_THRESH_HIGH 78
66 #define TX_POWER_ATHEROAP_THRESH_LOW 72
67 
68 #define Current_Tx_Rate_Reg 0x1e0
69 #define Initial_Tx_Rate_Reg 0x1e1
70 #define Tx_Retry_Count_Reg 0x1ac
71 #define RegC38_TH 20
72 
73 #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
74 #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
75 
76 #define TxHighPwrLevel_Normal 0
77 #define TxHighPwrLevel_Level1 1
78 #define TxHighPwrLevel_Level2 2
79 
80 #define DM_Type_ByFW 0
81 #define DM_Type_ByDriver 1
82 
83 /*--------------------------Define Parameters-------------------------------*/
84 
85 
86 /*------------------------------Define structure----------------------------*/
87 struct dig_t {
94 
97 
100 
103 
104  u8 dig_state;
110 
115 
118 
126 
127  long rssi_val;
128 };
129 
134 };
135 
136 
142 };
143 
159 };
160 
167 };
168 
172 };
173 
174 
181 };
182 
187 };
188 
197 };
198 
204 };
205 
210 };
211 
212 struct drx_path_sel {
217 
222 
225  long cck_pwdb_sta[4];
226 };
227 
232 };
233 
234 
235 enum dm_dbg {
239 };
240 
241 struct dcmd_txcmd {
245 };
246 /*------------------------------Define structure----------------------------*/
247 
248 
249 /*------------------------Export global variable----------------------------*/
250 extern struct dig_t dm_digtable;
251 extern u8 dm_shadow[16][256];
252 extern struct drx_path_sel DM_RxPathSelTable;
253 
254 extern u8 test_flag;
255 /*------------------------Export global variable----------------------------*/
256 
257 
258 /*------------------------Export Marco Definition---------------------------*/
259 #define DM_APInitGainChangeNotify(Event) \
260  { \
261  dm_digtable.CurAPConnectState = Event; \
262  }
263 /*------------------------Export Marco Definition---------------------------*/
264 
265 
266 /*--------------------------Exported Function prototype---------------------*/
267 /*--------------------------Exported Function prototype---------------------*/
268 extern void init_hal_dm(struct net_device *dev);
269 extern void deinit_hal_dm(struct net_device *dev);
270 
271 extern void hal_dm_watchdog(struct net_device *dev);
272 
273 
274 extern void init_rate_adaptive(struct net_device *dev);
275 extern void dm_txpower_trackingcallback(void *data);
276 
277 extern void dm_cck_txpower_adjust(struct net_device *dev, bool binch14);
278 
282  u32 dm_type,
283  u32 dm_value);
284 extern void DM_ChangeFsyncSetting(struct net_device *dev,
285  s32 DM_Type,
286  s32 DM_Value);
287 extern void dm_force_tx_fw_info(struct net_device *dev,
288  u32 force_type,
289  u32 force_value);
290 extern void dm_init_edca_turbo(struct net_device *dev);
291 extern void dm_rf_operation_test_callback(unsigned long data);
292 extern void dm_rf_pathcheck_workitemcallback(void *data);
293 extern void dm_fsync_timer_callback(unsigned long data);
294 extern void dm_check_fsync(struct net_device *dev);
295 extern void dm_shadow_init(struct net_device *dev);
296 extern void dm_initialize_txpower_tracking(struct net_device *dev);
297 extern void dm_CheckRfCtrlGPIO(void *data);
298 extern void dm_InitRateAdaptiveMask(struct net_device *dev);
299 extern void init_hal_dm(struct net_device *dev);
300 extern void deinit_hal_dm(struct net_device *dev);
301 extern void hal_dm_watchdog(struct net_device *dev);
302 extern void init_rate_adaptive(struct net_device *dev);
303 extern void dm_txpower_trackingcallback(void *data);
307  u32 dm_type,
308  u32 dm_value);
309 extern void DM_ChangeFsyncSetting(struct net_device *dev,
310  s32 DM_Type,
311  s32 DM_Value);
312 extern void dm_force_tx_fw_info(struct net_device *dev,
313  u32 force_type,
314  u32 force_value);
315 extern void dm_init_edca_turbo(struct net_device *dev);
316 extern void dm_rf_operation_test_callback(unsigned long data);
317 extern void dm_rf_pathcheck_workitemcallback(void *data);
318 extern void dm_fsync_timer_callback(unsigned long data);
319 extern void dm_check_fsync(struct net_device *dev);
320 extern void dm_shadow_init(struct net_device *dev);
321 extern void dm_initialize_txpower_tracking(struct net_device *dev);
322 extern void dm_CheckRfCtrlGPIO(void *data);
323 
324 #endif /*__R8192UDM_H__ */