developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 1 | From e58436183460b0f31ba597c8dba7b839101f494f 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 | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 4 | Subject: [PATCH 081/223] mtk: 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 ++++++ |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 11 | mt7996/init.c | 38 ++++++++++++++++++++++++++++++++++++-- |
| 12 | 2 files changed, 42 insertions(+), 2 deletions(-) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 13 | |
| 14 | diff --git a/mt7996/eeprom.c b/mt7996/eeprom.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 15 | index f9bd4d91..8272ead2 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 16 | --- a/mt7996/eeprom.c |
| 17 | +++ b/mt7996/eeprom.c |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 18 | @@ -422,6 +422,12 @@ static int mt7996_eeprom_parse_band_config(struct mt7996_phy *phy) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 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 | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 32 | index f5bff109..cedadefc 100644 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 33 | --- a/mt7996/init.c |
| 34 | +++ b/mt7996/init.c |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 35 | @@ -35,7 +35,7 @@ static const struct ieee80211_iface_combination if_comb[] = { |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 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, |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 42 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | |
| 43 | BIT(NL80211_CHAN_WIDTH_20) | |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 44 | @@ -46,6 +46,33 @@ static const struct ieee80211_iface_combination if_comb[] = { |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 45 | } |
| 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) |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 78 | @@ -419,8 +446,9 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 79 | 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 | |
developer | 05f3b2b | 2024-08-19 19:17:34 +0800 | [diff] [blame] | 89 | @@ -464,6 +492,12 @@ mt7996_init_wiphy(struct ieee80211_hw *hw, struct mtk_wed_device *wed) |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 90 | |
| 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 | -- |
developer | d0c8945 | 2024-10-11 16:53:27 +0800 | [diff] [blame^] | 103 | 2.45.2 |
developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 104 | |