[PATCH] P2P: Reduce the idle time of Wait in Wait peer connect state or increase the listen time

Neeraj Kumar Garg neerajkg
Mon Dec 12 02:09:26 PST 2011

When waiting for go_neg frame from the peer in WAIT_PEER_CONNECT state, I have observed that sometimes it takes 20 to 30 secs for successful go negotiation. I also found out that it is because of 1 second idle time, in WAIT_PEER_CONNECT state. While it is good to have 1 second idle time [for doing power-save or doing some other legacy STA Scan or some other useful stuff], this makes go-neg process slow.

We wait for 1 second idle and then listen for a random time between 200(min)-300(max)ms. Assume P1 is in WAIT_PEER_CONNECT state and P2 is the one which is now to send go_neg frame. If P2 sends Go-neg frame just at the boundary of 300ms of P1 and assume that P2 takes close to 600-800ms for one iteration of sending go_neg request (one iteration is go_neg_request frame time + dwell time + listen_time), P2 needs to transmit at least 16-18 action frames for hitting the listen time of P1.

Following patch reduces the idle time to 500ms. Alternatively we can increase the listen time interval to 500ms just for WAIT_PEER_CONNECT state. Please let me know which approach we should take
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
@@ -326,7 +326,7 @@ static void p2p_timeout_wait_peer_connect(struct p2p_data *p2p) 
-	p2p_set_timeout(p2p, 1, 0); 
+ 	p2p_set_timeout(p2p, 0, 500000); 


More information about the Hostap mailing list