diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-11-11 16:00:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-21 11:08:17 -0500 |
commit | 2ba4b32ecf748d5f45f298fc9677fa46d1dd9aff (patch) | |
tree | ebdf68be060014d9f5c799cf1cb54462bc896140 /net/ieee80211 | |
parent | 274bfb8dc5ffa16cb073801bebe76ab7f4e2e73d (diff) |
lib80211: consolidate crypt init routines
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index cf21f0bd8569..a2f5616d5b09 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -182,13 +182,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) | |||
182 | 182 | ||
183 | spin_lock_init(&ieee->lock); | 183 | spin_lock_init(&ieee->lock); |
184 | 184 | ||
185 | ieee->crypt_info.name = dev->name; | 185 | lib80211_crypt_info_init(&ieee->crypt_info, dev->name, &ieee->lock); |
186 | ieee->crypt_info.lock = &ieee->lock; | ||
187 | INIT_LIST_HEAD(&ieee->crypt_info.crypt_deinit_list); | ||
188 | setup_timer(&ieee->crypt_info.crypt_deinit_timer, | ||
189 | lib80211_crypt_deinit_handler, | ||
190 | (unsigned long)&ieee->crypt_info); | ||
191 | ieee->crypt_info.crypt_quiesced = 0; | ||
192 | 186 | ||
193 | ieee->wpa_enabled = 0; | 187 | ieee->wpa_enabled = 0; |
194 | ieee->drop_unencrypted = 0; | 188 | ieee->drop_unencrypted = 0; |
@@ -206,23 +200,7 @@ void free_ieee80211(struct net_device *dev) | |||
206 | { | 200 | { |
207 | struct ieee80211_device *ieee = netdev_priv(dev); | 201 | struct ieee80211_device *ieee = netdev_priv(dev); |
208 | 202 | ||
209 | int i; | 203 | lib80211_crypt_info_free(&ieee->crypt_info); |
210 | |||
211 | lib80211_crypt_quiescing(&ieee->crypt_info); | ||
212 | del_timer_sync(&ieee->crypt_info.crypt_deinit_timer); | ||
213 | lib80211_crypt_deinit_entries(&ieee->crypt_info, 1); | ||
214 | |||
215 | for (i = 0; i < WEP_KEYS; i++) { | ||
216 | struct lib80211_crypt_data *crypt = ieee->crypt_info.crypt[i]; | ||
217 | if (crypt) { | ||
218 | if (crypt->ops) { | ||
219 | crypt->ops->deinit(crypt->priv); | ||
220 | module_put(crypt->ops->owner); | ||
221 | } | ||
222 | kfree(crypt); | ||
223 | ieee->crypt_info.crypt[i] = NULL; | ||
224 | } | ||
225 | } | ||
226 | 204 | ||
227 | ieee80211_networks_free(ieee); | 205 | ieee80211_networks_free(ieee); |
228 | free_netdev(dev); | 206 | free_netdev(dev); |