mac80211: move mesh filter adjusting
authorJohannes Berg <johannes.berg@intel.com>
Fri, 3 Dec 2010 08:20:41 +0000 (09:20 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 6 Dec 2010 21:01:28 +0000 (16:01 -0500)
Logically, the filter adjusting belongs with
starting/stopping mesh, not interface up/down,
so move it there.

Tested-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/iface.c
net/mac80211/mesh.c

index 7aa85591dbe764ca8b485759a94922ab4b58520b..96e27f1e79fbe1f2f85b25a2097f4da485cd7e1d 100644 (file)
@@ -197,11 +197,6 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
                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_device *dev, bool coming_up)
                }
 
                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 ieee80211_sub_if_data *sdata,
                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);
index 78a36c79bdcca9c7acf9a9eba991f11fa5d9ba12..0d3234875ac5c7a1fbc39d1bdb38f872930c986d 100644 (file)
@@ -513,6 +513,11 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
        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 ieee80211_sub_if_data *sdata)
 
 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 ieee80211_sub_if_data *sdata)
         * 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,