1 //==================================================================
5 //=================================
6 // 20030110 UN20 Pete Chao
9 // Copyright (c) 2003 Winbond Electronics Corp. All rights reserved.
10 //==================================================================
14 #include <linux/types.h>
16 #define MTO_DEFAULT_TH_CNT 5
17 #define MTO_DEFAULT_TH_SQ3 112 //OLD IS 13 reference JohnXu
18 #define MTO_DEFAULT_TH_IDLE_SLOT 15
19 #define MTO_DEFAULT_TH_PR_INTERF 30
20 #define MTO_DEFAULT_TMR_AGING 25 // unit: slot time 10 reference JohnXu
21 #define MTO_DEFAULT_TMR_PERIODIC 5 // unit: slot time
23 #define MTO_ANTENNA_DIVERSITY_OFF 0
24 #define MTO_ANTENNA_DIVERSITY_ON 1
26 // LA20040210_DTO kevin
27 //#define MTO_PREAMBLE_LONG 0
28 //#define MTO_PREAMBLE_SHORT 1
29 #define MTO_PREAMBLE_LONG WLAN_PREAMBLE_TYPE_LONG
30 #define MTO_PREAMBLE_SHORT WLAN_PREAMBLE_TYPE_SHORT
33 TOGGLE_STATE_IDLE
= 0,
34 TOGGLE_STATE_WAIT0
= 1,
35 TOGGLE_STATE_WAIT1
= 2,
36 TOGGLE_STATE_MAKEDESISION
= 3,
37 TOGGLE_STATE_BKOFF
= 4
41 RATE_CHGSTATE_IDLE
= 0,
42 RATE_CHGSTATE_CALCULATE
= 1,
43 RATE_CHGSTATE_BACKOFF
= 2
44 } TX_RATE_REDUCTION_STATE
;
46 //============================================================================
47 // struct _MTOParameters --
49 // Defines the parameters used in the MAC Throughput Optimization algorithm
50 //============================================================================
51 typedef struct _MTO_PARAMETERS
62 //--------- wkchen added -------------
63 u32 TxFlowCount
; //to judge what kind the tx flow(sparse or busy) is
64 //------------------------------------------------
66 //--------- DTO threshold parameters -------------
67 u16 DTO_PeriodicCheckCycle
;
68 u16 DTO_RssiThForAntDiv
;
70 u16 DTO_TxCountThForCalcNewRate
;
76 u16 DTO_TxRateBackOff
;
77 u16 DTO_TxRetryRateReduce
;
79 u16 DTO_TxPowerIndex
; //0 ~ 31
81 //------------------------------------------------
84 u8 AntDiversityEnable
;
91 u8 PreambleChangeEnable
;
94 u8 DataRateChangeEnable
;
95 u8 FragThresholdLevel
;
96 u8 FragThresholdChangeEnable
;
99 u16 RTSThreshold_Setup
;
103 u32 AvgGapBtwnInterf
;
113 // 20040510 remove from globe vairable
116 TOGGLE_STATE ToggleState
;
117 TX_RATE_REDUCTION_STATE TxRateReductionState
;
121 u8 FallbackRateLevel
;
131 } MTO_PARAMETERS
, *PMTO_PARAMETERS
;
134 #define MTO_FUNC_INPUT struct wbsoft_priv * adapter
135 #define MTO_FUNC_INPUT_DATA adapter
136 #define MTO_DATA() (adapter->sMtoPara)
137 #define MTO_HAL() (&adapter->sHwData)
138 #define MTO_SET_PREAMBLE_TYPE(x) // 20040511 Turbo mark LM_PREAMBLE_TYPE(&pcore_data->lm_data) = (x)
139 #define MTO_ENABLE (adapter->sLocalPara.TxRateMode == RATE_AUTO)
140 #define MTO_TXPOWER_FROM_EEPROM (adapter->sHwData.PowerIndexFromEEPROM)
141 #define LOCAL_ANTENNA_NO() (adapter->sLocalPara.bAntennaNo)
142 #define LOCAL_IS_CONNECTED() (adapter->sLocalPara.wConnectedSTAindex != 0)
143 #define LOCAL_IS_IBSS_MODE() (adapter->asBSSDescriptElement[adapter->sLocalPara.wConnectedSTAindex].bBssType == IBSS_NET)
144 #define MTO_INITTXRATE_MODE (adapter->sHwData.SoftwareSet&0x2) //bit 1
145 // 20040510 Turbo add
146 #define MTO_TMR_CNT() MTO_DATA().TmrCnt
147 #define MTO_TOGGLE_STATE() MTO_DATA().ToggleState
148 #define MTO_TX_RATE_REDUCTION_STATE() MTO_DATA().TxRateReductionState
149 #define MTO_BACKOFF_TMR() MTO_DATA().BackoffTmr
150 #define MTO_LAST_RATE() MTO_DATA().Last_Rate
151 #define MTO_CO_EFFICENT() MTO_DATA().Co_efficent
153 #define MTO_TH_CNT() MTO_DATA().Th_Cnt
154 #define MTO_TH_SQ3() MTO_DATA().Th_SQ3
155 #define MTO_TH_IDLE_SLOT() MTO_DATA().Th_IdleSlot
156 #define MTO_TH_PR_INTERF() MTO_DATA().Th_PrInterf
158 #define MTO_TMR_AGING() MTO_DATA().Tmr_Aging
159 #define MTO_TMR_PERIODIC() MTO_DATA().Tmr_Periodic
161 #define MTO_POWER_CHANGE_ENABLE() MTO_DATA().PowerChangeEnable
162 #define MTO_ANT_DIVERSITY_ENABLE() adapter->sLocalPara.boAntennaDiversity
163 #define MTO_ANT_MAC() MTO_DATA().Ant_mac
164 #define MTO_ANT_DIVERSITY() MTO_DATA().Ant_div
165 #define MTO_CCA_MODE() MTO_DATA().CCA_Mode
166 #define MTO_CCA_MODE_SETUP() MTO_DATA().CCA_Mode_Setup
167 #define MTO_PREAMBLE_TYPE() MTO_DATA().Preamble_Type
168 #define MTO_PREAMBLE_CHANGE_ENABLE() MTO_DATA().PreambleChangeEnable
170 #define MTO_RATE_LEVEL() MTO_DATA().DataRateLevel
171 #define MTO_OFDM_RATE_LEVEL() MTO_DATA().OfdmRateLevel
172 #define MTO_RATE_CHANGE_ENABLE() MTO_DATA().DataRateChangeEnable
173 #define MTO_FRAG_TH_LEVEL() MTO_DATA().FragThresholdLevel
174 #define MTO_FRAG_CHANGE_ENABLE() MTO_DATA().FragThresholdChangeEnable
175 #define MTO_RTS_THRESHOLD() MTO_DATA().RTSThreshold
176 #define MTO_RTS_CHANGE_ENABLE() MTO_DATA().RTSChangeEnable
177 #define MTO_RTS_THRESHOLD_SETUP() MTO_DATA().RTSThreshold_Setup
179 #define MTO_AVG_IDLE_SLOT() MTO_DATA().AvgIdleSlot
180 #define MTO_PR_INTERF() MTO_DATA().Pr_Interf
181 #define MTO_AVG_GAP_BTWN_INTERF() MTO_DATA().AvgGapBtwnInterf
183 #define MTO_ANT_SEL() MTO_DATA().Ant_sel
184 #define MTO_CNT_ANT(x) MTO_DATA().Cnt_Ant[(x)]
185 #define MTO_SQ_ANT(x) MTO_DATA().SQ_Ant[(x)]
186 #define MTO_AGING_TIMEOUT() MTO_DATA().aging_timeout
189 #define MTO_TXFLOWCOUNT() MTO_DATA().TxFlowCount
190 //--------- DTO threshold parameters -------------
191 #define MTOPARA_PERIODIC_CHECK_CYCLE() MTO_DATA().DTO_PeriodicCheckCycle
192 #define MTOPARA_RSSI_TH_FOR_ANTDIV() MTO_DATA().DTO_RssiThForAntDiv
193 #define MTOPARA_TXCOUNT_TH_FOR_CALC_RATE() MTO_DATA().DTO_TxCountThForCalcNewRate
194 #define MTOPARA_TXRATE_INC_TH() MTO_DATA().DTO_TxRateIncTh
195 #define MTOPARA_TXRATE_DEC_TH() MTO_DATA().DTO_TxRateDecTh
196 #define MTOPARA_TXRATE_EQ_TH() MTO_DATA().DTO_TxRateEqTh
197 #define MTOPARA_TXRATE_BACKOFF() MTO_DATA().DTO_TxRateBackOff
198 #define MTOPARA_TXRETRYRATE_REDUCE() MTO_DATA().DTO_TxRetryRateReduce
199 #define MTOPARA_TXPOWER_INDEX() MTO_DATA().DTO_TxPowerIndex
200 //------------------------------------------------
203 extern u16 MTO_Frag_Th_Tbl
[];
205 #define MTO_DATA_RATE() MTO_Data_Rate_Tbl[MTO_RATE_LEVEL()]
206 #define MTO_FRAG_TH() MTO_Frag_Th_Tbl[MTO_FRAG_TH_LEVEL()]
213 typedef struct _STATISTICS_INFO
{
260 } STATISTICS_INFO
, *PSTATISTICS_INFO
;