Lines Matching refs:lq_sta

129 					 struct il_lq_sta *lq_sta);
131 struct il_lq_sta *lq_sta, u32 rate_n_flags);
132 static void il4965_rs_stay_in_table(struct il_lq_sta *lq_sta,
136 static void il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta,
140 il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) in il4965_rs_dbgfs_set_mcs() argument
642 il4965_rs_get_supported_rates(struct il_lq_sta *lq_sta, in il4965_rs_get_supported_rates() argument
647 return lq_sta->active_legacy_rate; in il4965_rs_get_supported_rates()
650 return lq_sta->active_siso_rate; in il4965_rs_get_supported_rates()
652 return lq_sta->active_mimo2_rate; in il4965_rs_get_supported_rates()
714 il4965_rs_get_lower_rate(struct il_lq_sta *lq_sta, in il4965_rs_get_lower_rate() argument
722 u8 is_green = lq_sta->is_green; in il4965_rs_get_lower_rate()
723 struct il_priv *il = lq_sta->drv; in il4965_rs_get_lower_rate()
731 if (lq_sta->band == NL80211_BAND_5GHZ) in il4965_rs_get_lower_rate()
745 rate_mask = il4965_rs_get_supported_rates(lq_sta, NULL, tbl->lq_type); in il4965_rs_get_lower_rate()
750 if (lq_sta->band == NL80211_BAND_5GHZ) in il4965_rs_get_lower_rate()
753 (lq_sta->supp_rates << IL_FIRST_OFDM_RATE)); in il4965_rs_get_lower_rate()
755 rate_mask = (u16) (rate_mask & lq_sta->supp_rates); in il4965_rs_get_lower_rate()
765 il4965_rs_get_adjacent_rate(lq_sta->drv, scale_idx, rate_mask, in il4965_rs_get_lower_rate()
773 return il4965_rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green); in il4965_rs_get_lower_rate()
798 struct il_lq_sta *lq_sta = il_sta; in il4965_rs_tx_status() local
811 if (!lq_sta) { in il4965_rs_tx_status()
814 } else if (!lq_sta->drv) { in il4965_rs_tx_status()
836 table = &lq_sta->lq; in il4965_rs_tx_status()
871 lq_sta->missed_rate_counter++; in il4965_rs_tx_status()
872 if (lq_sta->missed_rate_counter > IL_MISSED_RATE_MAX) { in il4965_rs_tx_status()
873 lq_sta->missed_rate_counter = 0; in il4965_rs_tx_status()
874 il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); in il4965_rs_tx_status()
880 lq_sta->missed_rate_counter = 0; in il4965_rs_tx_status()
884 (&tbl_type, &(lq_sta->lq_info[lq_sta->active_tbl]))) { in il4965_rs_tx_status()
885 curr_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_tx_status()
886 other_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); in il4965_rs_tx_status()
889 (&tbl_type, &lq_sta->lq_info[1 - lq_sta->active_tbl])) { in il4965_rs_tx_status()
890 curr_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); in il4965_rs_tx_status()
891 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_tx_status()
894 tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_tx_status()
897 tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); in il4965_rs_tx_status()
906 il4965_rs_stay_in_table(lq_sta, true); in il4965_rs_tx_status()
926 if (lq_sta->stay_in_tbl) { in il4965_rs_tx_status()
927 lq_sta->total_success += info->status.ampdu_ack_len; in il4965_rs_tx_status()
928 lq_sta->total_failed += in il4965_rs_tx_status()
964 if (lq_sta->stay_in_tbl) { in il4965_rs_tx_status()
965 lq_sta->total_success += legacy_success; in il4965_rs_tx_status()
966 lq_sta->total_failed += retries + (1 - legacy_success); in il4965_rs_tx_status()
970 lq_sta->last_rate_n_flags = tx_rate; in il4965_rs_tx_status()
974 il4965_rs_rate_scale_perform(il, skb, sta, lq_sta); in il4965_rs_tx_status()
987 struct il_lq_sta *lq_sta) in il4965_rs_set_stay_in_table() argument
990 lq_sta->stay_in_tbl = 1; /* only place this gets set */ in il4965_rs_set_stay_in_table()
992 lq_sta->table_count_limit = IL_LEGACY_TBL_COUNT; in il4965_rs_set_stay_in_table()
993 lq_sta->max_failure_limit = IL_LEGACY_FAILURE_LIMIT; in il4965_rs_set_stay_in_table()
994 lq_sta->max_success_limit = IL_LEGACY_SUCCESS_LIMIT; in il4965_rs_set_stay_in_table()
996 lq_sta->table_count_limit = IL_NONE_LEGACY_TBL_COUNT; in il4965_rs_set_stay_in_table()
997 lq_sta->max_failure_limit = IL_NONE_LEGACY_FAILURE_LIMIT; in il4965_rs_set_stay_in_table()
998 lq_sta->max_success_limit = IL_NONE_LEGACY_SUCCESS_LIMIT; in il4965_rs_set_stay_in_table()
1000 lq_sta->table_count = 0; in il4965_rs_set_stay_in_table()
1001 lq_sta->total_failed = 0; in il4965_rs_set_stay_in_table()
1002 lq_sta->total_success = 0; in il4965_rs_set_stay_in_table()
1003 lq_sta->flush_timer = jiffies; in il4965_rs_set_stay_in_table()
1004 lq_sta->action_counter = 0; in il4965_rs_set_stay_in_table()
1011 il4965_rs_set_expected_tpt_table(struct il_lq_sta *lq_sta, in il4965_rs_set_expected_tpt_table() argument
1032 if (is_siso(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup)) in il4965_rs_set_expected_tpt_table()
1036 else if (is_mimo2(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup)) in il4965_rs_set_expected_tpt_table()
1041 if (!tbl->is_SGI && !lq_sta->is_agg) /* Normal */ in il4965_rs_set_expected_tpt_table()
1043 else if (tbl->is_SGI && !lq_sta->is_agg) /* SGI */ in il4965_rs_set_expected_tpt_table()
1045 else if (!tbl->is_SGI && lq_sta->is_agg) /* AGG */ in il4965_rs_set_expected_tpt_table()
1064 il4965_rs_get_best_rate(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_get_best_rate() argument
1070 &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_get_best_rate()
1106 if ((100 * tpt_tbl[rate] > lq_sta->last_tpt && in il4965_rs_get_best_rate()
1158 il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_switch_to_mimo2() argument
1165 s8 is_green = lq_sta->is_green; in il4965_rs_switch_to_mimo2()
1180 tbl->is_dup = lq_sta->is_dup; in il4965_rs_switch_to_mimo2()
1183 rate_mask = lq_sta->active_mimo2_rate; in il4965_rs_switch_to_mimo2()
1190 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_switch_to_mimo2()
1192 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx); in il4965_rs_switch_to_mimo2()
1212 il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_switch_to_siso() argument
1217 u8 is_green = lq_sta->is_green; in il4965_rs_switch_to_siso()
1225 tbl->is_dup = lq_sta->is_dup; in il4965_rs_switch_to_siso()
1229 rate_mask = lq_sta->active_siso_rate; in il4965_rs_switch_to_siso()
1239 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_switch_to_siso()
1240 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx); in il4965_rs_switch_to_siso()
1259 il4965_rs_move_legacy_other(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_move_legacy_other() argument
1263 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_legacy_other()
1265 &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); in il4965_rs_move_legacy_other()
1280 lq_sta->action_counter++; in il4965_rs_move_legacy_other()
1303 il4965_rs_set_expected_tpt_table(lq_sta, in il4965_rs_move_legacy_other()
1315 il4965_rs_switch_to_siso(il, lq_sta, conf, sta, in il4965_rs_move_legacy_other()
1318 lq_sta->action_counter = 0; in il4965_rs_move_legacy_other()
1344 il4965_rs_switch_to_mimo2(il, lq_sta, conf, sta, in il4965_rs_move_legacy_other()
1347 lq_sta->action_counter = 0; in il4965_rs_move_legacy_other()
1364 lq_sta->search_better_tbl = 1; in il4965_rs_move_legacy_other()
1378 il4965_rs_move_siso_to_other(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_move_siso_to_other() argument
1382 u8 is_green = lq_sta->is_green; in il4965_rs_move_siso_to_other()
1383 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_siso_to_other()
1385 &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); in il4965_rs_move_siso_to_other()
1400 lq_sta->action_counter++; in il4965_rs_move_siso_to_other()
1441 il4965_rs_switch_to_mimo2(il, lq_sta, conf, sta, in il4965_rs_move_siso_to_other()
1464 il4965_rs_set_expected_tpt_table(lq_sta, search_tbl); in il4965_rs_move_siso_to_other()
1466 s32 tpt = lq_sta->last_tpt / 100; in il4965_rs_move_siso_to_other()
1487 lq_sta->search_better_tbl = 1; in il4965_rs_move_siso_to_other()
1501 il4965_rs_move_mimo2_to_other(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_move_mimo2_to_other() argument
1505 s8 is_green = lq_sta->is_green; in il4965_rs_move_mimo2_to_other()
1506 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_mimo2_to_other()
1508 &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); in il4965_rs_move_mimo2_to_other()
1522 lq_sta->action_counter++; in il4965_rs_move_mimo2_to_other()
1562 il4965_rs_switch_to_siso(il, lq_sta, conf, sta, in il4965_rs_move_mimo2_to_other()
1582 il4965_rs_set_expected_tpt_table(lq_sta, search_tbl); in il4965_rs_move_mimo2_to_other()
1590 s32 tpt = lq_sta->last_tpt / 100; in il4965_rs_move_mimo2_to_other()
1611 lq_sta->search_better_tbl = 1; in il4965_rs_move_mimo2_to_other()
1630 il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search) in il4965_rs_stay_in_table() argument
1638 il = lq_sta->drv; in il4965_rs_stay_in_table()
1639 active_tbl = lq_sta->active_tbl; in il4965_rs_stay_in_table()
1641 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_stay_in_table()
1644 if (lq_sta->stay_in_tbl) { in il4965_rs_stay_in_table()
1647 if (lq_sta->flush_timer) in il4965_rs_stay_in_table()
1650 (unsigned long)(lq_sta->flush_timer + in il4965_rs_stay_in_table()
1662 lq_sta->total_failed > lq_sta->max_failure_limit || in il4965_rs_stay_in_table()
1663 lq_sta->total_success > lq_sta->max_success_limit || in il4965_rs_stay_in_table()
1664 (!lq_sta->search_better_tbl && lq_sta->flush_timer && in il4965_rs_stay_in_table()
1667 lq_sta->total_failed, lq_sta->total_success, in il4965_rs_stay_in_table()
1671 lq_sta->stay_in_tbl = 0; /* only place reset */ in il4965_rs_stay_in_table()
1672 lq_sta->total_failed = 0; in il4965_rs_stay_in_table()
1673 lq_sta->total_success = 0; in il4965_rs_stay_in_table()
1674 lq_sta->flush_timer = 0; in il4965_rs_stay_in_table()
1683 lq_sta->table_count++; in il4965_rs_stay_in_table()
1684 if (lq_sta->table_count >= lq_sta->table_count_limit) { in il4965_rs_stay_in_table()
1685 lq_sta->table_count = 0; in il4965_rs_stay_in_table()
1699 if (!lq_sta->stay_in_tbl) { in il4965_rs_stay_in_table()
1710 il4965_rs_update_rate_tbl(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_update_rate_tbl() argument
1717 il4965_rs_fill_link_cmd(il, lq_sta, rate); in il4965_rs_update_rate_tbl()
1718 il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); in il4965_rs_update_rate_tbl()
1727 struct il_lq_sta *lq_sta) in il4965_rs_rate_scale_perform() argument
1763 lq_sta->supp_rates = sta->deflink.supp_rates[lq_sta->band]; in il4965_rs_rate_scale_perform()
1765 tid = il4965_rs_tl_add_packet(lq_sta, hdr); in il4965_rs_rate_scale_perform()
1766 if (tid != MAX_TID_COUNT && (lq_sta->tx_agg_tid_en & (1 << tid))) { in il4965_rs_rate_scale_perform()
1767 tid_data = &il->stations[lq_sta->lq.sta_id].tid[tid]; in il4965_rs_rate_scale_perform()
1769 lq_sta->is_agg = 0; in il4965_rs_rate_scale_perform()
1771 lq_sta->is_agg = 1; in il4965_rs_rate_scale_perform()
1773 lq_sta->is_agg = 0; in il4965_rs_rate_scale_perform()
1780 if (!lq_sta->search_better_tbl) in il4965_rs_rate_scale_perform()
1781 active_tbl = lq_sta->active_tbl; in il4965_rs_rate_scale_perform()
1783 active_tbl = 1 - lq_sta->active_tbl; in il4965_rs_rate_scale_perform()
1785 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_rate_scale_perform()
1787 lq_sta->is_green = 0; in il4965_rs_rate_scale_perform()
1789 lq_sta->is_green = il4965_rs_use_green(il, sta); in il4965_rs_rate_scale_perform()
1790 is_green = lq_sta->is_green; in il4965_rs_rate_scale_perform()
1793 idx = lq_sta->last_txrate_idx; in il4965_rs_rate_scale_perform()
1798 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type); in il4965_rs_rate_scale_perform()
1804 if (lq_sta->band == NL80211_BAND_5GHZ) in il4965_rs_rate_scale_perform()
1808 (lq_sta->supp_rates << IL_FIRST_OFDM_RATE)); in il4965_rs_rate_scale_perform()
1811 (u16) (rate_mask & lq_sta->supp_rates); in il4965_rs_rate_scale_perform()
1821 if (lq_sta->search_better_tbl) { in il4965_rs_rate_scale_perform()
1824 lq_sta->search_better_tbl = 0; in il4965_rs_rate_scale_perform()
1825 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_rate_scale_perform()
1828 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, in il4965_rs_rate_scale_perform()
1841 if (lq_sta->max_rate_idx != -1 && lq_sta->max_rate_idx < idx) { in il4965_rs_rate_scale_perform()
1842 idx = lq_sta->max_rate_idx; in il4965_rs_rate_scale_perform()
1868 il4965_rs_stay_in_table(lq_sta, false); in il4965_rs_rate_scale_perform()
1882 if (lq_sta->search_better_tbl) { in il4965_rs_rate_scale_perform()
1886 if (win->average_tpt > lq_sta->last_tpt) { in il4965_rs_rate_scale_perform()
1891 lq_sta->last_tpt); in il4965_rs_rate_scale_perform()
1894 lq_sta->enable_counter = 1; in il4965_rs_rate_scale_perform()
1897 lq_sta->active_tbl = active_tbl; in il4965_rs_rate_scale_perform()
1906 lq_sta->last_tpt); in il4965_rs_rate_scale_perform()
1912 active_tbl = lq_sta->active_tbl; in il4965_rs_rate_scale_perform()
1913 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_rate_scale_perform()
1917 current_tpt = lq_sta->last_tpt; in il4965_rs_rate_scale_perform()
1925 lq_sta->search_better_tbl = 0; in il4965_rs_rate_scale_perform()
1939 if (lq_sta->max_rate_idx != -1 && lq_sta->max_rate_idx < high) in il4965_rs_rate_scale_perform()
2031 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green); in il4965_rs_rate_scale_perform()
2035 il4965_rs_stay_in_table(lq_sta, false); in il4965_rs_rate_scale_perform()
2043 if (!update_lq && !done_search && !lq_sta->stay_in_tbl && win->counter) { in il4965_rs_rate_scale_perform()
2045 lq_sta->last_tpt = current_tpt; in il4965_rs_rate_scale_perform()
2050 il4965_rs_move_legacy_other(il, lq_sta, conf, sta, idx); in il4965_rs_rate_scale_perform()
2052 il4965_rs_move_siso_to_other(il, lq_sta, conf, sta, in il4965_rs_rate_scale_perform()
2055 il4965_rs_move_mimo2_to_other(il, lq_sta, conf, sta, in il4965_rs_rate_scale_perform()
2059 if (lq_sta->search_better_tbl) { in il4965_rs_rate_scale_perform()
2061 tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); in il4965_rs_rate_scale_perform()
2070 il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate); in il4965_rs_rate_scale_perform()
2071 il_send_lq_cmd(il, &lq_sta->lq, CMD_ASYNC, false); in il4965_rs_rate_scale_perform()
2076 if (done_search && !lq_sta->stay_in_tbl) { in il4965_rs_rate_scale_perform()
2082 tbl1 = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_rate_scale_perform()
2084 lq_sta->action_counter > tbl1->max_search) { in il4965_rs_rate_scale_perform()
2086 il4965_rs_set_stay_in_table(il, 1, lq_sta); in il4965_rs_rate_scale_perform()
2092 if (lq_sta->enable_counter && in il4965_rs_rate_scale_perform()
2093 lq_sta->action_counter >= tbl1->max_search) { in il4965_rs_rate_scale_perform()
2094 if (lq_sta->last_tpt > IL_AGG_TPT_THREHOLD && in il4965_rs_rate_scale_perform()
2095 (lq_sta->tx_agg_tid_en & (1 << tid)) && in il4965_rs_rate_scale_perform()
2098 &il->stations[lq_sta->lq.sta_id].tid[tid]; in il4965_rs_rate_scale_perform()
2103 lq_sta, sta); in il4965_rs_rate_scale_perform()
2106 il4965_rs_set_stay_in_table(il, 0, lq_sta); in il4965_rs_rate_scale_perform()
2114 lq_sta->last_txrate_idx = i; in il4965_rs_rate_scale_perform()
2133 struct ieee80211_sta *sta, struct il_lq_sta *lq_sta) in il4965_rs_initialize_lq() argument
2143 if (!sta || !lq_sta) in il4965_rs_initialize_lq()
2148 i = lq_sta->last_txrate_idx; in il4965_rs_initialize_lq()
2152 if (!lq_sta->search_better_tbl) in il4965_rs_initialize_lq()
2153 active_tbl = lq_sta->active_tbl; in il4965_rs_initialize_lq()
2155 active_tbl = 1 - lq_sta->active_tbl; in il4965_rs_initialize_lq()
2157 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_initialize_lq()
2175 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_initialize_lq()
2176 il4965_rs_fill_link_cmd(NULL, lq_sta, rate); in il4965_rs_initialize_lq()
2177 il->stations[lq_sta->lq.sta_id].lq = &lq_sta->lq; in il4965_rs_initialize_lq()
2178 il_send_lq_cmd(il, &lq_sta->lq, CMD_SYNC, true); in il4965_rs_initialize_lq()
2190 struct il_lq_sta *lq_sta = il_sta; in il4965_rs_get_rate() local
2196 if (lq_sta) { in il4965_rs_get_rate()
2197 lq_sta->max_rate_idx = fls(txrc->rate_idx_mask) - 1; in il4965_rs_get_rate()
2199 lq_sta->max_rate_idx != -1) in il4965_rs_get_rate()
2200 lq_sta->max_rate_idx += IL_FIRST_OFDM_RATE; in il4965_rs_get_rate()
2201 if (lq_sta->max_rate_idx < 0 || in il4965_rs_get_rate()
2202 lq_sta->max_rate_idx >= RATE_COUNT) in il4965_rs_get_rate()
2203 lq_sta->max_rate_idx = -1; in il4965_rs_get_rate()
2207 if (lq_sta && !lq_sta->drv) { in il4965_rs_get_rate()
2212 if (!lq_sta) in il4965_rs_get_rate()
2215 rate_idx = lq_sta->last_txrate_idx; in il4965_rs_get_rate()
2217 if (lq_sta->last_rate_n_flags & RATE_MCS_HT_MSK) { in il4965_rs_get_rate()
2221 if (il4965_rs_extract_rate(lq_sta->last_rate_n_flags) >= in il4965_rs_get_rate()
2225 if (lq_sta->last_rate_n_flags & RATE_MCS_SGI_MSK) in il4965_rs_get_rate()
2228 if (lq_sta->last_rate_n_flags & RATE_MCS_DUP_MSK) in il4965_rs_get_rate()
2231 if (lq_sta->last_rate_n_flags & RATE_MCS_HT40_MSK) in il4965_rs_get_rate()
2234 if (lq_sta->last_rate_n_flags & RATE_MCS_GF_MSK) in il4965_rs_get_rate()
2262 return &sta_priv->lq_sta; in il4965_rs_alloc_sta()
2276 struct il_lq_sta *lq_sta; in il4965_rs_rate_init() local
2280 lq_sta = &sta_priv->lq_sta; in il4965_rs_rate_init()
2283 lq_sta->lq.sta_id = sta_id; in il4965_rs_rate_init()
2287 il4965_rs_rate_scale_clear_win(&lq_sta->lq_info[j]. in il4965_rs_rate_init()
2290 lq_sta->flush_timer = 0; in il4965_rs_rate_init()
2291 lq_sta->supp_rates = sta->deflink.supp_rates[sband->band]; in il4965_rs_rate_init()
2294 il4965_rs_rate_scale_clear_win(&lq_sta->lq_info[j]. in il4965_rs_rate_init()
2304 lq_sta->is_dup = 0; in il4965_rs_rate_init()
2305 lq_sta->max_rate_idx = -1; in il4965_rs_rate_init()
2306 lq_sta->missed_rate_counter = IL_MISSED_RATE_MAX; in il4965_rs_rate_init()
2307 lq_sta->is_green = il4965_rs_use_green(il, sta); in il4965_rs_rate_init()
2308 lq_sta->active_legacy_rate = il->active_rate & ~(0x1000); in il4965_rs_rate_init()
2309 lq_sta->band = il->band; in il4965_rs_rate_init()
2314 lq_sta->active_siso_rate = ht_cap->mcs.rx_mask[0] << 1; in il4965_rs_rate_init()
2315 lq_sta->active_siso_rate |= ht_cap->mcs.rx_mask[0] & 0x1; in il4965_rs_rate_init()
2316 lq_sta->active_siso_rate &= ~((u16) 0x2); in il4965_rs_rate_init()
2317 lq_sta->active_siso_rate <<= IL_FIRST_OFDM_RATE; in il4965_rs_rate_init()
2320 lq_sta->active_mimo2_rate = ht_cap->mcs.rx_mask[1] << 1; in il4965_rs_rate_init()
2321 lq_sta->active_mimo2_rate |= ht_cap->mcs.rx_mask[1] & 0x1; in il4965_rs_rate_init()
2322 lq_sta->active_mimo2_rate &= ~((u16) 0x2); in il4965_rs_rate_init()
2323 lq_sta->active_mimo2_rate <<= IL_FIRST_OFDM_RATE; in il4965_rs_rate_init()
2326 lq_sta->lq.general_params.single_stream_ant_msk = in il4965_rs_rate_init()
2328 lq_sta->lq.general_params.dual_stream_ant_msk = in il4965_rs_rate_init()
2331 if (!lq_sta->lq.general_params.dual_stream_ant_msk) { in il4965_rs_rate_init()
2332 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; in il4965_rs_rate_init()
2334 lq_sta->lq.general_params.dual_stream_ant_msk = in il4965_rs_rate_init()
2339 lq_sta->tx_agg_tid_en = IL_AGG_ALL_TID; in il4965_rs_rate_init()
2340 lq_sta->drv = il; in il4965_rs_rate_init()
2343 lq_sta->last_txrate_idx = rate_lowest_index(sband, sta); in il4965_rs_rate_init()
2345 lq_sta->last_txrate_idx += IL_FIRST_OFDM_RATE; in il4965_rs_rate_init()
2346 lq_sta->is_agg = 0; in il4965_rs_rate_init()
2349 lq_sta->dbg_fixed_rate = 0; in il4965_rs_rate_init()
2352 il4965_rs_initialize_lq(il, conf, sta, lq_sta); in il4965_rs_rate_init()
2356 il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta, in il4965_rs_fill_link_cmd() argument
2366 struct il_link_quality_cmd *lq_cmd = &lq_sta->lq; in il4965_rs_fill_link_cmd()
2369 il4965_rs_dbgfs_set_mcs(lq_sta, &new_rate, idx); in il4965_rs_fill_link_cmd()
2372 il4965_rs_get_tbl_info_from_mcs(new_rate, lq_sta->band, &tbl_type, in il4965_rs_fill_link_cmd()
2418 il4965_rs_dbgfs_set_mcs(lq_sta, &new_rate, idx); in il4965_rs_fill_link_cmd()
2427 il4965_rs_get_tbl_info_from_mcs(new_rate, lq_sta->band, in il4965_rs_fill_link_cmd()
2438 il4965_rs_get_lower_rate(lq_sta, &tbl_type, rate_idx, in il4965_rs_fill_link_cmd()
2460 il4965_rs_dbgfs_set_mcs(lq_sta, &new_rate, idx); in il4965_rs_fill_link_cmd()
2501 il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx) in il4965_rs_dbgfs_set_mcs() argument
2507 il = lq_sta->drv; in il4965_rs_dbgfs_set_mcs()
2509 if (lq_sta->dbg_fixed_rate) { in il4965_rs_dbgfs_set_mcs()
2511 ((lq_sta-> in il4965_rs_dbgfs_set_mcs()
2515 *rate_n_flags = lq_sta->dbg_fixed_rate; in il4965_rs_dbgfs_set_mcs()
2518 lq_sta->dbg_fixed_rate = 0; in il4965_rs_dbgfs_set_mcs()
2534 struct il_lq_sta *lq_sta = file->private_data; in il4965_rs_sta_dbgfs_scale_table_write() local
2540 il = lq_sta->drv; in il4965_rs_sta_dbgfs_scale_table_write()
2547 lq_sta->dbg_fixed_rate = parsed_rate; in il4965_rs_sta_dbgfs_scale_table_write()
2549 lq_sta->dbg_fixed_rate = 0; in il4965_rs_sta_dbgfs_scale_table_write()
2551 lq_sta->active_legacy_rate = 0x0FFF; /* 1 - 54 MBits, includes CCK */ in il4965_rs_sta_dbgfs_scale_table_write()
2552 lq_sta->active_siso_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ in il4965_rs_sta_dbgfs_scale_table_write()
2553 lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ in il4965_rs_sta_dbgfs_scale_table_write()
2555 D_RATE("sta_id %d rate 0x%X\n", lq_sta->lq.sta_id, in il4965_rs_sta_dbgfs_scale_table_write()
2556 lq_sta->dbg_fixed_rate); in il4965_rs_sta_dbgfs_scale_table_write()
2558 if (lq_sta->dbg_fixed_rate) { in il4965_rs_sta_dbgfs_scale_table_write()
2559 il4965_rs_fill_link_cmd(NULL, lq_sta, lq_sta->dbg_fixed_rate); in il4965_rs_sta_dbgfs_scale_table_write()
2560 il_send_lq_cmd(lq_sta->drv, &lq_sta->lq, CMD_ASYNC, false); in il4965_rs_sta_dbgfs_scale_table_write()
2576 struct il_lq_sta *lq_sta = file->private_data; in il4965_rs_sta_dbgfs_scale_table_read() local
2578 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_sta_dbgfs_scale_table_read()
2580 il = lq_sta->drv; in il4965_rs_sta_dbgfs_scale_table_read()
2585 desc += sprintf(buff + desc, "sta_id %d\n", lq_sta->lq.sta_id); in il4965_rs_sta_dbgfs_scale_table_read()
2588 lq_sta->total_failed, lq_sta->total_success, in il4965_rs_sta_dbgfs_scale_table_read()
2589 lq_sta->active_legacy_rate); in il4965_rs_sta_dbgfs_scale_table_read()
2591 sprintf(buff + desc, "fixed rate 0x%X\n", lq_sta->dbg_fixed_rate); in il4965_rs_sta_dbgfs_scale_table_read()
2610 (lq_sta->is_green) ? "GF enabled" : "", in il4965_rs_sta_dbgfs_scale_table_read()
2611 (lq_sta->is_agg) ? "AGG on" : ""); in il4965_rs_sta_dbgfs_scale_table_read()
2615 lq_sta->last_rate_n_flags); in il4965_rs_sta_dbgfs_scale_table_read()
2619 lq_sta->lq.general_params.flags, in il4965_rs_sta_dbgfs_scale_table_read()
2620 lq_sta->lq.general_params.mimo_delimiter, in il4965_rs_sta_dbgfs_scale_table_read()
2621 lq_sta->lq.general_params.single_stream_ant_msk, in il4965_rs_sta_dbgfs_scale_table_read()
2622 lq_sta->lq.general_params.dual_stream_ant_msk); in il4965_rs_sta_dbgfs_scale_table_read()
2628 le16_to_cpu(lq_sta->lq.agg_params.agg_time_limit), in il4965_rs_sta_dbgfs_scale_table_read()
2629 lq_sta->lq.agg_params.agg_dis_start_th, in il4965_rs_sta_dbgfs_scale_table_read()
2630 lq_sta->lq.agg_params.agg_frame_cnt_limit); in il4965_rs_sta_dbgfs_scale_table_read()
2635 lq_sta->lq.general_params.start_rate_idx[0], in il4965_rs_sta_dbgfs_scale_table_read()
2636 lq_sta->lq.general_params.start_rate_idx[1], in il4965_rs_sta_dbgfs_scale_table_read()
2637 lq_sta->lq.general_params.start_rate_idx[2], in il4965_rs_sta_dbgfs_scale_table_read()
2638 lq_sta->lq.general_params.start_rate_idx[3]); in il4965_rs_sta_dbgfs_scale_table_read()
2643 (lq_sta->lq.rs_table[i]. in il4965_rs_sta_dbgfs_scale_table_read()
2648 le32_to_cpu(lq_sta->lq.rs_table[i]. in il4965_rs_sta_dbgfs_scale_table_read()
2655 le32_to_cpu(lq_sta->lq.rs_table[i]. in il4965_rs_sta_dbgfs_scale_table_read()
2683 struct il_lq_sta *lq_sta = file->private_data; in il4965_rs_sta_dbgfs_stats_table_read() local
2693 "rate=0x%X\n", lq_sta->active_tbl == i ? "*" : "x", in il4965_rs_sta_dbgfs_stats_table_read()
2694 lq_sta->lq_info[i].lq_type, in il4965_rs_sta_dbgfs_stats_table_read()
2695 lq_sta->lq_info[i].is_SGI, in il4965_rs_sta_dbgfs_stats_table_read()
2696 lq_sta->lq_info[i].is_ht40, in il4965_rs_sta_dbgfs_stats_table_read()
2697 lq_sta->lq_info[i].is_dup, lq_sta->is_green, in il4965_rs_sta_dbgfs_stats_table_read()
2698 lq_sta->lq_info[i].current_rate); in il4965_rs_sta_dbgfs_stats_table_read()
2703 lq_sta->lq_info[i].win[j].counter, in il4965_rs_sta_dbgfs_stats_table_read()
2704 lq_sta->lq_info[i].win[j].success_counter, in il4965_rs_sta_dbgfs_stats_table_read()
2705 lq_sta->lq_info[i].win[j].success_ratio); in il4965_rs_sta_dbgfs_stats_table_read()
2726 struct il_lq_sta *lq_sta = file->private_data; in il4965_rs_sta_dbgfs_rate_scale_data_read() local
2727 struct il_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl]; in il4965_rs_sta_dbgfs_rate_scale_data_read()
2732 tbl->expected_tpt[lq_sta->last_txrate_idx]); in il4965_rs_sta_dbgfs_rate_scale_data_read()
2736 il_rates[lq_sta->last_txrate_idx].ieee >> 1); in il4965_rs_sta_dbgfs_rate_scale_data_read()
2750 struct il_lq_sta *lq_sta = il_sta; in il4965_rs_add_debugfs() local
2752 debugfs_create_file("rate_scale_table", 0600, dir, lq_sta, in il4965_rs_add_debugfs()
2754 debugfs_create_file("rate_stats_table", 0400, dir, lq_sta, in il4965_rs_add_debugfs()
2756 debugfs_create_file("rate_scale_data", 0400, dir, lq_sta, in il4965_rs_add_debugfs()
2759 &lq_sta->tx_agg_tid_en); in il4965_rs_add_debugfs()