Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Oct 2008 23:29:12 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 151532 for review
Message-ID:  <200810182329.m9INTCad077577@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810182329.m9INTCad077577>