Skip to content

Commit

Permalink
brcmsmac: export firmware version to ethtool
Browse files Browse the repository at this point in the history
This exports the firmware version in use to userspace through ethtool.

root@OpenWrt:/# ethtool -i wlan0
firmware-version: 610.812

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Mar 6, 2013
1 parent 5f34608 commit 7626cf1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/wireless/brcm80211/brcmsmac/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7810,9 +7810,14 @@ void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx)

/* read the ucode version if we have not yet done so */
if (wlc->ucode_rev == 0) {
wlc->ucode_rev =
brcms_b_read_shm(wlc->hw, M_BOM_REV_MAJOR) << NBITS(u16);
wlc->ucode_rev |= brcms_b_read_shm(wlc->hw, M_BOM_REV_MINOR);
u16 rev;
u16 patch;

rev = brcms_b_read_shm(wlc->hw, M_BOM_REV_MAJOR);
patch = brcms_b_read_shm(wlc->hw, M_BOM_REV_MINOR);
wlc->ucode_rev = (rev << NBITS(u16)) | patch;
snprintf(wlc->wiphy->fw_version,
sizeof(wlc->wiphy->fw_version), "%u.%u", rev, patch);
}

/* ..now really unleash hell (allow the MAC out of suspend) */
Expand Down

0 comments on commit 7626cf1

Please sign in to comment.