]> err.no Git - linux-2.6/blobdiff - drivers/net/wireless/iwlwifi/iwl-core.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
[linux-2.6] / drivers / net / wireless / iwlwifi / iwl-core.c
index 97447df94d14693d3dc44b24aef2d8895fa81668..9bd61809129f800bfa7ca5ef3ff35482675e0a65 100644 (file)
@@ -383,8 +383,8 @@ void iwl_reset_qos(struct iwl_priv *priv)
 }
 EXPORT_SYMBOL(iwl_reset_qos);
 
-#define MAX_BIT_RATE_40_MHZ 0x96; /* 150 Mbps */
-#define MAX_BIT_RATE_20_MHZ 0x48; /* 72 Mbps */
+#define MAX_BIT_RATE_40_MHZ 0x96 /* 150 Mbps */
+#define MAX_BIT_RATE_20_MHZ 0x48 /* 72 Mbps */
 static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,
                              struct ieee80211_ht_info *ht_info,
                              enum ieee80211_band band)
@@ -495,7 +495,9 @@ static int iwlcore_init_geos(struct iwl_priv *priv)
        sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
        sband->n_bitrates = IWL_RATE_COUNT - IWL_FIRST_OFDM_RATE;
 
-       iwlcore_init_ht_hw_capab(priv, &sband->ht_info, IEEE80211_BAND_5GHZ);
+       if (priv->cfg->sku & IWL_SKU_N)
+               iwlcore_init_ht_hw_capab(priv, &sband->ht_info,
+                                        IEEE80211_BAND_5GHZ);
 
        sband = &priv->bands[IEEE80211_BAND_2GHZ];
        sband->channels = channels;
@@ -503,7 +505,9 @@ static int iwlcore_init_geos(struct iwl_priv *priv)
        sband->bitrates = rates;
        sband->n_bitrates = IWL_RATE_COUNT;
 
-       iwlcore_init_ht_hw_capab(priv, &sband->ht_info, IEEE80211_BAND_2GHZ);
+       if (priv->cfg->sku & IWL_SKU_N)
+               iwlcore_init_ht_hw_capab(priv, &sband->ht_info,
+                                        IEEE80211_BAND_2GHZ);
 
        priv->ieee_channels = channels;
        priv->ieee_rates = rates;
@@ -811,18 +815,19 @@ int iwl_setup_mac(struct iwl_priv *priv)
 {
        int ret;
        struct ieee80211_hw *hw = priv->hw;
-       hw->rate_control_algorithm = "iwl-4965-rs";
+       hw->rate_control_algorithm = "iwl-agn-rs";
 
        /* Tell mac80211 our characteristics */
-       hw->flags = IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE |
-                   IEEE80211_HW_SIGNAL_DBM |
+       hw->flags = IEEE80211_HW_SIGNAL_DBM |
                    IEEE80211_HW_NOISE_DBM;
        /* Default value; 4 EDCA QOS priorities */
        hw->queues = 4;
-       /* Enhanced value; more queues, to support 11n aggregation */
-       hw->ampdu_queues = 12;
+       /* queues to support 11n aggregation */
+       if (priv->cfg->sku & IWL_SKU_N)
+               hw->ampdu_queues = priv->cfg->mod_params->num_of_ampdu_queues;
 
        hw->conf.beacon_int = 100;
+       hw->max_listen_interval = IWL_CONN_MAX_LISTEN_INTERVAL;
 
        if (priv->bands[IEEE80211_BAND_2GHZ].n_channels)
                priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
@@ -853,6 +858,9 @@ int iwl_set_hw_params(struct iwl_priv *priv)
                priv->hw_params.rx_buf_size = IWL_RX_BUF_SIZE_4K;
        priv->hw_params.max_pkt_size = priv->hw_params.rx_buf_size - 256;
 
+       if (priv->cfg->mod_params->disable_11n)
+               priv->cfg->sku &= ~IWL_SKU_N;
+
        /* Device-specific setup */
        return priv->cfg->ops->lib->set_hw_params(priv);
 }
@@ -1399,7 +1407,14 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
        spin_lock_irqsave(&priv->lock, flags);
        iwl_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
 
-       clear_bit(STATUS_RF_KILL_SW, &priv->status);
+       /* If the driver is up it will receive CARD_STATE_NOTIFICATION
+        * notification where it will clear SW rfkill status.
+        * Setting it here would break the handler. Only if the
+        * interface is down we can set here since we don't
+        * receive any further notification.
+        */
+       if (!priv->is_open)
+               clear_bit(STATUS_RF_KILL_SW, &priv->status);
        spin_unlock_irqrestore(&priv->lock, flags);
 
        /* wake up ucode */
@@ -1417,8 +1432,10 @@ int iwl_radio_kill_sw_enable_radio(struct iwl_priv *priv)
                return 0;
        }
 
-       if (priv->is_open)
-               queue_work(priv->workqueue, &priv->restart);
+       /* If the driver is already loaded, it will receive
+        * CARD_STATE_NOTIFICATION notifications and the handler will
+        * call restart to reload the driver.
+        */
        return 1;
 }
 EXPORT_SYMBOL(iwl_radio_kill_sw_enable_radio);