linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] mac80211 disassociation fixes
@ 2008-09-08 15:33 Johannes Berg
  2008-09-08 15:33 ` [PATCH 1/4] mac80211: restructure disassoc/deauth flows Johannes Berg
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:33 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] mac80211: restructure disassoc/deauth flows
  2008-09-08 15:33 [PATCH 0/4] mac80211 disassociation fixes Johannes Berg
@ 2008-09-08 15:33 ` Johannes Berg
  2008-09-08 15:33 ` [PATCH 2/4] mac80211: disassociate when moving to new BSS Johannes Berg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:33 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw, Ron Rindjunsky, Tomas Winkler

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.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |   85 +++++++++++++++++++++++++++++++++-------------------
 1 file changed, 54 insertions(+), 31 deletions(-)

--- everything.orig/net/mac80211/mlme.c	2008-09-08 16:37:58.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 16:39:55.000000000 +0200
@@ -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;
 }
 

-- 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 2/4] mac80211: disassociate when moving to new BSS
  2008-09-08 15:33 [PATCH 0/4] mac80211 disassociation fixes Johannes Berg
  2008-09-08 15:33 ` [PATCH 1/4] mac80211: restructure disassoc/deauth flows Johannes Berg
@ 2008-09-08 15:33 ` Johannes Berg
  2008-09-08 15:33 ` [PATCH 3/4] mac80211: remove disassociation code from ieee80211_set_associated Johannes Berg
  2008-09-08 15:33 ` [PATCH 4/4] mac80211: stop queues before carrier off Johannes Berg
  3 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:33 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw, Ron Rindjunsky, Tomas Winkler

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.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- everything.orig/net/mac80211/mlme.c	2008-09-08 16:39:55.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 16:39:57.000000000 +0200
@@ -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);
 	}

-- 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 3/4] mac80211: remove disassociation code from ieee80211_set_associated
  2008-09-08 15:33 [PATCH 0/4] mac80211 disassociation fixes Johannes Berg
  2008-09-08 15:33 ` [PATCH 1/4] mac80211: restructure disassoc/deauth flows Johannes Berg
  2008-09-08 15:33 ` [PATCH 2/4] mac80211: disassociate when moving to new BSS Johannes Berg
@ 2008-09-08 15:33 ` Johannes Berg
  2008-09-08 15:33 ` [PATCH 4/4] mac80211: stop queues before carrier off Johannes Berg
  3 siblings, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:33 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw, Tomas Winkler

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.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |  102 ++++++++++++++++++++++++++++------------------------
 1 file changed, 56 insertions(+), 46 deletions(-)

--- everything.orig/net/mac80211/mlme.c	2008-09-08 16:39:57.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 16:39:59.000000000 +0200
@@ -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);
 }

-- 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 15:33 [PATCH 0/4] mac80211 disassociation fixes Johannes Berg
                   ` (2 preceding siblings ...)
  2008-09-08 15:33 ` [PATCH 3/4] mac80211: remove disassociation code from ieee80211_set_associated Johannes Berg
@ 2008-09-08 15:33 ` Johannes Berg
  2008-09-08 15:48   ` Johannes Berg
  2008-09-08 21:40   ` Tomas Winkler
  3 siblings, 2 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:33 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw

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>
---
 net/mac80211/mlme.c |   26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

--- everything.orig/net/mac80211/mlme.c	2008-09-08 16:39:59.000000000 +0200
+++ everything/net/mac80211/mlme.c	2008-09-08 16:40:03.000000000 +0200
@@ -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();
 

-- 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 15:33 ` [PATCH 4/4] mac80211: stop queues before carrier off Johannes Berg
@ 2008-09-08 15:48   ` Johannes Berg
  2008-09-08 21:40   ` Tomas Winkler
  1 sibling, 0 replies; 13+ messages in thread
From: Johannes Berg @ 2008-09-08 15:48 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, tomasw

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

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

From: Tomas Winkler <tomas.winkler@intel.com>

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

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 15:33 ` [PATCH 4/4] mac80211: stop queues before carrier off Johannes Berg
  2008-09-08 15:48   ` Johannes Berg
@ 2008-09-08 21:40   ` Tomas Winkler
  2008-09-08 21:44     ` Dan Williams
  1 sibling, 1 reply; 13+ messages in thread
From: Tomas Winkler @ 2008-09-08 21:40 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

On Mon, Sep 8, 2008 at 6:33 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> 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>

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


> ---
>  net/mac80211/mlme.c |   26 +++++++++++++++++---------
>  1 file changed, 17 insertions(+), 9 deletions(-)
>
> --- everything.orig/net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200
> +++ everything/net/mac80211/mlme.c      2008-09-08 16:40:03.000000000 +0200
> @@ -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();
>
>
> --
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 21:40   ` Tomas Winkler
@ 2008-09-08 21:44     ` Dan Williams
  2008-09-08 22:08       ` Tomas Winkler
  0 siblings, 1 reply; 13+ messages in thread
From: Dan Williams @ 2008-09-08 21:44 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Johannes Berg, John Linville, linux-wireless

On Tue, 2008-09-09 at 00:40 +0300, Tomas Winkler wrote:
> On Mon, Sep 8, 2008 at 6:33 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > 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>
> 
> 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

