diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/rs.c | 66 |
1 files changed, 48 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index c70e959bf0e3..17002cf437db 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. | 3 | * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. |
4 | * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH | ||
4 | * | 5 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of version 2 of the GNU General Public License as | 7 | * under the terms of version 2 of the GNU General Public License as |
@@ -2678,6 +2679,7 @@ static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm, | |||
2678 | int i; | 2679 | int i; |
2679 | int num_rates = ARRAY_SIZE(lq_cmd->rs_table); | 2680 | int num_rates = ARRAY_SIZE(lq_cmd->rs_table); |
2680 | __le32 ucode_rate_le32 = cpu_to_le32(ucode_rate); | 2681 | __le32 ucode_rate_le32 = cpu_to_le32(ucode_rate); |
2682 | u8 ant = (ucode_rate & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS; | ||
2681 | 2683 | ||
2682 | for (i = 0; i < num_rates; i++) | 2684 | for (i = 0; i < num_rates; i++) |
2683 | lq_cmd->rs_table[i] = ucode_rate_le32; | 2685 | lq_cmd->rs_table[i] = ucode_rate_le32; |
@@ -2688,6 +2690,13 @@ static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm, | |||
2688 | lq_cmd->mimo_delim = num_rates - 1; | 2690 | lq_cmd->mimo_delim = num_rates - 1; |
2689 | else | 2691 | else |
2690 | lq_cmd->mimo_delim = 0; | 2692 | lq_cmd->mimo_delim = 0; |
2693 | |||
2694 | lq_cmd->reduced_tpc = 0; | ||
2695 | |||
2696 | if (num_of_ant(ant) == 1) | ||
2697 | lq_cmd->single_stream_ant_msk = ant; | ||
2698 | |||
2699 | lq_cmd->agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_DEF; | ||
2691 | } | 2700 | } |
2692 | #endif /* CONFIG_MAC80211_DEBUGFS */ | 2701 | #endif /* CONFIG_MAC80211_DEBUGFS */ |
2693 | 2702 | ||
@@ -2811,31 +2820,55 @@ static void rs_fill_lq_cmd(struct iwl_mvm *mvm, | |||
2811 | const struct rs_rate *initial_rate) | 2820 | const struct rs_rate *initial_rate) |
2812 | { | 2821 | { |
2813 | struct iwl_lq_cmd *lq_cmd = &lq_sta->lq; | 2822 | struct iwl_lq_cmd *lq_cmd = &lq_sta->lq; |
2814 | u8 ant = initial_rate->ant; | 2823 | struct iwl_mvm_sta *mvmsta; |
2824 | struct iwl_mvm_vif *mvmvif; | ||
2825 | |||
2826 | lq_cmd->agg_disable_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; | ||
2827 | lq_cmd->agg_time_limit = | ||
2828 | cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF); | ||
2815 | 2829 | ||
2816 | #ifdef CONFIG_MAC80211_DEBUGFS | 2830 | #ifdef CONFIG_MAC80211_DEBUGFS |
2817 | if (lq_sta->pers.dbg_fixed_rate) { | 2831 | if (lq_sta->pers.dbg_fixed_rate) { |
2818 | rs_build_rates_table_from_fixed(mvm, lq_cmd, | 2832 | rs_build_rates_table_from_fixed(mvm, lq_cmd, |
2819 | lq_sta->band, | 2833 | lq_sta->band, |
2820 | lq_sta->pers.dbg_fixed_rate); | 2834 | lq_sta->pers.dbg_fixed_rate); |
2821 | lq_cmd->reduced_tpc = 0; | 2835 | return; |
2822 | ant = (lq_sta->pers.dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) >> | 2836 | } |
2823 | RATE_MCS_ANT_POS; | ||
2824 | } else | ||
2825 | #endif | 2837 | #endif |
2826 | rs_build_rates_table(mvm, lq_sta, initial_rate); | 2838 | if (WARN_ON_ONCE(!sta || !initial_rate)) |
2839 | return; | ||
2827 | 2840 | ||
2828 | if (num_of_ant(ant) == 1) | 2841 | rs_build_rates_table(mvm, lq_sta, initial_rate); |
2829 | lq_cmd->single_stream_ant_msk = ant; | ||
2830 | 2842 | ||
2831 | lq_cmd->agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_DEF; | 2843 | if (num_of_ant(initial_rate->ant) == 1) |
2832 | lq_cmd->agg_disable_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; | 2844 | lq_cmd->single_stream_ant_msk = initial_rate->ant; |
2833 | 2845 | ||
2834 | lq_cmd->agg_time_limit = | 2846 | mvmsta = iwl_mvm_sta_from_mac80211(sta); |
2835 | cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF); | 2847 | mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); |
2848 | |||
2849 | if (num_of_ant(initial_rate->ant) == 1) | ||
2850 | lq_cmd->single_stream_ant_msk = initial_rate->ant; | ||
2851 | |||
2852 | lq_cmd->agg_frame_cnt_limit = mvmsta->max_agg_bufsize; | ||
2836 | 2853 | ||
2837 | if (sta) | 2854 | /* |
2838 | lq_cmd->agg_time_limit = | 2855 | * In case of low latency, tell the firwmare to leave a frame in the |
2856 | * Tx Fifo so that it can start a transaction in the same TxOP. This | ||
2857 | * basically allows the firmware to send bursts. | ||
2858 | */ | ||
2859 | if (iwl_mvm_vif_low_latency(mvmvif)) { | ||
2860 | lq_cmd->agg_frame_cnt_limit--; | ||
2861 | |||
2862 | if (mvm->low_latency_agg_frame_limit) | ||
2863 | lq_cmd->agg_frame_cnt_limit = | ||
2864 | min(lq_cmd->agg_frame_cnt_limit, | ||
2865 | mvm->low_latency_agg_frame_limit); | ||
2866 | } | ||
2867 | |||
2868 | if (mvmsta->vif->p2p) | ||
2869 | lq_cmd->flags |= LQ_FLAG_USE_RTS_MSK; | ||
2870 | |||
2871 | lq_cmd->agg_time_limit = | ||
2839 | cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta)); | 2872 | cpu_to_le16(iwl_mvm_coex_agg_time_limit(mvm, sta)); |
2840 | } | 2873 | } |
2841 | 2874 | ||
@@ -2932,10 +2965,7 @@ static void rs_program_fix_rate(struct iwl_mvm *mvm, | |||
2932 | lq_sta->lq.sta_id, lq_sta->pers.dbg_fixed_rate); | 2965 | lq_sta->lq.sta_id, lq_sta->pers.dbg_fixed_rate); |
2933 | 2966 | ||
2934 | if (lq_sta->pers.dbg_fixed_rate) { | 2967 | if (lq_sta->pers.dbg_fixed_rate) { |
2935 | struct rs_rate rate; | 2968 | rs_fill_lq_cmd(mvm, NULL, lq_sta, NULL); |
2936 | rs_rate_from_ucode_rate(lq_sta->pers.dbg_fixed_rate, | ||
2937 | lq_sta->band, &rate); | ||
2938 | rs_fill_lq_cmd(mvm, NULL, lq_sta, &rate); | ||
2939 | iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq, false); | 2969 | iwl_mvm_send_lq_cmd(lq_sta->pers.drv, &lq_sta->lq, false); |
2940 | } | 2970 | } |
2941 | } | 2971 | } |