netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
To: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Kalle Valo <kalle.valo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>,
	Kalle Valo <kalle.valo-X3B1VOXEql0@public.gmane.org>,
	"Luis R. Rodriguez"
	<mcgrof-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"John W. Linville"
	<linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
Subject: [PATCH 3/3] at76c50x-usb: set firmware and hardware version in wiphy
Date: Wed, 30 Sep 2009 21:19:02 -0400	[thread overview]
Message-ID: <1254359942-3483-3-git-send-email-linville@tuxdriver.com> (raw)
In-Reply-To: <1254359942-3483-2-git-send-email-linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>

From: Kalle Valo <kalle.valo-X3B1VOXEql0@public.gmane.org>

Set firmware and hardware version in wiphy so that user space can access
it.

(Modification from original in favor of cfg80211 ethtool support. -- JWL)

Cc: Kalle Valo <kalle.valo-X3B1VOXEql0@public.gmane.org>
Signed-off-by: John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
---
 drivers/net/wireless/at76c50x-usb.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 8e1a55d..533954d 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -2217,6 +2217,8 @@ static struct ieee80211_supported_band at76_supported_band = {
 static int at76_init_new_device(struct at76_priv *priv,
 				struct usb_interface *interface)
 {
+	struct wiphy *wiphy;
+	size_t len;
 	int ret;
 
 	/* set up the endpoint information */
@@ -2254,6 +2256,7 @@ static int at76_init_new_device(struct at76_priv *priv,
 	priv->device_unplugged = 0;
 
 	/* mac80211 initialisation */
+	wiphy = priv->hw->wiphy;
 	priv->hw->wiphy->max_scan_ssids = 1;
 	priv->hw->wiphy->max_scan_ie_len = 0;
 	priv->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
@@ -2265,6 +2268,15 @@ static int at76_init_new_device(struct at76_priv *priv,
 	SET_IEEE80211_DEV(priv->hw, &interface->dev);
 	SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
 
+	len = sizeof(wiphy->fw_version);
+	snprintf(wiphy->fw_version, len, "%d.%d.%d-%d",
+		 priv->fw_version.major, priv->fw_version.minor,
+		 priv->fw_version.patch, priv->fw_version.build);
+	/* null terminate the strings in case they were truncated */
+	wiphy->fw_version[len - 1] = '\0';
+
+	wiphy->hw_version = priv->board_type;
+
 	ret = ieee80211_register_hw(priv->hw);
 	if (ret) {
 		printk(KERN_ERR "cannot register mac80211 hw (status %d)!\n",
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-10-01  1:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090924180048.14503.9579.stgit@tikku>
     [not found] ` <43e72e890909241320j592e347die8a14f8bdd962ffb@mail.gmail.com>
     [not found]   ` <20090925044258.GA2722@tuxdriver.com>
     [not found]     ` <da94abde0909250947k5084db85vccafe0d3e74e2ecf@mail.gmail.com>
     [not found]       ` <43e72e890909250953r1714c79bsa679b96ca6f5797@mail.gmail.com>
2009-10-01  1:13         ` [PATCH 0/2] cfg80211: firmware and hardware version John W. Linville
     [not found]           ` <20091001011340.GA3123-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2009-10-01  1:19             ` [PATCH 1/3] wireless: implement basic ethtool support for cfg80211 devices John W. Linville
2009-10-01  1:19               ` [PATCH 2/3] cfg80211: add firmware and hardware version to wiphy John W. Linville
     [not found]                 ` <1254359942-3483-2-git-send-email-linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2009-10-01  1:19                   ` John W. Linville [this message]
2009-10-01  1:32                     ` [PATCH 3/3] at76c50x-usb: set firmware and hardware version in wiphy 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
     [not found]               ` <1254359942-3483-1-git-send-email-linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
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:20               ` Kalle Valo
2009-10-01 17:07                 ` John W. Linville
     [not found]                   ` <20091001170722.GC2895-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
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=1254359942-3483-3-git-send-email-linville@tuxdriver.com \
    --to=linville-2xusbdqka4r54taoqtywwq@public.gmane.org \
    --cc=kalle.valo-X3B1VOXEql0@public.gmane.org \
    --cc=kalle.valo-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mcgrof-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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).