1e28a4053SRui Paulo /*
2e28a4053SRui Paulo * wpa_supplicant - Event notifications
3e28a4053SRui Paulo * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo *
5f05cddf9SRui Paulo * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo * See README for more details.
7e28a4053SRui Paulo */
8e28a4053SRui Paulo
9e28a4053SRui Paulo #include "utils/includes.h"
10e28a4053SRui Paulo
11e28a4053SRui Paulo #include "utils/common.h"
12e28a4053SRui Paulo #include "common/wpa_ctrl.h"
13e28a4053SRui Paulo #include "config.h"
14e28a4053SRui Paulo #include "wpa_supplicant_i.h"
15e28a4053SRui Paulo #include "wps_supplicant.h"
16780fb4a2SCy Schubert #include "binder/binder.h"
17e28a4053SRui Paulo #include "dbus/dbus_common.h"
18e28a4053SRui Paulo #include "dbus/dbus_new.h"
19f05cddf9SRui Paulo #include "rsn_supp/wpa.h"
20*a90b9d01SCy Schubert #include "rsn_supp/pmksa_cache.h"
21325151a3SRui Paulo #include "fst/fst.h"
22206b73d0SCy Schubert #include "crypto/tls.h"
2332a95656SCy Schubert #include "bss.h"
24e28a4053SRui Paulo #include "driver_i.h"
25e28a4053SRui Paulo #include "scan.h"
26f05cddf9SRui Paulo #include "p2p_supplicant.h"
27f05cddf9SRui Paulo #include "sme.h"
28e28a4053SRui Paulo #include "notify.h"
29e28a4053SRui Paulo
wpas_notify_supplicant_initialized(struct wpa_global * global)30e28a4053SRui Paulo int wpas_notify_supplicant_initialized(struct wpa_global *global)
31e28a4053SRui Paulo {
324bc52338SCy Schubert #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
33e28a4053SRui Paulo if (global->params.dbus_ctrl_interface) {
34e28a4053SRui Paulo global->dbus = wpas_dbus_init(global);
35e28a4053SRui Paulo if (global->dbus == NULL)
36e28a4053SRui Paulo return -1;
37e28a4053SRui Paulo }
384bc52338SCy Schubert #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
39e28a4053SRui Paulo
40780fb4a2SCy Schubert #ifdef CONFIG_BINDER
41780fb4a2SCy Schubert global->binder = wpas_binder_init(global);
42780fb4a2SCy Schubert if (!global->binder)
43780fb4a2SCy Schubert return -1;
44780fb4a2SCy Schubert #endif /* CONFIG_BINDER */
45780fb4a2SCy Schubert
46e28a4053SRui Paulo return 0;
47e28a4053SRui Paulo }
48e28a4053SRui Paulo
49e28a4053SRui Paulo
wpas_notify_supplicant_deinitialized(struct wpa_global * global)50e28a4053SRui Paulo void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
51e28a4053SRui Paulo {
524bc52338SCy Schubert #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
53e28a4053SRui Paulo if (global->dbus)
54e28a4053SRui Paulo wpas_dbus_deinit(global->dbus);
554bc52338SCy Schubert #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
56780fb4a2SCy Schubert
57780fb4a2SCy Schubert #ifdef CONFIG_BINDER
58780fb4a2SCy Schubert if (global->binder)
59780fb4a2SCy Schubert wpas_binder_deinit(global->binder);
60780fb4a2SCy Schubert #endif /* CONFIG_BINDER */
61e28a4053SRui Paulo }
62e28a4053SRui Paulo
63e28a4053SRui Paulo
wpas_notify_iface_added(struct wpa_supplicant * wpa_s)64e28a4053SRui Paulo int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
65e28a4053SRui Paulo {
665b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
675b9c547cSRui Paulo return 0;
685b9c547cSRui Paulo
69e28a4053SRui Paulo if (wpas_dbus_register_interface(wpa_s))
70e28a4053SRui Paulo return -1;
71e28a4053SRui Paulo
72e28a4053SRui Paulo return 0;
73e28a4053SRui Paulo }
74e28a4053SRui Paulo
75e28a4053SRui Paulo
wpas_notify_iface_removed(struct wpa_supplicant * wpa_s)76e28a4053SRui Paulo void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
77e28a4053SRui Paulo {
785b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
795b9c547cSRui Paulo return;
805b9c547cSRui Paulo
81e28a4053SRui Paulo /* unregister interface in new DBus ctrl iface */
82e28a4053SRui Paulo wpas_dbus_unregister_interface(wpa_s);
83e28a4053SRui Paulo }
84e28a4053SRui Paulo
85e28a4053SRui Paulo
wpas_notify_state_changed(struct wpa_supplicant * wpa_s,enum wpa_states new_state,enum wpa_states old_state)86e28a4053SRui Paulo void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
87e28a4053SRui Paulo enum wpa_states new_state,
88e28a4053SRui Paulo enum wpa_states old_state)
89e28a4053SRui Paulo {
905b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
915b9c547cSRui Paulo return;
925b9c547cSRui Paulo
93e28a4053SRui Paulo /* notify the new DBus API */
94e28a4053SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STATE);
95f05cddf9SRui Paulo
96325151a3SRui Paulo #ifdef CONFIG_FST
97325151a3SRui Paulo if (wpa_s->fst && !is_zero_ether_addr(wpa_s->bssid)) {
98325151a3SRui Paulo if (new_state == WPA_COMPLETED)
99325151a3SRui Paulo fst_notify_peer_connected(wpa_s->fst, wpa_s->bssid);
100325151a3SRui Paulo else if (old_state >= WPA_ASSOCIATED &&
101325151a3SRui Paulo new_state < WPA_ASSOCIATED)
102325151a3SRui Paulo fst_notify_peer_disconnected(wpa_s->fst, wpa_s->bssid);
103325151a3SRui Paulo }
104325151a3SRui Paulo #endif /* CONFIG_FST */
105325151a3SRui Paulo
106f05cddf9SRui Paulo if (new_state == WPA_COMPLETED)
107f05cddf9SRui Paulo wpas_p2p_notif_connected(wpa_s);
108f05cddf9SRui Paulo else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED)
109f05cddf9SRui Paulo wpas_p2p_notif_disconnected(wpa_s);
110f05cddf9SRui Paulo
111f05cddf9SRui Paulo sme_state_changed(wpa_s);
112f05cddf9SRui Paulo
113f05cddf9SRui Paulo #ifdef ANDROID
114f05cddf9SRui Paulo wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE
1155b9c547cSRui Paulo "id=%d state=%d BSSID=" MACSTR " SSID=%s",
116f05cddf9SRui Paulo wpa_s->current_ssid ? wpa_s->current_ssid->id : -1,
1175b9c547cSRui Paulo new_state,
1185b9c547cSRui Paulo MAC2STR(wpa_s->bssid),
1195b9c547cSRui Paulo wpa_s->current_ssid && wpa_s->current_ssid->ssid ?
1205b9c547cSRui Paulo wpa_ssid_txt(wpa_s->current_ssid->ssid,
1215b9c547cSRui Paulo wpa_s->current_ssid->ssid_len) : "");
122f05cddf9SRui Paulo #endif /* ANDROID */
123f05cddf9SRui Paulo }
124f05cddf9SRui Paulo
125f05cddf9SRui Paulo
wpas_notify_disconnect_reason(struct wpa_supplicant * wpa_s)126f05cddf9SRui Paulo void wpas_notify_disconnect_reason(struct wpa_supplicant *wpa_s)
127f05cddf9SRui Paulo {
1285b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
1295b9c547cSRui Paulo return;
1305b9c547cSRui Paulo
131f05cddf9SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_DISCONNECT_REASON);
132e28a4053SRui Paulo }
133e28a4053SRui Paulo
134e28a4053SRui Paulo
wpas_notify_auth_status_code(struct wpa_supplicant * wpa_s)1354bc52338SCy Schubert void wpas_notify_auth_status_code(struct wpa_supplicant *wpa_s)
1364bc52338SCy Schubert {
1374bc52338SCy Schubert if (wpa_s->p2p_mgmt)
1384bc52338SCy Schubert return;
1394bc52338SCy Schubert
1404bc52338SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AUTH_STATUS_CODE);
1414bc52338SCy Schubert }
1424bc52338SCy Schubert
1434bc52338SCy Schubert
wpas_notify_assoc_status_code(struct wpa_supplicant * wpa_s)144780fb4a2SCy Schubert void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s)
145780fb4a2SCy Schubert {
146780fb4a2SCy Schubert if (wpa_s->p2p_mgmt)
147780fb4a2SCy Schubert return;
148780fb4a2SCy Schubert
149780fb4a2SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ASSOC_STATUS_CODE);
150780fb4a2SCy Schubert }
151780fb4a2SCy Schubert
152780fb4a2SCy Schubert
wpas_notify_roam_time(struct wpa_supplicant * wpa_s)1534bc52338SCy Schubert void wpas_notify_roam_time(struct wpa_supplicant *wpa_s)
1544bc52338SCy Schubert {
1554bc52338SCy Schubert if (wpa_s->p2p_mgmt)
1564bc52338SCy Schubert return;
1574bc52338SCy Schubert
1584bc52338SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ROAM_TIME);
1594bc52338SCy Schubert }
1604bc52338SCy Schubert
1614bc52338SCy Schubert
wpas_notify_roam_complete(struct wpa_supplicant * wpa_s)1624bc52338SCy Schubert void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s)
1634bc52338SCy Schubert {
1644bc52338SCy Schubert if (wpa_s->p2p_mgmt)
1654bc52338SCy Schubert return;
1664bc52338SCy Schubert
1674bc52338SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ROAM_COMPLETE);
1684bc52338SCy Schubert }
1694bc52338SCy Schubert
1704bc52338SCy Schubert
wpas_notify_session_length(struct wpa_supplicant * wpa_s)1714bc52338SCy Schubert void wpas_notify_session_length(struct wpa_supplicant *wpa_s)
1724bc52338SCy Schubert {
1734bc52338SCy Schubert if (wpa_s->p2p_mgmt)
1744bc52338SCy Schubert return;
1754bc52338SCy Schubert
1764bc52338SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SESSION_LENGTH);
1774bc52338SCy Schubert }
1784bc52338SCy Schubert
1794bc52338SCy Schubert
wpas_notify_bss_tm_status(struct wpa_supplicant * wpa_s)1804bc52338SCy Schubert void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
1814bc52338SCy Schubert {
1824bc52338SCy Schubert if (wpa_s->p2p_mgmt)
1834bc52338SCy Schubert return;
1844bc52338SCy Schubert
1854bc52338SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSS_TM_STATUS);
1864bc52338SCy Schubert }
1874bc52338SCy Schubert
1884bc52338SCy Schubert
wpas_notify_network_changed(struct wpa_supplicant * wpa_s)189e28a4053SRui Paulo void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
190e28a4053SRui Paulo {
1915b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
1925b9c547cSRui Paulo return;
1935b9c547cSRui Paulo
194e28a4053SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_NETWORK);
195e28a4053SRui Paulo }
196e28a4053SRui Paulo
197e28a4053SRui Paulo
wpas_notify_ap_scan_changed(struct wpa_supplicant * wpa_s)198e28a4053SRui Paulo void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
199e28a4053SRui Paulo {
2005b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2015b9c547cSRui Paulo return;
2025b9c547cSRui Paulo
203e28a4053SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AP_SCAN);
204e28a4053SRui Paulo }
205e28a4053SRui Paulo
206e28a4053SRui Paulo
wpas_notify_bssid_changed(struct wpa_supplicant * wpa_s)207e28a4053SRui Paulo void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
208e28a4053SRui Paulo {
2095b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2105b9c547cSRui Paulo return;
2115b9c547cSRui Paulo
212e28a4053SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_BSS);
213e28a4053SRui Paulo }
214e28a4053SRui Paulo
215e28a4053SRui Paulo
wpas_notify_mac_address_changed(struct wpa_supplicant * wpa_s)216*a90b9d01SCy Schubert void wpas_notify_mac_address_changed(struct wpa_supplicant *wpa_s)
217*a90b9d01SCy Schubert {
218*a90b9d01SCy Schubert if (wpa_s->p2p_mgmt)
219*a90b9d01SCy Schubert return;
220*a90b9d01SCy Schubert
221*a90b9d01SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_MAC_ADDRESS);
222*a90b9d01SCy Schubert }
223*a90b9d01SCy Schubert
224*a90b9d01SCy Schubert
wpas_notify_auth_changed(struct wpa_supplicant * wpa_s)225f05cddf9SRui Paulo void wpas_notify_auth_changed(struct wpa_supplicant *wpa_s)
226f05cddf9SRui Paulo {
2275b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2285b9c547cSRui Paulo return;
2295b9c547cSRui Paulo
230f05cddf9SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_AUTH_MODE);
231f05cddf9SRui Paulo }
232f05cddf9SRui Paulo
233f05cddf9SRui Paulo
wpas_notify_network_enabled_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)234e28a4053SRui Paulo void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
235e28a4053SRui Paulo struct wpa_ssid *ssid)
236e28a4053SRui Paulo {
2375b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2385b9c547cSRui Paulo return;
2395b9c547cSRui Paulo
240e28a4053SRui Paulo wpas_dbus_signal_network_enabled_changed(wpa_s, ssid);
241e28a4053SRui Paulo }
242e28a4053SRui Paulo
243e28a4053SRui Paulo
wpas_notify_network_selected(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)244e28a4053SRui Paulo void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
245e28a4053SRui Paulo struct wpa_ssid *ssid)
246e28a4053SRui Paulo {
2475b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2485b9c547cSRui Paulo return;
2495b9c547cSRui Paulo
250e28a4053SRui Paulo wpas_dbus_signal_network_selected(wpa_s, ssid->id);
251e28a4053SRui Paulo }
252e28a4053SRui Paulo
253e28a4053SRui Paulo
wpas_notify_network_request(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,enum wpa_ctrl_req_type rtype,const char * default_txt)254f05cddf9SRui Paulo void wpas_notify_network_request(struct wpa_supplicant *wpa_s,
255f05cddf9SRui Paulo struct wpa_ssid *ssid,
256f05cddf9SRui Paulo enum wpa_ctrl_req_type rtype,
257f05cddf9SRui Paulo const char *default_txt)
258f05cddf9SRui Paulo {
2595b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2605b9c547cSRui Paulo return;
2615b9c547cSRui Paulo
262f05cddf9SRui Paulo wpas_dbus_signal_network_request(wpa_s, ssid, rtype, default_txt);
263f05cddf9SRui Paulo }
264f05cddf9SRui Paulo
265f05cddf9SRui Paulo
wpas_notify_scanning(struct wpa_supplicant * wpa_s)266e28a4053SRui Paulo void wpas_notify_scanning(struct wpa_supplicant *wpa_s)
267e28a4053SRui Paulo {
2685b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2695b9c547cSRui Paulo return;
2705b9c547cSRui Paulo
271e28a4053SRui Paulo /* notify the new DBus API */
272e28a4053SRui Paulo wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SCANNING);
273e28a4053SRui Paulo }
274e28a4053SRui Paulo
275e28a4053SRui Paulo
wpas_notify_scan_done(struct wpa_supplicant * wpa_s,int success)276e28a4053SRui Paulo void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
277e28a4053SRui Paulo {
2785b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2795b9c547cSRui Paulo return;
2805b9c547cSRui Paulo
281e28a4053SRui Paulo wpas_dbus_signal_scan_done(wpa_s, success);
282e28a4053SRui Paulo }
283e28a4053SRui Paulo
284e28a4053SRui Paulo
wpas_notify_scan_results(struct wpa_supplicant * wpa_s)285e28a4053SRui Paulo void wpas_notify_scan_results(struct wpa_supplicant *wpa_s)
286e28a4053SRui Paulo {
2875b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2885b9c547cSRui Paulo return;
2895b9c547cSRui Paulo
290e28a4053SRui Paulo wpas_wps_notify_scan_results(wpa_s);
291e28a4053SRui Paulo }
292e28a4053SRui Paulo
293e28a4053SRui Paulo
wpas_notify_wps_credential(struct wpa_supplicant * wpa_s,const struct wps_credential * cred)294e28a4053SRui Paulo void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
295e28a4053SRui Paulo const struct wps_credential *cred)
296e28a4053SRui Paulo {
2975b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
2985b9c547cSRui Paulo return;
2995b9c547cSRui Paulo
300e28a4053SRui Paulo #ifdef CONFIG_WPS
301e28a4053SRui Paulo /* notify the new DBus API */
302e28a4053SRui Paulo wpas_dbus_signal_wps_cred(wpa_s, cred);
303e28a4053SRui Paulo #endif /* CONFIG_WPS */
304e28a4053SRui Paulo }
305e28a4053SRui Paulo
306e28a4053SRui Paulo
wpas_notify_wps_event_m2d(struct wpa_supplicant * wpa_s,struct wps_event_m2d * m2d)307e28a4053SRui Paulo void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
308e28a4053SRui Paulo struct wps_event_m2d *m2d)
309e28a4053SRui Paulo {
3105b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
3115b9c547cSRui Paulo return;
3125b9c547cSRui Paulo
313e28a4053SRui Paulo #ifdef CONFIG_WPS
314e28a4053SRui Paulo wpas_dbus_signal_wps_event_m2d(wpa_s, m2d);
315e28a4053SRui Paulo #endif /* CONFIG_WPS */
316e28a4053SRui Paulo }
317e28a4053SRui Paulo
318e28a4053SRui Paulo
wpas_notify_wps_event_fail(struct wpa_supplicant * wpa_s,struct wps_event_fail * fail)319e28a4053SRui Paulo void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
320e28a4053SRui Paulo struct wps_event_fail *fail)
321e28a4053SRui Paulo {
3225b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
3235b9c547cSRui Paulo return;
3245b9c547cSRui Paulo
325e28a4053SRui Paulo #ifdef CONFIG_WPS
326e28a4053SRui Paulo wpas_dbus_signal_wps_event_fail(wpa_s, fail);
327e28a4053SRui Paulo #endif /* CONFIG_WPS */
328e28a4053SRui Paulo }
329e28a4053SRui Paulo
330e28a4053SRui Paulo
wpas_notify_wps_event_success(struct wpa_supplicant * wpa_s)331e28a4053SRui Paulo void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
332e28a4053SRui Paulo {
3335b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
3345b9c547cSRui Paulo return;
3355b9c547cSRui Paulo
336e28a4053SRui Paulo #ifdef CONFIG_WPS
337e28a4053SRui Paulo wpas_dbus_signal_wps_event_success(wpa_s);
338e28a4053SRui Paulo #endif /* CONFIG_WPS */
339e28a4053SRui Paulo }
340e28a4053SRui Paulo
wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant * wpa_s)341325151a3SRui Paulo void wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
342325151a3SRui Paulo {
343325151a3SRui Paulo if (wpa_s->p2p_mgmt)
344325151a3SRui Paulo return;
345325151a3SRui Paulo
346325151a3SRui Paulo #ifdef CONFIG_WPS
347325151a3SRui Paulo wpas_dbus_signal_wps_event_pbc_overlap(wpa_s);
348325151a3SRui Paulo #endif /* CONFIG_WPS */
349325151a3SRui Paulo }
350325151a3SRui Paulo
351e28a4053SRui Paulo
wpas_notify_network_added(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)352e28a4053SRui Paulo void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
353e28a4053SRui Paulo struct wpa_ssid *ssid)
354e28a4053SRui Paulo {
3555b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
3565b9c547cSRui Paulo return;
3575b9c547cSRui Paulo
358f05cddf9SRui Paulo /*
359f05cddf9SRui Paulo * Networks objects created during any P2P activities should not be
360f05cddf9SRui Paulo * exposed out. They might/will confuse certain non-P2P aware
361f05cddf9SRui Paulo * applications since these network objects won't behave like
362f05cddf9SRui Paulo * regular ones.
363f05cddf9SRui Paulo */
3644b72b91aSCy Schubert if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s) {
365e28a4053SRui Paulo wpas_dbus_register_network(wpa_s, ssid);
3664b72b91aSCy Schubert wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_ADDED "%d",
3674b72b91aSCy Schubert ssid->id);
3684b72b91aSCy Schubert }
369e28a4053SRui Paulo }
370e28a4053SRui Paulo
371e28a4053SRui Paulo
wpas_notify_persistent_group_added(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)372f05cddf9SRui Paulo void wpas_notify_persistent_group_added(struct wpa_supplicant *wpa_s,
373f05cddf9SRui Paulo struct wpa_ssid *ssid)
374f05cddf9SRui Paulo {
375f05cddf9SRui Paulo #ifdef CONFIG_P2P
376f05cddf9SRui Paulo wpas_dbus_register_persistent_group(wpa_s, ssid);
377f05cddf9SRui Paulo #endif /* CONFIG_P2P */
378f05cddf9SRui Paulo }
379f05cddf9SRui Paulo
380f05cddf9SRui Paulo
wpas_notify_persistent_group_removed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)381f05cddf9SRui Paulo void wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
382f05cddf9SRui Paulo struct wpa_ssid *ssid)
383f05cddf9SRui Paulo {
384f05cddf9SRui Paulo #ifdef CONFIG_P2P
385f05cddf9SRui Paulo wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
386f05cddf9SRui Paulo #endif /* CONFIG_P2P */
387f05cddf9SRui Paulo }
388f05cddf9SRui Paulo
389f05cddf9SRui Paulo
wpas_notify_network_removed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)390e28a4053SRui Paulo void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
391e28a4053SRui Paulo struct wpa_ssid *ssid)
392e28a4053SRui Paulo {
3935b9c547cSRui Paulo if (wpa_s->next_ssid == ssid)
3945b9c547cSRui Paulo wpa_s->next_ssid = NULL;
395*a90b9d01SCy Schubert if (wpa_s->last_ssid == ssid)
396*a90b9d01SCy Schubert wpa_s->last_ssid = NULL;
397*a90b9d01SCy Schubert if (wpa_s->current_ssid == ssid)
398*a90b9d01SCy Schubert wpa_s->current_ssid = NULL;
399*a90b9d01SCy Schubert if (wpa_s->ml_connect_probe_ssid == ssid) {
400*a90b9d01SCy Schubert wpa_s->ml_connect_probe_ssid = NULL;
401*a90b9d01SCy Schubert wpa_s->ml_connect_probe_bss = NULL;
402*a90b9d01SCy Schubert }
403*a90b9d01SCy Schubert if (wpa_s->connect_without_scan == ssid)
404*a90b9d01SCy Schubert wpa_s->connect_without_scan = NULL;
405*a90b9d01SCy Schubert #if defined(CONFIG_SME) && defined(CONFIG_SAE)
406*a90b9d01SCy Schubert if (wpa_s->sme.ext_auth_wpa_ssid == ssid)
407*a90b9d01SCy Schubert wpa_s->sme.ext_auth_wpa_ssid = NULL;
408*a90b9d01SCy Schubert #endif /* CONFIG_SME && CONFIG_SAE */
409*a90b9d01SCy Schubert if (wpa_s->wpa) {
410*a90b9d01SCy Schubert if ((wpa_key_mgmt_sae(ssid->key_mgmt) &&
411*a90b9d01SCy Schubert (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA)) ||
412*a90b9d01SCy Schubert ((ssid->key_mgmt & WPA_KEY_MGMT_OWE) &&
413*a90b9d01SCy Schubert (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_OWE_OFFLOAD_STA))) {
414*a90b9d01SCy Schubert /* For cases when PMK is generated at the driver */
415*a90b9d01SCy Schubert struct wpa_pmkid_params params;
416*a90b9d01SCy Schubert
417*a90b9d01SCy Schubert os_memset(¶ms, 0, sizeof(params));
418*a90b9d01SCy Schubert params.ssid = ssid->ssid;
419*a90b9d01SCy Schubert params.ssid_len = ssid->ssid_len;
420*a90b9d01SCy Schubert wpa_drv_remove_pmkid(wpa_s, ¶ms);
421*a90b9d01SCy Schubert }
422f05cddf9SRui Paulo wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
423*a90b9d01SCy Schubert }
424325151a3SRui Paulo if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s &&
4254b72b91aSCy Schubert !wpa_s->p2p_mgmt) {
426e28a4053SRui Paulo wpas_dbus_unregister_network(wpa_s, ssid->id);
4274b72b91aSCy Schubert wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_NETWORK_REMOVED "%d",
4284b72b91aSCy Schubert ssid->id);
4294b72b91aSCy Schubert }
4305b9c547cSRui Paulo if (network_is_persistent_group(ssid))
4315b9c547cSRui Paulo wpas_notify_persistent_group_removed(wpa_s, ssid);
4325b9c547cSRui Paulo
433f05cddf9SRui Paulo wpas_p2p_network_removed(wpa_s, ssid);
434e28a4053SRui Paulo }
435e28a4053SRui Paulo
436e28a4053SRui Paulo
wpas_notify_bss_added(struct wpa_supplicant * wpa_s,u8 bssid[],unsigned int id)437e28a4053SRui Paulo void wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
438e28a4053SRui Paulo u8 bssid[], unsigned int id)
439e28a4053SRui Paulo {
4405b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4415b9c547cSRui Paulo return;
4425b9c547cSRui Paulo
443e28a4053SRui Paulo wpas_dbus_register_bss(wpa_s, bssid, id);
444e28a4053SRui Paulo wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR,
445e28a4053SRui Paulo id, MAC2STR(bssid));
446e28a4053SRui Paulo }
447e28a4053SRui Paulo
448e28a4053SRui Paulo
wpas_notify_bss_removed(struct wpa_supplicant * wpa_s,u8 bssid[],unsigned int id)449e28a4053SRui Paulo void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
450e28a4053SRui Paulo u8 bssid[], unsigned int id)
451e28a4053SRui Paulo {
4525b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4535b9c547cSRui Paulo return;
4545b9c547cSRui Paulo
455e28a4053SRui Paulo wpas_dbus_unregister_bss(wpa_s, bssid, id);
456e28a4053SRui Paulo wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR,
457e28a4053SRui Paulo id, MAC2STR(bssid));
458e28a4053SRui Paulo }
459e28a4053SRui Paulo
460e28a4053SRui Paulo
wpas_notify_bss_freq_changed(struct wpa_supplicant * wpa_s,unsigned int id)461e28a4053SRui Paulo void wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
462e28a4053SRui Paulo unsigned int id)
463e28a4053SRui Paulo {
4645b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4655b9c547cSRui Paulo return;
4665b9c547cSRui Paulo
467e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
468e28a4053SRui Paulo }
469e28a4053SRui Paulo
470e28a4053SRui Paulo
wpas_notify_bss_signal_changed(struct wpa_supplicant * wpa_s,unsigned int id)471e28a4053SRui Paulo void wpas_notify_bss_signal_changed(struct wpa_supplicant *wpa_s,
472e28a4053SRui Paulo unsigned int id)
473e28a4053SRui Paulo {
4745b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4755b9c547cSRui Paulo return;
4765b9c547cSRui Paulo
477e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_SIGNAL,
478e28a4053SRui Paulo id);
479e28a4053SRui Paulo }
480e28a4053SRui Paulo
481e28a4053SRui Paulo
wpas_notify_bss_privacy_changed(struct wpa_supplicant * wpa_s,unsigned int id)482e28a4053SRui Paulo void wpas_notify_bss_privacy_changed(struct wpa_supplicant *wpa_s,
483e28a4053SRui Paulo unsigned int id)
484e28a4053SRui Paulo {
4855b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4865b9c547cSRui Paulo return;
4875b9c547cSRui Paulo
488e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_PRIVACY,
489e28a4053SRui Paulo id);
490e28a4053SRui Paulo }
491e28a4053SRui Paulo
492e28a4053SRui Paulo
wpas_notify_bss_mode_changed(struct wpa_supplicant * wpa_s,unsigned int id)493e28a4053SRui Paulo void wpas_notify_bss_mode_changed(struct wpa_supplicant *wpa_s,
494e28a4053SRui Paulo unsigned int id)
495e28a4053SRui Paulo {
4965b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
4975b9c547cSRui Paulo return;
4985b9c547cSRui Paulo
499e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_MODE, id);
500e28a4053SRui Paulo }
501e28a4053SRui Paulo
502e28a4053SRui Paulo
wpas_notify_bss_wpaie_changed(struct wpa_supplicant * wpa_s,unsigned int id)503e28a4053SRui Paulo void wpas_notify_bss_wpaie_changed(struct wpa_supplicant *wpa_s,
504e28a4053SRui Paulo unsigned int id)
505e28a4053SRui Paulo {
5065b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5075b9c547cSRui Paulo return;
5085b9c547cSRui Paulo
509e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPA, id);
510e28a4053SRui Paulo }
511e28a4053SRui Paulo
512e28a4053SRui Paulo
wpas_notify_bss_rsnie_changed(struct wpa_supplicant * wpa_s,unsigned int id)513e28a4053SRui Paulo void wpas_notify_bss_rsnie_changed(struct wpa_supplicant *wpa_s,
514e28a4053SRui Paulo unsigned int id)
515e28a4053SRui Paulo {
5165b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5175b9c547cSRui Paulo return;
5185b9c547cSRui Paulo
519e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RSN, id);
520e28a4053SRui Paulo }
521e28a4053SRui Paulo
522e28a4053SRui Paulo
wpas_notify_bss_wps_changed(struct wpa_supplicant * wpa_s,unsigned int id)523e28a4053SRui Paulo void wpas_notify_bss_wps_changed(struct wpa_supplicant *wpa_s,
524e28a4053SRui Paulo unsigned int id)
525e28a4053SRui Paulo {
5265b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5275b9c547cSRui Paulo return;
5285b9c547cSRui Paulo
529f05cddf9SRui Paulo #ifdef CONFIG_WPS
530f05cddf9SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPS, id);
531f05cddf9SRui Paulo #endif /* CONFIG_WPS */
532e28a4053SRui Paulo }
533e28a4053SRui Paulo
534e28a4053SRui Paulo
wpas_notify_bss_ies_changed(struct wpa_supplicant * wpa_s,unsigned int id)535e28a4053SRui Paulo void wpas_notify_bss_ies_changed(struct wpa_supplicant *wpa_s,
536e28a4053SRui Paulo unsigned int id)
537e28a4053SRui Paulo {
5385b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5395b9c547cSRui Paulo return;
5405b9c547cSRui Paulo
541e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_IES, id);
542e28a4053SRui Paulo }
543e28a4053SRui Paulo
544e28a4053SRui Paulo
wpas_notify_bss_rates_changed(struct wpa_supplicant * wpa_s,unsigned int id)545e28a4053SRui Paulo void wpas_notify_bss_rates_changed(struct wpa_supplicant *wpa_s,
546e28a4053SRui Paulo unsigned int id)
547e28a4053SRui Paulo {
5485b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5495b9c547cSRui Paulo return;
5505b9c547cSRui Paulo
551e28a4053SRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RATES, id);
552e28a4053SRui Paulo }
553e28a4053SRui Paulo
554e28a4053SRui Paulo
wpas_notify_bss_seen(struct wpa_supplicant * wpa_s,unsigned int id)5555b9c547cSRui Paulo void wpas_notify_bss_seen(struct wpa_supplicant *wpa_s, unsigned int id)
5565b9c547cSRui Paulo {
5575b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5585b9c547cSRui Paulo return;
5595b9c547cSRui Paulo
5605b9c547cSRui Paulo wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_AGE, id);
5615b9c547cSRui Paulo }
5625b9c547cSRui Paulo
5635b9c547cSRui Paulo
wpas_notify_bss_anqp_changed(struct wpa_supplicant * wpa_s,unsigned int id)564*a90b9d01SCy Schubert void wpas_notify_bss_anqp_changed(struct wpa_supplicant *wpa_s, unsigned int id)
565*a90b9d01SCy Schubert {
566*a90b9d01SCy Schubert if (wpa_s->p2p_mgmt)
567*a90b9d01SCy Schubert return;
568*a90b9d01SCy Schubert
569*a90b9d01SCy Schubert wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_ANQP, id);
570*a90b9d01SCy Schubert }
571*a90b9d01SCy Schubert
572*a90b9d01SCy Schubert
wpas_notify_blob_added(struct wpa_supplicant * wpa_s,const char * name)573e28a4053SRui Paulo void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
574e28a4053SRui Paulo {
5755b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5765b9c547cSRui Paulo return;
5775b9c547cSRui Paulo
578e28a4053SRui Paulo wpas_dbus_signal_blob_added(wpa_s, name);
579e28a4053SRui Paulo }
580e28a4053SRui Paulo
581e28a4053SRui Paulo
wpas_notify_blob_removed(struct wpa_supplicant * wpa_s,const char * name)582e28a4053SRui Paulo void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
583e28a4053SRui Paulo {
5845b9c547cSRui Paulo if (wpa_s->p2p_mgmt)
5855b9c547cSRui Paulo return;
5865b9c547cSRui Paulo
587e28a4053SRui Paulo wpas_dbus_signal_blob_removed(wpa_s, name);
588e28a4053SRui Paulo }
589e28a4053SRui Paulo
590e28a4053SRui Paulo
wpas_notify_debug_level_changed(struct wpa_global * global)591e28a4053SRui Paulo void wpas_notify_debug_level_changed(struct wpa_global *global)
592e28a4053SRui Paulo {
593e28a4053SRui Paulo wpas_dbus_signal_debug_level_changed(global);
594e28a4053SRui Paulo }
595e28a4053SRui Paulo
596e28a4053SRui Paulo
wpas_notify_debug_timestamp_changed(struct wpa_global * global)597e28a4053SRui Paulo void wpas_notify_debug_timestamp_changed(struct wpa_global *global)
598e28a4053SRui Paulo {
599e28a4053SRui Paulo wpas_dbus_signal_debug_timestamp_changed(global);
600e28a4053SRui Paulo }
601e28a4053SRui Paulo
602e28a4053SRui Paulo
wpas_notify_debug_show_keys_changed(struct wpa_global * global)603e28a4053SRui Paulo void wpas_notify_debug_show_keys_changed(struct wpa_global *global)
604e28a4053SRui Paulo {
605e28a4053SRui Paulo wpas_dbus_signal_debug_show_keys_changed(global);
606e28a4053SRui Paulo }
607e28a4053SRui Paulo
608e28a4053SRui Paulo
wpas_notify_suspend(struct wpa_global * global)609e28a4053SRui Paulo void wpas_notify_suspend(struct wpa_global *global)
610e28a4053SRui Paulo {
611e28a4053SRui Paulo struct wpa_supplicant *wpa_s;
612e28a4053SRui Paulo
613e28a4053SRui Paulo os_get_time(&global->suspend_time);
614e28a4053SRui Paulo wpa_printf(MSG_DEBUG, "System suspend notification");
615e28a4053SRui Paulo for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next)
616e28a4053SRui Paulo wpa_drv_suspend(wpa_s);
617e28a4053SRui Paulo }
618e28a4053SRui Paulo
619e28a4053SRui Paulo
wpas_notify_resume(struct wpa_global * global)620e28a4053SRui Paulo void wpas_notify_resume(struct wpa_global *global)
621e28a4053SRui Paulo {
622e28a4053SRui Paulo struct os_time now;
623e28a4053SRui Paulo int slept;
624e28a4053SRui Paulo struct wpa_supplicant *wpa_s;
625e28a4053SRui Paulo
626e28a4053SRui Paulo if (global->suspend_time.sec == 0)
627e28a4053SRui Paulo slept = -1;
628e28a4053SRui Paulo else {
629e28a4053SRui Paulo os_get_time(&now);
630e28a4053SRui Paulo slept = now.sec - global->suspend_time.sec;
631e28a4053SRui Paulo }
632e28a4053SRui Paulo wpa_printf(MSG_DEBUG, "System resume notification (slept %d seconds)",
633e28a4053SRui Paulo slept);
634e28a4053SRui Paulo
635e28a4053SRui Paulo for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
636e28a4053SRui Paulo wpa_drv_resume(wpa_s);
637e28a4053SRui Paulo if (wpa_s->wpa_state == WPA_DISCONNECTED)
638e28a4053SRui Paulo wpa_supplicant_req_scan(wpa_s, 0, 100000);
639e28a4053SRui Paulo }
640e28a4053SRui Paulo }
641f05cddf9SRui Paulo
642f05cddf9SRui Paulo
643f05cddf9SRui Paulo #ifdef CONFIG_P2P
644f05cddf9SRui Paulo
wpas_notify_p2p_find_stopped(struct wpa_supplicant * wpa_s)645325151a3SRui Paulo void wpas_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s)
646325151a3SRui Paulo {
647325151a3SRui Paulo /* Notify P2P find has stopped */
648325151a3SRui Paulo wpas_dbus_signal_p2p_find_stopped(wpa_s);
649325151a3SRui Paulo }
650325151a3SRui Paulo
651325151a3SRui Paulo
wpas_notify_p2p_device_found(struct wpa_supplicant * wpa_s,const u8 * dev_addr,int new_device)652f05cddf9SRui Paulo void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
653f05cddf9SRui Paulo const u8 *dev_addr, int new_device)
654f05cddf9SRui Paulo {
655f05cddf9SRui Paulo if (new_device) {
656f05cddf9SRui Paulo /* Create the new peer object */
657f05cddf9SRui Paulo wpas_dbus_register_peer(wpa_s, dev_addr);
658f05cddf9SRui Paulo }
659f05cddf9SRui Paulo
660f05cddf9SRui Paulo /* Notify a new peer has been detected*/
661f05cddf9SRui Paulo wpas_dbus_signal_peer_device_found(wpa_s, dev_addr);
662f05cddf9SRui Paulo }
663f05cddf9SRui Paulo
664f05cddf9SRui Paulo
wpas_notify_p2p_device_lost(struct wpa_supplicant * wpa_s,const u8 * dev_addr)665f05cddf9SRui Paulo void wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,
666f05cddf9SRui Paulo const u8 *dev_addr)
667f05cddf9SRui Paulo {
668f05cddf9SRui Paulo wpas_dbus_unregister_peer(wpa_s, dev_addr);
669f05cddf9SRui Paulo
670f05cddf9SRui Paulo /* Create signal on interface object*/
671f05cddf9SRui Paulo wpas_dbus_signal_peer_device_lost(wpa_s, dev_addr);
672f05cddf9SRui Paulo }
673f05cddf9SRui Paulo
674f05cddf9SRui Paulo
wpas_notify_p2p_group_removed(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,const char * role)675f05cddf9SRui Paulo void wpas_notify_p2p_group_removed(struct wpa_supplicant *wpa_s,
676f05cddf9SRui Paulo const struct wpa_ssid *ssid,
677f05cddf9SRui Paulo const char *role)
678f05cddf9SRui Paulo {
679f05cddf9SRui Paulo wpas_dbus_signal_p2p_group_removed(wpa_s, role);
6805b9c547cSRui Paulo
6815b9c547cSRui Paulo wpas_dbus_unregister_p2p_group(wpa_s, ssid);
682f05cddf9SRui Paulo }
683f05cddf9SRui Paulo
684f05cddf9SRui Paulo
wpas_notify_p2p_go_neg_req(struct wpa_supplicant * wpa_s,const u8 * src,u16 dev_passwd_id,u8 go_intent)685f05cddf9SRui Paulo void wpas_notify_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
686325151a3SRui Paulo const u8 *src, u16 dev_passwd_id, u8 go_intent)
687f05cddf9SRui Paulo {
688325151a3SRui Paulo wpas_dbus_signal_p2p_go_neg_req(wpa_s, src, dev_passwd_id, go_intent);
689f05cddf9SRui Paulo }
690f05cddf9SRui Paulo
691f05cddf9SRui Paulo
wpas_notify_p2p_go_neg_completed(struct wpa_supplicant * wpa_s,struct p2p_go_neg_results * res)692f05cddf9SRui Paulo void wpas_notify_p2p_go_neg_completed(struct wpa_supplicant *wpa_s,
693f05cddf9SRui Paulo struct p2p_go_neg_results *res)
694f05cddf9SRui Paulo {
695f05cddf9SRui Paulo wpas_dbus_signal_p2p_go_neg_resp(wpa_s, res);
696f05cddf9SRui Paulo }
697f05cddf9SRui Paulo
698f05cddf9SRui Paulo
wpas_notify_p2p_invitation_result(struct wpa_supplicant * wpa_s,int status,const u8 * bssid)699f05cddf9SRui Paulo void wpas_notify_p2p_invitation_result(struct wpa_supplicant *wpa_s,
700f05cddf9SRui Paulo int status, const u8 *bssid)
701f05cddf9SRui Paulo {
702f05cddf9SRui Paulo wpas_dbus_signal_p2p_invitation_result(wpa_s, status, bssid);
703f05cddf9SRui Paulo }
704f05cddf9SRui Paulo
705f05cddf9SRui Paulo
wpas_notify_p2p_sd_request(struct wpa_supplicant * wpa_s,int freq,const u8 * sa,u8 dialog_token,u16 update_indic,const u8 * tlvs,size_t tlvs_len)706f05cddf9SRui Paulo void wpas_notify_p2p_sd_request(struct wpa_supplicant *wpa_s,
707f05cddf9SRui Paulo int freq, const u8 *sa, u8 dialog_token,
708f05cddf9SRui Paulo u16 update_indic, const u8 *tlvs,
709f05cddf9SRui Paulo size_t tlvs_len)
710f05cddf9SRui Paulo {
711f05cddf9SRui Paulo wpas_dbus_signal_p2p_sd_request(wpa_s, freq, sa, dialog_token,
712f05cddf9SRui Paulo update_indic, tlvs, tlvs_len);
713f05cddf9SRui Paulo }
714f05cddf9SRui Paulo
715f05cddf9SRui Paulo
wpas_notify_p2p_sd_response(struct wpa_supplicant * wpa_s,const u8 * sa,u16 update_indic,const u8 * tlvs,size_t tlvs_len)716f05cddf9SRui Paulo void wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
717f05cddf9SRui Paulo const u8 *sa, u16 update_indic,
718f05cddf9SRui Paulo const u8 *tlvs, size_t tlvs_len)
719f05cddf9SRui Paulo {
720f05cddf9SRui Paulo wpas_dbus_signal_p2p_sd_response(wpa_s, sa, update_indic,
721f05cddf9SRui Paulo tlvs, tlvs_len);
722f05cddf9SRui Paulo }
723f05cddf9SRui Paulo
724f05cddf9SRui Paulo
725f05cddf9SRui Paulo /**
726f05cddf9SRui Paulo * wpas_notify_p2p_provision_discovery - Notification of provision discovery
727f05cddf9SRui Paulo * @dev_addr: Who sent the request or responded to our request.
728f05cddf9SRui Paulo * @request: Will be 1 if request, 0 for response.
729f05cddf9SRui Paulo * @status: Valid only in case of response (0 in case of success)
730f05cddf9SRui Paulo * @config_methods: WPS config methods
731f05cddf9SRui Paulo * @generated_pin: PIN to be displayed in case of WPS_CONFIG_DISPLAY method
732f05cddf9SRui Paulo *
733f05cddf9SRui Paulo * This can be used to notify:
734f05cddf9SRui Paulo * - Requests or responses
735f05cddf9SRui Paulo * - Various config methods
736f05cddf9SRui Paulo * - Failure condition in case of response
737f05cddf9SRui Paulo */
wpas_notify_p2p_provision_discovery(struct wpa_supplicant * wpa_s,const u8 * dev_addr,int request,enum p2p_prov_disc_status status,u16 config_methods,unsigned int generated_pin)738f05cddf9SRui Paulo void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
739f05cddf9SRui Paulo const u8 *dev_addr, int request,
740f05cddf9SRui Paulo enum p2p_prov_disc_status status,
741f05cddf9SRui Paulo u16 config_methods,
742f05cddf9SRui Paulo unsigned int generated_pin)
743f05cddf9SRui Paulo {
744f05cddf9SRui Paulo wpas_dbus_signal_p2p_provision_discovery(wpa_s, dev_addr, request,
745f05cddf9SRui Paulo status, config_methods,
746f05cddf9SRui Paulo generated_pin);
747f05cddf9SRui Paulo }
748f05cddf9SRui Paulo
749f05cddf9SRui Paulo
wpas_notify_p2p_group_started(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,int persistent,int client,const u8 * ip)750f05cddf9SRui Paulo void wpas_notify_p2p_group_started(struct wpa_supplicant *wpa_s,
751780fb4a2SCy Schubert struct wpa_ssid *ssid, int persistent,
75285732ac8SCy Schubert int client, const u8 *ip)
753f05cddf9SRui Paulo {
754f05cddf9SRui Paulo /* Notify a group has been started */
755f05cddf9SRui Paulo wpas_dbus_register_p2p_group(wpa_s, ssid);
756f05cddf9SRui Paulo
75785732ac8SCy Schubert wpas_dbus_signal_p2p_group_started(wpa_s, client, persistent, ip);
758f05cddf9SRui Paulo }
759f05cddf9SRui Paulo
760f05cddf9SRui Paulo
wpas_notify_p2p_group_formation_failure(struct wpa_supplicant * wpa_s,const char * reason)761325151a3SRui Paulo void wpas_notify_p2p_group_formation_failure(struct wpa_supplicant *wpa_s,
762325151a3SRui Paulo const char *reason)
763325151a3SRui Paulo {
764325151a3SRui Paulo /* Notify a group formation failed */
765325151a3SRui Paulo wpas_dbus_signal_p2p_group_formation_failure(wpa_s, reason);
766325151a3SRui Paulo }
767325151a3SRui Paulo
768325151a3SRui Paulo
wpas_notify_p2p_wps_failed(struct wpa_supplicant * wpa_s,struct wps_event_fail * fail)769f05cddf9SRui Paulo void wpas_notify_p2p_wps_failed(struct wpa_supplicant *wpa_s,
770f05cddf9SRui Paulo struct wps_event_fail *fail)
771f05cddf9SRui Paulo {
772f05cddf9SRui Paulo wpas_dbus_signal_p2p_wps_failed(wpa_s, fail);
773f05cddf9SRui Paulo }
774f05cddf9SRui Paulo
775325151a3SRui Paulo
wpas_notify_p2p_invitation_received(struct wpa_supplicant * wpa_s,const u8 * sa,const u8 * go_dev_addr,const u8 * bssid,int id,int op_freq)776325151a3SRui Paulo void wpas_notify_p2p_invitation_received(struct wpa_supplicant *wpa_s,
777325151a3SRui Paulo const u8 *sa, const u8 *go_dev_addr,
778325151a3SRui Paulo const u8 *bssid, int id, int op_freq)
779325151a3SRui Paulo {
780325151a3SRui Paulo /* Notify a P2P Invitation Request */
781325151a3SRui Paulo wpas_dbus_signal_p2p_invitation_received(wpa_s, sa, go_dev_addr, bssid,
782325151a3SRui Paulo id, op_freq);
783325151a3SRui Paulo }
784325151a3SRui Paulo
785f05cddf9SRui Paulo #endif /* CONFIG_P2P */
786f05cddf9SRui Paulo
787f05cddf9SRui Paulo
wpas_notify_ap_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr,const u8 * ip)788f05cddf9SRui Paulo static void wpas_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
789f05cddf9SRui Paulo const u8 *sta,
790*a90b9d01SCy Schubert const u8 *p2p_dev_addr, const u8 *ip)
791f05cddf9SRui Paulo {
792f05cddf9SRui Paulo #ifdef CONFIG_P2P
793f05cddf9SRui Paulo wpas_p2p_notify_ap_sta_authorized(wpa_s, p2p_dev_addr);
794f05cddf9SRui Paulo
795f05cddf9SRui Paulo /*
796f05cddf9SRui Paulo * Create 'peer-joined' signal on group object -- will also
797f05cddf9SRui Paulo * check P2P itself.
798f05cddf9SRui Paulo */
7995b9c547cSRui Paulo if (p2p_dev_addr)
8005b9c547cSRui Paulo wpas_dbus_signal_p2p_peer_joined(wpa_s, p2p_dev_addr);
801f05cddf9SRui Paulo #endif /* CONFIG_P2P */
8025b9c547cSRui Paulo
8034bc52338SCy Schubert /* Register the station */
8044bc52338SCy Schubert wpas_dbus_register_sta(wpa_s, sta);
8054bc52338SCy Schubert
8065b9c547cSRui Paulo /* Notify listeners a new station has been authorized */
8075b9c547cSRui Paulo wpas_dbus_signal_sta_authorized(wpa_s, sta);
808f05cddf9SRui Paulo }
809f05cddf9SRui Paulo
810f05cddf9SRui Paulo
wpas_notify_ap_sta_deauthorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)811f05cddf9SRui Paulo static void wpas_notify_ap_sta_deauthorized(struct wpa_supplicant *wpa_s,
8125b9c547cSRui Paulo const u8 *sta,
8135b9c547cSRui Paulo const u8 *p2p_dev_addr)
814f05cddf9SRui Paulo {
815f05cddf9SRui Paulo #ifdef CONFIG_P2P
816f05cddf9SRui Paulo /*
817f05cddf9SRui Paulo * Create 'peer-disconnected' signal on group object if this
818f05cddf9SRui Paulo * is a P2P group.
819f05cddf9SRui Paulo */
8205b9c547cSRui Paulo if (p2p_dev_addr)
8215b9c547cSRui Paulo wpas_dbus_signal_p2p_peer_disconnected(wpa_s, p2p_dev_addr);
822f05cddf9SRui Paulo #endif /* CONFIG_P2P */
8235b9c547cSRui Paulo
8245b9c547cSRui Paulo /* Notify listeners a station has been deauthorized */
8255b9c547cSRui Paulo wpas_dbus_signal_sta_deauthorized(wpa_s, sta);
8264bc52338SCy Schubert
8274bc52338SCy Schubert /* Unregister the station */
8284bc52338SCy Schubert wpas_dbus_unregister_sta(wpa_s, sta);
829f05cddf9SRui Paulo }
830f05cddf9SRui Paulo
831f05cddf9SRui Paulo
wpas_notify_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * mac_addr,int authorized,const u8 * p2p_dev_addr,const u8 * ip)832f05cddf9SRui Paulo void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
833f05cddf9SRui Paulo const u8 *mac_addr, int authorized,
834*a90b9d01SCy Schubert const u8 *p2p_dev_addr, const u8 *ip)
835f05cddf9SRui Paulo {
836f05cddf9SRui Paulo if (authorized)
837*a90b9d01SCy Schubert wpas_notify_ap_sta_authorized(wpa_s, mac_addr, p2p_dev_addr,
838*a90b9d01SCy Schubert ip);
839f05cddf9SRui Paulo else
8405b9c547cSRui Paulo wpas_notify_ap_sta_deauthorized(wpa_s, mac_addr, p2p_dev_addr);
841f05cddf9SRui Paulo }
842f05cddf9SRui Paulo
843f05cddf9SRui Paulo
wpas_notify_certification(struct wpa_supplicant * wpa_s,struct tls_cert_data * cert,const char * cert_hash)844206b73d0SCy Schubert void wpas_notify_certification(struct wpa_supplicant *wpa_s,
845206b73d0SCy Schubert struct tls_cert_data *cert,
846206b73d0SCy Schubert const char *cert_hash)
847f05cddf9SRui Paulo {
848206b73d0SCy Schubert int i;
849f05cddf9SRui Paulo
850206b73d0SCy Schubert wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT
851c1d255d3SCy Schubert "depth=%d subject='%s'%s%s%s%s",
852206b73d0SCy Schubert cert->depth, cert->subject, cert_hash ? " hash=" : "",
853206b73d0SCy Schubert cert_hash ? cert_hash : "",
854c1d255d3SCy Schubert cert->tod == 2 ? " tod=2" : "",
855c1d255d3SCy Schubert cert->tod == 1 ? " tod=1" : "");
856206b73d0SCy Schubert
857206b73d0SCy Schubert if (cert->cert) {
858f05cddf9SRui Paulo char *cert_hex;
859206b73d0SCy Schubert size_t len = wpabuf_len(cert->cert) * 2 + 1;
860f05cddf9SRui Paulo cert_hex = os_malloc(len);
861f05cddf9SRui Paulo if (cert_hex) {
862206b73d0SCy Schubert wpa_snprintf_hex(cert_hex, len, wpabuf_head(cert->cert),
863206b73d0SCy Schubert wpabuf_len(cert->cert));
864f05cddf9SRui Paulo wpa_msg_ctrl(wpa_s, MSG_INFO,
865f05cddf9SRui Paulo WPA_EVENT_EAP_PEER_CERT
866f05cddf9SRui Paulo "depth=%d subject='%s' cert=%s",
867206b73d0SCy Schubert cert->depth, cert->subject, cert_hex);
868f05cddf9SRui Paulo os_free(cert_hex);
869f05cddf9SRui Paulo }
870f05cddf9SRui Paulo }
871f05cddf9SRui Paulo
872206b73d0SCy Schubert for (i = 0; i < cert->num_altsubject; i++)
8735b9c547cSRui Paulo wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_ALT
874206b73d0SCy Schubert "depth=%d %s", cert->depth, cert->altsubject[i]);
8755b9c547cSRui Paulo
876f05cddf9SRui Paulo /* notify the new DBus API */
877206b73d0SCy Schubert wpas_dbus_signal_certification(wpa_s, cert->depth, cert->subject,
878206b73d0SCy Schubert cert->altsubject, cert->num_altsubject,
879206b73d0SCy Schubert cert_hash, cert->cert);
880f05cddf9SRui Paulo }
881f05cddf9SRui Paulo
882f05cddf9SRui Paulo
wpas_notify_preq(struct wpa_supplicant * wpa_s,const u8 * addr,const u8 * dst,const u8 * bssid,const u8 * ie,size_t ie_len,u32 ssi_signal)883f05cddf9SRui Paulo void wpas_notify_preq(struct wpa_supplicant *wpa_s,
884f05cddf9SRui Paulo const u8 *addr, const u8 *dst, const u8 *bssid,
885f05cddf9SRui Paulo const u8 *ie, size_t ie_len, u32 ssi_signal)
886f05cddf9SRui Paulo {
887f05cddf9SRui Paulo #ifdef CONFIG_AP
888f05cddf9SRui Paulo wpas_dbus_signal_preq(wpa_s, addr, dst, bssid, ie, ie_len, ssi_signal);
889f05cddf9SRui Paulo #endif /* CONFIG_AP */
890f05cddf9SRui Paulo }
891f05cddf9SRui Paulo
892f05cddf9SRui Paulo
wpas_notify_eap_status(struct wpa_supplicant * wpa_s,const char * status,const char * parameter)893f05cddf9SRui Paulo void wpas_notify_eap_status(struct wpa_supplicant *wpa_s, const char *status,
894f05cddf9SRui Paulo const char *parameter)
895f05cddf9SRui Paulo {
896f05cddf9SRui Paulo wpas_dbus_signal_eap_status(wpa_s, status, parameter);
8975b9c547cSRui Paulo wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_STATUS
8985b9c547cSRui Paulo "status='%s' parameter='%s'",
8995b9c547cSRui Paulo status, parameter);
9005b9c547cSRui Paulo }
9015b9c547cSRui Paulo
9025b9c547cSRui Paulo
wpas_notify_eap_error(struct wpa_supplicant * wpa_s,int error_code)90385732ac8SCy Schubert void wpas_notify_eap_error(struct wpa_supplicant *wpa_s, int error_code)
90485732ac8SCy Schubert {
90585732ac8SCy Schubert wpa_msg(wpa_s, MSG_ERROR, WPA_EVENT_EAP_ERROR_CODE "%d", error_code);
90685732ac8SCy Schubert }
90785732ac8SCy Schubert
90885732ac8SCy Schubert
wpas_notify_psk_mismatch(struct wpa_supplicant * wpa_s)909*a90b9d01SCy Schubert void wpas_notify_psk_mismatch(struct wpa_supplicant *wpa_s)
910*a90b9d01SCy Schubert {
911*a90b9d01SCy Schubert wpas_dbus_signal_psk_mismatch(wpa_s);
912*a90b9d01SCy Schubert }
913*a90b9d01SCy Schubert
914*a90b9d01SCy Schubert
wpas_notify_network_bssid_set_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)9155b9c547cSRui Paulo void wpas_notify_network_bssid_set_changed(struct wpa_supplicant *wpa_s,
9165b9c547cSRui Paulo struct wpa_ssid *ssid)
9175b9c547cSRui Paulo {
9185b9c547cSRui Paulo if (wpa_s->current_ssid != ssid)
9195b9c547cSRui Paulo return;
9205b9c547cSRui Paulo
9215b9c547cSRui Paulo wpa_dbg(wpa_s, MSG_DEBUG,
9225b9c547cSRui Paulo "Network bssid config changed for the current network - within-ESS roaming %s",
9235b9c547cSRui Paulo ssid->bssid_set ? "disabled" : "enabled");
9245b9c547cSRui Paulo
9255b9c547cSRui Paulo wpa_drv_roaming(wpa_s, !ssid->bssid_set,
9265b9c547cSRui Paulo ssid->bssid_set ? ssid->bssid : NULL);
9275b9c547cSRui Paulo }
9285b9c547cSRui Paulo
9295b9c547cSRui Paulo
wpas_notify_network_type_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)9305b9c547cSRui Paulo void wpas_notify_network_type_changed(struct wpa_supplicant *wpa_s,
9315b9c547cSRui Paulo struct wpa_ssid *ssid)
9325b9c547cSRui Paulo {
9335b9c547cSRui Paulo #ifdef CONFIG_P2P
9345b9c547cSRui Paulo if (ssid->disabled == 2) {
9355b9c547cSRui Paulo /* Changed from normal network profile to persistent group */
9365b9c547cSRui Paulo ssid->disabled = 0;
9375b9c547cSRui Paulo wpas_dbus_unregister_network(wpa_s, ssid->id);
9385b9c547cSRui Paulo ssid->disabled = 2;
939325151a3SRui Paulo ssid->p2p_persistent_group = 1;
9405b9c547cSRui Paulo wpas_dbus_register_persistent_group(wpa_s, ssid);
9415b9c547cSRui Paulo } else {
9425b9c547cSRui Paulo /* Changed from persistent group to normal network profile */
9435b9c547cSRui Paulo wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
944325151a3SRui Paulo ssid->p2p_persistent_group = 0;
9455b9c547cSRui Paulo wpas_dbus_register_network(wpa_s, ssid);
9465b9c547cSRui Paulo }
9475b9c547cSRui Paulo #endif /* CONFIG_P2P */
948f05cddf9SRui Paulo }
94985732ac8SCy Schubert
95085732ac8SCy Schubert
95185732ac8SCy Schubert #ifdef CONFIG_MESH
95285732ac8SCy Schubert
wpas_notify_mesh_group_started(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)95385732ac8SCy Schubert void wpas_notify_mesh_group_started(struct wpa_supplicant *wpa_s,
95485732ac8SCy Schubert struct wpa_ssid *ssid)
95585732ac8SCy Schubert {
95685732ac8SCy Schubert if (wpa_s->p2p_mgmt)
95785732ac8SCy Schubert return;
95885732ac8SCy Schubert
95985732ac8SCy Schubert wpas_dbus_signal_mesh_group_started(wpa_s, ssid);
96085732ac8SCy Schubert }
96185732ac8SCy Schubert
96285732ac8SCy Schubert
wpas_notify_mesh_group_removed(struct wpa_supplicant * wpa_s,const u8 * meshid,u8 meshid_len,u16 reason_code)96385732ac8SCy Schubert void wpas_notify_mesh_group_removed(struct wpa_supplicant *wpa_s,
96485732ac8SCy Schubert const u8 *meshid, u8 meshid_len,
965206b73d0SCy Schubert u16 reason_code)
96685732ac8SCy Schubert {
96785732ac8SCy Schubert if (wpa_s->p2p_mgmt)
96885732ac8SCy Schubert return;
96985732ac8SCy Schubert
97085732ac8SCy Schubert wpas_dbus_signal_mesh_group_removed(wpa_s, meshid, meshid_len,
97185732ac8SCy Schubert reason_code);
97285732ac8SCy Schubert }
97385732ac8SCy Schubert
97485732ac8SCy Schubert
wpas_notify_mesh_peer_connected(struct wpa_supplicant * wpa_s,const u8 * peer_addr)97585732ac8SCy Schubert void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
97685732ac8SCy Schubert const u8 *peer_addr)
97785732ac8SCy Schubert {
97885732ac8SCy Schubert if (wpa_s->p2p_mgmt)
97985732ac8SCy Schubert return;
98085732ac8SCy Schubert
981*a90b9d01SCy Schubert wpa_msg(wpa_s, MSG_INFO, MESH_PEER_CONNECTED MACSTR,
982*a90b9d01SCy Schubert MAC2STR(peer_addr));
98385732ac8SCy Schubert wpas_dbus_signal_mesh_peer_connected(wpa_s, peer_addr);
98485732ac8SCy Schubert }
98585732ac8SCy Schubert
98685732ac8SCy Schubert
wpas_notify_mesh_peer_disconnected(struct wpa_supplicant * wpa_s,const u8 * peer_addr,u16 reason_code)98785732ac8SCy Schubert void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
988206b73d0SCy Schubert const u8 *peer_addr, u16 reason_code)
98985732ac8SCy Schubert {
99085732ac8SCy Schubert if (wpa_s->p2p_mgmt)
99185732ac8SCy Schubert return;
99285732ac8SCy Schubert
993*a90b9d01SCy Schubert wpa_msg(wpa_s, MSG_INFO, MESH_PEER_DISCONNECTED MACSTR,
994*a90b9d01SCy Schubert MAC2STR(peer_addr));
99585732ac8SCy Schubert wpas_dbus_signal_mesh_peer_disconnected(wpa_s, peer_addr, reason_code);
99685732ac8SCy Schubert }
99785732ac8SCy Schubert
99885732ac8SCy Schubert #endif /* CONFIG_MESH */
99932a95656SCy Schubert
100032a95656SCy Schubert
100132a95656SCy Schubert #ifdef CONFIG_INTERWORKING
100232a95656SCy Schubert
wpas_notify_interworking_ap_added(struct wpa_supplicant * wpa_s,struct wpa_bss * bss,struct wpa_cred * cred,int excluded,const char * type,int bh,int bss_load,int conn_capab)100332a95656SCy Schubert void wpas_notify_interworking_ap_added(struct wpa_supplicant *wpa_s,
100432a95656SCy Schubert struct wpa_bss *bss,
100532a95656SCy Schubert struct wpa_cred *cred, int excluded,
100632a95656SCy Schubert const char *type, int bh, int bss_load,
100732a95656SCy Schubert int conn_capab)
100832a95656SCy Schubert {
100932a95656SCy Schubert wpa_msg(wpa_s, MSG_INFO, "%s" MACSTR " type=%s%s%s%s id=%d priority=%d sp_priority=%d",
101032a95656SCy Schubert excluded ? INTERWORKING_EXCLUDED : INTERWORKING_AP,
101132a95656SCy Schubert MAC2STR(bss->bssid), type,
101232a95656SCy Schubert bh ? " below_min_backhaul=1" : "",
101332a95656SCy Schubert bss_load ? " over_max_bss_load=1" : "",
101432a95656SCy Schubert conn_capab ? " conn_capab_missing=1" : "",
101532a95656SCy Schubert cred->id, cred->priority, cred->sp_priority);
101632a95656SCy Schubert
101732a95656SCy Schubert wpas_dbus_signal_interworking_ap_added(wpa_s, bss, cred, type, excluded,
101832a95656SCy Schubert bh, bss_load, conn_capab);
101932a95656SCy Schubert }
102032a95656SCy Schubert
102132a95656SCy Schubert
wpas_notify_interworking_select_done(struct wpa_supplicant * wpa_s)102232a95656SCy Schubert void wpas_notify_interworking_select_done(struct wpa_supplicant *wpa_s)
102332a95656SCy Schubert {
102432a95656SCy Schubert wpas_dbus_signal_interworking_select_done(wpa_s);
102532a95656SCy Schubert }
102632a95656SCy Schubert
1027*a90b9d01SCy Schubert
wpas_notify_anqp_query_done(struct wpa_supplicant * wpa_s,const u8 * dst,const char * result)1028*a90b9d01SCy Schubert void wpas_notify_anqp_query_done(struct wpa_supplicant *wpa_s,
1029*a90b9d01SCy Schubert const u8 *dst, const char *result)
1030*a90b9d01SCy Schubert {
1031*a90b9d01SCy Schubert wpa_msg(wpa_s, MSG_INFO, ANQP_QUERY_DONE "addr=" MACSTR " result=%s",
1032*a90b9d01SCy Schubert MAC2STR(dst), result);
1033*a90b9d01SCy Schubert
1034*a90b9d01SCy Schubert wpas_dbus_signal_anqp_query_done(wpa_s, dst, result);
1035*a90b9d01SCy Schubert }
1036*a90b9d01SCy Schubert
103732a95656SCy Schubert #endif /* CONFIG_INTERWORKING */
1038*a90b9d01SCy Schubert
1039*a90b9d01SCy Schubert
wpas_notify_pmk_cache_added(struct wpa_supplicant * wpa_s,struct rsn_pmksa_cache_entry * entry)1040*a90b9d01SCy Schubert void wpas_notify_pmk_cache_added(struct wpa_supplicant *wpa_s,
1041*a90b9d01SCy Schubert struct rsn_pmksa_cache_entry *entry)
1042*a90b9d01SCy Schubert {
1043*a90b9d01SCy Schubert /* TODO: Notify external entities of the added PMKSA cache entry */
1044*a90b9d01SCy Schubert }
1045*a90b9d01SCy Schubert
1046*a90b9d01SCy Schubert
wpas_notify_signal_change(struct wpa_supplicant * wpa_s)1047*a90b9d01SCy Schubert void wpas_notify_signal_change(struct wpa_supplicant *wpa_s)
1048*a90b9d01SCy Schubert {
1049*a90b9d01SCy Schubert wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SIGNAL_CHANGE);
1050*a90b9d01SCy Schubert }
1051*a90b9d01SCy Schubert
1052*a90b9d01SCy Schubert
1053*a90b9d01SCy Schubert #ifdef CONFIG_HS20
wpas_notify_hs20_t_c_acceptance(struct wpa_supplicant * wpa_s,const char * url)1054*a90b9d01SCy Schubert void wpas_notify_hs20_t_c_acceptance(struct wpa_supplicant *wpa_s,
1055*a90b9d01SCy Schubert const char *url)
1056*a90b9d01SCy Schubert {
1057*a90b9d01SCy Schubert wpa_msg(wpa_s, MSG_INFO, HS20_T_C_ACCEPTANCE "%s", url);
1058*a90b9d01SCy Schubert wpas_dbus_signal_hs20_t_c_acceptance(wpa_s, url);
1059*a90b9d01SCy Schubert }
1060*a90b9d01SCy Schubert #endif /* CONFIG_HS20 */
1061