diff options
author | John W. Linville <linville@tuxdriver.com> | 2008-10-29 11:35:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-21 11:08:17 -0500 |
commit | 274bfb8dc5ffa16cb073801bebe76ab7f4e2e73d (patch) | |
tree | 04cd3f6a062496911b56737daa6a0858b769ccd6 /net/ieee80211/ieee80211_module.c | |
parent | dfe1bafdbac1c7b48b636fb7ace799e78170e0d6 (diff) |
lib80211: absorb crypto bits from net/ieee80211
These bits are shared already between ipw2x00 and hostap, and could
probably be shared both more cleanly and with other drivers. This
commit simply relocates the code to lib80211 and adjusts the drivers
appropriately.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/ieee80211/ieee80211_module.c')
-rw-r--r-- | net/ieee80211/ieee80211_module.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c index d34d4e79b6f7..cf21f0bd8569 100644 --- a/net/ieee80211/ieee80211_module.c +++ b/net/ieee80211/ieee80211_module.c | |||
@@ -180,13 +180,16 @@ struct net_device *alloc_ieee80211(int sizeof_priv) | |||
180 | ieee->host_open_frag = 1; | 180 | ieee->host_open_frag = 1; |
181 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ | 181 | ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ |
182 | 182 | ||
183 | INIT_LIST_HEAD(&ieee->crypt_deinit_list); | ||
184 | setup_timer(&ieee->crypt_deinit_timer, ieee80211_crypt_deinit_handler, | ||
185 | (unsigned long)ieee); | ||
186 | ieee->crypt_quiesced = 0; | ||
187 | |||
188 | spin_lock_init(&ieee->lock); | 183 | spin_lock_init(&ieee->lock); |
189 | 184 | ||
185 | ieee->crypt_info.name = dev->name; | ||
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 | |||
190 | ieee->wpa_enabled = 0; | 193 | ieee->wpa_enabled = 0; |
191 | ieee->drop_unencrypted = 0; | 194 | ieee->drop_unencrypted = 0; |
192 | ieee->privacy_invoked = 0; | 195 | ieee->privacy_invoked = 0; |
@@ -205,19 +208,19 @@ void free_ieee80211(struct net_device *dev) | |||
205 | 208 | ||
206 | int i; | 209 | int i; |
207 | 210 | ||
208 | ieee80211_crypt_quiescing(ieee); | 211 | lib80211_crypt_quiescing(&ieee->crypt_info); |
209 | del_timer_sync(&ieee->crypt_deinit_timer); | 212 | del_timer_sync(&ieee->crypt_info.crypt_deinit_timer); |
210 | ieee80211_crypt_deinit_entries(ieee, 1); | 213 | lib80211_crypt_deinit_entries(&ieee->crypt_info, 1); |
211 | 214 | ||
212 | for (i = 0; i < WEP_KEYS; i++) { | 215 | for (i = 0; i < WEP_KEYS; i++) { |
213 | struct ieee80211_crypt_data *crypt = ieee->crypt[i]; | 216 | struct lib80211_crypt_data *crypt = ieee->crypt_info.crypt[i]; |
214 | if (crypt) { | 217 | if (crypt) { |
215 | if (crypt->ops) { | 218 | if (crypt->ops) { |
216 | crypt->ops->deinit(crypt->priv); | 219 | crypt->ops->deinit(crypt->priv); |
217 | module_put(crypt->ops->owner); | 220 | module_put(crypt->ops->owner); |
218 | } | 221 | } |
219 | kfree(crypt); | 222 | kfree(crypt); |
220 | ieee->crypt[i] = NULL; | 223 | ieee->crypt_info.crypt[i] = NULL; |
221 | } | 224 | } |
222 | } | 225 | } |
223 | 226 | ||