From: Daniel Golle <daniel@makrotopia.org>
To: Shayne Chen <shayne.chen@mediatek.com>
Cc: Felix Fietkau <nbd@nbd.name>,
linux-wireless <linux-wireless@vger.kernel.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Subject: Re: [PATCH 3/3] wifi: mt76: mt7996: set correct background radar capability
Date: Thu, 26 Sep 2024 15:14:22 +0100 [thread overview]
Message-ID: <ZvVsPqwRdL5GltTX@makrotopia.org> (raw)
In-Reply-To: <20240926032440.15978-3-shayne.chen@mediatek.com>
On Thu, Sep 26, 2024 at 11:24:40AM +0800, Shayne Chen wrote:
> From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
>
> Some of the variants do not support background radar, so add a helper
> to report background radar capability.
>
> Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
> ---
> .../net/wireless/mediatek/mt76/mt7996/init.c | 7 ++++---
> .../wireless/mediatek/mt76/mt7996/mt7996.h | 19 +++++++++++++++++++
> 2 files changed, 23 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> index bf70799b4bc4..f6a010b61a8a 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
> @@ -390,9 +390,10 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
> wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
> wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER);
>
> - if (!mdev->dev->of_node ||
> - !of_property_read_bool(mdev->dev->of_node,
> - "mediatek,disable-radar-background"))
> + if (mt7996_has_background_radar(phy->dev) &&
> + (!mdev->dev->of_node ||
> + !of_property_read_bool(mdev->dev->of_node,
> + "mediatek,disable-radar-background")))
> wiphy_ext_feature_set(wiphy,
> NL80211_EXT_FEATURE_RADAR_BACKGROUND);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
> index 3f3278f43c79..9aec97dd81d9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
> @@ -447,6 +447,25 @@ mt7996_band_valid(struct mt7996_dev *dev, u8 band)
> return band <= MT_BAND2;
> }
>
> +static inline bool
> +mt7996_has_background_radar(struct mt7996_dev *dev)
> +{
> + switch (mt76_chip(&dev->mt76)) {
> + case 0x7990:
> + if (dev->var.type == MT7996_VAR_TYPE_233)
> + return false;
> + break;
> + case 0x7992:
> + if (dev->var.type == MT7992_VAR_TYPE_23)
> + return false;
> + break;
> + default:
> + return false;
> + }
> +
> + return true;
> +}
> +
> extern const struct ieee80211_ops mt7996_ops;
> extern struct pci_driver mt7996_pci_driver;
> extern struct pci_driver mt7996_hif_driver;
> --
> 2.39.2
>
next prev parent reply other threads:[~2024-09-26 14:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-26 3:24 [PATCH 1/3] wifi: mt76: mt7996: extend flexibility of mt7996_mcu_get_eeprom() Shayne Chen
2024-09-26 3:24 ` [PATCH 2/3] wifi: mt76: mt7996: add suuport for more variants Shayne Chen
2024-09-26 14:14 ` Daniel Golle
2024-09-26 3:24 ` [PATCH 3/3] wifi: mt76: mt7996: set correct background radar capability Shayne Chen
2024-09-26 14:14 ` Daniel Golle [this message]
2024-09-26 14:13 ` [PATCH 1/3] wifi: mt76: mt7996: extend flexibility of mt7996_mcu_get_eeprom() Daniel Golle
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=ZvVsPqwRdL5GltTX@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=StanleyYP.Wang@mediatek.com \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
--cc=shayne.chen@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).