developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 1 | From 070859af14a0c57a521e9efc5d4ae275666679d9 Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: Howard Hsu <howard-yh.hsu@mediatek.com> |
| 3 | Date: Tue, 27 Feb 2024 14:50:20 +0800 |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 005/199] mtk: mt76: mt7996: adjust Beamformee SS capability |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | |
| 6 | This commit includes two changes to adjust beamformee ss capability. |
| 7 | First, configure the beamformee ss capability for mt7992 chipsets. |
| 8 | Second, no matter how many antenna numbers is set, always set the |
| 9 | maximum capability of Beamformee SS that chipsets support. |
| 10 | |
| 11 | Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com> |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 12 | --- |
| 13 | mt7996/init.c | 23 +++++++++++++++++------ |
| 14 | 1 file changed, 17 insertions(+), 6 deletions(-) |
| 15 | |
| 16 | diff --git a/mt7996/init.c b/mt7996/init.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 17 | index a98dcb40..7d8d1e7b 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 18 | --- a/mt7996/init.c |
| 19 | +++ b/mt7996/init.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 20 | @@ -941,8 +941,12 @@ void mt7996_set_stream_vht_txbf_caps(struct mt7996_phy *phy) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 21 | 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 | |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 35 | @@ -987,9 +991,15 @@ mt7996_set_stream_he_txbf_caps(struct mt7996_phy *phy, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 36 | 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 */ |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame^] | 54 | @@ -1186,7 +1196,8 @@ mt7996_init_eht_caps(struct mt7996_phy *phy, enum nl80211_band band, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 55 | 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 | -- |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 65 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 66 | |