rtl8xxxu: add support for rtl8188eu
[openwrt/staging/rmilecki.git] / package / kernel / mac80211 / patches / 651-0015-rtl8xxxu-Simplify-calculating-of-hw-value-used-for-s.patch
1 From dae8758ca00ceaf71253471dc79de6a2749cb722 Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Mon, 25 Jul 2016 13:06:24 -0400
4 Subject: [PATCH] rtl8xxxu: Simplify calculating of hw value used for setting
5 TX rate
6
7 Calculating the value in one place rather than using one calculation
8 in one place and a different one for management frames in another
9 location makes little sense.
10
11 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
12 ---
13 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 7 ++++---
14 1 file changed, 4 insertions(+), 3 deletions(-)
15
16 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
17 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
18 @@ -4848,7 +4848,8 @@ static void rtl8xxxu_tx(struct ieee80211
19 }
20 }
21
22 - if (rate_flag & IEEE80211_TX_RC_MCS)
23 + if (rate_flag & IEEE80211_TX_RC_MCS &&
24 + !ieee80211_is_mgmt(hdr->frame_control))
25 rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
26 else
27 rate = tx_rate->hw_value;
28 @@ -4869,7 +4870,7 @@ static void rtl8xxxu_tx(struct ieee80211
29 tx_desc->txdw1 |= cpu_to_le32(TXDESC32_AGG_BREAK);
30
31 if (ieee80211_is_mgmt(hdr->frame_control)) {
32 - tx_desc->txdw5 = cpu_to_le32(tx_rate->hw_value);
33 + tx_desc->txdw5 = cpu_to_le32(rate);
34 tx_desc->txdw4 |=
35 cpu_to_le32(TXDESC32_USE_DRIVER_RATE);
36 tx_desc->txdw5 |=
37 @@ -4923,7 +4924,7 @@ static void rtl8xxxu_tx(struct ieee80211
38 tx_desc40->txdw2 |= cpu_to_le32(TXDESC40_AGG_BREAK);
39
40 if (ieee80211_is_mgmt(hdr->frame_control)) {
41 - tx_desc40->txdw4 = cpu_to_le32(tx_rate->hw_value);
42 + tx_desc40->txdw4 = cpu_to_le32(rate);
43 tx_desc40->txdw3 |=
44 cpu_to_le32(TXDESC40_USE_DRIVER_RATE);
45 tx_desc40->txdw4 |=