diff mbox series

mt76: mt7921: enable VHT BFee capabiliity

Message ID a5748514496b2b4e4b23be7b0b560d2585feafb6.1622627260.git.deren.wu@mediatek.com
State New
Headers show
Series mt76: mt7921: enable VHT BFee capabiliity | expand

Commit Message

Deren Wu June 2, 2021, 3:17 p.m. UTC
From: Deren Wu <deren.wu@mediatek.com>

enable BFee functions with proper BFee IEs

Tested-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>
Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
---
 .../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(+)

Comments

Felix Fietkau June 6, 2021, 7:51 a.m. UTC | #1
On 2021-06-02 17:17, Deren Wu wrote:
> From: Deren Wu <deren.wu@mediatek.com>

> 

> enable BFee functions with proper BFee IEs

> 

> Tested-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>

> Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>

> Signed-off-by: Deren Wu <deren.wu@mediatek.com>

I've sent out a much simpler replacement for this patch, please take a look.

- Felix
Deren Wu June 6, 2021, 2:34 p.m. UTC | #2
On Sun, 2021-06-06 at 09:51 +0200, Felix Fietkau wrote:
> On 2021-06-02 17:17, Deren Wu wrote:

> > From: Deren Wu <deren.wu@mediatek.com>

> > 

> > enable BFee functions with proper BFee IEs

> > 

> > Tested-by: Eric-SY Chang <Eric-SY.Chang@mediatek.com>

> > Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>

> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>

> 

> 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
diff mbox series

Patch

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);