ath9k: fetch survey data for all channels
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 512-ath9k_survey_no_bogus_nf.patch
1 --- a/drivers/net/wireless/ath/ath9k/main.c
2 +++ b/drivers/net/wireless/ath/ath9k/main.c
3 @@ -2005,15 +2005,17 @@ static int ath9k_get_survey(struct ieee8
4 struct ath_wiphy *aphy = hw->priv;
5 struct ath_softc *sc = aphy->sc;
6 struct ath_hw *ah = sc->sc_ah;
7 - struct ath_common *common = ath9k_hw_common(ah);
8 struct ieee80211_conf *conf = &hw->conf;
9
10 if (idx != 0)
11 return -ENOENT;
12
13 survey->channel = conf->channel;
14 - survey->filled = SURVEY_INFO_NOISE_DBM;
15 - survey->noise = common->ani.noise_floor;
16 + survey->filled = 0;
17 + if (ah->curchan && ah->curchan->noisefloor) {
18 + survey->filled |= SURVEY_INFO_NOISE_DBM;
19 + survey->noise = ah->curchan->noisefloor;
20 + }
21
22 return 0;
23 }