linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Javier Cardona <javier@cozybit.com>,
	Steve Derosier <steve@cozybit.com>,
	devel@lists.open80211s.org
Subject: [RFC 2/5] mac80211: move mesh filter adjusting
Date: Wed, 01 Dec 2010 21:59:41 +0100	[thread overview]
Message-ID: <20101201210225.543887760@sipsolutions.net> (raw)
In-Reply-To: 20101201205939.009530439@sipsolutions.net

From: Johannes Berg <johannes.berg@intel.com>

Logically, the filter adjusting belongs with
starting/stopping mesh, not interface up/down,
so move it there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/iface.c |   18 +-----------------
 net/mac80211/mesh.c  |   11 +++++++++++
 2 files changed, 12 insertions(+), 17 deletions(-)

--- wireless-testing.orig/net/mac80211/iface.c	2010-12-01 20:24:46.000000000 +0100
+++ wireless-testing/net/mac80211/iface.c	2010-12-01 20:28:08.000000000 +0100
@@ -197,11 +197,6 @@ static int ieee80211_do_open(struct net_
 		sdata->bss = &sdata->u.ap;
 		break;
 	case NL80211_IFTYPE_MESH_POINT:
-		if (!ieee80211_vif_is_mesh(&sdata->vif))
-			break;
-		/* mesh ifaces must set allmulti to forward mcast traffic */
-		atomic_inc(&local->iff_allmultis);
-		break;
 	case NL80211_IFTYPE_STATION:
 	case NL80211_IFTYPE_MONITOR:
 	case NL80211_IFTYPE_ADHOC:
@@ -274,9 +269,6 @@ static int ieee80211_do_open(struct net_
 		}
 
 		if (ieee80211_vif_is_mesh(&sdata->vif)) {
-			local->fif_other_bss++;
-			ieee80211_configure_filter(local);
-
 			ieee80211_start_mesh(sdata);
 		} else if (sdata->vif.type == NL80211_IFTYPE_AP) {
 			local->fif_pspoll++;
@@ -504,16 +496,8 @@ static void ieee80211_do_stop(struct iee
 		ieee80211_configure_filter(local);
 		break;
 	case NL80211_IFTYPE_MESH_POINT:
-		if (ieee80211_vif_is_mesh(&sdata->vif)) {
-			/* other_bss and allmulti are always set on mesh
-			 * ifaces */
-			local->fif_other_bss--;
-			atomic_dec(&local->iff_allmultis);
-
-			ieee80211_configure_filter(local);
-
+		if (ieee80211_vif_is_mesh(&sdata->vif))
 			ieee80211_stop_mesh(sdata);
-		}
 		/* fall through */
 	default:
 		flush_work(&sdata->work);
--- wireless-testing.orig/net/mac80211/mesh.c	2010-12-01 20:24:46.000000000 +0100
+++ wireless-testing/net/mac80211/mesh.c	2010-12-01 20:29:36.000000000 +0100
@@ -513,6 +513,11 @@ void ieee80211_start_mesh(struct ieee802
 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
 	struct ieee80211_local *local = sdata->local;
 
+	local->fif_other_bss++;
+	/* mesh ifaces must set allmulti to forward mcast traffic */
+	atomic_inc(&local->iff_allmultis);
+	ieee80211_configure_filter(local);
+
 	set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
 	ieee80211_mesh_root_setup(ifmsh);
 	ieee80211_queue_work(&local->hw, &sdata->work);
@@ -524,6 +529,8 @@ void ieee80211_start_mesh(struct ieee802
 
 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 {
+	struct ieee80211_local *local = sdata->local;
+
 	del_timer_sync(&sdata->u.mesh.housekeeping_timer);
 	del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
 	/*
@@ -534,6 +541,10 @@ void ieee80211_stop_mesh(struct ieee8021
 	 * it no longer is.
 	 */
 	cancel_work_sync(&sdata->work);
+
+	local->fif_other_bss--;
+	atomic_dec(&local->iff_allmultis);
+	ieee80211_configure_filter(local);
 }
 
 static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,



  parent reply	other threads:[~2010-12-01 21:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 20:59 [RFC 0/5] mesh join/leave API Johannes Berg
2010-12-01 20:59 ` [RFC 1/5] mac80211: use configured mesh TTL Johannes Berg
2010-12-01 20:59 ` Johannes Berg [this message]
2010-12-01 20:59 ` [RFC 3/5] cfg80211: require add_virtual_intf to return new dev Johannes Berg
2010-12-01 20:59 ` [RFC 4/5] nl80211: refactor mesh parameter parsing Johannes Berg
2010-12-02  8:34   ` [RFC 4/5 v2] " Johannes Berg
2010-12-01 20:59 ` [RFC 5/5] cfg80211/mac80211: add mesh join/leave commands Johannes Berg
2010-12-01 21:15   ` Johannes Berg
2010-12-02  0:23   ` Javier Cardona
2010-12-02  6:57     ` Johannes Berg
2010-12-02  8:45   ` [RFC 5/5 v2] " Johannes Berg
2010-12-02 20:09     ` Javier Cardona
2010-12-02 20:14       ` Johannes Berg
2010-12-02 21:24         ` Javier Cardona
2010-12-02 21:38           ` Johannes Berg
2010-12-02 23:08             ` Javier Cardona
2010-12-03  8:13               ` 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=20101201210225.543887760@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=steve@cozybit.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).