diff mbox series

[5/6] mt76: mt7915: enable radar background detection

Message ID f97a4fe5bec70d8e5594c0f4d286b46b844939a5.1641996493.git.lorenzo@kernel.org (mailing list archive)
State Superseded
Delegated to: Felix Fietkau
Headers show
Series introduce background radar support for mt7915 driver | expand

Commit Message

Lorenzo Bianconi Jan. 12, 2022, 2:13 p.m. UTC
Notify userland the hw supports background radar/CAC detection.

Tested-by: Owen Peng <owen.peng@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ben Greear April 11, 2022, 9:46 p.m. UTC | #1
On 1/12/22 6:13 AM, Lorenzo Bianconi wrote:
> Notify userland the hw supports background radar/CAC detection.

So, what about someone like me using mtk7915 4x4 radio from asia-rf?  It
has no extra RF chains afaik, and it is certainly broken when
trying to use DFS channels on my system.

Maybe you need a positive check instead of negative check before
enabling this feature?

Thanks,
Ben

> 
> Tested-by: Owen Peng <owen.peng@mediatek.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>   drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index 5c1643963506..91c7ce60f296 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -309,6 +309,7 @@ static void
>   mt7915_init_wiphy(struct ieee80211_hw *hw)
>   {
>   	struct mt7915_phy *phy = mt7915_hw_phy(hw);
> +	struct mt76_dev *mdev = &phy->dev->mt76;
>   	struct wiphy *wiphy = hw->wiphy;
>   	struct mt7915_dev *dev = phy->dev;
>   
> @@ -337,6 +338,12 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)
>   	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_VHT);
>   	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_HE);
>   
> +	if (!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);
> +
>   	ieee80211_hw_set(hw, HAS_RATE_CONTROL);
>   	ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
>   	ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
>
Lorenzo Bianconi April 17, 2022, 3:40 p.m. UTC | #2
> On 1/12/22 6:13 AM, Lorenzo Bianconi wrote:
> > Notify userland the hw supports background radar/CAC detection.
> 
> So, what about someone like me using mtk7915 4x4 radio from asia-rf?  It
> has no extra RF chains afaik, and it is certainly broken when
> trying to use DFS channels on my system.

according to my understanding asia-rf card can be considered an outlier from
this point of view (mt7915 regular card should support a dedicated radar chain).
AFAIU there is no way to autodetect this feature (@Ryder correct?), so we could
add a module parameter (similar to dts one) to disable this feature. What do
you think?

Regards,
Lorenzo

> 
> Maybe you need a positive check instead of negative check before
> enabling this feature?
> 
> Thanks,
> Ben
> 
> > 
> > Tested-by: Owen Peng <owen.peng@mediatek.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> >   drivers/net/wireless/mediatek/mt76/mt7915/init.c | 7 +++++++
> >   1 file changed, 7 insertions(+)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > index 5c1643963506..91c7ce60f296 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > @@ -309,6 +309,7 @@ static void
> >   mt7915_init_wiphy(struct ieee80211_hw *hw)
> >   {
> >   	struct mt7915_phy *phy = mt7915_hw_phy(hw);
> > +	struct mt76_dev *mdev = &phy->dev->mt76;
> >   	struct wiphy *wiphy = hw->wiphy;
> >   	struct mt7915_dev *dev = phy->dev;
> > @@ -337,6 +338,12 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)
> >   	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_VHT);
> >   	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_HE);
> > +	if (!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);
> > +
> >   	ieee80211_hw_set(hw, HAS_RATE_CONTROL);
> >   	ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
> >   	ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
> > 
> 
> 
> -- 
> Ben Greear <greearb@candelatech.com>
> Candela Technologies Inc  http://www.candelatech.com
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index 5c1643963506..91c7ce60f296 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -309,6 +309,7 @@  static void
 mt7915_init_wiphy(struct ieee80211_hw *hw)
 {
 	struct mt7915_phy *phy = mt7915_hw_phy(hw);
+	struct mt76_dev *mdev = &phy->dev->mt76;
 	struct wiphy *wiphy = hw->wiphy;
 	struct mt7915_dev *dev = phy->dev;
 
@@ -337,6 +338,12 @@  mt7915_init_wiphy(struct ieee80211_hw *hw)
 	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_VHT);
 	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_BEACON_RATE_HE);
 
+	if (!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);
+
 	ieee80211_hw_set(hw, HAS_RATE_CONTROL);
 	ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
 	ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);