From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>,
linux-wireless@vger.kernel.org
Subject: [PATCH v3 4/7] mt76x02: minor beaconing init changes
Date: Wed, 30 Jan 2019 17:02:16 +0100 [thread overview]
Message-ID: <1548864139-27729-5-git-send-email-sgruszka@redhat.com> (raw)
In-Reply-To: <1548864139-27729-1-git-send-email-sgruszka@redhat.com>
Disable BEACON timer during init and configure interrupt registers
only for mmio devices.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
v3: do not move code to individual drivers, just mask it in common code
.../net/wireless/mediatek/mt76/mt76x02_util.c | 18 ++++++++++++------
1 file 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++)
--
2.19.2
next prev parent reply other threads:[~2019-01-30 16:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-30 16:02 [PATCH v3 0/7] mt76x02: Beacon support for USB Stanislaw Gruszka
2019-01-30 16:02 ` [PATCH v3 1/7] mt76x02: use mask for vifs Stanislaw Gruszka
2019-01-30 16:02 ` [PATCH v3 2/7] mt76x02: use commmon add interface for mt76x2u Stanislaw Gruszka
2019-01-30 16:02 ` [PATCH v3 3/7] mt76x02: initialize mutli bss mode when set up address Stanislaw Gruszka
2019-01-30 16:02 ` Stanislaw Gruszka [this message]
2019-01-30 16:02 ` [PATCH v3 5/7] mt76x02: init beacon config for mt76x2u Stanislaw Gruszka
2019-01-30 16:02 ` [PATCH v3 6/7] mt76: beaconing fixes for USB Stanislaw Gruszka
2019-01-30 16:02 ` [PATCH v3 7/7] mt76x02: enable support for IBSS and MESH Stanislaw Gruszka
2019-01-30 17:25 ` [PATCH v3 0/7] mt76x02: Beacon support for USB Felix Fietkau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1548864139-27729-5-git-send-email-sgruszka@redhat.com \
--to=sgruszka@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox