summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 12:00:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-07-15 12:00:32 +0000
commitf7e1d5672c045d98faa98b1b461f4060dfe89a12 (patch)
treec0d4e24d682b517a0b496a298e6c02b267036140 /sys
parenta4cdf0bbaeaca5aae7cd99e8bc9b456a60cd0f46 (diff)
Do not treat the lost beacon count specially any more. It is kind of
a dumb way to track the link condition anyway. From NetBSD (dyoung).
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/atw.c45
-rw-r--r--sys/dev/ic/atwvar.h4
2 files changed, 3 insertions, 46 deletions
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index 967a337fed4..4f1b3532fb9 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atw.c,v 1.6 2004/07/15 11:53:32 millert Exp $ */
+/* $OpenBSD: atw.c,v 1.7 2004/07/15 12:00:31 millert Exp $ */
/* $NetBSD: atw.c,v 1.39 2004/07/15 05:54:13 dyoung Exp $ */
/*-
@@ -216,7 +216,6 @@ void atw_tsf(struct atw_softc *);
void atw_start_beacon(struct atw_softc *, int);
void atw_write_wep(struct atw_softc *);
void atw_write_bssid(struct atw_softc *);
-void atw_write_bcn_thresh(struct atw_softc *);
void atw_write_ssid(struct atw_softc *);
void atw_write_sup_rates(struct atw_softc *);
void atw_clear_sram(struct atw_softc *);
@@ -886,8 +885,6 @@ atw_reset(struct atw_softc *sc)
atw_clear_sram(sc);
memset(sc->sc_bssid, 0, sizeof(sc->sc_bssid));
-
- sc->sc_lost_bcn_thresh = 0;
}
void
@@ -1938,44 +1935,6 @@ atw_write_bssid(struct atw_softc *sc)
memcpy(sc->sc_bssid, bssid, sizeof(sc->sc_bssid));
}
-/* Tell the ADM8211 how many beacon intervals must pass without
- * receiving a beacon with the preferred BSSID & SSID set by
- * atw_write_bssid and atw_write_ssid before ATW_INTR_LINKOFF
- * raised.
- */
-void
-atw_write_bcn_thresh(struct atw_softc *sc)
-{
- struct ieee80211com *ic = &sc->sc_ic;
- int lost_bcn_thresh;
-
- /* Lose link after one second or 7 beacons, whichever comes
- * first, but do not lose link before 2 beacons are lost.
- *
- * In host AP mode, set the lost-beacon threshold to 0.
- */
- if (ic->ic_opmode == IEEE80211_M_HOSTAP)
- lost_bcn_thresh = 0;
- else {
- int beacons_per_second =
- 1000000 / (IEEE80211_DUR_TU * MAX(1,ic->ic_bss->ni_intval));
- lost_bcn_thresh = MAX(2, MIN(7, beacons_per_second));
- }
-
- /* XXX resets wake-up status bits */
- ATW_WRITE(sc, ATW_WCSR,
- (ATW_READ(sc, ATW_WCSR) & ~ATW_WCSR_BLN_MASK) |
- (LSHIFT(lost_bcn_thresh, ATW_WCSR_BLN_MASK) & ATW_WCSR_BLN_MASK));
-
- DPRINTF(sc, ("%s: lost-beacon threshold %d -> %d\n",
- sc->sc_dev.dv_xname, sc->sc_lost_bcn_thresh, lost_bcn_thresh));
-
- sc->sc_lost_bcn_thresh = lost_bcn_thresh;
-
- DPRINTF(sc, ("%s: atw_write_bcn_thresh reg[WCSR] = %08x\n",
- sc->sc_dev.dv_xname, ATW_READ(sc, ATW_WCSR)));
-}
-
/* Write buflen bytes from buf to SRAM starting at the SRAM's ofs'th
* 16-bit word.
*/
@@ -2206,7 +2165,6 @@ atw_recv_beacon(struct ieee80211com *ic, struct mbuf *m0,
(*ic->ic_node_copy)(ic, ic->ic_bss, ni);
atw_write_bssid(sc);
- atw_write_bcn_thresh(sc);
atw_start_beacon(sc, 1);
}
@@ -2423,7 +2381,6 @@ atw_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
/*FALLTHROUGH*/
case IEEE80211_S_AUTH:
atw_write_bssid(sc);
- atw_write_bcn_thresh(sc);
atw_write_ssid(sc);
atw_write_sup_rates(sc);
diff --git a/sys/dev/ic/atwvar.h b/sys/dev/ic/atwvar.h
index 2eeb32c0594..4f8d6ea21f6 100644
--- a/sys/dev/ic/atwvar.h
+++ b/sys/dev/ic/atwvar.h
@@ -1,4 +1,5 @@
-/* $NetBSD: atwvar.h,v 1.9 2004/06/23 08:13:29 dyoung Exp $ */
+/* $OpenBSD: atwvar.h,v 1.3 2004/07/15 12:00:31 millert Exp $ */
+/* $NetBSD: atwvar.h,v 1.10 2004/07/15 06:06:53 dyoung Exp $ */
/*
* Copyright (c) 2003, 2004 The NetBSD Foundation, Inc. All rights reserved.
@@ -271,7 +272,6 @@ struct atw_softc {
/* ADM8211 state variables. */
u_int8_t sc_sram[ATW_SRAM_SIZE];
u_int8_t sc_bssid[IEEE80211_ADDR_LEN];
- u_int8_t sc_lost_bcn_thresh;
struct timeval sc_last_beacon;
struct timeout sc_scan_to;