aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/offchannel.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-14 08:06:28 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 07:01:35 -0500
commitd6a83228823fc0cc8d79d95c9f0bf568b7317862 (patch)
tree322f306f105337ae9e641eb11e16cc01efd83753 /net/mac80211/offchannel.c
parent8a61af65c6d03781015315dbc43d0942a5b31db9 (diff)
mac80211: track enable_beacon explicitly
Instead of calculating in ieee80211_bss_info_change_notify() whether beaconing should be enabled or not, set it in the correct places in the callers. This simplifies the logic in this function at the expense of offchannel, but is also more robust. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/offchannel.c')
-rw-r--r--net/mac80211/offchannel.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index a5379aea7d09..1430b48600fc 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -126,11 +126,13 @@ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local,
126 set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state); 126 set_bit(SDATA_STATE_OFFCHANNEL, &sdata->state);
127 127
128 /* Check to see if we should disable beaconing. */ 128 /* Check to see if we should disable beaconing. */
129 if (sdata->vif.type == NL80211_IFTYPE_AP || 129 if (sdata->vif.bss_conf.enable_beacon) {
130 sdata->vif.type == NL80211_IFTYPE_ADHOC || 130 set_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
131 sdata->vif.type == NL80211_IFTYPE_MESH_POINT) 131 &sdata->state);
132 sdata->vif.bss_conf.enable_beacon = false;
132 ieee80211_bss_info_change_notify( 133 ieee80211_bss_info_change_notify(
133 sdata, BSS_CHANGED_BEACON_ENABLED); 134 sdata, BSS_CHANGED_BEACON_ENABLED);
135 }
134 136
135 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) { 137 if (sdata->vif.type != NL80211_IFTYPE_MONITOR) {
136 netif_tx_stop_all_queues(sdata->dev); 138 netif_tx_stop_all_queues(sdata->dev);
@@ -183,11 +185,12 @@ void ieee80211_offchannel_return(struct ieee80211_local *local,
183 netif_tx_wake_all_queues(sdata->dev); 185 netif_tx_wake_all_queues(sdata->dev);
184 } 186 }
185 187
186 if (sdata->vif.type == NL80211_IFTYPE_AP || 188 if (test_and_clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED,
187 sdata->vif.type == NL80211_IFTYPE_ADHOC || 189 &sdata->state)) {
188 sdata->vif.type == NL80211_IFTYPE_MESH_POINT) 190 sdata->vif.bss_conf.enable_beacon = true;
189 ieee80211_bss_info_change_notify( 191 ieee80211_bss_info_change_notify(
190 sdata, BSS_CHANGED_BEACON_ENABLED); 192 sdata, BSS_CHANGED_BEACON_ENABLED);
193 }
191 } 194 }
192 mutex_unlock(&local->iflist_mtx); 195 mutex_unlock(&local->iflist_mtx);
193} 196}