Skip to contentSkip to conversation

mac80211 disassociation fixes

PATCH In review Johannes Berg 4 participants 13 messages Sep 8, 2008 – Sep 9, 2008 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

cover mac80211 disassociation fixes

This contains the disassociation fixes from Tomas (with rewritten changelogs to make the problems more apparent) and an additional patch I made to stop the queues to avoid the problem with spuriously reporting that the AP is on an unauthorized port.

johannes

author maintainer
#1 lore raw

PATCH 1/4 mac80211: restructure disassoc/deauth flows

This patch restructures disassociation and deauthentication to be consistent under all circumstances and adds the removal of the APs sta_info from the station table.

---
 net/mac80211/mlme.c |   85 +++++++++++++++++++++++++++++++++-------------------
 1 file changed, 54 insertions(+), 31 deletions(-)
net/mac80211/mlme.c +54 -31
@@ -416,8 +416,6 @@ static void ieee80211_set_associated(str
 		memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
 		ieee80211_sta_send_associnfo(sdata, ifsta);
 	} else {
-		netif_carrier_off(sdata->dev);
-		ieee80211_sta_tear_down_BA_sessions(sdata, ifsta->bssid);
 		ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
 		changed |= ieee80211_reset_erp_info(sdata);
 
@@ -440,18 +438,6 @@ static void ieee80211_set_associated(str
 	wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
 }
 
-static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
-				   struct ieee80211_if_sta *ifsta, int deauth)
-{
-	if (deauth) {
-		ifsta->direct_probe_tries = 0;
-		ifsta->auth_tries = 0;
-	}
-	ifsta->assoc_scan_tries = 0;
-	ifsta->assoc_tries = 0;
-	ieee80211_set_associated(sdata, ifsta, 0);
-}
-
 void ieee80211_sta_tx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
 		      int encrypt)
 {
@@ -845,6 +831,50 @@ static void ieee80211_send_disassoc(stru
 	ieee80211_sta_tx(sdata, skb, 0);
 }
 
+static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
+				   struct ieee80211_if_sta *ifsta, bool deauth,
+				   bool self_disconnected, u16 reason)
+{
+	struct ieee80211_local *local = sdata->local;
+	struct sta_info *sta;
+
+	rcu_read_lock();
+
+	sta = sta_info_get(local, ifsta->bssid);
+	if (!sta) {
+		rcu_read_unlock();
+		return;
+	}
+
+	if (deauth) {
+		ifsta->direct_probe_tries = 0;
+		ifsta->auth_tries = 0;
+	}
+	ifsta->assoc_scan_tries = 0;
+	ifsta->assoc_tries = 0;
+
+	netif_carrier_off(sdata->dev);
+
+	ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr);
+
+	if (self_disconnected) {
+		if (deauth)
+			ieee80211_send_deauth(sdata, ifsta, reason);
+		else
+			ieee80211_send_disassoc(sdata, ifsta, reason);
+	}
+
+	ieee80211_set_associated(sdata, ifsta, 0);
+
+	if (self_disconnected)
+		ifsta->state = IEEE80211_STA_MLME_DISABLED;
+
+	sta_info_unlink(&sta);
+
+	rcu_read_unlock();
+
+	sta_info_destroy(sta);
+}
 
 static int ieee80211_privacy_mismatch(struct ieee80211_sub_if_data *sdata,
 				      struct ieee80211_if_sta *ifsta)
@@ -939,7 +969,6 @@ static void ieee80211_associated(struct 
 				       "range\n",
 				       sdata->dev->name, print_mac(mac, ifsta->bssid));
 				disassoc = 1;
