linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Added get_survey callback in order to get channel noise
@ 2010-04-27 22:08 Benoit Papillault
  2010-04-27 22:17 ` Luis R. Rodriguez
  2010-04-28  7:00 ` Jouni Malinen
  0 siblings, 2 replies; 7+ messages in thread
From: Benoit Papillault @ 2010-04-27 22:08 UTC (permalink / raw)
  To: lrodriguez, jmalinen; +Cc: ath9k-devel, linux-wireless, Benoit Papillault


Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
 drivers/net/wireless/ath/ath9k/main.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c03821e..f0b2aa2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2047,6 +2047,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
 	return ret;
 }
 
+static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
+			     struct survey_info *survey)
+{
+	struct ath_wiphy *aphy = hw->priv;
+	struct ath_softc *sc = aphy->sc;
+	struct ath_hw *ah = sc->sc_ah;
+	struct ath_common *common = ath9k_hw_common(ah);
+	struct ieee80211_conf *conf = &hw->conf;
+
+	 if (idx != 0)
+		return -ENOENT;
+
+	survey->channel = conf->channel;
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = common->ani.noise_floor;
+
+	return 0;
+}
+
 static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
 {
 	struct ath_wiphy *aphy = hw->priv;
@@ -2122,6 +2141,7 @@ struct ieee80211_ops ath9k_ops = {
 	.set_tsf 	    = ath9k_set_tsf,
 	.reset_tsf 	    = ath9k_reset_tsf,
 	.ampdu_action       = ath9k_ampdu_action,
+	.get_survey	    = ath9k_get_survey,
 	.sw_scan_start      = ath9k_sw_scan_start,
 	.sw_scan_complete   = ath9k_sw_scan_complete,
 	.rfkill_poll        = ath9k_rfkill_poll_state,
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-29  0:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 22:08 [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit Papillault
2010-04-27 22:17 ` Luis R. Rodriguez
2010-04-28  7:00 ` Jouni Malinen
2010-04-28  8:01   ` kernel warning on 2.6.33 ath9k Xu, Martin
2010-04-28 14:04     ` John W. Linville
2010-04-29  0:39       ` Xu, Martin
2010-04-28 20:13   ` [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit PAPILLAULT

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).