All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: mesh formation info properly set
@ 2013-05-29 19:21 Jacob Minshall
  2013-05-29 19:52 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Minshall @ 2013-05-29 19:21 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, devel

Max peerings capped at 63 in accordance with IEEE-2012 8.4.2.100.7,
and trigger a beacon regeneration every time the number of peerings
changes. Previously this would only happen if the "accepting peerings"
bit changed.

Signed-off-by: Jacob Minshall <jacob@cozybit.com>
---
 include/linux/ieee80211.h |    1 +
 net/mac80211/mesh.c       |    4 ++--
 net/mac80211/mesh.h       |    6 ++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 06b0ed0..c181f48 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
 #define IEEE80211_MAX_RTS_THRESHOLD	2353
 #define IEEE80211_MAX_AID		2007
 #define IEEE80211_MAX_TIM_LEN		251
+#define IEEE80211_MAX_MESH_PEERINGS	63
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
    6.2.1.1.2.
 
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 6952760..d3e973e 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -271,8 +271,8 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
 	*pos++ = ifmsh->mesh_auth_id;
 	/* Mesh Formation Info - number of neighbors */
 	neighbors = atomic_read(&ifmsh->estab_plinks);
-	/* Number of neighbor mesh STAs or 15 whichever is smaller */
-	neighbors = (neighbors > 15) ? 15 : neighbors;
+	neighbors = (neighbors > IEEE80211_MAX_MESH_PEERINGS) ?
+			IEEE80211_MAX_MESH_PEERINGS : neighbors;
 	*pos++ = neighbors << 1;
 	/* Mesh capability */
 	*pos = IEEE80211_MESHCONF_CAPAB_FORWARDING;
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index da15877..7d0f1df 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -324,14 +324,16 @@ static inline
 u32 mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata)
 {
 	atomic_inc(&sdata->u.mesh.estab_plinks);
-	return mesh_accept_plinks_update(sdata);
+	mesh_accept_plinks_update(sdata);
+	return BSS_CHANGED_BEACON;
 }
 
 static inline
 u32 mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
 {
 	atomic_dec(&sdata->u.mesh.estab_plinks);
-	return mesh_accept_plinks_update(sdata);
+	mesh_accept_plinks_update(sdata);
+	return BSS_CHANGED_BEACON;
 }
 
 static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: mesh formation info properly set
  2013-05-29 19:21 [PATCH] mac80211: mesh formation info properly set Jacob Minshall
@ 2013-05-29 19:52 ` Johannes Berg
  2013-05-29 19:53   ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2013-05-29 19:52 UTC (permalink / raw)
  To: Jacob Minshall; +Cc: linux-wireless, devel

On Wed, 2013-05-29 at 12:21 -0700, Jacob Minshall wrote:
> Max peerings capped at 63 in accordance with IEEE-2012 8.4.2.100.7,
> and trigger a beacon regeneration every time the number of peerings
> changes. 

Can you write full sentences? Maybe also in the subject ("set mesh ...
properly"?) :-)


> -	neighbors = (neighbors > 15) ? 15 : neighbors;
> +	neighbors = (neighbors > IEEE80211_MAX_MESH_PEERINGS) ?
> +			IEEE80211_MAX_MESH_PEERINGS : neighbors;

min() or min_t()?

>  	atomic_inc(&sdata->u.mesh.estab_plinks);
> -	return mesh_accept_plinks_update(sdata);
> +	mesh_accept_plinks_update(sdata);
> +	return BSS_CHANGED_BEACON;

These changes seem odd to me, why doesn't mesh_accept_plinks_update()
just return the change value then?

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: mesh formation info properly set
  2013-05-29 19:52 ` Johannes Berg
@ 2013-05-29 19:53   ` Johannes Berg
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2013-05-29 19:53 UTC (permalink / raw)
  To: Jacob Minshall; +Cc: linux-wireless, devel

On Wed, 2013-05-29 at 21:52 +0200, Johannes Berg wrote:

> >  	atomic_inc(&sdata->u.mesh.estab_plinks);
> > -	return mesh_accept_plinks_update(sdata);
> > +	mesh_accept_plinks_update(sdata);
> > +	return BSS_CHANGED_BEACON;
> 
> These changes seem odd to me, why doesn't mesh_accept_plinks_update()
> just return the change value then?

Oh wait, n/m, but shouldn't you have something like

	return mesh_accept_...(...) | BSS_CHANGED_BEACON;

?

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-29 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 19:21 [PATCH] mac80211: mesh formation info properly set Jacob Minshall
2013-05-29 19:52 ` Johannes Berg
2013-05-29 19:53   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.