1 --- a/drivers/net/wireless/ath/ath9k/main.c
2 +++ b/drivers/net/wireless/ath/ath9k/main.c
3 @@ -1995,16 +1995,31 @@ 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 ieee80211_conf *conf = &hw->conf;
8 + struct ieee80211_supported_band *sband;
9 + struct ath9k_channel *chan;
13 + sband = hw->wiphy->bands[IEEE80211_BAND_2GHZ];
14 + if (sband && idx >= sband->n_channels) {
15 + idx -= sband->n_channels;
20 + sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ];
22 + if (idx >= sband->n_channels)
25 - survey->channel = conf->channel;
26 + survey->channel = &sband->channels[idx];
27 + chan = &ah->channels[survey->channel->hw_value];
29 - if (ah->curchan && ah->curchan->noisefloor) {
31 + if (chan == ah->curchan)
32 + survey->filled |= SURVEY_INFO_IN_USE;
34 + if (chan->noisefloor) {
35 survey->filled |= SURVEY_INFO_NOISE_DBM;
36 - survey->noise = ah->curchan->noisefloor;
37 + survey->noise = chan->noisefloor;