From 8d82c2105bd8d6b689adfd67498e3c958cacf06e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 20 Oct 2013 18:06:15 +0300 Subject: [PATCH] P2P: Fix PD retry channel on join-a-group case Join-a-group needs to force the current operating channel of the target group as the frequency to use for the PD exchange. When the channel was selected based on a BSS entry for the GO, this worked only for the first PD Request frame while the retries reverted to a potentially different channel based on a P2P peer entry. Fix this by maintaining the forced channel through the PD retry sequence. Signed-hostap: Jouni Malinen --- src/p2p/p2p.c | 3 ++- src/p2p/p2p_i.h | 8 ++++++++ src/p2p/p2p_pd.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 178a8f6da..9b7744c00 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -2664,7 +2664,8 @@ static void p2p_retry_pd(struct p2p_data *p2p) MAC2STR(dev->info.p2p_device_addr), dev->req_config_methods); p2p_send_prov_disc_req(p2p, dev, - dev->flags & P2P_DEV_PD_FOR_JOIN, 0); + dev->flags & P2P_DEV_PD_FOR_JOIN, + p2p->pd_force_freq); return; } } diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h index 6e57f45a8..e12e6f0e6 100644 --- a/src/p2p/p2p_i.h +++ b/src/p2p/p2p_i.h @@ -442,6 +442,14 @@ struct p2p_data { */ int pd_retries; + /** + * pd_force_freq - Forced frequency for PD retries or 0 to auto-select + * + * This is is used during PD retries for join-a-group case to use the + * correct operating frequency determined from a BSS entry for the GO. + */ + int pd_force_freq; + u8 go_timeout; u8 client_timeout; diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c index 54aa42828..409405fb2 100644 --- a/src/p2p/p2p_pd.c +++ b/src/p2p/p2p_pd.c @@ -437,6 +437,7 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr, } p2p->user_initiated_pd = user_initiated_pd; + p2p->pd_force_freq = force_freq; if (p2p->user_initiated_pd) p2p->pd_retries = MAX_PROV_DISC_REQ_RETRIES; @@ -472,4 +473,5 @@ void p2p_reset_pending_pd(struct p2p_data *p2p) p2p->user_initiated_pd = 0; os_memset(p2p->pending_pd_devaddr, 0, ETH_ALEN); p2p->pd_retries = 0; + p2p->pd_force_freq = 0; }