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/lib80211.c | |
parent | 274bfb8dc5ffa16cb073801bebe76ab7f4e2e73d (diff) |
lib80211: consolidate crypt init routines
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/lib80211.c')
-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) | |||
71 | } | 71 | } |
72 | EXPORT_SYMBOL(print_ssid); | 72 | EXPORT_SYMBOL(print_ssid); |
73 | 73 | ||
74 | int lib80211_crypt_info_init(struct lib80211_crypt_info *info, char *name, | ||
75 | spinlock_t *lock) | ||
76 | { | ||
77 | memset(info, 0, sizeof(*info)); | ||
78 | |||
79 | info->name = name; | ||
80 | info->lock = lock; | ||
81 | |||
82 | INIT_LIST_HEAD(&info->crypt_deinit_list); | ||
83 | setup_timer(&info->crypt_deinit_timer, lib80211_crypt_deinit_handler, | ||
84 | (unsigned long)info); | ||
85 | |||
86 | return 0; | ||
87 | } | ||
88 | EXPORT_SYMBOL(lib80211_crypt_info_init); | ||
89 | |||
90 | void lib80211_crypt_info_free(struct lib80211_crypt_info *info) | ||
91 | { | ||
92 | int i; | ||
93 | |||
94 | lib80211_crypt_quiescing(info); | ||
95 | del_timer_sync(&info->crypt_deinit_timer); | ||
96 | lib80211_crypt_deinit_entries(info, 1); | ||
97 | |||
98 | for (i = 0; i < NUM_WEP_KEYS; i++) { | ||
99 | struct lib80211_crypt_data *crypt = info->crypt[i]; | ||
100 | if (crypt) { | ||
101 | if (crypt->ops) { | ||
102 | crypt->ops->deinit(crypt->priv); | ||
103 | module_put(crypt->ops->owner); | ||
104 | } | ||
105 | kfree(crypt); | ||
106 | info->crypt[i] = NULL; | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | EXPORT_SYMBOL(lib80211_crypt_info_free); | ||
111 | |||
74 | void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, int force) | 112 | void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *info, int force) |
75 | { | 113 | { |
76 | struct lib80211_crypt_data *entry, *next; | 114 | struct lib80211_crypt_data *entry, *next; |