brcmfmac: fix nvram processing
authorArend van Spriel <arend@broadcom.com>
Sun, 25 Jan 2015 19:31:43 +0000 (20:31 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 29 Jan 2015 08:00:19 +0000 (10:00 +0200)
The nvram file can hold a key=value combination in which the value
may have spaces, ie. 'RAW1=80 02 fe ff'. The parsing functionality
did not deal with this so it gives an error message:

[621746.311635] brcmfmac: brcmf_nvram_handle_key
warning: ln=90:col=11: '=' expected, skip invalid key entry

because RAW1=80 is being considerd as key=value pair and it expects
'=' sign after '02' for next key=value pair. This entry can be
completely ignored as firmware does not need it.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/brcm80211/brcmfmac/firmware.c

index 1ff787d1a36be97848b412cdbc1246b5b3d8afe9..9cb99152ad1753e2bc2317589ce75df7abebd08b 100644 (file)
@@ -103,7 +103,11 @@ static enum nvram_parser_state brcmf_nvram_handle_key(struct nvram_parser *nvp)
 
        c = nvp->fwnv->data[nvp->pos];
        if (c == '=') {
-               st = VALUE;
+               /* ignore RAW1 by treating as comment */
+               if (strncmp(&nvp->fwnv->data[nvp->entry], "RAW1", 4) == 0)
+                       st = COMMENT;
+               else
+                       st = VALUE;
        } else if (!is_nvram_char(c)) {
                brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n",
                          nvp->line, nvp->column);