aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorRavi Joshi <ravij@qca.qualcomm.com>2015-07-16 17:45:41 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-08-28 20:37:10 +0000
commite6ccb16448fd0d5cf080fcb534266797855428d6 (patch)
treeffdec901a738b6d4acce75463bb35099dde9dc3d /wpa_supplicant
parent289d1289b5698bfbc81a54e11cea5f10f8a62693 (diff)
downloadandroid_external_wpa_supplicant_8-e6ccb16448fd0d5cf080fcb534266797855428d6.tar.gz
android_external_wpa_supplicant_8-e6ccb16448fd0d5cf080fcb534266797855428d6.tar.bz2
android_external_wpa_supplicant_8-e6ccb16448fd0d5cf080fcb534266797855428d6.zip
Add QCA vendor command support to set band to driver
Add vendor command to pass SET setband command to the driver and read the updated channel list from driver when this notification succeeds. This allows the driver to update its internal channel lists based on setband configuration. For merge compatibility it has 3 patches: 844dfeb Add QCA vendor command support to set band to driver 6b0ceee Add QCA vendor definitions for multi-port concurrency d71bdfb Add QCA vendor command for updating gateway parameters Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Bug: 23261230 Change-Id: I4ce6307c54b27d3d2f54d435fc0cae5480bdf23c
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/ctrl_iface.c33
-rw-r--r--wpa_supplicant/driver_i.h8
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h2
3 files changed, 34 insertions, 9 deletions
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index d0d70e91..3d9936e2 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -284,6 +284,30 @@ static int wpas_ctrl_pno(struct wpa_supplicant *wpa_s, char *cmd)
}
+static int wpas_ctrl_set_band(struct wpa_supplicant *wpa_s, char *band)
+{
+ union wpa_event_data event;
+
+ if (os_strcmp(band, "AUTO") == 0)
+ wpa_s->setband = WPA_SETBAND_AUTO;
+ else if (os_strcmp(band, "5G") == 0)
+ wpa_s->setband = WPA_SETBAND_5G;
+ else if (os_strcmp(band, "2G") == 0)
+ wpa_s->setband = WPA_SETBAND_2G;
+ else
+ return -1;
+
+ if (wpa_drv_setband(wpa_s, wpa_s->setband) == 0) {
+ os_memset(&event, 0, sizeof(event));
+ event.channel_list_changed.initiator = REGDOM_SET_BY_USER;
+ event.channel_list_changed.type = REGDOM_TYPE_UNKNOWN;
+ wpa_supplicant_event(wpa_s, EVENT_CHANNEL_LIST_CHANGED, &event);
+ }
+
+ return 0;
+}
+
+
static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
char *cmd)
{
@@ -447,14 +471,7 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
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;
+ ret = wpas_ctrl_set_band(wpa_s, value);
} else {
value[-1] = '=';
ret = wpa_config_process_global(wpa_s->conf, cmd, -1);
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 1fcb1806..d1f9f8be 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -885,4 +885,12 @@ static inline int wpa_drv_disable_transmit_sa(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_MACSEC */
+static inline int wpa_drv_setband(struct wpa_supplicant *wpa_s,
+ enum set_band band)
+{
+ if (!wpa_s->driver->set_band)
+ return -1;
+ return wpa_s->driver->set_band(wpa_s->drv_priv, band);
+}
+
#endif /* DRIVER_I_H */
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index dd5b245c..4f63456f 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -482,7 +482,7 @@ struct wpa_supplicant {
struct wpa_ssid_value *disallow_aps_ssid;
size_t disallow_aps_ssid_count;
- enum { WPA_SETBAND_AUTO, WPA_SETBAND_5G, WPA_SETBAND_2G } setband;
+ enum set_band setband;
/* Preferred network for the next connection attempt */
struct wpa_ssid *next_ssid;