From: Kalle Valo Date: Tue, 27 Oct 2009 15:36:17 +0000 (+0200) Subject: mac80211: fix dynamic power save for devices with nullfunc support in hw X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a9685338ab9d331c25ca92b0e8a92631e14c6b45;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mac80211: fix dynamic power save for devices with nullfunc support in hw In TX path it was assumed that dynamic power save works only if IEEE80211_HW_PS_NULLFUNC_STACK is set. But is not the case, there are devices which have nullfunc support in hardware but need mac80211 to handle dynamic power save timers, TI's wl1251 is one of them. The fix is to not check for IEEE80211_HW_PS_NULLFUNC_STACK in is_dynamic_ps_enabled(), instead check IEEE80211_HW_SUPPORTS_PS and IEEE80211_HW_SUPPORTS_DYNAMIC_PS flags and act accordingly. Tested with wl1251. Signed-off-by: Kalle Valo Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 498cdd435d73..cb06d8e56496 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1390,7 +1390,11 @@ static int ieee80211_skb_resize(struct ieee80211_local *local, static bool need_dynamic_ps(struct ieee80211_local *local) { /* driver doesn't support power save */ - if (!(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK)) + if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS)) + return false; + + /* hardware does dynamic power save */ + if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS) return false; /* dynamic power save disabled */