diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/rs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/rs.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index 56b636d9ab30..55334d542e26 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c | |||
@@ -680,12 +680,14 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags, | |||
680 | */ | 680 | */ |
681 | static bool rs_use_green(struct ieee80211_sta *sta) | 681 | static bool rs_use_green(struct ieee80211_sta *sta) |
682 | { | 682 | { |
683 | struct iwl_mvm_sta *sta_priv = (void *)sta->drv_priv; | 683 | /* |
684 | 684 | * There's a bug somewhere in this code that causes the | |
685 | bool use_green = !(sta_priv->vif->bss_conf.ht_operation_mode & | 685 | * scaling to get stuck because GF+SGI can't be combined |
686 | IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); | 686 | * in SISO rates. Until we find that bug, disable GF, it |
687 | 687 | * has only limited benefit and we still interoperate with | |
688 | return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && use_green; | 688 | * GF APs since we can always receive GF transmissions. |
689 | */ | ||
690 | return false; | ||
689 | } | 691 | } |
690 | 692 | ||
691 | /** | 693 | /** |
@@ -791,7 +793,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta, | |||
791 | 793 | ||
792 | if (num_of_ant(tbl->ant_type) > 1) | 794 | if (num_of_ant(tbl->ant_type) > 1) |
793 | tbl->ant_type = | 795 | tbl->ant_type = |
794 | first_antenna(mvm->nvm_data->valid_tx_ant); | 796 | first_antenna(iwl_fw_valid_tx_ant(mvm->fw)); |
795 | 797 | ||
796 | tbl->is_ht40 = 0; | 798 | tbl->is_ht40 = 0; |
797 | tbl->is_SGI = 0; | 799 | tbl->is_SGI = 0; |
@@ -1233,7 +1235,7 @@ static int rs_switch_to_mimo2(struct iwl_mvm *mvm, | |||
1233 | return -1; | 1235 | return -1; |
1234 | 1236 | ||
1235 | /* Need both Tx chains/antennas to support MIMO */ | 1237 | /* Need both Tx chains/antennas to support MIMO */ |
1236 | if (num_of_ant(mvm->nvm_data->valid_tx_ant) < 2) | 1238 | if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) < 2) |
1237 | return -1; | 1239 | return -1; |
1238 | 1240 | ||
1239 | IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO2\n"); | 1241 | IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO2\n"); |
@@ -1285,7 +1287,7 @@ static int rs_switch_to_mimo3(struct iwl_mvm *mvm, | |||
1285 | return -1; | 1287 | return -1; |
1286 | 1288 | ||
1287 | /* Need both Tx chains/antennas to support MIMO */ | 1289 | /* Need both Tx chains/antennas to support MIMO */ |
1288 | if (num_of_ant(mvm->nvm_data->valid_tx_ant) < 3) | 1290 | if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) < 3) |
1289 | return -1; | 1291 | return -1; |
1290 | 1292 | ||
1291 | IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO3\n"); | 1293 | IWL_DEBUG_RATE(mvm, "LQ: try to switch to MIMO3\n"); |
@@ -1379,7 +1381,7 @@ static int rs_move_legacy_other(struct iwl_mvm *mvm, | |||
1379 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1381 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1380 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1382 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1381 | u8 start_action; | 1383 | u8 start_action; |
1382 | u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 1384 | u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
1383 | u8 tx_chains_num = num_of_ant(valid_tx_ant); | 1385 | u8 tx_chains_num = num_of_ant(valid_tx_ant); |
1384 | int ret; | 1386 | int ret; |
1385 | u8 update_search_tbl_counter = 0; | 1387 | u8 update_search_tbl_counter = 0; |
@@ -1512,7 +1514,7 @@ static int rs_move_siso_to_other(struct iwl_mvm *mvm, | |||
1512 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1514 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1513 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1515 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1514 | u8 start_action; | 1516 | u8 start_action; |
1515 | u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 1517 | u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
1516 | u8 tx_chains_num = num_of_ant(valid_tx_ant); | 1518 | u8 tx_chains_num = num_of_ant(valid_tx_ant); |
1517 | u8 update_search_tbl_counter = 0; | 1519 | u8 update_search_tbl_counter = 0; |
1518 | int ret; | 1520 | int ret; |
@@ -1647,7 +1649,7 @@ static int rs_move_mimo2_to_other(struct iwl_mvm *mvm, | |||
1647 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1649 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1648 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1650 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1649 | u8 start_action; | 1651 | u8 start_action; |
1650 | u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 1652 | u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
1651 | u8 tx_chains_num = num_of_ant(valid_tx_ant); | 1653 | u8 tx_chains_num = num_of_ant(valid_tx_ant); |
1652 | u8 update_search_tbl_counter = 0; | 1654 | u8 update_search_tbl_counter = 0; |
1653 | int ret; | 1655 | int ret; |
@@ -1784,7 +1786,7 @@ static int rs_move_mimo3_to_other(struct iwl_mvm *mvm, | |||
1784 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - | 1786 | u32 sz = (sizeof(struct iwl_scale_tbl_info) - |
1785 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); | 1787 | (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); |
1786 | u8 start_action; | 1788 | u8 start_action; |
1787 | u8 valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 1789 | u8 valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
1788 | u8 tx_chains_num = num_of_ant(valid_tx_ant); | 1790 | u8 tx_chains_num = num_of_ant(valid_tx_ant); |
1789 | int ret; | 1791 | int ret; |
1790 | u8 update_search_tbl_counter = 0; | 1792 | u8 update_search_tbl_counter = 0; |
@@ -2447,7 +2449,7 @@ static void rs_initialize_lq(struct iwl_mvm *mvm, | |||
2447 | 2449 | ||
2448 | i = lq_sta->last_txrate_idx; | 2450 | i = lq_sta->last_txrate_idx; |
2449 | 2451 | ||
2450 | valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 2452 | valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
2451 | 2453 | ||
2452 | if (!lq_sta->search_better_tbl) | 2454 | if (!lq_sta->search_better_tbl) |
2453 | active_tbl = lq_sta->active_tbl; | 2455 | active_tbl = lq_sta->active_tbl; |
@@ -2637,15 +2639,15 @@ void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
2637 | 2639 | ||
2638 | /* These values will be overridden later */ | 2640 | /* These values will be overridden later */ |
2639 | lq_sta->lq.single_stream_ant_msk = | 2641 | lq_sta->lq.single_stream_ant_msk = |
2640 | first_antenna(mvm->nvm_data->valid_tx_ant); | 2642 | first_antenna(iwl_fw_valid_tx_ant(mvm->fw)); |
2641 | lq_sta->lq.dual_stream_ant_msk = | 2643 | lq_sta->lq.dual_stream_ant_msk = |
2642 | mvm->nvm_data->valid_tx_ant & | 2644 | iwl_fw_valid_tx_ant(mvm->fw) & |
2643 | ~first_antenna(mvm->nvm_data->valid_tx_ant); | 2645 | ~first_antenna(iwl_fw_valid_tx_ant(mvm->fw)); |
2644 | if (!lq_sta->lq.dual_stream_ant_msk) { | 2646 | if (!lq_sta->lq.dual_stream_ant_msk) { |
2645 | lq_sta->lq.dual_stream_ant_msk = ANT_AB; | 2647 | lq_sta->lq.dual_stream_ant_msk = ANT_AB; |
2646 | } else if (num_of_ant(mvm->nvm_data->valid_tx_ant) == 2) { | 2648 | } else if (num_of_ant(iwl_fw_valid_tx_ant(mvm->fw)) == 2) { |
2647 | lq_sta->lq.dual_stream_ant_msk = | 2649 | lq_sta->lq.dual_stream_ant_msk = |
2648 | mvm->nvm_data->valid_tx_ant; | 2650 | iwl_fw_valid_tx_ant(mvm->fw); |
2649 | } | 2651 | } |
2650 | 2652 | ||
2651 | /* as default allow aggregation for all tids */ | 2653 | /* as default allow aggregation for all tids */ |
@@ -2706,7 +2708,7 @@ static void rs_fill_link_cmd(struct iwl_mvm *mvm, | |||
2706 | index++; | 2708 | index++; |
2707 | repeat_rate--; | 2709 | repeat_rate--; |
2708 | if (mvm) | 2710 | if (mvm) |
2709 | valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 2711 | valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
2710 | 2712 | ||
2711 | /* Fill rest of rate table */ | 2713 | /* Fill rest of rate table */ |
2712 | while (index < LINK_QUAL_MAX_RETRY_NUM) { | 2714 | while (index < LINK_QUAL_MAX_RETRY_NUM) { |
@@ -2811,7 +2813,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta, | |||
2811 | u8 ant_sel_tx; | 2813 | u8 ant_sel_tx; |
2812 | 2814 | ||
2813 | mvm = lq_sta->drv; | 2815 | mvm = lq_sta->drv; |
2814 | valid_tx_ant = mvm->nvm_data->valid_tx_ant; | 2816 | valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw); |
2815 | if (lq_sta->dbg_fixed_rate) { | 2817 | if (lq_sta->dbg_fixed_rate) { |
2816 | ant_sel_tx = | 2818 | ant_sel_tx = |
2817 | ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) | 2819 | ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) |
@@ -2882,9 +2884,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file, | |||
2882 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", | 2884 | desc += sprintf(buff+desc, "fixed rate 0x%X\n", |
2883 | lq_sta->dbg_fixed_rate); | 2885 | lq_sta->dbg_fixed_rate); |
2884 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", | 2886 | desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", |
2885 | (mvm->nvm_data->valid_tx_ant & ANT_A) ? "ANT_A," : "", | 2887 | (iwl_fw_valid_tx_ant(mvm->fw) & ANT_A) ? "ANT_A," : "", |
2886 | (mvm->nvm_data->valid_tx_ant & ANT_B) ? "ANT_B," : "", | 2888 | (iwl_fw_valid_tx_ant(mvm->fw) & ANT_B) ? "ANT_B," : "", |
2887 | (mvm->nvm_data->valid_tx_ant & ANT_C) ? "ANT_C" : ""); | 2889 | (iwl_fw_valid_tx_ant(mvm->fw) & ANT_C) ? "ANT_C" : ""); |
2888 | desc += sprintf(buff+desc, "lq type %s\n", | 2890 | desc += sprintf(buff+desc, "lq type %s\n", |
2889 | (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); | 2891 | (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); |
2890 | if (is_Ht(tbl->lq_type)) { | 2892 | if (is_Ht(tbl->lq_type)) { |