kernel: add missing config symbols for 4.9
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 348-mac80211-initialize-SMPS-field-in-HT-capabilities.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 11 Jan 2017 23:30:20 +0100
3 Subject: [PATCH] mac80211: initialize SMPS field in HT capabilities
4
5 ibss and mesh modes copy the ht capabilites from the band without
6 overriding the SMPS state. Unfortunately the default value 0 for the
7 SMPS field means static SMPS instead of disabled.
8
9 This results in HT ibss and mesh setups using only single-stream rates,
10 even though SMPS is not supposed to be active.
11
12 Initialize SMPS to disabled for all bands on ieee80211_hw_register to
13 ensure that the value is sane where it is not overriden with the real
14 SMPS state.
15
16 Reported-by: Elektra Wagenrad <onelektra@gmx.net>
17 Signed-off-by: Felix Fietkau <nbd@nbd.name>
18 ---
19
20 --- a/net/mac80211/main.c
21 +++ b/net/mac80211/main.c
22 @@ -908,10 +908,15 @@ int ieee80211_register_hw(struct ieee802
23 supp_ht = supp_ht || sband->ht_cap.ht_supported;
24 supp_vht = supp_vht || sband->vht_cap.vht_supported;
25
26 - if (sband->ht_cap.ht_supported)
27 - local->rx_chains =
28 - max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
29 - local->rx_chains);
30 + if (!sband->ht_cap.ht_supported)
31 + continue;
32 +
33 + local->rx_chains =
34 + max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
35 + local->rx_chains);
36 +
37 + sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
38 + IEEE80211_HT_CAP_SM_PS_SHIFT;
39
40 /* TODO: consider VHT for RX chains, hopefully it's the same */
41 }