From owner-svn-src-all@FreeBSD.ORG Wed Jan 7 23:30:27 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 152A1106566B; Wed, 7 Jan 2009 23:30:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04FFF8FC1E; Wed, 7 Jan 2009 23:30:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n07NUQkv002685; Wed, 7 Jan 2009 23:30:26 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n07NUQPZ002684; Wed, 7 Jan 2009 23:30:26 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901072330.n07NUQPZ002684@svn.freebsd.org> From: Sam Leffler Date: Wed, 7 Jan 2009 23:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186879 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2009 23:30:27 -0000 Author: sam Date: Wed Jan 7 23:30:26 2009 New Revision: 186879 URL: http://svn.freebsd.org/changeset/base/186879 Log: correct fixed rate handling; the rixmap was changed a while back to be indexed by the ieee rate code Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed Jan 7 21:52:47 2009 (r186878) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed Jan 7 23:30:26 2009 (r186879) @@ -754,23 +754,18 @@ ath_rate_ctl_reset(struct ath_softc *sc, sn->static_rix = -1; if (tp != NULL && tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { /* - * A fixed rate is to be used; ic_fixed_rate is the - * IEEE code for this rate (sans basic bit). Convert this - * to the index into the negotiated rate set for - * the node. + * A fixed rate is to be used; ucastrate is the IEEE code + * for this rate (sans basic bit). Check this against the + * negotiated rate set for the node. Note the fixed rate + * may not be available for various reasons so we only + * setup the static rate index if the lookup is successful. + * XXX handle MCS */ - /* NB: the rate set is assumed sorted */ - srate = ni->ni_rates.rs_nrates - 1; - for (; srate >= 0 && RATE(srate) != tp->ucastrate; srate--) - ; - /* - * The fixed rate may not be available due to races - * and mode settings. Also orphaned nodes created in - * adhoc mode may not have any rate set so this lookup - * can fail. - */ - if (srate >= 0) - sn->static_rix = sc->sc_rixmap[srate]; + for (srate = ni->ni_rates.rs_nrates - 1; srate >= 0; srate--) + if (RATE(srate) == tp->ucastrate) { + sn->static_rix = sc->sc_rixmap[tp->ucastrate]; + break; + } } /*