-				sta_info_unlink(&sta);
 			} else
 				ieee80211_send_probe_req(sdata, ifsta->bssid,
 							 local->scan_ssid,
@@ -959,16 +988,12 @@ static void ieee80211_associated(struct 
 
 	rcu_read_unlock();
 
-	if (disassoc && sta)
-		sta_info_destroy(sta);
-
-	if (disassoc) {
-		ifsta->state = IEEE80211_STA_MLME_DISABLED;
-		ieee80211_set_associated(sdata, ifsta, 0);
-	} else {
+	if (disassoc)
+		ieee80211_set_disassoc(sdata, ifsta, true, true,
+					WLAN_REASON_PREV_AUTH_NOT_VALID);
+	else
 		mod_timer(&ifsta->timer, jiffies +
 				      IEEE80211_MONITORING_INTERVAL);
-	}
 }
 
 
@@ -1833,7 +1858,7 @@ static void ieee80211_rx_mgmt_deauth(str
 				      IEEE80211_RETRY_AUTH_INTERVAL);
 	}
 
-	ieee80211_set_disassoc(sdata, ifsta, 1);
+	ieee80211_set_disassoc(sdata, ifsta, true, false, 0);
 	ifsta->flags &= ~IEEE80211_STA_AUTHENTICATED;
 }
 
@@ -1863,7 +1888,7 @@ static void ieee80211_rx_mgmt_disassoc(s
 				      IEEE80211_RETRY_AUTH_INTERVAL);
 	}
 
-	ieee80211_set_disassoc(sdata, ifsta, 0);
+	ieee80211_set_disassoc(sdata, ifsta, false, false, 0);
 }
 
 
@@ -3201,8 +3226,8 @@ void ieee80211_sta_work(struct work_stru
 		printk(KERN_DEBUG "%s: privacy configuration mismatch and "
 		       "mixed-cell disabled - disassociate\n", sdata->dev->name);
 
-		ieee80211_send_disassoc(sdata, ifsta, WLAN_REASON_UNSPECIFIED);
-		ieee80211_set_disassoc(sdata, ifsta, 0);
+		ieee80211_set_disassoc(sdata, ifsta, false, true,
+					WLAN_REASON_UNSPECIFIED);
 	}
 }
 
@@ -4237,8 +4262,7 @@ int ieee80211_sta_deauthenticate(struct 
 	    sdata->vif.type != IEEE80211_IF_TYPE_IBSS)
 		return -EINVAL;
 
-	ieee80211_send_deauth(sdata, ifsta, reason);
-	ieee80211_set_disassoc(sdata, ifsta, 1);
+	ieee80211_set_disassoc(sdata, ifsta, true, true, reason);
 	return 0;
 }
 
@@ -4256,8 +4280,7 @@ int ieee80211_sta_disassociate(struct ie
 	if (!(ifsta->flags & IEEE80211_STA_ASSOCIATED))
 		return -1;
 
-	ieee80211_send_disassoc(sdata, ifsta, reason);
-	ieee80211_set_disassoc(sdata, ifsta, 0);
+	ieee80211_set_disassoc(sdata, ifsta, false, true, reason);
 	return 0;
 }
 
author maintainer
#2 lore raw

PATCH 2/4 mac80211: disassociate when moving to new BSS

In reply to Johannes Berg

This patch makes the MLME cleanly disassociate from the current BSS when leaving it for a new one. This is not just nicer to the old AP (we're leaving it, might as well tell it!) but also required for some drivers that keep track of the station we're associated with, they'd get confused because they'd think we are associated with two APs.

---
 net/mac80211/mlme.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
net/mac80211/mlme.c +7 -2
@@ -3272,9 +3272,14 @@ void ieee80211_sta_req_auth(struct ieee8
 		return;
 
 	if ((ifsta->flags & (IEEE80211_STA_BSSID_SET |
-				IEEE80211_STA_AUTO_BSSID_SEL)) &&
+			     IEEE80211_STA_AUTO_BSSID_SEL)) &&
 	    (ifsta->flags & (IEEE80211_STA_SSID_SET |
-				IEEE80211_STA_AUTO_SSID_SEL))) {
+			     IEEE80211_STA_AUTO_SSID_SEL))) {
+
+		if (ifsta->state == IEEE80211_STA_MLME_ASSOCIATED)
+			ieee80211_set_disassoc(sdata, ifsta, true, true,
+					       WLAN_REASON_DEAUTH_LEAVING);
+
 		set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request);
 		queue_work(local->hw.workqueue, &ifsta->work);
 	}
