diff options
author | Mordechay Goodstein <mordechay.goodstein@intel.com> | 2021-02-10 14:56:36 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2021-02-10 15:37:30 +0300 |
commit | 004272bc8d9d3e53049ae6b9d22a65649433f263 (patch) | |
tree | 3835a5acafffbdfd39c60bf42fd6b411a7897d77 /drivers/net/wireless/intel/iwlwifi/mvm | |
parent | 9cf671d60fdbeb8f875859c11148cf13c326ada2 (diff) | |
download | linux-004272bc8d9d3e53049ae6b9d22a65649433f263.tar.xz |
iwlwifi: when HW has rate offload don't look at control field
Control field is set by mac80211 only if case rate is not offloaded to
hw.
Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210135352.f845c4387eed.I30c4d26698bae1f5f8c396da80a545baa145e2ad@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index 871e9daf56f8..1ad621d13ad3 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -265,20 +265,24 @@ static u32 iwl_mvm_get_tx_rate(struct iwl_mvm *mvm, struct ieee80211_tx_info *info, struct ieee80211_sta *sta, __le16 fc) { - int rate_idx; + int rate_idx = -1; u8 rate_plcp; u32 rate_flags = 0; struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); - /* HT rate doesn't make sense for a non data frame */ - WARN_ONCE(info->control.rates[0].flags & IEEE80211_TX_RC_MCS && - !ieee80211_is_data(fc), - "Got a HT rate (flags:0x%x/mcs:%d/fc:0x%x/state:%d) for a non data frame\n", - info->control.rates[0].flags, - info->control.rates[0].idx, - le16_to_cpu(fc), mvmsta->sta_state); + /* info->control is only relevant for non HW rate control */ + if (!ieee80211_hw_check(mvm->hw, HAS_RATE_CONTROL)) { + /* HT rate doesn't make sense for a non data frame */ + WARN_ONCE(info->control.rates[0].flags & IEEE80211_TX_RC_MCS && + !ieee80211_is_data(fc), + "Got a HT rate (flags:0x%x/mcs:%d/fc:0x%x/state:%d) for a non data frame\n", + info->control.rates[0].flags, + info->control.rates[0].idx, + le16_to_cpu(fc), mvmsta->sta_state); + + rate_idx = info->control.rates[0].idx; + } - rate_idx = info->control.rates[0].idx; /* if the rate isn't a well known legacy rate, take the lowest one */ if (rate_idx < 0 || rate_idx >= IWL_RATE_COUNT_LEGACY) rate_idx = rate_lowest_index( |