summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2010-08-18 18:58:02 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2010-08-18 18:58:02 +0000
commitd1294fa40f184086f0eb83fa1e4c2da34830b004 (patch)
treea68ba017c20f777a075aafb5249deef9ba2fea6e
parent9749ab1ee72d5c113ddf0816377ce958088074e4 (diff)
- in STA mode, when associated, stop receiving beacons from other BSS.
tested by ray@ - no periodic PA calibration for the Osprey (AR9380)
-rw-r--r--sys/dev/ic/athn.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index b2207d734fe..bcd04a52e96 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: athn.c,v 1.61 2010/08/12 16:51:30 damien Exp $ */
+/* $OpenBSD: athn.c,v 1.62 2010/08/18 18:58:01 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -445,6 +445,7 @@ athn_rx_start(struct athn_softc *sc)
/* Want Compressed Block Ack Requests. */
rfilt |= AR_RX_FILTER_COMPR_BAR;
#endif
+ rfilt |= AR_RX_FILTER_BEACON;
if (ic->ic_opmode != IEEE80211_M_STA) {
rfilt |= AR_RX_FILTER_PROBEREQ;
if (ic->ic_opmode == IEEE80211_M_MONITOR)
@@ -454,9 +455,7 @@ athn_rx_start(struct athn_softc *sc)
ic->ic_opmode == IEEE80211_M_HOSTAP)
rfilt |= AR_RX_FILTER_PSPOLL;
#endif
- rfilt |= AR_RX_FILTER_BEACON;
- } else
- rfilt |= AR_RX_FILTER_BEACON; /* XXX AR_RX_FILTER_MYBEACON */
+ }
athn_set_rxfilter(sc, rfilt);
/* Set BSSID mask. */
@@ -1151,14 +1150,15 @@ athn_calib_to(void *arg)
/* Do periodic (every 4 minutes) PA calibration. */
if (AR_SREV_9285_11_OR_LATER(sc) &&
- sc->pa_calib_ticks + 240 * hz < ticks) {
+ !AR_SREV_9380_10_OR_LATER(sc) &&
+ ticks >= sc->pa_calib_ticks + 240 * hz) {
sc->pa_calib_ticks = ticks;
ar9285_pa_calib(sc);
}
/* Do periodic (every 30 seconds) temperature compensation. */
if ((sc->flags & ATHN_FLAG_OLPC) &&
- sc->olpc_ticks + 30 * hz < ticks) {
+ ticks >= sc->olpc_ticks + 30 * hz) {
sc->olpc_ticks = ticks;
ops->olpc_temp_compensation(sc);
}
@@ -2262,6 +2262,7 @@ athn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
struct ifnet *ifp = &ic->ic_if;
struct athn_softc *sc = ifp->if_softc;
struct athn_ops *ops = &sc->ops;
+ uint32_t reg;
int error;
timeout_del(&sc->calib_to);
@@ -2309,6 +2310,12 @@ athn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
athn_set_sta_timers(sc);
/* Enable beacon miss interrupts. */
sc->imask |= AR_IMR_BMISS;
+
+ /* Stop receiving beacons from other BSS. */
+ reg = AR_READ(sc, AR_RX_FILTER);
+ reg = (reg & ~AR_RX_FILTER_BEACON) |
+ AR_RX_FILTER_MYBEACON;
+ AR_WRITE(sc, AR_RX_FILTER, reg);
}
athn_enable_interrupts(sc);