diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-04-29 08:57:44 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-05-16 16:38:04 -0400 |
commit | b8360ab8d2caf8a4d0d95bc03f0ba6956459505f (patch) | |
tree | e4baf6380fd79fff844e2485e10f83d9b1aff864 | |
parent | a92eecbbeaf01ea2267751569dd3301248513915 (diff) |
mac80211: fix IEEE80211_SDATA_DISCONNECT_RESUME
Since commit 12e7f517029dad819c45eca9ca01fdb9ba57616b,
IEEE80211_SDATA_DISCONNECT_RESUME no longer worked as
it would simply never be tested. Restore a bit of the
code removed there and in 9b7d72c1041ec5b20b24af487a9
to make it work again.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/ieee80211_i.h | 1 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 25 | ||||
-rw-r--r-- | net/mac80211/util.c | 7 |
3 files changed, 33 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 158e6eb188d3..44be28cfc6c4 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -1267,6 +1267,7 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata); | |||
1267 | void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata); | 1267 | void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata); |
1268 | void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata, | 1268 | void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata, |
1269 | __le16 fc, bool acked); | 1269 | __le16 fc, bool acked); |
1270 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); | ||
1270 | 1271 | ||
1271 | /* IBSS code */ | 1272 | /* IBSS code */ |
1272 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); | 1273 | void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 29620bfc7a69..8a948ca55d80 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -3623,6 +3623,31 @@ static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | |||
3623 | } | 3623 | } |
3624 | } | 3624 | } |
3625 | 3625 | ||
3626 | #ifdef CONFIG_PM | ||
3627 | void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata) | ||
3628 | { | ||
3629 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | ||
3630 | |||
3631 | mutex_lock(&ifmgd->mtx); | ||
3632 | if (!ifmgd->associated) { | ||
3633 | mutex_unlock(&ifmgd->mtx); | ||
3634 | return; | ||
3635 | } | ||
3636 | |||
3637 | if (sdata->flags & IEEE80211_SDATA_DISCONNECT_RESUME) { | ||
3638 | sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_RESUME; | ||
3639 | mlme_dbg(sdata, "driver requested disconnect after resume\n"); | ||
3640 | ieee80211_sta_connection_lost(sdata, | ||
3641 | ifmgd->associated->bssid, | ||
3642 | WLAN_REASON_UNSPECIFIED, | ||
3643 | true); | ||
3644 | mutex_unlock(&ifmgd->mtx); | ||
3645 | return; | ||
3646 | } | ||
3647 | mutex_unlock(&ifmgd->mtx); | ||
3648 | } | ||
3649 | #endif | ||
3650 | |||
3626 | /* interface setup */ | 3651 | /* interface setup */ |
3627 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) | 3652 | void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) |
3628 | { | 3653 | { |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 3f87fa468b1f..27e07150eb46 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -1740,6 +1740,13 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1740 | mb(); | 1740 | mb(); |
1741 | local->resuming = false; | 1741 | local->resuming = false; |
1742 | 1742 | ||
1743 | list_for_each_entry(sdata, &local->interfaces, list) { | ||
1744 | if (!ieee80211_sdata_running(sdata)) | ||
1745 | continue; | ||
1746 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | ||
1747 | ieee80211_sta_restart(sdata); | ||
1748 | } | ||
1749 | |||
1743 | mod_timer(&local->sta_cleanup, jiffies + 1); | 1750 | mod_timer(&local->sta_cleanup, jiffies + 1); |
1744 | #else | 1751 | #else |
1745 | WARN_ON(1); | 1752 | WARN_ON(1); |