author maintainer
#3 lore raw

PATCH 3/4 mac80211: remove disassociation code from ieee80211_set_associated

In reply to Johannes Berg

This patch moves disassociation code from ieee80211_set_associated to ieee80211_set_disassoc. To reduce code duplication, it introduces the ieee80211_sta_send_apinfo function. Additionally, it fixes a lapse where BSS_CHANGED_HT wasn't set when notifying the driver of changes due to disassociation.

---
 net/mac80211/mlme.c |  102 ++++++++++++++++++++++++++++------------------------
 1 file changed, 56 insertions(+), 46 deletions(-)
net/mac80211/mlme.c +56 -46
@@ -352,6 +352,17 @@ int ieee80211_ht_addt_info_ie_to_ht_bss_
 	return 0;
 }
 
+static void ieee80211_sta_send_apinfo(struct ieee80211_sub_if_data *sdata,
+					struct ieee80211_if_sta *ifsta)
+{
+	union iwreq_data wrqu;
+	memset(&wrqu, 0, sizeof(wrqu));
+	if (ifsta->flags & IEEE80211_STA_ASSOCIATED)
+		memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
+	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+	wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
+}
+
 static void ieee80211_sta_send_associnfo(struct ieee80211_sub_if_data *sdata,
 					 struct ieee80211_if_sta *ifsta)
 {
@@ -374,68 +385,53 @@ static void ieee80211_sta_send_associnfo
 
 
 static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
-				     struct ieee80211_if_sta *ifsta,
-				     bool assoc)
+				     struct ieee80211_if_sta *ifsta)
 {
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_conf *conf = &local_to_hw(local)->conf;
-	union iwreq_data wrqu;
 	u32 changed = BSS_CHANGED_ASSOC;
 
-	if (assoc) {
-		struct ieee80211_sta_bss *bss;
-
-		ifsta->flags |= IEEE80211_STA_ASSOCIATED;
+	struct ieee80211_sta_bss *bss;
 
-		if (sdata->vif.type != IEEE80211_IF_TYPE_STA)
-			return;
+	ifsta->flags |= IEEE80211_STA_ASSOCIATED;
 
-		bss = ieee80211_rx_bss_get(local, ifsta->bssid,
-					   conf->channel->center_freq,
-					   ifsta->ssid, ifsta->ssid_len);
-		if (bss) {
-			/* set timing information */
-			sdata->bss_conf.beacon_int = bss->beacon_int;
-			sdata->bss_conf.timestamp = bss->timestamp;
-			sdata->bss_conf.dtim_period = bss->dtim_period;
+	if (sdata->vif.type != IEEE80211_IF_TYPE_STA)
+		return;
 
-			changed |= ieee80211_handle_bss_capability(sdata, bss);
+	bss = ieee80211_rx_bss_get(local, ifsta->bssid,
+				   conf->channel->center_freq,
+				   ifsta->ssid, ifsta->ssid_len);
+	if (bss) {
+		/* set timing information */
+		sdata->bss_conf.beacon_int = bss->beacon_int;
+		sdata->bss_conf.timestamp = bss->timestamp;
+		sdata->bss_conf.dtim_period = bss->dtim_period;
 
-			ieee80211_rx_bss_put(local, bss);
-		}
+		changed |= ieee80211_handle_bss_capability(sdata, bss);
 
-		if (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) {
-			changed |= BSS_CHANGED_HT;
-			sdata->bss_conf.assoc_ht = 1;
-			sdata->bss_conf.ht_conf = &conf->ht_conf;
-			sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf;
-		}
+		ieee80211_rx_bss_put(local, bss);
+	}
 
-		ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
-		memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN);
-		memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
-		ieee80211_sta_send_associnfo(sdata, ifsta);
-	} else {
-		ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
-		changed |= ieee80211_reset_erp_info(sdata);
+	if (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) {
+		changed |= BSS_CHANGED_HT;
+		sdata->bss_conf.assoc_ht = 1;
+		sdata->bss_conf.ht_conf = &conf->ht_conf;
+		sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf;
+	}
 
-		sdata->bss_conf.assoc_ht = 0;
-		sdata->bss_conf.ht_conf = NULL;
-		sdata->bss_conf.ht_bss_conf = NULL;
+	ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
+	memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN);
+	ieee80211_sta_send_associnfo(sdata, ifsta);
 
