diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2019-01-30 17:02:16 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-02-18 19:54:32 +0100 |
commit | 39834c1293ca6bfd1456b8d0063e7bd76f94eaf1 (patch) | |
tree | ea28ff0c51d26d91cfdfe242c36a8dbd2ca3079d | |
parent | 0b2d27e5b82c78ac98a1106b3387910c643ee09c (diff) | |
download | linux-stable-39834c1293ca6bfd1456b8d0063e7bd76f94eaf1.tar.gz linux-stable-39834c1293ca6bfd1456b8d0063e7bd76f94eaf1.tar.bz2 linux-stable-39834c1293ca6bfd1456b8d0063e7bd76f94eaf1.zip |
mt76x02: minor beaconing init changes
Disable BEACON timer during init and configure interrupt registers
only for mmio devices.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index 1ecd4ef83c82..4bc0520da1c6 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -670,13 +670,19 @@ void mt76x02_init_beacon_config(struct mt76x02_dev *dev) { int i; - /* Fire a pre-TBTT interrupt 8 ms before TBTT */ - mt76_rmw_field(dev, MT_INT_TIMER_CFG, MT_INT_TIMER_CFG_PRE_TBTT, - 8 << 4); - mt76_rmw_field(dev, MT_INT_TIMER_CFG, MT_INT_TIMER_CFG_GP_TIMER, - MT_DFS_GP_INTERVAL); - mt76_wr(dev, MT_INT_TIMER_EN, 0); + if (mt76_is_mmio(dev)) { + /* Fire a pre-TBTT interrupt 8 ms before TBTT */ + mt76_rmw_field(dev, MT_INT_TIMER_CFG, MT_INT_TIMER_CFG_PRE_TBTT, + 8 << 4); + mt76_rmw_field(dev, MT_INT_TIMER_CFG, MT_INT_TIMER_CFG_GP_TIMER, + MT_DFS_GP_INTERVAL); + mt76_wr(dev, MT_INT_TIMER_EN, 0); + } + mt76_clear(dev, MT_BEACON_TIME_CFG, (MT_BEACON_TIME_CFG_TIMER_EN | + MT_BEACON_TIME_CFG_SYNC_MODE | + MT_BEACON_TIME_CFG_TBTT_EN | + MT_BEACON_TIME_CFG_BEACON_TX)); mt76_wr(dev, MT_BCN_BYPASS_MASK, 0xffff); for (i = 0; i < 8; i++) |