aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@gmail.com>2009-11-09 18:46:41 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 15:23:57 -0500
commit8f2fda9594f083981ad54c1994863875fe680925 (patch)
tree3a409f293de7fd2569d6d962165e4704898bfe6e /net/mac80211
parenta1935218da8964a033bdf68c591629741c94eeec (diff)
mac80211: implement the meshconf formation info field
The Mesh Configuration Formation Info field contains the number of neighbors. This means that the beacon must be updated every time a peer joins or leaves. Signed-off-by: Rui Paulo <rpaulo@gmail.com> Signed-off-by: Javier Cardona <rpaulo@gmail.com> Reviewed-by: Andrey Yurovsky <andrey@cozybit.com> Tested-by: Brian Cavagnolo <brian@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh.c9
-rw-r--r--net/mac80211/mesh_plink.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index a49a3374acb1..79425182c290 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -223,6 +223,7 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
223 struct ieee80211_supported_band *sband; 223 struct ieee80211_supported_band *sband;
224 u8 *pos; 224 u8 *pos;
225 int len, i, rate; 225 int len, i, rate;
226 u8 neighbors;
226 227
227 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 228 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
228 len = sband->n_bitrates; 229 len = sband->n_bitrates;
@@ -271,9 +272,11 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
271 /* Authentication Protocol identifier */ 272 /* Authentication Protocol identifier */
272 *pos++ = sdata->u.mesh.mesh_auth_id; 273 *pos++ = sdata->u.mesh.mesh_auth_id;
273 274
274 /* Mesh Formation Info */ 275 /* Mesh Formation Info - number of neighbors */
275 memset(pos, 0x00, 1); 276 neighbors = atomic_read(&sdata->u.mesh.mshstats.estab_plinks);
276 pos += 1; 277 /* Number of neighbor mesh STAs or 15 whichever is smaller */
278 neighbors = (neighbors > 15) ? 15 : neighbors;
279 *pos++ = neighbors << 1;
277 280
278 /* Mesh capability */ 281 /* Mesh capability */
279 sdata->u.mesh.accepting_plinks = mesh_plink_availables(sdata); 282 sdata->u.mesh.accepting_plinks = mesh_plink_availables(sdata);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index ffcbad75e09b..f98c8d23f581 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -65,6 +65,7 @@ void mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata)
65{ 65{
66 atomic_inc(&sdata->u.mesh.mshstats.estab_plinks); 66 atomic_inc(&sdata->u.mesh.mshstats.estab_plinks);
67 mesh_accept_plinks_update(sdata); 67 mesh_accept_plinks_update(sdata);
68 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
68} 69}
69 70
70static inline 71static inline
@@ -72,6 +73,7 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
72{ 73{
73 atomic_dec(&sdata->u.mesh.mshstats.estab_plinks); 74 atomic_dec(&sdata->u.mesh.mshstats.estab_plinks);
74 mesh_accept_plinks_update(sdata); 75 mesh_accept_plinks_update(sdata);
76 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
75} 77}
76 78
77/** 79/**