-		memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
-	}
 	ifsta->last_probe = jiffies;
-	ieee80211_led_assoc(local, assoc);
+	ieee80211_led_assoc(local, 1);
 
-	sdata->bss_conf.assoc = assoc;
+	sdata->bss_conf.assoc = 1;
 	ieee80211_bss_info_change_notify(sdata, changed);
 
-	if (assoc)
-		netif_carrier_on(sdata->dev);
+	netif_carrier_on(sdata->dev);
 
-	wrqu.ap_addr.sa_family = ARPHRD_ETHER;
-	wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
+	ieee80211_sta_send_apinfo(sdata, ifsta);
 }
 
 void ieee80211_sta_tx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
@@ -837,6 +833,7 @@ static void ieee80211_set_disassoc(struc
 {
 	struct ieee80211_local *local = sdata->local;
 	struct sta_info *sta;
+	u32 changed = BSS_CHANGED_ASSOC;
 
 	rcu_read_lock();
 
@@ -864,7 +861,20 @@ static void ieee80211_set_disassoc(struc
 			ieee80211_send_disassoc(sdata, ifsta, reason);
 	}
 
-	ieee80211_set_associated(sdata, ifsta, 0);
+	ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
+	changed |= ieee80211_reset_erp_info(sdata);
+
+	if (sdata->bss_conf.assoc_ht)
+		changed |= BSS_CHANGED_HT;
+
+	sdata->bss_conf.assoc_ht = 0;
+	sdata->bss_conf.ht_conf = NULL;
+	sdata->bss_conf.ht_bss_conf = NULL;
+
+	ieee80211_led_assoc(local, 0);
+	sdata->bss_conf.assoc = 0;
+
+	ieee80211_sta_send_apinfo(sdata, ifsta);
 
 	if (self_disconnected)
 		ifsta->state = IEEE80211_STA_MLME_DISABLED;
@@ -2082,7 +2092,7 @@ static void ieee80211_rx_mgmt_assoc_resp
 	 * ieee80211_set_associated() will tell the driver */
 	bss_conf->aid = aid;
 	bss_conf->assoc_capability = capab_info;
-	ieee80211_set_associated(sdata, ifsta, 1);
+	ieee80211_set_associated(sdata, ifsta);
 
 	ieee80211_associated(sdata, ifsta);
 }
author maintainer
#4 lore raw

PATCH 4/4 mac80211: stop queues before carrier off

In reply to Johannes Berg

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.)

---
 net/mac80211/mlme.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
net/mac80211/mlme.c +17 -9
@@ -429,6 +429,7 @@ static void ieee80211_set_associated(str
 	sdata->bss_conf.assoc = 1;
 	ieee80211_bss_info_change_notify(sdata, changed);
 
+	netif_tx_start_all_queues(sdata->dev);
 	netif_carrier_on(sdata->dev);
 
 	ieee80211_sta_send_apinfo(sdata, ifsta);
@@ -850,6 +851,7 @@ static void ieee80211_set_disassoc(struc
 	ifsta->assoc_scan_tries = 0;
 	ifsta->assoc_tries = 0;
 
+	netif_tx_stop_all_queues(sdata->dev);
 	netif_carrier_off(sdata->dev);
 
 	ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr);
@@ -3269,6 +3271,7 @@ static void ieee80211_sta_reset_auth(str
 	ifsta->direct_probe_tries = 0;
 	ifsta->auth_tries = 0;
 	ifsta->assoc_tries = 0;
+	netif_tx_stop_all_queues(sdata->dev);
 	netif_carrier_off(sdata->dev);
 }
 
@@ -3745,13 +3748,15 @@ void ieee80211_scan_completed(struct iee
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 		/* Tell AP we're back */
-		if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-		    sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
-			ieee80211_send_nullfunc(local, sdata, 0);
+		if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+			if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+				ieee80211_send_nullfunc(local, sdata, 0);
+				netif_tx_wake_all_queues(sdata->dev);
+			}
+		} else
+			netif_tx_wake_all_queues(sdata->dev);
 
 		ieee80211_restart_sta_timer(sdata);
