[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@susie.id.au> who did the original work
on this a looong time ago for a company we both worked at.
This commit is contained in:
adrian 2016-11-03 23:05:39 +00:00
parent 13d9c12d58
commit 806cb8b636

View File

@ -635,7 +635,9 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status,
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 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status,
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 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status,
/*
* 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 @@ ath_rx_pkt(struct ath_softc *sc, struct ath_rx_status *rs, HAL_STATUS status,
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;
}