summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>2020-07-21 13:23:02 +0200
committerKalle Valo <kvalo@codeaurora.org>2020-08-02 18:32:06 +0300
commit3dc05ffb04436020f63138186dbc4f37bd938552 (patch)
tree465eb4d0f91b3b8c4e11cc46cf785a55083c30e3 /drivers/net/wireless
parenta080ecb11ae22f8433b8f88554f1f43e93a97a78 (diff)
downloadlinux-3dc05ffb04436020f63138186dbc4f37bd938552.tar.gz
linux-3dc05ffb04436020f63138186dbc4f37bd938552.tar.bz2
linux-3dc05ffb04436020f63138186dbc4f37bd938552.zip
brcmfmac: Set timeout value when configuring power save
Set the timeout value as per cfg80211's set_power_mgmt() request. If the requested value value is left undefined we set it to 2 seconds, the maximum supported value. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20200721112302.22718-1-nsaenzjulienne@suse.de
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 5d99771c3f64..ab0da2ff982e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -84,6 +84,8 @@
#define BRCMF_ND_INFO_TIMEOUT msecs_to_jiffies(2000)
+#define BRCMF_PS_MAX_TIMEOUT_MS 2000
+
#define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
(sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
@@ -2942,6 +2944,12 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev,
else
bphy_err(drvr, "error (%d)\n", err);
}
+
+ err = brcmf_fil_iovar_int_set(ifp, "pm2_sleep_ret",
+ min_t(u32, timeout, BRCMF_PS_MAX_TIMEOUT_MS));
+ if (err)
+ bphy_err(drvr, "Unable to set pm timeout, (%d)\n", err);
+
done:
brcmf_dbg(TRACE, "Exit\n");
return err;