ath9k: use the new channel noise value for signal strength and survey info
authorFelix Fietkau <nbd@openwrt.org>
Thu, 28 Jul 2011 12:08:57 +0000 (14:08 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 8 Aug 2011 20:04:20 +0000 (16:04 -0400)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/recv.c

index 9098aaad97a92707bdf62d2dcbdcc4dcb38a7a15..b602447b0a880e5d9cba1b9891fde90012dd376e 100644 (file)
@@ -163,7 +163,7 @@ static void ath_update_survey_nf(struct ath_softc *sc, int channel)
 
        if (chan->noisefloor) {
                survey->filled |= SURVEY_INFO_NOISE_DBM;
-               survey->noise = chan->noisefloor;
+               survey->noise = ath9k_hw_getchan_noise(ah, chan);
        }
 }
 
index 9a4850154fb251246d07d6c3ae3935fb889769a7..a551a942027b601cafab1911197b66e6db6a9fed 100644 (file)
@@ -995,6 +995,8 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
                                   struct ieee80211_rx_status *rx_status,
                                   bool *decrypt_error)
 {
+       struct ath_hw *ah = common->ah;
+
        memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
 
        /*
@@ -1015,7 +1017,7 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
 
        rx_status->band = hw->conf.channel->band;
        rx_status->freq = hw->conf.channel->center_freq;
-       rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
+       rx_status->signal = ah->noise + rx_stats->rs_rssi;
        rx_status->antenna = rx_stats->rs_antenna;
        rx_status->flag |= RX_FLAG_MACTIME_MPDU;