blob: c60a506174b5fa6118628d5f74111cf0568e21d8 [file] [log] [blame]
developer20d67712022-03-02 14:09:32 +08001From 6fa0621e2a214b95e123b49aaaf4afe0e4f079c2 Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Thu, 27 Jan 2022 11:27:23 +0800
4Subject: [PATCH 07/11] mt76: mt7915: update phy cap in
5 mt7915_set_stream_he_txbf_caps()
6
7Update phy cap for
8IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ and
9IEEE80211_HE_PHY_CAP7_STBC_TX/RX_ABOVE_80MHZ.
10
11Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
12---
13 .../net/wireless/mediatek/mt76/mt7915/init.c | 25 +++++++++++++++----
14 1 file changed, 20 insertions(+), 5 deletions(-)
15
16diff --git a/mt7915/init.c b/mt7915/init.c
17index 553d1f5..1003dd3 100644
18--- a/mt7915/init.c
19+++ b/mt7915/init.c
20@@ -727,11 +727,18 @@ void mt7915_set_stream_vht_txbf_caps(struct mt7915_phy *phy)
21 }
22
23 static void
24-mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap,
25+mt7915_set_stream_he_txbf_caps(struct mt7915_dev *dev,
26+ struct ieee80211_sta_he_cap *he_cap,
27 int vif, int nss)
28 {
29 struct ieee80211_he_cap_elem *elem = &he_cap->he_cap_elem;
30- u8 c;
31+ u8 c, nss_160;
32+
33+ /* Can do 1/2 of NSS streams in 160Mhz mode for mt7915 */
34+ if (is_mt7915(&dev->mt76) && !dev->dbdc_support)
35+ nss_160 = nss / 2;
36+ else
37+ nss_160 = nss;
38
39 #ifdef CONFIG_MAC80211_MESH
40 if (vif == NL80211_IFTYPE_MESH_POINT)
41@@ -785,13 +792,21 @@ mt7915_set_stream_he_txbf_caps(struct ieee80211_sta_he_cap *he_cap,
42 /* num_snd_dim
43 * for mt7915, max supported nss is 2 for bw > 80MHz
44 */
45- c = (nss - 1) |
46- IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_2;
47+ c = FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK,
48+ nss - 1) |
49+ FIELD_PREP(IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK,
50+ nss_160 - 1);
51 elem->phy_cap_info[5] |= c;
52
53 c = IEEE80211_HE_PHY_CAP6_TRIG_SU_BEAMFORMING_FB |
54 IEEE80211_HE_PHY_CAP6_TRIG_MU_BEAMFORMING_PARTIAL_BW_FB;
55 elem->phy_cap_info[6] |= c;
56+
57+ if (!is_mt7915(&dev->mt76)) {
58+ c = IEEE80211_HE_PHY_CAP7_STBC_TX_ABOVE_80MHZ |
59+ IEEE80211_HE_PHY_CAP7_STBC_RX_ABOVE_80MHZ;
60+ elem->phy_cap_info[7] |= c;
61+ }
62 }
63
64 static void
65@@ -953,7 +968,7 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
66 he_mcs->rx_mcs_80p80 = cpu_to_le16(mcs_map_160);
67 he_mcs->tx_mcs_80p80 = cpu_to_le16(mcs_map_160);
68
69- mt7915_set_stream_he_txbf_caps(he_cap, i, nss);
70+ mt7915_set_stream_he_txbf_caps(dev, he_cap, i, nss);
71
72 memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres));
73 if (he_cap_elem->phy_cap_info[6] &
74--
752.25.1
76