]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
mac80211: don't set set TDLS STA bandwidth wider than possible
authorJohannes Berg <johannes.berg@intel.com>
Sun, 6 Dec 2020 12:54:44 +0000 (14:54 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 11 Dec 2020 12:20:05 +0000 (13:20 +0100)
commitf65607cdbc6b0da356ef5a22552ddd9313cf87a0
treee5e720a7522f799e9e63e4a701a03dc1a7faa855
parent3f8a39ff28078e4b56d94e8676f49d9975f82e51
mac80211: don't set set TDLS STA bandwidth wider than possible

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>
net/mac80211/vht.c