aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/core.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-08-07 10:17:38 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:43 -0400
commitf5ea9120be2e5d5c846243416cfdce01d02f5836 (patch)
treecade27e47a90dde79a523598b96a2ebb50770d2f /net/wireless/core.c
parentf401a6f7ede753e56b84025e7d2db0d5ef560ce6 (diff)
nl80211: add generation number to all dumps
In order for userspace to be able to figure out whether it obtained a consistent snapshot of data or not when using netlink dumps, we need to have a generation number in each dump message that indicates whether the list has changed or not -- its value is arbitrary. This patch adds such a number to all dumps, this needs some mac80211 involvement to keep track of a generation number to start with when adding/removing mesh paths or stations. The wiphy and netdev lists can be fully handled within cfg80211, of course, but generation numbers need to be stored there as well. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r--net/wireless/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 1e189306560d..62e1ac00879b 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -32,6 +32,7 @@ MODULE_DESCRIPTION("wireless configuration support");
32 * only read the list, and that can happen quite 32 * only read the list, and that can happen quite
33 * often because we need to do it for each command */ 33 * often because we need to do it for each command */
34LIST_HEAD(cfg80211_rdev_list); 34LIST_HEAD(cfg80211_rdev_list);
35int cfg80211_rdev_list_generation;
35 36
36/* 37/*
37 * This is used to protect the cfg80211_rdev_list 38 * This is used to protect the cfg80211_rdev_list
@@ -511,6 +512,7 @@ int wiphy_register(struct wiphy *wiphy)
511 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); 512 wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
512 513
513 list_add(&rdev->list, &cfg80211_rdev_list); 514 list_add(&rdev->list, &cfg80211_rdev_list);
515 cfg80211_rdev_list_generation++;
514 516
515 mutex_unlock(&cfg80211_mutex); 517 mutex_unlock(&cfg80211_mutex);
516 518
@@ -593,6 +595,7 @@ void wiphy_unregister(struct wiphy *wiphy)
593 reg_device_remove(wiphy); 595 reg_device_remove(wiphy);
594 596
595 list_del(&rdev->list); 597 list_del(&rdev->list);
598 cfg80211_rdev_list_generation++;
596 device_del(&rdev->wiphy.dev); 599 device_del(&rdev->wiphy.dev);
597 debugfs_remove(rdev->wiphy.debugfsdir); 600 debugfs_remove(rdev->wiphy.debugfsdir);
598 601
@@ -653,6 +656,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
653 spin_lock_init(&wdev->event_lock); 656 spin_lock_init(&wdev->event_lock);
654 mutex_lock(&rdev->devlist_mtx); 657 mutex_lock(&rdev->devlist_mtx);
655 list_add(&wdev->list, &rdev->netdev_list); 658 list_add(&wdev->list, &rdev->netdev_list);
659 rdev->devlist_generation++;
656 /* can only change netns with wiphy */ 660 /* can only change netns with wiphy */
657 dev->features |= NETIF_F_NETNS_LOCAL; 661 dev->features |= NETIF_F_NETNS_LOCAL;
658 662
@@ -733,6 +737,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
733 if (!list_empty(&wdev->list)) { 737 if (!list_empty(&wdev->list)) {
734 sysfs_remove_link(&dev->dev.kobj, "phy80211"); 738 sysfs_remove_link(&dev->dev.kobj, "phy80211");
735 list_del_init(&wdev->list); 739 list_del_init(&wdev->list);
740 rdev->devlist_generation++;
736 mutex_destroy(&wdev->mtx); 741 mutex_destroy(&wdev->mtx);
737#ifdef CONFIG_WIRELESS_EXT 742#ifdef CONFIG_WIRELESS_EXT
738 kfree(wdev->wext.keys); 743 kfree(wdev->wext.keys);