diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-01-29 05:35:29 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-04 12:57:44 -0500 |
commit | 6b684db1db0df40275c7dfcc32a5d48eb72fe4e3 (patch) | |
tree | e3371fc60e3f31681348b43e6ddaac08455e6582 /net/mac80211/mlme.c | |
parent | e54faf29e07b6cc28a44a4f01d7fbc40905a67d3 (diff) |
mac80211: send deauth if connection was lost during suspend
If the driver determined the connection was lost or that
it couldn't securely maintain the connection when coming
out of WoWLAN, send a deauth frame to the AP to also let
it know.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 5e188a5d812f..353b690900e9 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2851,14 +2851,14 @@ static void ieee80211_sta_timer(unsigned long data) | |||
2851 | } | 2851 | } |
2852 | 2852 | ||
2853 | static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, | 2853 | static void ieee80211_sta_connection_lost(struct ieee80211_sub_if_data *sdata, |
2854 | u8 *bssid, u8 reason) | 2854 | u8 *bssid, u8 reason, bool tx) |
2855 | { | 2855 | { |
2856 | struct ieee80211_local *local = sdata->local; | 2856 | struct ieee80211_local *local = sdata->local; |
2857 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2857 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2858 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; | 2858 | u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; |
2859 | 2859 | ||
2860 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, | 2860 | ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, reason, |
2861 | false, frame_buf); | 2861 | tx, frame_buf); |
2862 | mutex_unlock(&ifmgd->mtx); | 2862 | mutex_unlock(&ifmgd->mtx); |
2863 | 2863 | ||
2864 | /* | 2864 | /* |
@@ -3107,7 +3107,8 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3107 | "No ack for nullfunc frame to AP %pM, disconnecting.\n", | 3107 | "No ack for nullfunc frame to AP %pM, disconnecting.\n", |
3108 | bssid); | 3108 | bssid); |
3109 | ieee80211_sta_connection_lost(sdata, bssid, | 3109 | ieee80211_sta_connection_lost(sdata, bssid, |
3110 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); | 3110 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, |
3111 | false); | ||
3111 | } | 3112 | } |
3112 | } else if (time_is_after_jiffies(ifmgd->probe_timeout)) | 3113 | } else if (time_is_after_jiffies(ifmgd->probe_timeout)) |
3113 | run_again(ifmgd, ifmgd->probe_timeout); | 3114 | run_again(ifmgd, ifmgd->probe_timeout); |
@@ -3116,7 +3117,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3116 | "Failed to send nullfunc to AP %pM after %dms, disconnecting\n", | 3117 | "Failed to send nullfunc to AP %pM after %dms, disconnecting\n", |
3117 | bssid, probe_wait_ms); | 3118 | bssid, probe_wait_ms); |
3118 | ieee80211_sta_connection_lost(sdata, bssid, | 3119 | ieee80211_sta_connection_lost(sdata, bssid, |
3119 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); | 3120 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); |
3120 | } else if (ifmgd->probe_send_count < max_tries) { | 3121 | } else if (ifmgd->probe_send_count < max_tries) { |
3121 | mlme_dbg(sdata, | 3122 | mlme_dbg(sdata, |
3122 | "No probe response from AP %pM after %dms, try %d/%i\n", | 3123 | "No probe response from AP %pM after %dms, try %d/%i\n", |
@@ -3135,7 +3136,7 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata) | |||
3135 | bssid, probe_wait_ms); | 3136 | bssid, probe_wait_ms); |
3136 | 3137 | ||
3137 | ieee80211_sta_connection_lost(sdata, bssid, | 3138 | ieee80211_sta_connection_lost(sdata, bssid, |
3138 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); | 3139 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, false); |
3139 | } | 3140 | } |
3140 | } | 3141 | } |
3141 | 3142 | ||
@@ -3242,7 +3243,8 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) | |||
3242 | mlme_dbg(sdata, "driver requested disconnect after resume\n"); | 3243 | mlme_dbg(sdata, "driver requested disconnect after resume\n"); |
3243 | ieee80211_sta_connection_lost(sdata, | 3244 | ieee80211_sta_connection_lost(sdata, |
3244 | ifmgd->associated->bssid, | 3245 | ifmgd->associated->bssid, |
3245 | WLAN_REASON_UNSPECIFIED); | 3246 | WLAN_REASON_UNSPECIFIED, |
3247 | true); | ||
3246 | mutex_unlock(&ifmgd->mtx); | 3248 | mutex_unlock(&ifmgd->mtx); |
3247 | return; | 3249 | return; |
3248 | } | 3250 | } |