wifi: mt76: mt7603: fix beacon interval after disabling a single vif
authorFelix Fietkau <nbd@nbd.name>
Tue, 25 Jul 2023 10:37:59 +0000 (12:37 +0200)
committerFelix Fietkau <nbd@nbd.name>
Wed, 26 Jul 2023 09:15:04 +0000 (11:15 +0200)
When disabling beacons on a vif, intval is 0. Ensure that dev->mt76.beacon_int
is not overwritten in this case, so that beacons continue to work for other
interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7603/beacon.c

index b65b0a88c1ded99ceef934367b72876300a57b20..888678732f2906467da5056c658a5054135f3a7d 100644 (file)
@@ -161,7 +161,8 @@ void mt7603_beacon_set_timer(struct mt7603_dev *dev, int idx, int intval)
                return;
        }
 
-       dev->mt76.beacon_int = intval;
+       if (intval)
+               dev->mt76.beacon_int = intval;
        mt76_wr(dev, MT_TBTT,
                FIELD_PREP(MT_TBTT_PERIOD, intval) | MT_TBTT_CAL_ENABLE);