Commit d75bd2a69490b16806f08ab79f4078e8d8bcbe6c

Authored by Luciano Coelho
Committed by Greg Kroah-Hartman
1 parent aefbc0b5c6

mac80211: only roll back station states for WDS when suspending

commit 2af81d6718f5ec92b1d787e0fe79b0d3b6f78601 upstream.

In normal cases (i.e. when we are fully associated), cfg80211 takes
care of removing all the stations before calling suspend in mac80211.

But in the corner case when we suspend during authentication or
association, mac80211 needs to roll back the station states.  But we
shouldn't roll back the station states in the suspend function,
because this is taken care of in other parts of the code, except for
WDS interfaces.  For AP types of interfaces, cfg80211 takes care of
disconnecting all stations before calling the driver's suspend code.
For station interfaces, this is done in the quiesce code.

For WDS interfaces we still need to do it here, so move the code into
a new switch case for WDS.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 15 additions and 14 deletions Side-by-side Diff

... ... @@ -86,20 +86,6 @@
86 86 }
87 87 }
88 88  
89   - /* tear down aggregation sessions and remove STAs */
90   - mutex_lock(&local->sta_mtx);
91   - list_for_each_entry(sta, &local->sta_list, list) {
92   - if (sta->uploaded) {
93   - enum ieee80211_sta_state state;
94   -
95   - state = sta->sta_state;
96   - for (; state > IEEE80211_STA_NOTEXIST; state--)
97   - WARN_ON(drv_sta_state(local, sta->sdata, sta,
98   - state, state - 1));
99   - }
100   - }
101   - mutex_unlock(&local->sta_mtx);
102   -
103 89 /* remove all interfaces that were created in the driver */
104 90 list_for_each_entry(sdata, &local->interfaces, list) {
105 91 if (!ieee80211_sdata_running(sdata))
... ... @@ -110,6 +96,21 @@
110 96 continue;
111 97 case NL80211_IFTYPE_STATION:
112 98 ieee80211_mgd_quiesce(sdata);
  99 + break;
  100 + case NL80211_IFTYPE_WDS:
  101 + /* tear down aggregation sessions and remove STAs */
  102 + mutex_lock(&local->sta_mtx);
  103 + sta = sdata->u.wds.sta;
  104 + if (sta && sta->uploaded) {
  105 + enum ieee80211_sta_state state;
  106 +
  107 + state = sta->sta_state;
  108 + for (; state > IEEE80211_STA_NOTEXIST; state--)
  109 + WARN_ON(drv_sta_state(local, sta->sdata,
  110 + sta, state,
  111 + state - 1));
  112 + }
  113 + mutex_unlock(&local->sta_mtx);
113 114 break;
114 115 default:
115 116 break;