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