Skip to content

Commit

Permalink
mac80211: support fast-rx with incompatible PS capabilities when PS i…
Browse files Browse the repository at this point in the history
…s disabled

When powersave is disabled for the interface, we can do fast-rx anyway.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
[fixed indentation on one line]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Felix Fietkau authored and Johannes Berg committed Feb 27, 2018
1 parent 59cae5b commit 1d87016
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,7 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,

ieee80211_recalc_ps(local);
ieee80211_recalc_ps_vif(sdata);
ieee80211_check_fast_rx_iface(sdata);

return 0;
}
Expand Down
17 changes: 11 additions & 6 deletions net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3750,12 +3750,7 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
/* 4-addr is harder to deal with, later maybe */
if (sdata->u.mgd.use_4addr)
goto clear;
/* software powersave is a huge mess, avoid all of it */
if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
goto clear;
if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
!ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
goto clear;

if (sta->sta.tdls) {
fastrx.da_offs = offsetof(struct ieee80211_hdr, addr1);
fastrx.sa_offs = offsetof(struct ieee80211_hdr, addr2);
Expand All @@ -3767,6 +3762,16 @@ void ieee80211_check_fast_rx(struct sta_info *sta)
fastrx.expected_ds_bits =
cpu_to_le16(IEEE80211_FCTL_FROMDS);
}

if (!sdata->u.mgd.powersave)
break;

/* software powersave is a huge mess, avoid all of it */
if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK))
goto clear;
if (ieee80211_hw_check(&local->hw, SUPPORTS_PS) &&
!ieee80211_hw_check(&local->hw, SUPPORTS_DYNAMIC_PS))
goto clear;
break;
case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_AP:
Expand Down

0 comments on commit 1d87016

Please sign in to comment.