aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2007-07-27 09:43:23 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:37 -0400
commit8a69aa93d54cb56017159b08512c80ede2263060 (patch)
tree4fbb506416233a10ae4f16a14fe6466ae7742b70 /net/mac80211
parentbe8755e1804d6f60e6a96a46ac6bc46ce6dfca53 (diff)
[MAC80211]: STA reassociation improvements
My cheapy D-Link AP behaves strangely w.r.t reassociations. The following sequence of commands causes me to lose association and to be unable to regain it: ifconfig eth8 down ifconfig eth8 up iwconfig eth8 essid <x> This is because mac80211 tries to reassociate, rather than just associate. My AP replies with an association response (not a reassociation response...) denying the association with code 12: "Association denied due to reason outside the scope of this standard" mac80211 tries this reassociation another 4 times or so before finally giving up. I see 2 problems here: 1. bringing the interface down and up again should be resetting interface state i.e. after the interface is brought down, it should have no memory of if or where it was previously associated 2. after the first reassociation fails, mac80211 should fall back to standard association for the next attempt Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211.c13
-rw-r--r--net/mac80211/ieee80211_sta.c6
2 files changed, 17 insertions, 2 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 566bdca32b86..f811a260ee9c 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -375,6 +375,18 @@ static void ieee80211_start_hard_monitor(struct ieee80211_local *local)
375 } 375 }
376} 376}
377 377
378static void ieee80211_if_open(struct net_device *dev)
379{
380 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
381
382 switch (sdata->type) {
383 case IEEE80211_IF_TYPE_STA:
384 case IEEE80211_IF_TYPE_IBSS:
385 sdata->u.sta.prev_bssid_set = 0;
386 break;
387 }
388}
389
378static int ieee80211_open(struct net_device *dev) 390static int ieee80211_open(struct net_device *dev)
379{ 391{
380 struct ieee80211_sub_if_data *sdata, *nsdata; 392 struct ieee80211_sub_if_data *sdata, *nsdata;
@@ -408,6 +420,7 @@ static int ieee80211_open(struct net_device *dev)
408 local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP; 420 local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
409 return 0; 421 return 0;
410 } 422 }
423 ieee80211_if_open(dev);
411 ieee80211_start_soft_monitor(local); 424 ieee80211_start_soft_monitor(local);
412 425
413 conf.if_id = dev->ifindex; 426 conf.if_id = dev->ifindex;
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c
index 9aee1abae127..8e6548974a9f 100644
--- a/net/mac80211/ieee80211_sta.c
+++ b/net/mac80211/ieee80211_sta.c
@@ -1187,8 +1187,10 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev,
1187 if (status_code != WLAN_STATUS_SUCCESS) { 1187 if (status_code != WLAN_STATUS_SUCCESS) {
1188 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n", 1188 printk(KERN_DEBUG "%s: AP denied association (code=%d)\n",
1189 dev->name, status_code); 1189 dev->name, status_code);
1190 if (status_code == WLAN_STATUS_REASSOC_NO_ASSOC) 1190 /* if this was a reassociation, ensure we try a "full"
1191 ifsta->prev_bssid_set = 0; 1191 * association next time. This works around some broken APs
1192 * which do not correctly reject reassociation requests. */
1193 ifsta->prev_bssid_set = 0;
1192 return; 1194 return;
1193 } 1195 }
1194 1196