-
-		netif_wake_queue(sdata->dev);
 	}
 	rcu_read_unlock();
 
@@ -3909,10 +3914,13 @@ static int ieee80211_sta_start_scan(stru
 
 	rcu_read_lock();
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-		netif_stop_queue(sdata->dev);
-		if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-		    (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED))
-			ieee80211_send_nullfunc(local, sdata, 1);
+		if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+			if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+				netif_tx_stop_all_queues(sdata->dev);
+				ieee80211_send_nullfunc(local, sdata, 1);
+			}
+		} else
+			netif_tx_stop_all_queues(sdata->dev);
 	}
 	rcu_read_unlock();
 
author maintainer
#5 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Oops, sorry, quilt ate the attribution (From header line), can you add those for the first three patches? I had

From: Tomas Winkler <[email protected]>

as in the original mails Tomas sent. Alternatively, I can resend?

johannes

#6 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

In reply to Johannes Berg
Quoted 9 lines · Johannes Berg

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.)

It worked as far as I tested... ACK then.
I foolishly tried to switch APs with NM... With sadness I have to say that we are now where other operating systems were 5 years ago Tomas

Quoted 73 lines
---
 net/mac80211/mlme.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 renamed from net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200 +17 -10
@@ -429,6 +429,7 @@ static void ieee80211_set_associated(str
       sdata->bss_conf.assoc = 1;
       ieee80211_bss_info_change_notify(sdata, changed);
 
+       netif_tx_start_all_queues(sdata->dev);
       netif_carrier_on(sdata->dev);
 
       ieee80211_sta_send_apinfo(sdata, ifsta);
@@ -850,6 +851,7 @@ static void ieee80211_set_disassoc(struc
       ifsta->assoc_scan_tries = 0;
       ifsta->assoc_tries = 0;
 
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 
       ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr);
@@ -3269,6 +3271,7 @@ static void ieee80211_sta_reset_auth(str
       ifsta->direct_probe_tries = 0;
       ifsta->auth_tries = 0;
       ifsta->assoc_tries = 0;
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 }
 
@@ -3745,13 +3748,15 @@ void ieee80211_scan_completed(struct iee
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
               /* Tell AP we're back */
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
-                       ieee80211_send_nullfunc(local, sdata, 0);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+                               ieee80211_send_nullfunc(local, sdata, 0);
+                               netif_tx_wake_all_queues(sdata->dev);
+                       }
+               } else
+                       netif_tx_wake_all_queues(sdata->dev);
 
               ieee80211_restart_sta_timer(sdata);
-
-               netif_wake_queue(sdata->dev);
       }
       rcu_read_unlock();
 
@@ -3909,10 +3914,13 @@ static int ieee80211_sta_start_scan(stru
 
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-               netif_stop_queue(sdata->dev);
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED))
-                       ieee80211_send_nullfunc(local, sdata, 1);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+                               netif_tx_stop_all_queues(sdata->dev);
+                               ieee80211_send_nullfunc(local, sdata, 1);
+                       }
+               } else
+                       netif_tx_stop_all_queues(sdata->dev);
       }
       rcu_read_unlock();
 
 
--
#7 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 9 lines · Tomas Winkler
Quoted 8 lines · Johannes Berg

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.)

Quoted 5 lines
Quoted 1 line

It worked as far as I tested... ACK then.
I foolishly tried to switch APs with NM... With sadness I have to say that we are now where other operating systems were 5 years ago

