diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-09-29 13:12:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-05 13:35:22 -0400 |
commit | 39162dbe813a2c90b7b9018a74dc1befb9ff4205 (patch) | |
tree | 10bd788a67a55e4eb32bf8627a94351b6b39a975 /drivers/net | |
parent | 17e5a8082894a4b66cb69e7ec16074f0f01281e1 (diff) |
ath9k: return survey data for all channels instead of just the current one
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index a801a08c4da2..49ea45896b89 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1994,16 +1994,31 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, | |||
1994 | struct ath_wiphy *aphy = hw->priv; | 1994 | struct ath_wiphy *aphy = hw->priv; |
1995 | struct ath_softc *sc = aphy->sc; | 1995 | struct ath_softc *sc = aphy->sc; |
1996 | struct ath_hw *ah = sc->sc_ah; | 1996 | struct ath_hw *ah = sc->sc_ah; |
1997 | struct ieee80211_conf *conf = &hw->conf; | 1997 | struct ieee80211_supported_band *sband; |
1998 | struct ath9k_channel *chan; | ||
1999 | |||
2000 | sband = hw->wiphy->bands[IEEE80211_BAND_2GHZ]; | ||
2001 | if (sband && idx >= sband->n_channels) { | ||
2002 | idx -= sband->n_channels; | ||
2003 | sband = NULL; | ||
2004 | } | ||
1998 | 2005 | ||
1999 | if (idx != 0) | 2006 | if (!sband) |
2000 | return -ENOENT; | 2007 | sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ]; |
2001 | 2008 | ||
2002 | survey->channel = conf->channel; | 2009 | if (!sband || idx >= sband->n_channels) |
2010 | return -ENOENT; | ||
2011 | |||
2012 | survey->channel = &sband->channels[idx]; | ||
2013 | chan = &ah->channels[survey->channel->hw_value]; | ||
2003 | survey->filled = 0; | 2014 | survey->filled = 0; |
2004 | if (ah->curchan && ah->curchan->noisefloor) { | 2015 | |
2016 | if (chan == ah->curchan) | ||
2017 | survey->filled |= SURVEY_INFO_IN_USE; | ||
2018 | |||
2019 | if (chan->noisefloor) { | ||
2005 | survey->filled |= SURVEY_INFO_NOISE_DBM; | 2020 | survey->filled |= SURVEY_INFO_NOISE_DBM; |
2006 | survey->noise = ah->curchan->noisefloor; | 2021 | survey->noise = chan->noisefloor; |
2007 | } | 2022 | } |
2008 | 2023 | ||
2009 | return 0; | 2024 | return 0; |