]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/ieee80211_sta.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
[linux-2.6-omap-h63xx.git] / net / mac80211 / ieee80211_sta.c
index ba2bf8f0a347414928a3b187fe518b14cb71962b..0d99b685df5f6cf46ea3254b92bc3f103e539d17 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/wireless.h>
 #include <linux/random.h>
 #include <linux/etherdevice.h>
-#include <linux/rtnetlink.h>
 #include <net/iw_handler.h>
 #include <asm/types.h>
 
@@ -1327,10 +1326,9 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid)
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct ieee80211_sta_bss *bss;
 
-       bss = kmalloc(sizeof(*bss), GFP_ATOMIC);
+       bss = kzalloc(sizeof(*bss), GFP_ATOMIC);
        if (!bss)
                return NULL;
-       memset(bss, 0, sizeof(*bss));
        atomic_inc(&bss->users);
        atomic_inc(&bss->users);
        memcpy(bss->bssid, bssid, ETH_ALEN);
@@ -2107,12 +2105,9 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
        struct ieee80211_sta_bss *bss, *selected = NULL;
        int top_rssi = 0, freq;
 
-       rtnl_lock();
-
        if (!ifsta->auto_channel_sel && !ifsta->auto_bssid_sel &&
            !ifsta->auto_ssid_sel) {
                ifsta->state = IEEE80211_AUTHENTICATE;
-               rtnl_unlock();
                ieee80211_sta_reset_auth(dev, ifsta);
                return 0;
        }
@@ -2155,18 +2150,20 @@ static int ieee80211_sta_config_auth(struct net_device *dev,
                ieee80211_sta_set_bssid(dev, selected->bssid);
                ieee80211_rx_bss_put(dev, selected);
                ifsta->state = IEEE80211_AUTHENTICATE;
-               rtnl_unlock();
                ieee80211_sta_reset_auth(dev, ifsta);
                return 0;
        } else {
                if (ifsta->state != IEEE80211_AUTHENTICATE) {
-                       ieee80211_sta_start_scan(dev, NULL, 0);
+                       if (ifsta->auto_ssid_sel)
+                               ieee80211_sta_start_scan(dev, NULL, 0);
+                       else
+                               ieee80211_sta_start_scan(dev, ifsta->ssid,
+                                                        ifsta->ssid_len);
                        ifsta->state = IEEE80211_AUTHENTICATE;
                        set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request);
                } else
                        ifsta->state = IEEE80211_DISABLED;
        }
-       rtnl_unlock();
        return -1;
 }