aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mbo.c
diff options
context:
space:
mode:
authorDavid Spinadel <david.spinadel@intel.com>2016-02-15 14:53:28 (GMT)
committerJouni Malinen <j@w1.fi>2016-02-22 17:53:04 (GMT)
commitc5d193d7b3cfeeafefa65c30b216aef04dd8dde3 (patch)
tree02e589fdf7721ed0a6678330fe15950ce9b07dd7 /wpa_supplicant/mbo.c
parent2d5b8614b7df19d670ae6cc29db3b3022801d8a8 (diff)
downloadhostap-c5d193d7b3cfeeafefa65c30b216aef04dd8dde3.zip
hostap-c5d193d7b3cfeeafefa65c30b216aef04dd8dde3.tar.gz
hostap-c5d193d7b3cfeeafefa65c30b216aef04dd8dde3.tar.bz2
MBO: Add cellular capability to MBO IE
Add cellular capability attribute to MBO IE and add MBO IE with cellular capabilities to Probe Request frames. By default, cellular capability value is set to Not Cellular capable (3). Signed-off-by: David Spinadel <david.spinadel@intel.com>
Diffstat (limited to 'wpa_supplicant/mbo.c')
-rw-r--r--wpa_supplicant/mbo.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/wpa_supplicant/mbo.c b/wpa_supplicant/mbo.c
index f35a1de..d6f2e76 100644
--- a/wpa_supplicant/mbo.c
+++ b/wpa_supplicant/mbo.c
@@ -136,8 +136,7 @@ int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len)
struct wpabuf *mbo;
int res;
- if (!wpa_s->non_pref_chan || !wpa_s->non_pref_chan_num ||
- len < MBO_IE_HEADER + 7)
+ if (len < MBO_IE_HEADER + 3 + 7)
return 0;
/* Leave room for the MBO IE header */
@@ -148,6 +147,14 @@ int wpas_mbo_ie(struct wpa_supplicant *wpa_s, u8 *buf, size_t len)
/* Add non-preferred channels attribute */
wpas_mbo_non_pref_chan_attrs(wpa_s, mbo, 0);
+ /*
+ * Send cellular capabilities attribute even if AP does not advertise
+ * cellular capabilities.
+ */
+ wpabuf_put_u8(mbo, MBO_ATTR_ID_CELL_DATA_CAPA);
+ wpabuf_put_u8(mbo, 1);
+ wpabuf_put_u8(mbo, wpa_s->conf->mbo_cell_capa);
+
res = mbo_add_ie(buf, len, wpabuf_head_u8(mbo), wpabuf_len(mbo));
if (!res)
wpa_printf(MSG_ERROR, "Failed to add MBO IE");
@@ -330,3 +337,16 @@ fail:
os_free(cmd);
return -1;
}
+
+
+void wpas_mbo_scan_ie(struct wpa_supplicant *wpa_s, struct wpabuf *ie)
+{
+ wpabuf_put_u8(ie, WLAN_EID_VENDOR_SPECIFIC);
+ wpabuf_put_u8(ie, 7);
+ wpabuf_put_be24(ie, OUI_WFA);
+ wpabuf_put_u8(ie, MBO_OUI_TYPE);
+
+ wpabuf_put_u8(ie, MBO_ATTR_ID_CELL_DATA_CAPA);
+ wpabuf_put_u8(ie, 1);
+ wpabuf_put_u8(ie, wpa_s->conf->mbo_cell_capa);
+}