From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:41420 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752289AbcAEPaF (ORCPT ); Tue, 5 Jan 2016 10:30:05 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: Johannes Berg , Jiri Slaby Subject: [patch added to the 3.12 stable tree] mac80211: fix driver RSSI event calculations Date: Tue, 5 Jan 2016 16:28:30 +0100 Message-Id: <1452007726-3747-29-git-send-email-jslaby@suse.cz> In-Reply-To: <1452007726-3747-1-git-send-email-jslaby@suse.cz> References: <1452007726-3747-1-git-send-email-jslaby@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: From: Johannes Berg This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. =============== commit 8ec6d97871f37e4743678ea4a455bd59580aa0f4 upstream. 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 Signed-off-by: Jiri Slaby --- net/mac80211/mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 023bc33bab9a..914e1b66d4ee 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3042,7 +3042,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; /* -- 2.6.4