linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] brcmfmac: set timeout value when configuring power save
@ 2020-07-07 15:54 Nicolas Saenz Julienne
  2020-07-14  9:41 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Saenz Julienne @ 2020-07-07 15:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Nicolas Saenz Julienne, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, Kalle Valo,
	David S. Miller, Jakub Kicinski, linux-wireless,
	brcm80211-dev-list.pdl, brcm80211-dev-list, netdev

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>
---

Note: I got the 2 seconds value from the Raspberry Pi downstream kernel.

 .../wireless/broadcom/brcm80211/brcmfmac/cfg80211.c    | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index a757abd7a599..15578c6e87cd 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))
 
@@ -2941,6 +2943,14 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev,
 		else
 			bphy_err(drvr, "error (%d)\n", err);
 	}
+
+	if ((u32)timeout > BRCMF_PS_MAX_TIMEOUT_MS)
+		timeout = BRCMF_PS_MAX_TIMEOUT_MS;
+
+	err = brcmf_fil_iovar_int_set(ifp, "pm2_sleep_ret", timeout);
+	if (err)
+		bphy_err(drvr, "Unable to set pm timeout, (%d)\n", err);
+
 done:
 	brcmf_dbg(TRACE, "Exit\n");
 	return err;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-14  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-07 15:54 [PATCH] brcmfmac: set timeout value when configuring power save Nicolas Saenz Julienne
2020-07-14  9:41 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).