aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Niwa <daisuke.x.niwa@sonymobile.com>2017-05-11 11:24:08 +0900
committerGlen Kuhne <kuh@google.com>2017-05-23 10:39:06 -0700
commit7a3998d9441af108e589afddd367762c4ef20f1b (patch)
tree4eed27d199bddb2c694809f67f146abbb399d325
parent553d451a3d75f70ef8eb5996222532c9312697ae (diff)
downloadwpa_supplicant_8-7a3998d9441af108e589afddd367762c4ef20f1b.tar.gz
wpa_supplicant(hidl): Support WPS PBC for GO
Current HIDL implementation doesn't handle ap_iface(GO). If device is GO, wpa_supplicant_ap_wps_pbc should be called. This patch takes care of PBC use case only. Bug: 38251521 Test: Manually verified via settings UI Change-Id: I18d04eece606772a1544fbf7238973113b4132a5
-rw-r--r--wpa_supplicant/hidl/1.0/p2p_iface.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/wpa_supplicant/hidl/1.0/p2p_iface.cpp b/wpa_supplicant/hidl/1.0/p2p_iface.cpp
index 9a048eb5..839fceee 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 @@ SupplicantStatus P2pIface::startWpsPbcInternal(
}
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, ""};
}