[PATCH 3/3] group_remove_notification if disassoc is sent from GO Signed-off-by: root <root at neeraj-ubuntu64.(none)>

root (none) root at neeraj-ubuntu64.
Fri Oct 21 04:44:41 EDT 2011


---
 wpa_supplicant/events.c         |    3 +++
 wpa_supplicant/p2p_supplicant.c |   14 ++++++++++++++
 wpa_supplicant/p2p_supplicant.h |    2 ++
 3 files changed, 19 insertions(+), 0 deletions(-)
 mode change 100644 =3D> 100755 wpa_supplicant/events.c
 mode change 100644 =3D> 100755 wpa_supplicant/p2p_supplicant.h

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
old mode 100644
new mode 100755
index 4ec935e..e00ad75
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1908,6 +1908,9 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_t=
ype event,
 		}
 #endif /* CONFIG_AP */
 		wpa_supplicant_event_disassoc(wpa_s, reason_code);
+#ifdef CONFIG_P2P
+		wpas_p2p_group_remove_notif(wpa_s, reason_code);
+#endif
 		break;
 	case EVENT_MICHAEL_MIC_FAILURE:
 		wpa_supplicant_event_michael_mic_failure(wpa_s, data);
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplican=
t.c
index 2935e81..7c78eb0 100755
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3749,7 +3749,21 @@ void wpas_p2p_deauth_notif(struct wpa_supplicant *wp=
a_s, const u8 *bssid,
=20
 	p2p_deauth_notif(wpa_s->global->p2p, bssid, reason_code, ie, ie_len);
 }
+void wpas_p2p_group_remove_notif(struct wpa_supplicant *wpa_s, u16 reason_=
code)
+{
+	if(wpa_s->global->p2p_disabled)
+		return;
+
+	/* If we are running a P2P Client and we received a Deauth/Disassoc from =
the Go, then remove
+	   the virutal interface on which the client is running. */
+	if((wpa_s !=3D wpa_s->parent) && (wpa_s->p2p_group_interface =3D=3D P2P_G=
ROUP_INTERFACE_CLIENT) && (wpa_s->key_mgmt !=3D WPA_KEY_MGMT_WPS)) {
=20
+		wpa_printf(MSG_DEBUG, "P2P: [EVENT_DEAUTH] Removing P2P_CLIENT virtual i=
ntf.");
+		wpa_supplicant_cancel_scan(wpa_s);
+		wpa_s->removal_reason =3D P2P_GROUP_REMOVAL_UNAVAILABLE;
+		wpas_p2p_group_delete(wpa_s);
+	}
+}
=20
 void wpas_p2p_disassoc_notif(struct wpa_supplicant *wpa_s, const u8 *bssid=
,
 			     u16 reason_code, const u8 *ie, size_t ie_len)
diff --git a/wpa_supplicant/p2p_supplicant.h b/wpa_supplicant/p2p_supplican=
t.h
old mode 100644
new mode 100755
index 9a13f9f..3387722
--- a/wpa_supplicant/p2p_supplicant.h
+++ b/wpa_supplicant/p2p_supplicant.h
@@ -109,6 +109,8 @@ int wpas_p2p_ext_listen(struct wpa_supplicant *wpa_s, u=
nsigned int period,
 			unsigned int interval);
 void wpas_p2p_deauth_notif(struct wpa_supplicant *wpa_s, const u8 *bssid,
 			   u16 reason_code, const u8 *ie, size_t ie_len);
+void wpas_p2p_group_remove_notif(struct wpa_supplicant *wpa_s,
+				u16 reason_code);
 void wpas_p2p_disassoc_notif(struct wpa_supplicant *wpa_s, const u8 *bssid=
,
 			     u16 reason_code, const u8 *ie, size_t ie_len);
 void wpas_p2p_update_config(struct wpa_supplicant *wpa_s);
--=20
1.7.4.1=20
=20
Regards,
-Neeraj



More information about the HostAP mailing list