WPS: Add WPS Cancel method over D-Bus interface
[mech_eap.git] / wpa_supplicant / dbus / dbus_new.c
index 121033f..85039bc 100644 (file)
@@ -4,14 +4,8 @@
  * Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
  * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include "includes.h"
 #include "../config.h"
 #include "../wpa_supplicant_i.h"
 #include "../bss.h"
+#include "../wpas_glue.h"
 #include "dbus_new_helpers.h"
 #include "dbus_dict_helpers.h"
 #include "dbus_new.h"
 #include "dbus_new_handlers.h"
-#include "dbus_common.h"
 #include "dbus_common_i.h"
 #include "dbus_new_handlers_p2p.h"
 #include "p2p/p2p.h"
+#include "../p2p_supplicant.h"
+
+#ifdef CONFIG_AP /* until needed by something else */
+
+/*
+ * NameOwnerChanged handling
+ *
+ * Some services we provide allow an application to register for
+ * a signal that it needs. While it can also unregister, we must
+ * be prepared for the case where the application simply crashes
+ * and thus doesn't clean up properly. The way to handle this in
+ * DBus is to register for the NameOwnerChanged signal which will
+ * signal an owner change to NULL if the peer closes the socket
+ * for whatever reason.
+ *
+ * Handle this signal via a filter function whenever necessary.
+ * The code below also handles refcounting in case in the future
+ * there will be multiple instances of this subscription scheme.
+ */
+static const char wpas_dbus_noc_filter_str[] =
+       "interface=org.freedesktop.DBus,member=NameOwnerChanged";
+
+
+static DBusHandlerResult noc_filter(DBusConnection *conn,
+                                   DBusMessage *message, void *data)
+{
+       struct wpas_dbus_priv *priv = data;
+
+       if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_SIGNAL)
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+       if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS,
+                                  "NameOwnerChanged")) {
+               const char *name;
+               const char *prev_owner;
+               const char *new_owner;
+               DBusError derr;
+               struct wpa_supplicant *wpa_s;
+
+               dbus_error_init(&derr);
+
+               if (!dbus_message_get_args(message, &derr,
+                                          DBUS_TYPE_STRING, &name,
+                                          DBUS_TYPE_STRING, &prev_owner,
+                                          DBUS_TYPE_STRING, &new_owner,
+                                          DBUS_TYPE_INVALID)) {
+                       /* Ignore this error */
+                       dbus_error_free(&derr);
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+               }
+
+               for (wpa_s = priv->global->ifaces; wpa_s; wpa_s = wpa_s->next) {
+                       if (wpa_s->preq_notify_peer != NULL &&
+                           os_strcmp(name, wpa_s->preq_notify_peer) == 0 &&
+                           (new_owner == NULL || os_strlen(new_owner) == 0)) {
+                               /* probe request owner disconnected */
+                               os_free(wpa_s->preq_notify_peer);
+                               wpa_s->preq_notify_peer = NULL;
+                               wpas_dbus_unsubscribe_noc(priv);
+                       }
+               }
+       }
+
+       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+
+void wpas_dbus_subscribe_noc(struct wpas_dbus_priv *priv)
+{
+       priv->dbus_noc_refcnt++;
+       if (priv->dbus_noc_refcnt > 1)
+               return;
+
+       if (!dbus_connection_add_filter(priv->con, noc_filter, priv, NULL)) {
+               wpa_printf(MSG_ERROR, "dbus: failed to add filter");
+               return;
+       }
+
+       dbus_bus_add_match(priv->con, wpas_dbus_noc_filter_str, NULL);
+}
+
+
+void wpas_dbus_unsubscribe_noc(struct wpas_dbus_priv *priv)
+{
+       priv->dbus_noc_refcnt--;
+       if (priv->dbus_noc_refcnt > 0)
+               return;
+
+       dbus_bus_remove_match(priv->con, wpas_dbus_noc_filter_str, NULL);
+       dbus_connection_remove_filter(priv->con, noc_filter, priv);
+}
+
+#endif /* CONFIG_AP */
 
 
 /**
@@ -50,7 +137,7 @@ static void wpas_dbus_signal_interface(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(WPAS_DBUS_NEW_PATH,
@@ -60,22 +147,14 @@ static void wpas_dbus_signal_interface(struct wpa_supplicant *wpa_s,
 
        dbus_message_iter_init_append(msg, &iter);
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &wpa_s->dbus_new_path))
-               goto err;
-
-       if (properties) {
-               if (!wpa_dbus_get_object_properties(
-                           iface, wpa_s->dbus_new_path,
-                           WPAS_DBUS_NEW_IFACE_INTERFACE, &iter))
-                       goto err;
-       }
-
-       dbus_connection_send(iface->con, msg, NULL);
-       dbus_message_unref(msg);
-       return;
-
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+                                           &wpa_s->dbus_new_path) ||
+           (properties &&
+            !wpa_dbus_get_object_properties(
+                    iface, wpa_s->dbus_new_path,
+                    WPAS_DBUS_NEW_IFACE_INTERFACE, &iter)))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
@@ -121,7 +200,7 @@ void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success)
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -141,7 +220,7 @@ void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success)
 
 
 /**
- * wpas_dbus_signal_blob - Send a BSS related event signal
+ * wpas_dbus_signal_bss - Send a BSS related event signal
  * @wpa_s: %wpa_supplicant network interface data
  * @bss_obj_path: BSS object path
  * @sig_name: signal name - BSSAdded or BSSRemoved
@@ -160,7 +239,7 @@ static void wpas_dbus_signal_bss(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -171,22 +250,14 @@ static void wpas_dbus_signal_bss(struct wpa_supplicant *wpa_s,
 
        dbus_message_iter_init_append(msg, &iter);
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &bss_obj_path))
-               goto err;
-
-       if (properties) {
-               if (!wpa_dbus_get_object_properties(iface, bss_obj_path,
-                                                   WPAS_DBUS_NEW_IFACE_BSS,
-                                                   &iter))
-                       goto err;
-       }
-
-       dbus_connection_send(iface->con, msg, NULL);
-       dbus_message_unref(msg);
-       return;
-
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+                                           &bss_obj_path) ||
+           (properties &&
+            !wpa_dbus_get_object_properties(iface, bss_obj_path,
+                                            WPAS_DBUS_NEW_IFACE_BSS,
+                                            &iter)))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
@@ -236,7 +307,7 @@ static void wpas_dbus_signal_blob(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -303,7 +374,7 @@ static void wpas_dbus_signal_network(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -319,23 +390,14 @@ static void wpas_dbus_signal_network(struct wpa_supplicant *wpa_s,
        dbus_message_iter_init_append(msg, &iter);
        path = net_obj_path;
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &path))
-               goto err;
-
-       if (properties) {
-               if (!wpa_dbus_get_object_properties(
-                           iface, net_obj_path, WPAS_DBUS_NEW_IFACE_NETWORK,
-                           &iter))
-                       goto err;
-       }
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-       dbus_message_unref(msg);
-       return;
-
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+                                           &path) ||
+           (properties &&
+            !wpa_dbus_get_object_properties(
+                    iface, net_obj_path, WPAS_DBUS_NEW_IFACE_NETWORK,
+                    &iter)))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
@@ -382,6 +444,60 @@ void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id)
 
 
 /**
+ * wpas_dbus_signal_network_request - Indicate that additional information
+ * (EAP password, etc.) is required to complete the association to this SSID
+ * @wpa_s: %wpa_supplicant network interface data
+ * @rtype: The specific additional information required
+ * @default_text: Optional description of required information
+ *
+ * Request additional information or passwords to complete an association
+ * request.
+ */
+void wpas_dbus_signal_network_request(struct wpa_supplicant *wpa_s,
+                                     struct wpa_ssid *ssid,
+                                     enum wpa_ctrl_req_type rtype,
+                                     const char *default_txt)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+       DBusMessageIter iter;
+       char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+       const char *field, *txt = NULL, *net_ptr;
+
+       iface = wpa_s->global->dbus;
+
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL || !wpa_s->dbus_new_path)
+               return;
+
+       field = wpa_supplicant_ctrl_req_to_string(rtype, default_txt, &txt);
+       if (field == NULL)
+               return;
+
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_INTERFACE,
+                                     "NetworkRequest");
+       if (msg == NULL)
+               return;
+
+       os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%u",
+                   wpa_s->dbus_new_path, ssid->id);
+       net_ptr = &net_obj_path[0];
+
+       dbus_message_iter_init_append(msg, &iter);
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
+                                           &net_ptr) ||
+           !dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &field) ||
+           !dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &txt))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
+       dbus_message_unref(msg);
+}
+
+
+/**
  * wpas_dbus_signal_network_enabled_changed - Signals Enabled property changes
  * @wpa_s: %wpa_supplicant network interface data
  * @ssid: configured network which Enabled property has changed
@@ -394,6 +510,9 @@ void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
 {
 
        char path[WPAS_DBUS_OBJECT_PATH_MAX];
+
+       if (!wpa_s->dbus_new_path)
+               return;
        os_snprintf(path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%d",
                    wpa_s->dbus_new_path, ssid->id);
@@ -422,7 +541,7 @@ void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s)
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -462,7 +581,7 @@ void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -503,7 +622,7 @@ void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -561,15 +680,15 @@ void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
        DBusMessage *msg;
        DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface;
-       char *auth_type[6]; /* we have six possible authorization types */
+       char *auth_type[5]; /* we have five possible authentication types */
        int at_num = 0;
