at76c50x-usb: set firmware and hardware version in wiphy
authorKalle Valo <kalle.valo@iki.fi>
Thu, 24 Sep 2009 18:02:51 +0000 (11:02 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:46 +0000 (16:39 -0400)
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@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/at76c50x-usb.c

index 8e1a55dec3514e5b8f6d872396db3cf1326b7460..e559dc960552556b4f137afeb9878bb9ba22c5b5 100644 (file)
@@ -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)
 {
 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 */
        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 */
        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);
        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,13 @@ 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);
 
        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);
+
+       wiphy->hw_version = priv->board_type;
+
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                printk(KERN_ERR "cannot register mac80211 hw (status %d)!\n",
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                printk(KERN_ERR "cannot register mac80211 hw (status %d)!\n",