From owner-svn-src-stable-8@FreeBSD.ORG Thu Jul 8 19:40:10 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FFB106566C; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 404E98FC0A; Thu, 8 Jul 2010 19:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o68JeA8P006859; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o68JeAGQ006857; Thu, 8 Jul 2010 19:40:10 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201007081940.o68JeAGQ006857@svn.freebsd.org> From: Weongyo Jeong Date: Thu, 8 Jul 2010 19:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209822 - stable/8/sys/dev/bwi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2010 19:40:10 -0000 Author: weongyo Date: Thu Jul 8 19:40:09 2010 New Revision: 209822 URL: http://svn.freebsd.org/changeset/base/209822 Log: MFC r209598: Initializes the ratectl for a node when the state is changed to RUN. This prevents a kernel fault by dividing with zero because the initial rate was 0 and didn't be initialized. Tested by: Warren Block Modified: stable/8/sys/dev/bwi/if_bwi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:36:38 2010 (r209821) +++ stable/8/sys/dev/bwi/if_bwi.c Thu Jul 8 19:40:09 2010 (r209822) @@ -1764,6 +1764,7 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); + const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1817,6 +1818,11 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif + /* Initializes ratectl for a node. */ + tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; + if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) + ieee80211_ratectl_node_init(vap->iv_bss); + callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: