Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Feb 2008 19:47:26 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 136395 for review
Message-ID:  <200802291947.m1TJlQ5u092189@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=136395

Change 136395 by sam@sam_ebb on 2008/02/28 05:01:49

	blindly convert

Affected files ...

.. //depot/projects/vap/sys/dev/ath/ath_rate/onoe/onoe.c#9 edit

Differences ...

==== //depot/projects/vap/sys/dev/ath/ath_rate/onoe/onoe.c#9 (text+ko) ====

@@ -255,11 +255,12 @@
 ath_rate_ctl_start(struct ath_softc *sc, struct ieee80211_node *ni)
 {
 #define	RATE(_ix)	(ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL)
-	struct ieee80211com *ic = &sc->sc_ic;
+	struct ath_node *an = ATH_NODE(ni);
+	const struct ieee80211_txparam *tp = an->an_tp;
 	int srate;
 
 	KASSERT(ni->ni_rates.rs_nrates > 0, ("no rates"));
-	if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE) {
+	if (tp == NULL || tp->ucastrate == IEEE80211_FIXED_RATE_NONE) {
 		/*
 		 * No fixed rate is requested. For 11b start with
 		 * the highest negotiated rate; otherwise, for 11g
@@ -285,7 +286,7 @@
 		 */
 		/* NB: the rate set is assumed sorted */
 		srate = ni->ni_rates.rs_nrates - 1;
-		for (; srate >= 0 && RATE(srate) != ic->ic_fixed_rate; srate--)
+		for (; srate >= 0 && RATE(srate) != tp->ucastrate; srate--)
 			;
 	}
 	/*
@@ -310,22 +311,24 @@
  * Reset the rate control state for each 802.11 state transition.
  */
 void
-ath_rate_newstate(struct ath_softc *sc, enum ieee80211_state state)
+ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state)
 {
+	struct ieee80211com *ic = vap->iv_ic;
+	struct ath_softc *sc = ic->ic_ifp->if_softc;
 	struct onoe_softc *osc = (struct onoe_softc *) sc->sc_rc;
-	struct ieee80211com *ic = &sc->sc_ic;
+	const struct ieee80211_txparam *tp;
 	struct ieee80211_node *ni;
 
 	if (state == IEEE80211_S_INIT) {
 		callout_stop(&osc->timer);
 		return;
 	}
-	if (ic->ic_opmode == IEEE80211_M_STA) {
+	if (vap->iv_opmode == IEEE80211_M_STA) {
 		/*
 		 * Reset local xmit state; this is really only
 		 * meaningful when operating in station mode.
 		 */
-		ni = ic->ic_bss;
+		ni = vap->iv_bss;
 		if (state == IEEE80211_S_RUN) {
 			ath_rate_ctl_start(sc, ni);
 		} else {
@@ -339,9 +342,10 @@
 		 * tx rate state of each node.
 		 */
 		ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, sc);
-		ath_rate_update(sc, ic->ic_bss, 0);
+		ath_rate_update(sc, vap->iv_bss, 0);
 	}
-	if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE &&
+	tp = ATH_NODE(vap->iv_bss)->an_tp;
+	if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE &&
 	    state == IEEE80211_S_RUN) {
 		int interval;
 		/*
@@ -349,10 +353,10 @@
 		 * are not configured to use a fixed xmit rate.
 		 */
 		interval = ath_rateinterval;
-		if (ic->ic_opmode == IEEE80211_M_STA)
+		if (vap->iv_opmode == IEEE80211_M_STA)
 			interval /= 2;
 		callout_reset(&osc->timer, (interval * hz) / 1000,
-			ath_ratectl, sc->sc_ifp);
+			ath_ratectl, vap);
 	}
 }
 
@@ -430,25 +434,25 @@
 static void
 ath_ratectl(void *arg)
 {
-	struct ifnet *ifp = arg;
+	struct ieee80211vap *vap = arg;
+	struct ieee80211com *ic = vap->iv_ic;
+	struct ifnet *ifp = ic->ic_ifp;
 	struct ath_softc *sc = ifp->if_softc;
 	struct onoe_softc *osc = (struct onoe_softc *) sc->sc_rc;
-	struct ieee80211com *ic = &sc->sc_ic;
 	int interval;
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
 		sc->sc_stats.ast_rate_calls++;
 
-		if (ic->ic_opmode == IEEE80211_M_STA)
-			ath_rate_ctl(sc, ic->ic_bss);	/* NB: no reference */
+		if (vap->iv_opmode == IEEE80211_M_STA)
+			ath_rate_ctl(sc, vap->iv_bss);	/* NB: no reference */
 		else
 			ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_ctl, sc);
 	}
 	interval = ath_rateinterval;
-	if (ic->ic_opmode == IEEE80211_M_STA)
+	if (vap->iv_opmode == IEEE80211_M_STA)
 		interval /= 2;
-	callout_reset(&osc->timer, (interval * hz) / 1000,
-		ath_ratectl, sc->sc_ifp);
+	callout_reset(&osc->timer, (interval * hz) / 1000, ath_ratectl, arg);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802291947.m1TJlQ5u092189>