18d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt/*
28d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * wpa_supplicant - Event notifications
38d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
48d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt *
5c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * This software may be distributed under the terms of the BSD license.
6c5ec7f57ead87efa365800228aa0b09a12d9e6c4Dmitry Shmidt * See README for more details.
78d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt */
88d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
98d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "utils/includes.h"
108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "utils/common.h"
128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "common/wpa_ctrl.h"
138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "config.h"
148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "wpa_supplicant_i.h"
158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "wps_supplicant.h"
168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "dbus/dbus_common.h"
178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "dbus/dbus_old.h"
188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "dbus/dbus_new.h"
191f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#include "rsn_supp/wpa.h"
208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "driver_i.h"
218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "scan.h"
228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "p2p_supplicant.h"
238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "sme.h"
248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#include "notify.h"
258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_notify_supplicant_initialized(struct wpa_global *global)
278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_DBUS
298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (global->params.dbus_ctrl_interface) {
308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		global->dbus = wpas_dbus_init(global);
318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		if (global->dbus == NULL)
328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			return -1;
338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	}
348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_DBUS */
358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return 0;
378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_supplicant_deinitialized(struct wpa_global *global)
418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_DBUS
438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (global->dbus)
448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpas_dbus_deinit(global->dbus);
458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_DBUS */
468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtint wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (wpas_dbus_register_iface(wpa_s))
528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return -1;
538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (wpas_dbus_register_interface(wpa_s))
558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		return -1;
568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	return 0;
588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* unregister interface in old DBus ctrl iface */
648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_unregister_iface(wpa_s);
658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* unregister interface in new DBus ctrl iface */
678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_unregister_interface(wpa_s);
688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       enum wpa_states new_state,
738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       enum wpa_states old_state)
748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the old DBus API */
768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_supplicant_dbus_notify_state_change(wpa_s, new_state,
778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt						old_state);
788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the new DBus API */
808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STATE);
818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_P2P
838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (new_state == WPA_COMPLETED)
848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpas_p2p_notif_connected(wpa_s);
8504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt	else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED)
868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpas_p2p_notif_disconnected(wpa_s);
878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_P2P */
888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	sme_state_changed(wpa_s);
908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef ANDROID
928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE
93f20a4432808cee548326c4b35c83071ca576a239Irfan Sheriff		     "id=%d state=%d BSSID=" MACSTR " SSID=%s",
948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     wpa_s->current_ssid ? wpa_s->current_ssid->id : -1,
95f20a4432808cee548326c4b35c83071ca576a239Irfan Sheriff		     new_state,
96e78e767aea5576ec0ba7edadfe25fd9dc7dce48fIrfan Sheriff		     MAC2STR(wpa_s->bssid),
975b5fb02b225c5c05a4477bef58bdaceede5d68dcandy		     wpa_s->current_ssid && wpa_s->current_ssid->ssid ?
985b5fb02b225c5c05a4477bef58bdaceede5d68dcandy		     wpa_ssid_txt(wpa_s->current_ssid->ssid,
991029477547084d210cb810e8e5463c628972b315Irfan Sheriff		     wpa_s->current_ssid->ssid_len): "");
1008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* ANDROID */
1018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
10404949598a23f501be6eec21697465fd46a28840aDmitry Shmidtvoid wpas_notify_disconnect_reason(struct wpa_supplicant *wpa_s)
10504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt{
10604949598a23f501be6eec21697465fd46a28840aDmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_DISCONNECT_REASON);
10704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt}
10804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
10904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
1108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
1118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_NETWORK);
1138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
1178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AP_SCAN);
1198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
1238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_BSS);
1258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_auth_changed(struct wpa_supplicant *wpa_s)
1298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_AUTH_MODE);
1318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
1358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					 struct wpa_ssid *ssid)
1368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_network_enabled_changed(wpa_s, ssid);
1388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
1428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  struct wpa_ssid *ssid)
1438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_network_selected(wpa_s, ssid->id);
1458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1481f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_notify_network_request(struct wpa_supplicant *wpa_s,
1491f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				 struct wpa_ssid *ssid,
1501f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				 enum wpa_ctrl_req_type rtype,
1511f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				 const char *default_txt)
1521f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt{
1531f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	wpas_dbus_signal_network_request(wpa_s, ssid, rtype, default_txt);
1541f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt}
1551f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
1561f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
1578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_scanning(struct wpa_supplicant *wpa_s)
1588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the old DBus API */
1608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_supplicant_dbus_notify_scanning(wpa_s);
1618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the new DBus API */
1638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SCANNING);
1648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
1688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_scan_done(wpa_s, success);
1708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_scan_results(struct wpa_supplicant *wpa_s)
1748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the old DBus API */
1768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_supplicant_dbus_notify_scan_results(wpa_s);
1778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_wps_notify_scan_results(wpa_s);
1798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
1838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				const struct wps_credential *cred)
1848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_WPS
1868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the old DBus API */
1878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_supplicant_dbus_notify_wps_cred(wpa_s, cred);
1888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	/* notify the new DBus API */
1898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_wps_cred(wpa_s, cred);
1908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_WPS */
1918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
1928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
1948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
1958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       struct wps_event_m2d *m2d)
1968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
1978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_WPS
1988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_wps_event_m2d(wpa_s, m2d);
1998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_WPS */
2008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
2048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				struct wps_event_fail *fail)
2058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_WPS
2078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_wps_event_fail(wpa_s, fail);
2088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_WPS */
2098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
2138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_WPS
2158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_wps_event_success(wpa_s);
2168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_WPS */
2178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_network_added(struct wpa_supplicant *wpa_s,
2218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			       struct wpa_ssid *ssid)
2228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
22375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/*
22475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * Networks objects created during any P2P activities should not be
22575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * exposed out. They might/will confuse certain non-P2P aware
22675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * applications since these network objects won't behave like
22775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * regular ones.
22875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 */
229391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt	if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s)
23075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen		wpas_dbus_register_network(wpa_s, ssid);
23175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
23275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
23375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
23475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_notify_persistent_group_added(struct wpa_supplicant *wpa_s,
23575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					struct wpa_ssid *ssid)
23675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
237c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt#ifdef CONFIG_P2P
23875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_register_persistent_group(wpa_s, ssid);
239c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt#endif /* CONFIG_P2P */
24075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
24175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
24275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
24375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
24475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					  struct wpa_ssid *ssid)
24575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
246c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt#ifdef CONFIG_P2P
24775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
248c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt#endif /* CONFIG_P2P */
2498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
2538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 struct wpa_ssid *ssid)
2548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2551f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	if (wpa_s->wpa)
2561f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
257391c59f0632df8db1c325da1d31d479b2eedce45Dmitry Shmidt	if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s)
25875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen		wpas_dbus_unregister_network(wpa_s, ssid->id);
2591f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#ifdef CONFIG_P2P
2601f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	wpas_p2p_network_removed(wpa_s, ssid);
2611f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt#endif /* CONFIG_P2P */
2628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
2668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			   u8 bssid[], unsigned int id)
2678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_register_bss(wpa_s, bssid, id);
2698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR,
2708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     id, MAC2STR(bssid));
2718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
2758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			     u8 bssid[], unsigned int id)
2768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_unregister_bss(wpa_s, bssid, id);
2788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR,
2798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		     id, MAC2STR(bssid));
2808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
2848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  unsigned int id)
2858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
2878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_signal_changed(struct wpa_supplicant *wpa_s,
2918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				    unsigned int id)
2928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
2938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_SIGNAL,
2948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					  id);
2958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
2968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
2988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_privacy_changed(struct wpa_supplicant *wpa_s,
2998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				     unsigned int id)
3008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_PRIVACY,
3028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					  id);
3038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_mode_changed(struct wpa_supplicant *wpa_s,
3078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  unsigned int id)
3088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_MODE, id);
3108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_wpaie_changed(struct wpa_supplicant *wpa_s,
3148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   unsigned int id)
3158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPA, id);
3178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3198d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3208d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_rsnie_changed(struct wpa_supplicant *wpa_s,
3218d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   unsigned int id)
3228d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3238d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RSN, id);
3248d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3258d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_wps_changed(struct wpa_supplicant *wpa_s,
3288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 unsigned int id)
3298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
330d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt#ifdef CONFIG_WPS
331d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPS, id);
332d5e4923d04122f81300fa68fb07d64ede28fd44dDmitry Shmidt#endif /* CONFIG_WPS */
3338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3358d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_ies_changed(struct wpa_supplicant *wpa_s,
3378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   unsigned int id)
3388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_IES, id);
3408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3438d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_bss_rates_changed(struct wpa_supplicant *wpa_s,
3448d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   unsigned int id)
3458d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RATES, id);
3478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
3518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3528d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_blob_added(wpa_s, name);
3538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3568d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
3578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_blob_removed(wpa_s, name);
3598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_debug_level_changed(struct wpa_global *global)
3638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_debug_level_changed(global);
3658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3668d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_debug_timestamp_changed(struct wpa_global *global)
3698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_debug_timestamp_changed(global);
3718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_debug_show_keys_changed(struct wpa_global *global)
3758d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3768d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpas_dbus_signal_debug_show_keys_changed(global);
3778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_suspend(struct wpa_global *global)
3818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpa_supplicant *wpa_s;
3838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3848d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	os_get_time(&global->suspend_time);
3858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_printf(MSG_DEBUG, "System suspend notification");
3868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next)
3878d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpa_drv_suspend(wpa_s);
3888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
3898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3918d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_resume(struct wpa_global *global)
3928d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
3938d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct os_time now;
3948d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	int slept;
3958d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	struct wpa_supplicant *wpa_s;
3968d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
3978d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (global->suspend_time.sec == 0)
3988d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		slept = -1;
3998d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	else {
4008d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		os_get_time(&now);
4018d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		slept = now.sec - global->suspend_time.sec;
4028d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	}
4038d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	wpa_printf(MSG_DEBUG, "System resume notification (slept %d seconds)",
4048d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		   slept);
4058d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4068d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
4078d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpa_drv_resume(wpa_s);
4088d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		if (wpa_s->wpa_state == WPA_DISCONNECTED)
4098d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt			wpa_supplicant_req_scan(wpa_s, 0, 100000);
4108d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	}
4118d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4128d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4138d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4148d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#ifdef CONFIG_P2P
4158d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4168d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
4178d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				  const u8 *dev_addr, int new_device)
4188d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
41975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	if (new_device) {
42075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen		/* Create the new peer object */
42175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen		wpas_dbus_register_peer(wpa_s, dev_addr);
42275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	}
42375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
42475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/* Notify a new peer has been detected*/
42575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_peer_device_found(wpa_s, dev_addr);
4268d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4278d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4288d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,
4308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 const u8 *dev_addr)
4318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
43275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_unregister_peer(wpa_s, dev_addr);
43375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
43475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/* Create signal on interface object*/
43575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_peer_device_lost(wpa_s, dev_addr);
4368d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4388d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4398d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_group_removed(struct wpa_supplicant *wpa_s,
4408d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   const struct wpa_ssid *ssid,
4418d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				   const char *role)
4428d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
44375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_unregister_p2p_group(wpa_s, ssid);
44475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
44575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_group_removed(wpa_s, role);
4468d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4478d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4488d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4498d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
4508d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				const u8 *src, u16 dev_passwd_id)
4518d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
45275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_go_neg_req(wpa_s, src, dev_passwd_id);
4538d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4548d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4558d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4561f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidtvoid wpas_notify_p2p_go_neg_completed(struct wpa_supplicant *wpa_s,
4571f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				      struct p2p_go_neg_results *res)
4588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
4591f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	wpas_dbus_signal_p2p_go_neg_resp(wpa_s, res);
4608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4638d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_invitation_result(struct wpa_supplicant *wpa_s,
4648d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				       int status, const u8 *bssid)
4658d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
46675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_invitation_result(wpa_s, status, bssid);
4678d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4688d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4698d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4708d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_sd_request(struct wpa_supplicant *wpa_s,
4718d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				int freq, const u8 *sa, u8 dialog_token,
4728d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				u16 update_indic, const u8 *tlvs,
4738d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				size_t tlvs_len)
4748d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
47575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_sd_request(wpa_s, freq, sa, dialog_token,
47675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					update_indic, tlvs, tlvs_len);
4778d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
4788d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
4808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
4818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 const u8 *sa, u16 update_indic,
4828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt				 const u8 *tlvs, size_t tlvs_len)
4838d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
48475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_sd_response(wpa_s, sa, update_indic,
48575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					 tlvs, tlvs_len);
48675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
48775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
48875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
48975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen/**
49075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * wpas_notify_p2p_provision_discovery - Notification of provision discovery
49175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * @dev_addr: Who sent the request or responded to our request.
49275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * @request: Will be 1 if request, 0 for response.
49375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * @status: Valid only in case of response (0 in case of success)
49475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * @config_methods: WPS config methods
49575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * @generated_pin: PIN to be displayed in case of WPS_CONFIG_DISPLAY method
49675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen *
49775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * This can be used to notify:
49875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * - Requests or responses
49975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * - Various config methods
50075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen * - Failure condition in case of response
50175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen */
50275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
50375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					 const u8 *dev_addr, int request,
50475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					 enum p2p_prov_disc_status status,
50575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					 u16 config_methods,
50675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen					 unsigned int generated_pin)
50775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
50875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_provision_discovery(wpa_s, dev_addr, request,
50975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen						 status, config_methods,
51075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen						 generated_pin);
51175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
51275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
51375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
51475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_notify_p2p_group_started(struct wpa_supplicant *wpa_s,
51575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen				   struct wpa_ssid *ssid, int network_id,
51675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen				   int client)
51775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
51875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/* Notify a group has been started */
51975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_register_p2p_group(wpa_s, ssid);
52075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
52175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_group_started(wpa_s, ssid, client, network_id);
52275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen}
52375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
52475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
52575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinenvoid wpas_notify_p2p_wps_failed(struct wpa_supplicant *wpa_s,
52675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen				struct wps_event_fail *fail)
52775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen{
52875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_wps_failed(wpa_s, fail);
5298d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
5308d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5318d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt#endif /* CONFIG_P2P */
5328d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5338d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5348d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic void wpas_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
5351f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt					  const u8 *sta,
5361f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt					  const u8 *p2p_dev_addr)
5378d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
53875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen#ifdef CONFIG_P2P
5391f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt	wpas_p2p_notify_ap_sta_authorized(wpa_s, p2p_dev_addr);
5401f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt
54175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/*
54275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * Register a group member object corresponding to this peer and
54375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * emit a PeerJoined signal. This will check if it really is a
54475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * P2P group.
54575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 */
54675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_register_p2p_groupmember(wpa_s, sta);
54775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
54875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/*
54975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * Create 'peer-joined' signal on group object -- will also
55075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * check P2P itself.
55175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 */
55275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_peer_joined(wpa_s, sta);
55375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen#endif /* CONFIG_P2P */
55434af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt
55534af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt	/* Notify listeners a new station has been authorized */
55634af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt	wpas_dbus_signal_sta_authorized(wpa_s, sta);
5578d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
5588d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5598d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5608d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtstatic void wpas_notify_ap_sta_deauthorized(struct wpa_supplicant *wpa_s,
5618d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt					    const u8 *sta)
5628d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
56375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen#ifdef CONFIG_P2P
56475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/*
56575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * Unregister a group member object corresponding to this peer
56675ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * if this is a P2P group.
56775ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 */
56875ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_unregister_p2p_groupmember(wpa_s, sta);
56975ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen
57075ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	/*
57175ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * Create 'peer-disconnected' signal on group object if this
57275ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 * is a P2P group.
57375ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	 */
57475ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen	wpas_dbus_signal_p2p_peer_disconnected(wpa_s, sta);
57575ecf5267604f166b85a7ee2cf0d9cb682966680Jouni Malinen#endif /* CONFIG_P2P */
57634af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt
57734af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt	/* Notify listeners a station has been deauthorized */
57834af306c42b7ccf956508e7cd23f0ba90606e360Dmitry Shmidt	wpas_dbus_signal_sta_deauthorized(wpa_s, sta);
5798d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
5808d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5818d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt
5828d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidtvoid wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
5831f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				const u8 *mac_addr, int authorized,
5841f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt				const u8 *p2p_dev_addr)
5858d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt{
5868d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	if (authorized)
5871f69aa52ea2e0a73ac502565df8c666ee49cab6aDmitry Shmidt		wpas_notify_ap_sta_authorized(wpa_s, mac_addr, p2p_dev_addr);
5888d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt	else
5898d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt		wpas_notify_ap_sta_deauthorized(wpa_s, mac_addr);
5908d520ff1dc2da35cdca849e982051b86468016d8Dmitry Shmidt}
591c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt
592c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt
593c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidtvoid wpas_notify_certification(struct wpa_supplicant *wpa_s, int depth,
594c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt			       const char *subject, const char *cert_hash,
595c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt			       const struct wpabuf *cert)
596c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt{
597c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT
598c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		"depth=%d subject='%s'%s%s",
599c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		depth, subject,
600c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		cert_hash ? " hash=" : "",
601c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		cert_hash ? cert_hash : "");
602c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt
603c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	if (cert) {
604c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		char *cert_hex;
605c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		size_t len = wpabuf_len(cert) * 2 + 1;
606c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		cert_hex = os_malloc(len);
607c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		if (cert_hex) {
608c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt			wpa_snprintf_hex(cert_hex, len, wpabuf_head(cert),
609c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt					 wpabuf_len(cert));
610c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt			wpa_msg_ctrl(wpa_s, MSG_INFO,
611c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt				     WPA_EVENT_EAP_PEER_CERT
612c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt				     "depth=%d subject='%s' cert=%s",
613c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt				     depth, subject, cert_hex);
614c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt			os_free(cert_hex);
615c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt		}
616c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	}
617c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt
618c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	/* notify the old DBus API */
619c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	wpa_supplicant_dbus_notify_certification(wpa_s, depth, subject,
620c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt						 cert_hash, cert);
621c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	/* notify the new DBus API */
622c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt	wpas_dbus_signal_certification(wpa_s, depth, subject, cert_hash, cert);
623c55524ad84d13014e8019491c2b17e5dcf13545aDmitry Shmidt}
62404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
62504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
62604949598a23f501be6eec21697465fd46a28840aDmitry Shmidtvoid wpas_notify_preq(struct wpa_supplicant *wpa_s,
62704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt		      const u8 *addr, const u8 *dst, const u8 *bssid,
62804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt		      const u8 *ie, size_t ie_len, u32 ssi_signal)
62904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt{
63004949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#ifdef CONFIG_AP
63104949598a23f501be6eec21697465fd46a28840aDmitry Shmidt	wpas_dbus_signal_preq(wpa_s, addr, dst, bssid, ie, ie_len, ssi_signal);
63204949598a23f501be6eec21697465fd46a28840aDmitry Shmidt#endif /* CONFIG_AP */
63304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt}
63404949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
63504949598a23f501be6eec21697465fd46a28840aDmitry Shmidt
63604949598a23f501be6eec21697465fd46a28840aDmitry Shmidtvoid wpas_notify_eap_status(struct wpa_supplicant *wpa_s, const char *status,
63704949598a23f501be6eec21697465fd46a28840aDmitry Shmidt			    const char *parameter)
63804949598a23f501be6eec21697465fd46a28840aDmitry Shmidt{
63904949598a23f501be6eec21697465fd46a28840aDmitry Shmidt	wpas_dbus_signal_eap_status(wpa_s, status, parameter);
6408da800a193fb6f8832218715f82a7b4e2d2ad338Dmitry Shmidt	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_STATUS
6418da800a193fb6f8832218715f82a7b4e2d2ad338Dmitry Shmidt		     "status='%s' parameter='%s'",
6428da800a193fb6f8832218715f82a7b4e2d2ad338Dmitry Shmidt		     status, parameter);
64304949598a23f501be6eec21697465fd46a28840aDmitry Shmidt}
644