PERFORCE change 137820 for review

Sam Leffler sam at FreeBSD.org
Sun Mar 16 02:59:55 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=137820

Change 137820 by sam at sam_ebb on 2008/03/16 02:59:46

	must check if cb hook is setup

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_amrr.c#8 edit
.. //depot/projects/vap/sys/net80211/ieee80211_proto.c#25 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_amrr.c#8 (text+ko) ====

@@ -172,7 +172,7 @@
 	struct ieee80211_amrr *amrr = amn->amn_amrr;
 	int rix;
 
-	if (is_enough(amn) && ticks - amn->amn_ticks > amrr->amrr_interval) {
+	if (is_enough(amn) && (ticks - amn->amn_ticks) > amrr->amrr_interval) {
 		rix = amrr_update(amrr, amn, ni);
 		if (rix != amn->amn_rix) {
 			/* update public rate */
@@ -180,6 +180,7 @@
 			    ni->ni_rates.rs_rates[rix] & IEEE80211_RATE_VAL;
 			amn->amn_rix = rix;
 		}
+		amn->amn_ticks = ticks;
 	} else
 		rix = amn->amn_rix;
 	return rix;

==== //depot/projects/vap/sys/net80211/ieee80211_proto.c#25 (text+ko) ====

@@ -1681,7 +1681,7 @@
 		vap->iv_newstate_cb = ieee80211_newstate_cb;
 	}
 	rc = vap->iv_newstate(vap, nstate, arg);
-	if (rc == 0)
+	if (rc == 0 && vap->iv_newstate_cb != NULL)
 		vap->iv_newstate_cb(vap, nstate, arg);
 done:
 	return rc;


More information about the p4-projects mailing list