From 8218b1f27763fb3b489a7fe36e6acebd11f42e88 Mon Sep 17 00:00:00 2001 From: dyoung Date: Thu, 15 Jul 2004 06:06:53 +0000 Subject: [PATCH] I'm not treating the lost beacon count specially any more. It is kind of a dumb way to track the link condition, anyway.... --- sys/dev/ic/atw.c | 47 ++------------------------------------------- sys/dev/ic/atwvar.h | 3 +-- 2 files changed, 3 insertions(+), 47 deletions(-) diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index f293d813b597..a4c7e3f6d927 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.39 2004/07/15 05:54:13 dyoung Exp $ */ +/* $NetBSD: atw.c,v 1.40 2004/07/15 06:06:53 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.39 2004/07/15 05:54:13 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.40 2004/07/15 06:06:53 dyoung Exp $"); #include "bpfilter.h" @@ -211,7 +211,6 @@ static void atw_tsf(struct atw_softc *); static void atw_start_beacon(struct atw_softc *, int); static void atw_write_wep(struct atw_softc *); static void atw_write_bssid(struct atw_softc *); -static void atw_write_bcn_thresh(struct atw_softc *); static void atw_write_ssid(struct atw_softc *); static void atw_write_sup_rates(struct atw_softc *); static void atw_clear_sram(struct atw_softc *); @@ -880,8 +879,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; } static void @@ -1929,44 +1926,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. - */ -static 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. */ @@ -2199,7 +2158,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); } @@ -2426,7 +2384,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 4ede107e69b1..bd8bda56986b 100644 --- a/sys/dev/ic/atwvar.h +++ b/sys/dev/ic/atwvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: atwvar.h,v 1.9 2004/06/23 08:13:29 dyoung 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 +271,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 callout sc_scan_ch;