From 26a98fca55930bddaa98a36de6c1c1694eb079d5 Mon Sep 17 00:00:00 2001 From: Senthil Balasubramanian Date: Mon, 1 Sep 2008 19:45:21 +0530 Subject: [PATCH] --- yaml --- r: 109440 b: refs/heads/master c: 1b96175b7e5801a908718d8b5270a4f7d94fed28 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/ath9k/hw.c | 8 ++++---- trunk/drivers/net/wireless/ath9k/main.c | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 3df91f901135..17895b3e67fc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 445df54fec7c1924f44018c4db2a9613b877f10e +refs/heads/master: 1b96175b7e5801a908718d8b5270a4f7d94fed28 diff --git a/trunk/drivers/net/wireless/ath9k/hw.c b/trunk/drivers/net/wireless/ath9k/hw.c index a17eb130f574..6dbfed0b4149 100644 --- a/trunk/drivers/net/wireless/ath9k/hw.c +++ b/trunk/drivers/net/wireless/ath9k/hw.c @@ -7285,15 +7285,15 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, } break; case ATH9K_CIPHER_WEP: - if (k->kv_len < 40 / NBBY) { + if (k->kv_len < LEN_WEP40) { DPRINTF(ah->ah_sc, ATH_DBG_KEYCACHE, "%s: WEP key length %u too small\n", __func__, k->kv_len); return false; } - if (k->kv_len <= 40 / NBBY) + if (k->kv_len <= LEN_WEP40) keyType = AR_KEYTABLE_TYPE_40; - else if (k->kv_len <= 104 / NBBY) + else if (k->kv_len <= LEN_WEP104) keyType = AR_KEYTABLE_TYPE_104; else keyType = AR_KEYTABLE_TYPE_128; @@ -7313,7 +7313,7 @@ ath9k_hw_set_keycache_entry(struct ath_hal *ah, u16 entry, key2 = get_unaligned_le32(k->kv_val + 6) ^ xorMask; key3 = (get_unaligned_le16(k->kv_val + 10) ^ xorMask) & 0xffff; key4 = get_unaligned_le32(k->kv_val + 12) ^ xorMask; - if (k->kv_len <= 104 / NBBY) + if (k->kv_len <= LEN_WEP104) key4 &= 0xff; if (keyType == AR_KEYTABLE_TYPE_TKIP && ATH9K_IS_MIC_ENABLED(ah)) { diff --git a/trunk/drivers/net/wireless/ath9k/main.c b/trunk/drivers/net/wireless/ath9k/main.c index 2888778040e4..95b337149484 100644 --- a/trunk/drivers/net/wireless/ath9k/main.c +++ b/trunk/drivers/net/wireless/ath9k/main.c @@ -206,7 +206,8 @@ static int ath_key_config(struct ath_softc *sc, if (!ret) return -EIO; - sc->sc_keytype = hk.kv_type; + if (mac) + sc->sc_keytype = hk.kv_type; return 0; } @@ -756,7 +757,8 @@ static int ath9k_set_key(struct ieee80211_hw *hw, key->hw_key_idx = key->keyidx; /* push IV and Michael MIC generation to stack */ key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; - key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; + if (key->alg == ALG_TKIP) + key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; } break; case DISABLE_KEY: