rtl8xxxu: add support for rtl8188eu
[openwrt/staging/rmilecki.git] / package / kernel / mac80211 / patches / 651-0017-rtl8xxxu-Determine-need-for-shore-preamble-before-up.patch
1 From 36109f7398a02f07a32051d1483e3e9ae7a4ad4b Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Mon, 25 Jul 2016 13:17:42 -0400
4 Subject: [PATCH] rtl8xxxu: Determine need for shore preamble before updating
5 TX descriptors
6
7 Another patch to move this detection out of the code handling the TX
8 descriptor update.
9
10 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
11 ---
12 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 12 +++++++-----
13 1 file changed, 7 insertions(+), 5 deletions(-)
14
15 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
16 +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
17 @@ -4770,7 +4770,7 @@ static void rtl8xxxu_tx(struct ieee80211
18 u16 rate_flag = tx_info->control.rates[0].flags;
19 int tx_desc_size = priv->fops->tx_desc_size;
20 int ret;
21 - bool usedesc40, ampdu_enable, sgi = false;
22 + bool usedesc40, ampdu_enable, sgi = false, short_preamble = false;
23
24 if (skb_headroom(skb) < tx_desc_size) {
25 dev_warn(dev,
26 @@ -4860,6 +4860,10 @@ static void rtl8xxxu_tx(struct ieee80211
27 (IEEE80211_HT_CAP_SGI_40 | IEEE80211_HT_CAP_SGI_20)))
28 sgi = true;
29
30 + if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
31 + (sta && vif && vif->bss_conf.use_short_preamble))
32 + short_preamble = true;
33 +
34 seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
35 if (!usedesc40) {
36 tx_desc->txdw5 = cpu_to_le32(rate);
37 @@ -4888,8 +4892,7 @@ static void rtl8xxxu_tx(struct ieee80211
38 if (ieee80211_is_data_qos(hdr->frame_control))
39 tx_desc->txdw4 |= cpu_to_le32(TXDESC32_QOS);
40
41 - if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
42 - (sta && vif && vif->bss_conf.use_short_preamble))
43 + if (short_preamble)
44 tx_desc->txdw4 |= cpu_to_le32(TXDESC32_SHORT_PREAMBLE);
45
46 if (sgi)
47 @@ -4935,8 +4938,7 @@ static void rtl8xxxu_tx(struct ieee80211
48 cpu_to_le32(TXDESC40_RETRY_LIMIT_ENABLE);
49 }
50
51 - if (rate_flag & IEEE80211_TX_RC_USE_SHORT_PREAMBLE ||
52 - (sta && vif && vif->bss_conf.use_short_preamble))
53 + if (short_preamble)
54 tx_desc40->txdw5 |=
55 cpu_to_le32(TXDESC40_SHORT_PREAMBLE);
56