blob: 9b56c521093b31bf1eda8f7875e29da2bc3bfe7a [file] [log] [blame]
developer9237f442024-06-14 17:13:04 +08001From 346eb89054af1f40dcceec43d128d8775081fd9a Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: Howard Hsu <howard-yh.hsu@mediatek.com>
3Date: Tue, 27 Feb 2024 14:50:20 +0800
developer9237f442024-06-14 17:13:04 +08004Subject: [PATCH 006/116] mtk: wifi: mt76: mt7996: adjust Beamformee SS
developer66e89bc2024-04-23 14:50:01 +08005 capability
6
7This commit includes two changes to adjust beamformee ss capability.
8First, configure the beamformee ss capability for mt7992 chipsets.
9Second, no matter how many antenna numbers is set, always set the
10maximum capability of Beamformee SS that chipsets support.
11
12Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
developer66e89bc2024-04-23 14:50:01 +080013---
14 mt7996/init.c | 23 +++++++++++++++++------
15 1 file changed, 17 insertions(+), 6 deletions(-)
16
17diff --git a/mt7996/init.c b/mt7996/init.c
developer9237f442024-06-14 17:13:04 +080018index c264d50..ab9445c 100644
developer66e89bc2024-04-23 14:50:01 +080019--- a/mt7996/init.c
20+++ b/mt7996/init.c
21@@ -940,8 +940,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
22 cap = &phy->mt76->sband_5g.sband.vht_cap.cap;
23
24 *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
25- IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
26- FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, sts - 1);
27+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
28+
29+ if (is_mt7996(phy->mt76->dev))
30+ *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 3);
31+ else
32+ *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 4);
33
34 *cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK |
35 IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
36@@ -986,9 +990,15 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
37 IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO;
38 elem->phy_cap_info[2] |= c;
39
40- c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE |
41- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
42- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
43+ c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE;
44+
45+ if (is_mt7996(phy->mt76->dev))
46+ c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
47+ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
48+ else
49+ c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 |
50+ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5;
51+
52 elem->phy_cap_info[4] |= c;
53
54 /* do not support NG16 due to spec D4.0 changes subcarrier idx */
55@@ -1185,7 +1195,8 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
56 IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER |
57 IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE;
58
59- val = max_t(u8, sts - 1, 3);
60+ /* Set the maximum capability regardless of the antenna configuration. */
61+ val = is_mt7992(phy->mt76->dev) ? 4 : 3;
62 eht_cap_elem->phy_cap_info[0] |=
63 u8_encode_bits(u8_get_bits(val, BIT(0)),
64 IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK);
65--
developer9237f442024-06-14 17:13:04 +0800662.18.0
developer66e89bc2024-04-23 14:50:01 +080067