From 2f4dcc2b3d4d6c9d7a0a5a3ecd3be073cd024d1e Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 29 Mar 2005 21:00:50 +0000 Subject: sync rates for any associated stations or neighbors on state transition --- sys/dev/ath/ath_rate/sample/sample.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/dev/ath/ath_rate/sample/sample.c b/sys/dev/ath/ath_rate/sample/sample.c index 3e8d25c..8a5d19c 100644 --- a/sys/dev/ath/ath_rate/sample/sample.c +++ b/sys/dev/ath/ath_rate/sample/sample.c @@ -725,6 +725,14 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni) #undef RATE } +static void +rate_cb(void *arg, struct ieee80211_node *ni) +{ + struct ath_softc *sc = arg; + + ath_rate_newassoc(sc, ATH_NODE(ni), 1); +} + /* * Reset the rate control state for each 802.11 state transition. */ @@ -733,8 +741,15 @@ ath_rate_newstate(struct ath_softc *sc, enum ieee80211_state state) { struct ieee80211com *ic = &sc->sc_ic; - if (state == IEEE80211_S_RUN) + if (state == IEEE80211_S_RUN) { + if (ic->ic_opmode != IEEE80211_M_STA) { + /* + * Sync rates for associated stations and neighbors. + */ + ieee80211_iterate_nodes(&ic->ic_sta, rate_cb, sc); + } ath_rate_newassoc(sc, ATH_NODE(ic->ic_bss), 1); + } } static void -- cgit v1.1