]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Increase GO Negotiation timeouts
authorJouni Malinen <j@w1.fi>
Sat, 11 Aug 2012 18:14:57 +0000 (21:14 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 11 Aug 2012 18:14:57 +0000 (21:14 +0300)
p2p_set_timeout() calls in GO Neg Req/Resp TX callbacks used timeout of
100 ms which is the value given in the P2P specification for GO
Negotiation, but this was actually shorter than the
wait-for-offchannel-TX value (200 ms) used for the driver call. In
addition, it looks like some devices (e.g., Galaxy Nexus with JB image)
can take longer time to reply to GO Negotiation Response (somewhere
between 200 and 250 ms has been observed).

Increase the wait-for-GO-Neg-Resp timeout from 100 ms to 200 ms if GO
Negotiation Request frame was acknowledged (this matches with the
offchannel wait timeout that used previously). The no-ack case is left
at 100 ms since we use GO Negotiation Request frame also to discover
whether the peer is on its Listen channel.

Increase the wait-for-GO-Neg-Conf timeout from 100 ms to 250 ms (and
increase the offchannel wait timeout to matching 250 ms) as a workaround
for devices that take over 200 ms to reply to GO Negotiation Response.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/p2p/p2p.c
src/p2p/p2p_go_neg.c

index f1d43459aa930fe72b1702136aa45122f4251aa8..80b345ad2a375fb9fa19bb532c10cd0d4eceec97 100644 (file)
@@ -2726,7 +2726,7 @@ static void p2p_go_neg_req_cb(struct p2p_data *p2p, int success)
         * channel.
         */
        p2p_set_state(p2p, P2P_CONNECT);
-       p2p_set_timeout(p2p, 0, 100000);
+       p2p_set_timeout(p2p, 0, success ? 200000 : 100000);
 }
 
 
@@ -2742,7 +2742,7 @@ static void p2p_go_neg_resp_cb(struct p2p_data *p2p, int success)
                return;
        }
        p2p_set_state(p2p, P2P_CONNECT);
-       p2p_set_timeout(p2p, 0, 100000);
+       p2p_set_timeout(p2p, 0, 250000);
 }
 
 
index 248b2a069f4311d178167c2f24b1e0128785bdce..8d74cfb276127b6b123addf3648791343c2f881b 100644 (file)
@@ -692,7 +692,7 @@ fail:
                        P2P_PENDING_GO_NEG_RESPONSE_FAILURE;
        if (p2p_send_action(p2p, freq, sa, p2p->cfg->dev_addr,
                            p2p->cfg->dev_addr,
-                           wpabuf_head(resp), wpabuf_len(resp), 200) < 0) {
+                           wpabuf_head(resp), wpabuf_len(resp), 250) < 0) {
                wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
                        "P2P: Failed to send Action frame");
        }