From owner-p4-projects@FreeBSD.ORG Wed Nov 17 19:26:04 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 841A216A4D2; Wed, 17 Nov 2004 19:26:04 +0000 (GMT) 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 5F98B16A4CE for ; Wed, 17 Nov 2004 19:26:04 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 300EE43D45 for ; Wed, 17 Nov 2004 19:26:04 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id iAHJQ4aF088029 for ; Wed, 17 Nov 2004 19:26:04 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iAHJQ3u1088026 for perforce@freebsd.org; Wed, 17 Nov 2004 19:26:03 GMT (envelope-from sam@freebsd.org) Date: Wed, 17 Nov 2004 19:26:03 GMT Message-Id: <200411171926.iAHJQ3u1088026@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 65354 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: Wed, 17 Nov 2004 19:26:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=65354 Change 65354 by sam@sam_ebb on 2004/11/17 19:25:23 o fixup for node table rewrite o use ieee80211_iterate_nodes instead of hand-rolled code to scan the station table Affected files ... .. //depot/projects/wifi/sys/dev/ath/ath_rate/amrr/amrr.c#2 edit .. //depot/projects/wifi/sys/dev/ath/ath_rate/onoe/onoe.c#2 edit Differences ... ==== //depot/projects/wifi/sys/dev/ath/ath_rate/amrr/amrr.c#2 (text+ko) ==== @@ -330,6 +330,12 @@ #undef RATE } +static void +ath_rate_cb(void *arg, struct ieee80211_node *ni) +{ + ath_rate_update(ni->ni_ic->ic_ifp->if_softc, ni, (int) arg); +} + /* * Reset the rate control state for each 802.11 state transition. */ @@ -362,8 +368,8 @@ * For any other operating mode we want to reset the * tx rate state of each node. */ - TAILQ_FOREACH(ni, &ic->ic_node, ni_list) - ath_rate_update(sc, ni, 0); /* use lowest rate */ + if (ic->ic_sta != NULL) + ieee80211_iterate_nodes(ic->ic_sta, ath_rate_cb, 0); ath_rate_update(sc, ic->ic_bss, 0); } if (ic->ic_fixed_rate == -1 && state == IEEE80211_S_RUN) { @@ -468,7 +474,7 @@ if (ic->ic_opmode == IEEE80211_M_STA) ath_rate_ctl(sc, ic->ic_bss); /* NB: no reference */ - else + else if (ic->ic_sta != NULL) ieee80211_iterate_nodes(ic, ath_rate_ctl, sc); } interval = ath_rateinterval; ==== //depot/projects/wifi/sys/dev/ath/ath_rate/onoe/onoe.c#2 (text+ko) ==== @@ -319,6 +319,12 @@ #undef RATE } +static void +ath_rate_cb(void *arg, struct ieee80211_node *ni) +{ + ath_rate_update(ni->ni_ic->ic_ifp->if_softc, ni, (int) arg); +} + /* * Reset the rate control state for each 802.11 state transition. */ @@ -351,8 +357,8 @@ * For any other operating mode we want to reset the * tx rate state of each node. */ - TAILQ_FOREACH(ni, &ic->ic_node, ni_list) - ath_rate_update(sc, ni, 0); /* use lowest rate */ + if (ic->ic_sta != NULL) + ieee80211_iterate_nodes(ic->ic_sta, ath_rate_cb, 0); ath_rate_update(sc, ic->ic_bss, 0); } if (ic->ic_fixed_rate == -1 && state == IEEE80211_S_RUN) { @@ -454,8 +460,8 @@ if (ic->ic_opmode == IEEE80211_M_STA) ath_rate_ctl(sc, ic->ic_bss); /* NB: no reference */ - else - ieee80211_iterate_nodes(ic, ath_rate_ctl, sc); + else if (ic->ic_sta != NULL) + ieee80211_iterate_nodes(ic->ic_sta, ath_rate_ctl, sc); } interval = ath_rateinterval; if (ic->ic_opmode == IEEE80211_M_STA)