-       char *encr_type[4]; /* we have four possible encryption types */
+       char *encr_type[3]; /* we have three possible encryption types */
        int et_num = 0;
 
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -586,34 +705,25 @@ void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
                auth_type[at_num++] = "open";
        if (cred->auth_type & WPS_AUTH_WPAPSK)
                auth_type[at_num++] = "wpa-psk";
-       if (cred->auth_type & WPS_AUTH_SHARED)
-               auth_type[at_num++] = "shared";
        if (cred->auth_type & WPS_AUTH_WPA)
                auth_type[at_num++] = "wpa-eap";
        if (cred->auth_type & WPS_AUTH_WPA2)
                auth_type[at_num++] = "wpa2-eap";
        if (cred->auth_type & WPS_AUTH_WPA2PSK)
-               auth_type[at_num++] =
-               "wpa2-psk";
+               auth_type[at_num++] = "wpa2-psk";
 
        if (cred->encr_type & WPS_ENCR_NONE)
                encr_type[et_num++] = "none";
-       if (cred->encr_type & WPS_ENCR_WEP)
-               encr_type[et_num++] = "wep";
        if (cred->encr_type & WPS_ENCR_TKIP)
                encr_type[et_num++] = "tkip";
        if (cred->encr_type & WPS_ENCR_AES)
                encr_type[et_num++] = "aes";
 
-       if (wpa_s->current_ssid) {
-               if (!wpa_dbus_dict_append_byte_array(
-                           &dict_iter, "BSSID",
-                           (const char *) wpa_s->current_ssid->bssid,
-                           ETH_ALEN))
-                       goto nomem;
-       }
-
-       if (!wpa_dbus_dict_append_byte_array(&dict_iter, "SSID",
+       if ((wpa_s->current_ssid &&
+            !wpa_dbus_dict_append_byte_array(
+                    &dict_iter, "BSSID",
+                    (const char *) wpa_s->current_ssid->bssid, ETH_ALEN)) ||
+           !wpa_dbus_dict_append_byte_array(&dict_iter, "SSID",
                                             (const char *) cred->ssid,
                                             cred->ssid_len) ||
            !wpa_dbus_dict_append_string_array(&dict_iter, "AuthType",
@@ -640,6 +750,8 @@ nomem:
 
 void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
                                    int depth, const char *subject,
+                                   const char *altsubject[],
+                                   int num_altsubject,
                                    const char *cert_hash,
                                    const struct wpabuf *cert)
 {
@@ -650,7 +762,7 @@ void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
@@ -660,32 +772,128 @@ void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
-               goto nomem;
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_uint32(&dict_iter, "depth", depth) ||
+           !wpa_dbus_dict_append_string(&dict_iter, "subject", subject) ||
+           (altsubject && num_altsubject &&
+            !wpa_dbus_dict_append_string_array(&dict_iter, "altsubject",
+                                               altsubject, num_altsubject)) ||
+           (cert_hash &&
+            !wpa_dbus_dict_append_string(&dict_iter, "cert_hash",
+                                         cert_hash)) ||
+           (cert &&
+            !wpa_dbus_dict_append_byte_array(&dict_iter, "cert",
+                                             wpabuf_head(cert),
+                                             wpabuf_len(cert))) ||
+           !wpa_dbus_dict_close_write(&iter, &dict_iter))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
+       dbus_message_unref(msg);
+}
 
-       if (!wpa_dbus_dict_append_uint32(&dict_iter, "depth", depth) ||
-           !wpa_dbus_dict_append_string(&dict_iter, "subject", subject))
-               goto nomem;
 
-       if (cert_hash &&
-           !wpa_dbus_dict_append_string(&dict_iter, "cert_hash", cert_hash))
-               goto nomem;
+void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
+                                const char *status, const char *parameter)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+       DBusMessageIter iter;
 
-       if (cert &&
-           !wpa_dbus_dict_append_byte_array(&dict_iter, "cert",
-                                            wpabuf_head(cert),
-                                            wpabuf_len(cert)))
-               goto nomem;
+       iface = wpa_s->global->dbus;
 
-       if (!wpa_dbus_dict_close_write(&iter, &dict_iter))
-               goto nomem;
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL || !wpa_s->dbus_new_path)
+               return;
 
-       dbus_connection_send(iface->con, msg, NULL);
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_INTERFACE,
+                                     "EAP");
+       if (msg == NULL)
+               return;
 
-nomem:
+       dbus_message_iter_init_append(msg, &iter);
+
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &status) ||
+           !dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
+                                           &parameter))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
+       dbus_message_unref(msg);
+}
+
+
+/**
+ * wpas_dbus_signal_sta - Send a station related event signal
+ * @wpa_s: %wpa_supplicant network interface data
+ * @sta: station mac address
+ * @sig_name: signal name - StaAuthorized or StaDeauthorized
+ *
+ * Notify listeners about event related with station
+ */
+static void wpas_dbus_signal_sta(struct wpa_supplicant *wpa_s,
+                                const u8 *sta, const char *sig_name)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+       char sta_mac[WPAS_DBUS_OBJECT_PATH_MAX];
+       char *dev_mac;
+
+       os_snprintf(sta_mac, WPAS_DBUS_OBJECT_PATH_MAX, MACSTR, MAC2STR(sta));
+       dev_mac = sta_mac;
+
+       iface = wpa_s->global->dbus;
+
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL || !wpa_s->dbus_new_path)
+               return;
+
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_INTERFACE, sig_name);
+       if (msg == NULL)
+               return;
+
+       if (dbus_message_append_args(msg, DBUS_TYPE_STRING, &dev_mac,
+                                    DBUS_TYPE_INVALID))
+               dbus_connection_send(iface->con, msg, NULL);
+       else
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
        dbus_message_unref(msg);
+
+       wpa_printf(MSG_DEBUG, "dbus: Station MAC address '%s' '%s'",
+                  sta_mac, sig_name);
 }
 
+
+/**
+ * wpas_dbus_signal_sta_authorized - Send a STA authorized signal
+ * @wpa_s: %wpa_supplicant network interface data
+ * @sta: station mac address
+ *
+ * Notify listeners a new station has been authorized
+ */
+void wpas_dbus_signal_sta_authorized(struct wpa_supplicant *wpa_s,
+                                    const u8 *sta)
+{
+       wpas_dbus_signal_sta(wpa_s, sta, "StaAuthorized");
+}
+
+
+/**
+ * wpas_dbus_signal_sta_deauthorized - Send a STA deauthorized signal
+ * @wpa_s: %wpa_supplicant network interface data
+ * @sta: station mac address
+ *
+ * Notify listeners a station has been deauthorized
+ */
+void wpas_dbus_signal_sta_deauthorized(struct wpa_supplicant *wpa_s,
+                                      const u8 *sta)
+{
+       wpas_dbus_signal_sta(wpa_s, sta, "StaDeauthorized");
+}
+
+
 #ifdef CONFIG_P2P
 
 /**
@@ -697,37 +905,41 @@ nomem:
 void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
                                        const char *role)
 {
-
        DBusMessage *msg;
-       DBusMessageIter iter;
+       DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface = wpa_s->global->dbus;
-       char *ifname = wpa_s->ifname;
+       struct wpa_supplicant *parent;
 
        /* Do nothing if the control interface is not turned on */
        if (iface == NULL)
                return;
 
-       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+       parent = wpa_s->parent;
+       if (parent->p2p_mgmt)
+               parent = parent->parent;
+
+       if (!wpa_s->dbus_groupobj_path || !wpa_s->dbus_new_path ||
+           !parent->dbus_new_path)
+               return;
+
+       msg = dbus_message_new_signal(parent->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
                                      "GroupFinished");
        if (msg == NULL)
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-
-       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &ifname)) {
-               wpa_printf(MSG_ERROR, "dbus: Failed to construct GroupFinished"
-                                     "signal -not enough memory for ifname ");
-               goto err;
-       }
-
-       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &role))
-               wpa_printf(MSG_ERROR, "dbus: Failed to construct GroupFinished"
-                                     "signal -not enough memory for role ");
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter,
+                                             "interface_object",
+                                             wpa_s->dbus_new_path) ||
+           !wpa_dbus_dict_append_string(&dict_iter, "role", role) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter, "group_object",
+                                             wpa_s->dbus_groupobj_path) ||
+           !wpa_dbus_dict_close_write(&iter, &dict_iter))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
        else
                dbus_connection_send(iface->con, msg, NULL);
-
-err:
        dbus_message_unref(msg);
 }
 
@@ -773,6 +985,11 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
        if (request || !status) {
                if (config_methods & WPS_CONFIG_DISPLAY)
                        _signal = request ?
@@ -787,9 +1004,10 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
                                   "ProvisionDiscoveryPBCResponse";
                else
                        return; /* Unknown or un-supported method */
-       } else if (!request && status)
+       } else {
                /* Explicit check for failure response */
                _signal = "ProvisionDiscoveryFailure";
+       }
 
        add_pin = ((request && (config_methods & WPS_CONFIG_DISPLAY)) ||
                   (!request && !status &&
@@ -806,7 +1024,7 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
                return;
 
        /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, dev_addr, 0, NULL, 0) < 0)
+       if (!p2p_peer_known(wpa_s->global->p2p, dev_addr))
                goto error;
 
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -858,6 +1076,11 @@ void wpas_dbus_signal_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
                    wpa_s->dbus_new_path, MAC2STR(src));
