From e1c59d4730a8706d0f049c0c59a704532b5cd198 Mon Sep 17 00:00:00 2001 From: Alexander Egorenkov Date: Fri, 26 Feb 2010 08:31:28 +0100 Subject: [PATCH] Store last RSSI dBm per node --- rt2860.c | 8 +++++++- rt2860_softc.h | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rt2860.c b/rt2860.c index dcf7519..afa0451 100644 --- a/rt2860.c +++ b/rt2860.c @@ -4973,6 +4973,7 @@ static int rt2860_rx_eof(struct rt2860_softc *sc, int limit) struct ieee80211com *ic; struct ieee80211_frame *wh; struct ieee80211_node *ni; + struct rt2860_softc_node *rni; struct rt2860_softc_rx_radiotap_header *tap; struct rt2860_softc_rx_ring *ring; struct rt2860_rxdesc *desc; @@ -4984,7 +4985,7 @@ static int rt2860_rx_eof(struct rt2860_softc *sc, int limit) uint32_t index, desc_flags; uint8_t cipher_err, rssi, ant, phymode, bw, shortgi, mcs; int8_t rssi_dbm; - int error, nsegs, len, ampdu, amsdu, rssi_dbm_rel, nframes; + int error, nsegs, len, ampdu, amsdu, rssi_dbm_rel, nframes, i; ifp = sc->ifp; ic = ifp->if_l2com; @@ -5227,6 +5228,11 @@ static int rt2860_rx_eof(struct rt2860_softc *sc, int limit) ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *) wh); if (ni != NULL) { + rni = (struct rt2860_softc_node *) ni; + + for (i = 0; i < RT2860_SOFTC_RSSI_DBM_COUNT; i++) + rni->last_rssi_dbm[i] = rt2860_rssi2dbm(sc, rxwi->rssi[i], i); + ieee80211_input(ni, m, rssi_dbm_rel, RT2860_NOISE_FLOOR); ieee80211_free_node(ni); } diff --git a/rt2860_softc.h b/rt2860_softc.h index 73ec16f..9929342 100644 --- a/rt2860_softc.h +++ b/rt2860_softc.h @@ -78,6 +78,8 @@ #define RT2860_SOFTC_AMRR_NODE_COUNT 256 +#define RT2860_SOFTC_RSSI_DBM_COUNT 3 + #define RT2860_SOFTC_TX_RING_COUNT 6 #define RT2860_SOFTC_RX_RING_DATA_COUNT 128 @@ -151,6 +153,8 @@ struct rt2860_softc_tx_ring struct rt2860_softc_node { struct ieee80211_node ni; + + int8_t last_rssi_dbm[RT2860_SOFTC_RSSI_DBM_COUNT]; }; struct rt2860_softc_vap -- 2.11.4.GIT