> Tomas
> 
> 
> > ---
> >  net/mac80211/mlme.c |   26 +++++++++++++++++---------
> >  1 file changed, 17 insertions(+), 9 deletions(-)
> >
> > --- everything.orig/net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200
> > +++ everything/net/mac80211/mlme.c      2008-09-08 16:40:03.000000000 +0200
> > @@ -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();
> >
> >
> > --
> >
> >
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 21:44     ` Dan Williams
@ 2008-09-08 22:08       ` Tomas Winkler
  2008-09-08 22:29         ` Matthew Garrett
  0 siblings, 1 reply; 13+ messages in thread
From: Tomas Winkler @ 2008-09-08 22:08 UTC (permalink / raw)
  To: Dan Williams; +Cc: Johannes Berg, John Linville, linux-wireless

On Tue, Sep 9, 2008 at 12:44 AM, Dan Williams <dcbw@redhat.com> wrote:
> On Tue, 2008-09-09 at 00:40 +0300, Tomas Winkler wrote:
>> On Mon, Sep 8, 2008 at 6:33 PM, Johannes Berg <johannes@sipsolutions.net> wrote:
>> > 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>
>>
>> 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

>
> Dan
>
>> Tomas
>>
>>
>> > ---
>> >  net/mac80211/mlme.c |   26 +++++++++++++++++---------
>> >  1 file changed, 17 insertions(+), 9 deletions(-)
>> >
>> > --- everything.orig/net/mac80211/mlme.c 2008-09-08 16:39:59.000000000 +0200
>> > +++ everything/net/mac80211/mlme.c      2008-09-08 16:40:03.000000000 +0200
>> > @@ -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();
>> >
>> >
>> > --
>> >
>> >
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 22:08       ` Tomas Winkler
@ 2008-09-08 22:29         ` Matthew Garrett
  2008-09-08 23:32           ` Tomas Winkler
  0 siblings, 1 reply; 13+ messages in thread
From: Matthew Garrett @ 2008-09-08 22:29 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Dan Williams, Johannes Berg, John Linville, linux-wireless

On Tue, Sep 09, 2008 at 01:08:17AM +0300, Tomas Winkler wrote:
> It has to be other way around.

[Citation needed]
-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 22:29         ` Matthew Garrett
@ 2008-09-08 23:32           ` Tomas Winkler
  2008-09-08 23:37             ` Matthew Garrett
  0 siblings, 1 reply; 13+ messages in thread
From: Tomas Winkler @ 2008-09-08 23:32 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Dan Williams, Johannes Berg, John Linville, linux-wireless

On Tue, Sep 9, 2008 at 1:29 AM, Matthew Garrett <mjg@redhat.com> wrote:
> On Tue, Sep 09, 2008 at 01:08:17AM +0300, Tomas Winkler wrote:
>> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 23:32           ` Tomas Winkler
@ 2008-09-08 23:37             ` Matthew Garrett
  2008-09-09  0:51               ` Tomas Winkler
  0 siblings, 1 reply; 13+ messages in thread
From: Matthew Garrett @ 2008-09-08 23:37 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: Dan Williams, Johannes Berg, John Linville, linux-wireless

On Tue, Sep 09, 2008 at 02:32:35AM +0300, Tomas Winkler wrote:
> On Tue, Sep 9, 2008 at 1:29 AM, Matthew Garrett <mjg@redhat.com> wrote:
> > On Tue, Sep 09, 2008 at 01:08:17AM +0300, Tomas Winkler wrote:
> >> 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.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 4/4] mac80211: stop queues before carrier off
  2008-09-08 23:37             ` Matthew Garrett
@ 2008-09-09  0:51               ` Tomas Winkler
  0 siblings, 0 replies; 13+ messages in thread
From: Tomas Winkler @ 2008-09-09  0:51 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Dan Williams, Johannes Berg, John Linville, linux-wireless

On Tue, Sep 9, 2008 at 2:37 AM, Matthew Garrett <mjg@redhat.com> wrote:
> On Tue, Sep 09, 2008 at 02:32:35AM +0300, Tomas Winkler wrote:
>> On Tue, Sep 9, 2008 at 1:29 AM, Matthew Garrett <mjg@redhat.com> wrote:
>> > On Tue, Sep 09, 2008 at 01:08:17AM +0300, Tomas Winkler wrote:
>> >> 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.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-09-09  0:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 15:33 [PATCH 0/4] mac80211 disassociation fixes Johannes Berg
2008-09-08 15:33 ` [PATCH 1/4] mac80211: restructure disassoc/deauth flows Johannes Berg
2008-09-08 15:33 ` [PATCH 2/4] mac80211: disassociate when moving to new BSS Johannes Berg
2008-09-08 15:33 ` [PATCH 3/4] mac80211: remove disassociation code from ieee80211_set_associated Johannes Berg
2008-09-08 15:33 ` [PATCH 4/4] mac80211: stop queues before carrier off Johannes Berg
2008-09-08 15:48   ` Johannes Berg
2008-09-08 21:40   ` Tomas Winkler
2008-09-08 21:44     ` Dan Williams
2008-09-08 22:08       ` Tomas Winkler
2008-09-08 22:29         ` Matthew Garrett
2008-09-08 23:32           ` Tomas Winkler
2008-09-08 23:37             ` Matthew Garrett
2008-09-09  0:51               ` Tomas Winkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).