Add possibility to set the setband parameter

Commit faf9a8585d 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>
This commit is contained in:
Jouni Malinen 2014-12-19 22:56:41 +02:00
parent 7749b1c982
commit 209702d4c9

View 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);