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

brcmfmac: provide firmware version in ethtool driver info

Knowing the firmware version is pretty useful information when
looking at issues. It is retrieved during initialization so
store it in driver data structure to fill the ethtool driver
info when requested.
Reviewed-by: default avatarHante Meuleman <meuleman@brodcom.com>
Reviewed-by: default avatarFranky Lin <frankyl@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 85b84133
...@@ -211,6 +211,11 @@ ...@@ -211,6 +211,11 @@
#define BRCMF_AMPDU_RX_REORDER_MAXFLOWS 256 #define BRCMF_AMPDU_RX_REORDER_MAXFLOWS 256
/* Length of firmware version string stored for
* ethtool driver info which uses 32 bytes as well.
*/
#define BRCMF_DRIVER_FIRMWARE_VERSION_LEN 32
/* Pattern matching filter. Specifies an offset within received packets to /* Pattern matching filter. Specifies an offset within received packets to
* start matching, the pattern to match, the size of the pattern, and a bitmask * start matching, the pattern to match, the size of the pattern, and a bitmask
* that indicates which bits within the pattern should be matched. * that indicates which bits within the pattern should be matched.
...@@ -544,7 +549,7 @@ struct brcmf_pub { ...@@ -544,7 +549,7 @@ struct brcmf_pub {
u8 wme_dp; /* wme discard priority */ u8 wme_dp; /* wme discard priority */
/* Dongle media info */ /* Dongle media info */
unsigned long drv_version; /* Version of dongle-resident driver */ char fwver[BRCMF_DRIVER_FIRMWARE_VERSION_LEN];
u8 mac[ETH_ALEN]; /* MAC address obtained from dongle */ u8 mac[ETH_ALEN]; /* MAC address obtained from dongle */
/* Multicast data packets sent to dongle */ /* Multicast data packets sent to dongle */
......
...@@ -278,9 +278,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) ...@@ -278,9 +278,14 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp)
} }
ptr = (char *)buf; ptr = (char *)buf;
strsep(&ptr, "\n"); strsep(&ptr, "\n");
/* Print fw version info */ /* Print fw version info */
brcmf_err("Firmware version = %s\n", buf); brcmf_err("Firmware version = %s\n", buf);
/* locate firmware version number for ethtool */
ptr = strrchr(buf, ' ') + 1;
strlcpy(ifp->drvr->fwver, ptr, sizeof(ifp->drvr->fwver));
/* /*
* Setup timeout if Beacons are lost and roam is off to report * Setup timeout if Beacons are lost and roam is off to report
* link down * link down
......
...@@ -599,8 +599,8 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *ndev, ...@@ -599,8 +599,8 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *ndev,
struct brcmf_pub *drvr = ifp->drvr; struct brcmf_pub *drvr = ifp->drvr;
strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver)); strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
snprintf(info->version, sizeof(info->version), "%lu", snprintf(info->version, sizeof(info->version), "n/a");
drvr->drv_version); strlcpy(info->fw_version, drvr->fwver, sizeof(info->fw_version));
strlcpy(info->bus_info, dev_name(drvr->bus_if->dev), strlcpy(info->bus_info, dev_name(drvr->bus_if->dev),
sizeof(info->bus_info)); sizeof(info->bus_info));
} }
......
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