| From 6fa0621e2a214b95e123b49aaaf4afe0e4f079c2 Mon Sep 17 00:00:00 2001 |
| From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| Date: Thu, 27 Jan 2022 11:27:23 +0800 |
| Subject: [PATCH 07/11] mt76: mt7915: update phy cap in |
| mt7915_set_stream_he_txbf_caps() |
| |
| Update phy cap for |
| IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ and |
| IEEE80211_HE_PHY_CAP7_STBC_TX/RX_ABOVE_80MHZ. |
| |
| Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| --- |
| .../net/wireless/mediatek/mt76/mt7915/init.c | 25 +++++++++++++++---- |
| 1 file changed, 20 insertions(+), 5 deletions(-) |
| |
| diff --git a/mt7915/init.c b/mt7915/init.c |
| index 553d1f5..1003dd3 100644 |
| --- a/mt7915/init.c |
| +++ b/mt7915/init.c |
| @@ -727,11 +727,18 @@ void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy) |
| } |
| |
| static void |
| -mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, |
| +mt7915_set_stream_he_txbf_caps(struct mt7915_dev *dev, |
| + struct ieee80211_sta_he_cap *he_cap, |
| int vif, int nss) |
| { |
| struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem; |
| - u8 c; |
| + u8 c, nss_160; |
| + |
| + /* Can do 1/2 of NSS streams in 160Mhz mode for mt7915 */ |
| + if (is_mt7915(&dev->mt76) && !dev->dbdc_support) |
| + nss_160 = nss / 2; |
| + else |
| + nss_160 = nss; |
| |
| #ifdef CONFIG_MAC80211_MESH |
| if (vif == NL80211_IFTYPE_MESH_POINT) |
| @@ -785,13 +792,21 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap, |
| /* num_snd_dim |
| * for mt7915, max supported nss is 2 for bw > 80MHz |
| */ |
| - c = (nss - 1) | |
| - IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2; |
| + c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK, |
| + nss - 1) | |
| + FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK, |
| + nss_160 - 1); |
| elem->phy_cap_info[5] |= c; |
| |
| c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB | |
| IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB; |
| elem->phy_cap_info[6] |= c; |
| + |
| + if (!is_mt7915(&dev->mt76)) { |
| + c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ | |
| + IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ; |
| + elem->phy_cap_info[7] |= c; |
| + } |
| } |
| |
| static void |
| @@ -953,7 +968,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band, |
| he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map_160); |
| he_mcs->tx_mcs_80p80 = cpu_to_le16(mcs_map_160); |
| |
| - mt7915_set_stream_he_txbf_caps(he_cap, i, nss); |
| + mt7915_set_stream_he_txbf_caps(dev, he_cap, i, nss); |
| |
| memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); |
| if (he_cap_elem->phy_cap_info[6] & |
| -- |
| 2.25.1 |
| |