Commit a9a2808f authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmfmac: show firmware error as string in debug message

Showing the firmware error allows to quickly give a clue what
went wrong and directly look in the firmware code that gave us
back the error.
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarDaniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b9a82f89
...@@ -32,6 +32,76 @@ ...@@ -32,6 +32,76 @@
#define MAX_HEX_DUMP_LEN 64 #define MAX_HEX_DUMP_LEN 64
#ifdef DEBUG
static const char * const brcmf_fil_errstr[] = {
"BCME_OK",
"BCME_ERROR",
"BCME_BADARG",
"BCME_BADOPTION",
"BCME_NOTUP",
"BCME_NOTDOWN",
"BCME_NOTAP",
"BCME_NOTSTA",
"BCME_BADKEYIDX",
"BCME_RADIOOFF",
"BCME_NOTBANDLOCKED",
"BCME_NOCLK",
"BCME_BADRATESET",
"BCME_BADBAND",
"BCME_BUFTOOSHORT",
"BCME_BUFTOOLONG",
"BCME_BUSY",
"BCME_NOTASSOCIATED",
"BCME_BADSSIDLEN",
"BCME_OUTOFRANGECHAN",
"BCME_BADCHAN",
"BCME_BADADDR",
"BCME_NORESOURCE",
"BCME_UNSUPPORTED",
"BCME_BADLEN",
"BCME_NOTREADY",
"BCME_EPERM",
"BCME_NOMEM",
"BCME_ASSOCIATED",
"BCME_RANGE",
"BCME_NOTFOUND",
"BCME_WME_NOT_ENABLED",
"BCME_TSPEC_NOTFOUND",
"BCME_ACM_NOTSUPPORTED",
"BCME_NOT_WME_ASSOCIATION",
"BCME_SDIO_ERROR",
"BCME_DONGLE_DOWN",
"BCME_VERSION",
"BCME_TXFAIL",
"BCME_RXFAIL",
"BCME_NODEVICE",
"BCME_NMODE_DISABLED",
"BCME_NONRESIDENT",
"BCME_SCANREJECT",
"BCME_USAGE_ERROR",
"BCME_IOCTL_ERROR",
"BCME_SERIAL_PORT_ERR",
"BCME_DISABLED",
"BCME_DECERR",
"BCME_ENCERR",
"BCME_MICERR",
"BCME_REPLAY",
"BCME_IE_NOTFOUND",
};
static const char *brcmf_fil_get_errstr(u32 err)
{
if (err >= ARRAY_SIZE(brcmf_fil_errstr))
return "(unknown)";
return brcmf_fil_errstr[err];
}
#else
static const char *brcmf_fil_get_errstr(u32 err)
{
return "";
}
#endif /* DEBUG */
static s32 static s32
brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
...@@ -54,7 +124,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) ...@@ -54,7 +124,8 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
if (err >= 0) if (err >= 0)
err = 0; err = 0;
else else
brcmf_dbg(FIL, "Failed err=%d\n", err); brcmf_dbg(FIL, "Failed: %s (%d)\n",
brcmf_fil_get_errstr((u32)(-err)), err);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment