Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315210
b: refs/heads/master
c: c5a7e58
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jul 4, 2012
1 parent 27f2908 commit ec7bdba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 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: a1845fc7c552977e23fe552ad3f5c6c279e3d550
refs/heads/master: c5a7e582490c423f0685e42ee5cfb7c6de81adb0
8 changes: 2 additions & 6 deletions trunk/net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ void cfg80211_update_iface_num(struct cfg80211_registered_device *rdev,
bool has_monitors_only_old = cfg80211_has_monitors_only(rdev);
bool has_monitors_only_new;

ASSERT_RDEV_LOCK(rdev);
ASSERT_RTNL();

rdev->num_running_ifaces += num;
if (iftype == NL80211_IFTYPE_MONITOR)
Expand Down Expand Up @@ -888,10 +888,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
wdev->beacon_interval = 0;
break;
case NETDEV_DOWN:
dev_hold(dev);
cfg80211_lock_rdev(rdev);
cfg80211_update_iface_num(rdev, wdev->iftype, -1);
cfg80211_unlock_rdev(rdev);
dev_hold(dev);
queue_work(cfg80211_wq, &wdev->cleanup_work);
break;
case NETDEV_UP:
Expand Down Expand Up @@ -1001,9 +999,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
mutex_unlock(&rdev->devlist_mtx);
if (ret)
return notifier_from_errno(ret);
cfg80211_lock_rdev(rdev);
cfg80211_update_iface_num(rdev, wdev->iftype, 1);
cfg80211_unlock_rdev(rdev);
break;
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/debugfs.h>
#include <linux/rfkill.h>
#include <linux/workqueue.h>
#include <linux/rtnetlink.h>
#include <net/genetlink.h>
#include <net/cfg80211.h>
#include "reg.h"
Expand Down Expand Up @@ -56,6 +57,7 @@ struct cfg80211_registered_device {

u32 ap_beacons_nlpid;

/* protected by RTNL only */
int num_running_ifaces;
int num_running_monitor_ifaces;

Expand Down Expand Up @@ -205,7 +207,7 @@ static inline void wdev_unlock(struct wireless_dev *wdev)

static inline bool cfg80211_has_monitors_only(struct cfg80211_registered_device *rdev)
{
ASSERT_RDEV_LOCK(rdev);
ASSERT_RTNL();

return rdev->num_running_ifaces == rdev->num_running_monitor_ifaces &&
rdev->num_running_ifaces > 0;
Expand Down

0 comments on commit ec7bdba

Please sign in to comment.