iwlwifi: mvm: Invert the condition for OFDM rate
authorTova Mussai <tova.mussai@intel.com>
Sun, 28 Jul 2019 10:51:07 +0000 (13:51 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 25 Oct 2019 07:10:24 +0000 (10:10 +0300)
OFDM rate used for all bands except to band 2.4 which use CCK rate.
Inverting the condition help that in future we won't need to expand the
condition for more bands.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index d9c23cd9633675937ca6c59ea0c80924c4dc30e0..b78992e341d5e40359322b1e4eb9773cd40306d6 100644 (file)
@@ -855,11 +855,10 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct ieee80211_tx_info *info,
                                    struct ieee80211_vif *vif)
 {
        u8 rate;
-
-       if (info->band == NL80211_BAND_5GHZ || vif->p2p)
-               rate = IWL_FIRST_OFDM_RATE;
-       else
+       if (info->band == NL80211_BAND_2GHZ && !vif->p2p)
                rate = IWL_FIRST_CCK_RATE;
+       else
+               rate = IWL_FIRST_OFDM_RATE;
 
        return rate;
 }
index e3b2a2bf3863c335cfda28805e326efec69c0363..f4778a6a40b96de75ab0f456330ab1c451b3286a 100644 (file)
@@ -341,8 +341,11 @@ static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm,
                rate_idx = rate_lowest_index(
                                &mvm->nvm_data->bands[info->band], sta);
 
-       /* For 5 GHZ band, remap mac80211 rate indices into driver indices */
-       if (info->band == NL80211_BAND_5GHZ)
+       /*
+        * For non 2 GHZ band, remap mac80211 rate
+        * indices into driver indices
+        */
+       if (info->band != NL80211_BAND_2GHZ)
                rate_idx += IWL_FIRST_OFDM_RATE;
 
        /* For 2.4 GHZ band, check that there is no need to remap */
index 8686107da116839a3691ce5b34d5e136ceb4e466..6096276cb0d002193747df2caa3ce594805539b4 100644 (file)
@@ -217,7 +217,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
        int band_offset = 0;
 
        /* Legacy rate format, search for match in table */
-       if (band == NL80211_BAND_5GHZ)
+       if (band != NL80211_BAND_2GHZ)
                band_offset = IWL_FIRST_OFDM_RATE;
        for (idx = band_offset; idx < IWL_RATE_COUNT_LEGACY; idx++)
                if (fw_rate_idx_to_plcp[idx] == rate)