summaryrefslogtreecommitdiff
path: root/sys/dev/ic/athn.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-05-16 17:46:39 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-05-16 17:46:39 +0000
commitcc691be79cc7dbac4180dc266400f4291f642722 (patch)
tree1055cc2ba5bab363b83c53772f55fd254954cbfe /sys/dev/ic/athn.c
parenta998ea7bf0773a86f544da789b2d9aa386521790 (diff)
fix ic_max_nnodes computation.
no need to set KEY3&KEY4 entries in the split TKIP MIC case (these entries are set to 0 already.)
Diffstat (limited to 'sys/dev/ic/athn.c')
-rw-r--r--sys/dev/ic/athn.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index 86226d6372a..b43111de962 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.45 2010/05/16 14:50:28 damien Exp $ */
+/* $OpenBSD: athn.c,v 1.46 2010/05/16 17:46:38 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -220,11 +220,11 @@ athn_attach(struct athn_softc *sc)
* limited by the number of entries in the HW key cache.
* TKIP keys consume 2 or 4 entries in the cache.
*/
- ic->ic_max_nnodes = sc->kc_entries - IEEE80211_WEP_NKID;
if (sc->flags & ATHN_FLAG_SPLIT_TKIP_MIC)
- ic->ic_max_nnodes /= 4;
+ ic->ic_max_nnodes = sc->kc_entries / 4;
else
- ic->ic_max_nnodes /= 2;
+ ic->ic_max_nnodes = sc->kc_entries / 2;
+ ic->ic_max_nnodes -= IEEE80211_WEP_NKID;
if (ic->ic_max_nnodes > IEEE80211_CACHE_SIZE)
ic->ic_max_nnodes = IEEE80211_CACHE_SIZE;
@@ -965,8 +965,6 @@ athn_set_key(struct ieee80211com *ic, struct ieee80211_node *ni,
micbuf[2]);
AR_WRITE(sc, AR_KEYTABLE_KEY2(micentry),
micbuf[3] | micbuf[4] << 16);
- AR_WRITE(sc, AR_KEYTABLE_KEY3(micentry), 0);
- AR_WRITE(sc, AR_KEYTABLE_KEY4(micentry), 0);
AR_WRITE(sc, AR_KEYTABLE_TYPE(micentry),
AR_KEYTABLE_TYPE_CLR);
@@ -979,8 +977,6 @@ athn_set_key(struct ieee80211com *ic, struct ieee80211_node *ni,
micbuf[2]);
AR_WRITE(sc, AR_KEYTABLE_KEY2(micentry),
micbuf[3] | micbuf[4] << 16);
- AR_WRITE(sc, AR_KEYTABLE_KEY3(micentry), 0);
- AR_WRITE(sc, AR_KEYTABLE_KEY4(micentry), 0);
AR_WRITE(sc, AR_KEYTABLE_TYPE(micentry),
AR_KEYTABLE_TYPE_CLR);
} else {