From 1f05233506c4f60763dc1530bfbfa21de9c7a9d8 Mon Sep 17 00:00:00 2001 From: "John W. Linville" Date: Wed, 28 Jul 2010 15:03:42 -0400 Subject: [PATCH] --- yaml --- r: 203935 b: refs/heads/master c: bef9cb589d37c5eb2e3fb9e529fa3933db4dda19 h: refs/heads/master i: 203933: 772070b99d724a9515fb4f12da813e53e1b804a1 203931: fe265a5718f694fa81c5a446a0c079158b7d2ec1 203927: 2dfffc02359078672b12bf69a32ad7ff97b5914f 203919: fdf294c1b72c0f41a38b0f20105366276f3361cb 203903: 922ad8bf5638d6a95853edb1079a2bd241e7ac5d v: v3 --- [refs] | 2 +- .../net/wireless/libertas_tf/libertas_tf.h | 3 +++ trunk/drivers/net/wireless/libertas_tf/main.c | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index b2357796b4ec..eef3e5620577 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 19434148d16dc231026f37af7c40e81ad9342e75 +refs/heads/master: bef9cb589d37c5eb2e3fb9e529fa3933db4dda19 diff --git a/trunk/drivers/net/wireless/libertas_tf/libertas_tf.h b/trunk/drivers/net/wireless/libertas_tf/libertas_tf.h index 737eac92ef72..ad77b92d0b41 100644 --- a/trunk/drivers/net/wireless/libertas_tf/libertas_tf.h +++ b/trunk/drivers/net/wireless/libertas_tf/libertas_tf.h @@ -253,6 +253,9 @@ struct lbtf_private { u8 fw_ready; u8 surpriseremoved; struct sk_buff_head bc_ps_buf; + + /* Most recently reported noise in dBm */ + s8 noise; }; /* 802.11-related definitions */ diff --git a/trunk/drivers/net/wireless/libertas_tf/main.c b/trunk/drivers/net/wireless/libertas_tf/main.c index 817fffc0de4b..9278b3c8ee30 100644 --- a/trunk/drivers/net/wireless/libertas_tf/main.c +++ b/trunk/drivers/net/wireless/libertas_tf/main.c @@ -525,6 +525,22 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw, lbtf_deb_leave(LBTF_DEB_MACOPS); } +static int lbtf_op_get_survey(struct ieee80211_hw *hw, int idx, + struct survey_info *survey) +{ + struct lbtf_private *priv = 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 = priv->noise; + + return 0; +} + static const struct ieee80211_ops lbtf_ops = { .tx = lbtf_op_tx, .start = lbtf_op_start, @@ -535,6 +551,7 @@ static const struct ieee80211_ops lbtf_ops = { .prepare_multicast = lbtf_op_prepare_multicast, .configure_filter = lbtf_op_configure_filter, .bss_info_changed = lbtf_op_bss_info_changed, + .get_survey = lbtf_op_get_survey, }; int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) @@ -555,6 +572,7 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) stats.freq = priv->cur_freq; stats.band = IEEE80211_BAND_2GHZ; stats.signal = prxpd->snr; + priv->noise = prxpd->nf; /* Marvell rate index has a hole at value 4 */ if (prxpd->rx_rate > 4) --prxpd->rx_rate;