summaryrefslogtreecommitdiff
path: root/net/wireless/util.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2012-06-29 14:47:01 +0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-29 15:39:16 +0400
commitdbbae26afa81320b3315fb4ad755b20f1ff256b4 (patch)
tree5b8b56bc68ca4f8d176f340d81a21a75263b7500 /net/wireless/util.c
parent26ab9a0c589db9ba2710f042c4959da25fd3297b (diff)
downloadlinux-dbbae26afa81320b3315fb4ad755b20f1ff256b4.tar.xz
cfg80211: track monitor interfaces count
Implements .set_monitor_enabled(wiphy, enabled). Notifies driver upon change of interface layout. If only monitor interfaces become present it is called with 2nd argument being true. If non-monitor interface appears then 2nd argument is false. Driver is notified only upon change. This makes it more obvious about the fact that cfg80211 supports single monitor channel. Once we implement multi-channel we don't want to allow setting monitor channel while other interface types are running. Otherwise it would be ambiguous once we start considering num_different_channels. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index fc948d0a53f3..9b92ec57d07b 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -871,6 +871,11 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
}
}
+ if (!err && ntype != otype && netif_running(dev)) {
+ cfg80211_update_iface_num(rdev, ntype, 1);
+ cfg80211_update_iface_num(rdev, otype, -1);
+ }
+
return err;
}