cfg80211: remove wireless_dev->bssid
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 1 Jul 2009 19:26:48 +0000 (21:26 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 10 Jul 2009 19:01:49 +0000 (15:01 -0400)
This variable isn't necessary -- the wext code keeps
track of the BSSID itself, and otherwise we have
current_bss.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
include/net/cfg80211.h
net/wireless/ibss.c

index 1696ff647a0899a8fcb42a94c3c66aec9040c5cf..10eb53e2bc9f82c9cffe5a495f211b5dd7e150c5 100644 (file)
@@ -1170,7 +1170,6 @@ struct wireless_dev {
 
        /* currently used for IBSS - might be rearranged in the future */
        struct cfg80211_bss *current_bss;
-       u8 bssid[ETH_ALEN];
        u8 ssid[IEEE80211_MAX_SSID_LEN];
        u8 ssid_len;
 
index a4a1c3498ff2a8974b4af40ec35bac9d6918921e..34b11eae30c80340bf8de2cb2363f2c951af5c93 100644 (file)
@@ -24,9 +24,6 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp)
        if (WARN_ON(!wdev->ssid_len))
                return;
 
-       if (memcmp(bssid, wdev->bssid, ETH_ALEN) == 0)
-               return;
-
        bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
                               wdev->ssid, wdev->ssid_len,
                               WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
@@ -41,7 +38,6 @@ void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp)
 
        cfg80211_hold_bss(bss);
        wdev->current_bss = bss;
-       memcpy(wdev->bssid, bssid, ETH_ALEN);
 
        nl80211_send_ibss_bssid(wiphy_to_dev(wdev->wiphy), dev, bssid, gfp);
 #ifdef CONFIG_WIRELESS_EXT
@@ -87,7 +83,6 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
 
        wdev->current_bss = NULL;
        wdev->ssid_len = 0;
-       memset(wdev->bssid, 0, ETH_ALEN);
 #ifdef CONFIG_WIRELESS_EXT
        if (!nowext)
                wdev->wext.ibss.ssid_len = 0;
@@ -356,12 +351,10 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
 
        ap_addr->sa_family = ARPHRD_ETHER;
 
-       if (wdev->wext.ibss.bssid) {
+       if (wdev->current_bss)
+               memcpy(ap_addr->sa_data, wdev->current_bss->bssid, ETH_ALEN);
+       else
                memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
-               return 0;
-       }
-
-       memcpy(ap_addr->sa_data, wdev->bssid, ETH_ALEN);
        return 0;
 }
 /* temporary symbol - mark GPL - in the future the handler won't be */