linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ath9k: fix signal strength of received packets
@ 2011-04-02  1:39 Felix Fietkau
  2011-04-02  1:39 ` [PATCH 2/3] ath9k: fix beacon slot processing in ad-hoc mode Felix Fietkau
  2011-04-05 18:07 ` [PATCH 1/3] ath9k: fix signal strength of received packets Senthil Balasubramanian
  0 siblings, 2 replies; 5+ messages in thread
From: Felix Fietkau @ 2011-04-02  1:39 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, lrodriguez

The reported RSSI values are relative to the calibrated noise floor, not
relative to a hardcoded value of -95.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/recv.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index a9c3f46..87d96c5 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -959,6 +959,9 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
 				   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));
 
 	/*
@@ -979,7 +982,13 @@ static int ath9k_rx_skb_preprocess(struct ath_common *common,
 
 	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;
 
-- 
1.7.3.2


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

end of thread, other threads:[~2011-04-05 18:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-02  1:39 [PATCH 1/3] ath9k: fix signal strength of received packets Felix Fietkau
2011-04-02  1:39 ` [PATCH 2/3] ath9k: fix beacon slot processing in ad-hoc mode Felix Fietkau
2011-04-02  1:39   ` [PATCH 3/3] ath9k: use the hw opmode to select the beacon timer mode Felix Fietkau
2011-04-05 18:07 ` [PATCH 1/3] ath9k: fix signal strength of received packets Senthil Balasubramanian
2011-04-05 18:19   ` Felix Fietkau

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