diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-05-28 20:57:23 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-05-28 20:57:23 +0000 |
commit | e4167ddb9a2519f2a2fc90e6b12d416d221bd4b6 (patch) | |
tree | f96eddb03411bfff2cfcd35fd41d199a85dafc17 /package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch | |
parent | aed5ae67044d19c865c901818f9a830d200975ad (diff) | |
download | upstream-e4167ddb9a2519f2a2fc90e6b12d416d221bd4b6.tar.gz upstream-e4167ddb9a2519f2a2fc90e6b12d416d221bd4b6.tar.bz2 upstream-e4167ddb9a2519f2a2fc90e6b12d416d221bd4b6.zip |
mac80211: backport one missed brcmfmac NVRAM-related patch
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45812 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch')
-rw-r--r-- | package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch b/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch new file mode 100644 index 0000000000..5700142646 --- /dev/null +++ b/package/kernel/mac80211/patches/378-brcmfmac-allow-NVRAM-values-to-contain-spaces.patch @@ -0,0 +1,50 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com> +Date: Sat, 23 May 2015 09:15:33 +0200 +Subject: [PATCH] brcmfmac: allow NVRAM values to contain spaces +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Platform NVRAMs often contain values with spaces. Even if right now most +firmware-supported entries are simple values, we shouldn't reject these +with spaces. It was semi-confirmed by Broadcom in the early patch adding +support for platform NVRAMs. + +Signed-off-by: Rafał Miłecki <zajec5@gmail.com> +Acked-by: Arend van Spriel <arend@broadcom.com> +Signed-off-by: Kalle Valo <kvalo@codeaurora.org> +--- + +--- a/drivers/net/wireless/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/brcm80211/brcmfmac/firmware.c +@@ -66,6 +66,12 @@ struct nvram_parser { + bool multi_dev_v2; + }; + ++/** ++ * is_nvram_char() - check if char is a valid one for NVRAM entry ++ * ++ * It accepts all printable ASCII chars except for '#' which opens a comment. ++ * Please note that ' ' (space) while accepted is not a valid key name char. ++ */ + static bool is_nvram_char(char c) + { + /* comment marker excluded */ +@@ -73,7 +79,7 @@ static bool is_nvram_char(char c) + return false; + + /* key and value may have any other readable character */ +- return (c > 0x20 && c < 0x7f); ++ return (c >= 0x20 && c < 0x7f); + } + + static bool is_whitespace(char c) +@@ -120,7 +126,7 @@ static enum nvram_parser_state brcmf_nvr + nvp->multi_dev_v1 = true; + if (strncmp(&nvp->fwnv->data[nvp->entry], "pcie/", 5) == 0) + nvp->multi_dev_v2 = true; +- } else if (!is_nvram_char(c)) { ++ } else if (!is_nvram_char(c) || c == ' ') { + brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", + nvp->line, nvp->column); + return COMMENT; |