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/wireless | |
parent | 274bfb8dc5ffa16cb073801bebe76ab7f4e2e73d (diff) | |
download | linux-stable-2ba4b32ecf748d5f45f298fc9677fa46d1dd9aff.tar.gz linux-stable-2ba4b32ecf748d5f45f298fc9677fa46d1dd9aff.tar.bz2 linux-stable-2ba4b32ecf748d5f45f298fc9677fa46d1dd9aff.zip |
lib80211: consolidate crypt init routines
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/lib80211.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/net/wireless/lib80211.c b/net/wireless/lib80211.c index d681721f4acb..97d411f74507 100644 --- a/net/wireless/lib80211.c +++ b/net/wireless/lib80211.c @@ -71,6 +71,44 @@ const char *print_ssid(char *buf, const char *ssid, u8 ssid_len) } EXPORT_SYMBOL(print_ssid); +int lib80211_crypt_info_init(struct lib80211_crypt_info *info, char *name, + spinlock_t *lock) +{ + memset(info, 0, sizeof(*info)); + + info->name = name; + info->lock = lock; + + INIT_LIST_HEAD(&info->crypt_deinit_list); + setup_timer(&info->crypt_deinit_timer, lib80211_crypt_deinit_handler, + (unsigned long)info); + + return 0; +} +EXPORT_SYMBOL(lib80211_crypt_info_init); + +void lib80211_crypt_info_free(struct lib80211_crypt_info *info) +{ + int i; + + lib80211_crypt_quiescing(info); + del_timer_sync(&info->crypt_deinit_timer); + lib80211_crypt_deinit_entries(info, 1); + + for (i = 0; i < NUM_WEP_KEYS; i++) { + struct lib80211_crypt_data *crypt = info->crypt[i]; + if (crypt) { + if (crypt->ops) { + crypt->ops->deinit(crypt->priv); + module_put(crypt->ops->owner); + } + kfree(crypt); + info->crypt[i] = NULL; + } + } +} +EXPORT_SYMBOL(lib80211_crypt_info_free); + void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, int force) { struct lib80211_crypt_data *entry, *next; |