From owner-p4-projects@FreeBSD.ORG Sat Oct 18 23:29:13 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 63D31106568C; Sat, 18 Oct 2008 23:29:13 +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 2724C106569A for ; Sat, 18 Oct 2008 23:29:13 +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 154E68FC16 for ; Sat, 18 Oct 2008 23:29:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m9INTCIN077579 for ; Sat, 18 Oct 2008 23:29:12 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m9INTCad077577 for perforce@freebsd.org; Sat, 18 Oct 2008 23:29:12 GMT (envelope-from sam@freebsd.org) Date: Sat, 18 Oct 2008 23:29:12 GMT Message-Id: <200810182329.m9INTCad077577@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 151532 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: Sat, 18 Oct 2008 23:29:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=151532 Change 151532 by sam@sam_ebb on 2008/10/18 23:28:27 Fix statistic reporting: o return rx rssi again o return tx rssi as the filtered avg of ACK rssi (was rssi of last received ACK--modulo bugs about assuming frames were ack'd) o fix tx rate to mask out the basic rate bit (caused athstats to report MCS values) Affected files ... .. //depot/projects/vap/sys/dev/ath/if_ath.c#104 edit .. //depot/projects/vap/sys/dev/ath/if_athvar.h#33 edit Differences ... ==== //depot/projects/vap/sys/dev/ath/if_ath.c#104 (text+ko) ==== @@ -6364,12 +6364,12 @@ /* NB: embed these numbers to get a consistent view */ sc->sc_stats.ast_tx_packets = ifp->if_opackets; sc->sc_stats.ast_rx_packets = ifp->if_ipackets; -#if 0 - ieee80211_getsignal(ic, &sc->sc_stats.ast_rx_rssi, - &sc->sc_stats.ast_rx_noise); -#endif + sc->sc_stats.ast_tx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgtxrssi); + sc->sc_stats.ast_rx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgrssi); rt = sc->sc_currates; - sc->sc_stats.ast_tx_rate = rt->info[sc->sc_txrix].dot11Rate; + /* XXX HT rates */ + sc->sc_stats.ast_tx_rate = + rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC; return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); #ifdef ATH_DIAGAPI ==== //depot/projects/vap/sys/dev/ath/if_athvar.h#33 (text+ko) ==== @@ -100,6 +100,9 @@ if ((y) >= -20) \ x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \ } while (0) +#define ATH_EP_RND(x,mul) \ + ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul)) +#define ATH_RSSI(x) ATH_EP_RND(x, HAL_RSSI_EP_MULTIPLIER) struct ath_buf { STAILQ_ENTRY(ath_buf) bf_list;