summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwmc3200wifi/netdev.c
diff options
context:
space:
mode:
authorSamuel Ortiz <samuel.ortiz@intel.com>2009-06-15 23:59:54 +0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 22:57:52 +0400
commit3549716484a95fd16f7fcf8b68699bd4c803b382 (patch)
treef1fd8ce07afec9562f178455a03aacf1faa43dc5 /drivers/net/wireless/iwmc3200wifi/netdev.c
parent191506ecbce03f09f6afa76f1af069574bf99bec (diff)
downloadlinux-3549716484a95fd16f7fcf8b68699bd4c803b382.tar.xz
iwmc3200wifi: cache keys when interface is down
When the interface is down and one sets a WEP key from userspace, we should be able to simply cache it. Since that implies setting part of the profile's security settings, we now alloc/free the umac_profile at probe/remove time, and no longer at interface bring up/down time. Simply resetting it during the latter is enough. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/netdev.c')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/netdev.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index aaa20c6885c8..d4deb4b471e5 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -48,6 +48,7 @@
#include <linux/netdevice.h>
#include "iwm.h"
+#include "commands.h"
#include "cfg80211.h"
#include "debug.h"
@@ -135,8 +136,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);
@@ -153,6 +166,8 @@ void iwm_if_free(struct iwm_priv *iwm)
free_netdev(iwm_to_ndev(iwm));
iwm_wdev_free(iwm);
iwm_priv_deinit(iwm);
+ kfree(iwm->umac_profile);
+ iwm->umac_profile = NULL;
}
int iwm_if_add(struct iwm_priv *iwm)