ath9k: fix reported signal strength

SVN-Revision: 26368
This commit is contained in:
Felix Fietkau 2011-03-30 11:38:39 +00:00
parent 08eca8da80
commit 15e79b479a

View file

@ -0,0 +1,27 @@
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -957,6 +957,9 @@ static int ath9k_rx_skb_preprocess(struc
struct ieee80211_rx_status *rx_status,
bool *decrypt_error)
{
+ struct ath_hw *ah = common->ah;
+ int noise;
+
memset(rx_status, 0, sizeof(struct ieee80211_rx_status));
/*
@@ -977,7 +980,13 @@ static int ath9k_rx_skb_preprocess(struc
rx_status->band = hw->conf.channel->band;
rx_status->freq = hw->conf.channel->center_freq;
- rx_status->signal = ATH_DEFAULT_NOISE_FLOOR + rx_stats->rs_rssi;
+
+ if (ah->curchan)
+ noise = ah->curchan->noisefloor;
+ else
+ noise = ATH_DEFAULT_NOISE_FLOOR;
+
+ rx_status->signal = noise + rx_stats->rs_rssi;
rx_status->antenna = rx_stats->rs_antenna;
rx_status->flag |= RX_FLAG_MACTIME_MPDU;