Lines Matching refs:tf

37 reset_time(struct time_filter *tf, uint32_t time_len)  in reset_time()  argument
39 tf->cur_time_limit = time_len; in reset_time()
43 reset_time_small(struct time_filter_small *tf, uint32_t time_len) in reset_time_small() argument
45 tf->cur_time_limit = time_len; in reset_time_small()
74 setup_time_filter(struct time_filter *tf, int fil_type, uint32_t time_len) in setup_time_filter() argument
97 tf->entries[i].value = set_val; in setup_time_filter()
98 tf->entries[i].time_up = 0; in setup_time_filter()
100 tf->cur_time_limit = time_len; in setup_time_filter()
105 setup_time_filter_small(struct time_filter_small *tf, int fil_type, uint32_t time_len) in setup_time_filter_small() argument
128 tf->entries[i].value = set_val; in setup_time_filter_small()
129 tf->entries[i].time_up = 0; in setup_time_filter_small()
131 tf->cur_time_limit = time_len; in setup_time_filter_small()
136 check_update_times(struct time_filter *tf, uint64_t value, uint32_t now) in check_update_times() argument
142 tim = now - tf->entries[i].time_up; in check_update_times()
143 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in check_update_times()
147 if (tf->entries[i].time_up < tf->entries[j].time_up) { in check_update_times()
148 tf->entries[i].value = tf->entries[j].value; in check_update_times()
149 tf->entries[i].time_up = tf->entries[j].time_up; in check_update_times()
156 tf->entries[i].value = value; in check_update_times()
157 tf->entries[i].time_up = now; in check_update_times()
162 tim = now - tf->entries[i].time_up; in check_update_times()
163 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in check_update_times()
165 tf->entries[i].value = value; in check_update_times()
166 tf->entries[i].time_up = now; in check_update_times()
171 check_update_times_small(struct time_filter_small *tf, uint32_t value, uint32_t now) in check_update_times_small() argument
177 tim = now - tf->entries[i].time_up; in check_update_times_small()
178 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in check_update_times_small()
182 if (tf->entries[i].time_up < tf->entries[j].time_up) { in check_update_times_small()
183 tf->entries[i].value = tf->entries[j].value; in check_update_times_small()
184 tf->entries[i].time_up = tf->entries[j].time_up; in check_update_times_small()
191 tf->entries[i].value = value; in check_update_times_small()
192 tf->entries[i].time_up = now; in check_update_times_small()
197 tim = now - tf->entries[i].time_up; in check_update_times_small()
198 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in check_update_times_small()
200 tf->entries[i].value = value; in check_update_times_small()
201 tf->entries[i].time_up = now; in check_update_times_small()
206 filter_reduce_by(struct time_filter *tf, uint64_t reduce_by, uint32_t now) in filter_reduce_by() argument
214 if (reduce_by < tf->entries[0].value) in filter_reduce_by()
215 tf->entries[0].value -= reduce_by; in filter_reduce_by()
217 tf->entries[0].value = 0; in filter_reduce_by()
218 tf->entries[0].time_up = now; in filter_reduce_by()
220 tf->entries[i].value = tf->entries[0].value; in filter_reduce_by()
221 tf->entries[i].time_up = now; in filter_reduce_by()
226 filter_reduce_by_small(struct time_filter_small *tf, uint32_t reduce_by, uint32_t now) in filter_reduce_by_small() argument
234 if (reduce_by < tf->entries[0].value) in filter_reduce_by_small()
235 tf->entries[0].value -= reduce_by; in filter_reduce_by_small()
237 tf->entries[0].value = 0; in filter_reduce_by_small()
238 tf->entries[0].time_up = now; in filter_reduce_by_small()
240 tf->entries[i].value = tf->entries[0].value; in filter_reduce_by_small()
241 tf->entries[i].time_up = now; in filter_reduce_by_small()
246 filter_increase_by(struct time_filter *tf, uint64_t incr_by, uint32_t now) in filter_increase_by() argument
254 tf->entries[0].value += incr_by; in filter_increase_by()
255 tf->entries[0].time_up = now; in filter_increase_by()
257 tf->entries[i].value = tf->entries[0].value; in filter_increase_by()
258 tf->entries[i].time_up = now; in filter_increase_by()
263 filter_increase_by_small(struct time_filter_small *tf, uint32_t incr_by, uint32_t now) in filter_increase_by_small() argument
271 tf->entries[0].value += incr_by; in filter_increase_by_small()
272 tf->entries[0].time_up = now; in filter_increase_by_small()
274 tf->entries[i].value = tf->entries[0].value; in filter_increase_by_small()
275 tf->entries[i].time_up = now; in filter_increase_by_small()
280 forward_filter_clock(struct time_filter *tf, uint32_t ticks_forward) in forward_filter_clock() argument
289 tf->entries[i].time_up += ticks_forward; in forward_filter_clock()
294 forward_filter_clock_small(struct time_filter_small *tf, uint32_t ticks_forward) in forward_filter_clock_small() argument
303 tf->entries[i].time_up += ticks_forward; in forward_filter_clock_small()
308 tick_filter_clock(struct time_filter *tf, uint32_t now) in tick_filter_clock() argument
325 tim = now - tf->entries[i].time_up; in tick_filter_clock()
326 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in tick_filter_clock()
332 tf->entries[i].value = tf->entries[(i+1)].value; in tick_filter_clock()
333 tf->entries[i].time_up = tf->entries[(i+1)].time_up; in tick_filter_clock()
339 tick_filter_clock_small(struct time_filter_small *tf, uint32_t now) in tick_filter_clock_small() argument
356 tim = now - tf->entries[i].time_up; in tick_filter_clock_small()
357 time_limit = (tf->cur_time_limit * (NUM_FILTER_ENTRIES-i))/NUM_FILTER_ENTRIES; in tick_filter_clock_small()
363 tf->entries[i].value = tf->entries[(i+1)].value; in tick_filter_clock_small()
364 tf->entries[i].time_up = tf->entries[(i+1)].time_up; in tick_filter_clock_small()
370 apply_filter_min(struct time_filter *tf, uint64_t value, uint32_t now) in apply_filter_min() argument
374 if (value <= tf->entries[0].value) { in apply_filter_min()
377 tf->entries[i].value = value; in apply_filter_min()
378 tf->entries[i].time_up = now; in apply_filter_min()
380 return (tf->entries[0].value); in apply_filter_min()
383 if (value <= tf->entries[j].value) { in apply_filter_min()
385 tf->entries[i].value = value; in apply_filter_min()
386 tf->entries[i].time_up = now; in apply_filter_min()
391 check_update_times(tf, value, now); in apply_filter_min()
392 return (tf->entries[0].value); in apply_filter_min()
396 apply_filter_min_small(struct time_filter_small *tf, in apply_filter_min_small() argument
401 if (value <= tf->entries[0].value) { in apply_filter_min_small()
404 tf->entries[i].value = value; in apply_filter_min_small()
405 tf->entries[i].time_up = now; in apply_filter_min_small()
407 return (tf->entries[0].value); in apply_filter_min_small()
410 if (value <= tf->entries[j].value) { in apply_filter_min_small()
412 tf->entries[i].value = value; in apply_filter_min_small()
413 tf->entries[i].time_up = now; in apply_filter_min_small()
418 check_update_times_small(tf, value, now); in apply_filter_min_small()
419 return (tf->entries[0].value); in apply_filter_min_small()
423 apply_filter_max(struct time_filter *tf, uint64_t value, uint32_t now) in apply_filter_max() argument
427 if (value >= tf->entries[0].value) { in apply_filter_max()
430 tf->entries[i].value = value; in apply_filter_max()
431 tf->entries[i].time_up = now; in apply_filter_max()
433 return (tf->entries[0].value); in apply_filter_max()
436 if (value >= tf->entries[j].value) { in apply_filter_max()
438 tf->entries[i].value = value; in apply_filter_max()
439 tf->entries[i].time_up = now; in apply_filter_max()
444 check_update_times(tf, value, now); in apply_filter_max()
445 return (tf->entries[0].value); in apply_filter_max()
449 apply_filter_max_small(struct time_filter_small *tf, in apply_filter_max_small() argument
454 if (value >= tf->entries[0].value) { in apply_filter_max_small()
457 tf->entries[i].value = value; in apply_filter_max_small()
458 tf->entries[i].time_up = now; in apply_filter_max_small()
460 return (tf->entries[0].value); in apply_filter_max_small()
463 if (value >= tf->entries[j].value) { in apply_filter_max_small()
465 tf->entries[i].value = value; in apply_filter_max_small()
466 tf->entries[i].time_up = now; in apply_filter_max_small()
471 check_update_times_small(tf, value, now); in apply_filter_max_small()
472 return (tf->entries[0].value); in apply_filter_max_small()