From owner-p4-projects@FreeBSD.ORG Mon Mar 10 22:16:05 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B51551065675; Mon, 10 Mar 2008 22:16:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73CEF1065671 for ; Mon, 10 Mar 2008 22:16:05 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 4A0C18FC15 for ; Mon, 10 Mar 2008 22:16:05 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2AMG5vW054470 for ; Mon, 10 Mar 2008 22:16:05 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2AMG5WC054468 for perforce@freebsd.org; Mon, 10 Mar 2008 22:16:05 GMT (envelope-from sam@freebsd.org) Date: Mon, 10 Mar 2008 22:16:05 GMT Message-Id: <200803102216.m2AMG5WC054468@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 137363 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2008 22:16:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=137363 Change 137363 by sam@sam_ebb on 2008/03/10 22:15:31 use the new sta info data for the current tx rate so we can more accurately report ht rates Affected files ... .. //depot/projects/vap/sbin/ifconfig/ifieee80211.c#13 edit Differences ... ==== //depot/projects/vap/sbin/ifconfig/ifieee80211.c#13 (text+ko) ==== @@ -161,26 +161,6 @@ "sturbo", "11na", "11ng" }; -/* XXX need max array size */ -static const int htrates[16] = { - 13, /* IFM_IEEE80211_MCS0 */ - 26, /* IFM_IEEE80211_MCS1 */ - 39, /* IFM_IEEE80211_MCS2 */ - 52, /* IFM_IEEE80211_MCS3 */ - 78, /* IFM_IEEE80211_MCS4 */ - 104, /* IFM_IEEE80211_MCS5 */ - 117, /* IFM_IEEE80211_MCS6 */ - 130, /* IFM_IEEE80211_MCS7 */ - 26, /* IFM_IEEE80211_MCS8 */ - 52, /* IFM_IEEE80211_MCS9 */ - 78, /* IFM_IEEE80211_MCS10 */ - 104, /* IFM_IEEE80211_MCS11 */ - 156, /* IFM_IEEE80211_MCS12 */ - 208, /* IFM_IEEE80211_MCS13 */ - 234, /* IFM_IEEE80211_MCS14 */ - 260, /* IFM_IEEE80211_MCS15 */ -}; - static void set80211(int s, int type, int val, int len, void *data); static int get80211(int s, int type, void *data, int len); static int get80211len(int s, int type, void *data, int len, int *plen); @@ -3391,20 +3371,6 @@ #undef IEEE80211_NODE_QOS } -static int -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 si->isi_flags & IEEE80211_CHAN_HT40 ? - txrate : txrate / 2; - } else - return (txrate & IEEE80211_RATE_VAL) / 2; -} - static void list_stations(int s) { @@ -3455,7 +3421,7 @@ , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) , ieee80211_mhz2ieee(si->isi_freq, si->isi_flags) - , gettxrate(si) + , si->isi_txmbps/2 , si->isi_rssi/2. , si->isi_inact , gettxseq(si)