linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Look out for some other AP when disassoc is received.
@ 2008-11-20  0:03 Vivek Natarajan
  2008-11-19 11:55 ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Vivek Natarajan @ 2008-11-20  0:03 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

When a disassoc packet is received with a reason code of 'AP leaving the BSS',
mac80211 should start looking for some other AP instead of trying to
associate with the same AP.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
 net/mac80211/mlme.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 6d5ed9c..8d0f995 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -855,7 +855,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
 	ieee80211_sta_send_apinfo(sdata, ifsta);
 
-	if (self_disconnected)
+	if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT)
 		ifsta->state = IEEE80211_STA_MLME_DISABLED;
 
 	sta_info_unlink(&sta);
@@ -1174,7 +1174,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
 				      IEEE80211_RETRY_AUTH_INTERVAL);
 	}
 
-	ieee80211_set_disassoc(sdata, ifsta, false, false, 0);
+	ieee80211_set_disassoc(sdata, ifsta, false, false, reason_code);
 }
 
 
-- 
1.6.0.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] mac80211: Look out for some other AP when disassoc is received.
@ 2008-11-22  4:13 Vivek Natarajan
  2008-11-21 14:44 ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Vivek Natarajan @ 2008-11-22  4:13 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

When a disassoc packet is received with a reason code of
'AP leaving the BSS', mac80211 should start looking for some
other AP instead of trying to associate with the same AP.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
---
 net/mac80211/mlme.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 90ad5a4..ee15e75 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -808,6 +808,10 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,
 	mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
 }
 
+/*
+ * The disassoc 'reason' argument can be either our own reason
+ * if self disconnected or a reason code from the AP.
+ */
 static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 				   struct ieee80211_if_sta *ifsta, bool deauth,
 				   bool self_disconnected, u16 reason)
@@ -854,7 +858,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
 	ieee80211_sta_send_apinfo(sdata, ifsta);
 
-	if (self_disconnected)
+	if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT)
 		ifsta->state = IEEE80211_STA_MLME_DISABLED;
 
 	sta_info_unlink(&sta);
@@ -1175,7 +1179,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
 				      IEEE80211_RETRY_AUTH_INTERVAL);
 	}
 
-	ieee80211_set_disassoc(sdata, ifsta, false, false, 0);
+	ieee80211_set_disassoc(sdata, ifsta, false, false, reason_code);
 }
 
 
-- 
1.5.6.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCH] mac80211: Look out for some other AP when disassoc is received.
@ 2008-11-22  6:19 Vivek Natarajan
  0 siblings, 0 replies; 10+ messages in thread
From: Vivek Natarajan @ 2008-11-22  6:19 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

When a disassoc packet is received from the AP with a reason code of
'leaving the BSS', mac80211 should go into DISABLED state just as it
would do if the AP suddenly went away for some reason, as that is what
will happen shortly after the AP leaves anyway.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 90ad5a4..ee15e75 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -808,6 +808,10 @@ static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,
 	mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
 }
 
+/*
+ * The disassoc 'reason' argument can be either our own reason
+ * if self disconnected or a reason code from the AP.
+ */
 static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 				   struct ieee80211_if_sta *ifsta, bool deauth,
 				   bool self_disconnected, u16 reason)
@@ -854,7 +858,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 
 	ieee80211_sta_send_apinfo(sdata, ifsta);
 
-	if (self_disconnected)
+	if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT)
 		ifsta->state = IEEE80211_STA_MLME_DISABLED;
 
 	sta_info_unlink(&sta);
@@ -1175,7 +1179,7 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
 				      IEEE80211_RETRY_AUTH_INTERVAL);
 	}
 
-	ieee80211_set_disassoc(sdata, ifsta, false, false, 0);
+	ieee80211_set_disassoc(sdata, ifsta, false, false, reason_code);
 }
 
 
-- 
1.5.6.4


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

end of thread, other threads:[~2008-11-21 16:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-20  0:03 [PATCH] mac80211: Look out for some other AP when disassoc is received Vivek Natarajan
2008-11-19 11:55 ` Johannes Berg
2008-11-19 12:33   ` Vivek Natarajan
2008-11-20 13:04     ` Johannes Berg
2008-11-21 11:46       ` Vivek Natarajan
2008-11-21 11:52         ` Johannes Berg
2008-11-22  4:01           ` Vivek Natarajan
  -- strict thread matches above, loose matches on Subject: below --
2008-11-22  4:13 Vivek Natarajan
2008-11-21 14:44 ` Johannes Berg
2008-11-22  6:19 Vivek Natarajan

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