P2P: Indicate frequency for upper layer invitation processing
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 1 Mar 2013 19:27:31 +0000 (21:27 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 1 Mar 2013 19:27:31 +0000 (21:27 +0200)
When a device that is a GO in a persistent group receives an Invitation
Request from a P2P client and persistent_reconnect=0, upper layer is
notified of this with P2P-INVITATION-RECEIVED event. The upper layer is
supposed to run another invitation exchange is this case, but if that
does not happen and the GO is started without successful (status=0)
invitation exchange, the operating channel for the group may end up
getting set in a way that the P2P client is not able to support. Provide
optional freq parameter in the P2P-INVITATION-RECEIVED event on the GO
side. If this parameter is received and the upper layer decides to issue
P2P_GROUP_ADD command, that command should include this freq parameter
to make sure the operating channel gets selected from the set that the
peer can support.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

wpa_supplicant/p2p_supplicant.c

index 9cb7af2..1d5e5f2 100644 (file)
@@ -2476,8 +2476,14 @@ static void wpas_invitation_received(void *ctx, const u8 *sa, const u8 *bssid,
                return;
        }
 
-       wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED "sa=" MACSTR
-               " persistent=%d", MAC2STR(sa), s->id);
+       if (s->mode == WPAS_MODE_P2P_GO && op_freq) {
+               wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED "sa="
+                       MACSTR " persistent=%d freq=%d",
+                       MAC2STR(sa), s->id, op_freq);
+       } else {
+               wpa_msg(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RECEIVED "sa="
+                       MACSTR " persistent=%d", MAC2STR(sa), s->id);
+       }
 }