P2P: Remove GO neg/invite special cases from search

There are separate states for these, so we can't really get into this
situation unless somebody tries to do multiple things at the same
time. p2p_connect stops find and CONNECT state is used to probe the peer
on its Listen channel with GO Negotiation Request frames. Similarly,
p2p_invite() stops find and INVITE state is used to probe the peer on
its Listen channel with Invitation Request frames. The older mechanism
of using Search state functionality to find the peer can be removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2012-06-30 20:18:07 +03:00 committed by Jouni Malinen
parent d001defeec
commit e6ecfc4fd3

View file

@ -808,33 +808,8 @@ static void p2p_search(struct p2p_data *p2p)
}
p2p->cfg->stop_listen(p2p->cfg->cb_ctx);
if (p2p->go_neg_peer) {
/*
* Only scan the known listen frequency of the peer
* during GO Negotiation start.
*/
freq = p2p->go_neg_peer->listen_freq;
if (freq <= 0)
freq = p2p->go_neg_peer->oper_freq;
type = P2P_SCAN_SPECIFIC;
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Starting search "
"for freq %u (GO Neg)", freq);
/* Advertise immediate availability of WPS credential */
pw_id = p2p_wps_method_pw_id(p2p->go_neg_peer->wps_method);
} else if (p2p->invite_peer) {
/*
* Only scan the known listen frequency of the peer
* during Invite start.
*/
freq = p2p->invite_peer->listen_freq;
if (freq <= 0)
freq = p2p->invite_peer->oper_freq;
type = P2P_SCAN_SPECIFIC;
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Starting search "
"for freq %u (Invite)", freq);
} else if (p2p->find_type == P2P_FIND_PROGRESSIVE &&
(freq = p2p_get_next_prog_freq(p2p)) > 0) {
if (p2p->find_type == P2P_FIND_PROGRESSIVE &&
(freq = p2p_get_next_prog_freq(p2p)) > 0) {
type = P2P_SCAN_SOCIAL_PLUS_ONE;
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Starting search "
"(+ freq %u)", freq);
@ -2653,16 +2628,6 @@ int p2p_scan_res_handler(struct p2p_data *p2p, const u8 *bssid, int freq,
{
p2p_add_device(p2p, bssid, freq, level, ies, ies_len, 1);
if (p2p->go_neg_peer && p2p->state == P2P_SEARCH &&
os_memcmp(p2p->go_neg_peer->info.p2p_device_addr, bssid, ETH_ALEN)
== 0) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Found GO Negotiation peer - try to start GO "
"negotiation");
p2p_connect_send(p2p, p2p->go_neg_peer);
return 1;
}
return 0;
}