summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-08-28 10:52:53 +0200
committerJohannes Berg <johannes.berg@intel.com>2015-09-22 15:21:26 +0200
commit8ec6d97871f37e4743678ea4a455bd59580aa0f4 (patch)
tree89e05759ba2a02463a5c5c52b79d93977ec2910d /net
parent8e0d7fe07c3f8c2a5e3b5bdbfdf09de4da2e2dd4 (diff)
downloadlinux-stable-8ec6d97871f37e4743678ea4a455bd59580aa0f4.tar.gz
linux-stable-8ec6d97871f37e4743678ea4a455bd59580aa0f4.tar.bz2
linux-stable-8ec6d97871f37e4743678ea4a455bd59580aa0f4.zip
mac80211: fix driver RSSI event calculations
The ifmgd->ave_beacon_signal value cannot be taken as is for comparisons, it must be divided by since it's represented like that for better accuracy of the EWMA calculations. This would lead to invalid driver RSSI events. Fix the used value. Fixes: 615f7b9bb1f8 ("mac80211: add driver RSSI threshold events") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index ce01cd3c8224..79cfc2b35ef0 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3380,7 +3380,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
if (ifmgd->rssi_min_thold != ifmgd->rssi_max_thold &&
ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT) {
- int sig = ifmgd->ave_beacon_signal;
+ int sig = ifmgd->ave_beacon_signal / 16;
int last_sig = ifmgd->last_ave_beacon_signal;
struct ieee80211_event event = {
.type = RSSI_EVENT,