Lines Matching refs:shared_timer
128 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_init_timer_defaults() local
132 shared_timer->timer_in_use_min = NES_NIC_FAST_TIMER_LOW; in nes_nic_init_timer_defaults()
133 shared_timer->timer_in_use_max = NES_NIC_FAST_TIMER_HIGH; in nes_nic_init_timer_defaults()
135 shared_timer->threshold_low = DEFAULT_JUMBO_NES_QL_LOW; in nes_nic_init_timer_defaults()
136 shared_timer->threshold_target = DEFAULT_JUMBO_NES_QL_TARGET; in nes_nic_init_timer_defaults()
137 shared_timer->threshold_high = DEFAULT_JUMBO_NES_QL_HIGH; in nes_nic_init_timer_defaults()
139 shared_timer->threshold_low = DEFAULT_NES_QL_LOW; in nes_nic_init_timer_defaults()
140 shared_timer->threshold_target = DEFAULT_NES_QL_TARGET; in nes_nic_init_timer_defaults()
141 shared_timer->threshold_high = DEFAULT_NES_QL_HIGH; in nes_nic_init_timer_defaults()
156 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_init_timer() local
160 if (shared_timer->timer_in_use_old == 0) { in nes_nic_init_timer()
162 shared_timer->timer_direction_upward = 0; in nes_nic_init_timer()
163 shared_timer->timer_direction_downward = 0; in nes_nic_init_timer()
164 shared_timer->timer_in_use = NES_NIC_FAST_TIMER; in nes_nic_init_timer()
165 shared_timer->timer_in_use_old = 0; in nes_nic_init_timer()
168 if (shared_timer->timer_in_use != shared_timer->timer_in_use_old) { in nes_nic_init_timer()
169 shared_timer->timer_in_use_old = shared_timer->timer_in_use; in nes_nic_init_timer()
171 0x80000000 | ((u32)(shared_timer->timer_in_use*8))); in nes_nic_init_timer()
185 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_tune_timer() local
190 if (shared_timer->cq_count_old <= cq_count) in nes_nic_tune_timer()
191 shared_timer->cq_direction_downward = 0; in nes_nic_tune_timer()
193 shared_timer->cq_direction_downward++; in nes_nic_tune_timer()
194 shared_timer->cq_count_old = cq_count; in nes_nic_tune_timer()
195 if (shared_timer->cq_direction_downward > NES_NIC_CQ_DOWNWARD_TREND) { in nes_nic_tune_timer()
196 if (cq_count <= shared_timer->threshold_low && in nes_nic_tune_timer()
197 shared_timer->threshold_low > 4) { in nes_nic_tune_timer()
198 shared_timer->threshold_low = shared_timer->threshold_low/2; in nes_nic_tune_timer()
199 shared_timer->cq_direction_downward=0; in nes_nic_tune_timer()
208 if (cq_count <= shared_timer->threshold_low) { /* increase timer gently */ in nes_nic_tune_timer()
209 shared_timer->timer_direction_upward++; in nes_nic_tune_timer()
210 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
211 } else if (cq_count <= shared_timer->threshold_target) { /* balanced */ in nes_nic_tune_timer()
212 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
213 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
214 } else if (cq_count <= shared_timer->threshold_high) { /* decrease timer gently */ in nes_nic_tune_timer()
215 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
216 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
217 } else if (cq_count <= (shared_timer->threshold_high) * 2) { in nes_nic_tune_timer()
218 shared_timer->timer_in_use -= 2; in nes_nic_tune_timer()
219 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
220 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
222 shared_timer->timer_in_use -= 4; in nes_nic_tune_timer()
223 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
224 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
227 if (shared_timer->timer_direction_upward > 3 ) { /* using history */ in nes_nic_tune_timer()
228 shared_timer->timer_in_use += 3; in nes_nic_tune_timer()
229 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
230 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
232 if (shared_timer->timer_direction_downward > 5) { /* using history */ in nes_nic_tune_timer()
233 shared_timer->timer_in_use -= 4 ; in nes_nic_tune_timer()
234 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
235 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
240 if (shared_timer->timer_in_use > shared_timer->threshold_high) in nes_nic_tune_timer()
241 shared_timer->timer_in_use = shared_timer->threshold_high; in nes_nic_tune_timer()
242 else if (shared_timer->timer_in_use < shared_timer->threshold_low) in nes_nic_tune_timer()
243 shared_timer->timer_in_use = shared_timer->threshold_low; in nes_nic_tune_timer()