From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Bo Jiao <bo.jiao@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
linux-wireless <linux-wireless@vger.kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Xing Song <xing.song@mediatek.com>,
Sujuan Chen <sujuan.chen@mediatek.com>,
Shayne Chen <shayne.chen@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH 06/11] mt76: mt7915: enlarge wcid size to 544
Date: Thu, 28 Oct 2021 10:58:57 +0200 [thread overview]
Message-ID: <YXpmUTtEu4JrshpY@lore-desk> (raw)
In-Reply-To: <c4c83998a000a6bbbfbbe9d9f179a73e8d6b4e25.1635323366.git.Bo.Jiao@mediatek.com>
[-- Attachment #1: Type: text/plain, Size: 3523 bytes --]
> From: Bo Jiao <Bo.Jiao@mediatek.com>
>
> The mt7916 can support up to 544 wcid entries.
> This is an intermediate patch to add mt7916 support.
>
> Co-developed-by: Sujuan Chen <sujuan.chen@mediatek.com>
> Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
> Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt76.h | 2 +-
> drivers/net/wireless/mediatek/mt76/mt7915/init.c | 2 +-
> drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 +-
> drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h | 8 +++++++-
> 4 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
> index ce687d5..0f1197e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt76.h
> @@ -225,7 +225,7 @@ enum mt76_wcid_flags {
> MT_WCID_FLAG_HDR_TRANS,
> };
>
> -#define MT76_N_WCIDS 288
> +#define MT76_N_WCIDS 544
is this change ok with older chipset as well?
Regards,
Lorenzo
>
> /* stored in ieee80211_tx_info::hw_queue */
> #define MT_TX_HW_QUEUE_EXT_PHY BIT(3)
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index 8d16c96..4dfa1c1 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -430,7 +430,7 @@ static void mt7915_mac_init(struct mt7915_dev *dev)
> /* enable hardware de-agg */
> mt76_set(dev, MT_MDP_DCR0, MT_MDP_DCR0_DAMSDU_EN);
>
> - for (i = 0; i < MT7915_WTBL_SIZE; i++)
> + for (i = 0; i < mt7915_wtbl_size(dev); i++)
> mt7915_mac_wtbl_update(dev, i,
> MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
> for (i = 0; i < 2; i++)
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index ba39f3d..4212dbb 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -1492,7 +1492,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
> if (pid < MT_PACKET_ID_FIRST)
> return;
>
> - if (wcidx >= MT7915_WTBL_SIZE)
> + if (wcidx >= mt7915_wtbl_size(dev))
> return;
>
> rcu_read_lock();
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
> index 3e2e900..e8fbe69 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
> @@ -12,7 +12,8 @@
> #define MT7915_MAX_INTERFACES 19
> #define MT7915_MAX_WMM_SETS 4
> #define MT7915_WTBL_SIZE 288
> -#define MT7915_WTBL_RESERVED (MT7915_WTBL_SIZE - 1)
> +#define MT7916_WTBL_SIZE 544
> +#define MT7915_WTBL_RESERVED (mt7915_wtbl_size(dev) - 1)
> #define MT7915_WTBL_STA (MT7915_WTBL_RESERVED - \
> MT7915_MAX_INTERFACES)
>
> @@ -477,6 +478,11 @@ static inline bool is_mt7915(struct mt76_dev *dev)
> return mt76_chip(dev) == 0x7915;
> }
>
> +static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
> +{
> + return is_mt7915(&dev->mt76) ? MT7915_WTBL_SIZE : MT7916_WTBL_SIZE;
> +}
> +
> void mt7915_dual_hif_set_irq_mask(struct mt7915_dev *dev, bool write_reg,
> u32 clear, u32 set);
>
> --
> 2.18.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2021-10-28 8:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-27 8:40 [PATCH 00/11] add mt7916 support Bo Jiao
2021-10-27 8:40 ` [PATCH 01/11] mt76: mt7915: add mt7915_mmio_probe() as a common probing function Bo Jiao
2021-10-27 8:40 ` [PATCH 02/11] mt76: mt7915: refine register definition Bo Jiao
2021-10-27 8:40 ` [PATCH 03/11] mt76: mt7915: rework dma.c to adapt mt7916 changes Bo Jiao
2021-10-28 8:56 ` Lorenzo Bianconi
2021-10-27 8:40 ` [PATCH 04/11] mt76: mt7915: add firmware support for mt7916 Bo Jiao
2021-10-27 8:40 ` [PATCH 05/11] mt76: mt7915: rework eeprom.c to adapt mt7916 changes Bo Jiao
2021-10-27 8:40 ` [PATCH 06/11] mt76: mt7915: enlarge wcid size to 544 Bo Jiao
2021-10-28 8:58 ` Lorenzo Bianconi [this message]
2021-10-27 8:40 ` [PATCH 07/11] mt76: mt7915: add txfree event v3 Bo Jiao
2021-10-27 8:40 ` [PATCH 08/11] mt76: mt7915: update rx rate reporting for mt7916 Bo Jiao
2021-10-27 8:40 ` [PATCH 09/11] mt76: mt7915: update mt7915_chan_mib_offs " Bo Jiao
2021-10-27 8:40 ` [PATCH 10/11] mt76: mt7915: add mt7916 calibrated data support Bo Jiao
2021-10-27 8:40 ` [PATCH 11/11] mt76: mt7915: add device id for mt7916 Bo Jiao
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=YXpmUTtEu4JrshpY@lore-desk \
--to=lorenzo@kernel.org \
--cc=bo.jiao@mediatek.com \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=shayne.chen@mediatek.com \
--cc=sujuan.chen@mediatek.com \
--cc=xing.song@mediatek.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).