diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-05 17:09:28 -0400 |
commit | 90864fbc7639d7a2300c67a18c9fb9fbcf7d51d2 (patch) | |
tree | 6951c8d0e529dbfc7c4cec75d4cec63350e39b7c /net/mac80211/key.c | |
parent | 228e548e602061b08ee8e8966f567c12aa079682 (diff) | |
parent | a70171dce9cd44cb06c7d299eba9fa87a8933045 (diff) |
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r-- | net/mac80211/key.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index af3c56482c80..b510721e3b3d 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -101,6 +101,11 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key) | |||
101 | 101 | ||
102 | if (!ret) { | 102 | if (!ret) { |
103 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; | 103 | key->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE; |
104 | |||
105 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || | ||
106 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))) | ||
107 | key->local->crypto_tx_tailroom_needed_cnt--; | ||
108 | |||
104 | return 0; | 109 | return 0; |
105 | } | 110 | } |
106 | 111 | ||
@@ -156,6 +161,10 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) | |||
156 | key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); | 161 | key->conf.keyidx, sta ? sta->addr : bcast_addr, ret); |
157 | 162 | ||
158 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; | 163 | key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; |
164 | |||
165 | if (!((key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_MMIC) || | ||
166 | (key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))) | ||
167 | key->local->crypto_tx_tailroom_needed_cnt++; | ||
159 | } | 168 | } |
160 | 169 | ||
161 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf) | 170 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf) |
@@ -388,8 +397,10 @@ static void __ieee80211_key_destroy(struct ieee80211_key *key) | |||
388 | ieee80211_aes_key_free(key->u.ccmp.tfm); | 397 | ieee80211_aes_key_free(key->u.ccmp.tfm); |
389 | if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) | 398 | if (key->conf.cipher == WLAN_CIPHER_SUITE_AES_CMAC) |
390 | ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); | 399 | ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm); |
391 | if (key->local) | 400 | if (key->local) { |
392 | ieee80211_debugfs_key_remove(key); | 401 | ieee80211_debugfs_key_remove(key); |
402 | key->local->crypto_tx_tailroom_needed_cnt--; | ||
403 | } | ||
393 | 404 | ||
394 | kfree(key); | 405 | kfree(key); |
395 | } | 406 | } |
@@ -451,6 +462,8 @@ int ieee80211_key_link(struct ieee80211_key *key, | |||
451 | 462 | ||
452 | ieee80211_debugfs_key_add(key); | 463 | ieee80211_debugfs_key_add(key); |
453 | 464 | ||
465 | key->local->crypto_tx_tailroom_needed_cnt++; | ||
466 | |||
454 | ret = ieee80211_key_enable_hw_accel(key); | 467 | ret = ieee80211_key_enable_hw_accel(key); |
455 | 468 | ||
456 | mutex_unlock(&sdata->local->key_mtx); | 469 | mutex_unlock(&sdata->local->key_mtx); |
@@ -492,8 +505,12 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata) | |||
492 | 505 | ||
493 | mutex_lock(&sdata->local->key_mtx); | 506 | mutex_lock(&sdata->local->key_mtx); |
494 | 507 | ||
495 | list_for_each_entry(key, &sdata->key_list, list) | 508 | sdata->local->crypto_tx_tailroom_needed_cnt = 0; |
509 | |||
510 | list_for_each_entry(key, &sdata->key_list, list) { | ||
511 | sdata->local->crypto_tx_tailroom_needed_cnt++; | ||
496 | ieee80211_key_enable_hw_accel(key); | 512 | ieee80211_key_enable_hw_accel(key); |
513 | } | ||
497 | 514 | ||
498 | mutex_unlock(&sdata->local->key_mtx); | 515 | mutex_unlock(&sdata->local->key_mtx); |
499 | } | 516 | } |