blob: 927fe40c10dd28ba07eb04e08042cbae4628b0cb [file] [log] [blame]
developer1f55fcf2024-10-17 14:52:33 +08001From b63cdf42665f2f3a21e860b1dca4b991db4a3ec6 Mon Sep 17 00:00:00 2001
developer66e89bc2024-04-23 14:50:01 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Thu, 30 Nov 2023 16:31:17 +0800
developer1f55fcf2024-10-17 14:52:33 +08004Subject: [PATCH 081/193] mtk: mt76: mt7996: enable MLO capability
developer66e89bc2024-04-23 14:50:01 +08005
6This is a preliminary patch to add MLO support for mt7996 chipsets.
7
8Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
9---
10 mt7996/eeprom.c | 6 ++++++
developer05f3b2b2024-08-19 19:17:34 +080011 mt7996/init.c | 38 ++++++++++++++++++++++++++++++++++++--
12 2 files changed, 42 insertions(+), 2 deletions(-)
developer66e89bc2024-04-23 14:50:01 +080013
14diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c
developer1f55fcf2024-10-17 14:52:33 +080015index f9bd4d9..8272ead 100644
developer66e89bc2024-04-23 14:50:01 +080016--- a/mt7996/eeprom.c
17+++ b/mt7996/eeprom.c
developerd0c89452024-10-11 16:53:27 +080018@@ -422,6 +422,12 @@ static int mt7996_eeprom_parse_band_config(struct mt7996_phy *phy)
developer66e89bc2024-04-23 14:50:01 +080019 break;
20 }
21
22+ /* TODO: for MLO, we enable all band capabilities */
23+ phy->mt76->cap.has_2ghz = true;
24+ phy->mt76->cap.has_5ghz = true;
25+ if (is_mt7996(&phy->dev->mt76))
26+ phy->mt76->cap.has_6ghz = true;
27+
28 return ret;
29 }
30
31diff --git a/mt7996/init.c b/mt7996/init.c
developer1f55fcf2024-10-17 14:52:33 +080032index 1a3b867..8240735 100644
developer66e89bc2024-04-23 14:50:01 +080033--- a/mt7996/init.c
34+++ b/mt7996/init.c
developer1f55fcf2024-10-17 14:52:33 +080035@@ -32,7 +32,7 @@ static const struct ieee80211_iface_combination if_comb[] = {
developer66e89bc2024-04-23 14:50:01 +080036 .limits = if_limits,
37 .n_limits = ARRAY_SIZE(if_limits),
38 .max_interfaces = MT7996_MAX_INTERFACES,
39- .num_different_channels = 1,
40+ .num_different_channels = 3,
41 .beacon_int_infra_match = true,
developer66e89bc2024-04-23 14:50:01 +080042 .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
43 BIT(NL80211_CHAN_WIDTH_20) |
developer1f55fcf2024-10-17 14:52:33 +080044@@ -43,6 +43,33 @@ static const struct ieee80211_iface_combination if_comb[] = {
developer66e89bc2024-04-23 14:50:01 +080045 }
46 };
47
48+static const u8 mt7996_if_types_ext_capa[] = {
49+ [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
50+ [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
51+};
52+
53+static const struct wiphy_iftype_ext_capab mt7996_iftypes_ext_capa[] = {
54+ {
55+ .iftype = NL80211_IFTYPE_STATION,
56+ .extended_capabilities = mt7996_if_types_ext_capa,
57+ .extended_capabilities_mask = mt7996_if_types_ext_capa,
58+ .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa),
59+ .mld_capa_and_ops = 2,
60+ },
61+ {
62+ .iftype = NL80211_IFTYPE_AP,
63+ .extended_capabilities = mt7996_if_types_ext_capa,
64+ .extended_capabilities_mask = mt7996_if_types_ext_capa,
65+ .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa),
66+ .mld_capa_and_ops = 2,
67+ /* the max number of simultaneous links is defined as the
68+ * maximum number of affiliated APs minus 1.
69+ * mt7996 could have 3 links in an MLD AP, so currently
70+ * hardcode it to 2.
71+ */
72+ },
73+};
74+
75 static ssize_t mt7996_thermal_temp_show(struct device *dev,
76 struct device_attribute *attr,
77 char *buf)
developer1f55fcf2024-10-17 14:52:33 +080078@@ -416,8 +443,9 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
developer66e89bc2024-04-23 14:50:01 +080079 ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
80 ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
81 ieee80211_hw_set(hw, WANT_MONITOR_VIF);
82- ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
83+ // ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
84 ieee80211_hw_set(hw, CHANCTX_STA_CSA);
85+ ieee80211_hw_set(hw, CONNECTION_MONITOR);
86
87 hw->max_tx_fragments = 4;
88
developer1f55fcf2024-10-17 14:52:33 +080089@@ -461,6 +489,12 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
developer66e89bc2024-04-23 14:50:01 +080090
91 wiphy->max_scan_ssids = 4;
92 wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
93+
94+ /* enable MLO support */
95+ wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
96+ wiphy->iftype_ext_capab = mt7996_iftypes_ext_capa;
97+ wiphy->num_iftype_ext_capab = ARRAY_SIZE(mt7996_iftypes_ext_capa);
98+ wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE;
99 }
100
101 static void
102--
developerd0c89452024-10-11 16:53:27 +08001032.45.2
developer66e89bc2024-04-23 14:50:01 +0800104