diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c index 5800d55ea..2afa16c95 100644 --- a/wpa_supplicant/hs20_supplicant.c +++ b/wpa_supplicant/hs20_supplicant.c @@ -23,6 +23,16 @@ #include "hs20_supplicant.h" +void wpas_hs20_add_indication(struct wpabuf *buf) +{ + wpabuf_put_u8(buf, WLAN_EID_VENDOR_SPECIFIC); + wpabuf_put_u8(buf, 5); + wpabuf_put_be24(buf, OUI_WFA); + wpabuf_put_u8(buf, HS20_INDICATION_OUI_TYPE); + wpabuf_put_u8(buf, 0x00); /* Hotspot Configuration */ +} + + struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload, size_t payload_len) { diff --git a/wpa_supplicant/hs20_supplicant.h b/wpa_supplicant/hs20_supplicant.h index 075e52cf8..6eb3926d3 100644 --- a/wpa_supplicant/hs20_supplicant.h +++ b/wpa_supplicant/hs20_supplicant.h @@ -8,6 +8,8 @@ #ifndef HS20_SUPPLICANT_H #define HS20_SUPPLICANT_H +void wpas_hs20_add_indication(struct wpabuf *buf); + int hs20_anqp_send_req(struct wpa_supplicant *wpa_s, const u8 *dst, u32 stypes, const u8 *payload, size_t payload_len); struct wpabuf * hs20_build_anqp_req(u32 stypes, const u8 *payload, diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index f27a0fb70..277b34f11 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -17,6 +17,7 @@ #include "wps_supplicant.h" #include "p2p_supplicant.h" #include "p2p/p2p.h" +#include "hs20_supplicant.h" #include "notify.h" #include "bss.h" #include "scan.h" @@ -626,6 +627,11 @@ ssid_list_set: wpa_supplicant_optimize_freqs(wpa_s, ¶ms); extra_ie = wpa_supplicant_extra_ies(wpa_s, ¶ms); +#ifdef CONFIG_HS20 + if (wpa_s->conf->hs20 && wpabuf_resize(&extra_ie, 6) == 0) + wpas_hs20_add_indication(extra_ie); +#endif /* CONFIG_HS20 */ + if (params.freqs == NULL && wpa_s->next_scan_freqs) { wpa_dbg(wpa_s, MSG_DEBUG, "Optimize scan based on previously " "generated frequency list");