From owner-p4-projects@FreeBSD.ORG Sat Oct 11 22:14:54 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3546A16A4C0; Sat, 11 Oct 2003 22:14:54 -0700 (PDT) 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 1123D16A4B3 for ; Sat, 11 Oct 2003 22:14:54 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A79E43F93 for ; Sat, 11 Oct 2003 22:14:53 -0700 (PDT) (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 h9C5ErXJ079137 for ; Sat, 11 Oct 2003 22:14:53 -0700 (PDT) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id h9C5Ermr079134 for perforce@freebsd.org; Sat, 11 Oct 2003 22:14:53 -0700 (PDT) (envelope-from sam@freebsd.org) Date: Sat, 11 Oct 2003 22:14:53 -0700 (PDT) Message-Id: <200310120514.h9C5Ermr079134@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 39547 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: Sun, 12 Oct 2003 05:14:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=39547 Change 39547 by sam@sam_ebb on 2003/10/11 22:14:23 change ath_rate_ctl_reset to handle transition from station mode to adhoc mode; was not resetting the initial xmit rate causing outbound frames to be dicarded Affected files ... .. //depot/projects/netperf/sys/dev/ath/if_ath.c#15 edit Differences ... ==== //depot/projects/netperf/sys/dev/ath/if_ath.c#15 (text+ko) ==== @@ -2565,20 +2565,13 @@ struct ieee80211_node *ni; struct ath_node *an; - an = (struct ath_node *) ic->ic_bss; - an->an_tx_ok = an->an_tx_err = an->an_tx_retr = an->an_tx_upper = 0; - if (ic->ic_opmode == IEEE80211_M_STA) { - 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!")); - ni->ni_txrate = ni->ni_rates.rs_nrates - 1; - } else { - /* use lowest rate */ - ni->ni_txrate = 0; - } - } else { + if (ic->ic_opmode != IEEE80211_M_STA) { + /* + * When operating as a station the node table holds + * the AP's that were discovered during scanning. + * For any other operating mode we want to reset the + * tx rate state of each node. + */ TAILQ_FOREACH(ni, &ic->ic_node, ni_list) { ni->ni_txrate = 0; /* use lowest rate */ an = (struct ath_node *) ni; @@ -2586,6 +2579,22 @@ an->an_tx_upper = 0; } } + /* + * Reset local xmit state; this is really only meaningful + * when operating in station or adhoc mode. + */ + ni = ic->ic_bss; + an = (struct ath_node *) ni; + an->an_tx_ok = an->an_tx_err = an->an_tx_retr = an->an_tx_upper = 0; + if (state == IEEE80211_S_RUN) { + /* start with highest negotiated rate */ + KASSERT(ni->ni_rates.rs_nrates > 0, + ("transition to RUN state w/ no rates!")); + ni->ni_txrate = ni->ni_rates.rs_nrates - 1; + } else { + /* use lowest rate */ + ni->ni_txrate = 0; + } } /*