From 110148ca048ae2feea628b70440a3c4b3d519621 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 30 Mar 2011 11:38:39 +0000 Subject: [PATCH] ath9k: fix reported signal strength git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26368 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- ...0-ath9k_fix_reported_signal_strength.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/mac80211/patches/560-ath9k_fix_reported_signal_strength.patch diff --git a/package/mac80211/patches/560-ath9k_fix_reported_signal_strength.patch b/package/mac80211/patches/560-ath9k_fix_reported_signal_strength.patch new file mode 100644 index 0000000000..2fa4c44284 --- /dev/null +++ b/package/mac80211/patches/560-ath9k_fix_reported_signal_strength.patch @@ -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; +