From ef6f39e69e61e5fd28a1cc5eea71b9032b12d976 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 3 Feb 2008 18:29:58 +0000 Subject: correct tx rate displayed by list sta: the reported legacy tx rate is still an index into the rate set and not (yet) the rate code Noticed by: JoaoBR --- sbin/ifconfig/ifieee80211.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sbin') diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index bf829d5..97eed75 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -2056,14 +2056,17 @@ getrxseq(const struct ieee80211req_sta_info *si) } static int -gettxrate(int txrate, int chanflags) +gettxrate(const struct ieee80211req_sta_info *si) { + int txrate = si->isi_txrate; + if (txrate & 0x80) { txrate = htrates[txrate & 0xf]; /* NB: could bump this more based on short gi */ - return chanflags & IEEE80211_CHAN_HT40 ? txrate : txrate / 2; + return si->isi_flags & IEEE80211_CHAN_HT40 ? + txrate : txrate / 2; } else - return (txrate & IEEE80211_RATE_VAL) / 2; + return (si->isi_rates[txrate] & IEEE80211_RATE_VAL) / 2; } static void @@ -2116,7 +2119,7 @@ list_stations(int s) , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) , ieee80211_mhz2ieee(si->isi_freq, si->isi_flags) - , gettxrate(si->isi_txrate, si->isi_flags) + , gettxrate(si) , si->isi_rssi/2. , si->isi_inact , gettxseq(si) -- cgit v1.1