Disabling SMPS (Spatial multiplexing power save) when 802.11n is not used
Jouni Malinen
j at w1.fi
Fri Mar 18 07:16:18 PDT 2016
On Fri, Mar 18, 2016 at 02:11:13PM +0100, Jose Blanquicet wrote:
> You are probably right, the problem could be that smps attribute is added
> without verify if it is going to do HT. In function wpa_driver_nl80211_set_ap:
>
> if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
> goto fail;
>
> When I set it to HT_CAP_INFO_SMPS_DISABLED, nl80211 shoul ignore it
> and that's the reason why it works.
Which driver are you using when testing this and what kind of
wpa_supplicant configuration? I was unable to reproduce the error
message with mac80211_hwsim, i.e., the AP did come up with HT disabled
when configuring the network with disable_ht=1.
That said, the attribute should not be there and the proper fix would
likely look like this:
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 5fb6652..b4c3462 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3526,24 +3526,26 @@ static int wpa_driver_nl80211_set_ap(void *priv,
nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite))
goto fail;
- switch (params->smps_mode) {
- case HT_CAP_INFO_SMPS_DYNAMIC:
- wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
- smps_mode = NL80211_SMPS_DYNAMIC;
- break;
- case HT_CAP_INFO_SMPS_STATIC:
- wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
- smps_mode = NL80211_SMPS_STATIC;
- break;
- default:
- /* invalid - fallback to smps off */
- case HT_CAP_INFO_SMPS_DISABLED:
- wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
- smps_mode = NL80211_SMPS_OFF;
- break;
+ if (params->ht_opmode != -1) {
+ switch (params->smps_mode) {
+ case HT_CAP_INFO_SMPS_DYNAMIC:
+ wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
+ smps_mode = NL80211_SMPS_DYNAMIC;
+ break;
+ case HT_CAP_INFO_SMPS_STATIC:
+ wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
+ smps_mode = NL80211_SMPS_STATIC;
+ break;
+ default:
+ /* invalid - fallback to smps off */
+ case HT_CAP_INFO_SMPS_DISABLED:
+ wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
+ smps_mode = NL80211_SMPS_OFF;
+ break;
+ }
+ if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
+ goto fail;
}
- if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
- goto fail;
if (params->beacon_ies) {
wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies",
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list