]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Advertise and configure SMPS modes
authorEliad Peller <eliad@wizery.com>
Mon, 20 Oct 2014 03:21:41 +0000 (23:21 -0400)
committerJouni Malinen <j@w1.fi>
Thu, 23 Oct 2014 22:29:08 +0000 (01:29 +0300)
Advertise static/dynamic SMPS mode support (according to the wiphy
feature bits) and pass the configured smps_mode when starting the AP.

Signed-off-by: Eliad Peller <eliad@wizery.com>
src/drivers/driver_nl80211.c

index b8df564c32ce712fcc2bc959fa6b202a262cf829..1017c80211926840acff83b71e30728e4c7e7a0c 100644 (file)
@@ -3888,6 +3888,12 @@ static void wiphy_info_feature_flags(struct wiphy_info_data *info,
 
        if (flags & NL80211_FEATURE_LOW_PRIORITY_SCAN)
                info->have_low_prio_scan = 1;
+
+       if (flags & NL80211_FEATURE_STATIC_SMPS)
+               capa->smps_modes |= WPA_DRIVER_SMPS_MODE_STATIC;
+
+       if (flags & NL80211_FEATURE_DYNAMIC_SMPS)
+               capa->smps_modes |= WPA_DRIVER_SMPS_MODE_DYNAMIC;
 }
 
 
@@ -7521,6 +7527,7 @@ static int wpa_driver_nl80211_set_ap(void *priv,
        int beacon_set;
        int ifindex = if_nametoindex(bss->ifname);
        int num_suites;
+       int smps_mode;
        u32 suites[10], suite;
        u32 ver;
 
@@ -7629,6 +7636,24 @@ static int wpa_driver_nl80211_set_ap(void *priv,
        if (suite)
                NLA_PUT_U32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite);
 
+       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;
+       }
+       NLA_PUT_U32(msg, NL80211_ATTR_SMPS_MODE, smps_mode);
+
        if (params->beacon_ies) {
                wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies",
                                params->beacon_ies);