aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@citymesh.com>2021-04-02 12:21:24 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2021-04-09 15:43:38 +0200
commitcc0b70467d0f67ea6481100631119ae77b76c9eb (patch)
treead7f9978ac50dbac64b372ba14fed32222fc5663 /package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch
parent2c46ba4356172a2562152a21aa085d5921d9e2a2 (diff)
downloadupstream-cc0b70467d0f67ea6481100631119ae77b76c9eb.tar.gz
upstream-cc0b70467d0f67ea6481100631119ae77b76c9eb.tar.bz2
upstream-cc0b70467d0f67ea6481100631119ae77b76c9eb.zip
mac80211: backport upstream fixes
Refreshed all patches. Includes all fixes up to 4.19.184 Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch')
-rw-r--r--package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch b/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch
new file mode 100644
index 0000000000..a88b24d402
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/369-mac80211-don-t-set-set-TDLS-STA-bandwidth-wider-than.patch
@@ -0,0 +1,65 @@
+From ebbd7dc7ca856a182769c17c4c8a739cedc064c4 Mon Sep 17 00:00:00 2001
+From: Johannes Berg <johannes.berg@intel.com>
+Date: Sun, 6 Dec 2020 14:54:44 +0200
+Subject: [PATCH] mac80211: don't set set TDLS STA bandwidth wider than
+ possible
+
+[ Upstream commit f65607cdbc6b0da356ef5a22552ddd9313cf87a0 ]
+
+When we set up a TDLS station, we set sta->sta.bandwidth solely based
+on the capabilities, because the "what's the current bandwidth" check
+is bypassed and only applied for other types of stations.
+
+This leads to the unfortunate scenario that the sta->sta.bandwidth is
+160 MHz if both stations support it, but we never actually configure
+this bandwidth unless the AP is already using 160 MHz; even for wider
+bandwidth support we only go up to 80 MHz (at least right now.)
+
+For iwlwifi, this can also lead to firmware asserts, telling us that
+we've configured the TX rates for a higher bandwidth than is actually
+available due to the PHY configuration.
+
+For non-TDLS, we check against the interface's requested bandwidth,
+but we explicitly skip this check for TDLS to cope with the wider BW
+case. Change this to
+ (a) still limit to the TDLS peer's own chandef, which gets factored
+ into the overall PHY configuration we request from the driver,
+ and
+ (b) limit it to when the TDLS peer is authorized, because it's only
+ factored into the channel context in this case.
+
+Fixes: 504871e602d9 ("mac80211: fix bandwidth computation for TDLS peers")
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Link: https://lore.kernel.org/r/iwlwifi.20201206145305.fcc7d29c4590.I11f77e9e25ddf871a3c8d5604650c763e2c5887a@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mac80211/vht.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+--- a/net/mac80211/vht.c
++++ b/net/mac80211/vht.c
+@@ -421,12 +421,18 @@ enum ieee80211_sta_rx_bandwidth ieee8021
+ * IEEE80211-2016 specification makes higher bandwidth operation
+ * possible on the TDLS link if the peers have wider bandwidth
+ * capability.
++ *
++ * However, in this case, and only if the TDLS peer is authorized,
++ * limit to the tdls_chandef so that the configuration here isn't
++ * wider than what's actually requested on the channel context.
+ */
+ if (test_sta_flag(sta, WLAN_STA_TDLS_PEER) &&
+- test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW))
+- return bw;
+-
+- bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width));
++ test_sta_flag(sta, WLAN_STA_TDLS_WIDER_BW) &&
++ test_sta_flag(sta, WLAN_STA_AUTHORIZED) &&
++ sta->tdls_chandef.chan)
++ bw = min(bw, ieee80211_chan_width_to_rx_bw(sta->tdls_chandef.width));
++ else
++ bw = min(bw, ieee80211_chan_width_to_rx_bw(bss_width));
+
+ return bw;
+ }