summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/key.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-09-08 07:04:54 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2010-09-16 19:19:45 (GMT)
commit117675d06ad2dd16fcf466669ba9700a8d589ea3 (patch)
treeb8239f2eea26890607b3adfe5115022573a59c32 /drivers/net/wireless/ath/key.c
parentd8878f83cf1cc0061e8b3bcf7dbd589410a51039 (diff)
downloadlinux-fsl-qoriq-117675d06ad2dd16fcf466669ba9700a8d589ea3.tar.xz
ath/ath9k: Replace common->splitmic with a flag
Replace common->splitmic with ATH_CRYPT_CAP_MIC_COMBINED flag. splitmic has to be used when the ATH_CRYPT_CAP_MIC_COMBINED capability flag is not set. Signed-off-by: Bruno Randolf <br1@einfach.org> Acked-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/key.c')
-rw-r--r--drivers/net/wireless/ath/key.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/key.c b/drivers/net/wireless/ath/key.c
index e45b854..bd21a4d 100644
--- a/drivers/net/wireless/ath/key.c
+++ b/drivers/net/wireless/ath/key.c
@@ -201,7 +201,7 @@ bool ath_hw_set_keycache_entry(struct ath_common *common, u16 entry,
/* Write MAC address for the entry */
(void) ath_hw_keysetmac(common, entry, mac);
- if (common->splitmic == 0) {
+ if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) {
/*
* TKIP uses two key cache entries:
* Michael MIC TX/RX keys in the same key cache entry
@@ -327,7 +327,7 @@ static int ath_setkey_tkip(struct ath_common *common, u16 keyix, const u8 *key,
}
return ath_hw_set_keycache_entry(common, keyix, hk, addr);
}
- if (!common->splitmic) {
+ if (common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) {
/* TX and RX keys share the same key cache entry. */
memcpy(hk->kv_mic, key_rxmic, sizeof(hk->kv_mic));
memcpy(hk->kv_txmic, key_txmic, sizeof(hk->kv_txmic));
@@ -358,7 +358,7 @@ static int ath_reserve_key_cache_slot_tkip(struct ath_common *common)
if (test_bit(i, common->keymap) ||
test_bit(i + 64, common->keymap))
continue; /* At least one part of TKIP key allocated */
- if (common->splitmic &&
+ if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED) &&
(test_bit(i + 32, common->keymap) ||
test_bit(i + 64 + 32, common->keymap)))
continue; /* At least one part of TKIP key allocated */
@@ -378,7 +378,7 @@ static int ath_reserve_key_cache_slot(struct ath_common *common,
return ath_reserve_key_cache_slot_tkip(common);
/* First, try to find slots that would not be available for TKIP. */
- if (common->splitmic) {
+ if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
for (i = IEEE80211_WEP_NKID; i < common->keymax / 4; i++) {
if (!test_bit(i, common->keymap) &&
(test_bit(i + 32, common->keymap) ||
@@ -419,7 +419,7 @@ static int ath_reserve_key_cache_slot(struct ath_common *common,
* TKIP will not be used. */
if (i >= 64 && i < 64 + IEEE80211_WEP_NKID)
continue;
- if (common->splitmic) {
+ if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
if (i >= 32 && i < 32 + IEEE80211_WEP_NKID)
continue;
if (i >= 64 + 32 && i < 64 + 32 + IEEE80211_WEP_NKID)
@@ -526,7 +526,7 @@ int ath_key_config(struct ath_common *common,
set_bit(idx + 64, common->keymap);
set_bit(idx, common->tkip_keymap);
set_bit(idx + 64, common->tkip_keymap);
- if (common->splitmic) {
+ if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
set_bit(idx + 32, common->keymap);
set_bit(idx + 64 + 32, common->keymap);
set_bit(idx + 32, common->tkip_keymap);
@@ -556,7 +556,7 @@ void ath_key_delete(struct ath_common *common, struct ieee80211_key_conf *key)
clear_bit(key->hw_key_idx, common->tkip_keymap);
clear_bit(key->hw_key_idx + 64, common->tkip_keymap);
- if (common->splitmic) {
+ if (!(common->crypt_caps & ATH_CRYPT_CAP_MIC_COMBINED)) {
ath_hw_keyreset(common, key->hw_key_idx + 32);
clear_bit(key->hw_key_idx + 32, common->keymap);
clear_bit(key->hw_key_idx + 64 + 32, common->keymap);