Add possibility to set the setband parameter
authorJouni Malinen <j@w1.fi>
Fri, 19 Dec 2014 20:56:41 +0000 (22:56 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 19 Dec 2014 20:56:41 +0000 (22:56 +0200)
Commit faf9a8585d3e187074c7991e1cd7fb3792baf53e added mechanism for
selecting 2.4 or 5 GHz band for scan operation. However, no mechanism
for setting the setband value was added at that time. This commit adds a
new SET ctrl_iface parameter to allow the setband functionality to be
used. "SET setband <AUTO/5G/2G>" can be used to select all bands, 5 GHz
band only, or 2.4 GHz band only.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/ctrl_iface.c

index c8dc97d..9969716 100644 (file)
@@ -441,6 +441,15 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
        } else if (os_strcmp(cmd, "blob") == 0) {
                ret = wpas_ctrl_set_blob(wpa_s, value);
 #endif /* CONFIG_NO_CONFIG_BLOBS */
+       } else if (os_strcasecmp(cmd, "setband") == 0) {
+               if (os_strcmp(value, "AUTO") == 0)
+                       wpa_s->setband = WPA_SETBAND_AUTO;
+               else if (os_strcmp(value, "5G") == 0)
+                       wpa_s->setband = WPA_SETBAND_5G;
+               else if (os_strcmp(value, "2G") == 0)
+                       wpa_s->setband = WPA_SETBAND_2G;
+               else
+                       ret = -1;
        } else {
                value[-1] = '=';
                ret = wpa_config_process_global(wpa_s->conf, cmd, -1);