int freq, enum nl80211_channel_type chantype)
{
struct ieee80211_channel *chan;
+ int err;
if (!rdev->ops->set_monitor_channel)
return -EOPNOTSUPP;
if (!chan)
return -EINVAL;
- return rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype);
+ err = rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype);
+ if (!err) {
+ rdev->monitor_channel = chan;
+ rdev->monitor_channel_type = chantype;
+ }
+
+ return err;
}
void
rdev->num_running_monitor_ifaces += num;
has_monitors_only_new = cfg80211_has_monitors_only(rdev);
- if (has_monitors_only_new != has_monitors_only_old)
+ if (has_monitors_only_new != has_monitors_only_old) {
rdev->ops->set_monitor_enabled(&rdev->wiphy,
has_monitors_only_new);
+
+ if (!has_monitors_only_new) {
+ rdev->monitor_channel = NULL;
+ rdev->monitor_channel_type = NL80211_CHAN_NO_HT;
+ }
+ }
}
static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
int num_running_ifaces;
int num_running_monitor_ifaces;
+ struct ieee80211_channel *monitor_channel;
+ enum nl80211_channel_type monitor_channel_type;
+
/* BSSes/scanning */
spinlock_t bss_lock;
struct list_head bss_list;