]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Reduce off channel wait time for some P2P Action frames
authorAvraham Stern <avraham.stern@intel.com>
Mon, 25 Jan 2016 10:28:48 +0000 (12:28 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 6 Feb 2016 16:19:03 +0000 (18:19 +0200)
Setting a long off channel wait time for P2P Action frames when
we know we are already on the right channel may cause a delay in
sending the Action frame (because the driver may not be able to
satisfy the request for long wait time until previous off channel
requests are over). This may be crucial for P2P response frames
that must be sent within 100 milliseconds of receiving the request.

Fix this by adjusting P2P Action frame wait times as follows:

 1. For GO Negotiation Response frame, shorten the wait time to 100 ms.
    This is reasonable because the peer has just sent us the GO
    Negotiation Request frame, so it is known to be on the right
    channel and is probably ready to send us the GO Negotiation
    Confirmation frame without delay.
 2. For GO Negotiation Confirmation, P2P Invitation Response, and
    Provision Discovery Response frames, there is no need for wait
    time at all as this is the last frame in the exchange. So set
    the wait time to 50 ms to ensure there is enough time to send the
    frame.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
src/p2p/p2p_go_neg.c
src/p2p/p2p_invitation.c
src/p2p/p2p_pd.c

index 049ce6e93f5b5e7da1dc2ef689c7ad22884014c6..fe0096f14c9029ee74e5901e06bf9967239be509 100644 (file)
@@ -1060,7 +1060,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), 500) < 0) {
+                           wpabuf_head(resp), wpabuf_len(resp), 100) < 0) {
                p2p_dbg(p2p, "Failed to send Action frame");
        }
 
@@ -1394,7 +1394,7 @@ fail:
 
        if (p2p_send_action(p2p, freq, sa, p2p->cfg->dev_addr, sa,
                            wpabuf_head(dev->go_neg_conf),
-                           wpabuf_len(dev->go_neg_conf), 200) < 0) {
+                           wpabuf_len(dev->go_neg_conf), 50) < 0) {
                p2p_dbg(p2p, "Failed to send Action frame");
                p2p_go_neg_failed(p2p, -1);
                p2p->cfg->send_action_done(p2p->cfg->cb_ctx);
index 70da15a964d60c7805147687846e0be286acbf6f..bbba001a7c93035842144acf7e5c49e5e4d04748 100644 (file)
@@ -418,7 +418,7 @@ fail:
        p2p->pending_action_state = P2P_PENDING_INVITATION_RESPONSE;
        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), 50) < 0) {
                p2p_dbg(p2p, "Failed to send Action frame");
        }
 
index d70a43c2d8d8f3cb1cffaa660f0becb70dfb4648..e6535d411bcd87cc3f30cc7dc9ecfd70bb6398b4 100644 (file)
@@ -997,7 +997,7 @@ out:
                if (p2p_send_action(p2p, freq, sa, p2p->cfg->dev_addr,
                                    p2p->cfg->dev_addr,
                                    wpabuf_head(resp), wpabuf_len(resp),
-                                   200) < 0)
+                                   50) < 0)
                        p2p_dbg(p2p, "Failed to send Action frame");
                else
                        p2p->send_action_in_progress = 1;