aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/events.c1
-rw-r--r--wpa_supplicant/wps_supplicant.c26
-rw-r--r--wpa_supplicant/wps_supplicant.h5
3 files changed, 32 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index a1bd2ba..b3c414a 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -626,6 +626,7 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s)
} else {
wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
wpa_supplicant_dbus_notify_scan_results(wpa_s);
+ wpas_wps_notify_scan_results(wpa_s);
}
if (wpa_s->conf->ap_scan == 2 || wpa_s->disconnected)
diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c
index 131506f..8c254df 100644
--- a/wpa_supplicant/wps_supplicant.c
+++ b/wpa_supplicant/wps_supplicant.c
@@ -21,6 +21,7 @@
#include "eap_peer/eap.h"
#include "wpa_supplicant_i.h"
#include "eloop.h"
+#include "wpa_ctrl.h"
#include "eap_common/eap_wsc_common.h"
#include "wps/wps.h"
#include "wps/wps_defs.h"
@@ -558,3 +559,28 @@ int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
return ret;
}
+
+
+void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
+{
+ size_t i;
+
+ if (wpa_s->disconnected || wpa_s->wpa_state >= WPA_ASSOCIATED)
+ return;
+
+ for (i = 0; i < wpa_s->scan_res->num; i++) {
+ struct wpa_scan_res *bss = wpa_s->scan_res->res[i];
+ struct wpabuf *ie;
+ ie = wpa_scan_get_vendor_ie_multi(bss, WPS_IE_VENDOR_TYPE);
+ if (!ie)
+ continue;
+ if (wps_is_selected_pbc_registrar(ie))
+ wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE_PBC);
+ else if (wps_is_selected_pin_registrar(ie))
+ wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE_PIN);
+ else
+ wpa_msg(wpa_s, MSG_INFO, WPS_EVENT_AP_AVAILABLE);
+ wpabuf_free(ie);
+ break;
+ }
+}
diff --git a/wpa_supplicant/wps_supplicant.h b/wpa_supplicant/wps_supplicant.h
index bdde6ab..f781dea 100644
--- a/wpa_supplicant/wps_supplicant.h
+++ b/wpa_supplicant/wps_supplicant.h
@@ -31,6 +31,7 @@ int wpas_wps_ssid_wildcard_ok(struct wpa_ssid *ssid, struct wpa_scan_res *bss);
int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
struct wpa_scan_res *selected,
struct wpa_ssid *ssid);
+void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s);
#else /* CONFIG_WPS */
@@ -72,6 +73,10 @@ static inline int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
return 0;
}
+static inline void wpas_wps_notify_scan_results(struct wpa_supplicant *wpa_s)
+{
+}
+
#endif /* CONFIG_WPS */
#endif /* WPS_SUPPLICANT_H */