iwlwifi: add missing rcu_read_lock
[safe/jmp/linux-2.6] / drivers / net / wireless / mac80211_hwsim.c
index 79bb883..6f8cb3e 100644 (file)
@@ -14,6 +14,7 @@
  */
 
 #include <linux/list.h>
+#include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <net/dst.h>
 #include <net/xfrm.h>
@@ -651,17 +652,17 @@ static void mac80211_hwsim_beacon(unsigned long arg)
        add_timer(&data->beacon_timer);
 }
 
+static const char *hwsim_chantypes[] = {
+       [NL80211_CHAN_NO_HT] = "noht",
+       [NL80211_CHAN_HT20] = "ht20",
+       [NL80211_CHAN_HT40MINUS] = "ht40-",
+       [NL80211_CHAN_HT40PLUS] = "ht40+",
+};
 
 static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
 {
        struct mac80211_hwsim_data *data = hw->priv;
        struct ieee80211_conf *conf = &hw->conf;
-       static const char *chantypes[4] = {
-               [NL80211_CHAN_NO_HT] = "noht",
-               [NL80211_CHAN_HT20] = "ht20",
-               [NL80211_CHAN_HT40MINUS] = "ht40-",
-               [NL80211_CHAN_HT40PLUS] = "ht40+",
-       };
        static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = {
                [IEEE80211_SMPS_AUTOMATIC] = "auto",
                [IEEE80211_SMPS_OFF] = "off",
@@ -672,7 +673,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
        printk(KERN_DEBUG "%s:%s (freq=%d/%s idle=%d ps=%d smps=%s)\n",
               wiphy_name(hw->wiphy), __func__,
               conf->channel->center_freq,
-              chantypes[conf->channel_type],
+              hwsim_chantypes[conf->channel_type],
               !!(conf->flags & IEEE80211_CONF_IDLE),
               !!(conf->flags & IEEE80211_CONF_PS),
               smps_modes[conf->smps_mode]);
@@ -760,9 +761,10 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
        }
 
        if (changed & BSS_CHANGED_HT) {
-               printk(KERN_DEBUG "  %s: HT: op_mode=0x%x\n",
+               printk(KERN_DEBUG "  %s: HT: op_mode=0x%x, chantype=%s\n",
                       wiphy_name(hw->wiphy),
-                      info->ht_operation_mode);
+                      info->ht_operation_mode,
+                      hwsim_chantypes[info->channel_type]);
        }
 
        if (changed & BSS_CHANGED_BASIC_RATES) {
@@ -973,6 +975,7 @@ static void hw_scan_done(struct work_struct *work)
 }
 
 static int mac80211_hwsim_hw_scan(struct ieee80211_hw *hw,
+                                 struct ieee80211_vif *vif,
                                  struct cfg80211_scan_request *req)
 {
        struct hw_scan_done *hsd = kzalloc(sizeof(*hsd), GFP_KERNEL);
@@ -1019,7 +1022,7 @@ static void mac80211_hwsim_sw_scan_complete(struct ieee80211_hw *hw)
        mutex_lock(&hwsim->mutex);
 
        printk(KERN_DEBUG "hwsim sw_scan_complete\n");
-       hwsim->scanning = true;
+       hwsim->scanning = false;
 
        mutex_unlock(&hwsim->mutex);
 }
@@ -1298,7 +1301,8 @@ static int __init init_mac80211_hwsim(void)
                hw->flags = IEEE80211_HW_MFP_CAPABLE |
                            IEEE80211_HW_SIGNAL_DBM |
                            IEEE80211_HW_SUPPORTS_STATIC_SMPS |
-                           IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS;
+                           IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
+                           IEEE80211_HW_AMPDU_AGGREGATION;
 
                /* ask mac80211 to reserve space for magic */
                hw->vif_data_size = sizeof(struct hwsim_vif_priv);