Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[cascardo/linux.git] / drivers / net / wireless / iwlwifi / iwl-agn.c
index cdc07c4..921dc4a 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
+#include <linux/sched.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/wireless.h>
@@ -115,9 +116,6 @@ int iwl_commit_rxon(struct iwl_priv *priv)
 
        /* always get timestamp with Rx frame */
        priv->staging_rxon.flags |= RXON_FLG_TSF2HOST_MSK;
-       /* allow CTS-to-self if possible. this is relevant only for
-        * 5000, but will not damage 4965 */
-       priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;
 
        ret = iwl_check_rxon_cmd(priv);
        if (ret) {
@@ -217,6 +215,13 @@ int iwl_commit_rxon(struct iwl_priv *priv)
                                        "Could not send WEP static key.\n");
                }
 
+               /*
+                * allow CTS-to-self if possible for new association.
+                * this is relevant only for 5000 series and up,
+                * but will not damage 4965
+                */
+               priv->staging_rxon.flags |= RXON_FLG_SELF_CTS_EN;
+
                /* Apply the new configuration
                 * RXON assoc doesn't clear the station table in uCode,
                 */
@@ -3105,8 +3110,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  out_pci_disable_device:
        pci_disable_device(pdev);
  out_ieee80211_free_hw:
-       ieee80211_free_hw(priv->hw);
        iwl_free_traffic_mem(priv);
+       ieee80211_free_hw(priv->hw);
  out:
        return err;
 }