All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@iki.fi>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 1/2] cfg80211: add firmware and hardware version to wiphy
Date: Thu, 24 Sep 2009 11:02:42 -0700	[thread overview]
Message-ID: <20090924180242.14503.11148.stgit@tikku> (raw)
In-Reply-To: <20090924180048.14503.9579.stgit@tikku>

From: Kalle Valo <kalle.valo@nokia.com>

It's useful to provide firmware and hardware version to user space and have a
generic interface to retrieve them. Users can provide the version information
in bug reports etc.

Add fields for firmware and hardware version to struct wiphy and return
them to user space in NL80211_CMD_GET_WIPHY reply.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 include/linux/nl80211.h |    3 +++
 include/net/cfg80211.h  |    5 +++++
 net/wireless/nl80211.c  |   11 +++++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index a8d71ed..6d6651f 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -714,6 +714,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PID,
 
+	NL80211_ATTR_FW_VERSION,
+	NL80211_ATTR_HW_VERSION,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3d874c6..de3da19 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1070,6 +1070,8 @@ struct cfg80211_ops {
  * and registration/helper functions
  */
 
+#define CFG80211_VERSION_LEN 32
+
 /**
  * struct wiphy - wireless hardware description
  * @idx: the wiphy index assigned to this item
@@ -1142,6 +1144,9 @@ struct wiphy {
 	u32 frag_threshold;
 	u32 rts_threshold;
 
+	char fw_version[CFG80211_VERSION_LEN];
+	char hw_version[CFG80211_VERSION_LEN];
+
 	/* If multiple wiphys are registered and you're handed e.g.
 	 * a regular netdev with assigned ieee80211_ptr, you won't
 	 * know whether it points to a wiphy your driver has registered
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index eddab09..9e2214e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -138,6 +138,14 @@ static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
 	[NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 },
 	[NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
 	[NL80211_ATTR_PID] = { .type = NLA_U32 },
+	[NL80211_ATTR_FW_VERSION] = {
+		.type = NLA_NUL_STRING,
+		.len = CFG80211_VERSION_LEN,
+	},
+	[NL80211_ATTR_HW_VERSION] = {
+		.type = NLA_NUL_STRING,
+		.len = CFG80211_VERSION_LEN,
+	},
 };
 
 /* policy for the attributes */
@@ -420,6 +428,9 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
 	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_RTS_THRESHOLD,
 		    dev->wiphy.rts_threshold);
 
+	NLA_PUT_STRING(msg, NL80211_ATTR_FW_VERSION, dev->wiphy.fw_version);
+	NLA_PUT_STRING(msg, NL80211_ATTR_HW_VERSION, dev->wiphy.hw_version);
+
 	NLA_PUT_U8(msg, NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
 		   dev->wiphy.max_scan_ssids);
 	NLA_PUT_U16(msg, NL80211_ATTR_MAX_SCAN_IE_LEN,


  reply	other threads:[~2009-09-24 18:02 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-24 18:02 [PATCH 0/2] cfg80211: firmware and hardware version Kalle Valo
2009-09-24 18:02 ` Kalle Valo [this message]
2009-09-24 18:32   ` [PATCH 1/2] cfg80211: add firmware and hardware version to wiphy Luis R. Rodriguez
2009-09-24 19:14     ` Kalle Valo
2009-09-24 20:08       ` Luis R. Rodriguez
2009-09-24 18:02 ` [PATCH 2/2] at76c50x-usb: set firmware and hardware version in wiphy Kalle Valo
2009-09-24 18:35   ` Luis R. Rodriguez
2009-09-24 19:10     ` Kalle Valo
2009-09-24 20:11       ` Luis R. Rodriguez
2009-09-25 19:11         ` Kalle Valo
2009-09-25 19:27           ` Luis R. Rodriguez
2009-09-26 12:07           ` Johannes Berg
2009-09-26 13:59             ` Kalle Valo
2009-09-24 21:13   ` Joerg Albert
2009-09-25 19:06     ` Kalle Valo
2009-09-24 18:09 ` [PATCH 1/2] iw: update nl80211.h from wireless-testing Kalle Valo
2009-09-24 18:09 ` [PATCH 2/2] iw: print firmware and hardware version Kalle Valo
2009-09-24 20:20 ` [PATCH 0/2] cfg80211: " Luis R. Rodriguez
2009-09-25  4:42   ` John W. Linville
2009-09-25 16:47     ` Kalle Valo
2009-09-25 16:53       ` Luis R. Rodriguez
2009-10-01  1:13         ` John W. Linville
2009-10-01  1:19           ` [PATCH 1/3] wireless: implement basic ethtool support for cfg80211 devices John W. Linville
2009-10-01  1:19             ` John W. Linville
2009-10-01  1:19             ` [PATCH 2/3] cfg80211: add firmware and hardware version to wiphy John W. Linville
2009-10-01  1:19               ` [PATCH 3/3] at76c50x-usb: set firmware and hardware version in wiphy John W. Linville
2009-10-01  1:19                 ` John W. Linville
2009-10-01  1:32                 ` Ben Hutchings
2009-10-01 14:27                   ` Kalle Valo
2009-10-01  1:30             ` [PATCH 1/3] wireless: implement basic ethtool support for cfg80211 devices Ben Hutchings
2009-10-01  8:51             ` Johannes Berg
2009-10-01  8:51               ` Johannes Berg
2009-10-01 14:18           ` [PATCH 0/2] cfg80211: firmware and hardware version Kalle Valo
2009-10-01 15:18             ` John W. Linville
2009-10-01 15:33               ` Ben Hutchings
2009-10-01 16:56                 ` John W. Linville
2009-10-01 16:56                   ` John W. Linville
2009-10-01 16:20               ` Kalle Valo
2009-10-01 17:07                 ` John W. Linville
2009-10-01 19:56                   ` Luis R. Rodriguez
2009-10-01 19:56                     ` Luis R. Rodriguez
2009-10-01 20:12                     ` Inaky Perez-Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090924180242.14503.11148.stgit@tikku \
    --to=kalle.valo@iki.fi \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.