aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-18 15:21:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-18 15:21:25 (GMT)
commit1ef2f7ffcf8c58725be57ad5022a7991f1cc6e4c (patch)
treee65a40bc17b9c823d90b191ebeeb0f118bb1f6ef /src
parent19030351b95f48714007e425eaa2163d9122d788 (diff)
downloadhostap-1ef2f7ffcf8c58725be57ad5022a7991f1cc6e4c.zip
hostap-1ef2f7ffcf8c58725be57ad5022a7991f1cc6e4c.tar.gz
hostap-1ef2f7ffcf8c58725be57ad5022a7991f1cc6e4c.tar.bz2
P2P: Fix Provision Discovery channel for some join-GO cases
The Provision Discovery Request needs to be sent on the operating channel of the GO and as such, the frequency from the BSS table (scan results) need to override the frequency in the P2P peer table that could be based on the Listen channel of the GO. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/p2p/p2p.c4
-rw-r--r--src/p2p/p2p.h3
-rw-r--r--src/p2p/p2p_i.h2
-rw-r--r--src/p2p/p2p_pd.c12
4 files changed, 13 insertions, 8 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 2b0c486..665b780 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2373,7 +2373,7 @@ void p2p_continue_find(struct p2p_data *p2p)
MACSTR " (config methods 0x%x)",
MAC2STR(dev->info.p2p_device_addr),
dev->req_config_methods);
- if (p2p_send_prov_disc_req(p2p, dev, 0) == 0)
+ if (p2p_send_prov_disc_req(p2p, dev, 0, 0) == 0)
return;
}
}
@@ -2442,7 +2442,7 @@ static void p2p_retry_pd(struct p2p_data *p2p)
MACSTR " (config methods 0x%x)",
MAC2STR(dev->info.p2p_device_addr),
dev->req_config_methods);
- p2p_send_prov_disc_req(p2p, dev, 0);
+ p2p_send_prov_disc_req(p2p, dev, 0, 0);
return;
}
}
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 0b24f7f..6a640ab 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -897,6 +897,7 @@ int p2p_reject(struct p2p_data *p2p, const u8 *peer_addr);
* @peer_addr: MAC address of the peer P2P client
* @config_methods: WPS Config Methods value (only one bit set)
* @join: Whether this is used by a client joining an active group
+ * @force_freq: Forced TX frequency for the frame (mainly for the join case)
* Returns: 0 on success, -1 on failure
*
* This function can be used to request a discovered P2P peer to display a PIN
@@ -908,7 +909,7 @@ int p2p_reject(struct p2p_data *p2p, const u8 *peer_addr);
* indicated with the p2p_config::prov_disc_resp() callback.
*/
int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
- u16 config_methods, int join);
+ u16 config_methods, int join, int force_freq);
/**
* p2p_sd_request - Schedule a service discovery query
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index 4a4751b..0dc33e7 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -619,7 +619,7 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
void p2p_process_prov_disc_resp(struct p2p_data *p2p, const u8 *sa,
const u8 *data, size_t len);
int p2p_send_prov_disc_req(struct p2p_data *p2p, struct p2p_device *dev,
- int join);
+ int join, int force_freq);
void p2p_reset_pending_pd(struct p2p_data *p2p);
/* p2p_invitation.c */
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 6409454..790334f 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -283,12 +283,16 @@ out:
int p2p_send_prov_disc_req(struct p2p_data *p2p, struct p2p_device *dev,
- int join)
+ int join, int force_freq)
{
struct wpabuf *req;
int freq;
- freq = dev->listen_freq > 0 ? dev->listen_freq : dev->oper_freq;
+ if (force_freq > 0)
+ freq = force_freq;
+ else
+ freq = dev->listen_freq > 0 ? dev->listen_freq :
+ dev->oper_freq;
if (freq <= 0) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: No Listen/Operating frequency known for the "
@@ -336,7 +340,7 @@ int p2p_send_prov_disc_req(struct p2p_data *p2p, struct p2p_device *dev,
int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
- u16 config_methods, int join)
+ u16 config_methods, int join, int force_freq)
{
struct p2p_device *dev;
@@ -385,7 +389,7 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
if (p2p->user_initiated_pd && p2p->state == P2P_IDLE)
p2p->pd_retries = MAX_PROV_DISC_REQ_RETRIES;
- return p2p_send_prov_disc_req(p2p, dev, join);
+ return p2p_send_prov_disc_req(p2p, dev, join, force_freq);
}