2021-06-02 15:20:05

by Deren Wu

[permalink] [raw]
Subject: [PATCH] mt76: mt7921: enable VHT BFee capabiliity

From: Deren Wu <[email protected]>

enable BFee functions with proper BFee IEs

Tested-by: Eric-SY Chang <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Deren Wu <[email protected]>
---
.../net/wireless/mediatek/mt76/mt7921/init.c | 1 +
.../net/wireless/mediatek/mt76/mt7921/main.c | 18 ++++++++++++++++++
.../net/wireless/mediatek/mt76/mt7921/mt7921.h | 1 +
3 files changed, 20 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
index 59da29032645..82b01a2cea69 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c
@@ -219,6 +219,7 @@ int mt7921_register_device(struct mt7921_dev *dev)
dev->mphy.hw->wiphy->available_antennas_tx = dev->mphy.chainmask;

mt76_set_stream_caps(&dev->mphy, true);
+ mt7921_set_stream_vht_bf_caps(&dev->phy);
mt7921_set_stream_he_caps(&dev->phy);

ret = mt76_register_device(&dev->mt76, true, mt76_rates,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/main.c b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
index 84930ad5ebc7..95502708b840 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/main.c
@@ -140,6 +140,24 @@ mt7921_init_he_caps(struct mt7921_phy *phy, enum nl80211_band band,
return idx;
}

+void mt7921_set_stream_vht_bf_caps(struct mt7921_phy *phy)
+{
+ u32 *cap;
+
+ if (!phy->mt76->cap.has_5ghz)
+ return;
+
+ cap = &phy->mt76->sband_5g.sband.vht_cap.cap;
+
+ *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
+ (3 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);
+
+ *cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK |
+ IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
+ IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE);
+}
+
void mt7921_set_stream_he_caps(struct mt7921_phy *phy)
{
struct ieee80211_sband_iftype_data *data;
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
index 8aa8d2ecdffa..abf8be358786 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
@@ -356,6 +356,7 @@ void mt7921_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps);
void mt7921_stats_work(struct work_struct *work);
void mt7921_txp_skb_unmap(struct mt76_dev *dev,
struct mt76_txwi_cache *txwi);
+void mt7921_set_stream_vht_bf_caps(struct mt7921_phy *phy);
void mt7921_set_stream_he_caps(struct mt7921_phy *phy);
void mt7921_update_channel(struct mt76_dev *mdev);
int mt7921_init_debugfs(struct mt7921_dev *dev);
--
2.18.0


2021-06-06 07:55:10

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt7921: enable VHT BFee capabiliity

On 2021-06-02 17:17, Deren Wu wrote:
> From: Deren Wu <[email protected]>
>
> enable BFee functions with proper BFee IEs
>
> Tested-by: Eric-SY Chang <[email protected]>
> Signed-off-by: Leon Yen <[email protected]>
> Signed-off-by: Deren Wu <[email protected]>
I've sent out a much simpler replacement for this patch, please take a look.

- Felix

2021-06-06 14:38:13

by Deren Wu

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt7921: enable VHT BFee capabiliity

On Sun, 2021-06-06 at 09:51 +0200, Felix Fietkau wrote:
> On 2021-06-02 17:17, Deren Wu wrote:
> > From: Deren Wu <[email protected]>
> >
> > enable BFee functions with proper BFee IEs
> >
> > Tested-by: Eric-SY Chang <[email protected]>
> > Signed-off-by: Leon Yen <[email protected]>
> > Signed-off-by: Deren Wu <[email protected]>
>
> I've sent out a much simpler replacement for this patch, please take
> a look.
>
> - Felix
Hi Felix,

Your patch is fine with me. Thanks for help.

Regards,
Deren