diff options
Diffstat (limited to 'net/mac80211/offchannel.c')
-rw-r--r-- | net/mac80211/offchannel.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index a5379aea7d09..82baf5b6ecf4 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c | |||
@@ -102,8 +102,7 @@ static void ieee80211_offchannel_ps_disable(struct ieee80211_sub_if_data *sdata) | |||
102 | ieee80211_sta_reset_conn_monitor(sdata); | 102 | ieee80211_sta_reset_conn_monitor(sdata); |
103 | } | 103 | } |
104 | 104 | ||
105 | void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, | 105 | void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local) |
106 | bool offchannel_ps_enable) | ||
107 | { | 106 | { |
108 | struct ieee80211_sub_if_data *sdata; | 107 | struct ieee80211_sub_if_data *sdata; |
109 | 108 | ||
@@ -126,16 +125,17 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, | |||
126 | set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); | 125 | set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); |
127 | 126 | ||
128 | /* Check to see if we should disable beaconing. */ | 127 | /* Check to see if we should disable beaconing. */ |
129 | if (sdata->vif.type == NL80211_IFTYPE_AP || | 128 | if (sdata->vif.bss_conf.enable_beacon) { |
130 | sdata->vif.type == NL80211_IFTYPE_ADHOC || | 129 | set_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, |
131 | sdata->vif.type == NL80211_IFTYPE_MESH_POINT) | 130 | &sdata->state); |
131 | sdata->vif.bss_conf.enable_beacon = false; | ||
132 | ieee80211_bss_info_change_notify( | 132 | ieee80211_bss_info_change_notify( |
133 | sdata, BSS_CHANGED_BEACON_ENABLED); | 133 | sdata, BSS_CHANGED_BEACON_ENABLED); |
134 | } | ||
134 | 135 | ||
135 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { | 136 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { |
136 | netif_tx_stop_all_queues(sdata->dev); | 137 | netif_tx_stop_all_queues(sdata->dev); |
137 | if (offchannel_ps_enable && | 138 | if (sdata->vif.type == NL80211_IFTYPE_STATION && |
138 | (sdata->vif.type == NL80211_IFTYPE_STATION) && | ||
139 | sdata->u.mgd.associated) | 139 | sdata->u.mgd.associated) |
140 | ieee80211_offchannel_ps_enable(sdata); | 140 | ieee80211_offchannel_ps_enable(sdata); |
141 | } | 141 | } |
@@ -143,8 +143,7 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local, | |||
143 | mutex_unlock(&local->iflist_mtx); | 143 | mutex_unlock(&local->iflist_mtx); |
144 | } | 144 | } |
145 | 145 | ||
146 | void ieee80211_offchannel_return(struct ieee80211_local *local, | 146 | void ieee80211_offchannel_return(struct ieee80211_local *local) |
147 | bool offchannel_ps_disable) | ||
148 | { | 147 | { |
149 | struct ieee80211_sub_if_data *sdata; | 148 | struct ieee80211_sub_if_data *sdata; |
150 | 149 | ||
@@ -163,11 +162,9 @@ void ieee80211_offchannel_return(struct ieee80211_local *local, | |||
163 | continue; | 162 | continue; |
164 | 163 | ||
165 | /* Tell AP we're back */ | 164 | /* Tell AP we're back */ |
166 | if (offchannel_ps_disable && | 165 | if (sdata->vif.type == NL80211_IFTYPE_STATION && |
167 | sdata->vif.type == NL80211_IFTYPE_STATION) { | 166 | sdata->u.mgd.associated) |
168 | if (sdata->u.mgd.associated) | 167 | ieee80211_offchannel_ps_disable(sdata); |
169 | ieee80211_offchannel_ps_disable(sdata); | ||
170 | } | ||
171 | 168 | ||
172 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { | 169 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { |
173 | /* | 170 | /* |
@@ -183,11 +180,12 @@ void ieee80211_offchannel_return(struct ieee80211_local *local, | |||
183 | netif_tx_wake_all_queues(sdata->dev); | 180 | netif_tx_wake_all_queues(sdata->dev); |
184 | } | 181 | } |
185 | 182 | ||
186 | if (sdata->vif.type == NL80211_IFTYPE_AP || | 183 | if (test_and_clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, |
187 | sdata->vif.type == NL80211_IFTYPE_ADHOC || | 184 | &sdata->state)) { |
188 | sdata->vif.type == NL80211_IFTYPE_MESH_POINT) | 185 | sdata->vif.bss_conf.enable_beacon = true; |
189 | ieee80211_bss_info_change_notify( | 186 | ieee80211_bss_info_change_notify( |
190 | sdata, BSS_CHANGED_BEACON_ENABLED); | 187 | sdata, BSS_CHANGED_BEACON_ENABLED); |
188 | } | ||
191 | } | 189 | } |
192 | mutex_unlock(&local->iflist_mtx); | 190 | mutex_unlock(&local->iflist_mtx); |
193 | } | 191 | } |
@@ -385,7 +383,7 @@ void ieee80211_sw_roc_work(struct work_struct *work) | |||
385 | local->tmp_channel = NULL; | 383 | local->tmp_channel = NULL; |
386 | ieee80211_hw_config(local, 0); | 384 | ieee80211_hw_config(local, 0); |
387 | 385 | ||
388 | ieee80211_offchannel_return(local, true); | 386 | ieee80211_offchannel_return(local); |
389 | } | 387 | } |
390 | 388 | ||
391 | ieee80211_recalc_idle(local); | 389 | ieee80211_recalc_idle(local); |