From e6ecfc4fd3856309b2e1b9e0d23a8635752666e2 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 30 Jun 2012 20:18:07 +0300 Subject: [PATCH] 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 --- src/p2p/p2p.c | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 5b1af43db..35dc195e6 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -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; }