* [PATCH] mac80211: deauth when interface is marked down
@ 2008-12-01 20:02 John W. Linville
2008-12-01 20:18 ` Johannes Berg
2008-12-01 20:51 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: John W. Linville @ 2008-12-01 20:02 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, dcbw, John W. Linville
It seems like proper etiquette to let other stations know when we are
going down in either STA or IBSS mode. This also notifies userland, so
wpa_supplicant doesn't get confused.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/mac80211/iface.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 4608212..b557250 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -435,6 +435,9 @@ static int ieee80211_stop(struct net_device *dev)
break;
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_ADHOC:
+ /* Announce that we are leaving the network. */
+ ieee80211_sta_deauthenticate(dev, WLAN_REASON_DEAUTH_LEAVING);
+
sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED;
memset(sdata->u.sta.bssid, 0, ETH_ALEN);
del_timer_sync(&sdata->u.sta.timer);
--
1.5.4.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: deauth when interface is marked down
2008-12-01 20:02 [PATCH] mac80211: deauth when interface is marked down John W. Linville
@ 2008-12-01 20:18 ` Johannes Berg
2008-12-01 20:51 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2008-12-01 20:18 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, dcbw
[-- Attachment #1: Type: text/plain, Size: 941 bytes --]
On Mon, 2008-12-01 at 15:02 -0500, John W. Linville wrote:
> It seems like proper etiquette to let other stations know when we are
> going down in either STA or IBSS mode. This also notifies userland, so
> wpa_supplicant doesn't get confused.
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> net/mac80211/iface.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 4608212..b557250 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -435,6 +435,9 @@ static int ieee80211_stop(struct net_device *dev)
> break;
> case NL80211_IFTYPE_STATION:
> case NL80211_IFTYPE_ADHOC:
> + /* Announce that we are leaving the network. */
> + ieee80211_sta_deauthenticate(dev, WLAN_REASON_DEAUTH_LEAVING);
> +
Ack, but I think it should check whether we're authenticated/associated
at all.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mac80211: deauth when interface is marked down
2008-12-01 20:02 [PATCH] mac80211: deauth when interface is marked down John W. Linville
2008-12-01 20:18 ` Johannes Berg
@ 2008-12-01 20:51 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2008-12-01 20:51 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Johannes Berg, dcbw
John W. Linville <linville@tuxdriver.com> writes:
> It seems like proper etiquette to let other stations know when we are
> going down in either STA or IBSS mode. This also notifies userland, so
> wpa_supplicant doesn't get confused.
I noticed a problem while I was testing my dynamic power save patches,
power save settings were not correctly sent to the driver because
ieee80211_stop() didn't notify mlme. I think this patch will fix this
but I didn't test it, yet.
>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
> net/mac80211/iface.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
> index 4608212..b557250 100644
> --- a/net/mac80211/iface.c
> +++ b/net/mac80211/iface.c
> @@ -435,6 +435,9 @@ static int ieee80211_stop(struct net_device *dev)
> break;
> case NL80211_IFTYPE_STATION:
> case NL80211_IFTYPE_ADHOC:
> + /* Announce that we are leaving the network. */
> + ieee80211_sta_deauthenticate(dev, WLAN_REASON_DEAUTH_LEAVING);
> +
> sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED;
I think manually setting u.sta.state can be removed now because
ieee80211_sta_deauthenticate() calls ieee80211_set_disassoc() which
again has this:
if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT)
ifsta->state = IEEE80211_STA_MLME_DISABLED;
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-01 20:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01 20:02 [PATCH] mac80211: deauth when interface is marked down John W. Linville
2008-12-01 20:18 ` Johannes Berg
2008-12-01 20:51 ` Kalle Valo
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).