Skip to content

Commit f650470

Browse files
bcopelandlinvjw
authored andcommitted
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>
1 parent 6714349 commit f650470

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

‎drivers/net/wireless/ath5k/ath5k.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ struct ath5k_hw {
10521052
bool ah_calibration;
10531053
bool ah_running;
10541054
bool ah_single_chip;
1055+
bool ah_combined_mic;
10551056
enum ath5k_rfgain ah_rf_gain;
10561057

10571058
u32 ah_mac_srev;

‎drivers/net/wireless/ath5k/attach.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ struct ath5k_hw *ath5k_hw_attach(struct ath5k_softc *sc, u8 mac_version)
317317
goto err_free;
318318
}
319319

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+
320326
/* MAC address is cleared until add_interface */
321327
ath5k_hw_set_lladdr(ah, mac);
322328

‎drivers/net/wireless/ath5k/pcu.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,20 +1096,20 @@ int ath5k_hw_set_key(struct ath5k_hw *ah, u16 entry,
10961096
/* Install rx/tx MIC */
10971097
rxmic = (__le32 *) &key->key[16];
10981098
txmic = (__le32 *) &key->key[24];
1099-
#if 0
1100-
/* MISC_MODE register & 0x04 - for mac srev >= griffin */
1101-
key_v[0] = rxmic[0];
1102-
key_v[1] = (txmic[0] >> 16) & 0xffff;
1103-
key_v[2] = rxmic[1];
1104-
key_v[3] = txmic[0] & 0xffff;
1105-
key_v[4] = txmic[1];
1106-
#else
1107-
key_v[0] = rxmic[0];
1108-
key_v[1] = 0;
1109-
key_v[2] = rxmic[1];
1110-
key_v[3] = 0;
1111-
key_v[4] = 0;
1112-
#endif
1099+
1100+
if (ah->ah_combined_mic) {
1101+
key_v[0] = rxmic[0];
1102+
key_v[1] = (txmic[0] >> 16) & 0xffff;
1103+
key_v[2] = rxmic[1];
1104+
key_v[3] = txmic[0] & 0xffff;
1105+
key_v[4] = txmic[1];
1106+
} else {
1107+
key_v[0] = rxmic[0];
1108+
key_v[1] = 0;
1109+
key_v[2] = rxmic[1];
1110+
key_v[3] = 0;
1111+
key_v[4] = 0;
1112+
}
11131113
for (i = 0; i < ARRAY_SIZE(key_v); i++)
11141114
ath5k_hw_reg_write(ah, le32_to_cpu(key_v[i]),
11151115
AR5K_KEYTABLE_OFF(micentry, i));

‎drivers/net/wireless/ath5k/reg.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,7 @@
17291729
#define AR5K_MISC_MODE 0x8120 /* Register Address */
17301730
#define AR5K_MISC_MODE_FBSSID_MATCH 0x00000001 /* Force BSSID match */
17311731
#define AR5K_MISC_MODE_ACKSIFS_MEM 0x00000002 /* ACK SIFS memory (?) */
1732+
#define AR5K_MISC_MODE_COMBINED_MIC 0x00000004 /* use rx/tx MIC key */
17321733
/* more bits */
17331734

17341735
/*

0 commit comments

Comments
 (0)