]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Reduce the idle time in Wait peer connect state
authorNeeraj Kumar Garg <neerajkg@broadcom.com>
Sun, 18 Dec 2011 16:01:11 +0000 (18:01 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 18 Dec 2011 16:01:11 +0000 (18:01 +0200)
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 Negotiation process slow.

We wait for 1 second idle and then listen for a random time between
100(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 Negotiation
frame just at the boundary of 300 ms of P1 and assume that P2 takes
close to 600-800 ms for one iteration of sending go_neg request (one
iteration is GO Negotiation 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 500 ms. Alternatively we can
increase the listen time interval to 500 ms just for WAIT_PEER_CONNECT
state.

src/p2p/p2p.c

index 665b7804bd9c4c053c7e9efad4cb46f669b17782..c0009ce74288c204a70f74d485367a80aa0f9be8 100644 (file)
@@ -2828,7 +2828,7 @@ static void p2p_timeout_wait_peer_connect(struct p2p_data *p2p)
         * state once per second to give other uses a chance to use the radio.
         */
        p2p_set_state(p2p, P2P_WAIT_PEER_IDLE);
-       p2p_set_timeout(p2p, 1, 0);
+       p2p_set_timeout(p2p, 0, 500000);
 }