blob: 9d4cf83f4b92613ff96a5d05e1211ebb20b62bc0 [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 070859af14a0c57a521e9efc5d4ae275666679d9 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
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 005/199] mtk: mt76: mt7996: adjust Beamformee SS capability
developer66e89bc2024-04-23 14:50:01 +08005
6This commit includes two changes to adjust beamformee ss capability.
7First, configure the beamformee ss capability for mt7992 chipsets.
8Second, no matter how many antenna numbers is set, always set the
9maximum capability of Beamformee SS that chipsets support.
10
11Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
developer66e89bc2024-04-23 14:50:01 +080012---
13 mt7996/init.c | 23 +++++++++++++++++------
14 1 file changed, 17 insertions(+), 6 deletions(-)
15
16diff --git a/mt7996/init.c b/mt7996/init.c
developer05f3b2b2024-08-19 19:17:34 +080017index a98dcb40..7d8d1e7b 100644
developer66e89bc2024-04-23 14:50:01 +080018--- a/mt7996/init.c
19+++ b/mt7996/init.c
developer05f3b2b2024-08-19 19:17:34 +080020@@ -941,8 +941,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy)
developer66e89bc2024-04-23 14:50:01 +080021 cap = &phy->mt76->sband_5g.sband.vht_cap.cap;
22
23 *cap |= IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
24- IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE |
25- FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, sts - 1);
26+ IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE;
27+
28+ if (is_mt7996(phy->mt76->dev))
29+ *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 3);
30+ else
31+ *cap |= FIELD_PREP(IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK, 4);
32
33 *cap &= ~(IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK |
34 IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
developer05f3b2b2024-08-19 19:17:34 +080035@@ -987,9 +991,15 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy,
developer66e89bc2024-04-23 14:50:01 +080036 IEEE80211_HE_PHY_CAP2_UL_MU_PARTIAL_MU_MIMO;
37 elem->phy_cap_info[2] |= c;
38
39- c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE |
40- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
41- IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
42+ c = IEEE80211_HE_PHY_CAP4_SU_BEAMFORMEE;
43+
44+ if (is_mt7996(phy->mt76->dev))
45+ c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_4 |
46+ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_4;
47+ else
48+ c |= IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_UNDER_80MHZ_5 |
49+ IEEE80211_HE_PHY_CAP4_BEAMFORMEE_MAX_STS_ABOVE_80MHZ_5;
50+
51 elem->phy_cap_info[4] |= c;
52
53 /* do not support NG16 due to spec D4.0 changes subcarrier idx */
developer05f3b2b2024-08-19 19:17:34 +080054@@ -1186,7 +1196,8 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band,
developer66e89bc2024-04-23 14:50:01 +080055 IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMER |
56 IEEE80211_EHT_PHY_CAP0_SU_BEAMFORMEE;
57
58- val = max_t(u8, sts - 1, 3);
59+ /* Set the maximum capability regardless of the antenna configuration. */
60+ val = is_mt7992(phy->mt76->dev) ? 4 : 3;
61 eht_cap_elem->phy_cap_info[0] |=
62 u8_encode_bits(u8_get_bits(val, BIT(0)),
63 IEEE80211_EHT_PHY_CAP0_BEAMFORMEE_SS_80MHZ_MASK);
64--
developer9237f442024-06-14 17:13:04 +0800652.18.0
developer66e89bc2024-04-23 14:50:01 +080066