need... cfg80211... Anyway, was there some problem with NM here?

Dan

Quoted 80 lines

Tomas

Quoted 63 lines
---
 net/mac80211/mlme.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 renamed from net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200 +12 -9
@@ -429,6 +429,7 @@ static void ieee80211_set_associated(str
       sdata->bss_conf.assoc = 1;
       ieee80211_bss_info_change_notify(sdata, changed);
 
+       netif_tx_start_all_queues(sdata->dev);
       netif_carrier_on(sdata->dev);
 
       ieee80211_sta_send_apinfo(sdata, ifsta);
@@ -850,6 +851,7 @@ static void ieee80211_set_disassoc(struc
       ifsta->assoc_scan_tries = 0;
       ifsta->assoc_tries = 0;
 
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 
       ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr);
@@ -3269,6 +3271,7 @@ static void ieee80211_sta_reset_auth(str
       ifsta->direct_probe_tries = 0;
       ifsta->auth_tries = 0;
       ifsta->assoc_tries = 0;
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 }
 
@@ -3745,13 +3748,15 @@ void ieee80211_scan_completed(struct iee
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
               /* Tell AP we're back */
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
-                       ieee80211_send_nullfunc(local, sdata, 0);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+                               ieee80211_send_nullfunc(local, sdata, 0);
+                               netif_tx_wake_all_queues(sdata->dev);
+                       }
+               } else
+                       netif_tx_wake_all_queues(sdata->dev);
 
               ieee80211_restart_sta_timer(sdata);
-
-               netif_wake_queue(sdata->dev);
       }
       rcu_read_unlock();
 
@@ -3909,10 +3914,13 @@ static int ieee80211_sta_start_scan(stru
 
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-               netif_stop_queue(sdata->dev);
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED))
-                       ieee80211_send_nullfunc(local, sdata, 1);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {

net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 static int ieee80211_sta_start_scan(stru

Quoted 10 lines
net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 renamed from net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200 +5 -1
+                               netif_tx_stop_all_queues(sdata->dev);
+                               ieee80211_send_nullfunc(local, sdata, 1);
+                       }
+               } else
+                       netif_tx_stop_all_queues(sdata->dev);
       }
       rcu_read_unlock();
 
 
--

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 10 lines · Dan Williams
Quoted 9 lines · Tomas Winkler
Quoted 8 lines · Johannes Berg

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.)

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

It worked as far as I tested... ACK then.
I foolishly tried to switch APs with NM... With sadness I have to say that we are now where other operating systems were 5 years ago

need... cfg80211...

Correct

Anyway, was there some problem with NM here?

I've added manually two APs one with security enabled (WPA2-Personal/CCMP) second open.
I was not able to connect to the open AP with NM it ask for a key.

When I want to connect to hidden ssid I have to manually scan for it with iwlist wlan0 essid <SSID>, but that's rather old problem I guess.

The GUI has conceptual problem that it trying to connect something in scan list (Wireless Networks - right click) instead to what we call a profile (managed list of netrwork connection in NM language) It has to be other way around. It should be possible to create a profile form an entry in thes scan list and connect this specific profile and not clicking on the entry of an scan list.

Even wpa supplicant works with profiles so why not the GUI?

Thanks
Tomas

Quoted 85 lines

Dan

Quoted 80 lines

Tomas

Quoted 63 lines
---
 net/mac80211/mlme.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)
