diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2012-06-29 10:47:02 (GMT) |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-06-29 11:39:16 (GMT) |
commit | 870d37fc22f3e40f9f23e06c581c8538fc16a2f0 (patch) | |
tree | e691076b032ca12568dcd645c46e15ddbfea8708 /net/mac80211/cfg.c | |
parent | dbbae26afa81320b3315fb4ad755b20f1ff256b4 (diff) | |
download | linux-870d37fc22f3e40f9f23e06c581c8538fc16a2f0.tar.xz |
mac80211: refactor virtual monitor code
Use cfg80211 the new .set_monitor_enabled instead
of tracking it inside mac80211.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 0f02c8b..ea4b1ea 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2990,6 +2990,16 @@ ieee80211_wiphy_get_channel(struct wiphy *wiphy, return local->oper_channel; } +static void ieee80211_set_monitor_enabled(struct wiphy *wiphy, bool enabled) +{ + struct ieee80211_local *local = wiphy_priv(wiphy); + + if (enabled) + WARN_ON(ieee80211_add_virtual_monitor(local)); + else + ieee80211_del_virtual_monitor(local); +} + #ifdef CONFIG_PM static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled) { @@ -3065,6 +3075,7 @@ struct cfg80211_ops mac80211_config_ops = { .probe_client = ieee80211_probe_client, .get_channel = ieee80211_wiphy_get_channel, .set_noack_map = ieee80211_set_noack_map, + .set_monitor_enabled = ieee80211_set_monitor_enabled, #ifdef CONFIG_PM .set_wakeup = ieee80211_set_wakeup, #endif |