MLK-18675-04 brcmfmac: return -EPERM when getting error in vendor command handler
authorWright Feng <wright.feng@cypress.com>
Tue, 22 Aug 2017 03:36:04 +0000 (22:36 -0500)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit5f88c8a80c7ffc6f0ea84679fb35e3b99079793c
tree82f1ff7004f9b6033841f778c84322a40a97fd3c
parent0c091af8398a5e1696633572b9517e72336c8322
MLK-18675-04 brcmfmac: return -EPERM when getting error in vendor command handler

Firmware returns proprietary error code when getting error in
fil_cmd_data_set or fil_cmd_data_get. Sometimes the vendor tool or
utilities which uses libnl may stuck in some commands when wl is down.
For example, issue "scan" command after issuing "down" command, the
"scan" command will be the blocking call and stuck as no response from
firmware. It is caused by that firmware returns BCME_NOTUP(-4) when wl
is down, but in Linux the -4 is -EINTR, so libnl catches the error and
not pass to upper layer.
Because of that, the driver should return Linux error code instead of the
proprietary error code, and the tools or utilities need to get the real
firmware error code by another command "bcmerrorstr" after receiving
the error.

Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c