8c4c724ef75adc7ca1aa98f6c3961bbd3223e403
[oweals/openwrt.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 23 Feb 2018 10:01:53 +0100
3 Subject: [PATCH] mac80211: support fast-rx with incompatible PS
4  capabilities when PS is disabled
5
6 When powersave is disabled for the interface, we can do fast-rx anyway.
7
8 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 ---
10
11 --- a/net/mac80211/cfg.c
12 +++ b/net/mac80211/cfg.c
13 @@ -2658,6 +2658,7 @@ static int ieee80211_set_power_mgmt(stru
14  
15         ieee80211_recalc_ps(local);
16         ieee80211_recalc_ps_vif(sdata);
17 +       ieee80211_check_fast_rx_iface(sdata);
18  
19         return 0;
20  }
21 --- a/net/mac80211/rx.c
22 +++ b/net/mac80211/rx.c
23 @@ -3741,12 +3741,7 @@ void ieee80211_check_fast_rx(struct sta_
24                 /* 4-addr is harder to deal with, later maybe */
25                 if (sdata->u.mgd.use_4addr)
26                         goto clear;
27 -               /* software powersave is a huge mess, avoid all of it */
28 -               if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
29 -                       goto clear;
30 -               if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
31 -                   !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
32 -                       goto clear;
33 +
34                 if (sta->sta.tdls) {
35                         fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
36                         fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
37 @@ -3758,6 +3753,16 @@ void ieee80211_check_fast_rx(struct sta_
38                         fastrx.expected_ds_bits =
39                                 cpu_to_le16(IEEE80211_FCTL_FROMDS);
40                 }
41 +
42 +               if (!sdata->u.mgd.powersave)
43 +                   break;
44 +
45 +               /* software powersave is a huge mess, avoid all of it */
46 +               if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
47 +                       goto clear;
48 +               if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
49 +                   !ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
50 +                       goto clear;
51                 break;
52         case NL80211_IFTYPE_AP_VLAN:
53         case NL80211_IFTYPE_AP: