* [PATCH] brcmsmac: export firmware version to ethtool
@ 2013-02-24 15:41 Hauke Mehrtens
2013-02-25 14:18 ` Arend van Spriel
0 siblings, 1 reply; 3+ messages in thread
From: Hauke Mehrtens @ 2013-02-24 15:41 UTC (permalink / raw)
To: linville; +Cc: arend, linux-wireless, brcm80211-dev-list, Hauke Mehrtens
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>
---
drivers/net/wireless/brcm80211/brcmsmac/main.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index d723e15..abd6eab 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -7957,9 +7957,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) */
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] brcmsmac: export firmware version to ethtool
2013-02-24 15:41 [PATCH] brcmsmac: export firmware version to ethtool Hauke Mehrtens
@ 2013-02-25 14:18 ` Arend van Spriel
2013-02-25 19:05 ` Hauke Mehrtens
0 siblings, 1 reply; 3+ messages in thread
From: Arend van Spriel @ 2013-02-25 14:18 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linville, linux-wireless, brcm80211-dev-list
On 02/24/13 16:41, Hauke Mehrtens wrote:
> This exports the firmware version in use to userspace through ethtool.
>
> root@OpenWrt:/# ethtool -i wlan0
> firmware-version: 610.812
This info is already available under debugfs although I prefer your
formatting :-) :
$ sudo cat hardware
board vendor: 1028
board type: e
board revision: 2203
board flags: 200
board flags2: 1000
firmware revision: 262032c
Gr. AvS
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] brcmsmac: export firmware version to ethtool
2013-02-25 14:18 ` Arend van Spriel
@ 2013-02-25 19:05 ` Hauke Mehrtens
0 siblings, 0 replies; 3+ messages in thread
From: Hauke Mehrtens @ 2013-02-25 19:05 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linville, linux-wireless, brcm80211-dev-list
On 02/25/2013 03:18 PM, Arend van Spriel wrote:
> On 02/24/13 16:41, Hauke Mehrtens wrote:
>> This exports the firmware version in use to userspace through ethtool.
>>
>> root@OpenWrt:/# ethtool -i wlan0
>> firmware-version: 610.812
>
> This info is already available under debugfs although I prefer your
> formatting :-) :
I used the same formating b43 uses, I do not know what's the official
formating for this firmware version number.
Writing the firmware version to wiphy->fw_version is the official way to
do this and many drivers already are exporting their firmware version in
this way.
I would prefer export the firmware version this way and also add it to
the hardware info in debugfs, where it already is.
Hauke
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-25 19:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24 15:41 [PATCH] brcmsmac: export firmware version to ethtool Hauke Mehrtens
2013-02-25 14:18 ` Arend van Spriel
2013-02-25 19:05 ` Hauke Mehrtens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).