From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 4/7] mt76x02: minor beaconing init changes
Date: Thu, 24 Jan 2019 23:32:15 +0100 [thread overview]
Message-ID: <20190124223213.GB2873@localhost.localdomain> (raw)
In-Reply-To: <1548344649-10404-5-git-send-email-sgruszka@redhat.com>
> Disable BEACON timer during init and remove interrupt registers
> initialization form generic code since they are PCIe specific.
>
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt76x0/pci.c | 7 +++++++
> drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 11 ++++-------
> drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c | 8 ++++++++
> 3 files changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> index 1472c8699b29..cb68af5b7478 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> @@ -128,6 +128,13 @@ static int mt76x0e_register_device(struct mt76x02_dev *dev)
> if (err < 0)
> return err;
>
> + /* Beaconing: 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);
What about having a dedicated routine for that configuration since we need it
for mt76x2 and mt76x0 drivers?
> +
> if (mt76_chip(&dev->mt76) == 0x7610) {
> u16 val;
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> index 02139dce4800..741ecd723b8e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> @@ -667,13 +667,10 @@ 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);
> -
> + 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++)
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
> index 0ccaa64d97ec..f86ff035fa7f 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
> @@ -121,6 +121,14 @@ static int mt76x2_mac_reset(struct mt76x02_dev *dev, bool hard)
>
> mt76x02_mac_setaddr(dev, macaddr);
> mt76x02_init_beacon_config(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);
> +
> if (!hard)
> return 0;
>
> --
> 1.9.3
>
next prev parent reply other threads:[~2019-01-24 22:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-24 15:44 [PATCH 0/7] mt76x02: Beacon support for USB Stanislaw Gruszka
2019-01-24 15:44 ` [PATCH 1/7] mt76x02: use mask for vifs Stanislaw Gruszka
2019-01-24 16:12 ` Lorenzo Bianconi
2019-01-24 16:20 ` Stanislaw Gruszka
2019-01-24 16:35 ` Lorenzo Bianconi
2019-01-24 22:20 ` Lorenzo Bianconi
2019-01-25 8:25 ` Stanislaw Gruszka
2019-01-25 9:02 ` Lorenzo Bianconi
2019-01-25 9:06 ` Stanislaw Gruszka
2019-01-25 9:47 ` Stanislaw Gruszka
2019-01-25 10:25 ` Lorenzo Bianconi
2019-01-25 12:41 ` Stanislaw Gruszka
2019-01-28 8:41 ` Felix Fietkau
2019-01-28 9:02 ` Stanislaw Gruszka
2019-01-28 11:16 ` Stanislaw Gruszka
2019-01-28 12:29 ` Felix Fietkau
2019-01-28 13:04 ` Stanislaw Gruszka
2019-01-24 15:44 ` [PATCH 2/7] mt76x02: use commmon add interface for mt76x2u Stanislaw Gruszka
2019-01-24 15:44 ` [PATCH 3/7] mt76x02: initialize mutli bss mode when set up address Stanislaw Gruszka
2019-01-24 15:44 ` [PATCH 4/7] mt76x02: minor beaconing init changes Stanislaw Gruszka
2019-01-24 22:32 ` Lorenzo Bianconi [this message]
2019-01-24 15:44 ` [PATCH 5/7] mt76x02: init beacon config for mt76x2u Stanislaw Gruszka
2019-01-24 22:33 ` Lorenzo Bianconi
2019-01-24 15:44 ` [PATCH 6/7] mt76: beaconing fixes for USB Stanislaw Gruszka
2019-01-24 22:50 ` Lorenzo Bianconi
2019-01-28 8:30 ` Stanislaw Gruszka
2019-01-24 15:44 ` [PATCH 7/7] mt76x02: enable support for IBSS, AP and MESH Stanislaw Gruszka
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=20190124223213.GB2873@localhost.localdomain \
--to=lorenzo.bianconi@redhat.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=sgruszka@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).