svn commit: r308267 - head/sys/dev/ath

Adrian Chadd adrian at FreeBSD.org
Thu Nov 3 23:05:40 UTC 2016


Author: adrian
Date: Thu Nov  3 23:05:39 2016
New Revision: 308267
URL: https://svnweb.freebsd.org/changeset/base/308267

Log:
  [ath] add the MIMO per-chain RSSI and noise floor information.
  
  This is a long time coming.  The general pieces have been floating around
  in a local repo since circa 2012 when I dropped the net80211 support
  into the tree.
  
  This allows the per-chain RSSI and NF to show up in 'ifconfig wlanX list sta'.
  I haven't yet implemented the EVM hookups so that'll show up; that'll come
  later.
  
  Thanks to Susie Hellings <susie at susie.id.au> who did the original work
  on this a looong time ago for a company we both worked at.

Modified:
  head/sys/dev/ath/if_ath_rx.c

Modified: head/sys/dev/ath/if_ath_rx.c
==============================================================================
--- head/sys/dev/ath/if_ath_rx.c	Thu Nov  3 22:51:38 2016	(r308266)
+++ head/sys/dev/ath/if_ath_rx.c	Thu Nov  3 23:05:39 2016	(r308267)
@@ -635,7 +635,9 @@ ath_rx_pkt(struct ath_softc *sc, struct 
     struct mbuf *m)
 {
 	uint64_t rstamp;
-	int len, type;
+	/* XXX TODO: make this an mbuf tag? */
+	struct ieee80211_rx_stats rxs;
+	int len, type, i;
 	struct ieee80211com *ic = &sc->sc_ic;
 	struct ieee80211_node *ni;
 	int is_good = 0;
@@ -904,6 +906,33 @@ rx_accept:
 		sc->sc_stats.ast_rx_agg++;
 #endif /* AH_SUPPORT_AR5416 */
 
+
+	/*
+	 * Populate the per-chain RSSI values where appropriate.
+	 */
+	bzero(&rxs, sizeof(rxs));
+	rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI |
+	    IEEE80211_R_C_CHAIN |
+	    IEEE80211_R_C_NF |
+	    IEEE80211_R_C_RSSI |
+	    IEEE80211_R_TSF64 |
+	    IEEE80211_R_TSF_START;	/* XXX TODO: validate */
+	rxs.c_rssi = rs->rs_rssi;
+	rxs.c_nf = nf;
+	rxs.c_chain = 3;	/* XXX TODO: check */
+	rxs.c_rx_tsf = rstamp;
+
+	for (i = 0; i < 3; i++) {
+		rxs.c_rssi_ctl[i] = rs->rs_rssi_ctl[i];
+		rxs.c_rssi_ext[i] = rs->rs_rssi_ext[i];
+		/*
+		 * XXX note: we currently don't track
+		 * per-chain noisefloor.
+		 */
+		rxs.c_nf_ctl[i] = nf;
+		rxs.c_nf_ext[i] = nf;
+	}
+
 	if (ni != NULL) {
 		/*
 		 * Only punt packets for ampdu reorder processing for
@@ -916,7 +945,8 @@ rx_accept:
 		/*
 		 * Sending station is known, dispatch directly.
 		 */
-		type = ieee80211_input(ni, m, rs->rs_rssi, nf);
+		(void) ieee80211_add_rx_params(m, &rxs);
+		type = ieee80211_input_mimo(ni, m);
 		ieee80211_free_node(ni);
 		m = NULL;
 		/*
@@ -929,7 +959,8 @@ rx_accept:
 		    rs->rs_keyix != HAL_RXKEYIX_INVALID)
 			is_good = 1;
 	} else {
-		type = ieee80211_input_all(ic, m, rs->rs_rssi, nf);
+		(void) ieee80211_add_rx_params(m, &rxs);
+		type = ieee80211_input_mimo_all(ic, m);
 		m = NULL;
 	}
 


More information about the svn-src-head mailing list