Browse Source

HS 2.0: Add Hotspot 2.0 indication into Probe Request

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Jay Katabathuni 13 years ago
parent
commit
c923b8a537
3 changed files with 18 additions and 0 deletions
  1. 10 0
      wpa_supplicant/hs20_supplicant.c
  2. 2 0
      wpa_supplicant/hs20_supplicant.h
  3. 6 0
      wpa_supplicant/scan.c

+ 10 - 0
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)
 {

+ 2 - 0
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,

+ 6 - 0
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, &params);
 	extra_ie = wpa_supplicant_extra_ies(wpa_s, &params);
 
+#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");