• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * wpa_supplicant - Event notifications
3  * Copyright (c) 2009-2010, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #include "utils/includes.h"
10 
11 #include "utils/common.h"
12 #include "common/wpa_ctrl.h"
13 #include "config.h"
14 #include "wpa_supplicant_i.h"
15 #include "wps_supplicant.h"
16 #include "dbus/dbus_common.h"
17 #include "dbus/dbus_new.h"
18 #include "rsn_supp/wpa.h"
19 #include "fst/fst.h"
20 #include "crypto/tls.h"
21 #include "driver_i.h"
22 #include "scan.h"
23 #include "p2p_supplicant.h"
24 #include "sme.h"
25 #include "notify.h"
26 #include "hidl.h"
27 
wpas_notify_supplicant_initialized(struct wpa_global * global)28 int wpas_notify_supplicant_initialized(struct wpa_global *global)
29 {
30 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
31 	if (global->params.dbus_ctrl_interface) {
32 		global->dbus = wpas_dbus_init(global);
33 		if (global->dbus == NULL)
34 			return -1;
35 	}
36 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
37 
38 #ifdef CONFIG_HIDL
39 	global->hidl = wpas_hidl_init(global);
40 	if (!global->hidl)
41 		return -1;
42 #endif /* CONFIG_HIDL */
43 
44 	return 0;
45 }
46 
47 
wpas_notify_supplicant_deinitialized(struct wpa_global * global)48 void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
49 {
50 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
51 	if (global->dbus)
52 		wpas_dbus_deinit(global->dbus);
53 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
54 
55 #ifdef CONFIG_HIDL
56 	if (global->hidl)
57 		wpas_hidl_deinit(global->hidl);
58 #endif /* CONFIG_HIDL */
59 }
60 
61 
wpas_notify_iface_added(struct wpa_supplicant * wpa_s)62 int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
63 {
64 	if (!wpa_s->p2p_mgmt) {
65 		if (wpas_dbus_register_interface(wpa_s))
66 			return -1;
67 	}
68 
69 	/* HIDL interface wants to keep track of the P2P mgmt iface. */
70 	if (wpas_hidl_register_interface(wpa_s))
71 		return -1;
72 
73 	return 0;
74 }
75 
76 
wpas_notify_iface_removed(struct wpa_supplicant * wpa_s)77 void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
78 {
79 	if (!wpa_s->p2p_mgmt) {
80 		/* unregister interface in new DBus ctrl iface */
81 		wpas_dbus_unregister_interface(wpa_s);
82 	}
83 
84 	/* HIDL interface wants to keep track of the P2P mgmt iface. */
85 	wpas_hidl_unregister_interface(wpa_s);
86 }
87 
88 
wpas_notify_state_changed(struct wpa_supplicant * wpa_s,enum wpa_states new_state,enum wpa_states old_state)89 void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
90 			       enum wpa_states new_state,
91 			       enum wpa_states old_state)
92 {
93 	if (wpa_s->p2p_mgmt)
94 		return;
95 
96 	/* notify the new DBus API */
97 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_STATE);
98 
99 #ifdef CONFIG_FST
100 	if (wpa_s->fst && !is_zero_ether_addr(wpa_s->bssid)) {
101 		if (new_state == WPA_COMPLETED)
102 			fst_notify_peer_connected(wpa_s->fst, wpa_s->bssid);
103 		else if (old_state >= WPA_ASSOCIATED &&
104 			 new_state < WPA_ASSOCIATED)
105 			fst_notify_peer_disconnected(wpa_s->fst, wpa_s->bssid);
106 	}
107 #endif /* CONFIG_FST */
108 
109 	if (new_state == WPA_COMPLETED)
110 		wpas_p2p_notif_connected(wpa_s);
111 	else if (old_state >= WPA_ASSOCIATED && new_state < WPA_ASSOCIATED)
112 		wpas_p2p_notif_disconnected(wpa_s);
113 
114 	sme_state_changed(wpa_s);
115 
116 #ifdef ANDROID
117 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_STATE_CHANGE
118 		     "id=%d state=%d BSSID=" MACSTR " SSID=%s",
119 		     wpa_s->current_ssid ? wpa_s->current_ssid->id : -1,
120 		     new_state,
121 		     MAC2STR(wpa_s->bssid),
122 		     wpa_s->current_ssid && wpa_s->current_ssid->ssid ?
123 		     wpa_ssid_txt(wpa_s->current_ssid->ssid,
124 				  wpa_s->current_ssid->ssid_len) : "");
125 #endif /* ANDROID */
126 
127 	wpas_hidl_notify_state_changed(wpa_s);
128 }
129 
130 
wpas_notify_disconnect_reason(struct wpa_supplicant * wpa_s)131 void wpas_notify_disconnect_reason(struct wpa_supplicant *wpa_s)
132 {
133 	if (wpa_s->p2p_mgmt)
134 		return;
135 
136 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_DISCONNECT_REASON);
137 
138 	wpas_hidl_notify_disconnect_reason(wpa_s);
139 }
140 
141 
wpas_notify_auth_status_code(struct wpa_supplicant * wpa_s)142 void wpas_notify_auth_status_code(struct wpa_supplicant *wpa_s)
143 {
144 	if (wpa_s->p2p_mgmt)
145 		return;
146 
147 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AUTH_STATUS_CODE);
148 }
149 
150 
wpas_notify_assoc_status_code(struct wpa_supplicant * wpa_s,const u8 * bssid,u8 timed_out)151 void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s,
152 				   const u8 *bssid, u8 timed_out)
153 {
154 	if (wpa_s->p2p_mgmt)
155 		return;
156 
157 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ASSOC_STATUS_CODE);
158 
159 	wpas_hidl_notify_assoc_reject(wpa_s, bssid, timed_out);
160 }
161 
wpas_notify_auth_timeout(struct wpa_supplicant * wpa_s)162 void wpas_notify_auth_timeout(struct wpa_supplicant *wpa_s) {
163 	if (wpa_s->p2p_mgmt)
164 		return;
165 
166 	wpas_hidl_notify_auth_timeout(wpa_s);
167 }
168 
wpas_notify_roam_time(struct wpa_supplicant * wpa_s)169 void wpas_notify_roam_time(struct wpa_supplicant *wpa_s)
170 {
171 	if (wpa_s->p2p_mgmt)
172 		return;
173 
174 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ROAM_TIME);
175 }
176 
177 
wpas_notify_roam_complete(struct wpa_supplicant * wpa_s)178 void wpas_notify_roam_complete(struct wpa_supplicant *wpa_s)
179 {
180 	if (wpa_s->p2p_mgmt)
181 		return;
182 
183 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ROAM_COMPLETE);
184 }
185 
186 
wpas_notify_session_length(struct wpa_supplicant * wpa_s)187 void wpas_notify_session_length(struct wpa_supplicant *wpa_s)
188 {
189 	if (wpa_s->p2p_mgmt)
190 		return;
191 
192 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SESSION_LENGTH);
193 }
194 
195 
wpas_notify_bss_tm_status(struct wpa_supplicant * wpa_s)196 void wpas_notify_bss_tm_status(struct wpa_supplicant *wpa_s)
197 {
198 	if (wpa_s->p2p_mgmt)
199 		return;
200 
201 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_BSS_TM_STATUS);
202 
203 #ifdef CONFIG_WNM
204 	wpas_hidl_notify_bss_tm_status(wpa_s);
205 #endif
206 }
207 
208 
wpas_notify_network_changed(struct wpa_supplicant * wpa_s)209 void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
210 {
211 	if (wpa_s->p2p_mgmt)
212 		return;
213 
214 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_NETWORK);
215 }
216 
217 
wpas_notify_ap_scan_changed(struct wpa_supplicant * wpa_s)218 void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
219 {
220 	if (wpa_s->p2p_mgmt)
221 		return;
222 
223 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AP_SCAN);
224 }
225 
226 
wpas_notify_bssid_changed(struct wpa_supplicant * wpa_s)227 void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
228 {
229 	if (wpa_s->p2p_mgmt)
230 		return;
231 
232 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_BSS);
233 
234 	wpas_hidl_notify_bssid_changed(wpa_s);
235 }
236 
237 
wpas_notify_auth_changed(struct wpa_supplicant * wpa_s)238 void wpas_notify_auth_changed(struct wpa_supplicant *wpa_s)
239 {
240 	if (wpa_s->p2p_mgmt)
241 		return;
242 
243 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_AUTH_MODE);
244 }
245 
246 
wpas_notify_network_enabled_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)247 void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
248 					 struct wpa_ssid *ssid)
249 {
250 	if (wpa_s->p2p_mgmt)
251 		return;
252 
253 	wpas_dbus_signal_network_enabled_changed(wpa_s, ssid);
254 }
255 
256 
wpas_notify_network_selected(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)257 void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
258 				  struct wpa_ssid *ssid)
259 {
260 	if (wpa_s->p2p_mgmt)
261 		return;
262 
263 	wpas_dbus_signal_network_selected(wpa_s, ssid->id);
264 }
265 
266 
wpas_notify_network_request(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,enum wpa_ctrl_req_type rtype,const char * default_txt)267 void wpas_notify_network_request(struct wpa_supplicant *wpa_s,
268 				 struct wpa_ssid *ssid,
269 				 enum wpa_ctrl_req_type rtype,
270 				 const char *default_txt)
271 {
272 	if (wpa_s->p2p_mgmt)
273 		return;
274 
275 	wpas_dbus_signal_network_request(wpa_s, ssid, rtype, default_txt);
276 
277 	wpas_hidl_notify_network_request(wpa_s, ssid, rtype, default_txt);
278 }
279 
280 
wpas_notify_scanning(struct wpa_supplicant * wpa_s)281 void wpas_notify_scanning(struct wpa_supplicant *wpa_s)
282 {
283 	if (wpa_s->p2p_mgmt)
284 		return;
285 
286 	/* notify the new DBus API */
287 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SCANNING);
288 }
289 
290 
wpas_notify_scan_done(struct wpa_supplicant * wpa_s,int success)291 void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
292 {
293 	if (wpa_s->p2p_mgmt)
294 		return;
295 
296 	wpas_dbus_signal_scan_done(wpa_s, success);
297 }
298 
299 
wpas_notify_scan_results(struct wpa_supplicant * wpa_s)300 void wpas_notify_scan_results(struct wpa_supplicant *wpa_s)
301 {
302 	if (wpa_s->p2p_mgmt)
303 		return;
304 
305 	wpas_wps_notify_scan_results(wpa_s);
306 }
307 
308 
wpas_notify_wps_credential(struct wpa_supplicant * wpa_s,const struct wps_credential * cred)309 void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
310 				const struct wps_credential *cred)
311 {
312 	if (wpa_s->p2p_mgmt)
313 		return;
314 
315 #ifdef CONFIG_WPS
316 	/* notify the new DBus API */
317 	wpas_dbus_signal_wps_cred(wpa_s, cred);
318 #endif /* CONFIG_WPS */
319 }
320 
321 
wpas_notify_wps_event_m2d(struct wpa_supplicant * wpa_s,struct wps_event_m2d * m2d)322 void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
323 			       struct wps_event_m2d *m2d)
324 {
325 	if (wpa_s->p2p_mgmt)
326 		return;
327 
328 #ifdef CONFIG_WPS
329 	wpas_dbus_signal_wps_event_m2d(wpa_s, m2d);
330 #endif /* CONFIG_WPS */
331 }
332 
333 
wpas_notify_wps_event_fail(struct wpa_supplicant * wpa_s,struct wps_event_fail * fail)334 void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
335 				struct wps_event_fail *fail)
336 {
337 	if (wpa_s->p2p_mgmt)
338 		return;
339 
340 #ifdef CONFIG_WPS
341 	wpas_dbus_signal_wps_event_fail(wpa_s, fail);
342 
343 	wpas_hidl_notify_wps_event_fail(wpa_s, fail->peer_macaddr,
344 					fail->config_error,
345 					fail->error_indication);
346 #endif /* CONFIG_WPS */
347 }
348 
349 
wpas_notify_wps_event_success(struct wpa_supplicant * wpa_s)350 void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
351 {
352 	if (wpa_s->p2p_mgmt)
353 		return;
354 
355 #ifdef CONFIG_WPS
356 	wpas_dbus_signal_wps_event_success(wpa_s);
357 
358 	wpas_hidl_notify_wps_event_success(wpa_s);
359 #endif /* CONFIG_WPS */
360 }
361 
wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant * wpa_s)362 void wpas_notify_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
363 {
364 	if (wpa_s->p2p_mgmt)
365 		return;
366 
367 #ifdef CONFIG_WPS
368 	wpas_dbus_signal_wps_event_pbc_overlap(wpa_s);
369 
370 	wpas_hidl_notify_wps_event_pbc_overlap(wpa_s);
371 #endif /* CONFIG_WPS */
372 }
373 
374 
wpas_notify_network_added(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)375 void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
376 			       struct wpa_ssid *ssid)
377 {
378 	if (wpa_s->p2p_mgmt)
379 		return;
380 
381 	/*
382 	 * Networks objects created during any P2P activities should not be
383 	 * exposed out. They might/will confuse certain non-P2P aware
384 	 * applications since these network objects won't behave like
385 	 * regular ones.
386 	 */
387 	if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s) {
388 		wpas_dbus_register_network(wpa_s, ssid);
389 		wpas_hidl_register_network(wpa_s, ssid);
390 	}
391 }
392 
393 
wpas_notify_persistent_group_added(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)394 void wpas_notify_persistent_group_added(struct wpa_supplicant *wpa_s,
395 					struct wpa_ssid *ssid)
396 {
397 #ifdef CONFIG_P2P
398 	wpas_dbus_register_persistent_group(wpa_s, ssid);
399 	wpas_hidl_register_network(wpa_s, ssid);
400 #endif /* CONFIG_P2P */
401 }
402 
403 
wpas_notify_persistent_group_removed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)404 void wpas_notify_persistent_group_removed(struct wpa_supplicant *wpa_s,
405 					  struct wpa_ssid *ssid)
406 {
407 #ifdef CONFIG_P2P
408 	wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
409 	wpas_hidl_unregister_network(wpa_s, ssid);
410 #endif /* CONFIG_P2P */
411 }
412 
413 
wpas_notify_network_removed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)414 void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
415 				 struct wpa_ssid *ssid)
416 {
417 	if (wpa_s->next_ssid == ssid)
418 		wpa_s->next_ssid = NULL;
419 	if (wpa_s->wpa)
420 		wpa_sm_pmksa_cache_flush(wpa_s->wpa, ssid);
421 	if (!ssid->p2p_group && wpa_s->global->p2p_group_formation != wpa_s &&
422 	    !wpa_s->p2p_mgmt) {
423 		wpas_dbus_unregister_network(wpa_s, ssid->id);
424 		wpas_hidl_unregister_network(wpa_s, ssid);
425 	}
426 	if (network_is_persistent_group(ssid))
427 		wpas_notify_persistent_group_removed(wpa_s, ssid);
428 
429 	wpas_p2p_network_removed(wpa_s, ssid);
430 }
431 
432 
wpas_notify_bss_added(struct wpa_supplicant * wpa_s,u8 bssid[],unsigned int id)433 void wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
434 			   u8 bssid[], unsigned int id)
435 {
436 	if (wpa_s->p2p_mgmt)
437 		return;
438 
439 	wpas_dbus_register_bss(wpa_s, bssid, id);
440 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR,
441 		     id, MAC2STR(bssid));
442 }
443 
444 
wpas_notify_bss_removed(struct wpa_supplicant * wpa_s,u8 bssid[],unsigned int id)445 void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
446 			     u8 bssid[], unsigned int id)
447 {
448 	if (wpa_s->p2p_mgmt)
449 		return;
450 
451 	wpas_dbus_unregister_bss(wpa_s, bssid, id);
452 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR,
453 		     id, MAC2STR(bssid));
454 }
455 
456 
wpas_notify_bss_freq_changed(struct wpa_supplicant * wpa_s,unsigned int id)457 void wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
458 				  unsigned int id)
459 {
460 	if (wpa_s->p2p_mgmt)
461 		return;
462 
463 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
464 }
465 
466 
wpas_notify_bss_signal_changed(struct wpa_supplicant * wpa_s,unsigned int id)467 void wpas_notify_bss_signal_changed(struct wpa_supplicant *wpa_s,
468 				    unsigned int id)
469 {
470 	if (wpa_s->p2p_mgmt)
471 		return;
472 
473 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_SIGNAL,
474 					  id);
475 }
476 
477 
wpas_notify_bss_privacy_changed(struct wpa_supplicant * wpa_s,unsigned int id)478 void wpas_notify_bss_privacy_changed(struct wpa_supplicant *wpa_s,
479 				     unsigned int id)
480 {
481 	if (wpa_s->p2p_mgmt)
482 		return;
483 
484 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_PRIVACY,
485 					  id);
486 }
487 
488 
wpas_notify_bss_mode_changed(struct wpa_supplicant * wpa_s,unsigned int id)489 void wpas_notify_bss_mode_changed(struct wpa_supplicant *wpa_s,
490 				  unsigned int id)
491 {
492 	if (wpa_s->p2p_mgmt)
493 		return;
494 
495 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_MODE, id);
496 }
497 
498 
wpas_notify_bss_wpaie_changed(struct wpa_supplicant * wpa_s,unsigned int id)499 void wpas_notify_bss_wpaie_changed(struct wpa_supplicant *wpa_s,
500 				   unsigned int id)
501 {
502 	if (wpa_s->p2p_mgmt)
503 		return;
504 
505 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPA, id);
506 }
507 
508 
wpas_notify_bss_rsnie_changed(struct wpa_supplicant * wpa_s,unsigned int id)509 void wpas_notify_bss_rsnie_changed(struct wpa_supplicant *wpa_s,
510 				   unsigned int id)
511 {
512 	if (wpa_s->p2p_mgmt)
513 		return;
514 
515 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RSN, id);
516 }
517 
518 
wpas_notify_bss_wps_changed(struct wpa_supplicant * wpa_s,unsigned int id)519 void wpas_notify_bss_wps_changed(struct wpa_supplicant *wpa_s,
520 				 unsigned int id)
521 {
522 	if (wpa_s->p2p_mgmt)
523 		return;
524 
525 #ifdef CONFIG_WPS
526 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_WPS, id);
527 #endif /* CONFIG_WPS */
528 }
529 
530 
wpas_notify_bss_ies_changed(struct wpa_supplicant * wpa_s,unsigned int id)531 void wpas_notify_bss_ies_changed(struct wpa_supplicant *wpa_s,
532 				   unsigned int id)
533 {
534 	if (wpa_s->p2p_mgmt)
535 		return;
536 
537 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_IES, id);
538 }
539 
540 
wpas_notify_bss_rates_changed(struct wpa_supplicant * wpa_s,unsigned int id)541 void wpas_notify_bss_rates_changed(struct wpa_supplicant *wpa_s,
542 				   unsigned int id)
543 {
544 	if (wpa_s->p2p_mgmt)
545 		return;
546 
547 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_RATES, id);
548 }
549 
550 
wpas_notify_bss_seen(struct wpa_supplicant * wpa_s,unsigned int id)551 void wpas_notify_bss_seen(struct wpa_supplicant *wpa_s, unsigned int id)
552 {
553 	if (wpa_s->p2p_mgmt)
554 		return;
555 
556 	wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_AGE, id);
557 }
558 
559 
wpas_notify_blob_added(struct wpa_supplicant * wpa_s,const char * name)560 void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
561 {
562 	if (wpa_s->p2p_mgmt)
563 		return;
564 
565 	wpas_dbus_signal_blob_added(wpa_s, name);
566 }
567 
568 
wpas_notify_blob_removed(struct wpa_supplicant * wpa_s,const char * name)569 void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
570 {
571 	if (wpa_s->p2p_mgmt)
572 		return;
573 
574 	wpas_dbus_signal_blob_removed(wpa_s, name);
575 }
576 
577 
wpas_notify_debug_level_changed(struct wpa_global * global)578 void wpas_notify_debug_level_changed(struct wpa_global *global)
579 {
580 	wpas_dbus_signal_debug_level_changed(global);
581 }
582 
583 
wpas_notify_debug_timestamp_changed(struct wpa_global * global)584 void wpas_notify_debug_timestamp_changed(struct wpa_global *global)
585 {
586 	wpas_dbus_signal_debug_timestamp_changed(global);
587 }
588 
589 
wpas_notify_debug_show_keys_changed(struct wpa_global * global)590 void wpas_notify_debug_show_keys_changed(struct wpa_global *global)
591 {
592 	wpas_dbus_signal_debug_show_keys_changed(global);
593 }
594 
595 
wpas_notify_suspend(struct wpa_global * global)596 void wpas_notify_suspend(struct wpa_global *global)
597 {
598 	struct wpa_supplicant *wpa_s;
599 
600 	os_get_time(&global->suspend_time);
601 	wpa_printf(MSG_DEBUG, "System suspend notification");
602 	for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next)
603 		wpa_drv_suspend(wpa_s);
604 }
605 
606 
wpas_notify_resume(struct wpa_global * global)607 void wpas_notify_resume(struct wpa_global *global)
608 {
609 	struct os_time now;
610 	int slept;
611 	struct wpa_supplicant *wpa_s;
612 
613 	if (global->suspend_time.sec == 0)
614 		slept = -1;
615 	else {
616 		os_get_time(&now);
617 		slept = now.sec - global->suspend_time.sec;
618 	}
619 	wpa_printf(MSG_DEBUG, "System resume notification (slept %d seconds)",
620 		   slept);
621 
622 	for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
623 		wpa_drv_resume(wpa_s);
624 		if (wpa_s->wpa_state == WPA_DISCONNECTED)
625 			wpa_supplicant_req_scan(wpa_s, 0, 100000);
626 	}
627 }
628 
629 
630 #ifdef CONFIG_P2P
631 
wpas_notify_p2p_find_stopped(struct wpa_supplicant * wpa_s)632 void wpas_notify_p2p_find_stopped(struct wpa_supplicant *wpa_s)
633 {
634 	/* Notify P2P find has stopped */
635 	wpas_dbus_signal_p2p_find_stopped(wpa_s);
636 
637 	wpas_hidl_notify_p2p_find_stopped(wpa_s);
638 }
639 
640 
wpas_notify_p2p_device_found(struct wpa_supplicant * wpa_s,const u8 * addr,const struct p2p_peer_info * info,const u8 * peer_wfd_device_info,u8 peer_wfd_device_info_len,int new_device)641 void wpas_notify_p2p_device_found(struct wpa_supplicant *wpa_s,
642 				  const u8 *addr, const struct p2p_peer_info *info,
643 				  const u8* peer_wfd_device_info, u8 peer_wfd_device_info_len,
644 				  int new_device)
645 {
646 	if (new_device) {
647 		/* Create the new peer object */
648 		wpas_dbus_register_peer(wpa_s, info->p2p_device_addr);
649 	}
650 
651 	/* Notify a new peer has been detected*/
652 	wpas_dbus_signal_peer_device_found(wpa_s, info->p2p_device_addr);
653 
654 	wpas_hidl_notify_p2p_device_found(wpa_s, addr, info,
655 					  peer_wfd_device_info,
656 					  peer_wfd_device_info_len);
657 }
658 
659 
wpas_notify_p2p_device_lost(struct wpa_supplicant * wpa_s,const u8 * dev_addr)660 void wpas_notify_p2p_device_lost(struct wpa_supplicant *wpa_s,
661 				 const u8 *dev_addr)
662 {
663 	wpas_dbus_unregister_peer(wpa_s, dev_addr);
664 
665 	/* Create signal on interface object*/
666 	wpas_dbus_signal_peer_device_lost(wpa_s, dev_addr);
667 
668 	wpas_hidl_notify_p2p_device_lost(wpa_s, dev_addr);
669 }
670 
671 
wpas_notify_p2p_group_removed(struct wpa_supplicant * wpa_s,const struct wpa_ssid * ssid,const char * role)672 void wpas_notify_p2p_group_removed(struct wpa_supplicant *wpa_s,
673 				   const struct wpa_ssid *ssid,
674 				   const char *role)
675 {
676 	wpas_dbus_signal_p2p_group_removed(wpa_s, role);
677 
678 	wpas_dbus_unregister_p2p_group(wpa_s, ssid);
679 
680 	wpas_hidl_notify_p2p_group_removed(wpa_s, ssid, role);
681 }
682 
683 
wpas_notify_p2p_go_neg_req(struct wpa_supplicant * wpa_s,const u8 * src,u16 dev_passwd_id,u8 go_intent)684 void wpas_notify_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
685 				const u8 *src, u16 dev_passwd_id, u8 go_intent)
686 {
687 	wpas_dbus_signal_p2p_go_neg_req(wpa_s, src, dev_passwd_id, go_intent);
688 
689 	wpas_hidl_notify_p2p_go_neg_req(wpa_s, src, dev_passwd_id, go_intent);
690 }
691 
692 
wpas_notify_p2p_go_neg_completed(struct wpa_supplicant * wpa_s,struct p2p_go_neg_results * res)693 void wpas_notify_p2p_go_neg_completed(struct wpa_supplicant *wpa_s,
694 				      struct p2p_go_neg_results *res)
695 {
696 	wpas_dbus_signal_p2p_go_neg_resp(wpa_s, res);
697 
698 	wpas_hidl_notify_p2p_go_neg_completed(wpa_s, res);
699 }
700 
701 
wpas_notify_p2p_invitation_result(struct wpa_supplicant * wpa_s,int status,const u8 * bssid)702 void wpas_notify_p2p_invitation_result(struct wpa_supplicant *wpa_s,
703 				       int status, const u8 *bssid)
704 {
705 	wpas_dbus_signal_p2p_invitation_result(wpa_s, status, bssid);
706 
707 	wpas_hidl_notify_p2p_invitation_result(wpa_s, status, bssid);
708 }
709 
710 
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)711 void wpas_notify_p2p_sd_request(struct wpa_supplicant *wpa_s,
712 				int freq, const u8 *sa, u8 dialog_token,
713 				u16 update_indic, const u8 *tlvs,
714 				size_t tlvs_len)
715 {
716 	wpas_dbus_signal_p2p_sd_request(wpa_s, freq, sa, dialog_token,
717 					update_indic, tlvs, tlvs_len);
718 }
719 
720 
wpas_notify_p2p_sd_response(struct wpa_supplicant * wpa_s,const u8 * sa,u16 update_indic,const u8 * tlvs,size_t tlvs_len)721 void wpas_notify_p2p_sd_response(struct wpa_supplicant *wpa_s,
722 				 const u8 *sa, u16 update_indic,
723 				 const u8 *tlvs, size_t tlvs_len)
724 {
725 	wpas_dbus_signal_p2p_sd_response(wpa_s, sa, update_indic,
726 					 tlvs, tlvs_len);
727 
728 	wpas_hidl_notify_p2p_sd_response(wpa_s, sa, update_indic,
729 					 tlvs, tlvs_len);
730 }
731 
732 
733 /**
734  * wpas_notify_p2p_provision_discovery - Notification of provision discovery
735  * @dev_addr: Who sent the request or responded to our request.
736  * @request: Will be 1 if request, 0 for response.
737  * @status: Valid only in case of response (0 in case of success)
738  * @config_methods: WPS config methods
739  * @generated_pin: PIN to be displayed in case of WPS_CONFIG_DISPLAY method
740  *
741  * This can be used to notify:
742  * - Requests or responses
743  * - Various config methods
744  * - Failure condition in case of response
745  */
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)746 void wpas_notify_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
747 					 const u8 *dev_addr, int request,
748 					 enum p2p_prov_disc_status status,
749 					 u16 config_methods,
750 					 unsigned int generated_pin)
751 {
752 	wpas_dbus_signal_p2p_provision_discovery(wpa_s, dev_addr, request,
753 						 status, config_methods,
754 						 generated_pin);
755 
756 	wpas_hidl_notify_p2p_provision_discovery(wpa_s, dev_addr, request,
757 						 status, config_methods,
758 						 generated_pin);
759 
760 }
761 
762 
wpas_notify_p2p_group_started(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid,int persistent,int client,const u8 * ip)763 void wpas_notify_p2p_group_started(struct wpa_supplicant *wpa_s,
764 				   struct wpa_ssid *ssid, int persistent,
765 				   int client, const u8 *ip)
766 {
767 	/* Notify a group has been started */
768 	wpas_dbus_register_p2p_group(wpa_s, ssid);
769 
770 	wpas_dbus_signal_p2p_group_started(wpa_s, client, persistent, ip);
771 
772 	wpas_hidl_notify_p2p_group_started(wpa_s, ssid, persistent, client);
773 }
774 
775 
wpas_notify_p2p_group_formation_failure(struct wpa_supplicant * wpa_s,const char * reason)776 void wpas_notify_p2p_group_formation_failure(struct wpa_supplicant *wpa_s,
777 					     const char *reason)
778 {
779 	/* Notify a group formation failed */
780 	wpas_dbus_signal_p2p_group_formation_failure(wpa_s, reason);
781 
782 	wpas_hidl_notify_p2p_group_formation_failure(wpa_s, reason);
783 }
784 
785 
wpas_notify_p2p_wps_failed(struct wpa_supplicant * wpa_s,struct wps_event_fail * fail)786 void wpas_notify_p2p_wps_failed(struct wpa_supplicant *wpa_s,
787 				struct wps_event_fail *fail)
788 {
789 	wpas_dbus_signal_p2p_wps_failed(wpa_s, fail);
790 }
791 
792 
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)793 void wpas_notify_p2p_invitation_received(struct wpa_supplicant *wpa_s,
794 					 const u8 *sa, const u8 *go_dev_addr,
795 					 const u8 *bssid, int id, int op_freq)
796 {
797 	/* Notify a P2P Invitation Request */
798 	wpas_dbus_signal_p2p_invitation_received(wpa_s, sa, go_dev_addr, bssid,
799 						 id, op_freq);
800 
801 	wpas_hidl_notify_p2p_invitation_received(wpa_s, sa, go_dev_addr, bssid,
802 						 id, op_freq);
803 }
804 
805 #endif /* CONFIG_P2P */
806 
807 
wpas_notify_ap_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)808 static void wpas_notify_ap_sta_authorized(struct wpa_supplicant *wpa_s,
809 					  const u8 *sta,
810 					  const u8 *p2p_dev_addr)
811 {
812 #ifdef CONFIG_P2P
813 	wpas_p2p_notify_ap_sta_authorized(wpa_s, p2p_dev_addr);
814 
815 	/*
816 	 * Create 'peer-joined' signal on group object -- will also
817 	 * check P2P itself.
818 	 */
819 	if (p2p_dev_addr)
820 		wpas_dbus_signal_p2p_peer_joined(wpa_s, p2p_dev_addr);
821 #endif /* CONFIG_P2P */
822 
823 	/* Register the station */
824 	wpas_dbus_register_sta(wpa_s, sta);
825 
826 	/* Notify listeners a new station has been authorized */
827 	wpas_dbus_signal_sta_authorized(wpa_s, sta);
828 
829 	wpas_hidl_notify_ap_sta_authorized(wpa_s, sta, p2p_dev_addr);
830 }
831 
832 
wpas_notify_ap_sta_deauthorized(struct wpa_supplicant * wpa_s,const u8 * sta,const u8 * p2p_dev_addr)833 static void wpas_notify_ap_sta_deauthorized(struct wpa_supplicant *wpa_s,
834 					    const u8 *sta,
835 					    const u8 *p2p_dev_addr)
836 {
837 #ifdef CONFIG_P2P
838 	/*
839 	 * Create 'peer-disconnected' signal on group object if this
840 	 * is a P2P group.
841 	 */
842 	if (p2p_dev_addr)
843 		wpas_dbus_signal_p2p_peer_disconnected(wpa_s, p2p_dev_addr);
844 #endif /* CONFIG_P2P */
845 
846 	/* Notify listeners a station has been deauthorized */
847 	wpas_dbus_signal_sta_deauthorized(wpa_s, sta);
848 
849         wpas_hidl_notify_ap_sta_deauthorized(wpa_s, sta, p2p_dev_addr);
850 	/* Unregister the station */
851 	wpas_dbus_unregister_sta(wpa_s, sta);
852 }
853 
854 
wpas_notify_sta_authorized(struct wpa_supplicant * wpa_s,const u8 * mac_addr,int authorized,const u8 * p2p_dev_addr)855 void wpas_notify_sta_authorized(struct wpa_supplicant *wpa_s,
856 				const u8 *mac_addr, int authorized,
857 				const u8 *p2p_dev_addr)
858 {
859 	if (authorized)
860 		wpas_notify_ap_sta_authorized(wpa_s, mac_addr, p2p_dev_addr);
861 	else
862 		wpas_notify_ap_sta_deauthorized(wpa_s, mac_addr, p2p_dev_addr);
863 }
864 
865 
wpas_notify_certification(struct wpa_supplicant * wpa_s,struct tls_cert_data * cert,const char * cert_hash)866 void wpas_notify_certification(struct wpa_supplicant *wpa_s,
867 			       struct tls_cert_data *cert,
868 			       const char *cert_hash)
869 {
870 	int i;
871 
872 	wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_CERT
873 		"depth=%d subject='%s'%s%s%s%s",
874 		cert->depth, cert->subject, cert_hash ? " hash=" : "",
875 		cert_hash ? cert_hash : "",
876 		cert->tod == 2 ? " tod=2" : "",
877 		cert->tod == 1 ? " tod=1" : "");
878 
879 	if (cert->cert) {
880 		char *cert_hex;
881 		size_t len = wpabuf_len(cert->cert) * 2 + 1;
882 		cert_hex = os_malloc(len);
883 		if (cert_hex) {
884 			wpa_snprintf_hex(cert_hex, len, wpabuf_head(cert->cert),
885 					 wpabuf_len(cert->cert));
886 			wpa_msg_ctrl(wpa_s, MSG_INFO,
887 				     WPA_EVENT_EAP_PEER_CERT
888 				     "depth=%d subject='%s' cert=%s",
889 				     cert->depth, cert->subject, cert_hex);
890 			os_free(cert_hex);
891 		}
892 	}
893 
894 	for (i = 0; i < cert->num_altsubject; i++)
895 		wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_EAP_PEER_ALT
896 			"depth=%d %s", cert->depth, cert->altsubject[i]);
897 
898 	/* notify the new DBus API */
899 	wpas_dbus_signal_certification(wpa_s, cert->depth, cert->subject,
900 				       cert->altsubject, cert->num_altsubject,
901 				       cert_hash, cert->cert);
902 }
903 
904 
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)905 void wpas_notify_preq(struct wpa_supplicant *wpa_s,
906 		      const u8 *addr, const u8 *dst, const u8 *bssid,
907 		      const u8 *ie, size_t ie_len, u32 ssi_signal)
908 {
909 #ifdef CONFIG_AP
910 	wpas_dbus_signal_preq(wpa_s, addr, dst, bssid, ie, ie_len, ssi_signal);
911 #endif /* CONFIG_AP */
912 }
913 
914 
wpas_notify_eap_status(struct wpa_supplicant * wpa_s,const char * status,const char * parameter)915 void wpas_notify_eap_status(struct wpa_supplicant *wpa_s, const char *status,
916 			    const char *parameter)
917 {
918 	wpas_dbus_signal_eap_status(wpa_s, status, parameter);
919 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_EAP_STATUS
920 		     "status='%s' parameter='%s'",
921 		     status, parameter);
922 }
923 
924 
wpas_notify_eap_error(struct wpa_supplicant * wpa_s,int error_code)925 void wpas_notify_eap_error(struct wpa_supplicant *wpa_s, int error_code)
926 {
927 	wpa_dbg(wpa_s, MSG_ERROR,
928 		"EAP Error code = %d", error_code);
929 	wpas_hidl_notify_eap_error(wpa_s, error_code);
930 }
931 
932 
wpas_notify_network_bssid_set_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)933 void wpas_notify_network_bssid_set_changed(struct wpa_supplicant *wpa_s,
934 					   struct wpa_ssid *ssid)
935 {
936 	if (wpa_s->current_ssid != ssid)
937 		return;
938 
939 	wpa_dbg(wpa_s, MSG_DEBUG,
940 		"Network bssid config changed for the current network - within-ESS roaming %s",
941 		ssid->bssid_set ? "disabled" : "enabled");
942 
943 	wpa_drv_roaming(wpa_s, !ssid->bssid_set,
944 			ssid->bssid_set ? ssid->bssid : NULL);
945 }
946 
947 
wpas_notify_network_type_changed(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)948 void wpas_notify_network_type_changed(struct wpa_supplicant *wpa_s,
949 				      struct wpa_ssid *ssid)
950 {
951 #ifdef CONFIG_P2P
952 	if (ssid->disabled == 2) {
953 		/* Changed from normal network profile to persistent group */
954 		ssid->disabled = 0;
955 		wpas_dbus_unregister_network(wpa_s, ssid->id);
956 		ssid->disabled = 2;
957 		ssid->p2p_persistent_group = 1;
958 		wpas_dbus_register_persistent_group(wpa_s, ssid);
959 	} else {
960 		/* Changed from persistent group to normal network profile */
961 		wpas_dbus_unregister_persistent_group(wpa_s, ssid->id);
962 		ssid->p2p_persistent_group = 0;
963 		wpas_dbus_register_network(wpa_s, ssid);
964 	}
965 #endif /* CONFIG_P2P */
966 }
967 
wpas_notify_anqp_query_done(struct wpa_supplicant * wpa_s,const u8 * bssid,const char * result,const struct wpa_bss_anqp * anqp)968 void wpas_notify_anqp_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
969 				 const char *result,
970 				 const struct wpa_bss_anqp *anqp)
971 {
972 #ifdef CONFIG_INTERWORKING
973 	if (!wpa_s || !bssid || !anqp)
974 		return;
975 
976 	wpas_hidl_notify_anqp_query_done(wpa_s, bssid, result, anqp);
977 #endif /* CONFIG_INTERWORKING */
978 }
979 
wpas_notify_hs20_icon_query_done(struct wpa_supplicant * wpa_s,const u8 * bssid,const char * file_name,const u8 * image,u32 image_length)980 void wpas_notify_hs20_icon_query_done(struct wpa_supplicant *wpa_s, const u8* bssid,
981 				      const char* file_name, const u8* image,
982 				      u32 image_length)
983 {
984 #ifdef CONFIG_HS20
985 	if (!wpa_s || !bssid || !file_name || !image)
986 		return;
987 
988 	wpas_hidl_notify_hs20_icon_query_done(wpa_s, bssid, file_name, image,
989 					      image_length);
990 #endif /* CONFIG_HS20 */
991 }
992 
wpas_notify_hs20_rx_subscription_remediation(struct wpa_supplicant * wpa_s,const char * url,u8 osu_method)993 void wpas_notify_hs20_rx_subscription_remediation(struct wpa_supplicant *wpa_s,
994 						  const char* url,
995 						  u8 osu_method)
996 {
997 #ifdef CONFIG_HS20
998 	if (!wpa_s || !url)
999 		return;
1000 
1001 	wpas_hidl_notify_hs20_rx_subscription_remediation(wpa_s, url, osu_method);
1002 #endif /* CONFIG_HS20 */
1003 }
1004 
wpas_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant * wpa_s,u8 code,u16 reauth_delay,const char * url)1005 void wpas_notify_hs20_rx_deauth_imminent_notice(struct wpa_supplicant *wpa_s,
1006 						u8 code, u16 reauth_delay,
1007 						const char *url)
1008 {
1009 #ifdef CONFIG_HS20
1010 	if (!wpa_s || !url)
1011 		return;
1012 
1013 	wpas_hidl_notify_hs20_rx_deauth_imminent_notice(wpa_s, code, reauth_delay,
1014 							url);
1015 #endif /* CONFIG_HS20 */
1016 }
1017 
1018 
1019 #ifdef CONFIG_MESH
1020 
wpas_notify_mesh_group_started(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)1021 void wpas_notify_mesh_group_started(struct wpa_supplicant *wpa_s,
1022 				    struct wpa_ssid *ssid)
1023 {
1024 	if (wpa_s->p2p_mgmt)
1025 		return;
1026 
1027 	wpas_dbus_signal_mesh_group_started(wpa_s, ssid);
1028 }
1029 
1030 
wpas_notify_mesh_group_removed(struct wpa_supplicant * wpa_s,const u8 * meshid,u8 meshid_len,u16 reason_code)1031 void wpas_notify_mesh_group_removed(struct wpa_supplicant *wpa_s,
1032 				    const u8 *meshid, u8 meshid_len,
1033 				    u16 reason_code)
1034 {
1035 	if (wpa_s->p2p_mgmt)
1036 		return;
1037 
1038 	wpas_dbus_signal_mesh_group_removed(wpa_s, meshid, meshid_len,
1039 					    reason_code);
1040 }
1041 
1042 
wpas_notify_mesh_peer_connected(struct wpa_supplicant * wpa_s,const u8 * peer_addr)1043 void wpas_notify_mesh_peer_connected(struct wpa_supplicant *wpa_s,
1044 				     const u8 *peer_addr)
1045 {
1046 	if (wpa_s->p2p_mgmt)
1047 		return;
1048 
1049 	wpas_dbus_signal_mesh_peer_connected(wpa_s, peer_addr);
1050 }
1051 
1052 
wpas_notify_mesh_peer_disconnected(struct wpa_supplicant * wpa_s,const u8 * peer_addr,u16 reason_code)1053 void wpas_notify_mesh_peer_disconnected(struct wpa_supplicant *wpa_s,
1054 					const u8 *peer_addr, u16 reason_code)
1055 {
1056 	if (wpa_s->p2p_mgmt)
1057 		return;
1058 
1059 	wpas_dbus_signal_mesh_peer_disconnected(wpa_s, peer_addr, reason_code);
1060 }
1061 
1062 #endif /* CONFIG_MESH */
1063 
1064 /*
1065  * DPP Notifications
1066  */
1067 
1068 /* DPP Success notifications */
1069 
wpas_notify_dpp_config_received(struct wpa_supplicant * wpa_s,struct wpa_ssid * ssid)1070 void wpas_notify_dpp_config_received(struct wpa_supplicant *wpa_s,
1071 	    struct wpa_ssid *ssid)
1072 {
1073 #ifdef CONFIG_DPP
1074 	if (!wpa_s)
1075 		return;
1076 
1077 	wpas_hidl_notify_dpp_config_received(wpa_s, ssid);
1078 #endif /* CONFIG_DPP */
1079 }
1080 
wpas_notify_dpp_config_sent(struct wpa_supplicant * wpa_s)1081 void wpas_notify_dpp_config_sent(struct wpa_supplicant *wpa_s)
1082 {
1083 #ifdef CONFIG_DPP
1084 	if (!wpa_s)
1085 		return;
1086 
1087 	wpas_hidl_notify_dpp_config_sent(wpa_s);
1088 #endif /* CONFIG_DPP */
1089 }
1090 
1091 /* DPP Progress notifications */
wpas_notify_dpp_auth_success(struct wpa_supplicant * wpa_s)1092 void wpas_notify_dpp_auth_success(struct wpa_supplicant *wpa_s)
1093 {
1094 #ifdef CONFIG_DPP
1095 	if (!wpa_s)
1096 		return;
1097 
1098 	wpas_hidl_notify_dpp_auth_success(wpa_s);
1099 #endif /* CONFIG_DPP */
1100 }
1101 
wpas_notify_dpp_resp_pending(struct wpa_supplicant * wpa_s)1102 void wpas_notify_dpp_resp_pending(struct wpa_supplicant *wpa_s)
1103 {
1104 #ifdef CONFIG_DPP
1105 	if (!wpa_s)
1106 		return;
1107 
1108 	wpas_hidl_notify_dpp_resp_pending(wpa_s);
1109 #endif /* CONFIG_DPP */
1110 }
1111 
1112 /* DPP Failure notifications */
wpas_notify_dpp_not_compatible(struct wpa_supplicant * wpa_s)1113 void wpas_notify_dpp_not_compatible(struct wpa_supplicant *wpa_s)
1114 {
1115 #ifdef CONFIG_DPP
1116 	if (!wpa_s)
1117 		return;
1118 
1119 	wpas_hidl_notify_dpp_not_compatible(wpa_s);
1120 #endif /* CONFIG_DPP */
1121 }
1122 
wpas_notify_dpp_missing_auth(struct wpa_supplicant * wpa_s)1123 void wpas_notify_dpp_missing_auth(struct wpa_supplicant *wpa_s)
1124 {
1125 #ifdef CONFIG_DPP
1126 	if (!wpa_s)
1127 		return;
1128 
1129 	wpas_hidl_notify_dpp_missing_auth(wpa_s);
1130 #endif /* CONFIG_DPP */
1131 }
1132 
wpas_notify_dpp_configuration_failure(struct wpa_supplicant * wpa_s)1133 void wpas_notify_dpp_configuration_failure(struct wpa_supplicant *wpa_s)
1134 {
1135 #ifdef CONFIG_DPP
1136 	if (!wpa_s)
1137 		return;
1138 
1139 	wpas_hidl_notify_dpp_configuration_failure(wpa_s);
1140 #endif /* CONFIG_DPP */
1141 }
1142 
wpas_notify_dpp_timeout(struct wpa_supplicant * wpa_s)1143 void wpas_notify_dpp_timeout(struct wpa_supplicant *wpa_s)
1144 {
1145 #ifdef CONFIG_DPP
1146 	if (!wpa_s)
1147 		return;
1148 
1149 	wpas_hidl_notify_dpp_timeout(wpa_s);
1150 #endif /* CONFIG_DPP */
1151 }
1152 
wpas_notify_dpp_auth_failure(struct wpa_supplicant * wpa_s)1153 void wpas_notify_dpp_auth_failure(struct wpa_supplicant *wpa_s)
1154 {
1155 #ifdef CONFIG_DPP
1156 	if (!wpa_s)
1157 		return;
1158 
1159 	wpas_hidl_notify_dpp_auth_failure(wpa_s);
1160 #endif /* CONFIG_DPP */
1161 }
1162 
wpas_notify_dpp_failure(struct wpa_supplicant * wpa_s)1163 void wpas_notify_dpp_failure(struct wpa_supplicant *wpa_s)
1164 {
1165 #ifdef CONFIG_DPP
1166 	if (!wpa_s)
1167 		return;
1168 
1169 	wpas_hidl_notify_dpp_fail(wpa_s);
1170 #endif /* CONFIG_DPP */
1171 }
1172 
wpas_notify_dpp_config_sent_wait_response(struct wpa_supplicant * wpa_s)1173 void wpas_notify_dpp_config_sent_wait_response(struct wpa_supplicant *wpa_s)
1174 {
1175 #ifdef CONFIG_DPP2
1176 	wpas_hidl_notify_dpp_config_sent_wait_response(wpa_s);
1177 #endif /* CONFIG_DPP2 */
1178 }
1179 
wpas_notify_dpp_config_accepted(struct wpa_supplicant * wpa_s)1180 void wpas_notify_dpp_config_accepted(struct wpa_supplicant *wpa_s)
1181 {
1182 #ifdef CONFIG_DPP2
1183 	wpas_hidl_notify_dpp_config_accepted(wpa_s);
1184 #endif /* CONFIG_DPP2 */
1185 }
1186 
wpas_notify_dpp_conn_status(struct wpa_supplicant * wpa_s,enum dpp_status_error status,const char * ssid,const char * channel_list,unsigned short band_list[],int size)1187 void wpas_notify_dpp_conn_status(struct wpa_supplicant *wpa_s,
1188 		enum dpp_status_error status, const char *ssid,
1189 		const char *channel_list, unsigned short band_list[], int size)
1190 {
1191 #ifdef CONFIG_DPP2
1192 	wpas_hidl_notify_dpp_conn_status(wpa_s, status, ssid, channel_list, band_list, size);
1193 #endif /* CONFIG_DPP2 */
1194 }
1195 
wpas_notify_dpp_config_rejected(struct wpa_supplicant * wpa_s)1196 void wpas_notify_dpp_config_rejected(struct wpa_supplicant *wpa_s)
1197 {
1198 #ifdef CONFIG_DPP2
1199 	wpas_hidl_notify_dpp_config_rejected(wpa_s);
1200 #endif /* CONFIG_DPP2 */
1201 }
1202 
wpas_notify_pmk_cache_added(struct wpa_supplicant * wpa_s,struct rsn_pmksa_cache_entry * entry)1203 void wpas_notify_pmk_cache_added(struct wpa_supplicant *wpa_s,
1204 				 struct rsn_pmksa_cache_entry *entry)
1205 {
1206 	if (!wpa_s)
1207 		return;
1208 
1209 	wpas_hidl_notify_pmk_cache_added(wpa_s, entry);
1210 }
1211