From owner-p4-projects@FreeBSD.ORG Sat Dec 13 10:39:18 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7A0B16A4D0; Sat, 13 Dec 2003 10:39:17 -0800 (PST) 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 A1DD016A4CE for ; Sat, 13 Dec 2003 10:39:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25ECB43D3C for ; Sat, 13 Dec 2003 10:39:16 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hBDIdFXJ057359 for ; Sat, 13 Dec 2003 10:39:15 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hBDIdFN9057356 for perforce@freebsd.org; Sat, 13 Dec 2003 10:39:15 -0800 (PST) (envelope-from sam@freebsd.org) Date: Sat, 13 Dec 2003 10:39:15 -0800 (PST) Message-Id: <200312131839.hBDIdFN9057356@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 43903 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: Sat, 13 Dec 2003 18:39:18 -0000 http://perforce.freebsd.org/chv.cgi?CH=43903 Change 43903 by sam@sam_ebb on 2003/12/13 10:38:26 only expect a negotiated rate set when operating in station mode; this corrects a problem where marking the interface up in monitor mode w/o first operating in another mode would cause an assertion failure note this may be suboptimal for adhoc mode; we may want to default to a base rate other than the lowest Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#48 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#48 (text+ko) ==== @@ -2774,7 +2774,21 @@ struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; - if (ic->ic_opmode != IEEE80211_M_STA) { + if (ic->ic_opmode == IEEE80211_M_STA) { + /* + * Reset local xmit state; this is really only + * meaningful when operating in station mode. + */ + ni = ic->ic_bss; + if (state == IEEE80211_S_RUN) { + /* start with highest negotiated rate */ + KASSERT(ni->ni_rates.rs_nrates > 0, + ("transition to RUN state w/ no rates!")); + ath_rate_update(sc, ni, ni->ni_rates.rs_nrates - 1); + } else { + ath_rate_update(sc, ni, 0); + } + } else { /* * When operating as a station the node table holds * the AP's that were discovered during scanning. @@ -2783,19 +2797,7 @@ */ TAILQ_FOREACH(ni, &ic->ic_node, ni_list) ath_rate_update(sc, ni, 0); /* use lowest rate */ - } - /* - * Reset local xmit state; this is really only meaningful - * when operating in station or adhoc mode. - */ - ni = ic->ic_bss; - if (state == IEEE80211_S_RUN) { - /* start with highest negotiated rate */ - KASSERT(ni->ni_rates.rs_nrates > 0, - ("transition to RUN state w/ no rates!")); - ath_rate_update(sc, ni, ni->ni_rates.rs_nrates - 1); - } else { - ath_rate_update(sc, ni, 0); /* use lowest rate */ + ath_rate_update(sc, ic->ic_bss, 0); } }