From owner-p4-projects@FreeBSD.ORG Mon Nov 28 06:50:39 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2BEBA16A500; Mon, 28 Nov 2005 06:50:32 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 BBCD216A50C for ; Mon, 28 Nov 2005 06:50:31 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E854F43D73 for ; Mon, 28 Nov 2005 06:50:23 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAS6oN2U055018 for ; Mon, 28 Nov 2005 06:50:23 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAS6oNHj055015 for perforce@freebsd.org; Mon, 28 Nov 2005 06:50:23 GMT (envelope-from sam@freebsd.org) Date: Mon, 28 Nov 2005 06:50:23 GMT Message-Id: <200511280650.jAS6oNHj055015@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 Cc: Subject: PERFORCE change 87343 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2005 06:50:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=87343 Change 87343 by sam@sam_ebb on 2005/11/28 06:50:15 don't use ic_bmisstimeout; calculate the value directly so we use the correct beacon interval Affected files ... .. //depot/projects/wifi/sys/dev/ath/if_ath.c#117 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/if_ath.c#117 (text+ko) ==== @@ -832,10 +832,12 @@ struct ieee80211com *ic = &sc->sc_ic; u_int64_t lastrx = sc->sc_lastrx; u_int64_t tsf = ath_hal_gettsf64(sc->sc_ah); + u_int bmisstimeout = + ic->ic_bmissthreshold * ic->ic_bss->ni_intval * 1024; DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf %llu lastrx %lld (%llu) bmiss %u\n", - __func__, tsf, tsf - lastrx, lastrx, ic->ic_bmisstimeout*1024); + __func__, tsf, tsf - lastrx, lastrx, bmisstimeout); /* * Workaround phantom bmiss interrupts by sanity-checking @@ -844,7 +846,7 @@ * truly a bmiss we'll get another interrupt soon and that'll * be dispatched up for processing. */ - if (tsf - lastrx > ic->ic_bmisstimeout*1024) + if (tsf - lastrx > bmisstimeout) ieee80211_beacon_miss(&sc->sc_ic); else sc->sc_stats.ast_bmiss_phantom++; @@ -2643,12 +2645,10 @@ #endif /* * Calculate the number of consecutive beacons to miss - * before taking a BMISS interrupt. The configuration - * is specified in ms, so we need to convert that to - * TU's and then calculate based on the beacon interval. + * before taking a BMISS interrupt. * Note that we clamp the result to at most 10 beacons. */ - bs.bs_bmissthreshold = howmany(ic->ic_bmisstimeout, intval); + bs.bs_bmissthreshold = ic->ic_bmissthreshold; if (bs.bs_bmissthreshold > 10) bs.bs_bmissthreshold = 10; else if (bs.bs_bmissthreshold <= 0)