summaryrefslogtreecommitdiff
path: root/sys/dev/ic/rt2860.c
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-07-19 19:08:29 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-07-19 19:08:29 +0000
commitd8eb22fbfec900f046aae2f9eb35fbc77963f87d (patch)
tree729a645b03b2ecc1fd88bde7209cb89d814b7a01 /sys/dev/ic/rt2860.c
parentbd430d271e890e49586f9f4c93f86a09f40a3242 (diff)
in hostap mode, when a STA leaves the BSS, clear its entry in the
hardware RX WCID search table. otherwise, if the same STA reassociates later with a different id, we would have two entries for the same MAC in the table, leading to problems with key lookups etc... big thanks to Nathanael Rensen who found the issue.
Diffstat (limited to 'sys/dev/ic/rt2860.c')
-rw-r--r--sys/dev/ic/rt2860.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index 5651f1c67cc..14ee14a3031 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2860.c,v 1.53 2010/05/10 18:17:10 damien Exp $ */
+/* $OpenBSD: rt2860.c,v 1.54 2010/07/19 19:08:28 damien Exp $ */
/*-
* Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr>
@@ -98,6 +98,8 @@ void rt2860_iter_func(void *, struct ieee80211_node *);
void rt2860_updatestats(struct rt2860_softc *);
void rt2860_newassoc(struct ieee80211com *, struct ieee80211_node *,
int);
+void rt2860_node_leave(struct ieee80211com *,
+ struct ieee80211_node *);
int rt2860_newstate(struct ieee80211com *, enum ieee80211_state,
int);
uint16_t rt3090_efuse_read_2(struct rt2860_softc *, uint16_t);
@@ -328,6 +330,9 @@ rt2860_attach(void *xsc, int id)
ieee80211_ifattach(ifp);
ic->ic_node_alloc = rt2860_node_alloc;
ic->ic_newassoc = rt2860_newassoc;
+#ifndef IEEE80211_STA_ONLY
+ ic->ic_node_leave = rt2860_node_leave;
+#endif
ic->ic_updateslot = rt2860_updateslot;
ic->ic_updateedca = rt2860_updateedca;
ic->ic_set_key = rt2860_set_key;
@@ -836,6 +841,19 @@ rt2860_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew)
}
}
+#ifndef IEEE80211_STA_ONLY
+void
+rt2860_node_leave(struct ieee80211com *ic, struct ieee80211_node *ni)
+{
+ struct rt2860_softc *sc = ic->ic_softc;
+ uint8_t wcid;
+
+ /* clear Rx WCID search table entry */
+ wcid = RT2860_AID2WCID(ni->ni_associd);
+ RAL_SET_REGION_4(sc, RT2860_WCID_ENTRY(wcid), 0, 2);
+}
+#endif
+
int
rt2860_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
{