Skip to content

Commit 14339b0

Browse files
nbd168gregkh
authored andcommitted
mac80211: initialize SMPS field in HT capabilities
[ Upstream commit 43071d8fb3b7f589d72663c496a6880fb097533c ] ibss and mesh modes copy the ht capabilites from the band without overriding the SMPS state. Unfortunately the default value 0 for the SMPS field means static SMPS instead of disabled. This results in HT ibss and mesh setups using only single-stream rates, even though SMPS is not supposed to be active. Initialize SMPS to disabled for all bands on ieee80211_hw_register to ensure that the value is sane where it is not overriden with the real SMPS state. Reported-by: Elektra Wagenrad <onelektra@gmx.net> Signed-off-by: Felix Fietkau <nbd@nbd.name> [move VHT TODO comment to a better place] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 11dd9e2 commit 14339b0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

net/mac80211/main.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,12 +891,17 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
891891
supp_ht = supp_ht || sband->ht_cap.ht_supported;
892892
supp_vht = supp_vht || sband->vht_cap.vht_supported;
893893

894-
if (sband->ht_cap.ht_supported)
895-
local->rx_chains =
896-
max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
897-
local->rx_chains);
894+
if (!sband->ht_cap.ht_supported)
895+
continue;
898896

899897
/* TODO: consider VHT for RX chains, hopefully it's the same */
898+
local->rx_chains =
899+
max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
900+
local->rx_chains);
901+
902+
/* no need to mask, SM_PS_DISABLED has all bits set */
903+
sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
904+
IEEE80211_HT_CAP_SM_PS_SHIFT;
900905
}
901906

902907
/* if low-level driver supports AP, we also support VLAN */

0 commit comments

Comments
 (0)