nfsd: Revert "svcrpc: take advantage of tcp autotuning"
[safe/jmp/linux-2.6] / net / mac80211 / main.c
index 5667f4e..1413419 100644 (file)
@@ -161,17 +161,12 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
        if (WARN_ON(!netif_running(sdata->dev)))
                return 0;
 
-       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
-               return -EINVAL;
-
-       if (!local->ops->config_interface)
-               return 0;
-
        memset(&conf, 0, sizeof(conf));
 
-       if (sdata->vif.type == NL80211_IFTYPE_STATION ||
-           sdata->vif.type == NL80211_IFTYPE_ADHOC)
-               conf.bssid = sdata->u.sta.bssid;
+       if (sdata->vif.type == NL80211_IFTYPE_STATION)
+               conf.bssid = sdata->u.mgd.bssid;
+       else if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+               conf.bssid = sdata->u.ibss.bssid;
        else if (sdata->vif.type == NL80211_IFTYPE_AP)
                conf.bssid = sdata->dev->dev_addr;
        else if (ieee80211_vif_is_mesh(&sdata->vif)) {
@@ -182,6 +177,9 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
                return -EINVAL;
        }
 
+       if (!local->ops->config_interface)
+               return 0;
+
        switch (sdata->vif.type) {
        case NL80211_IFTYPE_AP:
        case NL80211_IFTYPE_ADHOC:
@@ -210,7 +208,7 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
                                        !!rcu_dereference(sdata->u.ap.beacon);
                                break;
                        case NL80211_IFTYPE_ADHOC:
-                               conf.enable_beacon = !!sdata->u.sta.probe_resp;
+                               conf.enable_beacon = !!sdata->u.ibss.probe_resp;
                                break;
                        case NL80211_IFTYPE_MESH_POINT:
                                conf.enable_beacon = true;
@@ -223,9 +221,6 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
                }
        }
 
-       if (WARN_ON(!conf.bssid && (changed & IEEE80211_IFCC_BSSID)))
-               return -EINVAL;
-
        conf.changed = changed;
 
        return local->ops->config_interface(local_to_hw(local),
@@ -263,7 +258,7 @@ int ieee80211_hw_config(struct ieee80211_local *local, u32 changed)
                        (chan->max_power - local->power_constr_level) :
                        chan->max_power;
 
-       if (local->user_power_level)
+       if (local->user_power_level >= 0)
                power = min(power, local->user_power_level);
 
        if (local->hw.conf.power_level != power) {
@@ -705,7 +700,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
                                        const struct ieee80211_ops *ops)
 {
        struct ieee80211_local *local;
-       int priv_size;
+       int priv_size, i;
        struct wiphy *wiphy;
 
        /* Ensure 32-byte alignment of our private data and hw private data.
@@ -762,6 +757,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        local->hw.conf.long_frame_max_tx_count = 4;
        local->hw.conf.short_frame_max_tx_count = 7;
        local->hw.conf.radio_enabled = true;
+       local->user_power_level = -1;
 
        INIT_LIST_HEAD(&local->interfaces);
        mutex_init(&local->iflist_mtx);
@@ -781,6 +777,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
 
        sta_info_init(local);
 
+       for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
+               skb_queue_head_init(&local->pending[i]);
        tasklet_init(&local->tx_pending_tasklet, ieee80211_tx_pending,
                     (unsigned long)local);
        tasklet_disable(&local->tx_pending_tasklet);
@@ -793,6 +791,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
        skb_queue_head_init(&local->skb_queue);
        skb_queue_head_init(&local->skb_queue_unreliable);
 
+       spin_lock_init(&local->ampdu_lock);
+
        return local_to_hw(local);
 }
 EXPORT_SYMBOL(ieee80211_alloc_hw);
@@ -855,6 +855,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        /* mac80211 always supports monitor */
        local->hw.wiphy->interface_modes |= BIT(NL80211_IFTYPE_MONITOR);
 
+       if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
+               local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+       else if (local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)
+               local->hw.wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;
+
        result = wiphy_register(local->hw.wiphy);
        if (result < 0)
                goto fail_wiphy_register;
@@ -865,14 +870,10 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
         */
        if (hw->queues > IEEE80211_MAX_QUEUES)
                hw->queues = IEEE80211_MAX_QUEUES;
-       if (hw->ampdu_queues > IEEE80211_MAX_AMPDU_QUEUES)
-               hw->ampdu_queues = IEEE80211_MAX_AMPDU_QUEUES;
-       if (hw->queues < 4)
-               hw->ampdu_queues = 0;
 
        mdev = alloc_netdev_mq(sizeof(struct ieee80211_master_priv),
                               "wmaster%d", ieee80211_master_setup,
-                              ieee80211_num_queues(hw));
+                              hw->queues);
        if (!mdev)
                goto fail_mdev_alloc;
 
@@ -909,6 +910,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        if (result < 0)
                goto fail_sta_info;
 
+       result = ieee80211_wep_init(local);
+       if (result < 0) {
+               printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
+                      wiphy_name(local->hw.wiphy), result);
+               goto fail_wep;
+       }
+
        rtnl_lock();
        result = dev_alloc_name(local->mdev, local->mdev->name);
        if (result < 0)
@@ -916,6 +924,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        memcpy(local->mdev->dev_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
        SET_NETDEV_DEV(local->mdev, wiphy_dev(local->hw.wiphy));
+       local->mdev->features |= NETIF_F_NETNS_LOCAL;
 
        result = register_netdevice(local->mdev);
        if (result < 0)
@@ -929,14 +938,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
                goto fail_rate;
        }
 
-       result = ieee80211_wep_init(local);
-
-       if (result < 0) {
-               printk(KERN_DEBUG "%s: Failed to initialize wep: %d\n",
-                      wiphy_name(local->hw.wiphy), result);
-               goto fail_wep;
-       }
-
        /* add one default STA interface if supported */
        if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION)) {
                result = ieee80211_if_add(local, "wlan%d", NULL,
@@ -966,13 +967,13 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        return 0;
 
-fail_wep:
-       rate_control_deinitialize(local);
 fail_rate:
        unregister_netdevice(local->mdev);
        local->mdev = NULL;
 fail_dev:
        rtnl_unlock();
+       ieee80211_wep_free(local);
+fail_wep:
        sta_info_stop(local);
 fail_sta_info:
        debugfs_hw_del(local);