diff options
Diffstat (limited to 'net/ieee80211/softmac/ieee80211softmac_wx.c')
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_wx.c | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index 0e65ff4e33fc..75320b6842ab 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c | |||
@@ -70,12 +70,44 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev, | |||
70 | char *extra) | 70 | char *extra) |
71 | { | 71 | { |
72 | struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); | 72 | struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); |
73 | struct ieee80211softmac_network *n; | ||
74 | struct ieee80211softmac_auth_queue_item *authptr; | ||
73 | int length = 0; | 75 | int length = 0; |
74 | unsigned long flags; | 76 | unsigned long flags; |
75 | 77 | ||
78 | /* Check if we're already associating to this or another network | ||
79 | * If it's another network, cancel and start over with our new network | ||
80 | * If it's our network, ignore the change, we're already doing it! | ||
81 | */ | ||
82 | if((sm->associnfo.associating || sm->associated) && | ||
83 | (data->essid.flags && data->essid.length && extra)) { | ||
84 | /* Get the associating network */ | ||
85 | n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid); | ||
86 | if(n && n->essid.len == (data->essid.length - 1) && | ||
87 | !memcmp(n->essid.data, extra, n->essid.len)) { | ||
88 | dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n", | ||
89 | MAC_ARG(sm->associnfo.bssid)); | ||
90 | return 0; | ||
91 | } else { | ||
92 | dprintk(KERN_INFO PFX "Canceling existing associate request!\n"); | ||
93 | spin_lock_irqsave(&sm->lock,flags); | ||
94 | /* Cancel assoc work */ | ||
95 | cancel_delayed_work(&sm->associnfo.work); | ||
96 | /* We don't have to do this, but it's a little cleaner */ | ||
97 | list_for_each_entry(authptr, &sm->auth_queue, list) | ||
98 | cancel_delayed_work(&authptr->work); | ||
99 | sm->associnfo.bssvalid = 0; | ||
100 | sm->associnfo.bssfixed = 0; | ||
101 | spin_unlock_irqrestore(&sm->lock,flags); | ||
102 | flush_scheduled_work(); | ||
103 | } | ||
104 | } | ||
105 | |||
106 | |||
76 | spin_lock_irqsave(&sm->lock, flags); | 107 | spin_lock_irqsave(&sm->lock, flags); |
77 | 108 | ||
78 | sm->associnfo.static_essid = 0; | 109 | sm->associnfo.static_essid = 0; |
110 | sm->associnfo.assoc_wait = 0; | ||
79 | 111 | ||
80 | if (data->essid.flags && data->essid.length && extra /*required?*/) { | 112 | if (data->essid.flags && data->essid.length && extra /*required?*/) { |
81 | length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE); | 113 | length = min(data->essid.length - 1, IW_ESSID_MAX_SIZE); |