mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-20 22:59:12 +07:00
mt7601u: remove warning when avg_rssi is zero
It turned out that we can run calibration without already received
frames with RSSI data. In such case just don't update AGC register
and don't print the warning.
Fixes: b305a6ab02
("mt7601u: use EWMA to calculate avg_rssi")
Reported-by: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
f8c095f679
commit
92963318a2
@ -986,13 +986,15 @@ static void mt7601u_agc_tune(struct mt7601u_dev *dev)
|
|||||||
*/
|
*/
|
||||||
spin_lock_bh(&dev->con_mon_lock);
|
spin_lock_bh(&dev->con_mon_lock);
|
||||||
avg_rssi = ewma_rssi_read(&dev->avg_rssi);
|
avg_rssi = ewma_rssi_read(&dev->avg_rssi);
|
||||||
WARN_ON_ONCE(avg_rssi == 0);
|
spin_unlock_bh(&dev->con_mon_lock);
|
||||||
|
if (avg_rssi == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
avg_rssi = -avg_rssi;
|
avg_rssi = -avg_rssi;
|
||||||
if (avg_rssi <= -70)
|
if (avg_rssi <= -70)
|
||||||
val -= 0x20;
|
val -= 0x20;
|
||||||
else if (avg_rssi <= -60)
|
else if (avg_rssi <= -60)
|
||||||
val -= 0x10;
|
val -= 0x10;
|
||||||
spin_unlock_bh(&dev->con_mon_lock);
|
|
||||||
|
|
||||||
if (val != mt7601u_bbp_rr(dev, 66))
|
if (val != mt7601u_bbp_rr(dev, 66))
|
||||||
mt7601u_bbp_wr(dev, 66, val);
|
mt7601u_bbp_wr(dev, 66, val);
|
||||||
|
Loading…
Reference in New Issue
Block a user