aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_pathtbl.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/mac80211/mesh_pathtbl.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/mac80211/mesh_pathtbl.c')
-rw-r--r--net/mac80211/mesh_pathtbl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 04b9e4d61b8e..431865a58622 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -38,6 +38,8 @@ struct mpath_node {
38static struct mesh_table *mesh_paths; 38static struct mesh_table *mesh_paths;
39static struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */ 39static struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */
40 40
41int mesh_paths_generation;
42
41/* This lock will have the grow table function as writer and add / delete nodes 43/* This lock will have the grow table function as writer and add / delete nodes
42 * as readers. When reading the table (i.e. doing lookups) we are well protected 44 * as readers. When reading the table (i.e. doing lookups) we are well protected
43 * by RCU 45 * by RCU
@@ -243,6 +245,8 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
243 mesh_paths->mean_chain_len * (mesh_paths->hash_mask + 1)) 245 mesh_paths->mean_chain_len * (mesh_paths->hash_mask + 1))
244 grow = 1; 246 grow = 1;
245 247
248 mesh_paths_generation++;
249
246 spin_unlock(&mesh_paths->hashwlock[hash_idx]); 250 spin_unlock(&mesh_paths->hashwlock[hash_idx]);
247 read_unlock(&pathtbl_resize_lock); 251 read_unlock(&pathtbl_resize_lock);
248 if (grow) { 252 if (grow) {
@@ -484,6 +488,7 @@ int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata)
484 488
485 err = -ENXIO; 489 err = -ENXIO;
486enddel: 490enddel:
491 mesh_paths_generation++;
487 spin_unlock(&mesh_paths->hashwlock[hash_idx]); 492 spin_unlock(&mesh_paths->hashwlock[hash_idx]);
488 read_unlock(&pathtbl_resize_lock); 493 read_unlock(&pathtbl_resize_lock);
489 return err; 494 return err;