Lines Matching refs:shared_timer
119 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_init_timer_defaults() local
123 shared_timer->timer_in_use_min = NES_NIC_FAST_TIMER_LOW; in nes_nic_init_timer_defaults()
124 shared_timer->timer_in_use_max = NES_NIC_FAST_TIMER_HIGH; in nes_nic_init_timer_defaults()
126 shared_timer->threshold_low = DEFAULT_JUMBO_NES_QL_LOW; in nes_nic_init_timer_defaults()
127 shared_timer->threshold_target = DEFAULT_JUMBO_NES_QL_TARGET; in nes_nic_init_timer_defaults()
128 shared_timer->threshold_high = DEFAULT_JUMBO_NES_QL_HIGH; in nes_nic_init_timer_defaults()
130 shared_timer->threshold_low = DEFAULT_NES_QL_LOW; in nes_nic_init_timer_defaults()
131 shared_timer->threshold_target = DEFAULT_NES_QL_TARGET; in nes_nic_init_timer_defaults()
132 shared_timer->threshold_high = DEFAULT_NES_QL_HIGH; in nes_nic_init_timer_defaults()
147 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_init_timer() local
151 if (shared_timer->timer_in_use_old == 0) { in nes_nic_init_timer()
153 shared_timer->timer_direction_upward = 0; in nes_nic_init_timer()
154 shared_timer->timer_direction_downward = 0; in nes_nic_init_timer()
155 shared_timer->timer_in_use = NES_NIC_FAST_TIMER; in nes_nic_init_timer()
156 shared_timer->timer_in_use_old = 0; in nes_nic_init_timer()
159 if (shared_timer->timer_in_use != shared_timer->timer_in_use_old) { in nes_nic_init_timer()
160 shared_timer->timer_in_use_old = shared_timer->timer_in_use; in nes_nic_init_timer()
162 0x80000000 | ((u32)(shared_timer->timer_in_use*8))); in nes_nic_init_timer()
176 struct nes_hw_tune_timer *shared_timer = &nesadapter->tune_timer; in nes_nic_tune_timer() local
181 if (shared_timer->cq_count_old <= cq_count) in nes_nic_tune_timer()
182 shared_timer->cq_direction_downward = 0; in nes_nic_tune_timer()
184 shared_timer->cq_direction_downward++; in nes_nic_tune_timer()
185 shared_timer->cq_count_old = cq_count; in nes_nic_tune_timer()
186 if (shared_timer->cq_direction_downward > NES_NIC_CQ_DOWNWARD_TREND) { in nes_nic_tune_timer()
187 if (cq_count <= shared_timer->threshold_low && in nes_nic_tune_timer()
188 shared_timer->threshold_low > 4) { in nes_nic_tune_timer()
189 shared_timer->threshold_low = shared_timer->threshold_low/2; in nes_nic_tune_timer()
190 shared_timer->cq_direction_downward=0; in nes_nic_tune_timer()
199 if (cq_count <= shared_timer->threshold_low) { /* increase timer gently */ in nes_nic_tune_timer()
200 shared_timer->timer_direction_upward++; in nes_nic_tune_timer()
201 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
202 } else if (cq_count <= shared_timer->threshold_target) { /* balanced */ in nes_nic_tune_timer()
203 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
204 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
205 } else if (cq_count <= shared_timer->threshold_high) { /* decrease timer gently */ in nes_nic_tune_timer()
206 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
207 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
208 } else if (cq_count <= (shared_timer->threshold_high) * 2) { in nes_nic_tune_timer()
209 shared_timer->timer_in_use -= 2; in nes_nic_tune_timer()
210 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
211 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
213 shared_timer->timer_in_use -= 4; in nes_nic_tune_timer()
214 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
215 shared_timer->timer_direction_downward++; in nes_nic_tune_timer()
218 if (shared_timer->timer_direction_upward > 3 ) { /* using history */ in nes_nic_tune_timer()
219 shared_timer->timer_in_use += 3; in nes_nic_tune_timer()
220 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
221 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
223 if (shared_timer->timer_direction_downward > 5) { /* using history */ in nes_nic_tune_timer()
224 shared_timer->timer_in_use -= 4 ; in nes_nic_tune_timer()
225 shared_timer->timer_direction_downward = 0; in nes_nic_tune_timer()
226 shared_timer->timer_direction_upward = 0; in nes_nic_tune_timer()
231 if (shared_timer->timer_in_use > shared_timer->threshold_high) in nes_nic_tune_timer()
232 shared_timer->timer_in_use = shared_timer->threshold_high; in nes_nic_tune_timer()
233 else if (shared_timer->timer_in_use < shared_timer->threshold_low) in nes_nic_tune_timer()
234 shared_timer->timer_in_use = shared_timer->threshold_low; in nes_nic_tune_timer()