[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82182ad8-c728-d313-047c-79478c9ee85f@broadcom.com>
Date: Mon, 12 Apr 2021 10:22:47 +0200
From: Arend van Spriel <arend.vanspriel@...adcom.com>
To: Shawn Guo <shawn.guo@...aro.org>, Kalle Valo <kvalo@...eaurora.org>
Cc: Rob Herring <robh+dt@...nel.org>,
Rafał Miłecki <rafal@...ecki.pl>,
Arend van Spriel <aspriel@...il.com>,
Franky Lin <franky.lin@...adcom.com>,
Hante Meuleman <hante.meuleman@...adcom.com>,
Chi-hsien Lin <chi-hsien.lin@...ineon.com>,
Wright Feng <wright.feng@...ineon.com>,
Chung-hsien Hsu <chung-hsien.hsu@...ineon.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
brcm80211-dev-list.pdl@...adcom.com,
SHA-cyfmac-dev-list@...ineon.com
Subject: Re: [PATCH 2/2] brcmfmac: support parse country code map from DT
On 08-04-2021 13:30, Shawn Guo wrote:
> With any regulatory domain requests coming from either user space or
> 802.11 IE (Information Element), the country is coded in ISO3166
> standard. It needs to be translated to firmware country code and
> revision with the mapping info in settings->country_codes table.
> Support populate country_codes table by parsing the mapping from DT.
one more thing though...
> Signed-off-by: Shawn Guo <shawn.guo@...aro.org>
> ---
> .../wireless/broadcom/brcm80211/brcmfmac/of.c | 53 +++++++++++++++++++
> 1 file changed, 53 insertions(+)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> index a7554265f95f..ea5c7f434c2c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c
> @@ -12,12 +12,61 @@
> #include "common.h"
> #include "of.h"
>
> +static int brcmf_of_get_country_codes(struct device *dev,
> + struct brcmf_mp_device *settings)
> +{
[...]
> + /* String format e.g. US-Q2-86 */
> + strncpy(cce->iso3166, map, 2);
> + strncpy(cce->cc, map + 3, 2);
> +
> + ret = kstrtos32(map + 6, 10, &cce->rev);
> + if (ret < 0)
> + dev_warn(dev, "failed to read rev of map %s: %d",
> + cce->iso3166, ret);
Do we need a stronger validation of the string format, eg. use sscanf or
strstr. Would also be nice to have brcmf_dbg(INFO, ...) here to print
the entry.
Regards,
Arend
Powered by blists - more mailing lists