@@ -889,10 +1112,11 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
 {
        char group_name[3];
 
-       if (os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
+       if (!wpa_s->dbus_new_path ||
+           os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
                return -1;
 
-       memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
+       os_memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
        group_name[2] = '\0';
 
        os_snprintf(group_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -903,9 +1127,72 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
 }
 
 
+struct group_changed_data {
+       struct wpa_supplicant *wpa_s;
+       struct p2p_peer_info *info;
+};
+
+
+static int match_group_where_peer_is_client(struct p2p_group *group,
+                                           void *user_data)
+{
+       struct group_changed_data *data = user_data;
+       const struct p2p_group_config *cfg;
+       struct wpa_supplicant *wpa_s_go;
+
+       if (!p2p_group_is_client_connected(group, data->info->p2p_device_addr))
+               return 1;
+
+       cfg = p2p_group_get_config(group);
+
+       wpa_s_go = wpas_get_p2p_go_iface(data->wpa_s, cfg->ssid,
+                                        cfg->ssid_len);
+       if (wpa_s_go != NULL && wpa_s_go == data->wpa_s) {
+               wpas_dbus_signal_peer_groups_changed(
+                       data->wpa_s->parent, data->info->p2p_device_addr);
+               return 0;
+       }
+
+       return 1;
+}
+
+
+static void signal_peer_groups_changed(struct p2p_peer_info *info,
+                                      void *user_data)
+{
+       struct group_changed_data *data = user_data;
+       struct wpa_supplicant *wpa_s_go;
+
+       wpa_s_go = wpas_get_p2p_client_iface(data->wpa_s,
+                                            info->p2p_device_addr);
+       if (wpa_s_go != NULL && wpa_s_go == data->wpa_s) {
+               wpas_dbus_signal_peer_groups_changed(data->wpa_s->parent,
+                                                    info->p2p_device_addr);
+               return;
+       }
+
+       data->info = info;
+       p2p_loop_on_all_groups(data->wpa_s->global->p2p,
+                              match_group_where_peer_is_client, data);
+       data->info = NULL;
+}
+
+
+static void peer_groups_changed(struct wpa_supplicant *wpa_s)
+{
+       struct group_changed_data data;
+
+       os_memset(&data, 0, sizeof(data));
+       data.wpa_s = wpa_s;
+
+       p2p_loop_on_known_peers(wpa_s->global->p2p,
+                               signal_peer_groups_changed, &data);
+}
+
+
 /**
  * wpas_dbus_signal_p2p_group_started - Signals P2P group has
- * started.Emitted when a group is succesfully started
+ * started. Emitted when a group is successfully started
  * irrespective of the role (client/GO) of the current device
  *
  * @wpa_s: %wpa_supplicant network interface data
@@ -921,97 +1208,162 @@ void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
        DBusMessage *msg;
        DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface;
-       char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
-       char group_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+       struct wpa_supplicant *parent;
+
+       parent = wpa_s->parent;
+       if (parent->p2p_mgmt)
+               parent = parent->parent;
 
-       iface = wpa_s->parent->global->dbus;
+       iface = parent->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !parent->dbus_new_path || !wpa_s->dbus_new_path)
                return;
 
-       if (wpas_dbus_get_group_obj_path(wpa_s, ssid, group_obj_path) < 0)
+       if (wpa_s->dbus_groupobj_path == NULL)
                return;
 
        /* New interface has been created for this group */
-       msg = dbus_message_new_signal(wpa_s->parent->dbus_new_path,
+       msg = dbus_message_new_signal(parent->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
                                      "GroupStarted");
-
        if (msg == NULL)
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
-               goto nomem;
-
        /*
         * In case the device supports creating a separate interface the
         * DBus client will need to know the object path for the interface
         * object this group was created on, so include it here.
         */
-       if (!wpa_dbus_dict_append_object_path(&dict_iter,
-                                       "interface_object",
-                                       wpa_s->dbus_new_path))
-               goto nomem;
-
-       if (!wpa_dbus_dict_append_string(&dict_iter, "role",
-                                        client ? "client" : "GO"))
-               goto nomem;
-
-       os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
-                   "%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%u",
-                   wpa_s->parent->dbus_new_path, network_id);
-
-       if (!wpa_dbus_dict_append_object_path(&dict_iter, "group_object",
-                                            group_obj_path) ||
-          !wpa_dbus_dict_append_object_path(&dict_iter, "network_object",
-                                            net_obj_path) ||
-          !wpa_dbus_dict_close_write(&iter, &dict_iter))
-               goto nomem;
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-nomem:
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter,
+                                             "interface_object",
+                                             wpa_s->dbus_new_path) ||
+           !wpa_dbus_dict_append_string(&dict_iter, "role",
+                                        client ? "client" : "GO") ||
+           !wpa_dbus_dict_append_object_path(&dict_iter, "group_object",
+                                             wpa_s->dbus_groupobj_path) ||
+           !wpa_dbus_dict_close_write(&iter, &dict_iter)) {
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       } else {
+               dbus_connection_send(iface->con, msg, NULL);
+               if (client)
+                       peer_groups_changed(wpa_s);
+       }
        dbus_message_unref(msg);
 }
 
 
 /**
  *
- * Method to emit GONeogtiation Success or Failure signals based
+ * Method to emit GONegotiation Success or Failure signals based
  * on status.
  * @status: Status of the GO neg request. 0 for success, other for errors.
  */
-void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s, int status)
+void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
+                                     struct p2p_go_neg_results *res)
 {
        DBusMessage *msg;
-       DBusMessageIter iter;
+       DBusMessageIter iter, dict_iter;
+       DBusMessageIter iter_dict_entry, iter_dict_val, iter_dict_array;
        struct wpas_dbus_priv *iface;
+       char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       dbus_int32_t freqs[P2P_MAX_CHANNELS];
+       dbus_int32_t *f_array = freqs;
+
 
        iface = wpa_s->global->dbus;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
+       os_memset(freqs, 0, sizeof(freqs));
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
+       os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
+                   wpa_s->dbus_new_path, MAC2STR(res->peer_device_addr));
+       path = peer_obj_path;
+
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-                                     status ? "GONegotiationFailure" :
-                                              "GONegotiationSuccess");
+                                     res->status ? "GONegotiationFailure" :
+                                                   "GONegotiationSuccess");
        if (msg == NULL)
                return;
 
-       if (status) {
-               dbus_message_iter_init_append(msg, &iter);
-               if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32,
-                                                   &status)) {
-                       wpa_printf(MSG_ERROR,
-                                  "dbus: Failed to construct signal");
+       dbus_message_iter_init_append(msg, &iter);
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
+                                             path) ||
+           !wpa_dbus_dict_append_int32(&dict_iter, "status", res->status))
+               goto err;
+
+       if (!res->status) {
+               int i = 0;
+               int freq_list_num = 0;
+
+               if ((res->role_go &&
+                    !wpa_dbus_dict_append_string(&dict_iter, "passphrase",
+                                                 res->passphrase)) ||
+                   !wpa_dbus_dict_append_string(&dict_iter, "role_go",
+                                                res->role_go ? "GO" :
+                                                "client") ||
+                   !wpa_dbus_dict_append_int32(&dict_iter, "frequency",
+                                               res->freq) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter, "ssid",
+                                                    (const char *) res->ssid,
+                                                    res->ssid_len) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter,
+                                                    "peer_device_addr",
+                                                    (const char *)
+                                                    res->peer_device_addr,
+                                                    ETH_ALEN) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter,
+                                                    "peer_interface_addr",
+                                                    (const char *)
+                                                    res->peer_interface_addr,
+                                                    ETH_ALEN) ||
+                   !wpa_dbus_dict_append_string(&dict_iter, "wps_method",
+                                                p2p_wps_method_text(
+                                                        res->wps_method)))
                        goto err;
+
+               for (i = 0; i < P2P_MAX_CHANNELS; i++) {
+                       if (res->freq_list[i]) {
+                               freqs[i] = res->freq_list[i];
+                               freq_list_num++;
+                       }
                }
+
+               if (!wpa_dbus_dict_begin_array(&dict_iter,
+                                              "frequency_list",
+                                              DBUS_TYPE_INT32_AS_STRING,
+                                              &iter_dict_entry,
+                                              &iter_dict_val,
+                                              &iter_dict_array) ||
+                   !dbus_message_iter_append_fixed_array(&iter_dict_array,
+                                                         DBUS_TYPE_INT32,
+                                                         &f_array,
+                                                         freq_list_num) ||
+                   !wpa_dbus_dict_end_array(&dict_iter,
+                                            &iter_dict_entry,
+                                            &iter_dict_val,
+                                            &iter_dict_array) ||
+                   !wpa_dbus_dict_append_int32(&dict_iter, "persistent_group",
+                                               res->persistent_group) ||
+                   !wpa_dbus_dict_append_uint32(&dict_iter,
+                                                "peer_config_timeout",
+                                                res->peer_config_timeout))
+                       goto err;
        }
 
+       if (!wpa_dbus_dict_close_write(&iter, &dict_iter))
+               goto err;
+
        dbus_connection_send(iface->con, msg, NULL);
 err:
        dbus_message_unref(msg);
@@ -1033,13 +1385,18 @@ void wpas_dbus_signal_p2p_invitation_result(struct wpa_supplicant *wpa_s,
        DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface;
 
-       wpa_printf(MSG_INFO, "%s\n", __func__);
+       wpa_printf(MSG_DEBUG, "%s", __func__);
 
        iface = wpa_s->global->dbus;
        /* Do nothing if the control interface is not turned on */
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
                                      "InvitationResult");
