wpa_supplicant(hidl): Support WPS PBC for GO am: 7a3998d944
am: 973b60a4b7

Change-Id: I6f9f15b2af3d61a10c3f88289d7414b70264c380
diff --git a/wpa_supplicant/hidl/1.0/p2p_iface.cpp b/wpa_supplicant/hidl/1.0/p2p_iface.cpp
index 9a048eb..839fcee 100644
--- a/wpa_supplicant/hidl/1.0/p2p_iface.cpp
+++ b/wpa_supplicant/hidl/1.0/p2p_iface.cpp
@@ -2,6 +2,7 @@
  * hidl interface for wpa_supplicant daemon
  * Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
  * Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
+ * Copyright (C) 2017 Sony Mobile Communications Inc.
  *
  * This software may be distributed under the terms of the BSD license.
  * See README for more details.
@@ -14,6 +15,7 @@
 #include "p2p_iface.h"
 
 extern "C" {
+#include "ap.h"
 #include "wps_supplicant.h"
 #include "wifi_display.h"
 }
@@ -1035,6 +1037,14 @@
 	}
 	const uint8_t* bssid_addr =
 	    is_zero_ether_addr(bssid.data()) ? nullptr : bssid.data();
+#ifdef CONFIG_AP
+	if (wpa_group_s->ap_iface) {
+		if (wpa_supplicant_ap_wps_pbc(wpa_group_s, bssid_addr, NULL)) {
+			return {SupplicantStatusCode::FAILURE_UNKNOWN, ""};
+		}
+		return {SupplicantStatusCode::SUCCESS, ""};
+	}
+#endif /* CONFIG_AP */
 	if (wpas_wps_start_pbc(wpa_group_s, bssid_addr, 0)) {
 		return {SupplicantStatusCode::FAILURE_UNKNOWN, ""};
 	}