diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-05-28 10:39:11 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-05-28 10:39:11 +0000 |
commit | c1cc2217c24cbc419a642d896cf27d43038856a6 (patch) | |
tree | ebcc617bd2bf8b09badfbb7ee188b14dc03e37cb /package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch | |
parent | 597d2060c58b9c2c8de76b2d0bc577f66af9ee71 (diff) | |
download | upstream-c1cc2217c24cbc419a642d896cf27d43038856a6.tar.gz upstream-c1cc2217c24cbc419a642d896cf27d43038856a6.tar.bz2 upstream-c1cc2217c24cbc419a642d896cf27d43038856a6.zip |
mac80211: backport today's brcmfmac changes
This fixes various problems with parsing platform NVRAM. It's required
to get BCM43602 working in most cases.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 45802
Diffstat (limited to 'package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch')
-rw-r--r-- | package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch b/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch new file mode 100644 index 0000000000..dc174e5a3d --- /dev/null +++ b/package/kernel/mac80211/patches/377-brcmfmac-treat-0-as-end-of-comment-when-parsing-NVRA.patch @@ -0,0 +1,45 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com> +Date: Wed, 20 May 2015 13:59:54 +0200 +Subject: [PATCH] brcmfmac: treat \0 as end of comment when parsing NVRAM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a +flash MTD partition. In such cases entries are separated by \0 instead +of \n which caused ignoring whole content after the first "comment". +While platform NVRAM doesn't usually contain comments, we switch to +COMMENT state after e.g. finding an unexpected char in key name. + +Signed-off-by: Rafał Miłecki <zajec5@gmail.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 +@@ -162,17 +162,20 @@ brcmf_nvram_handle_value(struct nvram_pa + static enum nvram_parser_state + brcmf_nvram_handle_comment(struct nvram_parser *nvp) + { +- char *eol, *sol; ++ char *eoc, *sol; + + sol = (char *)&nvp->fwnv->data[nvp->pos]; +- eol = strchr(sol, '\n'); +- if (eol == NULL) +- return END; ++ eoc = strchr(sol, '\n'); ++ if (!eoc) { ++ eoc = strchr(sol, '\0'); ++ if (!eoc) ++ return END; ++ } + + /* eat all moving to next line */ + nvp->line++; + nvp->column = 1; +- nvp->pos += (eol - sol) + 1; ++ nvp->pos += (eoc - sol) + 1; + return IDLE; + } + |