@@ -1048,23 +1405,16 @@ void wpas_dbus_signal_p2p_invitation_result(struct wpa_supplicant *wpa_s,
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
-               goto nomem;
-
-       if (!wpa_dbus_dict_append_int32(&dict_iter, "status", status))
-               goto nomem;
-       if (bssid) {
-               if (!wpa_dbus_dict_append_byte_array(&dict_iter, "BSSID",
-                                                    (const char *) bssid,
-                                                    ETH_ALEN))
-                       goto nomem;
-       }
-       if (!wpa_dbus_dict_close_write(&iter, &dict_iter))
-               goto nomem;
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-nomem:
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_int32(&dict_iter, "status", status) ||
+           (bssid &&
+            !wpa_dbus_dict_append_byte_array(&dict_iter, "BSSID",
+                                             (const char *) bssid,
+                                             ETH_ALEN)) ||
+           !wpa_dbus_dict_close_write(&iter, &dict_iter))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
@@ -1076,15 +1426,16 @@ nomem:
  * constructed using p2p i/f addr used for connecting.
  *
  * @wpa_s: %wpa_supplicant network interface data
- * @member_addr: addr (p2p i/f) of the peer joining the group
+ * @peer_addr: P2P Device Address of the peer joining the group
  */
 void wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
-                                     const u8 *member)
+                                     const u8 *peer_addr)
 {
        struct wpas_dbus_priv *iface;
        DBusMessage *msg;
        DBusMessageIter iter;
-       char groupmember_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       struct wpa_supplicant *parent;
 
        iface = wpa_s->global->dbus;
 
@@ -1095,10 +1446,16 @@ void wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
        if (!wpa_s->dbus_groupobj_path)
                return;
 
-       os_snprintf(groupmember_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
-                       "%s/"  WPAS_DBUS_NEW_P2P_GROUPMEMBERS_PART "/"
+       parent = wpa_s->parent;
+       if (parent->p2p_mgmt)
+               parent = parent->parent;
+       if (!parent->dbus_new_path)
+               return;
+
+       os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                       "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
                        COMPACT_MACSTR,
-                       wpa_s->dbus_groupobj_path, MAC2STR(member));
+                       parent->dbus_new_path, MAC2STR(peer_addr));
 
        msg = dbus_message_new_signal(wpa_s->dbus_groupobj_path,
                                      WPAS_DBUS_NEW_IFACE_P2P_GROUP,
@@ -1107,18 +1464,14 @@ void wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-       path = groupmember_obj_path;
+       path = peer_obj_path;
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &path))
-               goto err;
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-       dbus_message_unref(msg);
-       return;
-
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+                                           &path)) {
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       } else {
+               dbus_connection_send(iface->con, msg, NULL);
+               wpas_dbus_signal_peer_groups_changed(parent, peer_addr);
+       }
        dbus_message_unref(msg);
 }
 
@@ -1127,18 +1480,19 @@ err:
  *
  * Method to emit a signal for a peer disconnecting the group.
  * The signal will carry path to the group member object
- * constructed using p2p i/f addr used for connecting.
+ * constructed using the P2P Device Address of the peer.
  *
  * @wpa_s: %wpa_supplicant network interface data
- * @member_addr: addr (p2p i/f) of the peer joining the group
+ * @peer_addr: P2P Device Address of the peer joining the group
  */
 void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
-                                     const u8 *member)
+                                           const u8 *peer_addr)
 {
        struct wpas_dbus_priv *iface;
        DBusMessage *msg;
        DBusMessageIter iter;
-       char groupmember_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       struct wpa_supplicant *parent;
 
        iface = wpa_s->global->dbus;
 
@@ -1149,10 +1503,16 @@ void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
        if (!wpa_s->dbus_groupobj_path)
                return;
 
-       os_snprintf(groupmember_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
-                       "%s/"  WPAS_DBUS_NEW_P2P_GROUPMEMBERS_PART "/"
+       parent = wpa_s->parent;
+       if (parent->p2p_mgmt)
+               parent = parent->parent;
+       if (!parent->dbus_new_path)
+               return;
+
+       os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                       "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
                        COMPACT_MACSTR,
-                       wpa_s->dbus_groupobj_path, MAC2STR(member));
+                       parent->dbus_new_path, MAC2STR(peer_addr));
 
        msg = dbus_message_new_signal(wpa_s->dbus_groupobj_path,
                                      WPAS_DBUS_NEW_IFACE_P2P_GROUP,
@@ -1161,19 +1521,15 @@ void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
                return;
 
        dbus_message_iter_init_append(msg, &iter);
-       path = groupmember_obj_path;
+       path = peer_obj_path;
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &path))
-               goto err;
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-       dbus_message_unref(msg);
-       return;
-
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct PeerDisconnected "
-                             "signal");
+                                           &path)) {
+               wpa_printf(MSG_ERROR,
+                          "dbus: Failed to construct PeerDisconnected signal");
+       } else {
+               dbus_connection_send(iface->con, msg, NULL);
+               wpas_dbus_signal_peer_groups_changed(parent, peer_addr);
+       }
        dbus_message_unref(msg);
 }
 
@@ -1200,22 +1556,28 @@ void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
        DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface;
        char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
+       /* Check if this is a known peer */
+       if (!p2p_peer_known(wpa_s->global->p2p, sa))
+               return;
+
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
                                      "ServiceDiscoveryRequest");
        if (msg == NULL)
                return;
 
-       /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, sa, 0, NULL, 0) < 0)
-               goto error;
-
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
                    COMPACT_MACSTR, wpa_s->dbus_new_path, MAC2STR(sa));
@@ -1223,11 +1585,8 @@ void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
        path = peer_obj_path;
 
        dbus_message_iter_init_append(msg, &iter);
-       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
-               goto error;
-
-
-       if (!wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
                                              path) ||
            !wpa_dbus_dict_append_int32(&dict_iter, "frequency", freq) ||
            !wpa_dbus_dict_append_int32(&dict_iter, "dialog_token",
@@ -1238,13 +1597,9 @@ void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
                                             (const char *) tlvs,
                                             tlvs_len) ||
            !wpa_dbus_dict_close_write(&iter, &dict_iter))
-               goto error;
-
-       dbus_connection_send(iface->con, msg, NULL);
-       dbus_message_unref(msg);
-       return;
-error:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
@@ -1269,22 +1624,28 @@ void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
        DBusMessageIter iter, dict_iter;
        struct wpas_dbus_priv *iface;
        char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
+       /* Check if this is a known peer */
+       if (!p2p_peer_known(wpa_s->global->p2p, sa))
+               return;
+
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-                               "ServiceDiscoveryResponse");
+                                     "ServiceDiscoveryResponse");
        if (msg == NULL)
                return;
 
-       /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, sa, 0, NULL, 0) < 0)
-               goto error;
-
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/"
                    COMPACT_MACSTR, wpa_s->dbus_new_path, MAC2STR(sa));
@@ -1292,10 +1653,8 @@ void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
        path = peer_obj_path;
 
        dbus_message_iter_init_append(msg, &iter);
-       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
-               goto error;
-
-       if (!wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+           !wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
                                              path) ||
            !wpa_dbus_dict_append_uint16(&dict_iter, "update_indicator",
                                         update_indic) ||
@@ -1303,17 +1662,13 @@ void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
                                             (const char *) tlvs,
                                             tlvs_len) ||
            !wpa_dbus_dict_close_write(&iter, &dict_iter))
-               goto error;
-
-
-       dbus_connection_send(iface->con, msg, NULL);
-       dbus_message_unref(msg);
-       return;
-error:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
        dbus_message_unref(msg);
 }
 
+
 /**
  * wpas_dbus_signal_persistent_group - Send a persistent group related
  *     event signal
@@ -1339,6 +1694,11 @@ static void wpas_dbus_signal_persistent_group(struct wpa_supplicant *wpa_s,
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+       if (!wpa_s->dbus_new_path)
+               return;
+
        os_snprintf(pgrp_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_PERSISTENT_GROUPS_PART "/%u",
                    wpa_s->dbus_new_path, id);
@@ -1352,23 +1712,15 @@ static void wpas_dbus_signal_persistent_group(struct wpa_supplicant *wpa_s,
        dbus_message_iter_init_append(msg, &iter);
        path = pgrp_obj_path;
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
-                                           &path))
-               goto err;
-
-       if (properties) {
-               if (!wpa_dbus_get_object_properties(
-                           iface, pgrp_obj_path,
-                           WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP, &iter))
-                       goto err;
-       }
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-       dbus_message_unref(msg);
-       return;
+                                           &path) ||
+           (properties &&
+            !wpa_dbus_get_object_properties(
+                    iface, pgrp_obj_path,
+                    WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP, &iter)))
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
 
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
        dbus_message_unref(msg);
 }
 
@@ -1427,6 +1779,11 @@ void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
        if (iface == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
+       if (!wpa_s->dbus_new_path)
+               return;
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
                                      "WpsFailed");
@@ -1448,7 +1805,7 @@ void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
        dbus_message_unref(msg);
 }
 
-#endif /*CONFIG_P2P*/
+#endif /* CONFIG_P2P */
 
 
 /**
@@ -1462,41 +1819,39 @@ void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
 void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
                                   enum wpas_dbus_prop property)
 {
-       WPADBusPropertyAccessor getter;
        char *prop;
+       dbus_bool_t flush;
 
        if (wpa_s->dbus_new_path == NULL)
                return; /* Skip signal since D-Bus setup is not yet ready */
 
