aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas_tf
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas_tf')
-rw-r--r--drivers/net/wireless/libertas_tf/libertas_tf.h3
-rw-r--r--drivers/net/wireless/libertas_tf/main.c18
2 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas_tf/libertas_tf.h b/drivers/net/wireless/libertas_tf/libertas_tf.h
index 737eac92ef72..ad77b92d0b41 100644
--- a/drivers/net/wireless/libertas_tf/libertas_tf.h
+++ b/drivers/net/wireless/libertas_tf/libertas_tf.h
@@ -253,6 +253,9 @@ struct lbtf_private {
253 u8 fw_ready; 253 u8 fw_ready;
254 u8 surpriseremoved; 254 u8 surpriseremoved;
255 struct sk_buff_head bc_ps_buf; 255 struct sk_buff_head bc_ps_buf;
256
257 /* Most recently reported noise in dBm */
258 s8 noise;
256}; 259};
257 260
258/* 802.11-related definitions */ 261/* 802.11-related definitions */
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 817fffc0de4b..9278b3c8ee30 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -525,6 +525,22 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw,
525 lbtf_deb_leave(LBTF_DEB_MACOPS); 525 lbtf_deb_leave(LBTF_DEB_MACOPS);
526} 526}
527 527
528static int lbtf_op_get_survey(struct ieee80211_hw *hw, int idx,
529 struct survey_info *survey)
530{
531 struct lbtf_private *priv = hw->priv;
532 struct ieee80211_conf *conf = &hw->conf;
533
534 if (idx != 0)
535 return -ENOENT;
536
537 survey->channel = conf->channel;
538 survey->filled = SURVEY_INFO_NOISE_DBM;
539 survey->noise = priv->noise;
540
541 return 0;
542}
543
528static const struct ieee80211_ops lbtf_ops = { 544static const struct ieee80211_ops lbtf_ops = {
529 .tx = lbtf_op_tx, 545 .tx = lbtf_op_tx,
530 .start = lbtf_op_start, 546 .start = lbtf_op_start,
@@ -535,6 +551,7 @@ static const struct ieee80211_ops lbtf_ops = {
535 .prepare_multicast = lbtf_op_prepare_multicast, 551 .prepare_multicast = lbtf_op_prepare_multicast,
536 .configure_filter = lbtf_op_configure_filter, 552 .configure_filter = lbtf_op_configure_filter,
537 .bss_info_changed = lbtf_op_bss_info_changed, 553 .bss_info_changed = lbtf_op_bss_info_changed,
554 .get_survey = lbtf_op_get_survey,
538}; 555};
539 556
540int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) 557int 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)
555 stats.freq = priv->cur_freq; 572 stats.freq = priv->cur_freq;
556 stats.band = IEEE80211_BAND_2GHZ; 573 stats.band = IEEE80211_BAND_2GHZ;
557 stats.signal = prxpd->snr; 574 stats.signal = prxpd->snr;
575 priv->noise = prxpd->nf;
558 /* Marvell rate index has a hole at value 4 */ 576 /* Marvell rate index has a hole at value 4 */
559 if (prxpd->rx_rate > 4) 577 if (prxpd->rx_rate > 4)
560 --prxpd->rx_rate; 578 --prxpd->rx_rate;