Index: ath.c
===================================================================
RCS file: /data/netbsd/cvs/src/sys/dev/ic/ath.c,v
retrieving revision 1.76
diff -u -r1.76 ath.c
--- ath.c 14 Jul 2006 13:37:25 -0000 1.76
+++ ath.c 9 Sep 2006 23:22:25 -0000
@@ -255,7 +255,7 @@
} while (0)
#define KEYPRINTF(sc, ix, hk, mac) do { \
if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \
- ath_keyprint(__func__, ix, hk, mac); \
+ ath_keyprint(sc, __func__, ix, hk, mac); \
} while (0)
static void ath_printrxbuf(struct ath_buf *bf, int);
static void ath_printtxbuf(struct ath_buf *bf, int);
@@ -375,18 +375,6 @@
*/
for (i = 0; i < sc->sc_keymax; i++)
ath_hal_keyreset(ah, i);
- /*
- * Mark key cache slots associated with global keys
- * as in use. If we knew TKIP was not to be used we
- * could leave the +32, +64, and +32+64 slots free.
- * XXX only for splitmic.
- */
- for (i = 0; i < IEEE80211_WEP_NKID; i++) {
- setbit(sc->sc_keymap, i);
- setbit(sc->sc_keymap, i+32);
- setbit(sc->sc_keymap, i+64);
- setbit(sc->sc_keymap, i+32+64);
- }
/*
* Collect the channel list using the default country
@@ -567,12 +555,31 @@
*/
if (ath_hal_ciphersupported(ah, HAL_CIPHER_MIC))
ic->ic_caps |= IEEE80211_C_TKIPMIC;
- if (ath_hal_tkipsplit(ah))
+ /*
+ * If the h/w supports storing tx+rx MIC keys
+ * in one cache slot automatically enable use.
+ */
+ if (ath_hal_hastkipsplit(ah) ||
+ !ath_hal_settkipsplit(ah, AH_FALSE))
sc->sc_splitmic = 1;
}
sc->sc_hasclrkey = ath_hal_ciphersupported(ah, HAL_CIPHER_CLR);
sc->sc_mcastkey = ath_hal_getmcastkeysearch(ah);
/*
+ * Mark key cache slots associated with global keys
+ * as in use. If we knew TKIP was not to be used we
+ * could leave the +32, +64, and +32+64 slots free.
+ * XXX only for splitmic.
+ */
+ for (i = 0; i < IEEE80211_WEP_NKID; i++) {
+ setbit(sc->sc_keymap, i);
+ setbit(sc->sc_keymap, i+64);
+ if (sc->sc_splitmic) {
+ setbit(sc->sc_keymap, i+32);
+ setbit(sc->sc_keymap, i+32+64);
+ }
+ }
+ /*
* TPC support can be done either with a global cap or
* per-packet support. The latter is not available on
* all parts. We're a bit pedantic here as all parts
@@ -1410,7 +1417,7 @@