+       flush = FALSE;
        switch (property) {
        case WPAS_DBUS_PROP_AP_SCAN:
-               getter = wpas_dbus_getter_ap_scan;
                prop = "ApScan";
                break;
        case WPAS_DBUS_PROP_SCANNING:
-               getter = wpas_dbus_getter_scanning;
                prop = "Scanning";
                break;
        case WPAS_DBUS_PROP_STATE:
-               getter = wpas_dbus_getter_state;
                prop = "State";
                break;
        case WPAS_DBUS_PROP_CURRENT_BSS:
-               getter = wpas_dbus_getter_current_bss;
                prop = "CurrentBSS";
                break;
        case WPAS_DBUS_PROP_CURRENT_NETWORK:
-               getter = wpas_dbus_getter_current_network;
                prop = "CurrentNetwork";
                break;
        case WPAS_DBUS_PROP_BSSS:
-               getter = wpas_dbus_getter_bsss;
                prop = "BSSs";
                break;
        case WPAS_DBUS_PROP_CURRENT_AUTH_MODE:
-               getter = wpas_dbus_getter_current_auth_mode;
                prop = "CurrentAuthMode";
                break;
+       case WPAS_DBUS_PROP_DISCONNECT_REASON:
+               prop = "DisconnectReason";
+               flush = TRUE;
+               break;
        default:
                wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
                           __func__, property);
@@ -1506,6 +1861,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
        wpa_dbus_mark_property_changed(wpa_s->global->dbus,
                                       wpa_s->dbus_new_path,
                                       WPAS_DBUS_NEW_IFACE_INTERFACE, prop);
+       if (flush) {
+               wpa_dbus_flush_object_changed_properties(
+                       wpa_s->global->dbus->con, wpa_s->dbus_new_path);
+       }
 }
 
 
@@ -1525,6 +1884,9 @@ void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
        char path[WPAS_DBUS_OBJECT_PATH_MAX];
        char *prop;
 
+       if (!wpa_s->dbus_new_path)
+               return;
+
        switch (property) {
        case WPAS_DBUS_BSS_PROP_SIGNAL:
                prop = "Signal";
@@ -1547,9 +1909,15 @@ void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
        case WPAS_DBUS_BSS_PROP_RSN:
                prop = "RSN";
                break;
+       case WPAS_DBUS_BSS_PROP_WPS:
+               prop = "WPS";
+               break;
        case WPAS_DBUS_BSS_PROP_IES:
                prop = "IEs";
                break;
+       case WPAS_DBUS_BSS_PROP_AGE:
+               prop = "Age";
+               break;
        default:
                wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
                           __func__, property);
