summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/util.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-01-11 16:17:30 +0300
committerFelix Fietkau <nbd@nbd.name>2019-01-17 16:50:15 +0300
commit02e5a769c0a48e4e145b765329bc9d22a70261e7 (patch)
tree8afc87104ab1b8cf67c394a5debf4717a0824ceb /drivers/net/wireless/mediatek/mt76/util.c
parentef13edc0070818f5cddb3a1d31957cc618e25e9d (diff)
downloadlinux-02e5a769c0a48e4e145b765329bc9d22a70261e7.tar.xz
mt76: fix rssi ewma tracking
The generic EWMA code cannot deal with negative numbers, so convert signal to a positive number before adding it Fixes mt76x2 AGC tuning Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/util.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/util.c b/drivers/net/wireless/mediatek/mt76/util.c
index 6242421c6011..69270c1a9091 100644
--- a/drivers/net/wireless/mediatek/mt76/util.c
+++ b/drivers/net/wireless/mediatek/mt76/util.c
@@ -100,7 +100,7 @@ int mt76_get_min_avg_rssi(struct mt76_dev *dev)
spin_lock(&dev->rx_lock);
if (wcid->inactive_count++ < 5)
- cur_rssi = ewma_signal_read(&wcid->rssi);
+ cur_rssi = -ewma_signal_read(&wcid->rssi);
else
cur_rssi = 0;
spin_unlock(&dev->rx_lock);