summaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/512-ath9k_survey_no_bogus_nf.patch
blob: 798e59c3abeada79620e3594de3cd3323735e4b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2005,15 +2005,17 @@ static int ath9k_get_survey(struct ieee8
 	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;
 }