From patchwork Thu Oct 1 01:19:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John W. Linville" X-Patchwork-Id: 50805 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n911KhLh026464 for ; Thu, 1 Oct 2009 01:20:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755370AbZJABUU (ORCPT ); Wed, 30 Sep 2009 21:20:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755345AbZJABUT (ORCPT ); Wed, 30 Sep 2009 21:20:19 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:52858 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755332AbZJABUT (ORCPT ); Wed, 30 Sep 2009 21:20:19 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1MtALC-0006R7-Mw; Wed, 30 Sep 2009 21:20:18 -0400 Received: from linville-t400.local (linville-t400.local [127.0.0.1]) by linville-t400.local (8.14.3/8.14.3) with ESMTP id n911J2wI003528; Wed, 30 Sep 2009 21:19:02 -0400 Received: (from linville@localhost) by linville-t400.local (8.14.3/8.14.3/Submit) id n911J2kM003527; Wed, 30 Sep 2009 21:19:02 -0400 From: "John W. Linville" To: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, Kalle Valo , Kalle Valo , "Luis R. Rodriguez" , "John W. Linville" Subject: [PATCH 3/3] at76c50x-usb: set firmware and hardware version in wiphy Date: Wed, 30 Sep 2009 21:19:02 -0400 Message-Id: <1254359942-3483-3-git-send-email-linville@tuxdriver.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1254359942-3483-2-git-send-email-linville@tuxdriver.com> References: <20091001011340.GA3123@tuxdriver.com> <1254359942-3483-1-git-send-email-linville@tuxdriver.com> <1254359942-3483-2-git-send-email-linville@tuxdriver.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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",