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 ******************************************************************************/
19 typedef struct _Dynamic_Initial_Gain_Threshold_ {
24 u8 Dig_Ext_Port_Stage;
32 u8 CurSTAConnectState;
33 u8 PreSTAConnectState;
34 u8 CurMultiSTAConnectState;
38 u8 BackupIGValue; /* MP DIG */
43 s8 BackoffVal_range_max;
44 s8 BackoffVal_range_min;
67 u8 *pbP2pLinkInProgress;
70 typedef struct false_ALARM_STATISTICS {
76 u32 Cnt_Ofdm_fail_pre; /* For RTL8881A */
80 u32 Cnt_SB_Search_fail;
84 u32 Cnt_BW_USC; /* Gary */
85 u32 Cnt_BW_LSC; /* Gary */
86 } false_ALARM_STATISTICS, *Pfalse_ALARM_STATISTICS;
88 typedef enum tag_Dynamic_Init_Gain_Operation_Type_Definition {
89 DIG_TYPE_THRESH_HIGH = 0,
90 DIG_TYPE_THRESH_LOW = 1,
92 DIG_TYPE_RX_GAIN_MIN = 3,
93 DIG_TYPE_RX_GAIN_MAX = 4,
99 typedef enum tag_ODM_PauseDIG_Type {
100 ODM_PAUSE_DIG = BIT0,
101 ODM_RESUME_DIG = BIT1
102 } ODM_Pause_DIG_TYPE;
104 typedef enum tag_ODM_PauseCCKPD_Type {
105 ODM_PAUSE_CCKPD = BIT0,
106 ODM_RESUME_CCKPD = BIT1
107 } ODM_Pause_CCKPD_TYPE;
109 #define DM_DIG_THRESH_HIGH 40
110 #define DM_DIG_THRESH_LOW 35
112 #define DMfalseALARM_THRESH_LOW 400
113 #define DMfalseALARM_THRESH_HIGH 1000
115 #define DM_DIG_MAX_NIC 0x3e
116 #define DM_DIG_MIN_NIC 0x1e /* 0x22//0x1c */
117 #define DM_DIG_MAX_OF_MIN_NIC 0x3e
119 #define DM_DIG_MAX_AP 0x3e
120 #define DM_DIG_MIN_AP 0x1c
121 #define DM_DIG_MAX_OF_MIN 0x2A /* 0x32 */
122 #define DM_DIG_MIN_AP_DFS 0x20
124 #define DM_DIG_MAX_NIC_HP 0x46
125 #define DM_DIG_MIN_NIC_HP 0x2e
127 #define DM_DIG_MAX_AP_HP 0x42
128 #define DM_DIG_MIN_AP_HP 0x30
130 #define DM_DIG_FA_TH0 0x200/* 0x20 */
132 #define DM_DIG_FA_TH1 0x300
133 #define DM_DIG_FA_TH2 0x400
134 /* this is for 92d */
135 #define DM_DIG_FA_TH0_92D 0x100
136 #define DM_DIG_FA_TH1_92D 0x400
137 #define DM_DIG_FA_TH2_92D 0x600
139 #define DM_DIG_BACKOFF_MAX 12
140 #define DM_DIG_BACKOFF_MIN -4
141 #define DM_DIG_BACKOFF_DEFAULT 10
143 #define DM_DIG_FA_TH0_LPS 4 /* 4 in lps */
144 #define DM_DIG_FA_TH1_LPS 15 /* 15 lps */
145 #define DM_DIG_FA_TH2_LPS 30 /* 30 lps */
146 #define RSSI_OFFSET_DIG 0x05
148 void odm_NHMCounterStatisticsInit(void *pDM_VOID);
150 void odm_NHMCounterStatistics(void *pDM_VOID);
152 void odm_NHMBBInit(void *pDM_VOID);
154 void odm_NHMBB(void *pDM_VOID);
156 void odm_NHMCounterStatisticsReset(void *pDM_VOID);
158 void odm_GetNHMCounterStatistics(void *pDM_VOID);
160 void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target);
162 void odm_AdaptivityInit(void *pDM_VOID);
164 void odm_Adaptivity(void *pDM_VOID, u8 IGI);
166 void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI);
168 void odm_PauseDIG(void *pDM_VOID, ODM_Pause_DIG_TYPE PauseType, u8 IGIValue);
170 void odm_DIGInit(void *pDM_VOID);
172 void odm_DIG(void *pDM_VOID);
174 void odm_DIGbyRSSI_LPS(void *pDM_VOID);
176 void odm_FalseAlarmCounterStatistics(void *pDM_VOID);
178 void odm_FAThresholdCheck(
187 u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI);
189 bool odm_DigAbort(void *pDM_VOID);
191 void odm_CCKPacketDetectionThresh(void *pDM_VOID);
193 void ODM_Write_CCK_CCA_Thres(void *pDM_VOID, u8 CurCCK_CCAThres);