Lines Matching refs:mvm

114 typedef bool (*allow_column_func_t) (struct iwl_mvm *mvm,
127 static bool rs_ant_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_ant_allow() argument
131 return iwl_mvm_bt_coex_is_ant_avail(mvm, next_col->ant); in rs_ant_allow()
134 static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_mimo_allow() argument
144 if (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) < 2) in rs_mimo_allow()
147 if (!iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta)) in rs_mimo_allow()
150 if (mvm->nvm_data->sku_cap_mimo_disabled) in rs_mimo_allow()
156 static bool rs_siso_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_siso_allow() argument
166 static bool rs_sgi_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_sgi_allow() argument
374 static void rs_rate_scale_perform(struct iwl_mvm *mvm,
378 static void rs_fill_lq_cmd(struct iwl_mvm *mvm,
522 static inline void rs_dump_rate(struct iwl_mvm *mvm, const struct rs_rate *rate, in rs_dump_rate() argument
525 IWL_DEBUG_RATE(mvm, in rs_dump_rate()
540 static void rs_rate_scale_clear_tbl_windows(struct iwl_mvm *mvm, in rs_rate_scale_clear_tbl_windows() argument
545 IWL_DEBUG_RATE(mvm, "Clearing up window stats\n"); in rs_rate_scale_clear_tbl_windows()
558 static int rs_tl_turn_on_agg_for_tid(struct iwl_mvm *mvm, in rs_tl_turn_on_agg_for_tid() argument
564 IWL_DEBUG_HT(mvm, "Starting Tx agg: STA: %pM tid: %d\n", in rs_tl_turn_on_agg_for_tid()
575 IWL_ERR(mvm, "Fail start Tx agg on tid: %d\n", in rs_tl_turn_on_agg_for_tid()
582 static void rs_tl_turn_on_agg(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, in rs_tl_turn_on_agg() argument
593 IWL_ERR(mvm, "tid exceeds max TID count: %d/%d\n", in rs_tl_turn_on_agg()
605 IWL_DEBUG_RATE(mvm, "try to aggregate tid %d\n", tid); in rs_tl_turn_on_agg()
606 if (rs_tl_turn_on_agg_for_tid(mvm, lq_sta, tid, sta) == 0) in rs_tl_turn_on_agg()
635 static int _rs_collect_tx_data(struct iwl_mvm *mvm, in _rs_collect_tx_data() argument
700 static int rs_collect_tpc_data(struct iwl_mvm *mvm, in rs_collect_tpc_data() argument
712 return _rs_collect_tx_data(mvm, tbl, scale_index, attempts, successes, in rs_collect_tpc_data()
716 static void rs_update_tid_tpt_stats(struct iwl_mvm *mvm, in rs_update_tid_tpt_stats() argument
746 static int rs_collect_tlc_data(struct iwl_mvm *mvm, in rs_collect_tlc_data() argument
763 rs_update_tid_tpt_stats(mvm, mvmsta, tid, successes); in rs_collect_tlc_data()
767 return _rs_collect_tx_data(mvm, tbl, scale_index, attempts, successes, in rs_collect_tlc_data()
772 static u32 ucode_rate_from_rs_rate(struct iwl_mvm *mvm, in ucode_rate_from_rs_rate() argument
796 IWL_ERR(mvm, "Invalid HT rate index %d\n", index); in ucode_rate_from_rs_rate()
809 IWL_ERR(mvm, "Invalid VHT rate index %d\n", index); in ucode_rate_from_rs_rate()
821 IWL_ERR(mvm, "Invalid rate->type %d\n", rate->type); in ucode_rate_from_rs_rate()
971 static u16 rs_get_adjacent_rate(struct iwl_mvm *mvm, u8 index, u16 rate_mask, in rs_get_adjacent_rate() argument
1042 struct iwl_mvm *mvm = lq_sta->pers.drv; in rs_get_lower_rate_in_column() local
1045 high_low = rs_get_adjacent_rate(mvm, rate->index, rate_mask, in rs_get_lower_rate_in_column()
1061 struct iwl_mvm *mvm = lq_sta->pers.drv; in rs_get_lower_rate_down_column() local
1087 rate->ant = first_antenna(iwl_mvm_get_valid_tx_ant(mvm)); in rs_get_lower_rate_down_column()
1167 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in rs_drv_mac80211_tx_status() local
1178 iwl_mvm_rs_tx_status(mvm, sta, rs_get_tid(hdr), info, in rs_drv_mac80211_tx_status()
1190 static void rs_set_stay_in_table(struct iwl_mvm *mvm, u8 is_legacy, in rs_set_stay_in_table() argument
1193 IWL_DEBUG_RATE(mvm, "Moving to RS_STATE_STAY_IN_COLUMN\n"); in rs_set_stay_in_table()
1324 static s32 rs_get_best_rate(struct iwl_mvm *mvm, in rs_get_best_rate() argument
1340 IWL_DEBUG_RATE(mvm, in rs_get_best_rate()
1345 IWL_DEBUG_RATE(mvm, in rs_get_best_rate()
1356 high_low = rs_get_adjacent_rate(mvm, rate_idx, rate_mask, in rs_get_best_rate()
1362 IWL_DEBUG_RATE(mvm, "Best rate found %d target_tp %d expected_new %d\n", in rs_get_best_rate()
1416 struct iwl_mvm *mvm; in rs_stay_in_table() local
1418 mvm = lq_sta->pers.drv; in rs_stay_in_table()
1445 IWL_DEBUG_RATE(mvm, in rs_stay_in_table()
1453 IWL_DEBUG_RATE(mvm, in rs_stay_in_table()
1472 IWL_DEBUG_RATE(mvm, in rs_stay_in_table()
1474 rs_rate_scale_clear_tbl_windows(mvm, tbl); in rs_stay_in_table()
1482 rs_rate_scale_clear_tbl_windows(mvm, tbl); in rs_stay_in_table()
1487 static void rs_set_amsdu_len(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_set_amsdu_len() argument
1518 iwl_mvm_max_amsdu_size(mvm, sta, i); in rs_set_amsdu_len()
1531 static void rs_update_rate_tbl(struct iwl_mvm *mvm, in rs_update_rate_tbl() argument
1536 rs_fill_lq_cmd(mvm, sta, lq_sta, &tbl->rate); in rs_update_rate_tbl()
1537 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq); in rs_update_rate_tbl()
1540 static bool rs_tweak_rate_tbl(struct iwl_mvm *mvm, in rs_tweak_rate_tbl() argument
1557 IWL_DEBUG_RATE(mvm, "Switch 80Mhz SISO MCS0 -> 20Mhz MCS4\n"); in rs_tweak_rate_tbl()
1573 IWL_DEBUG_RATE(mvm, "Switch 20Mhz SISO MCS5 -> 80Mhz MCS1\n"); in rs_tweak_rate_tbl()
1581 rs_rate_scale_clear_tbl_windows(mvm, tbl); in rs_tweak_rate_tbl()
1585 static enum rs_column rs_get_next_column(struct iwl_mvm *mvm, in rs_get_next_column() argument
1595 u8 valid_ants = iwl_mvm_get_valid_tx_ant(mvm); in rs_get_next_column()
1606 IWL_DEBUG_RATE(mvm, "Skip already visited column %d\n", in rs_get_next_column()
1614 IWL_DEBUG_RATE(mvm, in rs_get_next_column()
1622 if (allow_func && !allow_func(mvm, sta, &tbl->rate, in rs_get_next_column()
1628 IWL_DEBUG_RATE(mvm, in rs_get_next_column()
1643 IWL_DEBUG_RATE(mvm, in rs_get_next_column()
1651 IWL_DEBUG_RATE(mvm, in rs_get_next_column()
1657 IWL_DEBUG_RATE(mvm, in rs_get_next_column()
1669 static int rs_switch_to_column(struct iwl_mvm *mvm, in rs_switch_to_column() argument
1721 rate_idx = rs_get_best_rate(mvm, lq_sta, search_tbl, in rs_switch_to_column()
1726 IWL_DEBUG_RATE(mvm, in rs_switch_to_column()
1737 IWL_DEBUG_RATE(mvm, "Switched to column %d: Index %d\n", in rs_switch_to_column()
1747 static enum rs_action rs_get_rate_action(struct iwl_mvm *mvm, in rs_get_rate_action() argument
1757 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1765 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1774 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1781 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1790 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1797 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1805 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1811 IWL_DEBUG_RATE(mvm, "Maintain rate\n"); in rs_get_rate_action()
1816 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1820 IWL_DEBUG_RATE(mvm, in rs_get_rate_action()
1824 IWL_DEBUG_RATE(mvm, "Decrease rate\n"); in rs_get_rate_action()
1831 static bool rs_stbc_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_stbc_allow() argument
1840 if (!iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta)) in rs_stbc_allow()
1846 static void rs_get_adjacent_txp(struct iwl_mvm *mvm, int index, in rs_get_adjacent_txp() argument
1858 static bool rs_tpc_allowed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in rs_tpc_allowed() argument
1866 IWL_DEBUG_RATE(mvm, "cam: %d sta_ps_disabled %d\n", in rs_tpc_allowed()
1873 !iwl_mvm_bt_coex_is_tpc_allowed(mvm, band)) in rs_tpc_allowed()
1876 IWL_DEBUG_RATE(mvm, "check rate, table type: %d\n", rate->type); in rs_tpc_allowed()
1895 static enum tpc_action rs_get_tpc_action(struct iwl_mvm *mvm, in rs_get_tpc_action() argument
1902 IWL_DEBUG_RATE(mvm, "no current tpt. stay.\n"); in rs_get_tpc_action()
1909 IWL_DEBUG_RATE(mvm, "increase txp because of weak SR\n"); in rs_get_tpc_action()
1919 IWL_DEBUG_RATE(mvm, in rs_get_tpc_action()
1925 IWL_DEBUG_RATE(mvm, in rs_get_tpc_action()
1937 IWL_DEBUG_RATE(mvm, in rs_get_tpc_action()
1945 IWL_DEBUG_RATE(mvm, in rs_get_tpc_action()
1951 IWL_DEBUG_RATE(mvm, "no need to increase or decrease txp - stay\n"); in rs_get_tpc_action()
1955 static bool rs_tpc_perform(struct iwl_mvm *mvm, in rs_tpc_perform() argument
1975 IWL_DEBUG_RATE(mvm, "fixed tpc: %d\n", in rs_tpc_perform()
1990 if (!rs_tpc_allowed(mvm, vif, rate, band)) { in rs_tpc_perform()
1991 IWL_DEBUG_RATE(mvm, in rs_tpc_perform()
1997 rs_get_adjacent_txp(mvm, cur, &weak, &strong); in rs_tpc_perform()
2008 IWL_DEBUG_RATE(mvm, in rs_tpc_perform()
2013 action = rs_get_tpc_action(mvm, sr, weak, strong, in rs_tpc_perform()
2018 IWL_DEBUG_RATE(mvm, "already in lowest txp, stay\n"); in rs_tpc_perform()
2023 IWL_DEBUG_RATE(mvm, "already in highest txp, stay\n"); in rs_tpc_perform()
2047 static void rs_rate_scale_perform(struct iwl_mvm *mvm, in rs_rate_scale_perform() argument
2088 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2092 rs_rate_scale_clear_tbl_windows(mvm, tbl); in rs_rate_scale_perform()
2102 IWL_ERR(mvm, "Current Rate is not valid\n"); in rs_rate_scale_perform()
2108 rs_update_rate_tbl(mvm, sta, lq_sta, tbl); in rs_rate_scale_perform()
2115 IWL_ERR(mvm, "tbl->expected_tpt is NULL\n"); in rs_rate_scale_perform()
2132 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2153 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2165 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2196 high_low = rs_get_adjacent_rate(mvm, index, rate_mask, rate->type); in rs_rate_scale_perform()
2211 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2216 scale_action = rs_get_rate_action(mvm, tbl, sr, low, high, in rs_rate_scale_perform()
2221 !iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta)) { in rs_rate_scale_perform()
2222 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2235 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2246 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2254 update_lq = rs_tpc_perform(mvm, sta, lq_sta, tbl); in rs_rate_scale_perform()
2265 rs_tweak_rate_tbl(mvm, sta, lq_sta, tbl, scale_action); in rs_rate_scale_perform()
2266 rs_set_amsdu_len(mvm, sta, tbl, scale_action); in rs_rate_scale_perform()
2267 rs_update_rate_tbl(mvm, sta, lq_sta, tbl); in rs_rate_scale_perform()
2286 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2291 next_column = rs_get_next_column(mvm, lq_sta, sta, tbl); in rs_rate_scale_perform()
2293 int ret = rs_switch_to_column(mvm, lq_sta, sta, in rs_rate_scale_perform()
2298 IWL_DEBUG_RATE(mvm, in rs_rate_scale_perform()
2307 rs_rate_scale_clear_tbl_windows(mvm, tbl); in rs_rate_scale_perform()
2312 rs_dump_rate(mvm, &tbl->rate, in rs_rate_scale_perform()
2314 rs_update_rate_tbl(mvm, sta, lq_sta, tbl); in rs_rate_scale_perform()
2321 rs_tl_turn_on_agg(mvm, mvmsta, tid, lq_sta, sta); in rs_rate_scale_perform()
2325 rs_set_stay_in_table(mvm, is_legacy(&tbl1->rate), lq_sta); in rs_rate_scale_perform()
2403 static void rs_init_optimal_rate(struct iwl_mvm *mvm, in rs_init_optimal_rate() argument
2419 rate->sgi = rs_sgi_allow(mvm, sta, rate, NULL); in rs_init_optimal_rate()
2458 static struct rs_rate *rs_get_optimal_rate(struct iwl_mvm *mvm, in rs_get_optimal_rate() argument
2483 static void rs_get_initial_rate(struct iwl_mvm *mvm, in rs_get_initial_rate() argument
2494 u8 valid_tx_ant = iwl_mvm_get_valid_tx_ant(mvm); in rs_get_initial_rate()
2507 IWL_DEBUG_RATE(mvm, "Best ANT: %s Best RSSI: %d\n", in rs_get_initial_rate()
2566 IWL_ERR(mvm, "Invalid BW %d\n", in rs_get_initial_rate()
2595 rs_dump_rate(mvm, rate, "INITIAL"); in rs_get_initial_rate()
2599 void rs_update_last_rssi(struct iwl_mvm *mvm, in rs_update_last_rssi() argument
2634 static void rs_initialize_lq(struct iwl_mvm *mvm, in rs_initialize_lq() argument
2654 rs_get_initial_rate(mvm, sta, lq_sta, band, rate); in rs_initialize_lq()
2655 rs_init_optimal_rate(mvm, sta, lq_sta); in rs_initialize_lq()
2659 rate->ant, lq_sta->pers.chains, mvm->fw->valid_tx_ant, in rs_initialize_lq()
2660 mvm->nvm_data ? mvm->nvm_data->valid_tx_ant : ANT_INVALID); in rs_initialize_lq()
2665 rs_fill_lq_cmd(mvm, sta, lq_sta, rate); in rs_initialize_lq()
2667 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq); in rs_initialize_lq()
2675 struct iwl_mvm *mvm __maybe_unused = IWL_OP_MODE_GET_MVM(op_mode); in rs_drv_get_rate()
2702 optimal_rate = rs_get_optimal_rate(mvm, lq_sta); in rs_drv_get_rate()
2703 last_ucode_rate = ucode_rate_from_rs_rate(mvm, in rs_drv_get_rate()
2715 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); in rs_drv_alloc_sta() local
2718 IWL_DEBUG_RATE(mvm, "create station rate scale window\n"); in rs_drv_alloc_sta()
2720 lq_sta->pers.drv = mvm; in rs_drv_alloc_sta()
2791 static void rs_ht_init(struct iwl_mvm *mvm, in rs_ht_init() argument
2810 if (mvm->cfg->ht_params->ldpc && in rs_ht_init()
2814 if (mvm->cfg->ht_params->stbc && in rs_ht_init()
2815 (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) > 1) && in rs_ht_init()
2822 static void rs_vht_init(struct iwl_mvm *mvm, in rs_vht_init() argument
2829 if (mvm->cfg->ht_params->ldpc && in rs_vht_init()
2833 if (mvm->cfg->ht_params->stbc && in rs_vht_init()
2834 (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) > 1) && in rs_vht_init()
2838 if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_BEAMFORMER) && in rs_vht_init()
2839 (num_of_ant(iwl_mvm_get_valid_tx_ant(mvm)) > 1) && in rs_vht_init()
2847 void iwl_mvm_reset_frame_stats(struct iwl_mvm *mvm) in iwl_mvm_reset_frame_stats() argument
2849 spin_lock_bh(&mvm->drv_stats_lock); in iwl_mvm_reset_frame_stats()
2850 memset(&mvm->drv_rx_stats, 0, sizeof(mvm->drv_rx_stats)); in iwl_mvm_reset_frame_stats()
2851 spin_unlock_bh(&mvm->drv_stats_lock); in iwl_mvm_reset_frame_stats()
2854 void iwl_mvm_update_frame_stats(struct iwl_mvm *mvm, u32 rate, bool agg) in iwl_mvm_update_frame_stats() argument
2858 spin_lock(&mvm->drv_stats_lock); in iwl_mvm_update_frame_stats()
2861 mvm->drv_rx_stats.agg_frames++; in iwl_mvm_update_frame_stats()
2863 mvm->drv_rx_stats.success_frames++; in iwl_mvm_update_frame_stats()
2867 mvm->drv_rx_stats.bw_20_frames++; in iwl_mvm_update_frame_stats()
2870 mvm->drv_rx_stats.bw_40_frames++; in iwl_mvm_update_frame_stats()
2873 mvm->drv_rx_stats.bw_80_frames++; in iwl_mvm_update_frame_stats()
2876 mvm->drv_rx_stats.bw_160_frames++; in iwl_mvm_update_frame_stats()
2883 mvm->drv_rx_stats.ht_frames++; in iwl_mvm_update_frame_stats()
2886 mvm->drv_rx_stats.vht_frames++; in iwl_mvm_update_frame_stats()
2890 mvm->drv_rx_stats.legacy_frames++; in iwl_mvm_update_frame_stats()
2894 mvm->drv_rx_stats.siso_frames++; in iwl_mvm_update_frame_stats()
2896 mvm->drv_rx_stats.mimo2_frames++; in iwl_mvm_update_frame_stats()
2899 mvm->drv_rx_stats.sgi_frames++; in iwl_mvm_update_frame_stats()
2901 mvm->drv_rx_stats.ngi_frames++; in iwl_mvm_update_frame_stats()
2903 mvm->drv_rx_stats.last_rates[mvm->drv_rx_stats.last_frame_idx] = rate; in iwl_mvm_update_frame_stats()
2904 mvm->drv_rx_stats.last_frame_idx = in iwl_mvm_update_frame_stats()
2905 (mvm->drv_rx_stats.last_frame_idx + 1) % in iwl_mvm_update_frame_stats()
2906 ARRAY_SIZE(mvm->drv_rx_stats.last_rates); in iwl_mvm_update_frame_stats()
2908 spin_unlock(&mvm->drv_stats_lock); in iwl_mvm_update_frame_stats()
2915 static void rs_drv_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in rs_drv_rate_init() argument
2919 struct ieee80211_hw *hw = mvm->hw; in rs_drv_rate_init()
2939 rs_rate_scale_clear_tbl_windows(mvm, &lq_sta->lq_info[j]); in rs_drv_rate_init()
2944 IWL_DEBUG_RATE(mvm, in rs_drv_rate_init()
2964 rs_ht_init(mvm, sta, lq_sta, ht_cap); in rs_drv_rate_init()
2966 rs_vht_init(mvm, sta, lq_sta, vht_cap); in rs_drv_rate_init()
2975 IWL_DEBUG_RATE(mvm, in rs_drv_rate_init()
2982 IWL_DEBUG_RATE(mvm, "MAX RATE: LEGACY=%d SISO=%d MIMO2=%d\n", in rs_drv_rate_init()
2989 iwl_mvm_bt_coex_get_single_ant_msk(mvm, iwl_mvm_get_valid_tx_ant(mvm)); in rs_drv_rate_init()
2996 iwl_mvm_reset_frame_stats(mvm); in rs_drv_rate_init()
2998 rs_initialize_lq(mvm, sta, lq_sta, band); in rs_drv_rate_init()
3008 struct iwl_mvm *mvm __maybe_unused = IWL_OP_MODE_GET_MVM(op_mode); in rs_drv_rate_update()
3018 iwl_mvm_rs_rate_init(mvm, sta, sband->band, true); in rs_drv_rate_update()
3021 static void __iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, in __iwl_mvm_rs_tx_status() argument
3041 IWL_DEBUG_RATE(mvm, "Rate scaling not initialized yet.\n"); in __iwl_mvm_rs_tx_status()
3082 IWL_DEBUG_RATE(mvm, "Fixed rate 0x%x success %d attempts %d\n", in __iwl_mvm_rs_tx_status()
3091 IWL_DEBUG_RATE(mvm, "Tx idle for too long. reinit rs\n"); in __iwl_mvm_rs_tx_status()
3095 rs_drv_rate_init(mvm, sta, info->band); in __iwl_mvm_rs_tx_status()
3116 IWL_DEBUG_RATE(mvm, in __iwl_mvm_rs_tx_status()
3127 IWL_DEBUG_RATE(mvm, in __iwl_mvm_rs_tx_status()
3130 iwl_mvm_send_lq_cmd(mvm, &lq_sta->lq); in __iwl_mvm_rs_tx_status()
3148 IWL_DEBUG_RATE(mvm, in __iwl_mvm_rs_tx_status()
3151 rs_dump_rate(mvm, &tmp_tbl->rate, "ACTIVE"); in __iwl_mvm_rs_tx_status()
3153 rs_dump_rate(mvm, &tmp_tbl->rate, "SEARCH"); in __iwl_mvm_rs_tx_status()
3154 rs_dump_rate(mvm, &lq_rate, "ACTUAL"); in __iwl_mvm_rs_tx_status()
3170 rs_collect_tpc_data(mvm, lq_sta, curr_tbl, tx_resp_rate.index, in __iwl_mvm_rs_tx_status()
3191 rs_collect_tlc_data(mvm, mvmsta, tid, curr_tbl, in __iwl_mvm_rs_tx_status()
3230 rs_collect_tpc_data(mvm, lq_sta, tmp_tbl, in __iwl_mvm_rs_tx_status()
3234 rs_collect_tlc_data(mvm, mvmsta, tid, tmp_tbl, in __iwl_mvm_rs_tx_status()
3247 IWL_DEBUG_RATE(mvm, "reduced txpower: %d\n", reduced_txp); in __iwl_mvm_rs_tx_status()
3251 rs_rate_scale_perform(mvm, sta, lq_sta, tid, ndp); in __iwl_mvm_rs_tx_status()
3254 void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_rs_tx_status() argument
3265 __iwl_mvm_rs_tx_status(mvm, sta, tid, info, ndp); in iwl_mvm_rs_tx_status()
3270 static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm, in rs_build_rates_table_from_fixed() argument
3299 if (!mvm->trans->trans_cfg->gen2) in rs_build_rates_table_from_fixed()
3307 static void rs_fill_rates_for_column(struct iwl_mvm *mvm, in rs_fill_rates_for_column() argument
3323 ucode_rate = cpu_to_le32(ucode_rate_from_rs_rate(mvm, in rs_fill_rates_for_column()
3362 static void rs_build_rates_table(struct iwl_mvm *mvm, in rs_build_rates_table() argument
3376 valid_tx_ant = iwl_mvm_get_valid_tx_ant(mvm); in rs_build_rates_table()
3379 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_LQ_SS_PARAMS) && in rs_build_rates_table()
3380 rs_stbc_allow(mvm, sta, lq_sta)) in rs_build_rates_table()
3395 rs_fill_rates_for_column(mvm, lq_sta, &rate, lq_cmd->rs_table, &index, in rs_build_rates_table()
3414 rs_fill_rates_for_column(mvm, lq_sta, &rate, lq_cmd->rs_table, &index, in rs_build_rates_table()
3423 rs_fill_rates_for_column(mvm, lq_sta, &rate, lq_cmd->rs_table, &index, in rs_build_rates_table()
3494 static void rs_set_lq_ss_params(struct iwl_mvm *mvm, in rs_set_lq_ss_params() argument
3508 if (!iwl_mvm_bt_coex_is_mimo_allowed(mvm, sta)) in rs_set_lq_ss_params()
3521 IWL_DEBUG_RATE(mvm, "Forcing single stream Tx decision %d\n", in rs_set_lq_ss_params()
3533 ieee80211_iterate_stations_atomic(mvm->hw, in rs_set_lq_ss_params()
3543 IWL_DEBUG_RATE(mvm, "No sta with BFER allowed found. Allow\n"); in rs_set_lq_ss_params()
3549 IWL_DEBUG_RATE(mvm, "Found existing sta %d with BFER activated\n", in rs_set_lq_ss_params()
3560 iwl_mvm_send_lq_cmd(mvm, bfersta_lq_cmd); in rs_set_lq_ss_params()
3563 IWL_DEBUG_RATE(mvm, in rs_set_lq_ss_params()
3571 static void rs_fill_lq_cmd(struct iwl_mvm *mvm, in rs_fill_lq_cmd() argument
3586 rs_build_rates_table_from_fixed(mvm, lq_cmd, in rs_fill_lq_cmd()
3595 rs_build_rates_table(mvm, sta, lq_sta, initial_rate); in rs_fill_lq_cmd()
3597 if (fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_LQ_SS_PARAMS)) in rs_fill_lq_cmd()
3598 rs_set_lq_ss_params(mvm, sta, lq_sta, initial_rate); in rs_fill_lq_cmd()
3603 if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2) && in rs_fill_lq_cmd()
3621 cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta)); in rs_fill_lq_cmd()
3638 struct iwl_mvm *mvm __maybe_unused = IWL_OP_MODE_GET_MVM(op_mode); in rs_free_sta()
3640 IWL_DEBUG_RATE(mvm, "enter\n"); in rs_free_sta()
3641 IWL_DEBUG_RATE(mvm, "leave\n"); in rs_free_sta()
3700 static void rs_program_fix_rate(struct iwl_mvm *mvm, in rs_program_fix_rate() argument
3707 IWL_DEBUG_RATE(mvm, "sta_id %d rate 0x%X\n", in rs_program_fix_rate()
3711 rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL); in rs_program_fix_rate()
3720 struct iwl_mvm *mvm; in rs_sta_dbgfs_scale_table_write() local
3725 mvm = lq_sta->pers.drv; in rs_sta_dbgfs_scale_table_write()
3736 rs_program_fix_rate(mvm, lq_sta); in rs_sta_dbgfs_scale_table_write()
3753 struct iwl_mvm *mvm; in rs_sta_dbgfs_scale_table_read() local
3758 mvm = lq_sta->pers.drv; in rs_sta_dbgfs_scale_table_read()
3772 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_A) ? "ANT_A," : "", in rs_sta_dbgfs_scale_table_read()
3773 (iwl_mvm_get_valid_tx_ant(mvm) & ANT_B) ? "ANT_B," : ""); in rs_sta_dbgfs_scale_table_read()
4008 struct iwl_mvm *mvm = lq_sta->pers.drv; in iwl_dbgfs_ss_force_write() local
4019 IWL_ERR(mvm, in iwl_dbgfs_ss_force_write()
4027 IWL_ERR(mvm, in iwl_dbgfs_ss_force_write()
4032 IWL_ERR(mvm, "valid values none|siso|stbc|bfer\n"); in iwl_dbgfs_ss_force_write()
4047 static void rs_drv_add_sta_debugfs(void *mvm, void *priv_sta, in rs_drv_add_sta_debugfs() argument
4102 void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, in iwl_mvm_rs_rate_init() argument
4105 if (iwl_mvm_has_tlc_offload(mvm)) { in iwl_mvm_rs_rate_init()
4106 rs_fw_rate_init(mvm, sta, band, update); in iwl_mvm_rs_rate_init()
4111 rs_drv_rate_init(mvm, sta, band); in iwl_mvm_rs_rate_init()
4126 static int rs_drv_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, in rs_drv_tx_protection() argument
4131 lockdep_assert_held(&mvm->mutex); in rs_drv_tx_protection()
4143 return iwl_mvm_send_lq_cmd(mvm, lq); in rs_drv_tx_protection()
4152 int iwl_mvm_tx_protection(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, in iwl_mvm_tx_protection() argument
4155 if (iwl_mvm_has_tlc_offload(mvm)) in iwl_mvm_tx_protection()
4156 return rs_fw_tx_protection(mvm, mvmsta, enable); in iwl_mvm_tx_protection()
4158 return rs_drv_tx_protection(mvm, mvmsta, enable); in iwl_mvm_tx_protection()