diff options
author | Arend van Spriel <arend@broadcom.com> | 2015-01-25 22:31:41 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-29 10:59:14 +0300 |
commit | e749c7d49c2093d05d6f546f1a1a228cf3088e54 (patch) | |
tree | 23fdafa022774a2b9590b46f27082b9e709f08e8 /drivers/net/wireless/brcm80211 | |
parent | 4862290319ade31237ea9e5d61fae5d01b76c28f (diff) | |
download | linux-e749c7d49c2093d05d6f546f1a1a228cf3088e54.tar.xz |
brcmfmac: show firmware release info in ethtool driver info
The ethtool driver info already contained the unique firmware
identifier. This patch adds the firmware release version.
$ ethtool -i wlan4
driver: brcmfmac
version: 6.10.224.22
firmware-version: 01-32bd010f
Reviewed-by: Hante Meuleman <meuleman@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>
Diffstat (limited to 'drivers/net/wireless/brcm80211')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/core.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmutil/utils.c | 27 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/include/brcmu_utils.h | 2 |
3 files changed, 32 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/core.c b/drivers/net/wireless/brcm80211/brcmfmac/core.c index 6406f95af0d3..8d03588b54bb 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c @@ -601,9 +601,11 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *ndev, { struct brcmf_if *ifp = netdev_priv(ndev); struct brcmf_pub *drvr = ifp->drvr; + char drev[BRCMU_DOTREV_LEN]; strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); - snprintf(info->version, sizeof(info->version), "n/a"); + strlcpy(info->version, brcmu_dotrev_str(drvr->revinfo.driverrev, drev), + sizeof(info->version)); strlcpy(info->fw_version, drvr->fwver, sizeof(info->fw_version)); strlcpy(info->bus_info, dev_name(drvr->bus_if->dev), sizeof(info->bus_info)); diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c index 34937d8e1395..0543607002fd 100644 --- a/drivers/net/wireless/brcm80211/brcmutil/utils.c +++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c @@ -277,6 +277,33 @@ char *brcmu_boardrev_str(u32 brev, char *buf) } EXPORT_SYMBOL(brcmu_boardrev_str); +char *brcmu_dotrev_str(u32 dotrev, char *buf) +{ + u8 dotval[4]; + + if (!dotrev) { + snprintf(buf, BRCMU_DOTREV_LEN, "unknown"); + return buf; + } + dotval[0] = (dotrev >> 24) & 0xFF; + dotval[1] = (dotrev >> 16) & 0xFF; + dotval[2] = (dotrev >> 8) & 0xFF; + dotval[3] = dotrev & 0xFF; + + if (dotval[3]) + snprintf(buf, BRCMU_DOTREV_LEN, "%d.%d.%d.%d", dotval[0], + dotval[1], dotval[2], dotval[3]); + else if (dotval[2]) + snprintf(buf, BRCMU_DOTREV_LEN, "%d.%d.%d", dotval[0], + dotval[1], dotval[2]); + else + snprintf(buf, BRCMU_DOTREV_LEN, "%d.%d", dotval[0], + dotval[1]); + + return buf; +} +EXPORT_SYMBOL(brcmu_dotrev_str); + #if defined(DEBUG) /* pretty hex print a pkt buffer chain */ void brcmu_prpkt(const char *msg, struct sk_buff *p0) diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h index 197317b3fa70..41969527b459 100644 --- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h +++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h @@ -219,7 +219,9 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...) #endif #define BRCMU_BOARDREV_LEN 8 +#define BRCMU_DOTREV_LEN 16 char *brcmu_boardrev_str(u32 brev, char *buf); +char *brcmu_dotrev_str(u32 dotrev, char *buf); #endif /* _BRCMU_UTILS_H_ */ |