From 4936c0cef082bcd820e232e37045d334d047876b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 15 Jun 2018 18:56:57 +0200 Subject: [PATCH] mt76x2: clear false CCA counters after changing gain settings They will be read on the next calibration step without gain change and must not count earlier events Signed-off-by: Felix Fietkau --- mt76x2_phy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mt76x2_phy.c b/mt76x2_phy.c index a2c3f0e3..51fd7ddf 100644 --- a/mt76x2_phy.c +++ b/mt76x2_phy.c @@ -559,6 +559,9 @@ mt76x2_phy_update_channel_gain(struct mt76x2_dev *dev) dev->cal.agc_gain_cur[1] = gain[1] - gain_delta; dev->cal.agc_gain_adjust = 0; mt76x2_phy_set_gain_val(dev); + + /* clear false CCA counters */ + mt76_rr(dev, MT_RX_STAT_1); } int mt76x2_phy_set_channel(struct mt76x2_dev *dev,