Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6.git] / drivers / net / wireless / iwmc3200wifi / netdev.c
index aea5ccf..092d28a 100644 (file)
 #include <linux/netdevice.h>
 
 #include "iwm.h"
+#include "commands.h"
 #include "cfg80211.h"
 #include "debug.h"
 
 static int iwm_open(struct net_device *ndev)
 {
        struct iwm_priv *iwm = ndev_to_iwm(ndev);
-       int ret = 0;
-
-       if (!test_bit(IWM_RADIO_RFKILL_SW, &iwm->radio))
-               ret = iwm_up(iwm);
 
-       return ret;
+       return iwm_up(iwm);
 }
 
 static int iwm_stop(struct net_device *ndev)
 {
        struct iwm_priv *iwm = ndev_to_iwm(ndev);
-       int ret = 0;
-
-       if (!test_bit(IWM_RADIO_RFKILL_SW, &iwm->radio))
-               ret = iwm_down(iwm);
 
-       return ret;
+       return iwm_down(iwm);
 }
 
 /*
@@ -135,8 +128,20 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev,
        SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
        wdev->netdev = ndev;
 
+       iwm->umac_profile = kmalloc(sizeof(struct iwm_umac_profile),
+                                   GFP_KERNEL);
+       if (!iwm->umac_profile) {
+               dev_err(dev, "Couldn't alloc memory for profile\n");
+               goto out_profile;
+       }
+
+       iwm_init_default_profile(iwm, iwm->umac_profile);
+
        return iwm;
 
+ out_profile:
+       free_netdev(ndev);
+
  out_priv:
        iwm_priv_deinit(iwm);
 
@@ -152,6 +157,8 @@ void iwm_if_free(struct iwm_priv *iwm)
 
        free_netdev(iwm_to_ndev(iwm));
        iwm_priv_deinit(iwm);
+       kfree(iwm->umac_profile);
+       iwm->umac_profile = NULL;
        iwm_wdev_free(iwm);
 }