iwlwifi: align set channel with mac80211
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / iwl-core.c
index 9bd6180..0f9f8b6 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/version.h>
 #include <net/mac80211.h>
 
 struct iwl_priv; /* FIXME: remove */
@@ -774,7 +773,7 @@ void iwl_set_rxon_chain(struct iwl_priv *priv)
 EXPORT_SYMBOL(iwl_set_rxon_chain);
 
 /**
- * iwlcore_set_rxon_channel - Set the phymode and channel values in staging RXON
+ * iwl_set_rxon_channel - Set the phymode and channel values in staging RXON
  * @phymode: MODE_IEEE80211A sets to 5.2GHz; all else set to 2.4GHz
  * @channel: Any channel valid for the requested phymode
 
@@ -783,10 +782,11 @@ EXPORT_SYMBOL(iwl_set_rxon_chain);
  * NOTE:  Does not commit to the hardware; it sets appropriate bit fields
  * in the staging RXON flag structure based on the phymode
  */
-int iwl_set_rxon_channel(struct iwl_priv *priv,
-                               enum ieee80211_band band,
-                               u16 channel)
+int iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch)
 {
+       enum ieee80211_band band = ch->band;
+       u16 channel = ieee80211_frequency_to_channel(ch->center_freq);
+
        if (!iwl_get_channel_info(priv, band, channel)) {
                IWL_DEBUG_INFO("Could not set channel to %d [%d]\n",
                               channel, band);
@@ -820,6 +820,10 @@ int iwl_setup_mac(struct iwl_priv *priv)
        /* Tell mac80211 our characteristics */
        hw->flags = IEEE80211_HW_SIGNAL_DBM |
                    IEEE80211_HW_NOISE_DBM;
+       hw->wiphy->interface_modes =
+               BIT(NL80211_IFTYPE_AP) |
+               BIT(NL80211_IFTYPE_STATION) |
+               BIT(NL80211_IFTYPE_ADHOC);
        /* Default value; 4 EDCA QOS priorities */
        hw->queues = 4;
        /* queues to support 11n aggregation */
@@ -877,7 +881,6 @@ int iwl_init_drv(struct iwl_priv *priv)
        spin_lock_init(&priv->power_data.lock);
        spin_lock_init(&priv->sta_lock);
        spin_lock_init(&priv->hcmd_lock);
-       spin_lock_init(&priv->lq_mngr.lock);
 
        INIT_LIST_HEAD(&priv->free_frames);
 
@@ -908,8 +911,6 @@ int iwl_init_drv(struct iwl_priv *priv)
        priv->qos_data.qos_active = 0;
        priv->qos_data.qos_cap.val = 0;
 
-       iwl_set_rxon_channel(priv, IEEE80211_BAND_2GHZ, 6);
-
        priv->rates_mask = IWL_RATES_MASK;
        /* If power management is turned on, default to AC mode */
        priv->power_mode = IWL_POWER_AC;