From d493b10e6928004b8475b2d06030539dba5e6697 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 11 Aug 2023 17:29:57 +0800 Subject: [PATCH] mac80211: mt7601u: allow AP mode Signed-off-by: Tianling Shen --- .../ath10k/983-ath10k-allow-vht-on-2g.patch | 2 +- ...k-always-use-mac80211-loss-detection.patch | 2 +- .../ath11k/983-ath11k-Enable-VHT-for-2G.patch | 8 ++--- ...100-w1fi-mt7601u-Add-AP-mode-support.patch | 36 +++++++++++++++++++ .../subsys/600-mac80211-allow-vht-on-2g.patch | 4 +-- 5 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 package/kernel/mac80211/patches/mt7601u/100-w1fi-mt7601u-Add-AP-mode-support.patch diff --git a/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch b/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch index eeca88a613..3fb26bff90 100644 --- a/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch +++ b/package/kernel/mac80211/patches/ath10k/983-ath10k-allow-vht-on-2g.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -4718,6 +4718,7 @@ static void ath10k_mac_setup_ht_vht_cap( +@@ -5034,6 +5034,7 @@ static void ath10k_mac_setup_ht_vht_cap( if (ar->phy_capability & WHAL_WLAN_11G_CAPABILITY) { band = &ar->mac.sbands[NL80211_BAND_2GHZ]; band->ht_cap = ht_cap; diff --git a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch index f025fea63b..f4b1ded15e 100644 --- a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch @@ -18,7 +18,7 @@ Signed-off-by: David Bauer --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10080,7 +10080,6 @@ int ath10k_mac_register(struct ath10k *a +@@ -10081,7 +10081,6 @@ int ath10k_mac_register(struct ath10k *a ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA); ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); diff --git a/package/kernel/mac80211/patches/ath11k/983-ath11k-Enable-VHT-for-2G.patch b/package/kernel/mac80211/patches/ath11k/983-ath11k-Enable-VHT-for-2G.patch index 8484b7b92e..316396fdc8 100644 --- a/package/kernel/mac80211/patches/ath11k/983-ath11k-Enable-VHT-for-2G.patch +++ b/package/kernel/mac80211/patches/ath11k/983-ath11k-Enable-VHT-for-2G.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -2594,9 +2594,9 @@ +@@ -2776,9 +2776,9 @@ static void ath11k_peer_assoc_h_phymode( } else if (sta->deflink.vht_cap.vht_supported && !ath11k_peer_assoc_h_vht_masked(vht_mcs_mask)) { if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_40) @@ -12,7 +12,7 @@ } else if (sta->deflink.ht_cap.ht_supported && !ath11k_peer_assoc_h_ht_masked(ht_mcs_mask)) { if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_40) -@@ -5183,6 +5183,9 @@ +@@ -5616,6 +5616,9 @@ static void ath11k_mac_setup_ht_vht_cap( *ht_cap_info = ht_cap; band->ht_cap = ath11k_create_ht_cap(ar, ht_cap, rate_cap_rx_chainmask); @@ -24,7 +24,7 @@ if (cap->supported_bands & WMI_HOST_WLAN_5G_CAP && --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -346,6 +346,8 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st +@@ -406,6 +406,8 @@ ath11k_pull_mac_phy_cap_svc_ready_ext(st * handled. */ if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_2G_CAP) { @@ -32,4 +32,4 @@ + pdev_cap->vht_mcs = mac_phy_caps->vht_supp_mcs_2g; pdev_cap->tx_chain_mask = mac_phy_caps->tx_chain_mask_2g; pdev_cap->rx_chain_mask = mac_phy_caps->rx_chain_mask_2g; - } else if (mac_phy_caps->supported_bands & WMI_HOST_WLAN_5G_CAP) { + } diff --git a/package/kernel/mac80211/patches/mt7601u/100-w1fi-mt7601u-Add-AP-mode-support.patch b/package/kernel/mac80211/patches/mt7601u/100-w1fi-mt7601u-Add-AP-mode-support.patch new file mode 100644 index 0000000000..654954e454 --- /dev/null +++ b/package/kernel/mac80211/patches/mt7601u/100-w1fi-mt7601u-Add-AP-mode-support.patch @@ -0,0 +1,36 @@ +From: Chukun Pan +To: Jakub Kicinski +Cc: Kalle Valo , + "David S . Miller" , + Eric Dumazet , + Paolo Abeni , + Matthias Brugger , + Lintel Huang , + linux-wireless@vger.kernel.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org, Chukun Pan +Subject: [PATCH] wifi: mt7601u: Add AP mode support +Date: Tue, 26 Jul 2022 00:16:03 +0800 [thread overview] +Message-ID: <20220725161603.15201-1-amadeus@jmu.edu.cn> (raw) + +Add AP mode support to mt7601u chipset. +Simply tested it with firmware version +201302052146 and it seems working fine. + +Run-tested-by: Lintel Huang +Signed-off-by: Chukun Pan +--- + drivers/net/wireless/mediatek/mt7601u/init.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/mediatek/mt7601u/init.c ++++ b/drivers/net/wireless/mediatek/mt7601u/init.c +@@ -609,7 +609,8 @@ int mt7601u_register_device(struct mt760 + SET_IEEE80211_PERM_ADDR(hw, dev->macaddr); + + wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR; +- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); ++ wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | ++ BIT(NL80211_IFTYPE_AP); + wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; + + wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch b/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch index ffdb07479c..5d8742ba95 100644 --- a/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch +++ b/package/kernel/mac80211/patches/subsys/600-mac80211-allow-vht-on-2g.patch @@ -12,7 +12,7 @@ have_80mhz = true; --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -1906,7 +1906,8 @@ static int ieee80211_build_preq_ies_band +@@ -1955,7 +1955,8 @@ static int ieee80211_build_preq_ies_band /* Check if any channel in this sband supports at least 80 MHz */ for (i = 0; i < sband->n_channels; i++) { if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED | @@ -24,7 +24,7 @@ have_80mhz = true; --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c -@@ -5068,7 +5068,8 @@ static int ieee80211_prep_channel(struct +@@ -4744,7 +4744,8 @@ static int ieee80211_prep_channel(struct have_80mhz = false; for (i = 0; i < sband->n_channels; i++) { if (sband->channels[i].flags & (IEEE80211_CHAN_DISABLED |