blob: ee007e276759a2d61c31ed78ba5955cdd5766fbf [file] [log] [blame]
developer05f3b2b2024-08-19 19:17:34 +08001From 208cd15d45360f69c2811bed72b2715c83632b3b 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
developer05f3b2b2024-08-19 19:17:34 +08004Subject: [PATCH 093/199] 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
developer05f3b2b2024-08-19 19:17:34 +080015index c4714982..cd93a3c2 100644
developer66e89bc2024-04-23 14:50:01 +080016--- a/mt7996/eeprom.c
17+++ b/mt7996/eeprom.c
developer05f3b2b2024-08-19 19:17:34 +080018@@ -390,6 +390,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
developer05f3b2b2024-08-19 19:17:34 +080032index 86bb0661..2fe869c9 100644
developer66e89bc2024-04-23 14:50:01 +080033--- a/mt7996/init.c
34+++ b/mt7996/init.c
developer05f3b2b2024-08-19 19:17:34 +080035@@ -35,7 +35,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) |
developer05f3b2b2024-08-19 19:17:34 +080044@@ -46,6 +46,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)
developer05f3b2b2024-08-19 19:17:34 +080078@@ -419,8 +446,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
developer05f3b2b2024-08-19 19:17:34 +080089@@ -464,6 +492,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--
developer9237f442024-06-14 17:13:04 +08001032.18.0
developer66e89bc2024-04-23 14:50:01 +0800104