mt7601u: use EWMA to calculate avg_rssi
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 16 Apr 2018 11:56:17 +0000 (13:56 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 24 Apr 2018 17:33:02 +0000 (20:33 +0300)
commitb305a6ab02475f52ef604b36e4cecd3bf4aa5eb7
tree6cc4efa47af1e17075cfd80e131fef7ba5cd5d81
parentb9e5d4feb4fc0ec0823e5da3bdea1c01d38f448e
mt7601u: use EWMA to calculate avg_rssi

avr_rssi is not calculated correctly as we do not divide result
by 256 (mt76 sum avg_rssi1 and avg_rssi2 and divide by 512).
However dividing by 256 will make avg_rssi almost the same as
last rssi value - not really an average. So use EWMA to calculate
avg_rssi. I've chosen weight_rcp=4 to convergence quicker on signal
strength changes.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt7601u/mac.c
drivers/net/wireless/mediatek/mt7601u/mt7601u.h
drivers/net/wireless/mediatek/mt7601u/phy.c