rtl8xxxu: add support for rtl8188eu
[openwrt/staging/rmilecki.git] / package / kernel / mac80211 / patches / 650-0006-rtl8xxxu-Set-all-ieee80211_rx_status-values-in-parse.patch
1 From be5bf7d23ac03bcfa2e6875248f7d45165589d4f Mon Sep 17 00:00:00 2001
2 From: Jes Sorensen <Jes.Sorensen@redhat.com>
3 Date: Mon, 16 May 2016 21:57:25 -0400
4 Subject: [PATCH] rtl8xxxu: Set all ieee80211_rx_status values in
5 parse_rx_desc()
6
7 This needs to be handled locally in the parse_rx_desc() function in
8 order to be able to handle aggregated packets in the future.
9
10 Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
11 ---
12 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 17 ++++++++++++-----
13 1 file changed, 12 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 @@ -5048,6 +5048,7 @@ static void rtl8xxxu_rx_urb_work(struct
18 int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
19 struct ieee80211_rx_status *rx_status)
20 {
21 + struct ieee80211_hw *hw = priv->hw;
22 struct rtl8xxxu_rxdesc16 *rx_desc =
23 (struct rtl8xxxu_rxdesc16 *)skb->data;
24 struct rtl8723au_phy_stats *phy_stats;
25 @@ -5059,6 +5060,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
26 for (i = 0; i < (sizeof(struct rtl8xxxu_rxdesc16) / sizeof(u32)); i++)
27 _rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
28
29 + memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
30 +
31 skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc16));
32
33 phy_stats = (struct rtl8723au_phy_stats *)skb->data;
34 @@ -5088,12 +5091,16 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8x
35 rx_status->rate_idx = rx_desc->rxmcs;
36 }
37
38 + rx_status->freq = hw->conf.chandef.chan->center_freq;
39 + rx_status->band = hw->conf.chandef.chan->band;
40 +
41 return RX_TYPE_DATA_PKT;
42 }
43
44 int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb,
45 struct ieee80211_rx_status *rx_status)
46 {
47 + struct ieee80211_hw *hw = priv->hw;
48 struct rtl8xxxu_rxdesc24 *rx_desc =
49 (struct rtl8xxxu_rxdesc24 *)skb->data;
50 struct rtl8723au_phy_stats *phy_stats;
51 @@ -5105,6 +5112,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
52 for (i = 0; i < (sizeof(struct rtl8xxxu_rxdesc24) / sizeof(u32)); i++)
53 _rx_desc[i] = le32_to_cpu(_rx_desc_le[i]);
54
55 + memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
56 +
57 skb_pull(skb, sizeof(struct rtl8xxxu_rxdesc24));
58
59 phy_stats = (struct rtl8723au_phy_stats *)skb->data;
60 @@ -5140,6 +5149,9 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8x
61 rx_status->rate_idx = rx_desc->rxmcs;
62 }
63
64 + rx_status->freq = hw->conf.chandef.chan->center_freq;
65 + rx_status->band = hw->conf.chandef.chan->band;
66 +
67 return RX_TYPE_DATA_PKT;
68 }
69
70 @@ -5202,13 +5214,8 @@ static void rtl8xxxu_rx_complete(struct
71 skb_put(skb, urb->actual_length);
72
73 if (urb->status == 0) {
74 - memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
75 -
76 rx_type = priv->fops->parse_rx_desc(priv, skb, rx_status);
77
78 - rx_status->freq = hw->conf.chandef.chan->center_freq;
79 - rx_status->band = hw->conf.chandef.chan->band;
80 -
81 if (rx_type == RX_TYPE_DATA_PKT)
82 ieee80211_rx_irqsafe(hw, skb);
83 else {