diff options
author | Bob Copeland <me@bobcopeland.com> | 2008-11-26 16:17:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:32:13 -0500 |
commit | f650470a8f506bc33a15778432ebb8cdcf89175b (patch) | |
tree | 91d563ae28beaa01d229682ca7a299d70f047f74 /drivers/net/wireless/ath5k | |
parent | 671434904633876f89be70af415c35c89fb90115 (diff) |
ath5k: enable combined michael mic in key cache
For mac revisions >= "Griffin," the hardware allows the mic tx and rx
authenticator keys to share the same cache line, whereas earlier
hardware can only store the rx. Enable the combined mic on hardware
that supports it.
Changes to ath5k.h
Changes-licensed-under: 3-Clause-BSD
Changes to attach.c, pcu.c, reg.h
Changes-licensed-under: ISC
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath5k')
-rw-r--r-- | drivers/net/wireless/ath5k/ath5k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/attach.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/pcu.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/ath5k/reg.h | 1 |
4 files changed, 22 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h index 5ee2dd1814c2..13df1191b070 100644 --- a/drivers/net/wireless/ath5k/ath5k.h +++ b/drivers/net/wireless/ath5k/ath5k.h | |||
@@ -1052,6 +1052,7 @@ struct ath5k_hw { | |||
1052 | bool ah_calibration; | 1052 | bool ah_calibration; |
1053 | bool ah_running; | 1053 | bool ah_running; |
1054 | bool ah_single_chip; | 1054 | bool ah_single_chip; |
1055 | bool ah_combined_mic; | ||
1055 | enum ath5k_rfgain ah_rf_gain; | 1056 | enum ath5k_rfgain ah_rf_gain; |
1056 | 1057 | ||
1057 | u32 ah_mac_srev; | 1058 | u32 ah_mac_srev; |
diff --git a/drivers/net/wireless/ath5k/attach.c b/drivers/net/wireless/ath5k/attach.c index 49d82d79d3fc..dea378f76731 100644 --- a/drivers/net/wireless/ath5k/attach.c +++ b/drivers/net/wireless/ath5k/attach.c | |||
@@ -317,6 +317,12 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version) | |||
317 | goto err_free; | 317 | goto err_free; |
318 | } | 318 | } |
319 | 319 | ||
320 | if (srev >= AR5K_SREV_AR2414) { | ||
321 | ah->ah_combined_mic = true; | ||
322 | AR5K_REG_ENABLE_BITS(ah, AR5K_MISC_MODE, | ||
323 | AR5K_MISC_MODE_COMBINED_MIC); | ||
324 | } | ||
325 | |||
320 | /* MAC address is cleared until add_interface */ | 326 | /* MAC address is cleared until add_interface */ |
321 | ath5k_hw_set_lladdr(ah, mac); | 327 | ath5k_hw_set_lladdr(ah, mac); |
322 | 328 | ||
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c index ad7ea36502bd..dabe42219e2a 100644 --- a/drivers/net/wireless/ath5k/pcu.c +++ b/drivers/net/wireless/ath5k/pcu.c | |||
@@ -1096,20 +1096,20 @@ int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry, | |||
1096 | /* Install rx/tx MIC */ | 1096 | /* Install rx/tx MIC */ |
1097 | rxmic = (__le32 *) &key->key[16]; | 1097 | rxmic = (__le32 *) &key->key[16]; |
1098 | txmic = (__le32 *) &key->key[24]; | 1098 | txmic = (__le32 *) &key->key[24]; |
1099 | #if 0 | 1099 | |
1100 | /* MISC_MODE register & 0x04 - for mac srev >= griffin */ | 1100 | if (ah->ah_combined_mic) { |
1101 | key_v[0] = rxmic[0]; | 1101 | key_v[0] = rxmic[0]; |
1102 | key_v[1] = (txmic[0] >> 16) & 0xffff; | 1102 | key_v[1] = (txmic[0] >> 16) & 0xffff; |
1103 | key_v[2] = rxmic[1]; | 1103 | key_v[2] = rxmic[1]; |
1104 | key_v[3] = txmic[0] & 0xffff; | 1104 | key_v[3] = txmic[0] & 0xffff; |
1105 | key_v[4] = txmic[1]; | 1105 | key_v[4] = txmic[1]; |
1106 | #else | 1106 | } else { |
1107 | key_v[0] = rxmic[0]; | 1107 | key_v[0] = rxmic[0]; |
1108 | key_v[1] = 0; | 1108 | key_v[1] = 0; |
1109 | key_v[2] = rxmic[1]; | 1109 | key_v[2] = rxmic[1]; |
1110 | key_v[3] = 0; | 1110 | key_v[3] = 0; |
1111 | key_v[4] = 0; | 1111 | key_v[4] = 0; |
1112 | #endif | 1112 | } |
1113 | for (i = 0; i < ARRAY_SIZE(key_v); i++) | 1113 | for (i = 0; i < ARRAY_SIZE(key_v); i++) |
1114 | ath5k_hw_reg_write(ah, le32_to_cpu(key_v[i]), | 1114 | ath5k_hw_reg_write(ah, le32_to_cpu(key_v[i]), |
1115 | AR5K_KEYTABLE_OFF(micentry, i)); | 1115 | AR5K_KEYTABLE_OFF(micentry, i)); |
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h index 69755fc2f9be..91aaeaf88199 100644 --- a/drivers/net/wireless/ath5k/reg.h +++ b/drivers/net/wireless/ath5k/reg.h | |||
@@ -1729,6 +1729,7 @@ | |||
1729 | #define AR5K_MISC_MODE 0x8120 /* Register Address */ | 1729 | #define AR5K_MISC_MODE 0x8120 /* Register Address */ |
1730 | #define AR5K_MISC_MODE_FBSSID_MATCH 0x00000001 /* Force BSSID match */ | 1730 | #define AR5K_MISC_MODE_FBSSID_MATCH 0x00000001 /* Force BSSID match */ |
1731 | #define AR5K_MISC_MODE_ACKSIFS_MEM 0x00000002 /* ACK SIFS memory (?) */ | 1731 | #define AR5K_MISC_MODE_ACKSIFS_MEM 0x00000002 /* ACK SIFS memory (?) */ |
1732 | #define AR5K_MISC_MODE_COMBINED_MIC 0x00000004 /* use rx/tx MIC key */ | ||
1732 | /* more bits */ | 1733 | /* more bits */ |
1733 | 1734 | ||
1734 | /* | 1735 | /* |