Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315576
b: refs/heads/master
c: 4290cb4
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jul 13, 2012
1 parent 9f0163a commit 6907fd5
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 63 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: 5b7ccaf3fc7446e42b83a77fd7aa7ad92850acdd
refs/heads/master: 4290cb4bf212112e3d6f860e25f000ca8a1ca6a4
4 changes: 0 additions & 4 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1504,8 +1504,6 @@ struct cfg80211_gtk_rekey_data {
* interfaces are active this callback should reject the configuration.
* If no interfaces are active or the device is down, the channel should
* be stored for when a monitor interface becomes active.
* @set_monitor_enabled: Notify driver that there are only monitor
* interfaces running.
*
* @scan: Request to do a scan. If returning zero, the scan request is given
* the driver, and will be valid until passed to cfg80211_scan_done().
Expand Down Expand Up @@ -1824,8 +1822,6 @@ struct cfg80211_ops {
void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
u32 sset, u8 *data);

void (*set_monitor_enabled)(struct wiphy *wiphy, bool enabled);

struct ieee80211_channel *
(*get_channel)(struct wiphy *wiphy,
struct wireless_dev *wdev,
Expand Down
9 changes: 1 addition & 8 deletions trunk/net/wireless/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ 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 @@ -93,13 +92,7 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
if (!chan)
return -EINVAL;

err = rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype);
if (!err) {
rdev->monitor_channel = chan;
rdev->monitor_channel_type = chantype;
}

return err;
return rdev->ops->set_monitor_channel(&rdev->wiphy, chan, chantype);
}

void
Expand Down
48 changes: 1 addition & 47 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,60 +736,14 @@ static struct device_type wiphy_type = {
.name = "wlan",
};

static struct ieee80211_channel *
cfg80211_get_any_chan(struct cfg80211_registered_device *rdev)
{
struct ieee80211_supported_band *sband;
int i;

for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
sband = rdev->wiphy.bands[i];
if (sband && sband->n_channels > 0)
return &sband->channels[0];
}

return NULL;
}

static void cfg80211_init_mon_chan(struct cfg80211_registered_device *rdev)
{
struct ieee80211_channel *chan;

chan = cfg80211_get_any_chan(rdev);
if (WARN_ON(!chan))
return;

mutex_lock(&rdev->devlist_mtx);
WARN_ON(cfg80211_set_monitor_channel(rdev, chan->center_freq,
NL80211_CHAN_NO_HT));
mutex_unlock(&rdev->devlist_mtx);
}

void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
enum nl80211_iftype iftype, int num)
{
bool has_monitors_only_old = cfg80211_has_monitors_only(rdev);
bool has_monitors_only_new;

ASSERT_RTNL();

rdev->num_running_ifaces += num;
if (iftype == NL80211_IFTYPE_MONITOR)
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 (rdev->ops->set_monitor_enabled)
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;
} else {
cfg80211_init_mon_chan(rdev);
}
}
}

static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
Expand Down Expand Up @@ -912,6 +866,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
mutex_unlock(&rdev->devlist_mtx);
dev_put(dev);
}
cfg80211_update_iface_num(rdev, wdev->iftype, 1);
cfg80211_lock_rdev(rdev);
mutex_lock(&rdev->devlist_mtx);
wdev_lock(wdev);
Expand Down Expand Up @@ -1006,7 +961,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
mutex_unlock(&rdev->devlist_mtx);
if (ret)
return notifier_from_errno(ret);
cfg80211_update_iface_num(rdev, wdev->iftype, 1);
break;
}

Expand Down
3 changes: 0 additions & 3 deletions trunk/net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ 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 6907fd5

Please sign in to comment.