P2P fixes for BRCM

1. Fix for stopping any on-going P2P-FIND, while doing a P2P-GROUP-ADD.
2. Fix for Supplicant crash. The crash was due to socket being closed
   during P2P-GROUP-REMOVE.
3. Append P2P DEV ADDR during AP-STA-CONNECTED Event for P2P Devices.
   For legacy STA, the event format would remain the same.
BUG: b/5262575

Change-Id: I8faf2159d35538fd07e42dba82d367b581cf2164
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index d8b2e16..12dae34 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -3294,6 +3294,12 @@
 	if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
 		return -1;
 
+#ifdef ANDROID_BRCM_P2P_PATCH
+	/* Make sure we are not running find during connection establishment */
+	wpa_printf(MSG_DEBUG, "P2P: Stopping P2P FIND, if any");
+	wpas_p2p_stop_find(wpa_s);
+#endif
+
 	if (freq == 2) {
 		wpa_printf(MSG_DEBUG, "P2P: Request to start GO on 2.4 GHz "
 			   "band");