summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtl8xxxu
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2016-08-20 00:46:37 +0300
committerKalle Valo <kvalo@codeaurora.org>2016-09-03 19:57:23 +0300
commitbe49b1f111c76ce20a60a90587e2b8e8ab809a06 (patch)
tree703af17864f93514ebfc9724723ca6d28cee8487 /drivers/net/wireless/realtek/rtl8xxxu
parenteed145ab25a3eeba4caf2d4be0b5c7a3097f39bd (diff)
downloadlinux-be49b1f111c76ce20a60a90587e2b8e8ab809a06.tar.xz
rtl8xxxu: Simplify calculating of hw value used for setting TX rate
Calculating the value in one place rather than using one calculation in one place and a different one for management frames in another location makes little sense. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtl8xxxu')
-rw-r--r--drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 6de5b8f9340f..2f951cf788aa 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -4848,7 +4848,8 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
}
}
- if (rate_flag & IEEE80211_TX_RC_MCS)
+ if (rate_flag & IEEE80211_TX_RC_MCS &&
+ !ieee80211_is_mgmt(hdr->frame_control))
rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
else
rate = tx_rate->hw_value;
@@ -4869,7 +4870,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_BREAK);
if (ieee80211_is_mgmt(hdr->frame_control)) {
- tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
+ tx_desc->txdw5 = cpu_to_le32(rate);
tx_desc->txdw4 |=
cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
tx_desc->txdw5 |=
@@ -4923,7 +4924,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
if (ieee80211_is_mgmt(hdr->frame_control)) {
- tx_desc40->txdw4 = cpu_to_le32(tx_rate->hw_value);
+ tx_desc40->txdw4 = cpu_to_le32(rate);
tx_desc40->txdw3 |=
cpu_to_le32(TXDESC40_USE_DRIVER_RATE);
tx_desc40->txdw4 |=