1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
6 ******************************************************************************/
11 struct dig_t { /* _Dynamic_Initial_Gain_Threshold_ */
16 u8 Dig_Ext_Port_Stage;
24 u8 CurSTAConnectState;
25 u8 PreSTAConnectState;
26 u8 CurMultiSTAConnectState;
30 u8 BackupIGValue; /* MP DIG */
35 s8 BackoffVal_range_max;
36 s8 BackoffVal_range_min;
59 u8 *pbP2pLinkInProgress;
62 struct false_ALARM_STATISTICS {
68 u32 Cnt_Ofdm_fail_pre; /* For RTL8881A */
72 u32 Cnt_SB_Search_fail;
76 u32 Cnt_BW_USC; /* Gary */
77 u32 Cnt_BW_LSC; /* Gary */
80 enum ODM_Pause_DIG_TYPE {
85 #define DM_DIG_THRESH_HIGH 40
86 #define DM_DIG_THRESH_LOW 35
88 #define DMfalseALARM_THRESH_LOW 400
89 #define DMfalseALARM_THRESH_HIGH 1000
91 #define DM_DIG_MAX_NIC 0x3e
92 #define DM_DIG_MIN_NIC 0x1e /* 0x22//0x1c */
93 #define DM_DIG_MAX_OF_MIN_NIC 0x3e
95 #define DM_DIG_MAX_AP 0x3e
96 #define DM_DIG_MIN_AP 0x1c
97 #define DM_DIG_MAX_OF_MIN 0x2A /* 0x32 */
98 #define DM_DIG_MIN_AP_DFS 0x20
100 #define DM_DIG_MAX_NIC_HP 0x46
101 #define DM_DIG_MIN_NIC_HP 0x2e
103 #define DM_DIG_MAX_AP_HP 0x42
104 #define DM_DIG_MIN_AP_HP 0x30
106 #define DM_DIG_FA_TH0 0x200/* 0x20 */
108 #define DM_DIG_FA_TH1 0x300
109 #define DM_DIG_FA_TH2 0x400
110 /* this is for 92d */
111 #define DM_DIG_FA_TH0_92D 0x100
112 #define DM_DIG_FA_TH1_92D 0x400
113 #define DM_DIG_FA_TH2_92D 0x600
115 #define DM_DIG_BACKOFF_MAX 12
116 #define DM_DIG_BACKOFF_MIN -4
117 #define DM_DIG_BACKOFF_DEFAULT 10
119 #define DM_DIG_FA_TH0_LPS 4 /* 4 in lps */
120 #define DM_DIG_FA_TH1_LPS 15 /* 15 lps */
121 #define DM_DIG_FA_TH2_LPS 30 /* 30 lps */
122 #define RSSI_OFFSET_DIG 0x05
124 void odm_NHMCounterStatisticsInit(void *pDM_VOID);
126 void odm_NHMCounterStatistics(void *pDM_VOID);
128 void odm_NHMBBInit(void *pDM_VOID);
130 void odm_NHMBB(void *pDM_VOID);
132 void odm_NHMCounterStatisticsReset(void *pDM_VOID);
134 void odm_GetNHMCounterStatistics(void *pDM_VOID);
136 void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target);
138 void odm_AdaptivityInit(void *pDM_VOID);
140 void odm_Adaptivity(void *pDM_VOID, u8 IGI);
142 void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI);
144 void odm_DIGInit(void *pDM_VOID);
146 void odm_DIG(void *pDM_VOID);
148 void odm_DIGbyRSSI_LPS(void *pDM_VOID);
150 void odm_FalseAlarmCounterStatistics(void *pDM_VOID);
152 void odm_FAThresholdCheck(
161 u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI);
163 bool odm_DigAbort(void *pDM_VOID);
165 void odm_CCKPacketDetectionThresh(void *pDM_VOID);
167 void ODM_Write_CCK_CCA_Thres(void *pDM_VOID, u8 CurCCK_CCAThres);