[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87blkicu1r.fsf@tynnyri.adurom.net>
Date: Tue, 14 Jul 2020 12:41:52 +0300
From: Kalle Valo <kvalo@...eaurora.org>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
Cc: linux-kernel@...r.kernel.org,
Arend van Spriel <arend.vanspriel@...adcom.com>,
Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>,
Chi-Hsien Lin <chi-hsien.lin@...ress.com>,
Wright Feng <wright.feng@...ress.com>,
Kalle Valo <kvalo@...eaurora.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
linux-wireless@...r.kernel.org,
brcm80211-dev-list.pdl@...adcom.com,
brcm80211-dev-list@...ress.com, netdev@...r.kernel.org
Subject: Re: [PATCH] brcmfmac: set timeout value when configuring power save
Nicolas Saenz Julienne <nsaenzjulienne@...e.de> writes:
> 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@...e.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;
Wouldn't min_t() be better? Then you won't need the ugly cast either.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists