aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-10-27 16:36:10 (GMT)
committerJouni Malinen <j@w1.fi>2010-10-27 16:36:10 (GMT)
commit10c4edde6e4e060778adbf59ff7c294303dc205b (patch)
treee9ccac1cce9b6e5f76fb9a495b3ee18d22fdd7bc /src
parent58e54293dbcae5b20eea42381e609011002139fc (diff)
downloadhostap-10c4edde6e4e060778adbf59ff7c294303dc205b.zip
hostap-10c4edde6e4e060778adbf59ff7c294303dc205b.tar.gz
hostap-10c4edde6e4e060778adbf59ff7c294303dc205b.tar.bz2
P2P: Do not re-send PD Request for join-a-group after acked frame
We are not actually interested in the PD Response in join-a-group case, so there is no point in trying to send PD Request until the response is received. This avoids an extra PD getting started after a join-a-group operation in some cases.
Diffstat (limited to 'src')
-rw-r--r--src/p2p/p2p.c14
-rw-r--r--src/p2p/p2p_i.h1
-rw-r--r--src/p2p/p2p_pd.c4
3 files changed, 16 insertions, 3 deletions
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 5f112ab..d060de8 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -1920,7 +1920,13 @@ void p2p_continue_find(struct p2p_data *p2p)
return;
else
break;
- } else if (dev->req_config_methods) {
+ } else if (dev->req_config_methods &&
+ !(dev->flags & P2P_DEV_PD_FOR_JOIN)) {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Send "
+ "pending Provisioning Discovery Request to "
+ MACSTR " (config methods 0x%x)",
+ MAC2STR(dev->p2p_device_addr),
+ dev->req_config_methods);
if (p2p_send_prov_disc_req(p2p, dev, 0) == 0)
return;
}
@@ -2543,7 +2549,7 @@ int p2p_get_peer_info(struct p2p_data *p2p, const u8 *addr, int next,
"country=%c%c\n"
"oper_freq=%d\n"
"req_config_methods=0x%x\n"
- "flags=%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n"
+ "flags=%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n"
"status=%d\n"
"wait_count=%u\n"
"invitation_reqs=%u\n",
@@ -2593,7 +2599,9 @@ int p2p_get_peer_info(struct p2p_data *p2p, const u8 *addr, int next,
dev->flags & P2P_DEV_GROUP_CLIENT_ONLY ?
"[GROUP_CLIENT_ONLY]" : "",
dev->flags & P2P_DEV_FORCE_FREQ ?
- "[FORCE_FREQ" : "",
+ "[FORCE_FREQ]" : "",
+ dev->flags & P2P_DEV_PD_FOR_JOIN ?
+ "[PD_FOR_JOIN]" : "",
dev->status,
dev->wait_count,
dev->invitation_reqs);
diff --git a/src/p2p/p2p_i.h b/src/p2p/p2p_i.h
index b87a3ef..be05a84 100644
--- a/src/p2p/p2p_i.h
+++ b/src/p2p/p2p_i.h
@@ -93,6 +93,7 @@ struct p2p_device {
#define P2P_DEV_WAIT_GO_NEG_CONFIRM BIT(11)
#define P2P_DEV_GROUP_CLIENT_ONLY BIT(12)
#define P2P_DEV_FORCE_FREQ BIT(13)
+#define P2P_DEV_PD_FOR_JOIN BIT(14)
unsigned int flags;
int status; /* enum p2p_status_code */
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 5f76750..55341aa 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -327,6 +327,10 @@ int p2p_prov_disc_req(struct p2p_data *p2p, const u8 *peer_addr,
return -1;
dev->req_config_methods = config_methods;
+ if (join)
+ dev->flags |= P2P_DEV_PD_FOR_JOIN;
+ else
+ dev->flags &= ~P2P_DEV_PD_FOR_JOIN;
if (p2p->go_neg_peer ||
(p2p->state != P2P_IDLE && p2p->state != P2P_SEARCH &&