[PATCH 3/5] P2P: Reduce off channel wait time for P2P action frames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Avraham Stern <avraham.stern@xxxxxxxxx>

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 frames wait times as follows:

 1. For GO negotiation response frame, shorten the wait time to 100ms.
    This is reasonable because the peer has just sent us the GO
    negotiation request, so it is known to be on the right channel
    and is probably ready to send us the GO negotiation confirmation
    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 50ms to ensure there is enough time to send the
    frame.

Signed-off-by: Avraham Stern <avraham.stern@xxxxxxxxx>
---
 src/p2p/p2p_go_neg.c     | 4 ++--
 src/p2p/p2p_invitation.c | 2 +-
 src/p2p/p2p_pd.c         | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index 049ce6e..fe0096f 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -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);
diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c
index 70da15a..bbba001 100644
--- a/src/p2p/p2p_invitation.c
+++ b/src/p2p/p2p_invitation.c
@@ -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");
 	}
 
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index d70a43c..e6535d4 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -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;
-- 
1.9.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux