/* * Reset the rate control state for each 802.11 state transition. */ static void ath_rate_newstate(struct ieee80211vap *vap, enum ieee80211_state state) { struct ieee80211com *ic = vap->iv_ic; struct ath_softc *sc = ic->ic_dev->priv; struct ieee80211_node *ni; if (state == IEEE80211_S_INIT) return; if (vap->iv_opmode == IEEE80211_M_STA) { /* * Reset local xmit state; this is really only * meaningful when operating in station mode. */ ni = vap->iv_bss; if (state == IEEE80211_S_RUN) { ath_rate_ctl_start(sc, ni); } else { ath_rate_update(sc, ni, 0); } } else { /* * 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. */ ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, NULL); ath_rate_update(sc, vap->iv_bss, 0); } }
/* * Reset the rate control state for each 802.11 state transition. */ void ath_rate_newstate(struct ath_softc *sc, enum ieee80211_state state) { struct onoe_softc *osc = (struct onoe_softc *) sc->sc_rc; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; if (state == IEEE80211_S_INIT) { callout_stop(&osc->timer); return; } if (ic->ic_opmode == IEEE80211_M_STA) { /* * Reset local xmit state; this is really only * meaningful when operating in station mode. */ ni = ic->ic_bss; if (state == IEEE80211_S_RUN) { ath_rate_ctl_start(sc, ni); } else { ath_rate_update(sc, ni, 0); } } else { /* * 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. */ ieee80211_iterate_nodes(&ic->ic_sta, ath_rate_cb, sc); ath_rate_update(sc, ic->ic_bss, 0); } if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE && state == IEEE80211_S_RUN) { int interval; /* * Start the background rate control thread if we * are not configured to use a fixed xmit rate. */ interval = ath_rateinterval; if (ic->ic_opmode == IEEE80211_M_STA) interval /= 2; callout_reset(&osc->timer, (interval * hz) / 1000, ath_ratectl, &sc->sc_if); } }
/* * Reset the rate control state for each 802.11 state transition. */ void ath_rate_newstate(struct ath_softc *sc, enum ieee80211_state state) { struct amrr_softc *asc = (struct amrr_softc *) sc->sc_rc; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; if (state == IEEE80211_S_INIT) { del_timer(&asc->timer); return; } if (ic->ic_opmode == IEEE80211_M_STA) { /* * Reset local xmit state; this is really only * meaningful when operating in station mode. */ ni = ic->ic_bss; if (state == IEEE80211_S_RUN) { ath_rate_ctl_start(sc, ni); } else { ath_rate_update(sc, ni, 0); } } else { /* * 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) ath_rate_update(sc, ni, 0); /* use lowest rate */ ath_rate_update(sc, ic->ic_bss, 0); } if (ic->ic_fixed_rate == -1 && state == IEEE80211_S_RUN) { int interval; /* * Start the background rate control thread if we * are not configured to use a fixed xmit rate. */ interval = ath_rateinterval; if (ic->ic_opmode == IEEE80211_M_STA) interval /= 2; mod_timer(&asc->timer, jiffies + ((HZ * interval) / 1000)); } }
void ath_rate_newassoc(struct ath_softc *sc, struct ath_node *an, int isnew) { if (isnew) ath_rate_ctl_start(sc, &an->an_node); }