summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/marvell
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-02-10 20:48:22 +0100
committerKalle Valo <kvalo@codeaurora.org>2019-02-19 16:11:48 +0100
commitb723dbb313f09d238738dae5efd6d7c52f0fe25e (patch)
treea8fc9a29cabc8a3d55de673f44bdc5e897fb2df2 /drivers/net/wireless/marvell
parentlibertas_tf: move the banner to a more appropriate place (diff)
downloadlinux-b723dbb313f09d238738dae5efd6d7c52f0fe25e.tar.xz
linux-b723dbb313f09d238738dae5efd6d7c52f0fe25e.zip
libertas_tf: fix signal reporting
Instead of exposing the signal-to-noise ration, calculate the actual signal level taking the noise floor into account. Also, flip the SIGNAL_DBM bit on, so that mac80211 exposes the signal level along with the station info in scan results. This fills NetworkManager's "nmcli d wifi output" output with colors, bars and joy. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Reviewed-by: Steve deRosier <derosier@cal-sierra.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r--drivers/net/wireless/marvell/libertas_tf/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/marvell/libertas_tf/main.c b/drivers/net/wireless/marvell/libertas_tf/main.c
index 63f86001700a..4c5684e22112 100644
--- a/drivers/net/wireless/marvell/libertas_tf/main.c
+++ b/drivers/net/wireless/marvell/libertas_tf/main.c
@@ -562,7 +562,7 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
stats.flag |= RX_FLAG_FAILED_FCS_CRC;
stats.freq = priv->cur_freq;
stats.band = NL80211_BAND_2GHZ;
- stats.signal = prxpd->snr;
+ stats.signal = prxpd->snr - prxpd->nf;
priv->noise = prxpd->nf;
/* Marvell rate index has a hole at value 4 */
if (prxpd->rx_rate > 4)
@@ -626,6 +626,7 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
hw->queues = 1;
ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING);
+ ieee80211_hw_set(hw, SIGNAL_DBM);
hw->extra_tx_headroom = sizeof(struct txpd);
memcpy(priv->channels, lbtf_channels, sizeof(lbtf_channels));
memcpy(priv->rates, lbtf_rates, sizeof(lbtf_rates));