aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/mbo.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2017-03-09 13:19:58 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-10 14:53:10 (GMT)
commit2316cb358c854a013bc27ac76c63d0e1ed663475 (patch)
tree3741d6c6ff74611cf3a54e5988919f7cd9e35906 /wpa_supplicant/mbo.c
parentf7c25d1a509ec439ee872f1496ebfdfe9e92d402 (diff)
downloadhostap-2316cb358c854a013bc27ac76c63d0e1ed663475.zip
hostap-2316cb358c854a013bc27ac76c63d0e1ed663475.tar.gz
hostap-2316cb358c854a013bc27ac76c63d0e1ed663475.tar.bz2
MBO: Add option to add MBO query list to ANQP query
MBO techspec v0.0_r27 changed the MBO ANQP-element format. The MBO element in ANQP query should now include an MBO Query List element that contains a list of MBO elements to query. Add API to add the MBO Query List to an ANQP query. Format: ANQP_GET <addr> <info_id>[,<info_id>]...[,mbo:<subtype>...] Example for querying neighbor report with MBO cellular data connection preference: ANQP_GET <bssid> 272,mbo:2 Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/mbo.c')
-rw-r--r--wpa_supplicant/mbo.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/wpa_supplicant/mbo.c b/wpa_supplicant/mbo.c
index 5488f44..5348b9a 100644
--- a/wpa_supplicant/mbo.c
+++ b/wpa_supplicant/mbo.c
@@ -515,10 +515,11 @@ void wpas_mbo_update_cell_capa(struct wpa_supplicant *wpa_s, u8 mbo_cell_capa)
struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
- struct wpa_bss *bss)
+ struct wpa_bss *bss, u32 mbo_subtypes)
{
struct wpabuf *anqp_buf;
u8 *len_pos;
+ u8 i;
if (!wpa_bss_get_vendor_ie(bss, MBO_IE_VENDOR_TYPE)) {
wpa_printf(MSG_INFO, "MBO: " MACSTR
@@ -527,7 +528,8 @@ struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
return NULL;
}
- anqp_buf = wpabuf_alloc(10);
+ /* Allocate size for the maximum case - all MBO subtypes are set */
+ anqp_buf = wpabuf_alloc(9 + MAX_MBO_ANQP_SUBTYPE);
if (!anqp_buf)
return NULL;
@@ -535,7 +537,14 @@ struct wpabuf * mbo_build_anqp_buf(struct wpa_supplicant *wpa_s,
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);
+ wpabuf_put_u8(anqp_buf, MBO_ANQP_SUBTYPE_QUERY_LIST);
+
+ /* The first valid MBO subtype is 1 */
+ for (i = 1; i <= MAX_MBO_ANQP_SUBTYPE; i++) {
+ if (mbo_subtypes & BIT(i))
+ wpabuf_put_u8(anqp_buf, i);
+ }
+
gas_anqp_set_element_len(anqp_buf, len_pos);
return anqp_buf;