aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-03-09 05:28:13 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-24 20:46:39 (GMT)
commitacb97b360033dba1cb26b17aeb8d204fca254b05 (patch)
tree4dc03979d9336482bd4ea120b1255c13791bc1c7
parent58dbc037005e700396ba52d8d01a8733a6742dd8 (diff)
downloadhostap-acb97b360033dba1cb26b17aeb8d204fca254b05.zip
hostap-acb97b360033dba1cb26b17aeb8d204fca254b05.tar.gz
hostap-acb97b360033dba1cb26b17aeb8d204fca254b05.tar.bz2
Android: Implement SETBAND for scan requests
This provides partial SETBAND driver command implementation by converting the request into a filter for which channels are scanned by wpa_supplicant.
-rw-r--r--wpa_supplicant/ctrl_iface.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 73ef0b9..7963bc8 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -5168,7 +5168,26 @@ static int wpa_supplicant_driver_cmd(struct wpa_supplicant *wpa_s, char *cmd,
ret = pno_start(wpa_s);
else if (os_strcasecmp(cmd, "BGSCAN-STOP") == 0)
ret = pno_stop(wpa_s);
- else
+ else if (os_strncasecmp(cmd, "SETBAND ", 8) == 0) {
+ int val = atoi(cmd + 8);
+ /*
+ * Use driver_cmd for drivers that support it, but ignore the
+ * return value since scan requests from wpa_supplicant will
+ * provide a list of channels to scan for based on the SETBAND
+ * setting.
+ */
+ wpa_printf(MSG_DEBUG, "SETBAND: %d", val);
+ wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
+ ret = 0;
+ if (val == 0)
+ wpa_s->setband = WPA_SETBAND_AUTO;
+ else if (val == 1)
+ wpa_s->setband = WPA_SETBAND_5G;
+ else if (val == 2)
+ wpa_s->setband = WPA_SETBAND_2G;
+ else
+ ret = -1;
+ } else
ret = wpa_drv_driver_cmd(wpa_s, cmd, buf, buflen);
if (ret == 0) {
if (os_strncasecmp(cmd, "COUNTRY", 7) == 0) {