From owner-p4-projects@FreeBSD.ORG Fri Oct 29 21:58:23 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C881B16A4D0; Fri, 29 Oct 2004 21:58:22 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A390916A4CE for ; Fri, 29 Oct 2004 21:58:22 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D90843D4C for ; Fri, 29 Oct 2004 21:58:22 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i9TLwMgG001540 for ; Fri, 29 Oct 2004 21:58:22 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i9TLwMA3001537 for perforce@freebsd.org; Fri, 29 Oct 2004 21:58:22 GMT (envelope-from sam@freebsd.org) Date: Fri, 29 Oct 2004 21:58:22 GMT Message-Id: <200410292158.i9TLwMA3001537@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 63952 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 21:58:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=63952 Change 63952 by sam@sam_ebb on 2004/10/29 21:58:00 o fix rx filter calculation by passing in the 802.11 state instead of using ic_state; this can be wrong as we're called prior to completing the state transition from ath_newstate o move the call to ath_rate_newstate to happen before setting up the beacon state so the rate information is setup Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#4 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#4 (text+ko) ==== @@ -1459,7 +1459,7 @@ * - when scanning */ static u_int32_t -ath_calcrxfilter(struct ath_softc *sc) +ath_calcrxfilter(struct ath_softc *sc, enum ieee80211_state state) { struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; @@ -1475,7 +1475,7 @@ rfilt |= HAL_RX_FILTER_PROM; if (ic->ic_opmode == IEEE80211_M_STA || ic->ic_opmode == IEEE80211_M_IBSS || - ic->ic_state == IEEE80211_S_SCAN) + state == IEEE80211_S_SCAN) rfilt |= HAL_RX_FILTER_BEACON; return rfilt; } @@ -1483,6 +1483,7 @@ static void ath_mode_init(struct ath_softc *sc) { + struct ieee80211com *ic = &sc->sc_ic; struct ath_hal *ah = sc->sc_ah; struct ifnet *ifp = &sc->sc_if; u_int32_t rfilt, mfilt[2], val; @@ -1490,7 +1491,7 @@ struct ifmultiaddr *ifma; /* configure rx filter */ - rfilt = ath_calcrxfilter(sc); + rfilt = ath_calcrxfilter(sc, ic->ic_state); ath_hal_setrxfilter(ah, rfilt); /* configure operational mode */ @@ -3402,13 +3403,17 @@ if (nstate == IEEE80211_S_INIT) { sc->sc_imask &= ~(HAL_INT_SWBA | HAL_INT_BMISS); ath_hal_intrset(ah, sc->sc_imask); + /* + * Notify the rate control algorithm. + */ + ath_rate_newstate(sc, nstate); goto done; } ni = ic->ic_bss; error = ath_chan_set(sc, ni->ni_chan); if (error != 0) goto bad; - rfilt = ath_calcrxfilter(sc); + rfilt = ath_calcrxfilter(sc, nstate); if (nstate == IEEE80211_S_SCAN) bssid = ifp->if_broadcastaddr; else @@ -3427,6 +3432,12 @@ ath_hal_keysetmac(ah, i, bssid); } + /* + * Notify the rate control algorithm so rates + * are setup should ath_beacon_alloc be called. + */ + ath_rate_newstate(sc, nstate); + if (ic->ic_opmode == IEEE80211_M_MONITOR) { /* nothing to do */; } else if (nstate == IEEE80211_S_RUN) { @@ -3461,10 +3472,6 @@ } done: /* - * Notify the rate control algorithm. - */ - ath_rate_newstate(sc, nstate); - /* * Invoke the parent method to complete the work. */ error = sc->sc_newstate(ic, nstate, arg);