OSDN Git Service

wpa_supplicant: Update to BRCM version 0.8.0-38
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 4 Sep 2012 18:06:50 +0000 (11:06 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Wed, 5 Sep 2012 00:23:06 +0000 (17:23 -0700)
- Restore p2p_group_formation pointer till the 4-way handshake
  completes for the p2p client

Change-Id: I976659ae5dac4cf01ecdd7995ff9abb6bf914bc1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
wpa_supplicant/p2p_supplicant.c

index 3dc633c..55cb243 100644 (file)
@@ -621,6 +621,12 @@ static void wpas_group_formation_completed(struct wpa_supplicant *wpa_s,
                 * packets.
                 */
                wpa_s->show_group_started = 1;
+#ifdef ANDROID_P2P
+               /* For client Second phase of Group formation (4-way handshake) can be still pending
+                * So we need to restore wpa_s->global->p2p_group_formation */
+               wpa_s->global->p2p_group_formation = wpa_s;
+#endif
+
        } else if (ssid && ssid->passphrase == NULL && ssid->psk_set) {
                char psk[65];
                wpa_snprintf_hex(psk, sizeof(psk), ssid->psk, 32);
@@ -4881,9 +4887,28 @@ int wpas_p2p_disconnect(struct wpa_supplicant *wpa_s)
 
 int wpas_p2p_in_progress(struct wpa_supplicant *wpa_s)
 {
+#ifdef ANDROID_P2P
+       struct wpa_supplicant *group = wpa_s;
+#endif
+
        if (wpa_s->global->p2p_disabled || wpa_s->global->p2p == NULL)
                return 0;
 
+#ifdef ANDROID_P2P
+       while (group && (group->p2p_group_interface != NOT_P2P_GROUP_INTERFACE)) {
+               if(group->wpa_state == WPA_ASSOCIATED) {
+                       /* WPA_ASSOCIATED hasn't moved to WPA_COMPLETED. So it could be in WPS
+                        * or 4Way Hanshake phase. Avoid allowing scan during this time critical
+                        * phase
+                        */
+                       wpa_printf(MSG_ERROR, "P2P: WPS/4way handshake in Progress."
+                       " Defer SCAN ");
+                       return 1;
+               }
+               group = group->next;
+       }
+#endif
+
        return p2p_in_progress(wpa_s->global->p2p);
 }