]> err.no Git - linux-2.6/blobdiff - net/mac80211/ieee80211_iface.c
mac80211: support functions for mesh
[linux-2.6] / net / mac80211 / ieee80211_iface.c
index f66f1ddc3fda0d11200548350cd286b48593ff42..9523aeb7103288ce9fdab07e2f918e5cbc11f258 100644 (file)
@@ -165,7 +165,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
                break;
        default:
                printk(KERN_WARNING "%s: %s: Unknown interface type 0x%x",
-                      dev->name, __FUNCTION__, type);
+                      dev->name, __func__, type);
        }
        ieee80211_debugfs_change_if_type(sdata, oldtype);
 }
@@ -193,6 +193,7 @@ void ieee80211_if_reinit(struct net_device *dev)
                /* Remove all virtual interfaces that use this BSS
                 * as their sdata->bss */
                struct ieee80211_sub_if_data *tsdata, *n;
+               struct beacon_data *beacon;
 
                list_for_each_entry_safe(tsdata, n, &local->interfaces, list) {
                        if (tsdata != sdata && tsdata->bss == &sdata->u.ap) {
@@ -210,7 +211,10 @@ void ieee80211_if_reinit(struct net_device *dev)
                        }
                }
 
-               kfree(sdata->u.ap.beacon);
+               beacon = sdata->u.ap.beacon;
+               rcu_assign_pointer(sdata->u.ap.beacon, NULL);
+               synchronize_rcu();
+               kfree(beacon);
 
                while ((skb = skb_dequeue(&sdata->u.ap.ps_bc_buf))) {
                        local->total_ps_buffered--;
@@ -231,6 +235,7 @@ void ieee80211_if_reinit(struct net_device *dev)
 #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
                }
                break;
+       case IEEE80211_IF_TYPE_MESH_POINT:
        case IEEE80211_IF_TYPE_STA:
        case IEEE80211_IF_TYPE_IBSS:
                kfree(sdata->u.sta.extra_ie);