2010-07-29 17:45:13

by John W. Linville

[permalink] [raw]
Subject: [PATCH] b43: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

Signed-off-by: John W. Linville <[email protected]>
---
drivers/net/wireless/b43/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 20631ae..21242e9 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2280,6 +2280,7 @@ out:

static int b43_upload_microcode(struct b43_wldev *dev)
{
+ struct wiphy *wiphy = dev->wl->hw->wiphy;
const size_t hdr_len = sizeof(struct b43_fw_header);
const __be32 *data;
unsigned int i, len;
@@ -2405,6 +2406,10 @@ static int b43_upload_microcode(struct b43_wldev *dev)
}
}

+ snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u",
+ dev->fw.rev, dev->fw.patch);
+ wiphy->hw_version = dev->dev->bus->chip_id;
+
if (b43_is_old_txhdr_format(dev)) {
/* We're over the deadline, but we keep support for old fw
* until it turns out to be in major conflict with something new. */
--
1.7.1.1



2010-07-29 18:30:24

by John W. Linville

[permalink] [raw]
Subject: [PATCH v2] b43: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

Signed-off-by: John W. Linville <[email protected]>
---
v2 -> use coreid for hw_version

drivers/net/wireless/b43/main.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 20631ae..294b688 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2280,6 +2280,7 @@ out:

static int b43_upload_microcode(struct b43_wldev *dev)
{
+ struct wiphy *wiphy = dev->wl->hw->wiphy;
const size_t hdr_len = sizeof(struct b43_fw_header);
const __be32 *data;
unsigned int i, len;
@@ -2405,6 +2406,10 @@ static int b43_upload_microcode(struct b43_wldev *dev)
}
}

+ snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u",
+ dev->fw.rev, dev->fw.patch);
+ wiphy->hw_version = dev->dev->id.coreid;
+
if (b43_is_old_txhdr_format(dev)) {
/* We're over the deadline, but we keep support for old fw
* until it turns out to be in major conflict with something new. */
--
1.7.1.1


2010-07-29 18:45:38

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] b43: update hw/fw version info in wiphy struct

On Thu, Jul 29, 2010 at 08:04:52PM +0200, Michael B?sch wrote:
> On 07/29/2010 07:34 PM, John W. Linville wrote:
> >+ wiphy->hw_version = dev->dev->bus->chip_id;
>
> Hm, well. Is hw_version of any use, actually? How does ethtool display
> it? I guess it does not use BCD (chip_id is BCD encoded).

It is available through the ETHTOOL_GREGS ioctl. The userland ethtool
app can be extended to interpret the value for a specific driver.

> What about using the wireless-core revision? It is slightly more usable
> than the chip_id.

Patch v2 posted...

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2010-07-29 18:04:57

by Michael Büsch

[permalink] [raw]
Subject: Re: [PATCH] b43: update hw/fw version info in wiphy struct

On 07/29/2010 07:34 PM, John W. Linville wrote:
> + wiphy->hw_version = dev->dev->bus->chip_id;

Hm, well. Is hw_version of any use, actually? How does ethtool display
it? I guess it does not use BCD (chip_id is BCD encoded).

What about using the wireless-core revision? It is slightly more usable
than the chip_id.

--
Greetings Michael.