* [PATCH] ath5k: basic support for survey
@ 2010-04-19 8:24 Holger Schurig
0 siblings, 0 replies; only message in thread
From: Holger Schurig @ 2010-04-19 8:24 UTC (permalink / raw)
To: linux-wireless
This adds the first element of survey data, the noise floor figure.
Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
---
drivers/net/wireless/ath/ath5k/base.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
--- linux-wl.orig/drivers/net/wireless/ath/ath5k/base.c
+++ linux-wl/drivers/net/wireless/ath/ath5k/base.c
@@ -242,6 +242,8 @@ static int ath5k_set_key(struct ieee8021
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);
@@ -267,6 +269,7 @@ static const struct ieee80211_ops ath5k_
.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)
--
DH3HS, http://www.holgerschurig.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-19 8:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 8:24 [PATCH] ath5k: basic support for survey Holger Schurig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).