developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 1 | From ebe94f1d3aa73deefe0057ae93974a06b55db1ce Mon Sep 17 00:00:00 2001 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Thu, 30 Nov 2023 16:31:17 +0800 |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 4 | Subject: [PATCH 088/116] wifi: mt76: mt7996: enable MLO capability |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 5 | |
| 6 | This is a preliminary patch to add MLO support for mt7996 chipsets. |
| 7 | |
| 8 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 9 | --- |
| 10 | mt7996/eeprom.c | 6 ++++++ |
| 11 | mt7996/init.c | 40 ++++++++++++++++++++++++++++++++++++++-- |
| 12 | 2 files changed, 44 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 15 | index 51455d8..0393e93 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 16 | --- a/mt7996/eeprom.c |
| 17 | +++ b/mt7996/eeprom.c |
| 18 | @@ -387,6 +387,12 @@ static int mt7996_eeprom_parse_band_config(struct mt7996_phy *phy) |
| 19 | 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 | |
| 31 | diff --git a/mt7996/init.c b/mt7996/init.c |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 32 | index 381e129..c6eb6a5 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 33 | --- a/mt7996/init.c |
| 34 | +++ b/mt7996/init.c |
| 35 | @@ -34,16 +34,45 @@ static const struct ieee80211_iface_combination if_comb[] = { |
| 36 | .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, |
| 42 | + /* |
| 43 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | |
| 44 | BIT(NL80211_CHAN_WIDTH_20) | |
| 45 | BIT(NL80211_CHAN_WIDTH_40) | |
| 46 | BIT(NL80211_CHAN_WIDTH_80) | |
| 47 | BIT(NL80211_CHAN_WIDTH_160), |
| 48 | + */ |
| 49 | } |
| 50 | }; |
| 51 | |
| 52 | +static const u8 mt7996_if_types_ext_capa[] = { |
| 53 | + [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, |
| 54 | + [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, |
| 55 | +}; |
| 56 | + |
| 57 | +static const struct wiphy_iftype_ext_capab mt7996_iftypes_ext_capa[] = { |
| 58 | + { |
| 59 | + .iftype = NL80211_IFTYPE_STATION, |
| 60 | + .extended_capabilities = mt7996_if_types_ext_capa, |
| 61 | + .extended_capabilities_mask = mt7996_if_types_ext_capa, |
| 62 | + .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa), |
| 63 | + .mld_capa_and_ops = 2, |
| 64 | + }, |
| 65 | + { |
| 66 | + .iftype = NL80211_IFTYPE_AP, |
| 67 | + .extended_capabilities = mt7996_if_types_ext_capa, |
| 68 | + .extended_capabilities_mask = mt7996_if_types_ext_capa, |
| 69 | + .extended_capabilities_len = sizeof(mt7996_if_types_ext_capa), |
| 70 | + .mld_capa_and_ops = 2, |
| 71 | + /* the max number of simultaneous links is defined as the |
| 72 | + * maximum number of affiliated APs minus 1. |
| 73 | + * mt7996 could have 3 links in an MLD AP, so currently |
| 74 | + * hardcode it to 2. |
| 75 | + */ |
| 76 | + }, |
| 77 | +}; |
| 78 | + |
| 79 | static ssize_t mt7996_thermal_temp_show(struct device *dev, |
| 80 | struct device_attribute *attr, |
| 81 | char *buf) |
| 82 | @@ -417,8 +446,9 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed) |
| 83 | ieee80211_hw_set(hw, SUPPORTS_TX_ENCAP_OFFLOAD); |
| 84 | ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD); |
| 85 | ieee80211_hw_set(hw, WANT_MONITOR_VIF); |
| 86 | - ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); |
| 87 | + // ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); |
| 88 | ieee80211_hw_set(hw, CHANCTX_STA_CSA); |
| 89 | + ieee80211_hw_set(hw, CONNECTION_MONITOR); |
| 90 | |
| 91 | hw->max_tx_fragments = 4; |
| 92 | |
| 93 | @@ -462,6 +492,12 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed) |
| 94 | |
| 95 | wiphy->max_scan_ssids = 4; |
| 96 | wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; |
| 97 | + |
| 98 | + /* enable MLO support */ |
| 99 | + wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO; |
| 100 | + wiphy->iftype_ext_capab = mt7996_iftypes_ext_capa; |
| 101 | + wiphy->num_iftype_ext_capab = ARRAY_SIZE(mt7996_iftypes_ext_capa); |
| 102 | + wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE; |
| 103 | } |
| 104 | |
| 105 | static void |
| 106 | -- |
developer | 9237f44 | 2024-06-14 17:13:04 +0800 | [diff] [blame] | 107 | 2.18.0 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 108 | |