From eec88845953197c5a5957215528d10aea3e92c11 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Fri, 1 Jul 2016 19:58:13 +0000 Subject: [PATCH] [net80211] teach AMRR to log the initial MCS rate as "MCS X" Otheriwse it logs it as the rate value, which is 0x80 (MCS flag) + MCS, which isn't that helpful. Approved by: re (gjb) --- sys/net80211/ieee80211_amrr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c index 7460223556bc..3237c41bc1cb 100644 --- a/sys/net80211/ieee80211_amrr.c +++ b/sys/net80211/ieee80211_amrr.c @@ -220,10 +220,13 @@ amrr_node_init(struct ieee80211_node *ni) ni->ni_txrate = rate; amn->amn_ticks = ticks; + /* XXX TODO: we really need a rate-to-string method */ + /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, - "AMRR: nrates=%d, initial rate %d", + "AMRR: nrates=%d, initial rate %s%d", rs->rs_nrates, - rate); + amrr_node_is_11n(ni) ? "MCS " : "", + rate & IEEE80211_RATE_VAL); } static void @@ -249,6 +252,8 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, rs = &ni->ni_rates; } + /* XXX TODO: we really need a rate-to-string method */ + /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR: current rate %d, txcnt=%d, retrycnt=%d", rs->rs_rates[rix] & IEEE80211_RATE_VAL, @@ -270,6 +275,8 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, amn->amn_recovery = 1; amn->amn_success = 0; rix++; + /* XXX TODO: we really need a rate-to-string method */ + /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR increasing rate %d (txcnt=%d retrycnt=%d)", rs->rs_rates[rix] & IEEE80211_RATE_VAL, @@ -291,6 +298,8 @@ amrr_update(struct ieee80211_amrr *amrr, struct ieee80211_amrr_node *amn, amrr->amrr_min_success_threshold; } rix--; + /* XXX TODO: we really need a rate-to-string method */ + /* XXX TODO: non-11n rate should be divided by two.. */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_RATECTL, ni, "AMRR decreasing rate %d (txcnt=%d retrycnt=%d)", rs->rs_rates[rix] & IEEE80211_RATE_VAL,