Skip to contentSkip to conversation

b43: update hw/fw version info in wiphy struct

PATCH In review John W. Linville 2 participants 4 messages Jul 29, 2010 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 b43: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

---
 drivers/net/wireless/b43/main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/main.c +5 -0
index 20631ae..21242e9 100644
@@ -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. */
Signature · 1 line
1.7.1.1
#1 lore raw

drivers/net/wireless/b43/main.c static int b43_upload_microcode(struct b43_wldev *dev) · line 2411

Quoted 1 line · John W. Linville
drivers/net/wireless/b43/main.c +1 -0
+	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.

Signature · 1 line
Greetings Michael.
#2 lore raw

PATCH v2 1/1 b43: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

---
v2 -> use coreid for hw_version

 drivers/net/wireless/b43/main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/wireless/b43/main.c +5 -0
index 20631ae..294b688 100644
@@ -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. */
Signature · 1 line
1.7.1.1
#3 lore raw
In reply to Michael Büsch
Quoted 5 lines · Michael Büsch

drivers/net/wireless/b43/main.c static int b43_upload_microcode(struct b43_wldev *dev) · line 2411

Quoted 1 line · John W. Linville
drivers/net/wireless/b43/main.c +1 -0
+	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.

Quoted 2 lines

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

Patch v2 posted...

John

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