aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorvamsi krishna <vamsin@qti.qualcomm.com>2016-07-19 12:41:15 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-24 21:49:53 -0700
commit2b23da8a23446f9c8deb8c8650528f1b09d8701d (patch)
tree395eb6d58f9a8c3267a73cdff43c00ec3ea87b41 /src
parent5000e881341727fa0ba747c8b91e680135613396 (diff)
downloadandroid_external_wpa_supplicant_8-2b23da8a23446f9c8deb8c8650528f1b09d8701d.tar.gz
android_external_wpa_supplicant_8-2b23da8a23446f9c8deb8c8650528f1b09d8701d.tar.bz2
android_external_wpa_supplicant_8-2b23da8a23446f9c8deb8c8650528f1b09d8701d.zip
Set default scan IEs to the driver (QCA vendor extension)
This makes wpa_supplicant set default scan IEs to the driver (if the vendor command is supported). The driver can use these IEs in the scan requests initiated by the driver itself. Also the driver can merge these IEs into further scan requests that it receives, in case if the scan request doesn't carry any of the IEs sent in this command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: cc9985d1b1a844fddbc042abe8c4f5036c0d410b Git-repo: git://w1.fi/srv/git/hostap.git Change-Id: I21e8e31c50bb14903a14a2419a6eb5f4ae8841ef CRs-Fixed: 1049832
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver.h17
-rw-r--r--src/drivers/driver_nl80211.c1
-rw-r--r--src/drivers/driver_nl80211.h2
-rw-r--r--src/drivers/driver_nl80211_capa.c3
-rw-r--r--src/drivers/driver_nl80211_scan.c50
5 files changed, 73 insertions, 0 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index c33db9fe..a102d9bc 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -3578,6 +3578,23 @@ struct wpa_driver_ops {
* Returns: 0 on success or -1 on failure
*/
int (*p2p_lo_stop)(void *priv);
+
+ /**
+ * set_default_scan_ies - Set default scan IEs
+ * @priv: Private driver interface data
+ * @ies: Scan default IEs buffer
+ * @ies_len: Length of IEs in bytes
+ * Returns: 0 on success or -1 on failure
+ *
+ * The driver can use these by default when there are no scan IEs coming
+ * in the subsequent scan requests. Also in case of one or more of IEs
+ * given in set_default_scan_ies() are missing in the subsequent scan
+ * request, the driver should merge the missing scan IEs in the scan
+ * request from the IEs set by set_default_scan_ies() in the Probe
+ * Request frames sent.
+ */
+ int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
+
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 0ca6ccdc..fd9cd01c 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -9289,6 +9289,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.set_prob_oper_freq = nl80211_set_prob_oper_freq,
.p2p_lo_start = nl80211_p2p_lo_start,
.p2p_lo_stop = nl80211_p2p_lo_stop,
+ .set_default_scan_ies = nl80211_set_default_scan_ies,
#endif /* CONFIG_DRIVER_NL80211_QCA */
.get_ext_capab = nl80211_get_ext_capab,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 283dfd99..d0ec48c9 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -159,6 +159,7 @@ struct wpa_driver_nl80211_data {
unsigned int set_prob_oper_freq:1;
unsigned int scan_vendor_cmd_avail:1;
unsigned int connect_reassoc:1;
+ unsigned int set_wifi_conf_vendor_cmd_avail:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
@@ -301,5 +302,6 @@ void nl80211_dump_scan(struct wpa_driver_nl80211_data *drv);
int wpa_driver_nl80211_abort_scan(void *priv);
int wpa_driver_nl80211_vendor_scan(struct i802_bss *bss,
struct wpa_driver_scan_params *params);
+int nl80211_set_default_scan_ies(void *priv, const u8 *ies, size_t ies_len);
#endif /* DRIVER_NL80211_H */
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index a5515fff..56647449 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -702,6 +702,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN:
drv->scan_vendor_cmd_avail = 1;
break;
+ case QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION:
+ drv->set_wifi_conf_vendor_cmd_avail = 1;
+ break;
#endif /* CONFIG_DRIVER_NL80211_QCA */
}
}
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index c0898914..c115b6b3 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -1070,4 +1070,54 @@ fail:
return ret;
}
+
+/**
+ * nl80211_set_default_scan_ies - Set the scan default IEs to the driver
+ * @priv: Pointer to private driver data from wpa_driver_nl80211_init()
+ * @ies: Pointer to IEs buffer
+ * @ies_len: Length of IEs in bytes
+ * Returns: 0 on success, -1 on failure
+ */
+int nl80211_set_default_scan_ies(void *priv, const u8 *ies, size_t ies_len)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg = NULL;
+ struct nlattr *attr;
+ int ret = -1;
+
+ if (!drv->set_wifi_conf_vendor_cmd_avail)
+ return -1;
+
+ if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA) ||
+ nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
+ QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION))
+ goto fail;
+
+ attr = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
+ if (attr == NULL)
+ goto fail;
+
+ wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan default IEs", ies, ies_len);
+ if (nla_put(msg, QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES,
+ ies_len, ies))
+ goto fail;
+
+ nla_nest_end(msg, attr);
+
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ msg = NULL;
+ if (ret) {
+ wpa_printf(MSG_ERROR,
+ "nl80211: Set scan default IEs failed: ret=%d (%s)",
+ ret, strerror(-ret));
+ goto fail;
+ }
+
+fail:
+ nlmsg_free(msg);
+ return ret;
+}
+
#endif /* CONFIG_DRIVER_NL80211_QCA */