Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315196
b: refs/heads/master
c: b78e8ce
h: refs/heads/master
v: v3
  • Loading branch information
Michal Kazior authored and Johannes Berg committed Jun 29, 2012
1 parent 435bbe9 commit e4721c8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f03c1ed8901a01ad4abcef95c02c007a2d481c2
refs/heads/master: b78e8ceac23655e1e06b30aa95ab11742d1ac7c0
9 changes: 8 additions & 1 deletion trunk/net/wireless/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
int freq, enum nl80211_channel_type chantype)
{
struct ieee80211_channel *chan;
int err;

if (!rdev->ops->set_monitor_channel)
return -EOPNOTSUPP;
Expand All @@ -92,7 +93,13 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
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
Expand Down
8 changes: 7 additions & 1 deletion trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,15 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
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,
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ struct cfg80211_registered_device {
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;
Expand Down

0 comments on commit e4721c8

Please sign in to comment.