summaryrefslogtreecommitdiff
path: root/package/mac80211/patches/540-ath9k_fix_reported_signal_strength.patch
blob: 9e188fc627eea273bd307f8b380c36bbf4ff17f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -956,6 +956,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));
 
 	/*
@@ -976,7 +979,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 && ah->curchan->noisefloor)
+		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;