diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-09-08 11:33:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-11 15:53:36 -0400 |
commit | 24e64622c3f3143c801850897ab0cea8f3c69445 (patch) | |
tree | 2a36dfee1c6a7b96c9cf45510869fb37f901f4fb /net/mac80211/mlme.c | |
parent | f5e5bf258b399f74b606e532ae0a2599522fd7bf (diff) |
mac80211: stop queues before carrier off
During testing of the disassociation fixes, Tomas noticed that it
was possible to run into a situation where you'd suddenly get a
few "wlan0: dropped frame to <AP> (unauthorized port)" messages
and I found this to be due to the AP's sta_info having been
removed but netif_carrier_off not having removed/stopped traffic
yet. To avoid that, stop the queue for the interface (and avoid
bringing them up when another vif scans when they weren't up.)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 0e9bd840e7dd..d889e2a89e4b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -428,6 +428,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
428 | sdata->bss_conf.assoc = 1; | 428 | sdata->bss_conf.assoc = 1; |
429 | ieee80211_bss_info_change_notify(sdata, changed); | 429 | ieee80211_bss_info_change_notify(sdata, changed); |
430 | 430 | ||
431 | netif_tx_start_all_queues(sdata->dev); | ||
431 | netif_carrier_on(sdata->dev); | 432 | netif_carrier_on(sdata->dev); |
432 | 433 | ||
433 | ieee80211_sta_send_apinfo(sdata, ifsta); | 434 | ieee80211_sta_send_apinfo(sdata, ifsta); |
@@ -849,6 +850,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
849 | ifsta->assoc_scan_tries = 0; | 850 | ifsta->assoc_scan_tries = 0; |
850 | ifsta->assoc_tries = 0; | 851 | ifsta->assoc_tries = 0; |
851 | 852 | ||
853 | netif_tx_stop_all_queues(sdata->dev); | ||
852 | netif_carrier_off(sdata->dev); | 854 | netif_carrier_off(sdata->dev); |
853 | 855 | ||
854 | ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr); | 856 | ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr); |
@@ -3268,6 +3270,7 @@ static void ieee80211_sta_reset_auth(struct ieee80211_sub_if_data *sdata, | |||
3268 | ifsta->direct_probe_tries = 0; | 3270 | ifsta->direct_probe_tries = 0; |
3269 | ifsta->auth_tries = 0; | 3271 | ifsta->auth_tries = 0; |
3270 | ifsta->assoc_tries = 0; | 3272 | ifsta->assoc_tries = 0; |
3273 | netif_tx_stop_all_queues(sdata->dev); | ||
3271 | netif_carrier_off(sdata->dev); | 3274 | netif_carrier_off(sdata->dev); |
3272 | } | 3275 | } |
3273 | 3276 | ||
@@ -3744,13 +3747,15 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
3744 | rcu_read_lock(); | 3747 | rcu_read_lock(); |
3745 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 3748 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
3746 | /* Tell AP we're back */ | 3749 | /* Tell AP we're back */ |
3747 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA && | 3750 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { |
3748 | sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) | 3751 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { |
3749 | ieee80211_send_nullfunc(local, sdata, 0); | 3752 | ieee80211_send_nullfunc(local, sdata, 0); |
3753 | netif_tx_wake_all_queues(sdata->dev); | ||
3754 | } | ||
3755 | } else | ||
3756 | netif_tx_wake_all_queues(sdata->dev); | ||
3750 | 3757 | ||
3751 | ieee80211_restart_sta_timer(sdata); | 3758 | ieee80211_restart_sta_timer(sdata); |
3752 | |||
3753 | netif_wake_queue(sdata->dev); | ||
3754 | } | 3759 | } |
3755 | rcu_read_unlock(); | 3760 | rcu_read_unlock(); |
3756 | 3761 | ||
@@ -3908,10 +3913,13 @@ static int ieee80211_sta_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
3908 | 3913 | ||
3909 | rcu_read_lock(); | 3914 | rcu_read_lock(); |
3910 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 3915 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
3911 | netif_stop_queue(sdata->dev); | 3916 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { |
3912 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA && | 3917 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { |
3913 | (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)) | 3918 | netif_tx_stop_all_queues(sdata->dev); |
3914 | ieee80211_send_nullfunc(local, sdata, 1); | 3919 | ieee80211_send_nullfunc(local, sdata, 1); |
3920 | } | ||
3921 | } else | ||
3922 | netif_tx_stop_all_queues(sdata->dev); | ||
3915 | } | 3923 | } |
3916 | rcu_read_unlock(); | 3924 | rcu_read_unlock(); |
3917 | 3925 | ||