Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: wfx: firmware never return PS status for stations

At the beginning, firmware could send suspend_resume indication to
notify that a station wake up or sleep down. However, mac80211 already
handles power save status of stations and this behavior has been removed
from the firmware. So now, when suspend_resume indication is received,
it is always to notify that a DTIM is about to be sent.

So, it is possible to simply wfx_suspend_resume().

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-56-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jérôme Pouiller and committed by
Greg Kroah-Hartman
b5d4d98e 6537adc3

+17 -26
+17 -26
drivers/staging/wfx/sta.c
··· 985 985 return -ENOTSUPP; 986 986 } 987 987 988 - static void wfx_dtim_notify(struct wfx_vif *wvif) 989 - { 990 - spin_lock_bh(&wvif->ps_state_lock); 991 - wvif->sta_asleep_mask = 0; 992 - wfx_bh_request_tx(wvif->wdev); 993 - spin_unlock_bh(&wvif->ps_state_lock); 994 - } 995 - 996 988 void wfx_suspend_resume(struct wfx_vif *wvif, 997 989 const struct hif_ind_suspend_resume_tx *arg) 998 990 { 999 - if (arg->suspend_resume_flags.bc_mc_only) { 1000 - bool cancel_tmo = false; 991 + bool cancel_tmo = false; 1001 992 1002 - spin_lock_bh(&wvif->ps_state_lock); 1003 - if (!arg->suspend_resume_flags.resume) 1004 - wvif->mcast_tx = false; 1005 - else 1006 - wvif->mcast_tx = wvif->aid0_bit_set && 1007 - wvif->mcast_buffered; 1008 - if (wvif->mcast_tx) { 1009 - cancel_tmo = true; 1010 - wfx_bh_request_tx(wvif->wdev); 1011 - } 1012 - spin_unlock_bh(&wvif->ps_state_lock); 1013 - if (cancel_tmo) 1014 - del_timer_sync(&wvif->mcast_timeout); 1015 - } else if (arg->suspend_resume_flags.resume) { 1016 - wfx_dtim_notify(wvif); 1017 - } else { 993 + if (!arg->suspend_resume_flags.bc_mc_only) { 1018 994 dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); 995 + return; 1019 996 } 997 + 998 + spin_lock_bh(&wvif->ps_state_lock); 999 + if (!arg->suspend_resume_flags.resume) 1000 + wvif->mcast_tx = false; 1001 + else 1002 + wvif->mcast_tx = wvif->aid0_bit_set && 1003 + wvif->mcast_buffered; 1004 + if (wvif->mcast_tx) { 1005 + cancel_tmo = true; 1006 + wfx_bh_request_tx(wvif->wdev); 1007 + } 1008 + spin_unlock_bh(&wvif->ps_state_lock); 1009 + if (cancel_tmo) 1010 + del_timer_sync(&wvif->mcast_timeout); 1020 1011 } 1021 1012 1022 1013 int wfx_add_chanctx(struct ieee80211_hw *hw,