if (p2p->cfg->invitation_result)
p2p->cfg->invitation_result(
p2p->cfg->cb_ctx, -1, NULL, NULL,
- p2p->invite_peer->info.p2p_device_addr);
+ p2p->invite_peer->info.p2p_device_addr,
+ 0);
}
p2p_set_state(p2p, P2P_IDLE);
}
* @bssid: P2P Group BSSID or %NULL if not received
* @channels: Available operating channels for the group
* @addr: Peer address
+ * @freq: Frequency (in MHz) indicated during invitation or 0
*
* This callback is used to indicate result of an Invitation procedure
* started with a call to p2p_invite(). The indicated status code is
*/
void (*invitation_result)(void *ctx, int status, const u8 *bssid,
const struct p2p_channels *channels,
- const u8 *addr);
+ const u8 *addr, int freq);
/**
* go_connected - Check whether we are connected to a GO
channels = &intersection;
}
- if (p2p->cfg->invitation_result)
+ if (p2p->cfg->invitation_result) {
+ int freq = p2p_channel_to_freq(p2p->op_reg_class,
+ p2p->op_channel);
+ if (freq < 0)
+ freq = 0;
p2p->cfg->invitation_result(p2p->cfg->cb_ctx, *msg.status,
- msg.group_bssid, channels, sa);
+ msg.group_bssid, channels, sa,
+ freq);
+ }
p2p_parse_free(&msg);
static void wpas_invitation_result(void *ctx, int status, const u8 *bssid,
const struct p2p_channels *channels,
- const u8 *peer)
+ const u8 *peer, int neg_freq)
{
struct wpa_supplicant *wpa_s = ctx;
struct wpa_ssid *ssid;
+ int freq;
if (bssid) {
wpa_msg_global(wpa_s, MSG_INFO, P2P_EVENT_INVITATION_RESULT
"starting persistent group");
os_sleep(0, 50000);
+ freq = wpa_s->p2p_persistent_go_freq;
+ if (neg_freq > 0 && ssid->mode == WPAS_MODE_P2P_GO &&
+ freq_included(channels, neg_freq)) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use frequence %d MHz from invitation for GO mode",
+ neg_freq);
+ freq = neg_freq;
+ }
+
wpas_p2p_group_add_persistent(wpa_s, ssid,
ssid->mode == WPAS_MODE_P2P_GO,
- wpa_s->p2p_persistent_go_freq,
+ freq,
wpa_s->p2p_go_ht40, wpa_s->p2p_go_vht,
channels,
ssid->mode == WPAS_MODE_P2P_GO ?