net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 renamed from net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200 +12 -9
@@ -429,6 +429,7 @@ static void ieee80211_set_associated(str
       sdata->bss_conf.assoc = 1;
       ieee80211_bss_info_change_notify(sdata, changed);
 
+       netif_tx_start_all_queues(sdata->dev);
       netif_carrier_on(sdata->dev);
 
       ieee80211_sta_send_apinfo(sdata, ifsta);
@@ -850,6 +851,7 @@ static void ieee80211_set_disassoc(struc
       ifsta->assoc_scan_tries = 0;
       ifsta->assoc_tries = 0;
 
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 
       ieee80211_sta_tear_down_BA_sessions(sdata, sta->addr);
@@ -3269,6 +3271,7 @@ static void ieee80211_sta_reset_auth(str
       ifsta->direct_probe_tries = 0;
       ifsta->auth_tries = 0;
       ifsta->assoc_tries = 0;
+       netif_tx_stop_all_queues(sdata->dev);
       netif_carrier_off(sdata->dev);
 }
 
@@ -3745,13 +3748,15 @@ void ieee80211_scan_completed(struct iee
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
               /* Tell AP we're back */
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
-                       ieee80211_send_nullfunc(local, sdata, 0);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
+                               ieee80211_send_nullfunc(local, sdata, 0);
+                               netif_tx_wake_all_queues(sdata->dev);
+                       }
+               } else
+                       netif_tx_wake_all_queues(sdata->dev);
 
               ieee80211_restart_sta_timer(sdata);
-
-               netif_wake_queue(sdata->dev);
       }
       rcu_read_unlock();
 
@@ -3909,10 +3914,13 @@ static int ieee80211_sta_start_scan(stru
 
       rcu_read_lock();
       list_for_each_entry_rcu(sdata, &local->interfaces, list) {
-               netif_stop_queue(sdata->dev);
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
-                   (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED))
-                       ieee80211_send_nullfunc(local, sdata, 1);
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
+                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {

net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 static int ieee80211_sta_start_scan(stru

Quoted 10 lines
net/mac80211/mlme.c 2008-09-08 16:40:03.000000000 +0200 renamed from net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200 +5 -1
+                               netif_tx_stop_all_queues(sdata->dev);
+                               ieee80211_send_nullfunc(local, sdata, 1);
+                       }
+               } else
+                       netif_tx_stop_all_queues(sdata->dev);
       }
       rcu_read_unlock();
 
 
--

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 1 line · Tomas Winkler

It has to be other way around.

[Citation needed]

Signature · 1 line
Matthew Garrett | [email protected]
#10 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 4 lines · Matthew Garrett
Quoted 1 line · Tomas Winkler

It has to be other way around.

[Citation needed]\

This is how any other connection manager I know works. Maybe I'm trapped in old concepts but I don't find current NM paradigm friendly.
Tomas

#11 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 9 lines · Tomas Winkler
Quoted 4 lines · Matthew Garrett
Quoted 1 line · Tomas Winkler

It has to be other way around.

[Citation needed]\

This is how any other connection manager I know works. Maybe I'm trapped in old concepts but I don't find current NM paradigm friendly.

It's the way it's been in NM since 2004, so I think changing it at this point would be unfriendly. The aim isn't to build a Windows clone.

Signature · 1 line
Matthew Garrett | [email protected]
#12 lore raw

Re: [PATCH 4/4] mac80211: stop queues before carrier off

Quoted 5 lines · Matthew Garrett
Quoted 4 lines · Tomas Winkler
Quoted 3 lines · Matthew Garrett
Quoted 1 line · Tomas Winkler

It has to be other way around.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

[Citation needed]\

This is how any other connection manager I know works. Maybe I'm trapped in old concepts but I don't find current NM paradigm friendly.

It's the way it's been in NM since 2004, so I think changing it at this point would be unfriendly.

As I see it NM is evolving lately, which is good It didn't have connection editor before. Now they is just missing <connect> button along add, edit and delete to make me happy.

The aim isn't to build a Windows clone.

I didn't suggested this and wireless profile is a general concept nothing to do with Windows.

Another example you live big building where everybody has an AP. So your scan list has 50 entries.
Now you have to search by eye all this 50 entries instead of directly requesting connection to your particular AP.
What I want to see is 3 APs my home, work and favorite coffee house. I would access scan list only if I cannot find any of these three.

But we should probably move this conversation to different mailing list. Second I didn't plan to criticize anyone I didn't do anything actively to change it. I just got little frustrated when testing switching between APs

Thanks
Tomas