Skip to content

Commit

Permalink
brcmfmac: Set timeout value when configuring power save
Browse files Browse the repository at this point in the history
[ Upstream commit 3dc05ff ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Nicolas Saenz Julienne authored and gregkh committed Sep 3, 2020
1 parent 7aac56d commit b2defeb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Expand Up @@ -82,6 +82,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))

Expand Down Expand Up @@ -2789,6 +2791,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;
Expand Down

0 comments on commit b2defeb

Please sign in to comment.