]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.2.7/mac80211-fix-driver-rssi-event-calculations.patch
Linux 4.2.7
[thirdparty/kernel/stable-queue.git] / releases / 4.2.7 / mac80211-fix-driver-rssi-event-calculations.patch
1 From 8ec6d97871f37e4743678ea4a455bd59580aa0f4 Mon Sep 17 00:00:00 2001
2 From: Johannes Berg <johannes.berg@intel.com>
3 Date: Fri, 28 Aug 2015 10:52:53 +0200
4 Subject: mac80211: fix driver RSSI event calculations
5
6 From: Johannes Berg <johannes.berg@intel.com>
7
8 commit 8ec6d97871f37e4743678ea4a455bd59580aa0f4 upstream.
9
10 The ifmgd->ave_beacon_signal value cannot be taken as is for
11 comparisons, it must be divided by since it's represented
12 like that for better accuracy of the EWMA calculations. This
13 would lead to invalid driver RSSI events. Fix the used value.
14
15 Fixes: 615f7b9bb1f8 ("mac80211: add driver RSSI threshold events")
16 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18
19 ---
20 net/mac80211/mlme.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 --- a/net/mac80211/mlme.c
24 +++ b/net/mac80211/mlme.c
25 @@ -3378,7 +3378,7 @@ static void ieee80211_rx_mgmt_beacon(str
26
27 if (ifmgd->rssi_min_thold != ifmgd->rssi_max_thold &&
28 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT) {
29 - int sig = ifmgd->ave_beacon_signal;
30 + int sig = ifmgd->ave_beacon_signal / 16;
31 int last_sig = ifmgd->last_ave_beacon_signal;
32 struct ieee80211_event event = {
33 .type = RSSI_EVENT,