diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-07-01 17:07:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-03 10:33:08 +0200 |
commit | 01d2ffa4d916d5884c89b1db0d79fd43c08bb708 (patch) | |
tree | 92ef0c179887c50e576ef6a68bc807ace51b831c /drivers/staging/wfx/sta.c | |
parent | e5da5fbd7741162c51a70ffad4316be12e1bb010 (diff) |
staging: wfx: add a debugfs entry to force ps_timeout
In some advanced usage or debug scenarios, it could interesting to
change the value of ps_timeout or eventually to force use of PS-Poll
frames.
The wext API (used by iwconfig) provide a way to change ps_timeout.
However, this API is obsolete and it seems a little weird to use (it
seems it does apply the change, so the user have to disable then
re-enable de power save)
On side of nl80211, there is no way to change the ps_timeout.
This patch provides a file in debugfs to change the value of ps_timeout.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200701150707.222985-13-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/sta.c')
-rw-r--r-- | drivers/staging/wfx/sta.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 2c0ab51fc92d..fdf4f48ddc2c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -217,20 +217,24 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps) // are differents. if (enable_ps) *enable_ps = true; - if (wvif->bss_not_support_ps_poll) + if (wvif->wdev->force_ps_timeout > -1) + return wvif->wdev->force_ps_timeout; + else if (wvif->bss_not_support_ps_poll) return 30; else return 0; } if (enable_ps) *enable_ps = wvif->vif->bss_conf.ps; - if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps) + if (wvif->wdev->force_ps_timeout > -1) + return wvif->wdev->force_ps_timeout; + else if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps) return conf->dynamic_ps_timeout; else return -1; } -static int wfx_update_pm(struct wfx_vif *wvif) +int wfx_update_pm(struct wfx_vif *wvif) { int ps_timeout; bool ps; |