All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rui Paulo <rpaulo@gmail.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes@sipsolutions.net>,
	Rui Paulo <rpaulo@gmail.com>
Subject: [PATCH v2 03/20] mac80211: implement the meshconf formation info field
Date: Mon,  9 Nov 2009 23:46:41 +0000	[thread overview]
Message-ID: <1257810418-30075-4-git-send-email-rpaulo@gmail.com> (raw)
In-Reply-To: <1257810418-30075-1-git-send-email-rpaulo@gmail.com>

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>
---
 net/mac80211/mesh.c       |    9 ++++++---
 net/mac80211/mesh_plink.c |    2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index a49a337..7942518 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)
 	struct ieee80211_supported_band *sband;
 	u8 *pos;
 	int len, i, rate;
+	u8 neighbors;
 
 	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
 	len = sband->n_bitrates;
@@ -271,9 +272,11 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
 	/* Authentication Protocol identifier */
 	*pos++ = sdata->u.mesh.mesh_auth_id;
 
-	/* Mesh Formation Info */
-	memset(pos, 0x00, 1);
-	pos += 1;
+	/* Mesh Formation Info - number of neighbors */
+	neighbors = atomic_read(&sdata->u.mesh.mshstats.estab_plinks);
+	/* Number of neighbor mesh STAs or 15 whichever is smaller */
+	neighbors = (neighbors > 15) ? 15 : neighbors;
+	*pos++ = neighbors << 1;
 
 	/* Mesh capability */
 	sdata->u.mesh.accepting_plinks = mesh_plink_availables(sdata);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index ffcbad7..f98c8d2 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)
 {
 	atomic_inc(&sdata->u.mesh.mshstats.estab_plinks);
 	mesh_accept_plinks_update(sdata);
+	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
 }
 
 static inline
@@ -72,6 +73,7 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
 {
 	atomic_dec(&sdata->u.mesh.mshstats.estab_plinks);
 	mesh_accept_plinks_update(sdata);
+	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
 }
 
 /**
-- 
1.5.6.5


  parent reply	other threads:[~2009-11-09 23:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09 23:46 [PATCH v2 00/20] o11s update to latest draft Rui Paulo
2009-11-09 23:46 ` [PATCH v2 01/20] mac80211: update meshconf IE Rui Paulo
2009-11-09 23:46 ` [PATCH v2 02/20] mac80211: set MESH_TTL to 31 Rui Paulo
2009-11-09 23:46 ` Rui Paulo [this message]
2009-11-09 23:59   ` [PATCH v2 03/20] mac80211: implement the meshconf formation info field Johannes Berg
2009-11-09 23:46 ` [PATCH v2 04/20] mac80211: fix typo in a comment Rui Paulo
2009-11-09 23:46 ` [PATCH v2 05/20] mac80211: update peer link management IE and action frames Rui Paulo
2009-11-09 23:46 ` [PATCH v2 06/20] mac80211: update the format of path selection frames Rui Paulo
2009-11-09 23:46 ` [PATCH v2 07/20] mac80211: add MAC80211_VERBOSE_MHWMP_DEBUG Rui Paulo
2009-11-09 23:46 ` [PATCH v2 08/20] mac80211: allow processing of more than one HWMP IE Rui Paulo
2009-11-09 23:46 ` [PATCH v2 09/20] mac80211: improve HWMP debugging Rui Paulo
2009-11-09 23:46 ` [PATCH v2 10/20] mac80211: improve peer link management debugging Rui Paulo
2009-11-09 23:46 ` [PATCH v2 11/20] mac80211: implement RANN processing and forwarding Rui Paulo
2009-11-09 23:57   ` Johannes Berg
2009-11-09 23:46 ` [PATCH v2 12/20] mac80211: update PERR frame format Rui Paulo
2009-11-09 23:46 ` [PATCH v2 13/20] mac80211: properly forward the RANN IE Rui Paulo
2009-11-09 23:46 ` [PATCH v2 14/20] mac80211: set the AID field correctly for mesh peer frames Rui Paulo
2009-11-09 23:46 ` [PATCH v2 15/20] mac80211: fix BSSID setup for beacon frames Rui Paulo
2009-11-09 23:46 ` [PATCH v2 16/20] mac80211: add the DS params to the beacon Rui Paulo
2009-11-09 23:46 ` [PATCH v2 17/20] mac80211: replace "destination" with "target" to follow the spec Rui Paulo
2009-11-09 23:46 ` [PATCH v2 18/20] mac80211: implement a timer to send RANN action frames Rui Paulo
2009-11-09 23:46 ` [PATCH v2 19/20] mac80211: add nl80211/cfg80211 handling of the new mesh root mode option Rui Paulo
2009-11-09 23:46 ` [PATCH v2 20/20] mac80211: update copyrights to 2009 Rui Paulo
2009-11-10  0:05 ` [PATCH v2 00/20] o11s update to latest draft Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257810418-30075-4-git-send-email-rpaulo@gmail.com \
    --to=rpaulo@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.