D-Bus: Add Signal to notify WPS PBC Overlap event
authorSaurav Babu <saurav.babu@samsung.com>
Thu, 28 May 2015 03:53:07 +0000 (09:23 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 27 Sep 2015 09:52:34 +0000 (12:52 +0300)
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
wpa_supplicant/events.c
wpa_supplicant/wps_supplicant.c
wpa_supplicant/wps_supplicant.h

index 45ae7ea..3af1c7d 100644 (file)
@@ -1201,6 +1201,7 @@ int wpa_supplicant_connect(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_P2P */
 
 #ifdef CONFIG_WPS
+               wpas_wps_pbc_overlap(wpa_s);
                wpas_wps_cancel(wpa_s);
 #endif /* CONFIG_WPS */
                return -1;
index e612ca3..60f761c 100644 (file)
@@ -1248,6 +1248,22 @@ int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
 }
 
 
+void wpas_wps_pbc_overlap(struct wpa_supplicant *wpa_s)
+{
+       union wps_event_data data;
+
+       os_memset(&data, 0, sizeof(data));
+       data.fail.config_error = WPS_CFG_MULTIPLE_PBC_DETECTED;
+       data.fail.error_indication = WPS_EI_NO_ERROR;
+       /*
+        * Call wpas_notify_wps_event_fail() directly instead of through
+        * wpa_supplicant_wps_event() which would end up registering unnecessary
+        * timeouts (those are only for the case where the failure happens
+        * during an EAP-WSC exchange).
+        */
+       wpas_notify_wps_event_fail(wpa_s, &data.fail);
+}
+
 /* Cancel the wps pbc/pin requests */
 int wpas_wps_cancel(struct wpa_supplicant *wpa_s)
 {
index 683bd50..3c25ca8 100644 (file)
@@ -33,6 +33,7 @@ int wpas_wps_start_pbc(struct wpa_supplicant *wpa_s, const u8 *bssid,
                       int p2p_group);
 int wpas_wps_start_pin(struct wpa_supplicant *wpa_s, const u8 *bssid,
                       const char *pin, int p2p_group, u16 dev_pw_id);
+void wpas_wps_pbc_overlap(struct wpa_supplicant *wpa_s);
 int wpas_wps_cancel(struct wpa_supplicant *wpa_s);
 int wpas_wps_start_reg(struct wpa_supplicant *wpa_s, const u8 *bssid,
                       const char *pin, struct wps_new_ap_settings *settings);