ies) < 0) {
p2p_dbg(p2p, "Failed to start listen mode");
p2p->pending_listen_freq = 0;
+ } else {
+ p2p->pending_listen_wait_drv = true;
}
wpabuf_free(ies);
}
wpabuf_free(ies);
return -1;
}
+ p2p->pending_listen_wait_drv = true;
wpabuf_free(ies);
p2p_set_state(p2p, P2P_LISTEN_ONLY);
return;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
if (p2p->find_pending_full &&
(p2p->find_type == P2P_FIND_PROGRESSIVE ||
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p->find_pending_full = 0;
p2p->find_type = type;
if (freq != 2412 && freq != 2437 && freq != 2462 && freq != 60480)
void p2p_stop_listen_for_freq(struct p2p_data *p2p, int freq)
{
+ p2p_dbg(p2p,
+ "%s(freq=%d) pending_listen_freq=%d in_listen=%d drv_in_listen=%d",
+ __func__, freq, p2p->pending_listen_freq, p2p->in_listen,
+ p2p->drv_in_listen);
if (freq > 0 &&
((p2p->drv_in_listen == freq && p2p->in_listen) ||
p2p->pending_listen_freq == (unsigned int) freq)) {
p2p_dbg(p2p, "Clear drv_in_listen (%d)", p2p->drv_in_listen);
p2p->drv_in_listen = 0;
}
+ if (p2p->pending_listen_freq &&
+ p2p->pending_listen_freq != (unsigned int) freq &&
+ !p2p->drv_in_listen && p2p->pending_listen_wait_drv) {
+ p2p_dbg(p2p,
+ "Clear pending_listen_freq since the started listen did not complete before being stopped");
+ p2p->pending_listen_freq = 0;
+ }
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
}
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p->go_neg_peer->status = P2P_SC_SUCCESS;
/*
* Set new timeout to make sure a previously set one does not expire
p2p->pending_listen_freq = 0;
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
p2p_invite_send(p2p, p2p->invite_peer, p2p->invite_go_dev_addr,
p2p->invite_dev_pw_id);
}
p2p_dbg(p2p, "Starting Listen timeout(%u,%u) on freq=%u based on callback",
p2p->pending_listen_sec, p2p->pending_listen_usec,
p2p->pending_listen_freq);
+ p2p->pending_listen_wait_drv = false;
p2p->in_listen = 1;
p2p->drv_in_listen = freq;
if (p2p->pending_listen_sec || p2p->pending_listen_usec) {
p2p_dbg(p2p, "Go to Listen state while waiting for the peer to become ready for GO Negotiation");
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
if (p2p->pending_listen_freq) {
p2p_dbg(p2p, "Clear pending_listen_freq for %s", __func__);
p2p->pending_listen_freq = 0;
if (p2p->drv_in_listen) {
p2p_dbg(p2p, "Driver is still in listen state - stop it");
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
+ p2p->pending_listen_wait_drv = false;
}
switch (p2p->state) {