ath9k: do not return default noise floor values via survey
authorFelix Fietkau <nbd@openwrt.org>
Wed, 29 Sep 2010 15:15:28 +0000 (17:15 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 5 Oct 2010 17:35:22 +0000 (13:35 -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

index a133878826360d6856117b5ddad6935b5af1ba99..fcba402d5a1e7d4f86ffd78ffb4c130bcfd62bcf 100644 (file)
@@ -2004,15 +2004,17 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
        struct ath_wiphy *aphy = hw->priv;
        struct ath_softc *sc = aphy->sc;
        struct ath_hw *ah = sc->sc_ah;
-       struct ath_common *common = ath9k_hw_common(ah);
        struct ieee80211_conf *conf = &hw->conf;
 
         if (idx != 0)
                return -ENOENT;
 
        survey->channel = conf->channel;
-       survey->filled = SURVEY_INFO_NOISE_DBM;
-       survey->noise = common->ani.noise_floor;
+       survey->filled = 0;
+       if (ah->curchan && ah->curchan->noisefloor) {
+               survey->filled |= SURVEY_INFO_NOISE_DBM;
+               survey->noise = ah->curchan->noisefloor;
+       }
 
        return 0;
 }