blob: d01d5409c15154ef8083198559759d541873e74c [file] [log] [blame]
From f8005d1d132e823d02b055b99e6a31c8d9c775af Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 30 Nov 2023 16:31:17 +0800
Subject: [PATCH 104/120] wifi: mt76: mt7996: enable MLO capability
This is a preliminary patch to add MLO support for mt7996 chipsets.
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
mt7996/eeprom.c | 6 ++++++
mt7996/init.c | 40 ++++++++++++++++++++++++++++++++++++++--
2 files changed, 44 insertions(+), 2 deletions(-)
diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c
index aacfc623f..9c97f5741 100644
--- a/mt7996/eeprom.c
+++ b/mt7996/eeprom.c
@@ -388,6 +388,12 @@ static int mt7996_eeprom_parse_band_config(struct mt7996_phy *phy)
break;
}
+ /* TODO: for MLO, we enable all band capabilities */
+ phy->mt76->cap.has_2ghz = true;
+ phy->mt76->cap.has_5ghz = true;
+ if (is_mt7996(&phy->dev->mt76))
+ phy->mt76->cap.has_6ghz = true;
+
return ret;
}
diff --git a/mt7996/init.c b/mt7996/init.c
index 541361b86..eaa7b0401 100644
--- a/mt7996/init.c
+++ b/mt7996/init.c
@@ -34,16 +34,45 @@ static const struct ieee80211_iface_combination if_comb[] = {
.limits = if_limits,
.n_limits = ARRAY_SIZE(if_limits),
.max_interfaces = MT7996_MAX_INTERFACES,
- .num_different_channels = 1,
+ .num_different_channels = 3,
.beacon_int_infra_match = true,
+ /*
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_80) |
BIT(NL80211_CHAN_WIDTH_160),
+ */
}
};
+static const u8 mt7996_if_types_ext_capa[] = {
+ [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
+ [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
+};
+
+static const struct wiphy_iftype_ext_capab mt7996_iftypes_ext_capa[] = {
+ {
+ .iftype = NL80211_IFTYPE_STATION,
+ .extended_capabilities = mt7996_if_types_ext_capa,
+ .extended_capabilities_mask = mt7996_if_types_ext_capa,
+ .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa),
+ .mld_capa_and_ops = 2,
+ },
+ {
+ .iftype = NL80211_IFTYPE_AP,
+ .extended_capabilities = mt7996_if_types_ext_capa,
+ .extended_capabilities_mask = mt7996_if_types_ext_capa,
+ .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa),
+ .mld_capa_and_ops = 2,
+ /* the max number of simultaneous links is defined as the
+ * maximum number of affiliated APs minus 1.
+ * mt7996 could have 3 links in an MLD AP, so currently
+ * hardcode it to 2.
+ */
+ },
+};
+
static ssize_t mt7996_thermal_temp_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -416,8 +445,9 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD);
ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
ieee80211_hw_set(hw, WANT_MONITOR_VIF);
- ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
+ // ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
ieee80211_hw_set(hw, CHANCTX_STA_CSA);
+ ieee80211_hw_set(hw, CONNECTION_MONITOR);
hw->max_tx_fragments = 4;
@@ -461,6 +491,12 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed)
wiphy->max_scan_ssids = 4;
wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
+
+ /* enable MLO support */
+ wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
+ wiphy->iftype_ext_capab = mt7996_iftypes_ext_capa;
+ wiphy->num_iftype_ext_capab = ARRAY_SIZE(mt7996_iftypes_ext_capa);
+ wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE;
}
static void
--
2.39.2