From cd1e2309a2ae5bf29d2bbdf798224e1a06feadef Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 1 Mar 2013 21:27:31 +0200 Subject: [PATCH] P2P: Indicate frequency for upper layer invitation processing 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 --- wpa_supplicant/p2p_supplicant.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index 9cb7af2cc..1d5e5f274 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -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); + } }