Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openwrt/mt76.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/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-11 17:24:32 +0300
commitd77c861208a47d8c6864ade7039c9cdfa978fd32 (patch)
tree3c5cf39bba385f24f29361e2ce38ef553696d1b7 /util.c
parent2ad54b2f2577855e24d59256bf12d419951a96b5 (diff)
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 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 6242421c..69270c1a 100644
--- a/util.c
+++ b/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);