aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2003-10-13 03:37:38 +0000
committerSam Leffler <sam@FreeBSD.org>2003-10-13 03:37:38 +0000
commit310e4a4ae64f6c4f919f42784a369632603bb0df (patch)
tree47a27d785c005577169a30407a9c573892c7322d /sys
parent50ac3f993968514dce23433facb14591cd7bbb29 (diff)
downloadsrc-310e4a4ae64f6c4f919f42784a369632603bb0df.tar.gz
src-310e4a4ae64f6c4f919f42784a369632603bb0df.zip
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ath/if_ath.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 06f11535695e..e766a38951ae 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -2565,20 +2565,13 @@ ath_rate_ctl_reset(struct ath_softc *sc, enum ieee80211_state state)
struct ieee80211_node *ni;
struct ath_node *an;
- an = (struct ath_node *) ic->ic_bss;
- an->an_tx_ok = an->an_tx_err = an->an_tx_retr = an->an_tx_upper = 0;
- if (ic->ic_opmode == IEEE80211_M_STA) {
- ni = ic->ic_bss;
- if (state == IEEE80211_S_RUN) {
- /* start with highest negotiated rate */
- KASSERT(ni->ni_rates.rs_nrates > 0,
- ("transition to RUN state w/ no rates!"));
- ni->ni_txrate = ni->ni_rates.rs_nrates - 1;
- } else {
- /* use lowest rate */
- ni->ni_txrate = 0;
- }
- } else {
+ if (ic->ic_opmode != IEEE80211_M_STA) {
+ /*
+ * 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) {
ni->ni_txrate = 0; /* use lowest rate */
an = (struct ath_node *) ni;
@@ -2586,6 +2579,22 @@ ath_rate_ctl_reset(struct ath_softc *sc, enum ieee80211_state state)
an->an_tx_upper = 0;
}
}
+ /*
+ * Reset local xmit state; this is really only meaningful
+ * when operating in station or adhoc mode.
+ */
+ ni = ic->ic_bss;
+ an = (struct ath_node *) ni;
+ an->an_tx_ok = an->an_tx_err = an->an_tx_retr = an->an_tx_upper = 0;
+ if (state == IEEE80211_S_RUN) {
+ /* start with highest negotiated rate */
+ KASSERT(ni->ni_rates.rs_nrates > 0,
+ ("transition to RUN state w/ no rates!"));
+ ni->ni_txrate = ni->ni_rates.rs_nrates - 1;
+ } else {
+ /* use lowest rate */
+ ni->ni_txrate = 0;
+ }
}
/*