From 209702d4c9fab15e7b397540ac8fad83abd22c85 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 19 Dec 2014 22:56:41 +0200 Subject: [PATCH] Add possibility to set the setband parameter 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 " can be used to select all bands, 5 GHz band only, or 2.4 GHz band only. Signed-off-by: Jouni Malinen --- wpa_supplicant/ctrl_iface.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index c8dc97d16..996971687 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -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);