nl80211: Do not add NL80211_ATTR_SMPS_MODE attribute if HT is disabled

SMPS mode is applicable only for HT and including an attribute to
configure it when HT is disabled could result in the AP start operation
failing. Fix this by adding the attribute only in cases where HT is
enabled.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-03-18 16:16:40 +02:00 committed by Jouni Malinen
parent 4ca16b5fd7
commit ee298f1b1f

View file

@ -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",