linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] b43: update hw/fw version info in wiphy struct
@ 2010-07-29 17:34 John W. Linville
  2010-07-29 18:04 ` Michael Büsch
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2010-07-29 17:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Michael Buesch, Larry Finger, John W. Linville

This makes the information available through ethtool...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] b43: update hw/fw version info in wiphy struct
  2010-07-29 17:34 [PATCH] b43: update hw/fw version info in wiphy struct John W. Linville
@ 2010-07-29 18:04 ` Michael Büsch
  2010-07-29 18:28   ` [PATCH v2] " John W. Linville
  2010-07-29 18:44   ` [PATCH] " John W. Linville
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Büsch @ 2010-07-29 18:04 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Larry Finger

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] b43: update hw/fw version info in wiphy struct
  2010-07-29 18:04 ` Michael Büsch
@ 2010-07-29 18:28   ` John W. Linville
  2010-07-29 18:44   ` [PATCH] " John W. Linville
  1 sibling, 0 replies; 4+ messages in thread
From: John W. Linville @ 2010-07-29 18:28 UTC (permalink / raw)
  To: linux-wireless; +Cc: Michael Buesch, Larry Finger, John W. Linville

This makes the information available through ethtool...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] b43: update hw/fw version info in wiphy struct
  2010-07-29 18:04 ` Michael Büsch
  2010-07-29 18:28   ` [PATCH v2] " John W. Linville
@ 2010-07-29 18:44   ` John W. Linville
  1 sibling, 0 replies; 4+ messages in thread
From: John W. Linville @ 2010-07-29 18:44 UTC (permalink / raw)
  To: Michael Büsch; +Cc: linux-wireless, Larry Finger

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
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-29 18:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-29 17:34 [PATCH] b43: update hw/fw version info in wiphy struct John W. Linville
2010-07-29 18:04 ` Michael Büsch
2010-07-29 18:28   ` [PATCH v2] " John W. Linville
2010-07-29 18:44   ` [PATCH] " John W. Linville

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).