diff options
author | Samuel Ortiz <samuel.ortiz@intel.com> | 2009-06-15 15:59:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 14:57:52 -0400 |
commit | 3549716484a95fd16f7fcf8b68699bd4c803b382 (patch) | |
tree | f1fd8ce07afec9562f178455a03aacf1faa43dc5 /drivers/net/wireless/iwmc3200wifi/netdev.c | |
parent | 191506ecbce03f09f6afa76f1af069574bf99bec (diff) |
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.c | 15 |
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 @@ | |||
48 | #include <linux/netdevice.h> | 48 | #include <linux/netdevice.h> |
49 | 49 | ||
50 | #include "iwm.h" | 50 | #include "iwm.h" |
51 | #include "commands.h" | ||
51 | #include "cfg80211.h" | 52 | #include "cfg80211.h" |
52 | #include "debug.h" | 53 | #include "debug.h" |
53 | 54 | ||
@@ -135,8 +136,20 @@ void *iwm_if_alloc(int sizeof_bus, struct device *dev, | |||
135 | SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy)); | 136 | SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy)); |
136 | wdev->netdev = ndev; | 137 | wdev->netdev = ndev; |
137 | 138 | ||
139 | iwm->umac_profile = kmalloc(sizeof(struct iwm_umac_profile), | ||
140 | GFP_KERNEL); | ||
141 | if (!iwm->umac_profile) { | ||
142 | dev_err(dev, "Couldn't alloc memory for profile\n"); | ||
143 | goto out_profile; | ||
144 | } | ||
145 | |||
146 | iwm_init_default_profile(iwm, iwm->umac_profile); | ||
147 | |||
138 | return iwm; | 148 | return iwm; |
139 | 149 | ||
150 | out_profile: | ||
151 | free_netdev(ndev); | ||
152 | |||
140 | out_priv: | 153 | out_priv: |
141 | iwm_priv_deinit(iwm); | 154 | iwm_priv_deinit(iwm); |
142 | 155 | ||
@@ -153,6 +166,8 @@ void iwm_if_free(struct iwm_priv *iwm) | |||
153 | free_netdev(iwm_to_ndev(iwm)); | 166 | free_netdev(iwm_to_ndev(iwm)); |
154 | iwm_wdev_free(iwm); | 167 | iwm_wdev_free(iwm); |
155 | iwm_priv_deinit(iwm); | 168 | iwm_priv_deinit(iwm); |
169 | kfree(iwm->umac_profile); | ||
170 | iwm->umac_profile = NULL; | ||
156 | } | 171 | } |
157 | 172 | ||
158 | int iwm_if_add(struct iwm_priv *iwm) | 173 | int iwm_if_add(struct iwm_priv *iwm) |