Lines Matching refs:win
117 il3945_clear_win(struct il3945_rate_scale_data *win) in il3945_clear_win() argument
119 win->data = 0; in il3945_clear_win()
120 win->success_counter = 0; in il3945_clear_win()
121 win->success_ratio = -1; in il3945_clear_win()
122 win->counter = 0; in il3945_clear_win()
123 win->average_tpt = IL_INVALID_VALUE; in il3945_clear_win()
124 win->stamp = 0; in il3945_clear_win()
148 if (!rs_sta->win[i].counter) in il3945_rate_scale_flush_wins()
152 if (time_after(jiffies, rs_sta->win[i].stamp + RATE_WIN_FLUSH)) { in il3945_rate_scale_flush_wins()
154 rs_sta->win[i].counter, i); in il3945_rate_scale_flush_wins()
155 il3945_clear_win(&rs_sta->win[i]); in il3945_rate_scale_flush_wins()
241 struct il3945_rate_scale_data *win, int success, in il3945_collect_tx_data() argument
264 if (win->counter >= RATE_MAX_WINDOW) { in il3945_collect_tx_data()
267 win->counter = RATE_MAX_WINDOW - 1; in il3945_collect_tx_data()
269 if (win->data & (1ULL << (RATE_MAX_WINDOW - 1))) { in il3945_collect_tx_data()
270 win->data &= ~(1ULL << (RATE_MAX_WINDOW - 1)); in il3945_collect_tx_data()
271 win->success_counter--; in il3945_collect_tx_data()
276 win->counter++; in il3945_collect_tx_data()
281 win->data <<= 1; in il3945_collect_tx_data()
283 win->success_counter++; in il3945_collect_tx_data()
284 win->data |= 0x1; in il3945_collect_tx_data()
292 if (win->counter > 0) in il3945_collect_tx_data()
293 win->success_ratio = in il3945_collect_tx_data()
294 128 * (100 * win->success_counter) / win->counter; in il3945_collect_tx_data()
296 win->success_ratio = IL_INVALID_VALUE; in il3945_collect_tx_data()
298 fail_count = win->counter - win->success_counter; in il3945_collect_tx_data()
302 win->success_counter >= RATE_MIN_SUCCESS_TH) in il3945_collect_tx_data()
303 win->average_tpt = in il3945_collect_tx_data()
304 ((win->success_ratio * rs_sta->expected_tpt[idx] + in il3945_collect_tx_data()
307 win->average_tpt = IL_INVALID_VALUE; in il3945_collect_tx_data()
310 win->stamp = jiffies; in il3945_collect_tx_data()
349 il3945_clear_win(&rs_sta->win[i]); in il3945_rs_rate_init()
487 il3945_collect_tx_data(rs_sta, &rs_sta->win[scale_rate_idx], 0, in il3945_rs_tx_status()
500 il3945_collect_tx_data(rs_sta, &rs_sta->win[last_idx], in il3945_rs_tx_status()
614 struct il3945_rate_scale_data *win = NULL; in il3945_rs_get_rate() local
666 win = &(rs_sta->win[idx]); in il3945_rs_get_rate()
668 fail_count = win->counter - win->success_counter; in il3945_rs_get_rate()
671 win->success_counter < RATE_MIN_SUCCESS_TH) { in il3945_rs_get_rate()
676 "expected_tpt is %sNULL\n", idx, win->counter, in il3945_rs_get_rate()
677 win->success_counter, in il3945_rs_get_rate()
681 win->average_tpt = IL_INVALID_VALUE; in il3945_rs_get_rate()
686 current_tpt = win->average_tpt; in il3945_rs_get_rate()
699 low_tpt = rs_sta->win[low].average_tpt; in il3945_rs_get_rate()
702 high_tpt = rs_sta->win[high].average_tpt; in il3945_rs_get_rate()
709 if (win->success_ratio < RATE_DECREASE_TH || !current_tpt) { in il3945_rs_get_rate()
717 win->success_ratio >= RATE_INCREASE_TH) in il3945_rs_get_rate()
739 win->success_ratio >= RATE_INCREASE_TH) in il3945_rs_get_rate()
749 } else if (win->success_ratio >= RATE_INCREASE_TH) { in il3945_rs_get_rate()
760 (win->success_ratio > RATE_HIGH_TH || in il3945_rs_get_rate()
826 lq_sta->win[j].counter, in il3945_sta_dbgfs_stats_table_read()
827 lq_sta->win[j].success_counter, in il3945_sta_dbgfs_stats_table_read()
828 lq_sta->win[j].success_ratio); in il3945_sta_dbgfs_stats_table_read()