diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -138,25 +138,6 @@ nrefs--; /* XXX locking */ } -/* - * Return whether 11n rates are possible. - * - * Some 11n devices may return HT information but no HT rates. - * Thus, we shouldn't treat them as an 11n node. - */ -static int -amrr_node_is_11n(struct ieee80211_node *ni) -{ - - if (ni->ni_chan == NULL) - return (0); - if (ni->ni_chan == IEEE80211_CHAN_ANYC) - return (0); - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && ni->ni_htrates.rs_nrates == 0) - return (0); - return (IEEE80211_IS_CHAN_HT(ni->ni_chan)); -} - static void amrr_node_init(struct ieee80211_node *ni) { @@ -189,7 +170,7 @@ amn->amn_success_threshold = amrr->amrr_min_success_threshold; /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "%s: 11n node", __func__); @@ -204,7 +185,7 @@ rate = rs->rs_rates[0]; /* XXX clear the basic rate flag if it's not 11n */ - if (! amrr_node_is_11n(ni)) + if (! ieee80211_ht_check_tx_ht(ni)) rate &= IEEE80211_RATE_VAL; /* pick initial rate from the rateset - HT or otherwise */ @@ -213,7 +194,7 @@ amn->amn_rix--) { /* legacy - anything < 36mbit, stop searching */ /* 11n - stop at MCS4 */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { if ((rs->rs_rates[amn->amn_rix] & 0x1f) < 4) break; } else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72) @@ -222,7 +203,7 @@ rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; /* if the rate is an 11n rate, ensure the MCS bit is set */ - if (amrr_node_is_11n(ni)) + if (ieee80211_ht_check_tx_ht(ni)) rate |= IEEE80211_RATE_MCS; /* Assign initial rate from the rateset */ @@ -234,7 +215,7 @@ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR: nrates=%d, initial rate %s%d", rs->rs_nrates, - amrr_node_is_11n(ni) ? "MCS " : "", + ieee80211_ht_check_tx_ht(ni) ? "MCS " : "", rate & IEEE80211_RATE_VAL); } @@ -254,7 +235,7 @@ KASSERT(is_enough(amn), ("txcnt %d", amn->amn_txcnt)); /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ rs = (struct ieee80211_rateset *) &ni->ni_htrates; } else { @@ -347,7 +328,7 @@ amrr = amn->amn_amrr; /* 11n or not? Pick the right rateset */ - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { /* XXX ew */ rs = (struct ieee80211_rateset *) &ni->ni_htrates; } else { @@ -360,7 +341,7 @@ /* update public rate */ ni->ni_txrate = rs->rs_rates[rix]; /* XXX strip basic rate flag from txrate, if non-11n */ - if (amrr_node_is_11n(ni)) + if (ieee80211_ht_check_tx_ht(ni)) ni->ni_txrate |= IEEE80211_RATE_MCS; else ni->ni_txrate &= IEEE80211_RATE_VAL; @@ -482,7 +463,7 @@ int rate; struct ieee80211_rateset *rs; - if (amrr_node_is_11n(ni)) { + if (ieee80211_ht_check_tx_ht(ni)) { rs = (struct ieee80211_rateset *) &ni->ni_htrates; rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; sbuf_printf(s, "rate: MCS %d\n", rate);