aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mbo.c
diff options
context:
space:
mode:
authorvamsi krishna <vamsin@qti.qualcomm.com>2016-09-09 12:05:50 (GMT)
committerJouni Malinen <j@w1.fi>2016-09-30 19:45:03 (GMT)
commit8f4791749302bb3a89b2baef19fc5e6075ec3845 (patch)
tree8cc755dffeee85f4910a6118fb6fa255e262f8f9 /wpa_supplicant/mbo.c
parent5b71cb552bc0def1149acf2a89a1847606702f22 (diff)
downloadhostap-8f4791749302bb3a89b2baef19fc5e6075ec3845.zip
hostap-8f4791749302bb3a89b2baef19fc5e6075ec3845.tar.gz
hostap-8f4791749302bb3a89b2baef19fc5e6075ec3845.tar.bz2
MBO: Add support to send ANQP request to get cellular preference
This extends ANQP_GET command to support querying MBO cellular preference also. The cellular preference can be requested along with neigbor report by appending mbo:1 to the command arguments. For example: ANQP_GET <bssid> 272,mbo:1 Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/mbo.c')
-rw-r--r--wpa_supplicant/mbo.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/wpa_supplicant/mbo.c b/wpa_supplicant/mbo.c
index 13d764e..7e049be 100644
--- a/wpa_supplicant/mbo.c
+++ b/wpa_supplicant/mbo.c
@@ -14,6 +14,7 @@
#include "utils/common.h"
#include "common/ieee802_11_defs.h"
+#include "common/gas.h"
#include "config.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
@@ -805,3 +806,31 @@ void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa)
wpas_mbo_send_wnm_notification(wpa_s, cell_capa, 7);
wpa_supplicant_set_default_scan_ies(wpa_s);
}
+
+
+struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
+ struct wpa_bss *bss)
+{
+ struct wpabuf *anqp_buf;
+ u8 *len_pos;
+
+ if (!wpa_bss_get_vendor_ie(bss, MBO_IE_VENDOR_TYPE)) {
+ wpa_printf(MSG_INFO, "MBO: " MACSTR
+ " does not support MBO - cannot request MBO ANQP elements from it",
+ MAC2STR(bss->bssid));
+ return NULL;
+ }
+
+ anqp_buf = wpabuf_alloc(10);
+ if (!anqp_buf)
+ return NULL;
+
+ len_pos = gas_anqp_add_element(anqp_buf, ANQP_VENDOR_SPECIFIC);
+ wpabuf_put_be24(anqp_buf, OUI_WFA);
+ wpabuf_put_u8(anqp_buf, MBO_ANQP_OUI_TYPE);
+
+ wpabuf_put_u8(anqp_buf, MBO_ANQP_SUBTYPE_CELL_CONN_PREF);
+ gas_anqp_set_element_len(anqp_buf, len_pos);
+
+ return anqp_buf;
+}