mac80211: fix broken spatial multiplexing defaults
authorFelix Fietkau <nbd@nbd.name>
Wed, 11 Jan 2017 22:35:19 +0000 (23:35 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 13 Jan 2017 09:22:22 +0000 (10:22 +0100)
Most mac80211 drivers leave the SMPS field in the HT capabilities
uninitialized (unfortunately defaults to static SMPS), which leads to
some devices limiting themselves to single-stream rates in some modes
(mostly mesh and IBSS).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/kernel/mac80211/patches/348-mac80211-initialize-SMPS-field-in-HT-capabilities.patch [new file with mode: 0644]
package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch

diff --git a/package/kernel/mac80211/patches/348-mac80211-initialize-SMPS-field-in-HT-capabilities.patch b/package/kernel/mac80211/patches/348-mac80211-initialize-SMPS-field-in-HT-capabilities.patch
new file mode 100644 (file)
index 0000000..118f535
--- /dev/null
@@ -0,0 +1,41 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Wed, 11 Jan 2017 23:30:20 +0100
+Subject: [PATCH] mac80211: initialize SMPS field in HT capabilities
+
+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>
+---
+
+--- a/net/mac80211/main.c
++++ b/net/mac80211/main.c
+@@ -908,10 +908,15 @@ int ieee80211_register_hw(struct ieee802
+               supp_ht = supp_ht || sband->ht_cap.ht_supported;
+               supp_vht = supp_vht || sband->vht_cap.vht_supported;
+-              if (sband->ht_cap.ht_supported)
+-                      local->rx_chains =
+-                              max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
+-                                  local->rx_chains);
++              if (!sband->ht_cap.ht_supported)
++                      continue;
++
++              local->rx_chains =
++                      max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
++                          local->rx_chains);
++
++              sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
++                                   IEEE80211_HT_CAP_SM_PS_SHIFT;
+               /* TODO: consider VHT for RX chains, hopefully it's the same */
+       }
index 6e4962b09d90c19935f30c781057d0d357b558cd..9e767ffa8d19483b171c564bde0b7d52984f784d 100644 (file)
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -2562,6 +2562,7 @@ struct cfg80211_nan_func {
+@@ -2590,6 +2590,7 @@ struct cfg80211_nan_func {
   *    (as advertised by the nl80211 feature flag.)
   * @get_tx_power: store the current TX power into the dbm variable;
   *    return 0 if successful
@@ -8,7 +8,7 @@
   *
   * @set_wds_peer: set the WDS peer for a WDS interface
   *
-@@ -2836,6 +2837,7 @@ struct cfg80211_ops {
+@@ -2864,6 +2865,7 @@ struct cfg80211_ops {
                                enum nl80211_tx_power_setting type, int mbm);
        int     (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
                                int *dbm);