|
@@ -2553,6 +2553,21 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
|
|
|
wpa_msg(wpa_s, MSG_INFO, "Failed to initialize the "
|
|
|
"driver after interface was added");
|
|
|
}
|
|
|
+
|
|
|
+#ifdef CONFIG_P2P
|
|
|
+ if (!wpa_s->global->p2p &&
|
|
|
+ !wpa_s->global->p2p_disabled &&
|
|
|
+ !wpa_s->conf->p2p_disabled &&
|
|
|
+ (wpa_s->drv_flags &
|
|
|
+ WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) &&
|
|
|
+ wpas_p2p_add_p2pdev_interface(
|
|
|
+ wpa_s, wpa_s->global->params.conf_p2p_dev) < 0) {
|
|
|
+ wpa_printf(MSG_INFO,
|
|
|
+ "P2P: Failed to enable P2P Device interface");
|
|
|
+ /* Try to continue without. P2P will be disabled. */
|
|
|
+ }
|
|
|
+#endif /* CONFIG_P2P */
|
|
|
+
|
|
|
break;
|
|
|
case EVENT_INTERFACE_REMOVED:
|
|
|
wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was removed");
|
|
@@ -2561,6 +2576,21 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
|
|
|
wpa_supplicant_set_state(wpa_s, WPA_INTERFACE_DISABLED);
|
|
|
l2_packet_deinit(wpa_s->l2);
|
|
|
wpa_s->l2 = NULL;
|
|
|
+
|
|
|
+#ifdef CONFIG_P2P
|
|
|
+ if (wpa_s->global->p2p &&
|
|
|
+ wpa_s->global->p2p_init_wpa_s->parent == wpa_s &&
|
|
|
+ (wpa_s->drv_flags &
|
|
|
+ WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE)) {
|
|
|
+ wpa_dbg(wpa_s, MSG_DEBUG,
|
|
|
+ "Removing P2P Device interface");
|
|
|
+ wpa_supplicant_remove_iface(
|
|
|
+ wpa_s->global, wpa_s->global->p2p_init_wpa_s,
|
|
|
+ 0);
|
|
|
+ wpa_s->global->p2p_init_wpa_s = NULL;
|
|
|
+ }
|
|
|
+#endif /* CONFIG_P2P */
|
|
|
+
|
|
|
#ifdef CONFIG_TERMINATE_ONLASTIF
|
|
|
/* check if last interface */
|
|
|
if (!any_interfaces(wpa_s->global->ifaces))
|