summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Schurig <holgerschurig@gmail.com>2010-04-19 10:24:22 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-04-20 11:50:52 -0400
commit55ee82b500551f80720de57a00d2990d56cf08a8 (patch)
tree110eb832a72ac69b15ed8e8689143aa3c325b7c3
parent1289723ef238908ca8d95ff48a46ee0de970f882 (diff)
ath5k: basic support for survey
This adds the first element of survey data, the noise floor figure. Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 92327423325..a49ede7b87b 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -241,6 +241,8 @@ static int ath5k_set_key(struct ieee80211_hw *hw,
struct ieee80211_key_conf *key);
static int ath5k_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
+static int ath5k_get_survey(struct ieee80211_hw *hw,
+ int idx, struct survey_info *survey);
static u64 ath5k_get_tsf(struct ieee80211_hw *hw);
static void ath5k_set_tsf(struct ieee80211_hw *hw, u64 tsf);
static void ath5k_reset_tsf(struct ieee80211_hw *hw);
@@ -266,6 +268,7 @@ static const struct ieee80211_ops ath5k_hw_ops = {
.configure_filter = ath5k_configure_filter,
.set_key = ath5k_set_key,
.get_stats = ath5k_get_stats,
+ .get_survey = ath5k_get_survey,
.conf_tx = NULL,
.get_tsf = ath5k_get_tsf,
.set_tsf = ath5k_set_tsf,
@@ -3294,6 +3297,22 @@ ath5k_get_stats(struct ieee80211_hw *hw,
return 0;
}
+static int ath5k_get_survey(struct ieee80211_hw *hw, int idx,
+ struct survey_info *survey)
+{
+ struct ath5k_softc *sc = hw->priv;
+ struct ieee80211_conf *conf = &hw->conf;
+
+ if (idx != 0)
+ return -ENOENT;
+
+ survey->channel = conf->channel;
+ survey->filled = SURVEY_INFO_NOISE_DBM;
+ survey->noise = sc->ah->ah_noise_floor;
+
+ return 0;
+}
+
static u64
ath5k_get_tsf(struct ieee80211_hw *hw)
{