]> 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 be96aa84c79a4f9481d65eafd3b0c2c6d7495b6d..9523aeb7103288ce9fdab07e2f918e5cbc11f258 100644 (file)
@@ -118,6 +118,8 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
        sdata->bss = NULL;
        sdata->vif.type = type;
 
+       sdata->basic_rates = 0;
+
        switch (type) {
        case IEEE80211_IF_TYPE_WDS:
                /* nothing special */
@@ -126,7 +128,6 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
                sdata->u.vlan.ap = NULL;
                break;
        case IEEE80211_IF_TYPE_AP:
-               sdata->u.ap.dtim_period = 2;
                sdata->u.ap.force_unicast_rateidx = -1;
                sdata->u.ap.max_ratectrl_rateidx = -1;
                skb_queue_head_init(&sdata->u.ap.ps_bc_buf);
@@ -159,10 +160,12 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
        case IEEE80211_IF_TYPE_MNTR:
                dev->type = ARPHRD_IEEE80211_RADIOTAP;
                dev->hard_start_xmit = ieee80211_monitor_start_xmit;
+               sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
+                                     MONITOR_FLAG_OTHER_BSS;
                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);
 }
@@ -190,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) {
@@ -207,8 +211,10 @@ void ieee80211_if_reinit(struct net_device *dev)
                        }
                }
 
-               kfree(sdata->u.ap.beacon_head);
-               kfree(sdata->u.ap.beacon_tail);
+               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--;
@@ -229,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);