@@ -1634,7 +2002,7 @@ static void wpas_dbus_register(struct wpa_dbus_object_desc *obj_desc,
 
 static const struct wpa_dbus_method_desc wpas_dbus_global_methods[] = {
        { "CreateInterface", WPAS_DBUS_NEW_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_create_interface,
+         (WPADBusMethodHandler) wpas_dbus_handler_create_interface,
          {
                  { "args", "a{sv}", ARG_IN },
                  { "path", "o", ARG_OUT },
@@ -1642,14 +2010,14 @@ static const struct wpa_dbus_method_desc wpas_dbus_global_methods[] = {
          }
        },
        { "RemoveInterface", WPAS_DBUS_NEW_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_remove_interface,
+         (WPADBusMethodHandler) wpas_dbus_handler_remove_interface,
          {
                  { "path", "o", ARG_IN },
                  END_ARGS
          }
        },
        { "GetInterface", WPAS_DBUS_NEW_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_get_interface,
+         (WPADBusMethodHandler) wpas_dbus_handler_get_interface,
          {
                  { "ifname", "s", ARG_IN },
                  { "path", "o", ARG_OUT },
@@ -1662,30 +2030,35 @@ static const struct wpa_dbus_method_desc wpas_dbus_global_methods[] = {
 static const struct wpa_dbus_property_desc wpas_dbus_global_properties[] = {
        { "DebugLevel", WPAS_DBUS_NEW_INTERFACE, "s",
          wpas_dbus_getter_debug_level,
-         wpas_dbus_setter_debug_level,
-         RW
+         wpas_dbus_setter_debug_level
        },
        { "DebugTimestamp", WPAS_DBUS_NEW_INTERFACE, "b",
          wpas_dbus_getter_debug_timestamp,
-         wpas_dbus_setter_debug_timestamp,
-         RW
+         wpas_dbus_setter_debug_timestamp
        },
        { "DebugShowKeys", WPAS_DBUS_NEW_INTERFACE, "b",
          wpas_dbus_getter_debug_show_keys,
-         wpas_dbus_setter_debug_show_keys,
-         RW
+         wpas_dbus_setter_debug_show_keys
        },
        { "Interfaces", WPAS_DBUS_NEW_INTERFACE, "ao",
          wpas_dbus_getter_interfaces,
-         NULL,
-         R
+         NULL
        },
        { "EapMethods", WPAS_DBUS_NEW_INTERFACE, "as",
          wpas_dbus_getter_eap_methods,
-         NULL,
-         R
+         NULL
+       },
+       { "Capabilities", WPAS_DBUS_NEW_INTERFACE, "as",
+         wpas_dbus_getter_global_capabilities,
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+#ifdef CONFIG_WIFI_DISPLAY
+       { "WFDIEs", WPAS_DBUS_NEW_INTERFACE, "ay",
+         wpas_dbus_getter_global_wfd_ies,
+         wpas_dbus_setter_global_wfd_ies
+       },
+#endif /* CONFIG_WIFI_DISPLAY */
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_global_signals[] = {
@@ -1702,6 +2075,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_global_signals[] = {
                  END_ARGS
          }
        },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_INTERFACE,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -1727,8 +2101,8 @@ int wpas_dbus_ctrl_iface_init(struct wpas_dbus_priv *priv)
 
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                return -1;
        }
 
@@ -1779,19 +2153,18 @@ static void wpa_dbus_free(void *ptr)
 static const struct wpa_dbus_property_desc wpas_dbus_network_properties[] = {
        { "Properties", WPAS_DBUS_NEW_IFACE_NETWORK, "a{sv}",
          wpas_dbus_getter_network_properties,
-         wpas_dbus_setter_network_properties,
-         RW
+         wpas_dbus_setter_network_properties
        },
        { "Enabled", WPAS_DBUS_NEW_IFACE_NETWORK, "b",
          wpas_dbus_getter_enabled,
-         wpas_dbus_setter_enabled,
-         RW
+         wpas_dbus_setter_enabled
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 
 static const struct wpa_dbus_signal_desc wpas_dbus_network_signals[] = {
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_NETWORK,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -1829,7 +2202,7 @@ int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_P2P */
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL)
+       if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
@@ -1843,16 +2216,16 @@ int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
                   net_obj_path);
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                goto err;
        }
 
        /* allocate memory for handlers arguments */
        arg = os_zalloc(sizeof(struct network_handler_args));
        if (!arg) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create arguments for method");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create arguments for method");
                goto err;
        }
 
@@ -1890,19 +2263,18 @@ int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
        struct wpas_dbus_priv *ctrl_iface;
        char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
        int ret;
+#ifdef CONFIG_P2P
        struct wpa_ssid *ssid;
 
        ssid = wpa_config_get_network(wpa_s->conf, nid);
 
-#ifdef CONFIG_P2P
        /* If it is a persistent group unregister it as such */
        if (ssid && network_is_persistent_group(ssid))
                return wpas_dbus_unregister_persistent_group(wpa_s, nid);
 #endif /* CONFIG_P2P */
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL ||
-           wpa_s->dbus_new_path == NULL)
+       if (wpa_s->global == NULL || wpa_s->dbus_new_path == NULL)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
@@ -1926,59 +2298,58 @@ int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
 static const struct wpa_dbus_property_desc wpas_dbus_bss_properties[] = {
        { "SSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_ssid,
-         NULL,
-         R
+         NULL
        },
        { "BSSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_bssid,
-         NULL,
-         R
+         NULL
        },
        { "Privacy", WPAS_DBUS_NEW_IFACE_BSS, "b",
          wpas_dbus_getter_bss_privacy,
-         NULL,
-         R
+         NULL
        },
        { "Mode", WPAS_DBUS_NEW_IFACE_BSS, "s",
          wpas_dbus_getter_bss_mode,
-         NULL,
-         R
+         NULL
        },
        { "Signal", WPAS_DBUS_NEW_IFACE_BSS, "n",
          wpas_dbus_getter_bss_signal,
-         NULL,
-         R
+         NULL
        },
        { "Frequency", WPAS_DBUS_NEW_IFACE_BSS, "q",
          wpas_dbus_getter_bss_frequency,
-         NULL,
-         R
+         NULL
        },
        { "Rates", WPAS_DBUS_NEW_IFACE_BSS, "au",
          wpas_dbus_getter_bss_rates,
-         NULL,
-         R
+         NULL
        },
        { "WPA", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
          wpas_dbus_getter_bss_wpa,
-         NULL,
-         R
+         NULL
        },
        { "RSN", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
          wpas_dbus_getter_bss_rsn,
-         NULL,
-         R
+         NULL
+       },
+       { "WPS", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
+         wpas_dbus_getter_bss_wps,
+         NULL
        },
        { "IEs", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_ies,
-         NULL,
-         R
+         NULL
+       },
+       { "Age", WPAS_DBUS_NEW_IFACE_BSS, "u",
+         wpas_dbus_getter_bss_age,
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 
 static const struct wpa_dbus_signal_desc wpas_dbus_bss_signals[] = {
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_BSS,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2005,7 +2376,7 @@ int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
        char bss_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL)
+       if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
@@ -2048,7 +2419,7 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
        struct bss_handler_args *arg;
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL)
+       if (wpa_s == NULL || wpa_s->global == NULL || !wpa_s->dbus_new_path)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
@@ -2060,15 +2431,15 @@ int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
 
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                goto err;
        }
 
        arg = os_zalloc(sizeof(struct bss_handler_args));
        if (!arg) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create arguments for handler");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create arguments for handler");
                goto err;
        }
        arg->wpa_s = wpa_s;
@@ -2101,48 +2472,77 @@ err:
 
 static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
        { "Scan", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_scan,
+         (WPADBusMethodHandler) wpas_dbus_handler_scan,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
+       { "SignalPoll", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_signal_poll,
+         {
+                 { "args", "a{sv}", ARG_OUT },
+                 END_ARGS
+         }
+       },
        { "Disconnect", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_disconnect,
+         (WPADBusMethodHandler) wpas_dbus_handler_disconnect,
          {
                  END_ARGS
          }
        },
        { "AddNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_add_network,
+         (WPADBusMethodHandler) wpas_dbus_handler_add_network,
          {
                  { "args", "a{sv}", ARG_IN },
                  { "path", "o", ARG_OUT },
                  END_ARGS
          }
        },
+       { "Reassociate", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_reassociate,
+         {
+                 END_ARGS
+         }
+       },
+       { "Reattach", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_reattach,
+         {
+                 END_ARGS
+         }
+       },
        { "RemoveNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_remove_network,
+         (WPADBusMethodHandler) wpas_dbus_handler_remove_network,
          {
                  { "path", "o", ARG_IN },
                  END_ARGS
          }
        },
        { "RemoveAllNetworks", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_remove_all_networks,
+         (WPADBusMethodHandler) wpas_dbus_handler_remove_all_networks,
          {
                  END_ARGS
          }
        },
        { "SelectNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_select_network,
+         (WPADBusMethodHandler) wpas_dbus_handler_select_network,
+         {
+                 { "path", "o", ARG_IN },
+                 END_ARGS
+         }
+       },
+       { "NetworkReply", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_network_reply,
          {
                  { "path", "o", ARG_IN },
+                 { "field", "s", ARG_IN },
+                 { "value", "s", ARG_IN },
                  END_ARGS
          }
        },
+#ifndef CONFIG_NO_CONFIG_BLOBS
        { "AddBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_add_blob,
+         (WPADBusMethodHandler) wpas_dbus_handler_add_blob,
          {
                  { "name", "s", ARG_IN },
                  { "data", "ay", ARG_IN },
@@ -2150,67 +2550,83 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
          }
        },
        { "GetBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_get_blob,
+         (WPADBusMethodHandler) wpas_dbus_handler_get_blob,
+         {
+                 { "name", "s", ARG_IN },
+                 { "data", "ay", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       { "RemoveBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_remove_blob,
          {
                  { "name", "s", ARG_IN },
-                 { "data", "ay", ARG_OUT },
                  END_ARGS
          }
        },
-       { "RemoveBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_remove_blob,
+#endif /* CONFIG_NO_CONFIG_BLOBS */
+       { "SetPKCS11EngineAndModulePath", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler)
+         wpas_dbus_handler_set_pkcs11_engine_and_module_path,
          {
-                 { "name", "s", ARG_IN },
+                 { "pkcs11_engine_path", "s", ARG_IN },
+                 { "pkcs11_module_path", "s", ARG_IN },
                  END_ARGS
          }
        },
 #ifdef CONFIG_WPS
        { "Start", WPAS_DBUS_NEW_IFACE_WPS,
-         (WPADBusMethodHandler) &wpas_dbus_handler_wps_start,
+         (WPADBusMethodHandler) wpas_dbus_handler_wps_start,
          {
                  { "args", "a{sv}", ARG_IN },
                  { "output", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
+       { "Cancel", WPAS_DBUS_NEW_IFACE_WPS,
+         (WPADBusMethodHandler) wpas_dbus_handler_wps_cancel,
+         {
+                 END_ARGS
+         }
+       },
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P
        { "Find", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_find,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_find,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "StopFind", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_stop_find,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_stop_find,
          {
                  END_ARGS
          }
        },
        { "Listen", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_listen,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_listen,
          {
                  { "timeout", "i", ARG_IN },
                  END_ARGS
          }
        },
        { "ExtendedListen", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_extendedlisten,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_extendedlisten,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "PresenceRequest", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_presence_request,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_presence_request,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "ProvisionDiscoveryRequest", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_prov_disc_req,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_prov_disc_req,
          {
                  { "peer", "o", ARG_IN },
                  { "config_method", "s", ARG_IN },
@@ -2218,102 +2634,96 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
          }
        },
        { "Connect", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_connect,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_connect,
          {
                  { "args", "a{sv}", ARG_IN },
-                 { "generated_pin", "i", ARG_OUT },
+                 { "generated_pin", "s", ARG_OUT },
                  END_ARGS
          }
        },
        { "GroupAdd", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_group_add,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_group_add,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "Invite", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_invite,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_invite,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "Disconnect", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_disconnect,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_disconnect,
          {
                  END_ARGS
          }
        },
        { "RejectPeer", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_rejectpeer,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_rejectpeer,
          {
                  { "peer", "o", ARG_IN },
                  END_ARGS
          }
        },
        { "Flush", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_flush,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_flush,
          {
                  END_ARGS
          }
        },
        { "AddService", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_add_service,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_add_service,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "DeleteService", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_delete_service,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_delete_service,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "FlushService", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_flush_service,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_flush_service,
          {
                  END_ARGS
          }
        },
        { "ServiceDiscoveryRequest", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_service_sd_req,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_service_sd_req,
          {
                  { "args", "a{sv}", ARG_IN },
+                 { "ref", "t", ARG_OUT },
                  END_ARGS
          }
        },
        { "ServiceDiscoveryResponse", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_service_sd_res,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_service_sd_res,
          {
                  { "args", "a{sv}", ARG_IN },
                  END_ARGS
          }
        },
        { "ServiceDiscoveryCancelRequest", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_service_sd_cancel_req,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_service_sd_cancel_req,
          {
                  { "args", "t", ARG_IN },
                  END_ARGS
          }
        },
        { "ServiceUpdate", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_service_update,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_service_update,
          {
                  END_ARGS
          }
        },
        { "ServiceDiscoveryExternal", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_serv_disc_external,
-         {
-                 { "arg", "i", ARG_IN },
-                 END_ARGS
-         }
-       },
-       { "ServiceDiscoveryExternal", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-         (WPADBusMethodHandler)wpas_dbus_handler_p2p_serv_disc_external,
+         (WPADBusMethodHandler) wpas_dbus_handler_p2p_serv_disc_external,
          {
                  { "arg", "i", ARG_IN },
                  END_ARGS
@@ -2343,119 +2753,203 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
        },
 #endif /* CONFIG_P2P */
        { "FlushBSS", WPAS_DBUS_NEW_IFACE_INTERFACE,
-         (WPADBusMethodHandler) &wpas_dbus_handler_flush_bss,
+         (WPADBusMethodHandler) wpas_dbus_handler_flush_bss,
          {
                  { "age", "u", ARG_IN },
                  END_ARGS
          }
        },
+#ifdef CONFIG_AP
+       { "SubscribeProbeReq", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_subscribe_preq,
+         {
+                 END_ARGS
+         }
+       },
+       { "UnsubscribeProbeReq", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_unsubscribe_preq,
+         {
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AP */
+       { "EAPLogoff", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_eap_logoff,
+         {
+                 END_ARGS
+         }
+       },
+       { "EAPLogon", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_eap_logon,
+         {
+                 END_ARGS
+         }
+       },
+#ifdef CONFIG_AUTOSCAN
+       { "AutoScan", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_autoscan,
+         {
+                 { "arg", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AUTOSCAN */
+#ifdef CONFIG_TDLS
+       { "TDLSDiscover", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_tdls_discover,
+         {
+                 { "peer_address", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
+       { "TDLSSetup", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_tdls_setup,
+         {
+                 { "peer_address", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
+       { "TDLSStatus", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_tdls_status,
+         {
+                 { "peer_address", "s", ARG_IN },
+                 { "status", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       { "TDLSTeardown", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_tdls_teardown,
+         {
+                 { "peer_address", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_TDLS */
        { NULL, NULL, NULL, { END_ARGS } }
 };
 
 static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
        { "Capabilities", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{sv}",
          wpas_dbus_getter_capabilities,
-         NULL, R
+         NULL
        },
        { "State", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_state,
-         NULL, R
+         NULL
        },
        { "Scanning", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
          wpas_dbus_getter_scanning,
-         NULL, R
+         NULL
        },
        { "ApScan", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_ap_scan,
-         wpas_dbus_setter_ap_scan,
-         RW
+         wpas_dbus_setter_ap_scan
        },
        { "BSSExpireAge", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_bss_expire_age,
-         wpas_dbus_setter_bss_expire_age,
-         RW
+         wpas_dbus_setter_bss_expire_age
        },
        { "BSSExpireCount", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_bss_expire_count,
-         wpas_dbus_setter_bss_expire_count,
-         RW
+         wpas_dbus_setter_bss_expire_count
        },
        { "Country", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_country,
-         wpas_dbus_setter_country,
-         RW
+         wpas_dbus_setter_country
        },
        { "Ifname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_ifname,
-         NULL, R
+         NULL
        },
        { "Driver", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_driver,
-         NULL, R
+         NULL
        },
        { "BridgeIfname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_bridge_ifname,
-         NULL, R
+         NULL
        },
        { "CurrentBSS", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
          wpas_dbus_getter_current_bss,
-         NULL, R
+         NULL
        },
        { "CurrentNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
          wpas_dbus_getter_current_network,
-         NULL, R
+         NULL
        },
        { "CurrentAuthMode", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_current_auth_mode,
-         NULL, R
+         NULL
        },
        { "Blobs", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{say}",
          wpas_dbus_getter_blobs,
-         NULL, R
+         NULL
        },
        { "BSSs", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
          wpas_dbus_getter_bsss,
-         NULL, R
+         NULL
        },
        { "Networks", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
          wpas_dbus_getter_networks,
-         NULL, R
+         NULL
+       },
+       { "FastReauth", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
+         wpas_dbus_getter_fast_reauth,
+         wpas_dbus_setter_fast_reauth
+       },
+       { "ScanInterval", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
+         wpas_dbus_getter_scan_interval,
+         wpas_dbus_setter_scan_interval
+       },
+       { "PKCS11EnginePath", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
+         wpas_dbus_getter_pkcs11_engine_path,
+         NULL
+       },
+       { "PKCS11ModulePath", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
+         wpas_dbus_getter_pkcs11_module_path,
+         NULL
        },
 #ifdef CONFIG_WPS
        { "ProcessCredentials", WPAS_DBUS_NEW_IFACE_WPS, "b",
          wpas_dbus_getter_process_credentials,
-         wpas_dbus_setter_process_credentials,
-         RW
+         wpas_dbus_setter_process_credentials
+       },
+       { "ConfigMethods", WPAS_DBUS_NEW_IFACE_WPS, "s",
+         wpas_dbus_getter_config_methods,
+         wpas_dbus_setter_config_methods
        },
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P
-       { "P2PDeviceProperties", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "a{sv}",
-         wpas_dbus_getter_p2p_device_properties,
-         wpas_dbus_setter_p2p_device_properties,
-         RW
+       { "P2PDeviceConfig", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "a{sv}",
+         wpas_dbus_getter_p2p_device_config,
+         wpas_dbus_setter_p2p_device_config
        },
        { "Peers", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "ao",
          wpas_dbus_getter_p2p_peers,
-         NULL, R
+         NULL
        },
        { "Role", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "s",
          wpas_dbus_getter_p2p_role,
-         NULL, R
+         NULL
        },
        { "Group", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "o",
          wpas_dbus_getter_p2p_group,
-         NULL, R
+         NULL
        },
        { "PeerGO", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "o",
          wpas_dbus_getter_p2p_peergo,
-         NULL, R
+         NULL
        },
        { "PersistentGroups", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "ao",
          wpas_dbus_getter_persistent_groups,
-         NULL, R
+         NULL
        },
 #endif /* CONFIG_P2P */
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { "DisconnectReason", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
+         wpas_dbus_getter_disconnect_reason,
+         NULL
+       },
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
@@ -2509,6 +3003,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
                  END_ARGS
          }
        },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_INTERFACE,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2529,6 +3024,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
                  END_ARGS
          }
        },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_WPS,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2537,22 +3033,20 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
        },
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P
-       { "P2PStateChanged", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+       { "DeviceFound", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
-                 { "states", "a{ss}", ARG_OUT },
+                 { "path", "o", ARG_OUT },
                  END_ARGS
          }
        },
-       { "DeviceFound", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+       { "DeviceLost", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
                  { "path", "o", ARG_OUT },
-                 { "properties", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
-       { "DeviceLost", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+       { "FindStopped", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
-                 { "path", "o", ARG_OUT },
                  END_ARGS
          }
        },
@@ -2609,12 +3103,13 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
        },
        { "GONegotiationSuccess", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
+                 { "properties", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
        { "GONegotiationFailure", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
-                 { "status", "i", ARG_OUT },
+                 { "properties", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
@@ -2633,8 +3128,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
        },
        { "GroupFinished", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
          {
-                 { "ifname", "s", ARG_OUT },
-                 { "role", "s", ARG_OUT },
+                 { "properties", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
@@ -2671,12 +3165,47 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
          }
        },
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_AP
+       { "ProbeRequest", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "args", "a{sv}", ARG_OUT },
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AP */
        { "Certification", WPAS_DBUS_NEW_IFACE_INTERFACE,
          {
                  { "certification", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
+       { "EAP", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "status", "s", ARG_OUT },
+                 { "parameter", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       { "StaAuthorized", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "name", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       { "StaDeauthorized", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "name", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       { "NetworkRequest", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "path", "o", ARG_OUT },
+                 { "field", "s", ARG_OUT },
+                 { "text", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
        { NULL, NULL, { END_ARGS } }
 };
 
@@ -2703,8 +3232,8 @@ int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
 
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                goto err;
        }
 
@@ -2739,11 +3268,20 @@ int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
        if (wpa_s == NULL || wpa_s->global == NULL)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
-       if (ctrl_iface == NULL)
+       if (ctrl_iface == NULL || wpa_s->dbus_new_path == NULL)
                return 0;
 
        wpa_printf(MSG_DEBUG, "dbus: Unregister interface object '%s'",
                   wpa_s->dbus_new_path);
+
+#ifdef CONFIG_AP
+       if (wpa_s->preq_notify_peer) {
+               wpas_dbus_unsubscribe_noc(ctrl_iface);
+               os_free(wpa_s->preq_notify_peer);
+               wpa_s->preq_notify_peer = NULL;
+       }
+#endif /* CONFIG_AP */
+
        if (wpa_dbus_unregister_object_per_iface(ctrl_iface,
                                                 wpa_s->dbus_new_path))
                return -1;
@@ -2759,19 +3297,61 @@ int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
 #ifdef CONFIG_P2P
 
 static const struct wpa_dbus_property_desc wpas_dbus_p2p_peer_properties[] = {
-       { "Properties", WPAS_DBUS_NEW_IFACE_P2P_PEER, "a{sv}",
-         wpas_dbus_getter_p2p_peer_properties,
-         NULL, R
+       { "DeviceName", WPAS_DBUS_NEW_IFACE_P2P_PEER, "s",
+         wpas_dbus_getter_p2p_peer_device_name,
+         NULL
+       },
+       { "PrimaryDeviceType", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
+         wpas_dbus_getter_p2p_peer_primary_device_type,
+         NULL
+       },
+       { "config_method", WPAS_DBUS_NEW_IFACE_P2P_PEER, "q",
+         wpas_dbus_getter_p2p_peer_config_method,
+         NULL
+       },
+       { "level", WPAS_DBUS_NEW_IFACE_P2P_PEER, "i",
+         wpas_dbus_getter_p2p_peer_level,
+         NULL
+       },
+       { "devicecapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
+         wpas_dbus_getter_p2p_peer_device_capability,
+         NULL
+       },
+       { "groupcapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
+         wpas_dbus_getter_p2p_peer_group_capability,
+         NULL
+       },
+       { "SecondaryDeviceTypes", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
+         wpas_dbus_getter_p2p_peer_secondary_device_types,
+         NULL
+       },
+       { "VendorExtension", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
+         wpas_dbus_getter_p2p_peer_vendor_extension,
+         NULL
        },
        { "IEs", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
          wpas_dbus_getter_p2p_peer_ies,
-         NULL, R
+         NULL
+       },
+       { "DeviceAddress", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
+         wpas_dbus_getter_p2p_peer_device_address,
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { "Groups", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ao",
+         wpas_dbus_getter_p2p_peer_groups,
+         NULL
+       },
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_p2p_peer_signals[] = {
-
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
+       { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_P2P_PEER,
+         {
+                 { "properties", "a{sv}", ARG_OUT },
+                 END_ARGS
+         }
+       },
        { NULL, NULL, { END_ARGS } }
 };
 
@@ -2795,10 +3375,13 @@ static void wpas_dbus_signal_peer(struct wpa_supplicant *wpa_s,
        DBusMessageIter iter;
        char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
        iface = wpa_s->global->dbus;
 
        /* Do nothing if the control interface is not turned on */
-       if (iface == NULL)
+       if (iface == NULL || !wpa_s->dbus_new_path)
                return;
 
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -2814,15 +3397,10 @@ static void wpas_dbus_signal_peer(struct wpa_supplicant *wpa_s,
        path = peer_obj_path;
        if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
                                            &path))
-               goto err;
-
-       dbus_connection_send(iface->con, msg, NULL);
-
-       dbus_message_unref(msg);
-       return;
+               wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       else
+               dbus_connection_send(iface->con, msg, NULL);
 
-err:
-       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
        dbus_message_unref(msg);
 }
 
@@ -2880,6 +3458,10 @@ int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr)
        if (ctrl_iface == NULL)
                return 0;
 
+       wpa_s = wpa_s->parent->parent;
+       if (!wpa_s->dbus_new_path)
+               return 0;
+
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
                    "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
                    wpa_s->dbus_new_path, MAC2STR(dev_addr));
@@ -2888,16 +3470,16 @@ int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr)
                   peer_obj_path);
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                goto err;
        }
 
        /* allocate memory for handlers arguments */
        arg = os_zalloc(sizeof(struct peer_handler_args));
        if (!arg) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create arguments for method");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create arguments for method");
                goto err;
        }
 
@@ -2936,9 +3518,13 @@ int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
        int ret;
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL ||
-           wpa_s->dbus_new_path == NULL)
+       if (wpa_s == NULL || wpa_s->global == NULL)
                return 0;
+
+       wpa_s = wpa_s->parent->parent;
+       if (!wpa_s->dbus_new_path)
+               return 0;
+
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
                return 0;
@@ -2955,18 +3541,92 @@ int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
 }
 
 
+/**
+ * wpas_dbus_signal_p2p_find_stopped - Send P2P Find stopped signal
+ * @wpa_s: %wpa_supplicant network interface data
+ *
+ * Notify listeners about P2P Find stopped
+ */
+void wpas_dbus_signal_p2p_find_stopped(struct wpa_supplicant *wpa_s)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+
+       iface = wpa_s->global->dbus;
+
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL || !wpa_s->dbus_new_path)
+               return;
+
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_P2PDEVICE,
+                                     "FindStopped");
+       if (msg == NULL)
+               return;
+
+       dbus_connection_send(iface->con, msg, NULL);
+
+       dbus_message_unref(msg);
+}
+
+
+void wpas_dbus_signal_peer_groups_changed(struct wpa_supplicant *wpa_s,
+                                         const u8 *dev_addr)
+{
+       char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
+       if (!wpa_s->dbus_new_path)
+               return;
+       os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
+                   wpa_s->dbus_new_path, MAC2STR(dev_addr));
+
+       wpa_dbus_mark_property_changed(wpa_s->global->dbus, peer_obj_path,
+                                      WPAS_DBUS_NEW_IFACE_P2P_PEER, "Groups");
+}
+
+
 static const struct wpa_dbus_property_desc wpas_dbus_p2p_group_properties[] = {
        { "Members", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ao",
          wpas_dbus_getter_p2p_group_members,
-         NULL, R
+         NULL
+       },
+       { "Group", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "o",
+         wpas_dbus_getter_p2p_group,
+         NULL
+       },
+       { "Role", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "s",
+         wpas_dbus_getter_p2p_role,
+         NULL
+       },
+       { "SSID", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_ssid,
+         NULL
+       },
+       { "BSSID", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_bssid,
+         NULL
+       },
+       { "Frequency", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "q",
+         wpas_dbus_getter_p2p_group_frequency,
+         NULL
+       },
+       { "Passphrase", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "s",
+         wpas_dbus_getter_p2p_group_passphrase,
+         NULL
+       },
+       { "PSK", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_psk,
+         NULL
        },
-       { "Properties",
-         WPAS_DBUS_NEW_IFACE_P2P_GROUP, "a{sv}",
-         wpas_dbus_getter_p2p_group_properties,
-         wpas_dbus_setter_p2p_group_properties,
-         RW
+       { "WPSVendorExtensions", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "aay",
+         wpas_dbus_getter_p2p_group_vendor_ext,
+         wpas_dbus_setter_p2p_group_vendor_ext
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_p2p_group_signals[] = {
@@ -3025,8 +3685,8 @@ void wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
                   group_obj_path);
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
+               wpa_printf(MSG_ERROR,
+                          "Not enough memory to create object description");
                goto err;
        }
 
@@ -3063,6 +3723,9 @@ void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
        if (wpa_s == NULL || wpa_s->global == NULL)
                return;
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
                return;
@@ -3074,6 +3737,8 @@ void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       peer_groups_changed(wpa_s);
+
        wpa_printf(MSG_DEBUG, "dbus: Unregister group object '%s'",
                   wpa_s->dbus_groupobj_path);
 
@@ -3085,120 +3750,12 @@ void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
 }
 
 static const struct wpa_dbus_property_desc
-wpas_dbus_p2p_groupmember_properties[] = {
-       { "Properties", WPAS_DBUS_NEW_IFACE_P2P_GROUPMEMBER, "a{sv}",
-         wpas_dbus_getter_p2p_group_properties,
-         NULL, R
-       },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
-};
-
-/**
- * wpas_dbus_register_p2p_groupmember - Register a p2p groupmember
- * object with dbus
- * @wpa_s: wpa_supplicant interface structure
- * @p2p_if_addr: i/f addr of the device joining this group
- *
- * Registers p2p groupmember representing object with dbus
- */
-void wpas_dbus_register_p2p_groupmember(struct wpa_supplicant *wpa_s,
-                                       const u8 *p2p_if_addr)
-{
-       struct wpas_dbus_priv *ctrl_iface;
-       struct wpa_dbus_object_desc *obj_desc = NULL;
-       struct groupmember_handler_args *arg;
-       char groupmember_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
-
-       /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL)
-               return;
-
-       ctrl_iface = wpa_s->global->dbus;
-       if (ctrl_iface == NULL)
-               return;
-
-       if (!wpa_s->dbus_groupobj_path)
-               return;
-
-       os_snprintf(groupmember_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
-               "%s/" WPAS_DBUS_NEW_P2P_GROUPMEMBERS_PART "/" COMPACT_MACSTR,
-               wpa_s->dbus_groupobj_path, MAC2STR(p2p_if_addr));
-
-       obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
-       if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create object description");
-               goto err;
-       }
-
-       /* allocate memory for handlers arguments */
-       arg = os_zalloc(sizeof(struct groupmember_handler_args));
-       if (!arg) {
-               wpa_printf(MSG_ERROR, "Not enough memory "
-                          "to create arguments for method");
-               goto err;
-       }
-
-       arg->wpa_s = wpa_s;
-       os_memcpy(arg->member_addr, p2p_if_addr, ETH_ALEN);
-
-       wpas_dbus_register(obj_desc, arg, wpa_dbus_free, NULL,
-                          wpas_dbus_p2p_groupmember_properties, NULL);
-
-       if (wpa_dbus_register_object_per_iface(ctrl_iface, groupmember_obj_path,
-                                              wpa_s->ifname, obj_desc))
-               goto err;
-
-       wpa_printf(MSG_INFO,
-                  "dbus: Registered group member object '%s' successfully",
-                  groupmember_obj_path);
-       return;
-
-err:
-       free_dbus_object_desc(obj_desc);
-}
-
-/**
- * wpas_dbus_unregister_p2p_groupmember - Unregister a p2p groupmember
- * object with dbus
- * @wpa_s: wpa_supplicant interface structure
- * @p2p_if_addr: i/f addr of the device joining this group
- *
- * Unregisters p2p groupmember representing object with dbus
- */
-void wpas_dbus_unregister_p2p_groupmember(struct wpa_supplicant *wpa_s,
-                                         const u8 *p2p_if_addr)
-{
-       struct wpas_dbus_priv *ctrl_iface;
-       char groupmember_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
-
-       /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL)
-               return;
-
-       ctrl_iface = wpa_s->global->dbus;
-       if (ctrl_iface == NULL)
-               return;
-
-       if (!wpa_s->dbus_groupobj_path)
-               return;
-
-       os_snprintf(groupmember_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
-               "%s/" WPAS_DBUS_NEW_P2P_GROUPMEMBERS_PART "/" COMPACT_MACSTR,
-               wpa_s->dbus_groupobj_path, MAC2STR(p2p_if_addr));
-
-       wpa_dbus_unregister_object_per_iface(ctrl_iface, groupmember_obj_path);
-}
-
-
-static const struct wpa_dbus_property_desc
        wpas_dbus_persistent_group_properties[] = {
        { "Properties", WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP, "a{sv}",
          wpas_dbus_getter_persistent_group_properties,
-         wpas_dbus_setter_persistent_group_properties,
-         RW
+         wpas_dbus_setter_persistent_group_properties
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 /* No signals intended for persistent group objects */
@@ -3224,11 +3781,17 @@ int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
        /* Do nothing if the control interface is not turned on */
        if (wpa_s == NULL || wpa_s->global == NULL)
                return 0;
+       wpa_s = wpa_s->parent->parent;
+       if (!wpa_s->dbus_new_path)
+               return 0;
 
        /* Make sure ssid is a persistent group */
        if (ssid->disabled != 2 && !ssid->p2p_persistent_group)
                return -1; /* should we return w/o complaining? */
 
+       if (wpa_s->p2p_mgmt)
+               wpa_s = wpa_s->parent;
+
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
                return 0;
@@ -3245,8 +3808,8 @@ int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
                   pgrp_obj_path);
        obj_desc = os_zalloc(sizeof(struct wpa_dbus_object_desc));
        if (!obj_desc) {
-               wpa_printf(MSG_ERROR, "dbus: Not enough memory to create "
-                          "object description");
+               wpa_printf(MSG_ERROR,
+                          "dbus: Not enough memory to create object description");
                goto err;
        }
 
@@ -3257,8 +3820,8 @@ int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
        /* allocate memory for handlers arguments */
        arg = os_zalloc(sizeof(struct network_handler_args));
        if (!arg) {
-               wpa_printf(MSG_ERROR, "dbus: Not enough memory to create "
-                          "arguments for method");
+               wpa_printf(MSG_ERROR,
+                          "dbus: Not enough memory to create arguments for method");
                goto err;
        }
 
@@ -3305,11 +3868,13 @@ int wpas_dbus_unregister_persistent_group(struct wpa_supplicant *wpa_s,
        int ret;
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL ||
-           wpa_s->dbus_new_path == NULL)
+       if (wpa_s == NULL || wpa_s->global == NULL)
                return 0;
+
+       wpa_s = wpa_s->parent->parent;
+
        ctrl_iface = wpa_s->global->dbus;
-       if (ctrl_iface == NULL)
+       if (ctrl_iface == NULL || !wpa_s->dbus_new_path)
                return 0;
 
        os_snprintf(pgrp_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,